Skip to main content

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, Eq, Hash, Ord, PartialEq, PartialOrd)]
58pub struct DeviceMonitorWatchPhyEventsRequest {
59    pub watcher: fidl::endpoints::ServerEnd<PhyEventWatcherMarker>,
60}
61
62impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
63    for DeviceMonitorWatchPhyEventsRequest
64{
65}
66
67#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
68pub struct DeviceMonitorMarker;
69
70impl fidl::endpoints::ProtocolMarker for DeviceMonitorMarker {
71    type Proxy = DeviceMonitorProxy;
72    type RequestStream = DeviceMonitorRequestStream;
73    #[cfg(target_os = "fuchsia")]
74    type SynchronousProxy = DeviceMonitorSynchronousProxy;
75
76    const DEBUG_NAME: &'static str = "fuchsia.wlan.device.service.DeviceMonitor";
77}
78impl fidl::endpoints::DiscoverableProtocolMarker for DeviceMonitorMarker {}
79pub type DeviceMonitorGetSupportedMacRolesResult =
80    Result<Vec<fidl_fuchsia_wlan_common::WlanMacRole>, i32>;
81pub type DeviceMonitorGetCountryResult = Result<GetCountryResponse, i32>;
82pub type DeviceMonitorGetPowerSaveModeResult = Result<GetPowerSaveModeResponse, i32>;
83pub type DeviceMonitorPowerDownResult = Result<(), i32>;
84pub type DeviceMonitorPowerUpResult = Result<(), i32>;
85pub type DeviceMonitorResetResult = Result<(), i32>;
86pub type DeviceMonitorSetTxPowerScenarioResult = Result<(), i32>;
87pub type DeviceMonitorResetTxPowerScenarioResult = Result<(), i32>;
88pub type DeviceMonitorGetTxPowerScenarioResult =
89    Result<fidl_fuchsia_wlan_internal::TxPowerScenario, i32>;
90pub type DeviceMonitorGetPowerStateResult = Result<bool, i32>;
91pub type DeviceMonitorSetBtCoexistenceModeResult = Result<(), i32>;
92pub type DeviceMonitorCreateIfaceResult =
93    Result<DeviceMonitorCreateIfaceResponse, DeviceMonitorError>;
94pub type DeviceMonitorQueryIfaceResult = Result<QueryIfaceResponse, i32>;
95pub type DeviceMonitorQueryIfaceCapabilitiesResult =
96    Result<fidl_fuchsia_wlan_common::ApfPacketFilterSupport, i32>;
97pub type DeviceMonitorGetClientSmeResult = Result<(), i32>;
98pub type DeviceMonitorGetApSmeResult = Result<(), i32>;
99pub type DeviceMonitorGetSmeTelemetryResult = Result<(), i32>;
100
101pub trait DeviceMonitorProxyInterface: Send + Sync {
102    type ListPhysResponseFut: std::future::Future<Output = Result<Vec<u16>, fidl::Error>> + Send;
103    fn r#list_phys(&self) -> Self::ListPhysResponseFut;
104    type ListIfacesResponseFut: std::future::Future<Output = Result<Vec<u16>, fidl::Error>> + Send;
105    fn r#list_ifaces(&self) -> Self::ListIfacesResponseFut;
106    type GetDevPathResponseFut: std::future::Future<Output = Result<Option<String>, fidl::Error>>
107        + Send;
108    fn r#get_dev_path(&self, phy_id: u16) -> Self::GetDevPathResponseFut;
109    type GetSupportedMacRolesResponseFut: std::future::Future<Output = Result<DeviceMonitorGetSupportedMacRolesResult, fidl::Error>>
110        + Send;
111    fn r#get_supported_mac_roles(&self, phy_id: u16) -> Self::GetSupportedMacRolesResponseFut;
112    fn r#watch_devices(
113        &self,
114        watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
115    ) -> Result<(), fidl::Error>;
116    fn r#watch_phy_events(
117        &self,
118        watcher: fidl::endpoints::ServerEnd<PhyEventWatcherMarker>,
119    ) -> Result<(), fidl::Error>;
120    type GetCountryResponseFut: std::future::Future<Output = Result<DeviceMonitorGetCountryResult, fidl::Error>>
121        + Send;
122    fn r#get_country(&self, phy_id: u16) -> Self::GetCountryResponseFut;
123    type SetCountryResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
124    fn r#set_country(&self, req: &SetCountryRequest) -> Self::SetCountryResponseFut;
125    type ClearCountryResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
126    fn r#clear_country(&self, req: &ClearCountryRequest) -> Self::ClearCountryResponseFut;
127    type SetPowerSaveModeResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
128    fn r#set_power_save_mode(
129        &self,
130        req: &SetPowerSaveModeRequest,
131    ) -> Self::SetPowerSaveModeResponseFut;
132    type GetPowerSaveModeResponseFut: std::future::Future<Output = Result<DeviceMonitorGetPowerSaveModeResult, fidl::Error>>
133        + Send;
134    fn r#get_power_save_mode(&self, phy_id: u16) -> Self::GetPowerSaveModeResponseFut;
135    type PowerDownResponseFut: std::future::Future<Output = Result<DeviceMonitorPowerDownResult, fidl::Error>>
136        + Send;
137    fn r#power_down(&self, phy_id: u16) -> Self::PowerDownResponseFut;
138    type PowerUpResponseFut: std::future::Future<Output = Result<DeviceMonitorPowerUpResult, fidl::Error>>
139        + Send;
140    fn r#power_up(&self, phy_id: u16) -> Self::PowerUpResponseFut;
141    type ResetResponseFut: std::future::Future<Output = Result<DeviceMonitorResetResult, fidl::Error>>
142        + Send;
143    fn r#reset(&self, phy_id: u16) -> Self::ResetResponseFut;
144    type SetTxPowerScenarioResponseFut: std::future::Future<Output = Result<DeviceMonitorSetTxPowerScenarioResult, fidl::Error>>
145        + Send;
146    fn r#set_tx_power_scenario(
147        &self,
148        phy_id: u16,
149        scenario: fidl_fuchsia_wlan_internal::TxPowerScenario,
150    ) -> Self::SetTxPowerScenarioResponseFut;
151    type ResetTxPowerScenarioResponseFut: std::future::Future<Output = Result<DeviceMonitorResetTxPowerScenarioResult, fidl::Error>>
152        + Send;
153    fn r#reset_tx_power_scenario(&self, phy_id: u16) -> Self::ResetTxPowerScenarioResponseFut;
154    type GetTxPowerScenarioResponseFut: std::future::Future<Output = Result<DeviceMonitorGetTxPowerScenarioResult, fidl::Error>>
155        + Send;
156    fn r#get_tx_power_scenario(&self, phy_id: u16) -> Self::GetTxPowerScenarioResponseFut;
157    type GetPowerStateResponseFut: std::future::Future<Output = Result<DeviceMonitorGetPowerStateResult, fidl::Error>>
158        + Send;
159    fn r#get_power_state(&self, phy_id: u16) -> Self::GetPowerStateResponseFut;
160    type SetBtCoexistenceModeResponseFut: std::future::Future<Output = Result<DeviceMonitorSetBtCoexistenceModeResult, fidl::Error>>
161        + Send;
162    fn r#set_bt_coexistence_mode(
163        &self,
164        phy_id: u16,
165        mode: fidl_fuchsia_wlan_internal::BtCoexistenceMode,
166    ) -> Self::SetBtCoexistenceModeResponseFut;
167    type CreateIfaceResponseFut: std::future::Future<Output = Result<DeviceMonitorCreateIfaceResult, fidl::Error>>
168        + Send;
169    fn r#create_iface(
170        &self,
171        payload: &DeviceMonitorCreateIfaceRequest,
172    ) -> Self::CreateIfaceResponseFut;
173    type QueryIfaceResponseFut: std::future::Future<Output = Result<DeviceMonitorQueryIfaceResult, fidl::Error>>
174        + Send;
175    fn r#query_iface(&self, iface_id: u16) -> Self::QueryIfaceResponseFut;
176    type DestroyIfaceResponseFut: std::future::Future<Output = Result<i32, fidl::Error>> + Send;
177    fn r#destroy_iface(&self, req: &DestroyIfaceRequest) -> Self::DestroyIfaceResponseFut;
178    type QueryIfaceCapabilitiesResponseFut: std::future::Future<Output = Result<DeviceMonitorQueryIfaceCapabilitiesResult, fidl::Error>>
179        + Send;
180    fn r#query_iface_capabilities(&self, iface_id: u16) -> Self::QueryIfaceCapabilitiesResponseFut;
181    type GetClientSmeResponseFut: std::future::Future<Output = Result<DeviceMonitorGetClientSmeResult, fidl::Error>>
182        + Send;
183    fn r#get_client_sme(
184        &self,
185        iface_id: u16,
186        sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
187    ) -> Self::GetClientSmeResponseFut;
188    type GetApSmeResponseFut: std::future::Future<Output = Result<DeviceMonitorGetApSmeResult, fidl::Error>>
189        + Send;
190    fn r#get_ap_sme(
191        &self,
192        iface_id: u16,
193        sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
194    ) -> Self::GetApSmeResponseFut;
195    type GetSmeTelemetryResponseFut: std::future::Future<Output = Result<DeviceMonitorGetSmeTelemetryResult, fidl::Error>>
196        + Send;
197    fn r#get_sme_telemetry(
198        &self,
199        iface_id: u16,
200        telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
201    ) -> Self::GetSmeTelemetryResponseFut;
202}
203#[derive(Debug)]
204#[cfg(target_os = "fuchsia")]
205pub struct DeviceMonitorSynchronousProxy {
206    client: fidl::client::sync::Client,
207}
208
209#[cfg(target_os = "fuchsia")]
210impl fidl::endpoints::SynchronousProxy for DeviceMonitorSynchronousProxy {
211    type Proxy = DeviceMonitorProxy;
212    type Protocol = DeviceMonitorMarker;
213
214    fn from_channel(inner: fidl::Channel) -> Self {
215        Self::new(inner)
216    }
217
218    fn into_channel(self) -> fidl::Channel {
219        self.client.into_channel()
220    }
221
222    fn as_channel(&self) -> &fidl::Channel {
223        self.client.as_channel()
224    }
225}
226
227#[cfg(target_os = "fuchsia")]
228impl DeviceMonitorSynchronousProxy {
229    pub fn new(channel: fidl::Channel) -> Self {
230        let protocol_name = <DeviceMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
231        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
232    }
233
234    pub fn into_channel(self) -> fidl::Channel {
235        self.client.into_channel()
236    }
237
238    /// Waits until an event arrives and returns it. It is safe for other
239    /// threads to make concurrent requests while waiting for an event.
240    pub fn wait_for_event(
241        &self,
242        deadline: zx::MonotonicInstant,
243    ) -> Result<DeviceMonitorEvent, fidl::Error> {
244        DeviceMonitorEvent::decode(self.client.wait_for_event(deadline)?)
245    }
246
247    pub fn r#list_phys(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<u16>, fidl::Error> {
248        let _response =
249            self.client.send_query::<fidl::encoding::EmptyPayload, DeviceMonitorListPhysResponse>(
250                (),
251                0x3a08518874196aab,
252                fidl::encoding::DynamicFlags::empty(),
253                ___deadline,
254            )?;
255        Ok(_response.phy_list)
256    }
257
258    pub fn r#list_ifaces(
259        &self,
260        ___deadline: zx::MonotonicInstant,
261    ) -> Result<Vec<u16>, fidl::Error> {
262        let _response = self
263            .client
264            .send_query::<fidl::encoding::EmptyPayload, DeviceMonitorListIfacesResponse>(
265                (),
266                0x129e758fb8e0b113,
267                fidl::encoding::DynamicFlags::empty(),
268                ___deadline,
269            )?;
270        Ok(_response.iface_list)
271    }
272
273    pub fn r#get_dev_path(
274        &self,
275        mut phy_id: u16,
276        ___deadline: zx::MonotonicInstant,
277    ) -> Result<Option<String>, fidl::Error> {
278        let _response = self
279            .client
280            .send_query::<DeviceMonitorGetDevPathRequest, DeviceMonitorGetDevPathResponse>(
281                (phy_id,),
282                0x4aa489b57113bccf,
283                fidl::encoding::DynamicFlags::empty(),
284                ___deadline,
285            )?;
286        Ok(_response.dev_path)
287    }
288
289    pub fn r#get_supported_mac_roles(
290        &self,
291        mut phy_id: u16,
292        ___deadline: zx::MonotonicInstant,
293    ) -> Result<DeviceMonitorGetSupportedMacRolesResult, fidl::Error> {
294        let _response = self.client.send_query::<
295            DeviceMonitorGetSupportedMacRolesRequest,
296            fidl::encoding::ResultType<DeviceMonitorGetSupportedMacRolesResponse, i32>,
297        >(
298            (phy_id,),
299            0x172b3d2eabd5a14e,
300            fidl::encoding::DynamicFlags::empty(),
301            ___deadline,
302        )?;
303        Ok(_response.map(|x| x.supported_mac_roles))
304    }
305
306    pub fn r#watch_devices(
307        &self,
308        mut watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
309    ) -> Result<(), fidl::Error> {
310        self.client.send::<DeviceMonitorWatchDevicesRequest>(
311            (watcher,),
312            0x4615941e67e31b8e,
313            fidl::encoding::DynamicFlags::empty(),
314        )
315    }
316
317    pub fn r#watch_phy_events(
318        &self,
319        mut watcher: fidl::endpoints::ServerEnd<PhyEventWatcherMarker>,
320    ) -> Result<(), fidl::Error> {
321        self.client.send::<DeviceMonitorWatchPhyEventsRequest>(
322            (watcher,),
323            0x2c5af9d064099745,
324            fidl::encoding::DynamicFlags::empty(),
325        )
326    }
327
328    pub fn r#get_country(
329        &self,
330        mut phy_id: u16,
331        ___deadline: zx::MonotonicInstant,
332    ) -> Result<DeviceMonitorGetCountryResult, fidl::Error> {
333        let _response = self.client.send_query::<
334            DeviceMonitorGetCountryRequest,
335            fidl::encoding::ResultType<DeviceMonitorGetCountryResponse, i32>,
336        >(
337            (phy_id,),
338            0x6f1040bd81bde90e,
339            fidl::encoding::DynamicFlags::empty(),
340            ___deadline,
341        )?;
342        Ok(_response.map(|x| x.resp))
343    }
344
345    pub fn r#set_country(
346        &self,
347        mut req: &SetCountryRequest,
348        ___deadline: zx::MonotonicInstant,
349    ) -> Result<i32, fidl::Error> {
350        let _response = self
351            .client
352            .send_query::<DeviceMonitorSetCountryRequest, DeviceMonitorSetCountryResponse>(
353                (req,),
354                0xdaa7b77a5a6e71b,
355                fidl::encoding::DynamicFlags::empty(),
356                ___deadline,
357            )?;
358        Ok(_response.status)
359    }
360
361    pub fn r#clear_country(
362        &self,
363        mut req: &ClearCountryRequest,
364        ___deadline: zx::MonotonicInstant,
365    ) -> Result<i32, fidl::Error> {
366        let _response = self
367            .client
368            .send_query::<DeviceMonitorClearCountryRequest, DeviceMonitorClearCountryResponse>(
369                (req,),
370                0x66714d61103120e9,
371                fidl::encoding::DynamicFlags::empty(),
372                ___deadline,
373            )?;
374        Ok(_response.status)
375    }
376
377    pub fn r#set_power_save_mode(
378        &self,
379        mut req: &SetPowerSaveModeRequest,
380        ___deadline: zx::MonotonicInstant,
381    ) -> Result<i32, fidl::Error> {
382        let _response = self.client.send_query::<
383            DeviceMonitorSetPowerSaveModeRequest,
384            DeviceMonitorSetPowerSaveModeResponse,
385        >(
386            (req,),
387            0x62202b4d360533bc,
388            fidl::encoding::DynamicFlags::empty(),
389            ___deadline,
390        )?;
391        Ok(_response.status)
392    }
393
394    pub fn r#get_power_save_mode(
395        &self,
396        mut phy_id: u16,
397        ___deadline: zx::MonotonicInstant,
398    ) -> Result<DeviceMonitorGetPowerSaveModeResult, fidl::Error> {
399        let _response = self.client.send_query::<
400            DeviceMonitorGetPowerSaveModeRequest,
401            fidl::encoding::ResultType<DeviceMonitorGetPowerSaveModeResponse, i32>,
402        >(
403            (phy_id,),
404            0x14304d406ada8693,
405            fidl::encoding::DynamicFlags::empty(),
406            ___deadline,
407        )?;
408        Ok(_response.map(|x| x.resp))
409    }
410
411    /// All interfaces should be deleted before calling this method. If supported, the
412    /// wlan driver will power down the wlan chip. Refer to wlan.phyimpl fidl for more details.
413    pub fn r#power_down(
414        &self,
415        mut phy_id: u16,
416        ___deadline: zx::MonotonicInstant,
417    ) -> Result<DeviceMonitorPowerDownResult, fidl::Error> {
418        let _response = self.client.send_query::<
419            DeviceMonitorPowerDownRequest,
420            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
421        >(
422            (phy_id,),
423            0x374ad717fe8902e0,
424            fidl::encoding::DynamicFlags::empty(),
425            ___deadline,
426        )?;
427        Ok(_response.map(|x| x))
428    }
429
430    /// If supported, the wlan driver will power up the wlan chip. Refer to wlan.phyimpl fidl
431    /// for more details.
432    pub fn r#power_up(
433        &self,
434        mut phy_id: u16,
435        ___deadline: zx::MonotonicInstant,
436    ) -> Result<DeviceMonitorPowerUpResult, fidl::Error> {
437        let _response = self.client.send_query::<
438            DeviceMonitorPowerUpRequest,
439            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
440        >(
441            (phy_id,),
442            0xa2379b639869c17,
443            fidl::encoding::DynamicFlags::empty(),
444            ___deadline,
445        )?;
446        Ok(_response.map(|x| x))
447    }
448
449    /// If supported, the wlan driver will reset the wlan chip. An attempt is made to delete
450    /// any existing interfaces. Refer to wlan.phyimpl fidl for more details.
451    pub fn r#reset(
452        &self,
453        mut phy_id: u16,
454        ___deadline: zx::MonotonicInstant,
455    ) -> Result<DeviceMonitorResetResult, fidl::Error> {
456        let _response = self.client.send_query::<
457            DeviceMonitorResetRequest,
458            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
459        >(
460            (phy_id,),
461            0x6def240c9f8c6867,
462            fidl::encoding::DynamicFlags::empty(),
463            ___deadline,
464        )?;
465        Ok(_response.map(|x| x))
466    }
467
468    /// Applies the provided TxPowerScenario to the specified PHY.
469    pub fn r#set_tx_power_scenario(
470        &self,
471        mut phy_id: u16,
472        mut scenario: fidl_fuchsia_wlan_internal::TxPowerScenario,
473        ___deadline: zx::MonotonicInstant,
474    ) -> Result<DeviceMonitorSetTxPowerScenarioResult, fidl::Error> {
475        let _response = self.client.send_query::<
476            DeviceMonitorSetTxPowerScenarioRequest,
477            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
478        >(
479            (phy_id, scenario,),
480            0x7c51443a985934fd,
481            fidl::encoding::DynamicFlags::empty(),
482            ___deadline,
483        )?;
484        Ok(_response.map(|x| x))
485    }
486
487    /// Clears any existing TxPowerScenario that has been applied and resets the PHY to use its default TxPowerScenario.
488    pub fn r#reset_tx_power_scenario(
489        &self,
490        mut phy_id: u16,
491        ___deadline: zx::MonotonicInstant,
492    ) -> Result<DeviceMonitorResetTxPowerScenarioResult, fidl::Error> {
493        let _response = self.client.send_query::<
494            DeviceMonitorResetTxPowerScenarioRequest,
495            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
496        >(
497            (phy_id,),
498            0x4790357c9cdddc4a,
499            fidl::encoding::DynamicFlags::empty(),
500            ___deadline,
501        )?;
502        Ok(_response.map(|x| x))
503    }
504
505    /// Queries the current TxPowerScenario setting for the specified PHY.
506    pub fn r#get_tx_power_scenario(
507        &self,
508        mut phy_id: u16,
509        ___deadline: zx::MonotonicInstant,
510    ) -> Result<DeviceMonitorGetTxPowerScenarioResult, fidl::Error> {
511        let _response = self.client.send_query::<
512            DeviceMonitorGetTxPowerScenarioRequest,
513            fidl::encoding::ResultType<DeviceMonitorGetTxPowerScenarioResponse, i32>,
514        >(
515            (phy_id,),
516            0x555fb197f90e9830,
517            fidl::encoding::DynamicFlags::empty(),
518            ___deadline,
519        )?;
520        Ok(_response.map(|x| x.scenario))
521    }
522
523    /// This will return the current power state of the wlan chip.
524    pub fn r#get_power_state(
525        &self,
526        mut phy_id: u16,
527        ___deadline: zx::MonotonicInstant,
528    ) -> Result<DeviceMonitorGetPowerStateResult, fidl::Error> {
529        let _response = self.client.send_query::<
530            DeviceMonitorGetPowerStateRequest,
531            fidl::encoding::ResultType<DeviceMonitorGetPowerStateResponse, i32>,
532        >(
533            (phy_id,),
534            0x58cf95c5bbbe3f,
535            fidl::encoding::DynamicFlags::empty(),
536            ___deadline,
537        )?;
538        Ok(_response.map(|x| x.power_on))
539    }
540
541    /// Set the Bluetooth coexistence mode.
542    /// Likely errors include:
543    ///     * NOT_FOUND: The given phy_id does not exist.
544    ///     * NOT_SUPPORTED: The specified BT coexistence mode is not supported.
545    pub fn r#set_bt_coexistence_mode(
546        &self,
547        mut phy_id: u16,
548        mut mode: fidl_fuchsia_wlan_internal::BtCoexistenceMode,
549        ___deadline: zx::MonotonicInstant,
550    ) -> Result<DeviceMonitorSetBtCoexistenceModeResult, fidl::Error> {
551        let _response = self.client.send_query::<
552            DeviceMonitorSetBtCoexistenceModeRequest,
553            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
554        >(
555            (phy_id, mode,),
556            0x97539596c9a79c7,
557            fidl::encoding::DynamicFlags::empty(),
558            ___deadline,
559        )?;
560        Ok(_response.map(|x| x))
561    }
562
563    pub fn r#create_iface(
564        &self,
565        mut payload: &DeviceMonitorCreateIfaceRequest,
566        ___deadline: zx::MonotonicInstant,
567    ) -> Result<DeviceMonitorCreateIfaceResult, fidl::Error> {
568        let _response =
569            self.client.send_query::<DeviceMonitorCreateIfaceRequest, fidl::encoding::ResultType<
570                DeviceMonitorCreateIfaceResponse,
571                DeviceMonitorError,
572            >>(
573                payload,
574                0x1e1d30c24c0ec144,
575                fidl::encoding::DynamicFlags::empty(),
576                ___deadline,
577            )?;
578        Ok(_response.map(|x| x))
579    }
580
581    pub fn r#query_iface(
582        &self,
583        mut iface_id: u16,
584        ___deadline: zx::MonotonicInstant,
585    ) -> Result<DeviceMonitorQueryIfaceResult, fidl::Error> {
586        let _response = self.client.send_query::<
587            DeviceMonitorQueryIfaceRequest,
588            fidl::encoding::ResultType<DeviceMonitorQueryIfaceResponse, i32>,
589        >(
590            (iface_id,),
591            0x1a48c4a2b86259ef,
592            fidl::encoding::DynamicFlags::empty(),
593            ___deadline,
594        )?;
595        Ok(_response.map(|x| x.resp))
596    }
597
598    pub fn r#destroy_iface(
599        &self,
600        mut req: &DestroyIfaceRequest,
601        ___deadline: zx::MonotonicInstant,
602    ) -> Result<i32, fidl::Error> {
603        let _response = self
604            .client
605            .send_query::<DeviceMonitorDestroyIfaceRequest, DeviceMonitorDestroyIfaceResponse>(
606                (req,),
607                0x4c77982c1616a3b0,
608                fidl::encoding::DynamicFlags::empty(),
609                ___deadline,
610            )?;
611        Ok(_response.status)
612    }
613
614    pub fn r#query_iface_capabilities(
615        &self,
616        mut iface_id: u16,
617        ___deadline: zx::MonotonicInstant,
618    ) -> Result<DeviceMonitorQueryIfaceCapabilitiesResult, fidl::Error> {
619        let _response = self.client.send_query::<
620            DeviceMonitorQueryIfaceCapabilitiesRequest,
621            fidl::encoding::ResultType<DeviceMonitorQueryIfaceCapabilitiesResponse, i32>,
622        >(
623            (iface_id,),
624            0x37e8b884766de0f8,
625            fidl::encoding::DynamicFlags::empty(),
626            ___deadline,
627        )?;
628        Ok(_response.map(|x| x.apf_support))
629    }
630
631    /// Attempt to establish a new connection to a Client SME.
632    /// Connections may be established for the whole lifetime of the SME,
633    /// but concurrent connections might lead to unexpected behavior.
634    /// Likely errors include:
635    ///     * NOT_FOUND: The given iface_id does not exist.
636    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
637    ///     * PEER_CLOSED: The underlying SME is shutting down.
638    pub fn r#get_client_sme(
639        &self,
640        mut iface_id: u16,
641        mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
642        ___deadline: zx::MonotonicInstant,
643    ) -> Result<DeviceMonitorGetClientSmeResult, fidl::Error> {
644        let _response = self.client.send_query::<
645            DeviceMonitorGetClientSmeRequest,
646            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
647        >(
648            (iface_id, sme_server,),
649            0x1b056c379ca98273,
650            fidl::encoding::DynamicFlags::empty(),
651            ___deadline,
652        )?;
653        Ok(_response.map(|x| x))
654    }
655
656    /// Attempt to establish a new connection to an AP SME.
657    /// Connections may be established for the whole lifetime of the SME,
658    /// but concurrent connections might lead to unexpected behavior.
659    /// Likely errors include:
660    ///     * NOT_FOUND: The given iface_id does not exist.
661    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
662    ///     * PEER_CLOSED: The underlying SME is shutting down.
663    pub fn r#get_ap_sme(
664        &self,
665        mut iface_id: u16,
666        mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
667        ___deadline: zx::MonotonicInstant,
668    ) -> Result<DeviceMonitorGetApSmeResult, fidl::Error> {
669        let _response = self.client.send_query::<
670            DeviceMonitorGetApSmeRequest,
671            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
672        >(
673            (iface_id, sme_server,),
674            0x754de680c4318c52,
675            fidl::encoding::DynamicFlags::empty(),
676            ___deadline,
677        )?;
678        Ok(_response.map(|x| x))
679    }
680
681    /// Attempt to establish a new connection to telemetry for an SME.
682    /// Connections may be established for the whole lifetime of the SME, and
683    /// concurrent connections are safe since this is a read-only API.
684    /// Likely errors include:
685    ///     * NOT_FOUND: The given iface_id does not exist.
686    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
687    ///     * PEER_CLOSED: The underlying SME is shutting down.
688    pub fn r#get_sme_telemetry(
689        &self,
690        mut iface_id: u16,
691        mut telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
692        ___deadline: zx::MonotonicInstant,
693    ) -> Result<DeviceMonitorGetSmeTelemetryResult, fidl::Error> {
694        let _response = self.client.send_query::<
695            DeviceMonitorGetSmeTelemetryRequest,
696            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
697        >(
698            (iface_id, telemetry_server,),
699            0x1baf42b003f7452a,
700            fidl::encoding::DynamicFlags::empty(),
701            ___deadline,
702        )?;
703        Ok(_response.map(|x| x))
704    }
705}
706
707#[cfg(target_os = "fuchsia")]
708impl From<DeviceMonitorSynchronousProxy> for zx::NullableHandle {
709    fn from(value: DeviceMonitorSynchronousProxy) -> Self {
710        value.into_channel().into()
711    }
712}
713
714#[cfg(target_os = "fuchsia")]
715impl From<fidl::Channel> for DeviceMonitorSynchronousProxy {
716    fn from(value: fidl::Channel) -> Self {
717        Self::new(value)
718    }
719}
720
721#[cfg(target_os = "fuchsia")]
722impl fidl::endpoints::FromClient for DeviceMonitorSynchronousProxy {
723    type Protocol = DeviceMonitorMarker;
724
725    fn from_client(value: fidl::endpoints::ClientEnd<DeviceMonitorMarker>) -> Self {
726        Self::new(value.into_channel())
727    }
728}
729
730#[derive(Debug, Clone)]
731pub struct DeviceMonitorProxy {
732    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
733}
734
735impl fidl::endpoints::Proxy for DeviceMonitorProxy {
736    type Protocol = DeviceMonitorMarker;
737
738    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
739        Self::new(inner)
740    }
741
742    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
743        self.client.into_channel().map_err(|client| Self { client })
744    }
745
746    fn as_channel(&self) -> &::fidl::AsyncChannel {
747        self.client.as_channel()
748    }
749}
750
751impl DeviceMonitorProxy {
752    /// Create a new Proxy for fuchsia.wlan.device.service/DeviceMonitor.
753    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
754        let protocol_name = <DeviceMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
755        Self { client: fidl::client::Client::new(channel, protocol_name) }
756    }
757
758    /// Get a Stream of events from the remote end of the protocol.
759    ///
760    /// # Panics
761    ///
762    /// Panics if the event stream was already taken.
763    pub fn take_event_stream(&self) -> DeviceMonitorEventStream {
764        DeviceMonitorEventStream { event_receiver: self.client.take_event_receiver() }
765    }
766
767    pub fn r#list_phys(
768        &self,
769    ) -> fidl::client::QueryResponseFut<Vec<u16>, fidl::encoding::DefaultFuchsiaResourceDialect>
770    {
771        DeviceMonitorProxyInterface::r#list_phys(self)
772    }
773
774    pub fn r#list_ifaces(
775        &self,
776    ) -> fidl::client::QueryResponseFut<Vec<u16>, fidl::encoding::DefaultFuchsiaResourceDialect>
777    {
778        DeviceMonitorProxyInterface::r#list_ifaces(self)
779    }
780
781    pub fn r#get_dev_path(
782        &self,
783        mut phy_id: u16,
784    ) -> fidl::client::QueryResponseFut<Option<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
785    {
786        DeviceMonitorProxyInterface::r#get_dev_path(self, phy_id)
787    }
788
789    pub fn r#get_supported_mac_roles(
790        &self,
791        mut phy_id: u16,
792    ) -> fidl::client::QueryResponseFut<
793        DeviceMonitorGetSupportedMacRolesResult,
794        fidl::encoding::DefaultFuchsiaResourceDialect,
795    > {
796        DeviceMonitorProxyInterface::r#get_supported_mac_roles(self, phy_id)
797    }
798
799    pub fn r#watch_devices(
800        &self,
801        mut watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
802    ) -> Result<(), fidl::Error> {
803        DeviceMonitorProxyInterface::r#watch_devices(self, watcher)
804    }
805
806    pub fn r#watch_phy_events(
807        &self,
808        mut watcher: fidl::endpoints::ServerEnd<PhyEventWatcherMarker>,
809    ) -> Result<(), fidl::Error> {
810        DeviceMonitorProxyInterface::r#watch_phy_events(self, watcher)
811    }
812
813    pub fn r#get_country(
814        &self,
815        mut phy_id: u16,
816    ) -> fidl::client::QueryResponseFut<
817        DeviceMonitorGetCountryResult,
818        fidl::encoding::DefaultFuchsiaResourceDialect,
819    > {
820        DeviceMonitorProxyInterface::r#get_country(self, phy_id)
821    }
822
823    pub fn r#set_country(
824        &self,
825        mut req: &SetCountryRequest,
826    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
827        DeviceMonitorProxyInterface::r#set_country(self, req)
828    }
829
830    pub fn r#clear_country(
831        &self,
832        mut req: &ClearCountryRequest,
833    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
834        DeviceMonitorProxyInterface::r#clear_country(self, req)
835    }
836
837    pub fn r#set_power_save_mode(
838        &self,
839        mut req: &SetPowerSaveModeRequest,
840    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
841        DeviceMonitorProxyInterface::r#set_power_save_mode(self, req)
842    }
843
844    pub fn r#get_power_save_mode(
845        &self,
846        mut phy_id: u16,
847    ) -> fidl::client::QueryResponseFut<
848        DeviceMonitorGetPowerSaveModeResult,
849        fidl::encoding::DefaultFuchsiaResourceDialect,
850    > {
851        DeviceMonitorProxyInterface::r#get_power_save_mode(self, phy_id)
852    }
853
854    /// All interfaces should be deleted before calling this method. If supported, the
855    /// wlan driver will power down the wlan chip. Refer to wlan.phyimpl fidl for more details.
856    pub fn r#power_down(
857        &self,
858        mut phy_id: u16,
859    ) -> fidl::client::QueryResponseFut<
860        DeviceMonitorPowerDownResult,
861        fidl::encoding::DefaultFuchsiaResourceDialect,
862    > {
863        DeviceMonitorProxyInterface::r#power_down(self, phy_id)
864    }
865
866    /// If supported, the wlan driver will power up the wlan chip. Refer to wlan.phyimpl fidl
867    /// for more details.
868    pub fn r#power_up(
869        &self,
870        mut phy_id: u16,
871    ) -> fidl::client::QueryResponseFut<
872        DeviceMonitorPowerUpResult,
873        fidl::encoding::DefaultFuchsiaResourceDialect,
874    > {
875        DeviceMonitorProxyInterface::r#power_up(self, phy_id)
876    }
877
878    /// If supported, the wlan driver will reset the wlan chip. An attempt is made to delete
879    /// any existing interfaces. Refer to wlan.phyimpl fidl for more details.
880    pub fn r#reset(
881        &self,
882        mut phy_id: u16,
883    ) -> fidl::client::QueryResponseFut<
884        DeviceMonitorResetResult,
885        fidl::encoding::DefaultFuchsiaResourceDialect,
886    > {
887        DeviceMonitorProxyInterface::r#reset(self, phy_id)
888    }
889
890    /// Applies the provided TxPowerScenario to the specified PHY.
891    pub fn r#set_tx_power_scenario(
892        &self,
893        mut phy_id: u16,
894        mut scenario: fidl_fuchsia_wlan_internal::TxPowerScenario,
895    ) -> fidl::client::QueryResponseFut<
896        DeviceMonitorSetTxPowerScenarioResult,
897        fidl::encoding::DefaultFuchsiaResourceDialect,
898    > {
899        DeviceMonitorProxyInterface::r#set_tx_power_scenario(self, phy_id, scenario)
900    }
901
902    /// Clears any existing TxPowerScenario that has been applied and resets the PHY to use its default TxPowerScenario.
903    pub fn r#reset_tx_power_scenario(
904        &self,
905        mut phy_id: u16,
906    ) -> fidl::client::QueryResponseFut<
907        DeviceMonitorResetTxPowerScenarioResult,
908        fidl::encoding::DefaultFuchsiaResourceDialect,
909    > {
910        DeviceMonitorProxyInterface::r#reset_tx_power_scenario(self, phy_id)
911    }
912
913    /// Queries the current TxPowerScenario setting for the specified PHY.
914    pub fn r#get_tx_power_scenario(
915        &self,
916        mut phy_id: u16,
917    ) -> fidl::client::QueryResponseFut<
918        DeviceMonitorGetTxPowerScenarioResult,
919        fidl::encoding::DefaultFuchsiaResourceDialect,
920    > {
921        DeviceMonitorProxyInterface::r#get_tx_power_scenario(self, phy_id)
922    }
923
924    /// This will return the current power state of the wlan chip.
925    pub fn r#get_power_state(
926        &self,
927        mut phy_id: u16,
928    ) -> fidl::client::QueryResponseFut<
929        DeviceMonitorGetPowerStateResult,
930        fidl::encoding::DefaultFuchsiaResourceDialect,
931    > {
932        DeviceMonitorProxyInterface::r#get_power_state(self, phy_id)
933    }
934
935    /// Set the Bluetooth coexistence mode.
936    /// Likely errors include:
937    ///     * NOT_FOUND: The given phy_id does not exist.
938    ///     * NOT_SUPPORTED: The specified BT coexistence mode is not supported.
939    pub fn r#set_bt_coexistence_mode(
940        &self,
941        mut phy_id: u16,
942        mut mode: fidl_fuchsia_wlan_internal::BtCoexistenceMode,
943    ) -> fidl::client::QueryResponseFut<
944        DeviceMonitorSetBtCoexistenceModeResult,
945        fidl::encoding::DefaultFuchsiaResourceDialect,
946    > {
947        DeviceMonitorProxyInterface::r#set_bt_coexistence_mode(self, phy_id, mode)
948    }
949
950    pub fn r#create_iface(
951        &self,
952        mut payload: &DeviceMonitorCreateIfaceRequest,
953    ) -> fidl::client::QueryResponseFut<
954        DeviceMonitorCreateIfaceResult,
955        fidl::encoding::DefaultFuchsiaResourceDialect,
956    > {
957        DeviceMonitorProxyInterface::r#create_iface(self, payload)
958    }
959
960    pub fn r#query_iface(
961        &self,
962        mut iface_id: u16,
963    ) -> fidl::client::QueryResponseFut<
964        DeviceMonitorQueryIfaceResult,
965        fidl::encoding::DefaultFuchsiaResourceDialect,
966    > {
967        DeviceMonitorProxyInterface::r#query_iface(self, iface_id)
968    }
969
970    pub fn r#destroy_iface(
971        &self,
972        mut req: &DestroyIfaceRequest,
973    ) -> fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect> {
974        DeviceMonitorProxyInterface::r#destroy_iface(self, req)
975    }
976
977    pub fn r#query_iface_capabilities(
978        &self,
979        mut iface_id: u16,
980    ) -> fidl::client::QueryResponseFut<
981        DeviceMonitorQueryIfaceCapabilitiesResult,
982        fidl::encoding::DefaultFuchsiaResourceDialect,
983    > {
984        DeviceMonitorProxyInterface::r#query_iface_capabilities(self, iface_id)
985    }
986
987    /// Attempt to establish a new connection to a Client SME.
988    /// Connections may be established for the whole lifetime of the SME,
989    /// but concurrent connections might lead to unexpected behavior.
990    /// Likely errors include:
991    ///     * NOT_FOUND: The given iface_id does not exist.
992    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
993    ///     * PEER_CLOSED: The underlying SME is shutting down.
994    pub fn r#get_client_sme(
995        &self,
996        mut iface_id: u16,
997        mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
998    ) -> fidl::client::QueryResponseFut<
999        DeviceMonitorGetClientSmeResult,
1000        fidl::encoding::DefaultFuchsiaResourceDialect,
1001    > {
1002        DeviceMonitorProxyInterface::r#get_client_sme(self, iface_id, sme_server)
1003    }
1004
1005    /// Attempt to establish a new connection to an AP SME.
1006    /// Connections may be established for the whole lifetime of the SME,
1007    /// but concurrent connections might lead to unexpected behavior.
1008    /// Likely errors include:
1009    ///     * NOT_FOUND: The given iface_id does not exist.
1010    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
1011    ///     * PEER_CLOSED: The underlying SME is shutting down.
1012    pub fn r#get_ap_sme(
1013        &self,
1014        mut iface_id: u16,
1015        mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
1016    ) -> fidl::client::QueryResponseFut<
1017        DeviceMonitorGetApSmeResult,
1018        fidl::encoding::DefaultFuchsiaResourceDialect,
1019    > {
1020        DeviceMonitorProxyInterface::r#get_ap_sme(self, iface_id, sme_server)
1021    }
1022
1023    /// Attempt to establish a new connection to telemetry for an SME.
1024    /// Connections may be established for the whole lifetime of the SME, and
1025    /// concurrent connections are safe since this is a read-only API.
1026    /// Likely errors include:
1027    ///     * NOT_FOUND: The given iface_id does not exist.
1028    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
1029    ///     * PEER_CLOSED: The underlying SME is shutting down.
1030    pub fn r#get_sme_telemetry(
1031        &self,
1032        mut iface_id: u16,
1033        mut telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
1034    ) -> fidl::client::QueryResponseFut<
1035        DeviceMonitorGetSmeTelemetryResult,
1036        fidl::encoding::DefaultFuchsiaResourceDialect,
1037    > {
1038        DeviceMonitorProxyInterface::r#get_sme_telemetry(self, iface_id, telemetry_server)
1039    }
1040}
1041
1042impl DeviceMonitorProxyInterface for DeviceMonitorProxy {
1043    type ListPhysResponseFut =
1044        fidl::client::QueryResponseFut<Vec<u16>, fidl::encoding::DefaultFuchsiaResourceDialect>;
1045    fn r#list_phys(&self) -> Self::ListPhysResponseFut {
1046        fn _decode(
1047            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1048        ) -> Result<Vec<u16>, fidl::Error> {
1049            let _response = fidl::client::decode_transaction_body::<
1050                DeviceMonitorListPhysResponse,
1051                fidl::encoding::DefaultFuchsiaResourceDialect,
1052                0x3a08518874196aab,
1053            >(_buf?)?;
1054            Ok(_response.phy_list)
1055        }
1056        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u16>>(
1057            (),
1058            0x3a08518874196aab,
1059            fidl::encoding::DynamicFlags::empty(),
1060            _decode,
1061        )
1062    }
1063
1064    type ListIfacesResponseFut =
1065        fidl::client::QueryResponseFut<Vec<u16>, fidl::encoding::DefaultFuchsiaResourceDialect>;
1066    fn r#list_ifaces(&self) -> Self::ListIfacesResponseFut {
1067        fn _decode(
1068            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1069        ) -> Result<Vec<u16>, fidl::Error> {
1070            let _response = fidl::client::decode_transaction_body::<
1071                DeviceMonitorListIfacesResponse,
1072                fidl::encoding::DefaultFuchsiaResourceDialect,
1073                0x129e758fb8e0b113,
1074            >(_buf?)?;
1075            Ok(_response.iface_list)
1076        }
1077        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<u16>>(
1078            (),
1079            0x129e758fb8e0b113,
1080            fidl::encoding::DynamicFlags::empty(),
1081            _decode,
1082        )
1083    }
1084
1085    type GetDevPathResponseFut = fidl::client::QueryResponseFut<
1086        Option<String>,
1087        fidl::encoding::DefaultFuchsiaResourceDialect,
1088    >;
1089    fn r#get_dev_path(&self, mut phy_id: u16) -> Self::GetDevPathResponseFut {
1090        fn _decode(
1091            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1092        ) -> Result<Option<String>, fidl::Error> {
1093            let _response = fidl::client::decode_transaction_body::<
1094                DeviceMonitorGetDevPathResponse,
1095                fidl::encoding::DefaultFuchsiaResourceDialect,
1096                0x4aa489b57113bccf,
1097            >(_buf?)?;
1098            Ok(_response.dev_path)
1099        }
1100        self.client.send_query_and_decode::<DeviceMonitorGetDevPathRequest, Option<String>>(
1101            (phy_id,),
1102            0x4aa489b57113bccf,
1103            fidl::encoding::DynamicFlags::empty(),
1104            _decode,
1105        )
1106    }
1107
1108    type GetSupportedMacRolesResponseFut = fidl::client::QueryResponseFut<
1109        DeviceMonitorGetSupportedMacRolesResult,
1110        fidl::encoding::DefaultFuchsiaResourceDialect,
1111    >;
1112    fn r#get_supported_mac_roles(&self, mut phy_id: u16) -> Self::GetSupportedMacRolesResponseFut {
1113        fn _decode(
1114            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1115        ) -> Result<DeviceMonitorGetSupportedMacRolesResult, fidl::Error> {
1116            let _response = fidl::client::decode_transaction_body::<
1117                fidl::encoding::ResultType<DeviceMonitorGetSupportedMacRolesResponse, i32>,
1118                fidl::encoding::DefaultFuchsiaResourceDialect,
1119                0x172b3d2eabd5a14e,
1120            >(_buf?)?;
1121            Ok(_response.map(|x| x.supported_mac_roles))
1122        }
1123        self.client.send_query_and_decode::<
1124            DeviceMonitorGetSupportedMacRolesRequest,
1125            DeviceMonitorGetSupportedMacRolesResult,
1126        >(
1127            (phy_id,),
1128            0x172b3d2eabd5a14e,
1129            fidl::encoding::DynamicFlags::empty(),
1130            _decode,
1131        )
1132    }
1133
1134    fn r#watch_devices(
1135        &self,
1136        mut watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
1137    ) -> Result<(), fidl::Error> {
1138        self.client.send::<DeviceMonitorWatchDevicesRequest>(
1139            (watcher,),
1140            0x4615941e67e31b8e,
1141            fidl::encoding::DynamicFlags::empty(),
1142        )
1143    }
1144
1145    fn r#watch_phy_events(
1146        &self,
1147        mut watcher: fidl::endpoints::ServerEnd<PhyEventWatcherMarker>,
1148    ) -> Result<(), fidl::Error> {
1149        self.client.send::<DeviceMonitorWatchPhyEventsRequest>(
1150            (watcher,),
1151            0x2c5af9d064099745,
1152            fidl::encoding::DynamicFlags::empty(),
1153        )
1154    }
1155
1156    type GetCountryResponseFut = fidl::client::QueryResponseFut<
1157        DeviceMonitorGetCountryResult,
1158        fidl::encoding::DefaultFuchsiaResourceDialect,
1159    >;
1160    fn r#get_country(&self, mut phy_id: u16) -> Self::GetCountryResponseFut {
1161        fn _decode(
1162            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1163        ) -> Result<DeviceMonitorGetCountryResult, fidl::Error> {
1164            let _response = fidl::client::decode_transaction_body::<
1165                fidl::encoding::ResultType<DeviceMonitorGetCountryResponse, i32>,
1166                fidl::encoding::DefaultFuchsiaResourceDialect,
1167                0x6f1040bd81bde90e,
1168            >(_buf?)?;
1169            Ok(_response.map(|x| x.resp))
1170        }
1171        self.client
1172            .send_query_and_decode::<DeviceMonitorGetCountryRequest, DeviceMonitorGetCountryResult>(
1173                (phy_id,),
1174                0x6f1040bd81bde90e,
1175                fidl::encoding::DynamicFlags::empty(),
1176                _decode,
1177            )
1178    }
1179
1180    type SetCountryResponseFut =
1181        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1182    fn r#set_country(&self, mut req: &SetCountryRequest) -> Self::SetCountryResponseFut {
1183        fn _decode(
1184            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1185        ) -> Result<i32, fidl::Error> {
1186            let _response = fidl::client::decode_transaction_body::<
1187                DeviceMonitorSetCountryResponse,
1188                fidl::encoding::DefaultFuchsiaResourceDialect,
1189                0xdaa7b77a5a6e71b,
1190            >(_buf?)?;
1191            Ok(_response.status)
1192        }
1193        self.client.send_query_and_decode::<DeviceMonitorSetCountryRequest, i32>(
1194            (req,),
1195            0xdaa7b77a5a6e71b,
1196            fidl::encoding::DynamicFlags::empty(),
1197            _decode,
1198        )
1199    }
1200
1201    type ClearCountryResponseFut =
1202        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1203    fn r#clear_country(&self, mut req: &ClearCountryRequest) -> Self::ClearCountryResponseFut {
1204        fn _decode(
1205            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1206        ) -> Result<i32, fidl::Error> {
1207            let _response = fidl::client::decode_transaction_body::<
1208                DeviceMonitorClearCountryResponse,
1209                fidl::encoding::DefaultFuchsiaResourceDialect,
1210                0x66714d61103120e9,
1211            >(_buf?)?;
1212            Ok(_response.status)
1213        }
1214        self.client.send_query_and_decode::<DeviceMonitorClearCountryRequest, i32>(
1215            (req,),
1216            0x66714d61103120e9,
1217            fidl::encoding::DynamicFlags::empty(),
1218            _decode,
1219        )
1220    }
1221
1222    type SetPowerSaveModeResponseFut =
1223        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1224    fn r#set_power_save_mode(
1225        &self,
1226        mut req: &SetPowerSaveModeRequest,
1227    ) -> Self::SetPowerSaveModeResponseFut {
1228        fn _decode(
1229            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1230        ) -> Result<i32, fidl::Error> {
1231            let _response = fidl::client::decode_transaction_body::<
1232                DeviceMonitorSetPowerSaveModeResponse,
1233                fidl::encoding::DefaultFuchsiaResourceDialect,
1234                0x62202b4d360533bc,
1235            >(_buf?)?;
1236            Ok(_response.status)
1237        }
1238        self.client.send_query_and_decode::<DeviceMonitorSetPowerSaveModeRequest, i32>(
1239            (req,),
1240            0x62202b4d360533bc,
1241            fidl::encoding::DynamicFlags::empty(),
1242            _decode,
1243        )
1244    }
1245
1246    type GetPowerSaveModeResponseFut = fidl::client::QueryResponseFut<
1247        DeviceMonitorGetPowerSaveModeResult,
1248        fidl::encoding::DefaultFuchsiaResourceDialect,
1249    >;
1250    fn r#get_power_save_mode(&self, mut phy_id: u16) -> Self::GetPowerSaveModeResponseFut {
1251        fn _decode(
1252            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1253        ) -> Result<DeviceMonitorGetPowerSaveModeResult, fidl::Error> {
1254            let _response = fidl::client::decode_transaction_body::<
1255                fidl::encoding::ResultType<DeviceMonitorGetPowerSaveModeResponse, i32>,
1256                fidl::encoding::DefaultFuchsiaResourceDialect,
1257                0x14304d406ada8693,
1258            >(_buf?)?;
1259            Ok(_response.map(|x| x.resp))
1260        }
1261        self.client.send_query_and_decode::<
1262            DeviceMonitorGetPowerSaveModeRequest,
1263            DeviceMonitorGetPowerSaveModeResult,
1264        >(
1265            (phy_id,),
1266            0x14304d406ada8693,
1267            fidl::encoding::DynamicFlags::empty(),
1268            _decode,
1269        )
1270    }
1271
1272    type PowerDownResponseFut = fidl::client::QueryResponseFut<
1273        DeviceMonitorPowerDownResult,
1274        fidl::encoding::DefaultFuchsiaResourceDialect,
1275    >;
1276    fn r#power_down(&self, mut phy_id: u16) -> Self::PowerDownResponseFut {
1277        fn _decode(
1278            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1279        ) -> Result<DeviceMonitorPowerDownResult, fidl::Error> {
1280            let _response = fidl::client::decode_transaction_body::<
1281                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1282                fidl::encoding::DefaultFuchsiaResourceDialect,
1283                0x374ad717fe8902e0,
1284            >(_buf?)?;
1285            Ok(_response.map(|x| x))
1286        }
1287        self.client
1288            .send_query_and_decode::<DeviceMonitorPowerDownRequest, DeviceMonitorPowerDownResult>(
1289                (phy_id,),
1290                0x374ad717fe8902e0,
1291                fidl::encoding::DynamicFlags::empty(),
1292                _decode,
1293            )
1294    }
1295
1296    type PowerUpResponseFut = fidl::client::QueryResponseFut<
1297        DeviceMonitorPowerUpResult,
1298        fidl::encoding::DefaultFuchsiaResourceDialect,
1299    >;
1300    fn r#power_up(&self, mut phy_id: u16) -> Self::PowerUpResponseFut {
1301        fn _decode(
1302            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1303        ) -> Result<DeviceMonitorPowerUpResult, fidl::Error> {
1304            let _response = fidl::client::decode_transaction_body::<
1305                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1306                fidl::encoding::DefaultFuchsiaResourceDialect,
1307                0xa2379b639869c17,
1308            >(_buf?)?;
1309            Ok(_response.map(|x| x))
1310        }
1311        self.client
1312            .send_query_and_decode::<DeviceMonitorPowerUpRequest, DeviceMonitorPowerUpResult>(
1313                (phy_id,),
1314                0xa2379b639869c17,
1315                fidl::encoding::DynamicFlags::empty(),
1316                _decode,
1317            )
1318    }
1319
1320    type ResetResponseFut = fidl::client::QueryResponseFut<
1321        DeviceMonitorResetResult,
1322        fidl::encoding::DefaultFuchsiaResourceDialect,
1323    >;
1324    fn r#reset(&self, mut phy_id: u16) -> Self::ResetResponseFut {
1325        fn _decode(
1326            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1327        ) -> Result<DeviceMonitorResetResult, fidl::Error> {
1328            let _response = fidl::client::decode_transaction_body::<
1329                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1330                fidl::encoding::DefaultFuchsiaResourceDialect,
1331                0x6def240c9f8c6867,
1332            >(_buf?)?;
1333            Ok(_response.map(|x| x))
1334        }
1335        self.client.send_query_and_decode::<DeviceMonitorResetRequest, DeviceMonitorResetResult>(
1336            (phy_id,),
1337            0x6def240c9f8c6867,
1338            fidl::encoding::DynamicFlags::empty(),
1339            _decode,
1340        )
1341    }
1342
1343    type SetTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
1344        DeviceMonitorSetTxPowerScenarioResult,
1345        fidl::encoding::DefaultFuchsiaResourceDialect,
1346    >;
1347    fn r#set_tx_power_scenario(
1348        &self,
1349        mut phy_id: u16,
1350        mut scenario: fidl_fuchsia_wlan_internal::TxPowerScenario,
1351    ) -> Self::SetTxPowerScenarioResponseFut {
1352        fn _decode(
1353            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1354        ) -> Result<DeviceMonitorSetTxPowerScenarioResult, fidl::Error> {
1355            let _response = fidl::client::decode_transaction_body::<
1356                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1357                fidl::encoding::DefaultFuchsiaResourceDialect,
1358                0x7c51443a985934fd,
1359            >(_buf?)?;
1360            Ok(_response.map(|x| x))
1361        }
1362        self.client.send_query_and_decode::<
1363            DeviceMonitorSetTxPowerScenarioRequest,
1364            DeviceMonitorSetTxPowerScenarioResult,
1365        >(
1366            (phy_id, scenario,),
1367            0x7c51443a985934fd,
1368            fidl::encoding::DynamicFlags::empty(),
1369            _decode,
1370        )
1371    }
1372
1373    type ResetTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
1374        DeviceMonitorResetTxPowerScenarioResult,
1375        fidl::encoding::DefaultFuchsiaResourceDialect,
1376    >;
1377    fn r#reset_tx_power_scenario(&self, mut phy_id: u16) -> Self::ResetTxPowerScenarioResponseFut {
1378        fn _decode(
1379            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1380        ) -> Result<DeviceMonitorResetTxPowerScenarioResult, fidl::Error> {
1381            let _response = fidl::client::decode_transaction_body::<
1382                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1383                fidl::encoding::DefaultFuchsiaResourceDialect,
1384                0x4790357c9cdddc4a,
1385            >(_buf?)?;
1386            Ok(_response.map(|x| x))
1387        }
1388        self.client.send_query_and_decode::<
1389            DeviceMonitorResetTxPowerScenarioRequest,
1390            DeviceMonitorResetTxPowerScenarioResult,
1391        >(
1392            (phy_id,),
1393            0x4790357c9cdddc4a,
1394            fidl::encoding::DynamicFlags::empty(),
1395            _decode,
1396        )
1397    }
1398
1399    type GetTxPowerScenarioResponseFut = fidl::client::QueryResponseFut<
1400        DeviceMonitorGetTxPowerScenarioResult,
1401        fidl::encoding::DefaultFuchsiaResourceDialect,
1402    >;
1403    fn r#get_tx_power_scenario(&self, mut phy_id: u16) -> Self::GetTxPowerScenarioResponseFut {
1404        fn _decode(
1405            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1406        ) -> Result<DeviceMonitorGetTxPowerScenarioResult, fidl::Error> {
1407            let _response = fidl::client::decode_transaction_body::<
1408                fidl::encoding::ResultType<DeviceMonitorGetTxPowerScenarioResponse, i32>,
1409                fidl::encoding::DefaultFuchsiaResourceDialect,
1410                0x555fb197f90e9830,
1411            >(_buf?)?;
1412            Ok(_response.map(|x| x.scenario))
1413        }
1414        self.client.send_query_and_decode::<
1415            DeviceMonitorGetTxPowerScenarioRequest,
1416            DeviceMonitorGetTxPowerScenarioResult,
1417        >(
1418            (phy_id,),
1419            0x555fb197f90e9830,
1420            fidl::encoding::DynamicFlags::empty(),
1421            _decode,
1422        )
1423    }
1424
1425    type GetPowerStateResponseFut = fidl::client::QueryResponseFut<
1426        DeviceMonitorGetPowerStateResult,
1427        fidl::encoding::DefaultFuchsiaResourceDialect,
1428    >;
1429    fn r#get_power_state(&self, mut phy_id: u16) -> Self::GetPowerStateResponseFut {
1430        fn _decode(
1431            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1432        ) -> Result<DeviceMonitorGetPowerStateResult, fidl::Error> {
1433            let _response = fidl::client::decode_transaction_body::<
1434                fidl::encoding::ResultType<DeviceMonitorGetPowerStateResponse, i32>,
1435                fidl::encoding::DefaultFuchsiaResourceDialect,
1436                0x58cf95c5bbbe3f,
1437            >(_buf?)?;
1438            Ok(_response.map(|x| x.power_on))
1439        }
1440        self.client.send_query_and_decode::<
1441            DeviceMonitorGetPowerStateRequest,
1442            DeviceMonitorGetPowerStateResult,
1443        >(
1444            (phy_id,),
1445            0x58cf95c5bbbe3f,
1446            fidl::encoding::DynamicFlags::empty(),
1447            _decode,
1448        )
1449    }
1450
1451    type SetBtCoexistenceModeResponseFut = fidl::client::QueryResponseFut<
1452        DeviceMonitorSetBtCoexistenceModeResult,
1453        fidl::encoding::DefaultFuchsiaResourceDialect,
1454    >;
1455    fn r#set_bt_coexistence_mode(
1456        &self,
1457        mut phy_id: u16,
1458        mut mode: fidl_fuchsia_wlan_internal::BtCoexistenceMode,
1459    ) -> Self::SetBtCoexistenceModeResponseFut {
1460        fn _decode(
1461            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1462        ) -> Result<DeviceMonitorSetBtCoexistenceModeResult, fidl::Error> {
1463            let _response = fidl::client::decode_transaction_body::<
1464                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1465                fidl::encoding::DefaultFuchsiaResourceDialect,
1466                0x97539596c9a79c7,
1467            >(_buf?)?;
1468            Ok(_response.map(|x| x))
1469        }
1470        self.client.send_query_and_decode::<
1471            DeviceMonitorSetBtCoexistenceModeRequest,
1472            DeviceMonitorSetBtCoexistenceModeResult,
1473        >(
1474            (phy_id, mode,),
1475            0x97539596c9a79c7,
1476            fidl::encoding::DynamicFlags::empty(),
1477            _decode,
1478        )
1479    }
1480
1481    type CreateIfaceResponseFut = fidl::client::QueryResponseFut<
1482        DeviceMonitorCreateIfaceResult,
1483        fidl::encoding::DefaultFuchsiaResourceDialect,
1484    >;
1485    fn r#create_iface(
1486        &self,
1487        mut payload: &DeviceMonitorCreateIfaceRequest,
1488    ) -> Self::CreateIfaceResponseFut {
1489        fn _decode(
1490            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1491        ) -> Result<DeviceMonitorCreateIfaceResult, fidl::Error> {
1492            let _response = fidl::client::decode_transaction_body::<
1493                fidl::encoding::ResultType<DeviceMonitorCreateIfaceResponse, DeviceMonitorError>,
1494                fidl::encoding::DefaultFuchsiaResourceDialect,
1495                0x1e1d30c24c0ec144,
1496            >(_buf?)?;
1497            Ok(_response.map(|x| x))
1498        }
1499        self.client.send_query_and_decode::<
1500            DeviceMonitorCreateIfaceRequest,
1501            DeviceMonitorCreateIfaceResult,
1502        >(
1503            payload,
1504            0x1e1d30c24c0ec144,
1505            fidl::encoding::DynamicFlags::empty(),
1506            _decode,
1507        )
1508    }
1509
1510    type QueryIfaceResponseFut = fidl::client::QueryResponseFut<
1511        DeviceMonitorQueryIfaceResult,
1512        fidl::encoding::DefaultFuchsiaResourceDialect,
1513    >;
1514    fn r#query_iface(&self, mut iface_id: u16) -> Self::QueryIfaceResponseFut {
1515        fn _decode(
1516            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1517        ) -> Result<DeviceMonitorQueryIfaceResult, fidl::Error> {
1518            let _response = fidl::client::decode_transaction_body::<
1519                fidl::encoding::ResultType<DeviceMonitorQueryIfaceResponse, i32>,
1520                fidl::encoding::DefaultFuchsiaResourceDialect,
1521                0x1a48c4a2b86259ef,
1522            >(_buf?)?;
1523            Ok(_response.map(|x| x.resp))
1524        }
1525        self.client
1526            .send_query_and_decode::<DeviceMonitorQueryIfaceRequest, DeviceMonitorQueryIfaceResult>(
1527                (iface_id,),
1528                0x1a48c4a2b86259ef,
1529                fidl::encoding::DynamicFlags::empty(),
1530                _decode,
1531            )
1532    }
1533
1534    type DestroyIfaceResponseFut =
1535        fidl::client::QueryResponseFut<i32, fidl::encoding::DefaultFuchsiaResourceDialect>;
1536    fn r#destroy_iface(&self, mut req: &DestroyIfaceRequest) -> Self::DestroyIfaceResponseFut {
1537        fn _decode(
1538            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1539        ) -> Result<i32, fidl::Error> {
1540            let _response = fidl::client::decode_transaction_body::<
1541                DeviceMonitorDestroyIfaceResponse,
1542                fidl::encoding::DefaultFuchsiaResourceDialect,
1543                0x4c77982c1616a3b0,
1544            >(_buf?)?;
1545            Ok(_response.status)
1546        }
1547        self.client.send_query_and_decode::<DeviceMonitorDestroyIfaceRequest, i32>(
1548            (req,),
1549            0x4c77982c1616a3b0,
1550            fidl::encoding::DynamicFlags::empty(),
1551            _decode,
1552        )
1553    }
1554
1555    type QueryIfaceCapabilitiesResponseFut = fidl::client::QueryResponseFut<
1556        DeviceMonitorQueryIfaceCapabilitiesResult,
1557        fidl::encoding::DefaultFuchsiaResourceDialect,
1558    >;
1559    fn r#query_iface_capabilities(
1560        &self,
1561        mut iface_id: u16,
1562    ) -> Self::QueryIfaceCapabilitiesResponseFut {
1563        fn _decode(
1564            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1565        ) -> Result<DeviceMonitorQueryIfaceCapabilitiesResult, fidl::Error> {
1566            let _response = fidl::client::decode_transaction_body::<
1567                fidl::encoding::ResultType<DeviceMonitorQueryIfaceCapabilitiesResponse, i32>,
1568                fidl::encoding::DefaultFuchsiaResourceDialect,
1569                0x37e8b884766de0f8,
1570            >(_buf?)?;
1571            Ok(_response.map(|x| x.apf_support))
1572        }
1573        self.client.send_query_and_decode::<
1574            DeviceMonitorQueryIfaceCapabilitiesRequest,
1575            DeviceMonitorQueryIfaceCapabilitiesResult,
1576        >(
1577            (iface_id,),
1578            0x37e8b884766de0f8,
1579            fidl::encoding::DynamicFlags::empty(),
1580            _decode,
1581        )
1582    }
1583
1584    type GetClientSmeResponseFut = fidl::client::QueryResponseFut<
1585        DeviceMonitorGetClientSmeResult,
1586        fidl::encoding::DefaultFuchsiaResourceDialect,
1587    >;
1588    fn r#get_client_sme(
1589        &self,
1590        mut iface_id: u16,
1591        mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
1592    ) -> Self::GetClientSmeResponseFut {
1593        fn _decode(
1594            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1595        ) -> Result<DeviceMonitorGetClientSmeResult, fidl::Error> {
1596            let _response = fidl::client::decode_transaction_body::<
1597                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1598                fidl::encoding::DefaultFuchsiaResourceDialect,
1599                0x1b056c379ca98273,
1600            >(_buf?)?;
1601            Ok(_response.map(|x| x))
1602        }
1603        self.client.send_query_and_decode::<
1604            DeviceMonitorGetClientSmeRequest,
1605            DeviceMonitorGetClientSmeResult,
1606        >(
1607            (iface_id, sme_server,),
1608            0x1b056c379ca98273,
1609            fidl::encoding::DynamicFlags::empty(),
1610            _decode,
1611        )
1612    }
1613
1614    type GetApSmeResponseFut = fidl::client::QueryResponseFut<
1615        DeviceMonitorGetApSmeResult,
1616        fidl::encoding::DefaultFuchsiaResourceDialect,
1617    >;
1618    fn r#get_ap_sme(
1619        &self,
1620        mut iface_id: u16,
1621        mut sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
1622    ) -> Self::GetApSmeResponseFut {
1623        fn _decode(
1624            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1625        ) -> Result<DeviceMonitorGetApSmeResult, fidl::Error> {
1626            let _response = fidl::client::decode_transaction_body::<
1627                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1628                fidl::encoding::DefaultFuchsiaResourceDialect,
1629                0x754de680c4318c52,
1630            >(_buf?)?;
1631            Ok(_response.map(|x| x))
1632        }
1633        self.client
1634            .send_query_and_decode::<DeviceMonitorGetApSmeRequest, DeviceMonitorGetApSmeResult>(
1635                (iface_id, sme_server),
1636                0x754de680c4318c52,
1637                fidl::encoding::DynamicFlags::empty(),
1638                _decode,
1639            )
1640    }
1641
1642    type GetSmeTelemetryResponseFut = fidl::client::QueryResponseFut<
1643        DeviceMonitorGetSmeTelemetryResult,
1644        fidl::encoding::DefaultFuchsiaResourceDialect,
1645    >;
1646    fn r#get_sme_telemetry(
1647        &self,
1648        mut iface_id: u16,
1649        mut telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
1650    ) -> Self::GetSmeTelemetryResponseFut {
1651        fn _decode(
1652            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1653        ) -> Result<DeviceMonitorGetSmeTelemetryResult, fidl::Error> {
1654            let _response = fidl::client::decode_transaction_body::<
1655                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1656                fidl::encoding::DefaultFuchsiaResourceDialect,
1657                0x1baf42b003f7452a,
1658            >(_buf?)?;
1659            Ok(_response.map(|x| x))
1660        }
1661        self.client.send_query_and_decode::<
1662            DeviceMonitorGetSmeTelemetryRequest,
1663            DeviceMonitorGetSmeTelemetryResult,
1664        >(
1665            (iface_id, telemetry_server,),
1666            0x1baf42b003f7452a,
1667            fidl::encoding::DynamicFlags::empty(),
1668            _decode,
1669        )
1670    }
1671}
1672
1673pub struct DeviceMonitorEventStream {
1674    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1675}
1676
1677impl std::marker::Unpin for DeviceMonitorEventStream {}
1678
1679impl futures::stream::FusedStream for DeviceMonitorEventStream {
1680    fn is_terminated(&self) -> bool {
1681        self.event_receiver.is_terminated()
1682    }
1683}
1684
1685impl futures::Stream for DeviceMonitorEventStream {
1686    type Item = Result<DeviceMonitorEvent, fidl::Error>;
1687
1688    fn poll_next(
1689        mut self: std::pin::Pin<&mut Self>,
1690        cx: &mut std::task::Context<'_>,
1691    ) -> std::task::Poll<Option<Self::Item>> {
1692        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1693            &mut self.event_receiver,
1694            cx
1695        )?) {
1696            Some(buf) => std::task::Poll::Ready(Some(DeviceMonitorEvent::decode(buf))),
1697            None => std::task::Poll::Ready(None),
1698        }
1699    }
1700}
1701
1702#[derive(Debug)]
1703pub enum DeviceMonitorEvent {}
1704
1705impl DeviceMonitorEvent {
1706    /// Decodes a message buffer as a [`DeviceMonitorEvent`].
1707    fn decode(
1708        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1709    ) -> Result<DeviceMonitorEvent, fidl::Error> {
1710        let (bytes, _handles) = buf.split_mut();
1711        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1712        debug_assert_eq!(tx_header.tx_id, 0);
1713        match tx_header.ordinal {
1714            _ => Err(fidl::Error::UnknownOrdinal {
1715                ordinal: tx_header.ordinal,
1716                protocol_name: <DeviceMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1717            }),
1718        }
1719    }
1720}
1721
1722/// A Stream of incoming requests for fuchsia.wlan.device.service/DeviceMonitor.
1723pub struct DeviceMonitorRequestStream {
1724    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1725    is_terminated: bool,
1726}
1727
1728impl std::marker::Unpin for DeviceMonitorRequestStream {}
1729
1730impl futures::stream::FusedStream for DeviceMonitorRequestStream {
1731    fn is_terminated(&self) -> bool {
1732        self.is_terminated
1733    }
1734}
1735
1736impl fidl::endpoints::RequestStream for DeviceMonitorRequestStream {
1737    type Protocol = DeviceMonitorMarker;
1738    type ControlHandle = DeviceMonitorControlHandle;
1739
1740    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1741        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1742    }
1743
1744    fn control_handle(&self) -> Self::ControlHandle {
1745        DeviceMonitorControlHandle { inner: self.inner.clone() }
1746    }
1747
1748    fn into_inner(
1749        self,
1750    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1751    {
1752        (self.inner, self.is_terminated)
1753    }
1754
1755    fn from_inner(
1756        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1757        is_terminated: bool,
1758    ) -> Self {
1759        Self { inner, is_terminated }
1760    }
1761}
1762
1763impl futures::Stream for DeviceMonitorRequestStream {
1764    type Item = Result<DeviceMonitorRequest, fidl::Error>;
1765
1766    fn poll_next(
1767        mut self: std::pin::Pin<&mut Self>,
1768        cx: &mut std::task::Context<'_>,
1769    ) -> std::task::Poll<Option<Self::Item>> {
1770        let this = &mut *self;
1771        if this.inner.check_shutdown(cx) {
1772            this.is_terminated = true;
1773            return std::task::Poll::Ready(None);
1774        }
1775        if this.is_terminated {
1776            panic!("polled DeviceMonitorRequestStream after completion");
1777        }
1778        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1779            |bytes, handles| {
1780                match this.inner.channel().read_etc(cx, bytes, handles) {
1781                    std::task::Poll::Ready(Ok(())) => {}
1782                    std::task::Poll::Pending => return std::task::Poll::Pending,
1783                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1784                        this.is_terminated = true;
1785                        return std::task::Poll::Ready(None);
1786                    }
1787                    std::task::Poll::Ready(Err(e)) => {
1788                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1789                            e.into(),
1790                        ))));
1791                    }
1792                }
1793
1794                // A message has been received from the channel
1795                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1796
1797                std::task::Poll::Ready(Some(match header.ordinal {
1798                    0x3a08518874196aab => {
1799                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1800                        let mut req = fidl::new_empty!(
1801                            fidl::encoding::EmptyPayload,
1802                            fidl::encoding::DefaultFuchsiaResourceDialect
1803                        );
1804                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1805                        let control_handle =
1806                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1807                        Ok(DeviceMonitorRequest::ListPhys {
1808                            responder: DeviceMonitorListPhysResponder {
1809                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1810                                tx_id: header.tx_id,
1811                            },
1812                        })
1813                    }
1814                    0x129e758fb8e0b113 => {
1815                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1816                        let mut req = fidl::new_empty!(
1817                            fidl::encoding::EmptyPayload,
1818                            fidl::encoding::DefaultFuchsiaResourceDialect
1819                        );
1820                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1821                        let control_handle =
1822                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1823                        Ok(DeviceMonitorRequest::ListIfaces {
1824                            responder: DeviceMonitorListIfacesResponder {
1825                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1826                                tx_id: header.tx_id,
1827                            },
1828                        })
1829                    }
1830                    0x4aa489b57113bccf => {
1831                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1832                        let mut req = fidl::new_empty!(
1833                            DeviceMonitorGetDevPathRequest,
1834                            fidl::encoding::DefaultFuchsiaResourceDialect
1835                        );
1836                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetDevPathRequest>(&header, _body_bytes, handles, &mut req)?;
1837                        let control_handle =
1838                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1839                        Ok(DeviceMonitorRequest::GetDevPath {
1840                            phy_id: req.phy_id,
1841
1842                            responder: DeviceMonitorGetDevPathResponder {
1843                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1844                                tx_id: header.tx_id,
1845                            },
1846                        })
1847                    }
1848                    0x172b3d2eabd5a14e => {
1849                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1850                        let mut req = fidl::new_empty!(
1851                            DeviceMonitorGetSupportedMacRolesRequest,
1852                            fidl::encoding::DefaultFuchsiaResourceDialect
1853                        );
1854                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetSupportedMacRolesRequest>(&header, _body_bytes, handles, &mut req)?;
1855                        let control_handle =
1856                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1857                        Ok(DeviceMonitorRequest::GetSupportedMacRoles {
1858                            phy_id: req.phy_id,
1859
1860                            responder: DeviceMonitorGetSupportedMacRolesResponder {
1861                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1862                                tx_id: header.tx_id,
1863                            },
1864                        })
1865                    }
1866                    0x4615941e67e31b8e => {
1867                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1868                        let mut req = fidl::new_empty!(
1869                            DeviceMonitorWatchDevicesRequest,
1870                            fidl::encoding::DefaultFuchsiaResourceDialect
1871                        );
1872                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorWatchDevicesRequest>(&header, _body_bytes, handles, &mut req)?;
1873                        let control_handle =
1874                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1875                        Ok(DeviceMonitorRequest::WatchDevices {
1876                            watcher: req.watcher,
1877
1878                            control_handle,
1879                        })
1880                    }
1881                    0x2c5af9d064099745 => {
1882                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1883                        let mut req = fidl::new_empty!(
1884                            DeviceMonitorWatchPhyEventsRequest,
1885                            fidl::encoding::DefaultFuchsiaResourceDialect
1886                        );
1887                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorWatchPhyEventsRequest>(&header, _body_bytes, handles, &mut req)?;
1888                        let control_handle =
1889                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1890                        Ok(DeviceMonitorRequest::WatchPhyEvents {
1891                            watcher: req.watcher,
1892
1893                            control_handle,
1894                        })
1895                    }
1896                    0x6f1040bd81bde90e => {
1897                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1898                        let mut req = fidl::new_empty!(
1899                            DeviceMonitorGetCountryRequest,
1900                            fidl::encoding::DefaultFuchsiaResourceDialect
1901                        );
1902                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetCountryRequest>(&header, _body_bytes, handles, &mut req)?;
1903                        let control_handle =
1904                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1905                        Ok(DeviceMonitorRequest::GetCountry {
1906                            phy_id: req.phy_id,
1907
1908                            responder: DeviceMonitorGetCountryResponder {
1909                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1910                                tx_id: header.tx_id,
1911                            },
1912                        })
1913                    }
1914                    0xdaa7b77a5a6e71b => {
1915                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1916                        let mut req = fidl::new_empty!(
1917                            DeviceMonitorSetCountryRequest,
1918                            fidl::encoding::DefaultFuchsiaResourceDialect
1919                        );
1920                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorSetCountryRequest>(&header, _body_bytes, handles, &mut req)?;
1921                        let control_handle =
1922                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1923                        Ok(DeviceMonitorRequest::SetCountry {
1924                            req: req.req,
1925
1926                            responder: DeviceMonitorSetCountryResponder {
1927                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1928                                tx_id: header.tx_id,
1929                            },
1930                        })
1931                    }
1932                    0x66714d61103120e9 => {
1933                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1934                        let mut req = fidl::new_empty!(
1935                            DeviceMonitorClearCountryRequest,
1936                            fidl::encoding::DefaultFuchsiaResourceDialect
1937                        );
1938                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorClearCountryRequest>(&header, _body_bytes, handles, &mut req)?;
1939                        let control_handle =
1940                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1941                        Ok(DeviceMonitorRequest::ClearCountry {
1942                            req: req.req,
1943
1944                            responder: DeviceMonitorClearCountryResponder {
1945                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1946                                tx_id: header.tx_id,
1947                            },
1948                        })
1949                    }
1950                    0x62202b4d360533bc => {
1951                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1952                        let mut req = fidl::new_empty!(
1953                            DeviceMonitorSetPowerSaveModeRequest,
1954                            fidl::encoding::DefaultFuchsiaResourceDialect
1955                        );
1956                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorSetPowerSaveModeRequest>(&header, _body_bytes, handles, &mut req)?;
1957                        let control_handle =
1958                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1959                        Ok(DeviceMonitorRequest::SetPowerSaveMode {
1960                            req: req.req,
1961
1962                            responder: DeviceMonitorSetPowerSaveModeResponder {
1963                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1964                                tx_id: header.tx_id,
1965                            },
1966                        })
1967                    }
1968                    0x14304d406ada8693 => {
1969                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1970                        let mut req = fidl::new_empty!(
1971                            DeviceMonitorGetPowerSaveModeRequest,
1972                            fidl::encoding::DefaultFuchsiaResourceDialect
1973                        );
1974                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetPowerSaveModeRequest>(&header, _body_bytes, handles, &mut req)?;
1975                        let control_handle =
1976                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1977                        Ok(DeviceMonitorRequest::GetPowerSaveMode {
1978                            phy_id: req.phy_id,
1979
1980                            responder: DeviceMonitorGetPowerSaveModeResponder {
1981                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1982                                tx_id: header.tx_id,
1983                            },
1984                        })
1985                    }
1986                    0x374ad717fe8902e0 => {
1987                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1988                        let mut req = fidl::new_empty!(
1989                            DeviceMonitorPowerDownRequest,
1990                            fidl::encoding::DefaultFuchsiaResourceDialect
1991                        );
1992                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorPowerDownRequest>(&header, _body_bytes, handles, &mut req)?;
1993                        let control_handle =
1994                            DeviceMonitorControlHandle { inner: this.inner.clone() };
1995                        Ok(DeviceMonitorRequest::PowerDown {
1996                            phy_id: req.phy_id,
1997
1998                            responder: DeviceMonitorPowerDownResponder {
1999                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2000                                tx_id: header.tx_id,
2001                            },
2002                        })
2003                    }
2004                    0xa2379b639869c17 => {
2005                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2006                        let mut req = fidl::new_empty!(
2007                            DeviceMonitorPowerUpRequest,
2008                            fidl::encoding::DefaultFuchsiaResourceDialect
2009                        );
2010                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorPowerUpRequest>(&header, _body_bytes, handles, &mut req)?;
2011                        let control_handle =
2012                            DeviceMonitorControlHandle { inner: this.inner.clone() };
2013                        Ok(DeviceMonitorRequest::PowerUp {
2014                            phy_id: req.phy_id,
2015
2016                            responder: DeviceMonitorPowerUpResponder {
2017                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2018                                tx_id: header.tx_id,
2019                            },
2020                        })
2021                    }
2022                    0x6def240c9f8c6867 => {
2023                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2024                        let mut req = fidl::new_empty!(
2025                            DeviceMonitorResetRequest,
2026                            fidl::encoding::DefaultFuchsiaResourceDialect
2027                        );
2028                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorResetRequest>(&header, _body_bytes, handles, &mut req)?;
2029                        let control_handle =
2030                            DeviceMonitorControlHandle { inner: this.inner.clone() };
2031                        Ok(DeviceMonitorRequest::Reset {
2032                            phy_id: req.phy_id,
2033
2034                            responder: DeviceMonitorResetResponder {
2035                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2036                                tx_id: header.tx_id,
2037                            },
2038                        })
2039                    }
2040                    0x7c51443a985934fd => {
2041                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2042                        let mut req = fidl::new_empty!(
2043                            DeviceMonitorSetTxPowerScenarioRequest,
2044                            fidl::encoding::DefaultFuchsiaResourceDialect
2045                        );
2046                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorSetTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
2047                        let control_handle =
2048                            DeviceMonitorControlHandle { inner: this.inner.clone() };
2049                        Ok(DeviceMonitorRequest::SetTxPowerScenario {
2050                            phy_id: req.phy_id,
2051                            scenario: req.scenario,
2052
2053                            responder: DeviceMonitorSetTxPowerScenarioResponder {
2054                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2055                                tx_id: header.tx_id,
2056                            },
2057                        })
2058                    }
2059                    0x4790357c9cdddc4a => {
2060                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2061                        let mut req = fidl::new_empty!(
2062                            DeviceMonitorResetTxPowerScenarioRequest,
2063                            fidl::encoding::DefaultFuchsiaResourceDialect
2064                        );
2065                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorResetTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
2066                        let control_handle =
2067                            DeviceMonitorControlHandle { inner: this.inner.clone() };
2068                        Ok(DeviceMonitorRequest::ResetTxPowerScenario {
2069                            phy_id: req.phy_id,
2070
2071                            responder: DeviceMonitorResetTxPowerScenarioResponder {
2072                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2073                                tx_id: header.tx_id,
2074                            },
2075                        })
2076                    }
2077                    0x555fb197f90e9830 => {
2078                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2079                        let mut req = fidl::new_empty!(
2080                            DeviceMonitorGetTxPowerScenarioRequest,
2081                            fidl::encoding::DefaultFuchsiaResourceDialect
2082                        );
2083                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetTxPowerScenarioRequest>(&header, _body_bytes, handles, &mut req)?;
2084                        let control_handle =
2085                            DeviceMonitorControlHandle { inner: this.inner.clone() };
2086                        Ok(DeviceMonitorRequest::GetTxPowerScenario {
2087                            phy_id: req.phy_id,
2088
2089                            responder: DeviceMonitorGetTxPowerScenarioResponder {
2090                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2091                                tx_id: header.tx_id,
2092                            },
2093                        })
2094                    }
2095                    0x58cf95c5bbbe3f => {
2096                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2097                        let mut req = fidl::new_empty!(
2098                            DeviceMonitorGetPowerStateRequest,
2099                            fidl::encoding::DefaultFuchsiaResourceDialect
2100                        );
2101                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetPowerStateRequest>(&header, _body_bytes, handles, &mut req)?;
2102                        let control_handle =
2103                            DeviceMonitorControlHandle { inner: this.inner.clone() };
2104                        Ok(DeviceMonitorRequest::GetPowerState {
2105                            phy_id: req.phy_id,
2106
2107                            responder: DeviceMonitorGetPowerStateResponder {
2108                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2109                                tx_id: header.tx_id,
2110                            },
2111                        })
2112                    }
2113                    0x97539596c9a79c7 => {
2114                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2115                        let mut req = fidl::new_empty!(
2116                            DeviceMonitorSetBtCoexistenceModeRequest,
2117                            fidl::encoding::DefaultFuchsiaResourceDialect
2118                        );
2119                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorSetBtCoexistenceModeRequest>(&header, _body_bytes, handles, &mut req)?;
2120                        let control_handle =
2121                            DeviceMonitorControlHandle { inner: this.inner.clone() };
2122                        Ok(DeviceMonitorRequest::SetBtCoexistenceMode {
2123                            phy_id: req.phy_id,
2124                            mode: req.mode,
2125
2126                            responder: DeviceMonitorSetBtCoexistenceModeResponder {
2127                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2128                                tx_id: header.tx_id,
2129                            },
2130                        })
2131                    }
2132                    0x1e1d30c24c0ec144 => {
2133                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2134                        let mut req = fidl::new_empty!(
2135                            DeviceMonitorCreateIfaceRequest,
2136                            fidl::encoding::DefaultFuchsiaResourceDialect
2137                        );
2138                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorCreateIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
2139                        let control_handle =
2140                            DeviceMonitorControlHandle { inner: this.inner.clone() };
2141                        Ok(DeviceMonitorRequest::CreateIface {
2142                            payload: req,
2143                            responder: DeviceMonitorCreateIfaceResponder {
2144                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2145                                tx_id: header.tx_id,
2146                            },
2147                        })
2148                    }
2149                    0x1a48c4a2b86259ef => {
2150                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2151                        let mut req = fidl::new_empty!(
2152                            DeviceMonitorQueryIfaceRequest,
2153                            fidl::encoding::DefaultFuchsiaResourceDialect
2154                        );
2155                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorQueryIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
2156                        let control_handle =
2157                            DeviceMonitorControlHandle { inner: this.inner.clone() };
2158                        Ok(DeviceMonitorRequest::QueryIface {
2159                            iface_id: req.iface_id,
2160
2161                            responder: DeviceMonitorQueryIfaceResponder {
2162                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2163                                tx_id: header.tx_id,
2164                            },
2165                        })
2166                    }
2167                    0x4c77982c1616a3b0 => {
2168                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2169                        let mut req = fidl::new_empty!(
2170                            DeviceMonitorDestroyIfaceRequest,
2171                            fidl::encoding::DefaultFuchsiaResourceDialect
2172                        );
2173                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorDestroyIfaceRequest>(&header, _body_bytes, handles, &mut req)?;
2174                        let control_handle =
2175                            DeviceMonitorControlHandle { inner: this.inner.clone() };
2176                        Ok(DeviceMonitorRequest::DestroyIface {
2177                            req: req.req,
2178
2179                            responder: DeviceMonitorDestroyIfaceResponder {
2180                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2181                                tx_id: header.tx_id,
2182                            },
2183                        })
2184                    }
2185                    0x37e8b884766de0f8 => {
2186                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2187                        let mut req = fidl::new_empty!(
2188                            DeviceMonitorQueryIfaceCapabilitiesRequest,
2189                            fidl::encoding::DefaultFuchsiaResourceDialect
2190                        );
2191                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorQueryIfaceCapabilitiesRequest>(&header, _body_bytes, handles, &mut req)?;
2192                        let control_handle =
2193                            DeviceMonitorControlHandle { inner: this.inner.clone() };
2194                        Ok(DeviceMonitorRequest::QueryIfaceCapabilities {
2195                            iface_id: req.iface_id,
2196
2197                            responder: DeviceMonitorQueryIfaceCapabilitiesResponder {
2198                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2199                                tx_id: header.tx_id,
2200                            },
2201                        })
2202                    }
2203                    0x1b056c379ca98273 => {
2204                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2205                        let mut req = fidl::new_empty!(
2206                            DeviceMonitorGetClientSmeRequest,
2207                            fidl::encoding::DefaultFuchsiaResourceDialect
2208                        );
2209                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetClientSmeRequest>(&header, _body_bytes, handles, &mut req)?;
2210                        let control_handle =
2211                            DeviceMonitorControlHandle { inner: this.inner.clone() };
2212                        Ok(DeviceMonitorRequest::GetClientSme {
2213                            iface_id: req.iface_id,
2214                            sme_server: req.sme_server,
2215
2216                            responder: DeviceMonitorGetClientSmeResponder {
2217                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2218                                tx_id: header.tx_id,
2219                            },
2220                        })
2221                    }
2222                    0x754de680c4318c52 => {
2223                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2224                        let mut req = fidl::new_empty!(
2225                            DeviceMonitorGetApSmeRequest,
2226                            fidl::encoding::DefaultFuchsiaResourceDialect
2227                        );
2228                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetApSmeRequest>(&header, _body_bytes, handles, &mut req)?;
2229                        let control_handle =
2230                            DeviceMonitorControlHandle { inner: this.inner.clone() };
2231                        Ok(DeviceMonitorRequest::GetApSme {
2232                            iface_id: req.iface_id,
2233                            sme_server: req.sme_server,
2234
2235                            responder: DeviceMonitorGetApSmeResponder {
2236                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2237                                tx_id: header.tx_id,
2238                            },
2239                        })
2240                    }
2241                    0x1baf42b003f7452a => {
2242                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2243                        let mut req = fidl::new_empty!(
2244                            DeviceMonitorGetSmeTelemetryRequest,
2245                            fidl::encoding::DefaultFuchsiaResourceDialect
2246                        );
2247                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceMonitorGetSmeTelemetryRequest>(&header, _body_bytes, handles, &mut req)?;
2248                        let control_handle =
2249                            DeviceMonitorControlHandle { inner: this.inner.clone() };
2250                        Ok(DeviceMonitorRequest::GetSmeTelemetry {
2251                            iface_id: req.iface_id,
2252                            telemetry_server: req.telemetry_server,
2253
2254                            responder: DeviceMonitorGetSmeTelemetryResponder {
2255                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2256                                tx_id: header.tx_id,
2257                            },
2258                        })
2259                    }
2260                    _ => Err(fidl::Error::UnknownOrdinal {
2261                        ordinal: header.ordinal,
2262                        protocol_name:
2263                            <DeviceMonitorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2264                    }),
2265                }))
2266            },
2267        )
2268    }
2269}
2270
2271#[derive(Debug)]
2272pub enum DeviceMonitorRequest {
2273    ListPhys {
2274        responder: DeviceMonitorListPhysResponder,
2275    },
2276    ListIfaces {
2277        responder: DeviceMonitorListIfacesResponder,
2278    },
2279    GetDevPath {
2280        phy_id: u16,
2281        responder: DeviceMonitorGetDevPathResponder,
2282    },
2283    GetSupportedMacRoles {
2284        phy_id: u16,
2285        responder: DeviceMonitorGetSupportedMacRolesResponder,
2286    },
2287    WatchDevices {
2288        watcher: fidl::endpoints::ServerEnd<DeviceWatcherMarker>,
2289        control_handle: DeviceMonitorControlHandle,
2290    },
2291    WatchPhyEvents {
2292        watcher: fidl::endpoints::ServerEnd<PhyEventWatcherMarker>,
2293        control_handle: DeviceMonitorControlHandle,
2294    },
2295    GetCountry {
2296        phy_id: u16,
2297        responder: DeviceMonitorGetCountryResponder,
2298    },
2299    SetCountry {
2300        req: SetCountryRequest,
2301        responder: DeviceMonitorSetCountryResponder,
2302    },
2303    ClearCountry {
2304        req: ClearCountryRequest,
2305        responder: DeviceMonitorClearCountryResponder,
2306    },
2307    SetPowerSaveMode {
2308        req: SetPowerSaveModeRequest,
2309        responder: DeviceMonitorSetPowerSaveModeResponder,
2310    },
2311    GetPowerSaveMode {
2312        phy_id: u16,
2313        responder: DeviceMonitorGetPowerSaveModeResponder,
2314    },
2315    /// All interfaces should be deleted before calling this method. If supported, the
2316    /// wlan driver will power down the wlan chip. Refer to wlan.phyimpl fidl for more details.
2317    PowerDown {
2318        phy_id: u16,
2319        responder: DeviceMonitorPowerDownResponder,
2320    },
2321    /// If supported, the wlan driver will power up the wlan chip. Refer to wlan.phyimpl fidl
2322    /// for more details.
2323    PowerUp {
2324        phy_id: u16,
2325        responder: DeviceMonitorPowerUpResponder,
2326    },
2327    /// If supported, the wlan driver will reset the wlan chip. An attempt is made to delete
2328    /// any existing interfaces. Refer to wlan.phyimpl fidl for more details.
2329    Reset {
2330        phy_id: u16,
2331        responder: DeviceMonitorResetResponder,
2332    },
2333    /// Applies the provided TxPowerScenario to the specified PHY.
2334    SetTxPowerScenario {
2335        phy_id: u16,
2336        scenario: fidl_fuchsia_wlan_internal::TxPowerScenario,
2337        responder: DeviceMonitorSetTxPowerScenarioResponder,
2338    },
2339    /// Clears any existing TxPowerScenario that has been applied and resets the PHY to use its default TxPowerScenario.
2340    ResetTxPowerScenario {
2341        phy_id: u16,
2342        responder: DeviceMonitorResetTxPowerScenarioResponder,
2343    },
2344    /// Queries the current TxPowerScenario setting for the specified PHY.
2345    GetTxPowerScenario {
2346        phy_id: u16,
2347        responder: DeviceMonitorGetTxPowerScenarioResponder,
2348    },
2349    /// This will return the current power state of the wlan chip.
2350    GetPowerState {
2351        phy_id: u16,
2352        responder: DeviceMonitorGetPowerStateResponder,
2353    },
2354    /// Set the Bluetooth coexistence mode.
2355    /// Likely errors include:
2356    ///     * NOT_FOUND: The given phy_id does not exist.
2357    ///     * NOT_SUPPORTED: The specified BT coexistence mode is not supported.
2358    SetBtCoexistenceMode {
2359        phy_id: u16,
2360        mode: fidl_fuchsia_wlan_internal::BtCoexistenceMode,
2361        responder: DeviceMonitorSetBtCoexistenceModeResponder,
2362    },
2363    CreateIface {
2364        payload: DeviceMonitorCreateIfaceRequest,
2365        responder: DeviceMonitorCreateIfaceResponder,
2366    },
2367    QueryIface {
2368        iface_id: u16,
2369        responder: DeviceMonitorQueryIfaceResponder,
2370    },
2371    DestroyIface {
2372        req: DestroyIfaceRequest,
2373        responder: DeviceMonitorDestroyIfaceResponder,
2374    },
2375    QueryIfaceCapabilities {
2376        iface_id: u16,
2377        responder: DeviceMonitorQueryIfaceCapabilitiesResponder,
2378    },
2379    /// Attempt to establish a new connection to a Client SME.
2380    /// Connections may be established for the whole lifetime of the SME,
2381    /// but concurrent connections might lead to unexpected behavior.
2382    /// Likely errors include:
2383    ///     * NOT_FOUND: The given iface_id does not exist.
2384    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
2385    ///     * PEER_CLOSED: The underlying SME is shutting down.
2386    GetClientSme {
2387        iface_id: u16,
2388        sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
2389        responder: DeviceMonitorGetClientSmeResponder,
2390    },
2391    /// Attempt to establish a new connection to an AP SME.
2392    /// Connections may be established for the whole lifetime of the SME,
2393    /// but concurrent connections might lead to unexpected behavior.
2394    /// Likely errors include:
2395    ///     * NOT_FOUND: The given iface_id does not exist.
2396    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
2397    ///     * PEER_CLOSED: The underlying SME is shutting down.
2398    GetApSme {
2399        iface_id: u16,
2400        sme_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
2401        responder: DeviceMonitorGetApSmeResponder,
2402    },
2403    /// Attempt to establish a new connection to telemetry for an SME.
2404    /// Connections may be established for the whole lifetime of the SME, and
2405    /// concurrent connections are safe since this is a read-only API.
2406    /// Likely errors include:
2407    ///     * NOT_FOUND: The given iface_id does not exist.
2408    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
2409    ///     * PEER_CLOSED: The underlying SME is shutting down.
2410    GetSmeTelemetry {
2411        iface_id: u16,
2412        telemetry_server: fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
2413        responder: DeviceMonitorGetSmeTelemetryResponder,
2414    },
2415}
2416
2417impl DeviceMonitorRequest {
2418    #[allow(irrefutable_let_patterns)]
2419    pub fn into_list_phys(self) -> Option<(DeviceMonitorListPhysResponder)> {
2420        if let DeviceMonitorRequest::ListPhys { responder } = self {
2421            Some((responder))
2422        } else {
2423            None
2424        }
2425    }
2426
2427    #[allow(irrefutable_let_patterns)]
2428    pub fn into_list_ifaces(self) -> Option<(DeviceMonitorListIfacesResponder)> {
2429        if let DeviceMonitorRequest::ListIfaces { responder } = self {
2430            Some((responder))
2431        } else {
2432            None
2433        }
2434    }
2435
2436    #[allow(irrefutable_let_patterns)]
2437    pub fn into_get_dev_path(self) -> Option<(u16, DeviceMonitorGetDevPathResponder)> {
2438        if let DeviceMonitorRequest::GetDevPath { phy_id, responder } = self {
2439            Some((phy_id, responder))
2440        } else {
2441            None
2442        }
2443    }
2444
2445    #[allow(irrefutable_let_patterns)]
2446    pub fn into_get_supported_mac_roles(
2447        self,
2448    ) -> Option<(u16, DeviceMonitorGetSupportedMacRolesResponder)> {
2449        if let DeviceMonitorRequest::GetSupportedMacRoles { phy_id, responder } = self {
2450            Some((phy_id, responder))
2451        } else {
2452            None
2453        }
2454    }
2455
2456    #[allow(irrefutable_let_patterns)]
2457    pub fn into_watch_devices(
2458        self,
2459    ) -> Option<(fidl::endpoints::ServerEnd<DeviceWatcherMarker>, DeviceMonitorControlHandle)> {
2460        if let DeviceMonitorRequest::WatchDevices { watcher, control_handle } = self {
2461            Some((watcher, control_handle))
2462        } else {
2463            None
2464        }
2465    }
2466
2467    #[allow(irrefutable_let_patterns)]
2468    pub fn into_watch_phy_events(
2469        self,
2470    ) -> Option<(fidl::endpoints::ServerEnd<PhyEventWatcherMarker>, DeviceMonitorControlHandle)>
2471    {
2472        if let DeviceMonitorRequest::WatchPhyEvents { watcher, control_handle } = self {
2473            Some((watcher, control_handle))
2474        } else {
2475            None
2476        }
2477    }
2478
2479    #[allow(irrefutable_let_patterns)]
2480    pub fn into_get_country(self) -> Option<(u16, DeviceMonitorGetCountryResponder)> {
2481        if let DeviceMonitorRequest::GetCountry { phy_id, responder } = self {
2482            Some((phy_id, responder))
2483        } else {
2484            None
2485        }
2486    }
2487
2488    #[allow(irrefutable_let_patterns)]
2489    pub fn into_set_country(self) -> Option<(SetCountryRequest, DeviceMonitorSetCountryResponder)> {
2490        if let DeviceMonitorRequest::SetCountry { req, responder } = self {
2491            Some((req, responder))
2492        } else {
2493            None
2494        }
2495    }
2496
2497    #[allow(irrefutable_let_patterns)]
2498    pub fn into_clear_country(
2499        self,
2500    ) -> Option<(ClearCountryRequest, DeviceMonitorClearCountryResponder)> {
2501        if let DeviceMonitorRequest::ClearCountry { req, responder } = self {
2502            Some((req, responder))
2503        } else {
2504            None
2505        }
2506    }
2507
2508    #[allow(irrefutable_let_patterns)]
2509    pub fn into_set_power_save_mode(
2510        self,
2511    ) -> Option<(SetPowerSaveModeRequest, DeviceMonitorSetPowerSaveModeResponder)> {
2512        if let DeviceMonitorRequest::SetPowerSaveMode { req, responder } = self {
2513            Some((req, responder))
2514        } else {
2515            None
2516        }
2517    }
2518
2519    #[allow(irrefutable_let_patterns)]
2520    pub fn into_get_power_save_mode(self) -> Option<(u16, DeviceMonitorGetPowerSaveModeResponder)> {
2521        if let DeviceMonitorRequest::GetPowerSaveMode { phy_id, responder } = self {
2522            Some((phy_id, responder))
2523        } else {
2524            None
2525        }
2526    }
2527
2528    #[allow(irrefutable_let_patterns)]
2529    pub fn into_power_down(self) -> Option<(u16, DeviceMonitorPowerDownResponder)> {
2530        if let DeviceMonitorRequest::PowerDown { phy_id, responder } = self {
2531            Some((phy_id, responder))
2532        } else {
2533            None
2534        }
2535    }
2536
2537    #[allow(irrefutable_let_patterns)]
2538    pub fn into_power_up(self) -> Option<(u16, DeviceMonitorPowerUpResponder)> {
2539        if let DeviceMonitorRequest::PowerUp { phy_id, responder } = self {
2540            Some((phy_id, responder))
2541        } else {
2542            None
2543        }
2544    }
2545
2546    #[allow(irrefutable_let_patterns)]
2547    pub fn into_reset(self) -> Option<(u16, DeviceMonitorResetResponder)> {
2548        if let DeviceMonitorRequest::Reset { phy_id, responder } = self {
2549            Some((phy_id, responder))
2550        } else {
2551            None
2552        }
2553    }
2554
2555    #[allow(irrefutable_let_patterns)]
2556    pub fn into_set_tx_power_scenario(
2557        self,
2558    ) -> Option<(
2559        u16,
2560        fidl_fuchsia_wlan_internal::TxPowerScenario,
2561        DeviceMonitorSetTxPowerScenarioResponder,
2562    )> {
2563        if let DeviceMonitorRequest::SetTxPowerScenario { phy_id, scenario, responder } = self {
2564            Some((phy_id, scenario, responder))
2565        } else {
2566            None
2567        }
2568    }
2569
2570    #[allow(irrefutable_let_patterns)]
2571    pub fn into_reset_tx_power_scenario(
2572        self,
2573    ) -> Option<(u16, DeviceMonitorResetTxPowerScenarioResponder)> {
2574        if let DeviceMonitorRequest::ResetTxPowerScenario { phy_id, responder } = self {
2575            Some((phy_id, responder))
2576        } else {
2577            None
2578        }
2579    }
2580
2581    #[allow(irrefutable_let_patterns)]
2582    pub fn into_get_tx_power_scenario(
2583        self,
2584    ) -> Option<(u16, DeviceMonitorGetTxPowerScenarioResponder)> {
2585        if let DeviceMonitorRequest::GetTxPowerScenario { phy_id, responder } = self {
2586            Some((phy_id, responder))
2587        } else {
2588            None
2589        }
2590    }
2591
2592    #[allow(irrefutable_let_patterns)]
2593    pub fn into_get_power_state(self) -> Option<(u16, DeviceMonitorGetPowerStateResponder)> {
2594        if let DeviceMonitorRequest::GetPowerState { phy_id, responder } = self {
2595            Some((phy_id, responder))
2596        } else {
2597            None
2598        }
2599    }
2600
2601    #[allow(irrefutable_let_patterns)]
2602    pub fn into_set_bt_coexistence_mode(
2603        self,
2604    ) -> Option<(
2605        u16,
2606        fidl_fuchsia_wlan_internal::BtCoexistenceMode,
2607        DeviceMonitorSetBtCoexistenceModeResponder,
2608    )> {
2609        if let DeviceMonitorRequest::SetBtCoexistenceMode { phy_id, mode, responder } = self {
2610            Some((phy_id, mode, responder))
2611        } else {
2612            None
2613        }
2614    }
2615
2616    #[allow(irrefutable_let_patterns)]
2617    pub fn into_create_iface(
2618        self,
2619    ) -> Option<(DeviceMonitorCreateIfaceRequest, DeviceMonitorCreateIfaceResponder)> {
2620        if let DeviceMonitorRequest::CreateIface { payload, responder } = self {
2621            Some((payload, responder))
2622        } else {
2623            None
2624        }
2625    }
2626
2627    #[allow(irrefutable_let_patterns)]
2628    pub fn into_query_iface(self) -> Option<(u16, DeviceMonitorQueryIfaceResponder)> {
2629        if let DeviceMonitorRequest::QueryIface { iface_id, responder } = self {
2630            Some((iface_id, responder))
2631        } else {
2632            None
2633        }
2634    }
2635
2636    #[allow(irrefutable_let_patterns)]
2637    pub fn into_destroy_iface(
2638        self,
2639    ) -> Option<(DestroyIfaceRequest, DeviceMonitorDestroyIfaceResponder)> {
2640        if let DeviceMonitorRequest::DestroyIface { req, responder } = self {
2641            Some((req, responder))
2642        } else {
2643            None
2644        }
2645    }
2646
2647    #[allow(irrefutable_let_patterns)]
2648    pub fn into_query_iface_capabilities(
2649        self,
2650    ) -> Option<(u16, DeviceMonitorQueryIfaceCapabilitiesResponder)> {
2651        if let DeviceMonitorRequest::QueryIfaceCapabilities { iface_id, responder } = self {
2652            Some((iface_id, responder))
2653        } else {
2654            None
2655        }
2656    }
2657
2658    #[allow(irrefutable_let_patterns)]
2659    pub fn into_get_client_sme(
2660        self,
2661    ) -> Option<(
2662        u16,
2663        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
2664        DeviceMonitorGetClientSmeResponder,
2665    )> {
2666        if let DeviceMonitorRequest::GetClientSme { iface_id, sme_server, responder } = self {
2667            Some((iface_id, sme_server, responder))
2668        } else {
2669            None
2670        }
2671    }
2672
2673    #[allow(irrefutable_let_patterns)]
2674    pub fn into_get_ap_sme(
2675        self,
2676    ) -> Option<(
2677        u16,
2678        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
2679        DeviceMonitorGetApSmeResponder,
2680    )> {
2681        if let DeviceMonitorRequest::GetApSme { iface_id, sme_server, responder } = self {
2682            Some((iface_id, sme_server, responder))
2683        } else {
2684            None
2685        }
2686    }
2687
2688    #[allow(irrefutable_let_patterns)]
2689    pub fn into_get_sme_telemetry(
2690        self,
2691    ) -> Option<(
2692        u16,
2693        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
2694        DeviceMonitorGetSmeTelemetryResponder,
2695    )> {
2696        if let DeviceMonitorRequest::GetSmeTelemetry { iface_id, telemetry_server, responder } =
2697            self
2698        {
2699            Some((iface_id, telemetry_server, responder))
2700        } else {
2701            None
2702        }
2703    }
2704
2705    /// Name of the method defined in FIDL
2706    pub fn method_name(&self) -> &'static str {
2707        match *self {
2708            DeviceMonitorRequest::ListPhys { .. } => "list_phys",
2709            DeviceMonitorRequest::ListIfaces { .. } => "list_ifaces",
2710            DeviceMonitorRequest::GetDevPath { .. } => "get_dev_path",
2711            DeviceMonitorRequest::GetSupportedMacRoles { .. } => "get_supported_mac_roles",
2712            DeviceMonitorRequest::WatchDevices { .. } => "watch_devices",
2713            DeviceMonitorRequest::WatchPhyEvents { .. } => "watch_phy_events",
2714            DeviceMonitorRequest::GetCountry { .. } => "get_country",
2715            DeviceMonitorRequest::SetCountry { .. } => "set_country",
2716            DeviceMonitorRequest::ClearCountry { .. } => "clear_country",
2717            DeviceMonitorRequest::SetPowerSaveMode { .. } => "set_power_save_mode",
2718            DeviceMonitorRequest::GetPowerSaveMode { .. } => "get_power_save_mode",
2719            DeviceMonitorRequest::PowerDown { .. } => "power_down",
2720            DeviceMonitorRequest::PowerUp { .. } => "power_up",
2721            DeviceMonitorRequest::Reset { .. } => "reset",
2722            DeviceMonitorRequest::SetTxPowerScenario { .. } => "set_tx_power_scenario",
2723            DeviceMonitorRequest::ResetTxPowerScenario { .. } => "reset_tx_power_scenario",
2724            DeviceMonitorRequest::GetTxPowerScenario { .. } => "get_tx_power_scenario",
2725            DeviceMonitorRequest::GetPowerState { .. } => "get_power_state",
2726            DeviceMonitorRequest::SetBtCoexistenceMode { .. } => "set_bt_coexistence_mode",
2727            DeviceMonitorRequest::CreateIface { .. } => "create_iface",
2728            DeviceMonitorRequest::QueryIface { .. } => "query_iface",
2729            DeviceMonitorRequest::DestroyIface { .. } => "destroy_iface",
2730            DeviceMonitorRequest::QueryIfaceCapabilities { .. } => "query_iface_capabilities",
2731            DeviceMonitorRequest::GetClientSme { .. } => "get_client_sme",
2732            DeviceMonitorRequest::GetApSme { .. } => "get_ap_sme",
2733            DeviceMonitorRequest::GetSmeTelemetry { .. } => "get_sme_telemetry",
2734        }
2735    }
2736}
2737
2738#[derive(Debug, Clone)]
2739pub struct DeviceMonitorControlHandle {
2740    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2741}
2742
2743impl fidl::endpoints::ControlHandle for DeviceMonitorControlHandle {
2744    fn shutdown(&self) {
2745        self.inner.shutdown()
2746    }
2747
2748    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2749        self.inner.shutdown_with_epitaph(status)
2750    }
2751
2752    fn is_closed(&self) -> bool {
2753        self.inner.channel().is_closed()
2754    }
2755    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2756        self.inner.channel().on_closed()
2757    }
2758
2759    #[cfg(target_os = "fuchsia")]
2760    fn signal_peer(
2761        &self,
2762        clear_mask: zx::Signals,
2763        set_mask: zx::Signals,
2764    ) -> Result<(), zx_status::Status> {
2765        use fidl::Peered;
2766        self.inner.channel().signal_peer(clear_mask, set_mask)
2767    }
2768}
2769
2770impl DeviceMonitorControlHandle {}
2771
2772#[must_use = "FIDL methods require a response to be sent"]
2773#[derive(Debug)]
2774pub struct DeviceMonitorListPhysResponder {
2775    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2776    tx_id: u32,
2777}
2778
2779/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
2780/// if the responder is dropped without sending a response, so that the client
2781/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2782impl std::ops::Drop for DeviceMonitorListPhysResponder {
2783    fn drop(&mut self) {
2784        self.control_handle.shutdown();
2785        // Safety: drops once, never accessed again
2786        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2787    }
2788}
2789
2790impl fidl::endpoints::Responder for DeviceMonitorListPhysResponder {
2791    type ControlHandle = DeviceMonitorControlHandle;
2792
2793    fn control_handle(&self) -> &DeviceMonitorControlHandle {
2794        &self.control_handle
2795    }
2796
2797    fn drop_without_shutdown(mut self) {
2798        // Safety: drops once, never accessed again due to mem::forget
2799        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2800        // Prevent Drop from running (which would shut down the channel)
2801        std::mem::forget(self);
2802    }
2803}
2804
2805impl DeviceMonitorListPhysResponder {
2806    /// Sends a response to the FIDL transaction.
2807    ///
2808    /// Sets the channel to shutdown if an error occurs.
2809    pub fn send(self, mut phy_list: &[u16]) -> Result<(), fidl::Error> {
2810        let _result = self.send_raw(phy_list);
2811        if _result.is_err() {
2812            self.control_handle.shutdown();
2813        }
2814        self.drop_without_shutdown();
2815        _result
2816    }
2817
2818    /// Similar to "send" but does not shutdown the channel if an error occurs.
2819    pub fn send_no_shutdown_on_err(self, mut phy_list: &[u16]) -> Result<(), fidl::Error> {
2820        let _result = self.send_raw(phy_list);
2821        self.drop_without_shutdown();
2822        _result
2823    }
2824
2825    fn send_raw(&self, mut phy_list: &[u16]) -> Result<(), fidl::Error> {
2826        self.control_handle.inner.send::<DeviceMonitorListPhysResponse>(
2827            (phy_list,),
2828            self.tx_id,
2829            0x3a08518874196aab,
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 DeviceMonitorListIfacesResponder {
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 DeviceMonitorListIfacesResponder {
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 DeviceMonitorListIfacesResponder {
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 DeviceMonitorListIfacesResponder {
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 iface_list: &[u16]) -> Result<(), fidl::Error> {
2873        let _result = self.send_raw(iface_list);
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 iface_list: &[u16]) -> Result<(), fidl::Error> {
2883        let _result = self.send_raw(iface_list);
2884        self.drop_without_shutdown();
2885        _result
2886    }
2887
2888    fn send_raw(&self, mut iface_list: &[u16]) -> Result<(), fidl::Error> {
2889        self.control_handle.inner.send::<DeviceMonitorListIfacesResponse>(
2890            (iface_list,),
2891            self.tx_id,
2892            0x129e758fb8e0b113,
2893            fidl::encoding::DynamicFlags::empty(),
2894        )
2895    }
2896}
2897
2898#[must_use = "FIDL methods require a response to be sent"]
2899#[derive(Debug)]
2900pub struct DeviceMonitorGetDevPathResponder {
2901    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2902    tx_id: u32,
2903}
2904
2905/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
2906/// if the responder is dropped without sending a response, so that the client
2907/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2908impl std::ops::Drop for DeviceMonitorGetDevPathResponder {
2909    fn drop(&mut self) {
2910        self.control_handle.shutdown();
2911        // Safety: drops once, never accessed again
2912        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2913    }
2914}
2915
2916impl fidl::endpoints::Responder for DeviceMonitorGetDevPathResponder {
2917    type ControlHandle = DeviceMonitorControlHandle;
2918
2919    fn control_handle(&self) -> &DeviceMonitorControlHandle {
2920        &self.control_handle
2921    }
2922
2923    fn drop_without_shutdown(mut self) {
2924        // Safety: drops once, never accessed again due to mem::forget
2925        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2926        // Prevent Drop from running (which would shut down the channel)
2927        std::mem::forget(self);
2928    }
2929}
2930
2931impl DeviceMonitorGetDevPathResponder {
2932    /// Sends a response to the FIDL transaction.
2933    ///
2934    /// Sets the channel to shutdown if an error occurs.
2935    pub fn send(self, mut dev_path: Option<&str>) -> Result<(), fidl::Error> {
2936        let _result = self.send_raw(dev_path);
2937        if _result.is_err() {
2938            self.control_handle.shutdown();
2939        }
2940        self.drop_without_shutdown();
2941        _result
2942    }
2943
2944    /// Similar to "send" but does not shutdown the channel if an error occurs.
2945    pub fn send_no_shutdown_on_err(self, mut dev_path: Option<&str>) -> Result<(), fidl::Error> {
2946        let _result = self.send_raw(dev_path);
2947        self.drop_without_shutdown();
2948        _result
2949    }
2950
2951    fn send_raw(&self, mut dev_path: Option<&str>) -> Result<(), fidl::Error> {
2952        self.control_handle.inner.send::<DeviceMonitorGetDevPathResponse>(
2953            (dev_path,),
2954            self.tx_id,
2955            0x4aa489b57113bccf,
2956            fidl::encoding::DynamicFlags::empty(),
2957        )
2958    }
2959}
2960
2961#[must_use = "FIDL methods require a response to be sent"]
2962#[derive(Debug)]
2963pub struct DeviceMonitorGetSupportedMacRolesResponder {
2964    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
2965    tx_id: u32,
2966}
2967
2968/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
2969/// if the responder is dropped without sending a response, so that the client
2970/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2971impl std::ops::Drop for DeviceMonitorGetSupportedMacRolesResponder {
2972    fn drop(&mut self) {
2973        self.control_handle.shutdown();
2974        // Safety: drops once, never accessed again
2975        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2976    }
2977}
2978
2979impl fidl::endpoints::Responder for DeviceMonitorGetSupportedMacRolesResponder {
2980    type ControlHandle = DeviceMonitorControlHandle;
2981
2982    fn control_handle(&self) -> &DeviceMonitorControlHandle {
2983        &self.control_handle
2984    }
2985
2986    fn drop_without_shutdown(mut self) {
2987        // Safety: drops once, never accessed again due to mem::forget
2988        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2989        // Prevent Drop from running (which would shut down the channel)
2990        std::mem::forget(self);
2991    }
2992}
2993
2994impl DeviceMonitorGetSupportedMacRolesResponder {
2995    /// Sends a response to the FIDL transaction.
2996    ///
2997    /// Sets the channel to shutdown if an error occurs.
2998    pub fn send(
2999        self,
3000        mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
3001    ) -> Result<(), fidl::Error> {
3002        let _result = self.send_raw(result);
3003        if _result.is_err() {
3004            self.control_handle.shutdown();
3005        }
3006        self.drop_without_shutdown();
3007        _result
3008    }
3009
3010    /// Similar to "send" but does not shutdown the channel if an error occurs.
3011    pub fn send_no_shutdown_on_err(
3012        self,
3013        mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
3014    ) -> Result<(), fidl::Error> {
3015        let _result = self.send_raw(result);
3016        self.drop_without_shutdown();
3017        _result
3018    }
3019
3020    fn send_raw(
3021        &self,
3022        mut result: Result<&[fidl_fuchsia_wlan_common::WlanMacRole], i32>,
3023    ) -> Result<(), fidl::Error> {
3024        self.control_handle.inner.send::<fidl::encoding::ResultType<
3025            DeviceMonitorGetSupportedMacRolesResponse,
3026            i32,
3027        >>(
3028            result.map(|supported_mac_roles| (supported_mac_roles,)),
3029            self.tx_id,
3030            0x172b3d2eabd5a14e,
3031            fidl::encoding::DynamicFlags::empty(),
3032        )
3033    }
3034}
3035
3036#[must_use = "FIDL methods require a response to be sent"]
3037#[derive(Debug)]
3038pub struct DeviceMonitorGetCountryResponder {
3039    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3040    tx_id: u32,
3041}
3042
3043/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3044/// if the responder is dropped without sending a response, so that the client
3045/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3046impl std::ops::Drop for DeviceMonitorGetCountryResponder {
3047    fn drop(&mut self) {
3048        self.control_handle.shutdown();
3049        // Safety: drops once, never accessed again
3050        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3051    }
3052}
3053
3054impl fidl::endpoints::Responder for DeviceMonitorGetCountryResponder {
3055    type ControlHandle = DeviceMonitorControlHandle;
3056
3057    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3058        &self.control_handle
3059    }
3060
3061    fn drop_without_shutdown(mut self) {
3062        // Safety: drops once, never accessed again due to mem::forget
3063        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3064        // Prevent Drop from running (which would shut down the channel)
3065        std::mem::forget(self);
3066    }
3067}
3068
3069impl DeviceMonitorGetCountryResponder {
3070    /// Sends a response to the FIDL transaction.
3071    ///
3072    /// Sets the channel to shutdown if an error occurs.
3073    pub fn send(self, mut result: Result<&GetCountryResponse, i32>) -> Result<(), fidl::Error> {
3074        let _result = self.send_raw(result);
3075        if _result.is_err() {
3076            self.control_handle.shutdown();
3077        }
3078        self.drop_without_shutdown();
3079        _result
3080    }
3081
3082    /// Similar to "send" but does not shutdown the channel if an error occurs.
3083    pub fn send_no_shutdown_on_err(
3084        self,
3085        mut result: Result<&GetCountryResponse, i32>,
3086    ) -> Result<(), fidl::Error> {
3087        let _result = self.send_raw(result);
3088        self.drop_without_shutdown();
3089        _result
3090    }
3091
3092    fn send_raw(&self, mut result: Result<&GetCountryResponse, i32>) -> Result<(), fidl::Error> {
3093        self.control_handle
3094            .inner
3095            .send::<fidl::encoding::ResultType<DeviceMonitorGetCountryResponse, i32>>(
3096                result.map(|resp| (resp,)),
3097                self.tx_id,
3098                0x6f1040bd81bde90e,
3099                fidl::encoding::DynamicFlags::empty(),
3100            )
3101    }
3102}
3103
3104#[must_use = "FIDL methods require a response to be sent"]
3105#[derive(Debug)]
3106pub struct DeviceMonitorSetCountryResponder {
3107    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3108    tx_id: u32,
3109}
3110
3111/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3112/// if the responder is dropped without sending a response, so that the client
3113/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3114impl std::ops::Drop for DeviceMonitorSetCountryResponder {
3115    fn drop(&mut self) {
3116        self.control_handle.shutdown();
3117        // Safety: drops once, never accessed again
3118        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3119    }
3120}
3121
3122impl fidl::endpoints::Responder for DeviceMonitorSetCountryResponder {
3123    type ControlHandle = DeviceMonitorControlHandle;
3124
3125    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3126        &self.control_handle
3127    }
3128
3129    fn drop_without_shutdown(mut self) {
3130        // Safety: drops once, never accessed again due to mem::forget
3131        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3132        // Prevent Drop from running (which would shut down the channel)
3133        std::mem::forget(self);
3134    }
3135}
3136
3137impl DeviceMonitorSetCountryResponder {
3138    /// Sends a response to the FIDL transaction.
3139    ///
3140    /// Sets the channel to shutdown if an error occurs.
3141    pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
3142        let _result = self.send_raw(status);
3143        if _result.is_err() {
3144            self.control_handle.shutdown();
3145        }
3146        self.drop_without_shutdown();
3147        _result
3148    }
3149
3150    /// Similar to "send" but does not shutdown the channel if an error occurs.
3151    pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
3152        let _result = self.send_raw(status);
3153        self.drop_without_shutdown();
3154        _result
3155    }
3156
3157    fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
3158        self.control_handle.inner.send::<DeviceMonitorSetCountryResponse>(
3159            (status,),
3160            self.tx_id,
3161            0xdaa7b77a5a6e71b,
3162            fidl::encoding::DynamicFlags::empty(),
3163        )
3164    }
3165}
3166
3167#[must_use = "FIDL methods require a response to be sent"]
3168#[derive(Debug)]
3169pub struct DeviceMonitorClearCountryResponder {
3170    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3171    tx_id: u32,
3172}
3173
3174/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3175/// if the responder is dropped without sending a response, so that the client
3176/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3177impl std::ops::Drop for DeviceMonitorClearCountryResponder {
3178    fn drop(&mut self) {
3179        self.control_handle.shutdown();
3180        // Safety: drops once, never accessed again
3181        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3182    }
3183}
3184
3185impl fidl::endpoints::Responder for DeviceMonitorClearCountryResponder {
3186    type ControlHandle = DeviceMonitorControlHandle;
3187
3188    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3189        &self.control_handle
3190    }
3191
3192    fn drop_without_shutdown(mut self) {
3193        // Safety: drops once, never accessed again due to mem::forget
3194        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3195        // Prevent Drop from running (which would shut down the channel)
3196        std::mem::forget(self);
3197    }
3198}
3199
3200impl DeviceMonitorClearCountryResponder {
3201    /// Sends a response to the FIDL transaction.
3202    ///
3203    /// Sets the channel to shutdown if an error occurs.
3204    pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
3205        let _result = self.send_raw(status);
3206        if _result.is_err() {
3207            self.control_handle.shutdown();
3208        }
3209        self.drop_without_shutdown();
3210        _result
3211    }
3212
3213    /// Similar to "send" but does not shutdown the channel if an error occurs.
3214    pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
3215        let _result = self.send_raw(status);
3216        self.drop_without_shutdown();
3217        _result
3218    }
3219
3220    fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
3221        self.control_handle.inner.send::<DeviceMonitorClearCountryResponse>(
3222            (status,),
3223            self.tx_id,
3224            0x66714d61103120e9,
3225            fidl::encoding::DynamicFlags::empty(),
3226        )
3227    }
3228}
3229
3230#[must_use = "FIDL methods require a response to be sent"]
3231#[derive(Debug)]
3232pub struct DeviceMonitorSetPowerSaveModeResponder {
3233    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3234    tx_id: u32,
3235}
3236
3237/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3238/// if the responder is dropped without sending a response, so that the client
3239/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3240impl std::ops::Drop for DeviceMonitorSetPowerSaveModeResponder {
3241    fn drop(&mut self) {
3242        self.control_handle.shutdown();
3243        // Safety: drops once, never accessed again
3244        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3245    }
3246}
3247
3248impl fidl::endpoints::Responder for DeviceMonitorSetPowerSaveModeResponder {
3249    type ControlHandle = DeviceMonitorControlHandle;
3250
3251    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3252        &self.control_handle
3253    }
3254
3255    fn drop_without_shutdown(mut self) {
3256        // Safety: drops once, never accessed again due to mem::forget
3257        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3258        // Prevent Drop from running (which would shut down the channel)
3259        std::mem::forget(self);
3260    }
3261}
3262
3263impl DeviceMonitorSetPowerSaveModeResponder {
3264    /// Sends a response to the FIDL transaction.
3265    ///
3266    /// Sets the channel to shutdown if an error occurs.
3267    pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
3268        let _result = self.send_raw(status);
3269        if _result.is_err() {
3270            self.control_handle.shutdown();
3271        }
3272        self.drop_without_shutdown();
3273        _result
3274    }
3275
3276    /// Similar to "send" but does not shutdown the channel if an error occurs.
3277    pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
3278        let _result = self.send_raw(status);
3279        self.drop_without_shutdown();
3280        _result
3281    }
3282
3283    fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
3284        self.control_handle.inner.send::<DeviceMonitorSetPowerSaveModeResponse>(
3285            (status,),
3286            self.tx_id,
3287            0x62202b4d360533bc,
3288            fidl::encoding::DynamicFlags::empty(),
3289        )
3290    }
3291}
3292
3293#[must_use = "FIDL methods require a response to be sent"]
3294#[derive(Debug)]
3295pub struct DeviceMonitorGetPowerSaveModeResponder {
3296    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3297    tx_id: u32,
3298}
3299
3300/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3301/// if the responder is dropped without sending a response, so that the client
3302/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3303impl std::ops::Drop for DeviceMonitorGetPowerSaveModeResponder {
3304    fn drop(&mut self) {
3305        self.control_handle.shutdown();
3306        // Safety: drops once, never accessed again
3307        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3308    }
3309}
3310
3311impl fidl::endpoints::Responder for DeviceMonitorGetPowerSaveModeResponder {
3312    type ControlHandle = DeviceMonitorControlHandle;
3313
3314    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3315        &self.control_handle
3316    }
3317
3318    fn drop_without_shutdown(mut self) {
3319        // Safety: drops once, never accessed again due to mem::forget
3320        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3321        // Prevent Drop from running (which would shut down the channel)
3322        std::mem::forget(self);
3323    }
3324}
3325
3326impl DeviceMonitorGetPowerSaveModeResponder {
3327    /// Sends a response to the FIDL transaction.
3328    ///
3329    /// Sets the channel to shutdown if an error occurs.
3330    pub fn send(
3331        self,
3332        mut result: Result<&GetPowerSaveModeResponse, i32>,
3333    ) -> Result<(), fidl::Error> {
3334        let _result = self.send_raw(result);
3335        if _result.is_err() {
3336            self.control_handle.shutdown();
3337        }
3338        self.drop_without_shutdown();
3339        _result
3340    }
3341
3342    /// Similar to "send" but does not shutdown the channel if an error occurs.
3343    pub fn send_no_shutdown_on_err(
3344        self,
3345        mut result: Result<&GetPowerSaveModeResponse, i32>,
3346    ) -> Result<(), fidl::Error> {
3347        let _result = self.send_raw(result);
3348        self.drop_without_shutdown();
3349        _result
3350    }
3351
3352    fn send_raw(
3353        &self,
3354        mut result: Result<&GetPowerSaveModeResponse, i32>,
3355    ) -> Result<(), fidl::Error> {
3356        self.control_handle.inner.send::<fidl::encoding::ResultType<
3357            DeviceMonitorGetPowerSaveModeResponse,
3358            i32,
3359        >>(
3360            result.map(|resp| (resp,)),
3361            self.tx_id,
3362            0x14304d406ada8693,
3363            fidl::encoding::DynamicFlags::empty(),
3364        )
3365    }
3366}
3367
3368#[must_use = "FIDL methods require a response to be sent"]
3369#[derive(Debug)]
3370pub struct DeviceMonitorPowerDownResponder {
3371    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3372    tx_id: u32,
3373}
3374
3375/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3376/// if the responder is dropped without sending a response, so that the client
3377/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3378impl std::ops::Drop for DeviceMonitorPowerDownResponder {
3379    fn drop(&mut self) {
3380        self.control_handle.shutdown();
3381        // Safety: drops once, never accessed again
3382        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3383    }
3384}
3385
3386impl fidl::endpoints::Responder for DeviceMonitorPowerDownResponder {
3387    type ControlHandle = DeviceMonitorControlHandle;
3388
3389    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3390        &self.control_handle
3391    }
3392
3393    fn drop_without_shutdown(mut self) {
3394        // Safety: drops once, never accessed again due to mem::forget
3395        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3396        // Prevent Drop from running (which would shut down the channel)
3397        std::mem::forget(self);
3398    }
3399}
3400
3401impl DeviceMonitorPowerDownResponder {
3402    /// Sends a response to the FIDL transaction.
3403    ///
3404    /// Sets the channel to shutdown if an error occurs.
3405    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3406        let _result = self.send_raw(result);
3407        if _result.is_err() {
3408            self.control_handle.shutdown();
3409        }
3410        self.drop_without_shutdown();
3411        _result
3412    }
3413
3414    /// Similar to "send" but does not shutdown the channel if an error occurs.
3415    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3416        let _result = self.send_raw(result);
3417        self.drop_without_shutdown();
3418        _result
3419    }
3420
3421    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3422        self.control_handle
3423            .inner
3424            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3425                result,
3426                self.tx_id,
3427                0x374ad717fe8902e0,
3428                fidl::encoding::DynamicFlags::empty(),
3429            )
3430    }
3431}
3432
3433#[must_use = "FIDL methods require a response to be sent"]
3434#[derive(Debug)]
3435pub struct DeviceMonitorPowerUpResponder {
3436    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3437    tx_id: u32,
3438}
3439
3440/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3441/// if the responder is dropped without sending a response, so that the client
3442/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3443impl std::ops::Drop for DeviceMonitorPowerUpResponder {
3444    fn drop(&mut self) {
3445        self.control_handle.shutdown();
3446        // Safety: drops once, never accessed again
3447        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3448    }
3449}
3450
3451impl fidl::endpoints::Responder for DeviceMonitorPowerUpResponder {
3452    type ControlHandle = DeviceMonitorControlHandle;
3453
3454    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3455        &self.control_handle
3456    }
3457
3458    fn drop_without_shutdown(mut self) {
3459        // Safety: drops once, never accessed again due to mem::forget
3460        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3461        // Prevent Drop from running (which would shut down the channel)
3462        std::mem::forget(self);
3463    }
3464}
3465
3466impl DeviceMonitorPowerUpResponder {
3467    /// Sends a response to the FIDL transaction.
3468    ///
3469    /// Sets the channel to shutdown if an error occurs.
3470    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3471        let _result = self.send_raw(result);
3472        if _result.is_err() {
3473            self.control_handle.shutdown();
3474        }
3475        self.drop_without_shutdown();
3476        _result
3477    }
3478
3479    /// Similar to "send" but does not shutdown the channel if an error occurs.
3480    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3481        let _result = self.send_raw(result);
3482        self.drop_without_shutdown();
3483        _result
3484    }
3485
3486    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3487        self.control_handle
3488            .inner
3489            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3490                result,
3491                self.tx_id,
3492                0xa2379b639869c17,
3493                fidl::encoding::DynamicFlags::empty(),
3494            )
3495    }
3496}
3497
3498#[must_use = "FIDL methods require a response to be sent"]
3499#[derive(Debug)]
3500pub struct DeviceMonitorResetResponder {
3501    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3502    tx_id: u32,
3503}
3504
3505/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3506/// if the responder is dropped without sending a response, so that the client
3507/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3508impl std::ops::Drop for DeviceMonitorResetResponder {
3509    fn drop(&mut self) {
3510        self.control_handle.shutdown();
3511        // Safety: drops once, never accessed again
3512        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3513    }
3514}
3515
3516impl fidl::endpoints::Responder for DeviceMonitorResetResponder {
3517    type ControlHandle = DeviceMonitorControlHandle;
3518
3519    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3520        &self.control_handle
3521    }
3522
3523    fn drop_without_shutdown(mut self) {
3524        // Safety: drops once, never accessed again due to mem::forget
3525        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3526        // Prevent Drop from running (which would shut down the channel)
3527        std::mem::forget(self);
3528    }
3529}
3530
3531impl DeviceMonitorResetResponder {
3532    /// Sends a response to the FIDL transaction.
3533    ///
3534    /// Sets the channel to shutdown if an error occurs.
3535    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3536        let _result = self.send_raw(result);
3537        if _result.is_err() {
3538            self.control_handle.shutdown();
3539        }
3540        self.drop_without_shutdown();
3541        _result
3542    }
3543
3544    /// Similar to "send" but does not shutdown the channel if an error occurs.
3545    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3546        let _result = self.send_raw(result);
3547        self.drop_without_shutdown();
3548        _result
3549    }
3550
3551    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3552        self.control_handle
3553            .inner
3554            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3555                result,
3556                self.tx_id,
3557                0x6def240c9f8c6867,
3558                fidl::encoding::DynamicFlags::empty(),
3559            )
3560    }
3561}
3562
3563#[must_use = "FIDL methods require a response to be sent"]
3564#[derive(Debug)]
3565pub struct DeviceMonitorSetTxPowerScenarioResponder {
3566    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3567    tx_id: u32,
3568}
3569
3570/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3571/// if the responder is dropped without sending a response, so that the client
3572/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3573impl std::ops::Drop for DeviceMonitorSetTxPowerScenarioResponder {
3574    fn drop(&mut self) {
3575        self.control_handle.shutdown();
3576        // Safety: drops once, never accessed again
3577        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3578    }
3579}
3580
3581impl fidl::endpoints::Responder for DeviceMonitorSetTxPowerScenarioResponder {
3582    type ControlHandle = DeviceMonitorControlHandle;
3583
3584    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3585        &self.control_handle
3586    }
3587
3588    fn drop_without_shutdown(mut self) {
3589        // Safety: drops once, never accessed again due to mem::forget
3590        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3591        // Prevent Drop from running (which would shut down the channel)
3592        std::mem::forget(self);
3593    }
3594}
3595
3596impl DeviceMonitorSetTxPowerScenarioResponder {
3597    /// Sends a response to the FIDL transaction.
3598    ///
3599    /// Sets the channel to shutdown if an error occurs.
3600    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3601        let _result = self.send_raw(result);
3602        if _result.is_err() {
3603            self.control_handle.shutdown();
3604        }
3605        self.drop_without_shutdown();
3606        _result
3607    }
3608
3609    /// Similar to "send" but does not shutdown the channel if an error occurs.
3610    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3611        let _result = self.send_raw(result);
3612        self.drop_without_shutdown();
3613        _result
3614    }
3615
3616    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3617        self.control_handle
3618            .inner
3619            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3620                result,
3621                self.tx_id,
3622                0x7c51443a985934fd,
3623                fidl::encoding::DynamicFlags::empty(),
3624            )
3625    }
3626}
3627
3628#[must_use = "FIDL methods require a response to be sent"]
3629#[derive(Debug)]
3630pub struct DeviceMonitorResetTxPowerScenarioResponder {
3631    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3632    tx_id: u32,
3633}
3634
3635/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3636/// if the responder is dropped without sending a response, so that the client
3637/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3638impl std::ops::Drop for DeviceMonitorResetTxPowerScenarioResponder {
3639    fn drop(&mut self) {
3640        self.control_handle.shutdown();
3641        // Safety: drops once, never accessed again
3642        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3643    }
3644}
3645
3646impl fidl::endpoints::Responder for DeviceMonitorResetTxPowerScenarioResponder {
3647    type ControlHandle = DeviceMonitorControlHandle;
3648
3649    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3650        &self.control_handle
3651    }
3652
3653    fn drop_without_shutdown(mut self) {
3654        // Safety: drops once, never accessed again due to mem::forget
3655        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3656        // Prevent Drop from running (which would shut down the channel)
3657        std::mem::forget(self);
3658    }
3659}
3660
3661impl DeviceMonitorResetTxPowerScenarioResponder {
3662    /// Sends a response to the FIDL transaction.
3663    ///
3664    /// Sets the channel to shutdown if an error occurs.
3665    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3666        let _result = self.send_raw(result);
3667        if _result.is_err() {
3668            self.control_handle.shutdown();
3669        }
3670        self.drop_without_shutdown();
3671        _result
3672    }
3673
3674    /// Similar to "send" but does not shutdown the channel if an error occurs.
3675    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3676        let _result = self.send_raw(result);
3677        self.drop_without_shutdown();
3678        _result
3679    }
3680
3681    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3682        self.control_handle
3683            .inner
3684            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3685                result,
3686                self.tx_id,
3687                0x4790357c9cdddc4a,
3688                fidl::encoding::DynamicFlags::empty(),
3689            )
3690    }
3691}
3692
3693#[must_use = "FIDL methods require a response to be sent"]
3694#[derive(Debug)]
3695pub struct DeviceMonitorGetTxPowerScenarioResponder {
3696    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3697    tx_id: u32,
3698}
3699
3700/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3701/// if the responder is dropped without sending a response, so that the client
3702/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3703impl std::ops::Drop for DeviceMonitorGetTxPowerScenarioResponder {
3704    fn drop(&mut self) {
3705        self.control_handle.shutdown();
3706        // Safety: drops once, never accessed again
3707        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3708    }
3709}
3710
3711impl fidl::endpoints::Responder for DeviceMonitorGetTxPowerScenarioResponder {
3712    type ControlHandle = DeviceMonitorControlHandle;
3713
3714    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3715        &self.control_handle
3716    }
3717
3718    fn drop_without_shutdown(mut self) {
3719        // Safety: drops once, never accessed again due to mem::forget
3720        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3721        // Prevent Drop from running (which would shut down the channel)
3722        std::mem::forget(self);
3723    }
3724}
3725
3726impl DeviceMonitorGetTxPowerScenarioResponder {
3727    /// Sends a response to the FIDL transaction.
3728    ///
3729    /// Sets the channel to shutdown if an error occurs.
3730    pub fn send(
3731        self,
3732        mut result: Result<fidl_fuchsia_wlan_internal::TxPowerScenario, i32>,
3733    ) -> Result<(), fidl::Error> {
3734        let _result = self.send_raw(result);
3735        if _result.is_err() {
3736            self.control_handle.shutdown();
3737        }
3738        self.drop_without_shutdown();
3739        _result
3740    }
3741
3742    /// Similar to "send" but does not shutdown the channel if an error occurs.
3743    pub fn send_no_shutdown_on_err(
3744        self,
3745        mut result: Result<fidl_fuchsia_wlan_internal::TxPowerScenario, i32>,
3746    ) -> Result<(), fidl::Error> {
3747        let _result = self.send_raw(result);
3748        self.drop_without_shutdown();
3749        _result
3750    }
3751
3752    fn send_raw(
3753        &self,
3754        mut result: Result<fidl_fuchsia_wlan_internal::TxPowerScenario, i32>,
3755    ) -> Result<(), fidl::Error> {
3756        self.control_handle.inner.send::<fidl::encoding::ResultType<
3757            DeviceMonitorGetTxPowerScenarioResponse,
3758            i32,
3759        >>(
3760            result.map(|scenario| (scenario,)),
3761            self.tx_id,
3762            0x555fb197f90e9830,
3763            fidl::encoding::DynamicFlags::empty(),
3764        )
3765    }
3766}
3767
3768#[must_use = "FIDL methods require a response to be sent"]
3769#[derive(Debug)]
3770pub struct DeviceMonitorGetPowerStateResponder {
3771    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3772    tx_id: u32,
3773}
3774
3775/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3776/// if the responder is dropped without sending a response, so that the client
3777/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3778impl std::ops::Drop for DeviceMonitorGetPowerStateResponder {
3779    fn drop(&mut self) {
3780        self.control_handle.shutdown();
3781        // Safety: drops once, never accessed again
3782        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3783    }
3784}
3785
3786impl fidl::endpoints::Responder for DeviceMonitorGetPowerStateResponder {
3787    type ControlHandle = DeviceMonitorControlHandle;
3788
3789    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3790        &self.control_handle
3791    }
3792
3793    fn drop_without_shutdown(mut self) {
3794        // Safety: drops once, never accessed again due to mem::forget
3795        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3796        // Prevent Drop from running (which would shut down the channel)
3797        std::mem::forget(self);
3798    }
3799}
3800
3801impl DeviceMonitorGetPowerStateResponder {
3802    /// Sends a response to the FIDL transaction.
3803    ///
3804    /// Sets the channel to shutdown if an error occurs.
3805    pub fn send(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3806        let _result = self.send_raw(result);
3807        if _result.is_err() {
3808            self.control_handle.shutdown();
3809        }
3810        self.drop_without_shutdown();
3811        _result
3812    }
3813
3814    /// Similar to "send" but does not shutdown the channel if an error occurs.
3815    pub fn send_no_shutdown_on_err(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3816        let _result = self.send_raw(result);
3817        self.drop_without_shutdown();
3818        _result
3819    }
3820
3821    fn send_raw(&self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3822        self.control_handle
3823            .inner
3824            .send::<fidl::encoding::ResultType<DeviceMonitorGetPowerStateResponse, i32>>(
3825                result.map(|power_on| (power_on,)),
3826                self.tx_id,
3827                0x58cf95c5bbbe3f,
3828                fidl::encoding::DynamicFlags::empty(),
3829            )
3830    }
3831}
3832
3833#[must_use = "FIDL methods require a response to be sent"]
3834#[derive(Debug)]
3835pub struct DeviceMonitorSetBtCoexistenceModeResponder {
3836    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3837    tx_id: u32,
3838}
3839
3840/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3841/// if the responder is dropped without sending a response, so that the client
3842/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3843impl std::ops::Drop for DeviceMonitorSetBtCoexistenceModeResponder {
3844    fn drop(&mut self) {
3845        self.control_handle.shutdown();
3846        // Safety: drops once, never accessed again
3847        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3848    }
3849}
3850
3851impl fidl::endpoints::Responder for DeviceMonitorSetBtCoexistenceModeResponder {
3852    type ControlHandle = DeviceMonitorControlHandle;
3853
3854    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3855        &self.control_handle
3856    }
3857
3858    fn drop_without_shutdown(mut self) {
3859        // Safety: drops once, never accessed again due to mem::forget
3860        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3861        // Prevent Drop from running (which would shut down the channel)
3862        std::mem::forget(self);
3863    }
3864}
3865
3866impl DeviceMonitorSetBtCoexistenceModeResponder {
3867    /// Sends a response to the FIDL transaction.
3868    ///
3869    /// Sets the channel to shutdown if an error occurs.
3870    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3871        let _result = self.send_raw(result);
3872        if _result.is_err() {
3873            self.control_handle.shutdown();
3874        }
3875        self.drop_without_shutdown();
3876        _result
3877    }
3878
3879    /// Similar to "send" but does not shutdown the channel if an error occurs.
3880    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3881        let _result = self.send_raw(result);
3882        self.drop_without_shutdown();
3883        _result
3884    }
3885
3886    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3887        self.control_handle
3888            .inner
3889            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3890                result,
3891                self.tx_id,
3892                0x97539596c9a79c7,
3893                fidl::encoding::DynamicFlags::empty(),
3894            )
3895    }
3896}
3897
3898#[must_use = "FIDL methods require a response to be sent"]
3899#[derive(Debug)]
3900pub struct DeviceMonitorCreateIfaceResponder {
3901    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3902    tx_id: u32,
3903}
3904
3905/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3906/// if the responder is dropped without sending a response, so that the client
3907/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3908impl std::ops::Drop for DeviceMonitorCreateIfaceResponder {
3909    fn drop(&mut self) {
3910        self.control_handle.shutdown();
3911        // Safety: drops once, never accessed again
3912        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3913    }
3914}
3915
3916impl fidl::endpoints::Responder for DeviceMonitorCreateIfaceResponder {
3917    type ControlHandle = DeviceMonitorControlHandle;
3918
3919    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3920        &self.control_handle
3921    }
3922
3923    fn drop_without_shutdown(mut self) {
3924        // Safety: drops once, never accessed again due to mem::forget
3925        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3926        // Prevent Drop from running (which would shut down the channel)
3927        std::mem::forget(self);
3928    }
3929}
3930
3931impl DeviceMonitorCreateIfaceResponder {
3932    /// Sends a response to the FIDL transaction.
3933    ///
3934    /// Sets the channel to shutdown if an error occurs.
3935    pub fn send(
3936        self,
3937        mut result: Result<&DeviceMonitorCreateIfaceResponse, DeviceMonitorError>,
3938    ) -> Result<(), fidl::Error> {
3939        let _result = self.send_raw(result);
3940        if _result.is_err() {
3941            self.control_handle.shutdown();
3942        }
3943        self.drop_without_shutdown();
3944        _result
3945    }
3946
3947    /// Similar to "send" but does not shutdown the channel if an error occurs.
3948    pub fn send_no_shutdown_on_err(
3949        self,
3950        mut result: Result<&DeviceMonitorCreateIfaceResponse, DeviceMonitorError>,
3951    ) -> Result<(), fidl::Error> {
3952        let _result = self.send_raw(result);
3953        self.drop_without_shutdown();
3954        _result
3955    }
3956
3957    fn send_raw(
3958        &self,
3959        mut result: Result<&DeviceMonitorCreateIfaceResponse, DeviceMonitorError>,
3960    ) -> Result<(), fidl::Error> {
3961        self.control_handle.inner.send::<fidl::encoding::ResultType<
3962            DeviceMonitorCreateIfaceResponse,
3963            DeviceMonitorError,
3964        >>(
3965            result,
3966            self.tx_id,
3967            0x1e1d30c24c0ec144,
3968            fidl::encoding::DynamicFlags::empty(),
3969        )
3970    }
3971}
3972
3973#[must_use = "FIDL methods require a response to be sent"]
3974#[derive(Debug)]
3975pub struct DeviceMonitorQueryIfaceResponder {
3976    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
3977    tx_id: u32,
3978}
3979
3980/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
3981/// if the responder is dropped without sending a response, so that the client
3982/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3983impl std::ops::Drop for DeviceMonitorQueryIfaceResponder {
3984    fn drop(&mut self) {
3985        self.control_handle.shutdown();
3986        // Safety: drops once, never accessed again
3987        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3988    }
3989}
3990
3991impl fidl::endpoints::Responder for DeviceMonitorQueryIfaceResponder {
3992    type ControlHandle = DeviceMonitorControlHandle;
3993
3994    fn control_handle(&self) -> &DeviceMonitorControlHandle {
3995        &self.control_handle
3996    }
3997
3998    fn drop_without_shutdown(mut self) {
3999        // Safety: drops once, never accessed again due to mem::forget
4000        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4001        // Prevent Drop from running (which would shut down the channel)
4002        std::mem::forget(self);
4003    }
4004}
4005
4006impl DeviceMonitorQueryIfaceResponder {
4007    /// Sends a response to the FIDL transaction.
4008    ///
4009    /// Sets the channel to shutdown if an error occurs.
4010    pub fn send(self, mut result: Result<&QueryIfaceResponse, i32>) -> Result<(), fidl::Error> {
4011        let _result = self.send_raw(result);
4012        if _result.is_err() {
4013            self.control_handle.shutdown();
4014        }
4015        self.drop_without_shutdown();
4016        _result
4017    }
4018
4019    /// Similar to "send" but does not shutdown the channel if an error occurs.
4020    pub fn send_no_shutdown_on_err(
4021        self,
4022        mut result: Result<&QueryIfaceResponse, i32>,
4023    ) -> Result<(), fidl::Error> {
4024        let _result = self.send_raw(result);
4025        self.drop_without_shutdown();
4026        _result
4027    }
4028
4029    fn send_raw(&self, mut result: Result<&QueryIfaceResponse, i32>) -> Result<(), fidl::Error> {
4030        self.control_handle
4031            .inner
4032            .send::<fidl::encoding::ResultType<DeviceMonitorQueryIfaceResponse, i32>>(
4033                result.map(|resp| (resp,)),
4034                self.tx_id,
4035                0x1a48c4a2b86259ef,
4036                fidl::encoding::DynamicFlags::empty(),
4037            )
4038    }
4039}
4040
4041#[must_use = "FIDL methods require a response to be sent"]
4042#[derive(Debug)]
4043pub struct DeviceMonitorDestroyIfaceResponder {
4044    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
4045    tx_id: u32,
4046}
4047
4048/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
4049/// if the responder is dropped without sending a response, so that the client
4050/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4051impl std::ops::Drop for DeviceMonitorDestroyIfaceResponder {
4052    fn drop(&mut self) {
4053        self.control_handle.shutdown();
4054        // Safety: drops once, never accessed again
4055        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4056    }
4057}
4058
4059impl fidl::endpoints::Responder for DeviceMonitorDestroyIfaceResponder {
4060    type ControlHandle = DeviceMonitorControlHandle;
4061
4062    fn control_handle(&self) -> &DeviceMonitorControlHandle {
4063        &self.control_handle
4064    }
4065
4066    fn drop_without_shutdown(mut self) {
4067        // Safety: drops once, never accessed again due to mem::forget
4068        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4069        // Prevent Drop from running (which would shut down the channel)
4070        std::mem::forget(self);
4071    }
4072}
4073
4074impl DeviceMonitorDestroyIfaceResponder {
4075    /// Sends a response to the FIDL transaction.
4076    ///
4077    /// Sets the channel to shutdown if an error occurs.
4078    pub fn send(self, mut status: i32) -> Result<(), fidl::Error> {
4079        let _result = self.send_raw(status);
4080        if _result.is_err() {
4081            self.control_handle.shutdown();
4082        }
4083        self.drop_without_shutdown();
4084        _result
4085    }
4086
4087    /// Similar to "send" but does not shutdown the channel if an error occurs.
4088    pub fn send_no_shutdown_on_err(self, mut status: i32) -> Result<(), fidl::Error> {
4089        let _result = self.send_raw(status);
4090        self.drop_without_shutdown();
4091        _result
4092    }
4093
4094    fn send_raw(&self, mut status: i32) -> Result<(), fidl::Error> {
4095        self.control_handle.inner.send::<DeviceMonitorDestroyIfaceResponse>(
4096            (status,),
4097            self.tx_id,
4098            0x4c77982c1616a3b0,
4099            fidl::encoding::DynamicFlags::empty(),
4100        )
4101    }
4102}
4103
4104#[must_use = "FIDL methods require a response to be sent"]
4105#[derive(Debug)]
4106pub struct DeviceMonitorQueryIfaceCapabilitiesResponder {
4107    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
4108    tx_id: u32,
4109}
4110
4111/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
4112/// if the responder is dropped without sending a response, so that the client
4113/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4114impl std::ops::Drop for DeviceMonitorQueryIfaceCapabilitiesResponder {
4115    fn drop(&mut self) {
4116        self.control_handle.shutdown();
4117        // Safety: drops once, never accessed again
4118        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4119    }
4120}
4121
4122impl fidl::endpoints::Responder for DeviceMonitorQueryIfaceCapabilitiesResponder {
4123    type ControlHandle = DeviceMonitorControlHandle;
4124
4125    fn control_handle(&self) -> &DeviceMonitorControlHandle {
4126        &self.control_handle
4127    }
4128
4129    fn drop_without_shutdown(mut self) {
4130        // Safety: drops once, never accessed again due to mem::forget
4131        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4132        // Prevent Drop from running (which would shut down the channel)
4133        std::mem::forget(self);
4134    }
4135}
4136
4137impl DeviceMonitorQueryIfaceCapabilitiesResponder {
4138    /// Sends a response to the FIDL transaction.
4139    ///
4140    /// Sets the channel to shutdown if an error occurs.
4141    pub fn send(
4142        self,
4143        mut result: Result<&fidl_fuchsia_wlan_common::ApfPacketFilterSupport, i32>,
4144    ) -> Result<(), fidl::Error> {
4145        let _result = self.send_raw(result);
4146        if _result.is_err() {
4147            self.control_handle.shutdown();
4148        }
4149        self.drop_without_shutdown();
4150        _result
4151    }
4152
4153    /// Similar to "send" but does not shutdown the channel if an error occurs.
4154    pub fn send_no_shutdown_on_err(
4155        self,
4156        mut result: Result<&fidl_fuchsia_wlan_common::ApfPacketFilterSupport, i32>,
4157    ) -> Result<(), fidl::Error> {
4158        let _result = self.send_raw(result);
4159        self.drop_without_shutdown();
4160        _result
4161    }
4162
4163    fn send_raw(
4164        &self,
4165        mut result: Result<&fidl_fuchsia_wlan_common::ApfPacketFilterSupport, i32>,
4166    ) -> Result<(), fidl::Error> {
4167        self.control_handle.inner.send::<fidl::encoding::ResultType<
4168            DeviceMonitorQueryIfaceCapabilitiesResponse,
4169            i32,
4170        >>(
4171            result.map(|apf_support| (apf_support,)),
4172            self.tx_id,
4173            0x37e8b884766de0f8,
4174            fidl::encoding::DynamicFlags::empty(),
4175        )
4176    }
4177}
4178
4179#[must_use = "FIDL methods require a response to be sent"]
4180#[derive(Debug)]
4181pub struct DeviceMonitorGetClientSmeResponder {
4182    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
4183    tx_id: u32,
4184}
4185
4186/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
4187/// if the responder is dropped without sending a response, so that the client
4188/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4189impl std::ops::Drop for DeviceMonitorGetClientSmeResponder {
4190    fn drop(&mut self) {
4191        self.control_handle.shutdown();
4192        // Safety: drops once, never accessed again
4193        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4194    }
4195}
4196
4197impl fidl::endpoints::Responder for DeviceMonitorGetClientSmeResponder {
4198    type ControlHandle = DeviceMonitorControlHandle;
4199
4200    fn control_handle(&self) -> &DeviceMonitorControlHandle {
4201        &self.control_handle
4202    }
4203
4204    fn drop_without_shutdown(mut self) {
4205        // Safety: drops once, never accessed again due to mem::forget
4206        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4207        // Prevent Drop from running (which would shut down the channel)
4208        std::mem::forget(self);
4209    }
4210}
4211
4212impl DeviceMonitorGetClientSmeResponder {
4213    /// Sends a response to the FIDL transaction.
4214    ///
4215    /// Sets the channel to shutdown if an error occurs.
4216    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4217        let _result = self.send_raw(result);
4218        if _result.is_err() {
4219            self.control_handle.shutdown();
4220        }
4221        self.drop_without_shutdown();
4222        _result
4223    }
4224
4225    /// Similar to "send" but does not shutdown the channel if an error occurs.
4226    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4227        let _result = self.send_raw(result);
4228        self.drop_without_shutdown();
4229        _result
4230    }
4231
4232    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4233        self.control_handle
4234            .inner
4235            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4236                result,
4237                self.tx_id,
4238                0x1b056c379ca98273,
4239                fidl::encoding::DynamicFlags::empty(),
4240            )
4241    }
4242}
4243
4244#[must_use = "FIDL methods require a response to be sent"]
4245#[derive(Debug)]
4246pub struct DeviceMonitorGetApSmeResponder {
4247    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
4248    tx_id: u32,
4249}
4250
4251/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
4252/// if the responder is dropped without sending a response, so that the client
4253/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4254impl std::ops::Drop for DeviceMonitorGetApSmeResponder {
4255    fn drop(&mut self) {
4256        self.control_handle.shutdown();
4257        // Safety: drops once, never accessed again
4258        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4259    }
4260}
4261
4262impl fidl::endpoints::Responder for DeviceMonitorGetApSmeResponder {
4263    type ControlHandle = DeviceMonitorControlHandle;
4264
4265    fn control_handle(&self) -> &DeviceMonitorControlHandle {
4266        &self.control_handle
4267    }
4268
4269    fn drop_without_shutdown(mut self) {
4270        // Safety: drops once, never accessed again due to mem::forget
4271        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4272        // Prevent Drop from running (which would shut down the channel)
4273        std::mem::forget(self);
4274    }
4275}
4276
4277impl DeviceMonitorGetApSmeResponder {
4278    /// Sends a response to the FIDL transaction.
4279    ///
4280    /// Sets the channel to shutdown if an error occurs.
4281    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4282        let _result = self.send_raw(result);
4283        if _result.is_err() {
4284            self.control_handle.shutdown();
4285        }
4286        self.drop_without_shutdown();
4287        _result
4288    }
4289
4290    /// Similar to "send" but does not shutdown the channel if an error occurs.
4291    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4292        let _result = self.send_raw(result);
4293        self.drop_without_shutdown();
4294        _result
4295    }
4296
4297    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4298        self.control_handle
4299            .inner
4300            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4301                result,
4302                self.tx_id,
4303                0x754de680c4318c52,
4304                fidl::encoding::DynamicFlags::empty(),
4305            )
4306    }
4307}
4308
4309#[must_use = "FIDL methods require a response to be sent"]
4310#[derive(Debug)]
4311pub struct DeviceMonitorGetSmeTelemetryResponder {
4312    control_handle: std::mem::ManuallyDrop<DeviceMonitorControlHandle>,
4313    tx_id: u32,
4314}
4315
4316/// Set the the channel to be shutdown (see [`DeviceMonitorControlHandle::shutdown`])
4317/// if the responder is dropped without sending a response, so that the client
4318/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4319impl std::ops::Drop for DeviceMonitorGetSmeTelemetryResponder {
4320    fn drop(&mut self) {
4321        self.control_handle.shutdown();
4322        // Safety: drops once, never accessed again
4323        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4324    }
4325}
4326
4327impl fidl::endpoints::Responder for DeviceMonitorGetSmeTelemetryResponder {
4328    type ControlHandle = DeviceMonitorControlHandle;
4329
4330    fn control_handle(&self) -> &DeviceMonitorControlHandle {
4331        &self.control_handle
4332    }
4333
4334    fn drop_without_shutdown(mut self) {
4335        // Safety: drops once, never accessed again due to mem::forget
4336        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4337        // Prevent Drop from running (which would shut down the channel)
4338        std::mem::forget(self);
4339    }
4340}
4341
4342impl DeviceMonitorGetSmeTelemetryResponder {
4343    /// Sends a response to the FIDL transaction.
4344    ///
4345    /// Sets the channel to shutdown if an error occurs.
4346    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4347        let _result = self.send_raw(result);
4348        if _result.is_err() {
4349            self.control_handle.shutdown();
4350        }
4351        self.drop_without_shutdown();
4352        _result
4353    }
4354
4355    /// Similar to "send" but does not shutdown the channel if an error occurs.
4356    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4357        let _result = self.send_raw(result);
4358        self.drop_without_shutdown();
4359        _result
4360    }
4361
4362    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4363        self.control_handle
4364            .inner
4365            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4366                result,
4367                self.tx_id,
4368                0x1baf42b003f7452a,
4369                fidl::encoding::DynamicFlags::empty(),
4370            )
4371    }
4372}
4373
4374#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4375pub struct DeviceWatcherMarker;
4376
4377impl fidl::endpoints::ProtocolMarker for DeviceWatcherMarker {
4378    type Proxy = DeviceWatcherProxy;
4379    type RequestStream = DeviceWatcherRequestStream;
4380    #[cfg(target_os = "fuchsia")]
4381    type SynchronousProxy = DeviceWatcherSynchronousProxy;
4382
4383    const DEBUG_NAME: &'static str = "(anonymous) DeviceWatcher";
4384}
4385
4386pub trait DeviceWatcherProxyInterface: Send + Sync {}
4387#[derive(Debug)]
4388#[cfg(target_os = "fuchsia")]
4389pub struct DeviceWatcherSynchronousProxy {
4390    client: fidl::client::sync::Client,
4391}
4392
4393#[cfg(target_os = "fuchsia")]
4394impl fidl::endpoints::SynchronousProxy for DeviceWatcherSynchronousProxy {
4395    type Proxy = DeviceWatcherProxy;
4396    type Protocol = DeviceWatcherMarker;
4397
4398    fn from_channel(inner: fidl::Channel) -> Self {
4399        Self::new(inner)
4400    }
4401
4402    fn into_channel(self) -> fidl::Channel {
4403        self.client.into_channel()
4404    }
4405
4406    fn as_channel(&self) -> &fidl::Channel {
4407        self.client.as_channel()
4408    }
4409}
4410
4411#[cfg(target_os = "fuchsia")]
4412impl DeviceWatcherSynchronousProxy {
4413    pub fn new(channel: fidl::Channel) -> Self {
4414        let protocol_name = <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4415        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4416    }
4417
4418    pub fn into_channel(self) -> fidl::Channel {
4419        self.client.into_channel()
4420    }
4421
4422    /// Waits until an event arrives and returns it. It is safe for other
4423    /// threads to make concurrent requests while waiting for an event.
4424    pub fn wait_for_event(
4425        &self,
4426        deadline: zx::MonotonicInstant,
4427    ) -> Result<DeviceWatcherEvent, fidl::Error> {
4428        DeviceWatcherEvent::decode(self.client.wait_for_event(deadline)?)
4429    }
4430}
4431
4432#[cfg(target_os = "fuchsia")]
4433impl From<DeviceWatcherSynchronousProxy> for zx::NullableHandle {
4434    fn from(value: DeviceWatcherSynchronousProxy) -> Self {
4435        value.into_channel().into()
4436    }
4437}
4438
4439#[cfg(target_os = "fuchsia")]
4440impl From<fidl::Channel> for DeviceWatcherSynchronousProxy {
4441    fn from(value: fidl::Channel) -> Self {
4442        Self::new(value)
4443    }
4444}
4445
4446#[cfg(target_os = "fuchsia")]
4447impl fidl::endpoints::FromClient for DeviceWatcherSynchronousProxy {
4448    type Protocol = DeviceWatcherMarker;
4449
4450    fn from_client(value: fidl::endpoints::ClientEnd<DeviceWatcherMarker>) -> Self {
4451        Self::new(value.into_channel())
4452    }
4453}
4454
4455#[derive(Debug, Clone)]
4456pub struct DeviceWatcherProxy {
4457    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4458}
4459
4460impl fidl::endpoints::Proxy for DeviceWatcherProxy {
4461    type Protocol = DeviceWatcherMarker;
4462
4463    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4464        Self::new(inner)
4465    }
4466
4467    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4468        self.client.into_channel().map_err(|client| Self { client })
4469    }
4470
4471    fn as_channel(&self) -> &::fidl::AsyncChannel {
4472        self.client.as_channel()
4473    }
4474}
4475
4476impl DeviceWatcherProxy {
4477    /// Create a new Proxy for fuchsia.wlan.device.service/DeviceWatcher.
4478    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4479        let protocol_name = <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4480        Self { client: fidl::client::Client::new(channel, protocol_name) }
4481    }
4482
4483    /// Get a Stream of events from the remote end of the protocol.
4484    ///
4485    /// # Panics
4486    ///
4487    /// Panics if the event stream was already taken.
4488    pub fn take_event_stream(&self) -> DeviceWatcherEventStream {
4489        DeviceWatcherEventStream { event_receiver: self.client.take_event_receiver() }
4490    }
4491}
4492
4493impl DeviceWatcherProxyInterface for DeviceWatcherProxy {}
4494
4495pub struct DeviceWatcherEventStream {
4496    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4497}
4498
4499impl std::marker::Unpin for DeviceWatcherEventStream {}
4500
4501impl futures::stream::FusedStream for DeviceWatcherEventStream {
4502    fn is_terminated(&self) -> bool {
4503        self.event_receiver.is_terminated()
4504    }
4505}
4506
4507impl futures::Stream for DeviceWatcherEventStream {
4508    type Item = Result<DeviceWatcherEvent, fidl::Error>;
4509
4510    fn poll_next(
4511        mut self: std::pin::Pin<&mut Self>,
4512        cx: &mut std::task::Context<'_>,
4513    ) -> std::task::Poll<Option<Self::Item>> {
4514        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4515            &mut self.event_receiver,
4516            cx
4517        )?) {
4518            Some(buf) => std::task::Poll::Ready(Some(DeviceWatcherEvent::decode(buf))),
4519            None => std::task::Poll::Ready(None),
4520        }
4521    }
4522}
4523
4524#[derive(Debug)]
4525pub enum DeviceWatcherEvent {
4526    OnPhyAdded { phy_id: u16 },
4527    OnPhyRemoved { phy_id: u16 },
4528    OnIfaceAdded { iface_id: u16 },
4529    OnIfaceRemoved { iface_id: u16 },
4530}
4531
4532impl DeviceWatcherEvent {
4533    #[allow(irrefutable_let_patterns)]
4534    pub fn into_on_phy_added(self) -> Option<u16> {
4535        if let DeviceWatcherEvent::OnPhyAdded { phy_id } = self { Some((phy_id)) } else { None }
4536    }
4537    #[allow(irrefutable_let_patterns)]
4538    pub fn into_on_phy_removed(self) -> Option<u16> {
4539        if let DeviceWatcherEvent::OnPhyRemoved { phy_id } = self { Some((phy_id)) } else { None }
4540    }
4541    #[allow(irrefutable_let_patterns)]
4542    pub fn into_on_iface_added(self) -> Option<u16> {
4543        if let DeviceWatcherEvent::OnIfaceAdded { iface_id } = self {
4544            Some((iface_id))
4545        } else {
4546            None
4547        }
4548    }
4549    #[allow(irrefutable_let_patterns)]
4550    pub fn into_on_iface_removed(self) -> Option<u16> {
4551        if let DeviceWatcherEvent::OnIfaceRemoved { iface_id } = self {
4552            Some((iface_id))
4553        } else {
4554            None
4555        }
4556    }
4557
4558    /// Decodes a message buffer as a [`DeviceWatcherEvent`].
4559    fn decode(
4560        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4561    ) -> Result<DeviceWatcherEvent, fidl::Error> {
4562        let (bytes, _handles) = buf.split_mut();
4563        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4564        debug_assert_eq!(tx_header.tx_id, 0);
4565        match tx_header.ordinal {
4566            0x771c58e0bd059f86 => {
4567                let mut out = fidl::new_empty!(
4568                    DeviceWatcherOnPhyAddedRequest,
4569                    fidl::encoding::DefaultFuchsiaResourceDialect
4570                );
4571                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherOnPhyAddedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
4572                Ok((DeviceWatcherEvent::OnPhyAdded { phy_id: out.phy_id }))
4573            }
4574            0x4ad72b96ccb7cff6 => {
4575                let mut out = fidl::new_empty!(
4576                    DeviceWatcherOnPhyRemovedRequest,
4577                    fidl::encoding::DefaultFuchsiaResourceDialect
4578                );
4579                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherOnPhyRemovedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
4580                Ok((DeviceWatcherEvent::OnPhyRemoved { phy_id: out.phy_id }))
4581            }
4582            0x6ee685e4aa1f31d8 => {
4583                let mut out = fidl::new_empty!(
4584                    DeviceWatcherOnIfaceAddedRequest,
4585                    fidl::encoding::DefaultFuchsiaResourceDialect
4586                );
4587                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherOnIfaceAddedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
4588                Ok((DeviceWatcherEvent::OnIfaceAdded { iface_id: out.iface_id }))
4589            }
4590            0x3b771b1fce38c291 => {
4591                let mut out = fidl::new_empty!(
4592                    DeviceWatcherOnIfaceRemovedRequest,
4593                    fidl::encoding::DefaultFuchsiaResourceDialect
4594                );
4595                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DeviceWatcherOnIfaceRemovedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
4596                Ok((DeviceWatcherEvent::OnIfaceRemoved { iface_id: out.iface_id }))
4597            }
4598            _ => Err(fidl::Error::UnknownOrdinal {
4599                ordinal: tx_header.ordinal,
4600                protocol_name: <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4601            }),
4602        }
4603    }
4604}
4605
4606/// A Stream of incoming requests for fuchsia.wlan.device.service/DeviceWatcher.
4607pub struct DeviceWatcherRequestStream {
4608    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4609    is_terminated: bool,
4610}
4611
4612impl std::marker::Unpin for DeviceWatcherRequestStream {}
4613
4614impl futures::stream::FusedStream for DeviceWatcherRequestStream {
4615    fn is_terminated(&self) -> bool {
4616        self.is_terminated
4617    }
4618}
4619
4620impl fidl::endpoints::RequestStream for DeviceWatcherRequestStream {
4621    type Protocol = DeviceWatcherMarker;
4622    type ControlHandle = DeviceWatcherControlHandle;
4623
4624    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4625        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4626    }
4627
4628    fn control_handle(&self) -> Self::ControlHandle {
4629        DeviceWatcherControlHandle { inner: self.inner.clone() }
4630    }
4631
4632    fn into_inner(
4633        self,
4634    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4635    {
4636        (self.inner, self.is_terminated)
4637    }
4638
4639    fn from_inner(
4640        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4641        is_terminated: bool,
4642    ) -> Self {
4643        Self { inner, is_terminated }
4644    }
4645}
4646
4647impl futures::Stream for DeviceWatcherRequestStream {
4648    type Item = Result<DeviceWatcherRequest, fidl::Error>;
4649
4650    fn poll_next(
4651        mut self: std::pin::Pin<&mut Self>,
4652        cx: &mut std::task::Context<'_>,
4653    ) -> std::task::Poll<Option<Self::Item>> {
4654        let this = &mut *self;
4655        if this.inner.check_shutdown(cx) {
4656            this.is_terminated = true;
4657            return std::task::Poll::Ready(None);
4658        }
4659        if this.is_terminated {
4660            panic!("polled DeviceWatcherRequestStream after completion");
4661        }
4662        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4663            |bytes, handles| {
4664                match this.inner.channel().read_etc(cx, bytes, handles) {
4665                    std::task::Poll::Ready(Ok(())) => {}
4666                    std::task::Poll::Pending => return std::task::Poll::Pending,
4667                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4668                        this.is_terminated = true;
4669                        return std::task::Poll::Ready(None);
4670                    }
4671                    std::task::Poll::Ready(Err(e)) => {
4672                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4673                            e.into(),
4674                        ))));
4675                    }
4676                }
4677
4678                // A message has been received from the channel
4679                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4680
4681                std::task::Poll::Ready(Some(match header.ordinal {
4682                    _ => Err(fidl::Error::UnknownOrdinal {
4683                        ordinal: header.ordinal,
4684                        protocol_name:
4685                            <DeviceWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4686                    }),
4687                }))
4688            },
4689        )
4690    }
4691}
4692
4693#[derive(Debug)]
4694pub enum DeviceWatcherRequest {}
4695
4696impl DeviceWatcherRequest {
4697    /// Name of the method defined in FIDL
4698    pub fn method_name(&self) -> &'static str {
4699        match *self {}
4700    }
4701}
4702
4703#[derive(Debug, Clone)]
4704pub struct DeviceWatcherControlHandle {
4705    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4706}
4707
4708impl fidl::endpoints::ControlHandle for DeviceWatcherControlHandle {
4709    fn shutdown(&self) {
4710        self.inner.shutdown()
4711    }
4712
4713    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4714        self.inner.shutdown_with_epitaph(status)
4715    }
4716
4717    fn is_closed(&self) -> bool {
4718        self.inner.channel().is_closed()
4719    }
4720    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4721        self.inner.channel().on_closed()
4722    }
4723
4724    #[cfg(target_os = "fuchsia")]
4725    fn signal_peer(
4726        &self,
4727        clear_mask: zx::Signals,
4728        set_mask: zx::Signals,
4729    ) -> Result<(), zx_status::Status> {
4730        use fidl::Peered;
4731        self.inner.channel().signal_peer(clear_mask, set_mask)
4732    }
4733}
4734
4735impl DeviceWatcherControlHandle {
4736    pub fn send_on_phy_added(&self, mut phy_id: u16) -> Result<(), fidl::Error> {
4737        self.inner.send::<DeviceWatcherOnPhyAddedRequest>(
4738            (phy_id,),
4739            0,
4740            0x771c58e0bd059f86,
4741            fidl::encoding::DynamicFlags::empty(),
4742        )
4743    }
4744
4745    pub fn send_on_phy_removed(&self, mut phy_id: u16) -> Result<(), fidl::Error> {
4746        self.inner.send::<DeviceWatcherOnPhyRemovedRequest>(
4747            (phy_id,),
4748            0,
4749            0x4ad72b96ccb7cff6,
4750            fidl::encoding::DynamicFlags::empty(),
4751        )
4752    }
4753
4754    pub fn send_on_iface_added(&self, mut iface_id: u16) -> Result<(), fidl::Error> {
4755        self.inner.send::<DeviceWatcherOnIfaceAddedRequest>(
4756            (iface_id,),
4757            0,
4758            0x6ee685e4aa1f31d8,
4759            fidl::encoding::DynamicFlags::empty(),
4760        )
4761    }
4762
4763    pub fn send_on_iface_removed(&self, mut iface_id: u16) -> Result<(), fidl::Error> {
4764        self.inner.send::<DeviceWatcherOnIfaceRemovedRequest>(
4765            (iface_id,),
4766            0,
4767            0x3b771b1fce38c291,
4768            fidl::encoding::DynamicFlags::empty(),
4769        )
4770    }
4771}
4772
4773#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4774pub struct PhyEventWatcherMarker;
4775
4776impl fidl::endpoints::ProtocolMarker for PhyEventWatcherMarker {
4777    type Proxy = PhyEventWatcherProxy;
4778    type RequestStream = PhyEventWatcherRequestStream;
4779    #[cfg(target_os = "fuchsia")]
4780    type SynchronousProxy = PhyEventWatcherSynchronousProxy;
4781
4782    const DEBUG_NAME: &'static str = "(anonymous) PhyEventWatcher";
4783}
4784
4785pub trait PhyEventWatcherProxyInterface: Send + Sync {}
4786#[derive(Debug)]
4787#[cfg(target_os = "fuchsia")]
4788pub struct PhyEventWatcherSynchronousProxy {
4789    client: fidl::client::sync::Client,
4790}
4791
4792#[cfg(target_os = "fuchsia")]
4793impl fidl::endpoints::SynchronousProxy for PhyEventWatcherSynchronousProxy {
4794    type Proxy = PhyEventWatcherProxy;
4795    type Protocol = PhyEventWatcherMarker;
4796
4797    fn from_channel(inner: fidl::Channel) -> Self {
4798        Self::new(inner)
4799    }
4800
4801    fn into_channel(self) -> fidl::Channel {
4802        self.client.into_channel()
4803    }
4804
4805    fn as_channel(&self) -> &fidl::Channel {
4806        self.client.as_channel()
4807    }
4808}
4809
4810#[cfg(target_os = "fuchsia")]
4811impl PhyEventWatcherSynchronousProxy {
4812    pub fn new(channel: fidl::Channel) -> Self {
4813        let protocol_name = <PhyEventWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4814        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4815    }
4816
4817    pub fn into_channel(self) -> fidl::Channel {
4818        self.client.into_channel()
4819    }
4820
4821    /// Waits until an event arrives and returns it. It is safe for other
4822    /// threads to make concurrent requests while waiting for an event.
4823    pub fn wait_for_event(
4824        &self,
4825        deadline: zx::MonotonicInstant,
4826    ) -> Result<PhyEventWatcherEvent, fidl::Error> {
4827        PhyEventWatcherEvent::decode(self.client.wait_for_event(deadline)?)
4828    }
4829}
4830
4831#[cfg(target_os = "fuchsia")]
4832impl From<PhyEventWatcherSynchronousProxy> for zx::NullableHandle {
4833    fn from(value: PhyEventWatcherSynchronousProxy) -> Self {
4834        value.into_channel().into()
4835    }
4836}
4837
4838#[cfg(target_os = "fuchsia")]
4839impl From<fidl::Channel> for PhyEventWatcherSynchronousProxy {
4840    fn from(value: fidl::Channel) -> Self {
4841        Self::new(value)
4842    }
4843}
4844
4845#[cfg(target_os = "fuchsia")]
4846impl fidl::endpoints::FromClient for PhyEventWatcherSynchronousProxy {
4847    type Protocol = PhyEventWatcherMarker;
4848
4849    fn from_client(value: fidl::endpoints::ClientEnd<PhyEventWatcherMarker>) -> Self {
4850        Self::new(value.into_channel())
4851    }
4852}
4853
4854#[derive(Debug, Clone)]
4855pub struct PhyEventWatcherProxy {
4856    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4857}
4858
4859impl fidl::endpoints::Proxy for PhyEventWatcherProxy {
4860    type Protocol = PhyEventWatcherMarker;
4861
4862    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4863        Self::new(inner)
4864    }
4865
4866    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4867        self.client.into_channel().map_err(|client| Self { client })
4868    }
4869
4870    fn as_channel(&self) -> &::fidl::AsyncChannel {
4871        self.client.as_channel()
4872    }
4873}
4874
4875impl PhyEventWatcherProxy {
4876    /// Create a new Proxy for fuchsia.wlan.device.service/PhyEventWatcher.
4877    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4878        let protocol_name = <PhyEventWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4879        Self { client: fidl::client::Client::new(channel, protocol_name) }
4880    }
4881
4882    /// Get a Stream of events from the remote end of the protocol.
4883    ///
4884    /// # Panics
4885    ///
4886    /// Panics if the event stream was already taken.
4887    pub fn take_event_stream(&self) -> PhyEventWatcherEventStream {
4888        PhyEventWatcherEventStream { event_receiver: self.client.take_event_receiver() }
4889    }
4890}
4891
4892impl PhyEventWatcherProxyInterface for PhyEventWatcherProxy {}
4893
4894pub struct PhyEventWatcherEventStream {
4895    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4896}
4897
4898impl std::marker::Unpin for PhyEventWatcherEventStream {}
4899
4900impl futures::stream::FusedStream for PhyEventWatcherEventStream {
4901    fn is_terminated(&self) -> bool {
4902        self.event_receiver.is_terminated()
4903    }
4904}
4905
4906impl futures::Stream for PhyEventWatcherEventStream {
4907    type Item = Result<PhyEventWatcherEvent, fidl::Error>;
4908
4909    fn poll_next(
4910        mut self: std::pin::Pin<&mut Self>,
4911        cx: &mut std::task::Context<'_>,
4912    ) -> std::task::Poll<Option<Self::Item>> {
4913        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4914            &mut self.event_receiver,
4915            cx
4916        )?) {
4917            Some(buf) => std::task::Poll::Ready(Some(PhyEventWatcherEvent::decode(buf))),
4918            None => std::task::Poll::Ready(None),
4919        }
4920    }
4921}
4922
4923#[derive(Debug)]
4924pub enum PhyEventWatcherEvent {
4925    OnCriticalError {
4926        phy_id: u16,
4927        reason_code: CriticalErrorReason,
4928    },
4929    OnCountryCodeChange {
4930        phy_id: u16,
4931        alpha2: [u8; 2],
4932    },
4933    #[non_exhaustive]
4934    _UnknownEvent {
4935        /// Ordinal of the event that was sent.
4936        ordinal: u64,
4937    },
4938}
4939
4940impl PhyEventWatcherEvent {
4941    #[allow(irrefutable_let_patterns)]
4942    pub fn into_on_critical_error(self) -> Option<(u16, CriticalErrorReason)> {
4943        if let PhyEventWatcherEvent::OnCriticalError { phy_id, reason_code } = self {
4944            Some((phy_id, reason_code))
4945        } else {
4946            None
4947        }
4948    }
4949    #[allow(irrefutable_let_patterns)]
4950    pub fn into_on_country_code_change(self) -> Option<(u16, [u8; 2])> {
4951        if let PhyEventWatcherEvent::OnCountryCodeChange { phy_id, alpha2 } = self {
4952            Some((phy_id, alpha2))
4953        } else {
4954            None
4955        }
4956    }
4957
4958    /// Decodes a message buffer as a [`PhyEventWatcherEvent`].
4959    fn decode(
4960        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4961    ) -> Result<PhyEventWatcherEvent, fidl::Error> {
4962        let (bytes, _handles) = buf.split_mut();
4963        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4964        debug_assert_eq!(tx_header.tx_id, 0);
4965        match tx_header.ordinal {
4966            0x609a325d54f9e6ac => {
4967                let mut out = fidl::new_empty!(
4968                    PhyEventWatcherOnCriticalErrorRequest,
4969                    fidl::encoding::DefaultFuchsiaResourceDialect
4970                );
4971                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhyEventWatcherOnCriticalErrorRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
4972                Ok((PhyEventWatcherEvent::OnCriticalError {
4973                    phy_id: out.phy_id,
4974                    reason_code: out.reason_code,
4975                }))
4976            }
4977            0x781d791772be33ed => {
4978                let mut out = fidl::new_empty!(
4979                    PhyEventWatcherOnCountryCodeChangeRequest,
4980                    fidl::encoding::DefaultFuchsiaResourceDialect
4981                );
4982                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PhyEventWatcherOnCountryCodeChangeRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
4983                Ok((PhyEventWatcherEvent::OnCountryCodeChange {
4984                    phy_id: out.phy_id,
4985                    alpha2: out.alpha2,
4986                }))
4987            }
4988            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4989                Ok(PhyEventWatcherEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4990            }
4991            _ => Err(fidl::Error::UnknownOrdinal {
4992                ordinal: tx_header.ordinal,
4993                protocol_name:
4994                    <PhyEventWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4995            }),
4996        }
4997    }
4998}
4999
5000/// A Stream of incoming requests for fuchsia.wlan.device.service/PhyEventWatcher.
5001pub struct PhyEventWatcherRequestStream {
5002    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5003    is_terminated: bool,
5004}
5005
5006impl std::marker::Unpin for PhyEventWatcherRequestStream {}
5007
5008impl futures::stream::FusedStream for PhyEventWatcherRequestStream {
5009    fn is_terminated(&self) -> bool {
5010        self.is_terminated
5011    }
5012}
5013
5014impl fidl::endpoints::RequestStream for PhyEventWatcherRequestStream {
5015    type Protocol = PhyEventWatcherMarker;
5016    type ControlHandle = PhyEventWatcherControlHandle;
5017
5018    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5019        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5020    }
5021
5022    fn control_handle(&self) -> Self::ControlHandle {
5023        PhyEventWatcherControlHandle { inner: self.inner.clone() }
5024    }
5025
5026    fn into_inner(
5027        self,
5028    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5029    {
5030        (self.inner, self.is_terminated)
5031    }
5032
5033    fn from_inner(
5034        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5035        is_terminated: bool,
5036    ) -> Self {
5037        Self { inner, is_terminated }
5038    }
5039}
5040
5041impl futures::Stream for PhyEventWatcherRequestStream {
5042    type Item = Result<PhyEventWatcherRequest, fidl::Error>;
5043
5044    fn poll_next(
5045        mut self: std::pin::Pin<&mut Self>,
5046        cx: &mut std::task::Context<'_>,
5047    ) -> std::task::Poll<Option<Self::Item>> {
5048        let this = &mut *self;
5049        if this.inner.check_shutdown(cx) {
5050            this.is_terminated = true;
5051            return std::task::Poll::Ready(None);
5052        }
5053        if this.is_terminated {
5054            panic!("polled PhyEventWatcherRequestStream after completion");
5055        }
5056        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5057            |bytes, handles| {
5058                match this.inner.channel().read_etc(cx, bytes, handles) {
5059                    std::task::Poll::Ready(Ok(())) => {}
5060                    std::task::Poll::Pending => return std::task::Poll::Pending,
5061                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5062                        this.is_terminated = true;
5063                        return std::task::Poll::Ready(None);
5064                    }
5065                    std::task::Poll::Ready(Err(e)) => {
5066                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5067                            e.into(),
5068                        ))));
5069                    }
5070                }
5071
5072                // A message has been received from the channel
5073                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5074
5075                std::task::Poll::Ready(Some(match header.ordinal {
5076                    _ if header.tx_id == 0
5077                        && header
5078                            .dynamic_flags()
5079                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5080                    {
5081                        Ok(PhyEventWatcherRequest::_UnknownMethod {
5082                            ordinal: header.ordinal,
5083                            control_handle: PhyEventWatcherControlHandle {
5084                                inner: this.inner.clone(),
5085                            },
5086                            method_type: fidl::MethodType::OneWay,
5087                        })
5088                    }
5089                    _ if header
5090                        .dynamic_flags()
5091                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
5092                    {
5093                        this.inner.send_framework_err(
5094                            fidl::encoding::FrameworkErr::UnknownMethod,
5095                            header.tx_id,
5096                            header.ordinal,
5097                            header.dynamic_flags(),
5098                            (bytes, handles),
5099                        )?;
5100                        Ok(PhyEventWatcherRequest::_UnknownMethod {
5101                            ordinal: header.ordinal,
5102                            control_handle: PhyEventWatcherControlHandle {
5103                                inner: this.inner.clone(),
5104                            },
5105                            method_type: fidl::MethodType::TwoWay,
5106                        })
5107                    }
5108                    _ => Err(fidl::Error::UnknownOrdinal {
5109                        ordinal: header.ordinal,
5110                        protocol_name:
5111                            <PhyEventWatcherMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5112                    }),
5113                }))
5114            },
5115        )
5116    }
5117}
5118
5119#[derive(Debug)]
5120pub enum PhyEventWatcherRequest {
5121    /// An interaction was received which does not match any known method.
5122    #[non_exhaustive]
5123    _UnknownMethod {
5124        /// Ordinal of the method that was called.
5125        ordinal: u64,
5126        control_handle: PhyEventWatcherControlHandle,
5127        method_type: fidl::MethodType,
5128    },
5129}
5130
5131impl PhyEventWatcherRequest {
5132    /// Name of the method defined in FIDL
5133    pub fn method_name(&self) -> &'static str {
5134        match *self {
5135            PhyEventWatcherRequest::_UnknownMethod {
5136                method_type: fidl::MethodType::OneWay,
5137                ..
5138            } => "unknown one-way method",
5139            PhyEventWatcherRequest::_UnknownMethod {
5140                method_type: fidl::MethodType::TwoWay,
5141                ..
5142            } => "unknown two-way method",
5143        }
5144    }
5145}
5146
5147#[derive(Debug, Clone)]
5148pub struct PhyEventWatcherControlHandle {
5149    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5150}
5151
5152impl fidl::endpoints::ControlHandle for PhyEventWatcherControlHandle {
5153    fn shutdown(&self) {
5154        self.inner.shutdown()
5155    }
5156
5157    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5158        self.inner.shutdown_with_epitaph(status)
5159    }
5160
5161    fn is_closed(&self) -> bool {
5162        self.inner.channel().is_closed()
5163    }
5164    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5165        self.inner.channel().on_closed()
5166    }
5167
5168    #[cfg(target_os = "fuchsia")]
5169    fn signal_peer(
5170        &self,
5171        clear_mask: zx::Signals,
5172        set_mask: zx::Signals,
5173    ) -> Result<(), zx_status::Status> {
5174        use fidl::Peered;
5175        self.inner.channel().signal_peer(clear_mask, set_mask)
5176    }
5177}
5178
5179impl PhyEventWatcherControlHandle {
5180    pub fn send_on_critical_error(
5181        &self,
5182        mut phy_id: u16,
5183        mut reason_code: CriticalErrorReason,
5184    ) -> Result<(), fidl::Error> {
5185        self.inner.send::<PhyEventWatcherOnCriticalErrorRequest>(
5186            (phy_id, reason_code),
5187            0,
5188            0x609a325d54f9e6ac,
5189            fidl::encoding::DynamicFlags::empty(),
5190        )
5191    }
5192
5193    pub fn send_on_country_code_change(
5194        &self,
5195        mut phy_id: u16,
5196        mut alpha2: &[u8; 2],
5197    ) -> Result<(), fidl::Error> {
5198        self.inner.send::<PhyEventWatcherOnCountryCodeChangeRequest>(
5199            (phy_id, alpha2),
5200            0,
5201            0x781d791772be33ed,
5202            fidl::encoding::DynamicFlags::empty(),
5203        )
5204    }
5205}
5206
5207mod internal {
5208    use super::*;
5209
5210    impl fidl::encoding::ResourceTypeMarker for DeviceMonitorGetApSmeRequest {
5211        type Borrowed<'a> = &'a mut Self;
5212        fn take_or_borrow<'a>(
5213            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5214        ) -> Self::Borrowed<'a> {
5215            value
5216        }
5217    }
5218
5219    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetApSmeRequest {
5220        type Owned = Self;
5221
5222        #[inline(always)]
5223        fn inline_align(_context: fidl::encoding::Context) -> usize {
5224            4
5225        }
5226
5227        #[inline(always)]
5228        fn inline_size(_context: fidl::encoding::Context) -> usize {
5229            8
5230        }
5231    }
5232
5233    unsafe impl
5234        fidl::encoding::Encode<
5235            DeviceMonitorGetApSmeRequest,
5236            fidl::encoding::DefaultFuchsiaResourceDialect,
5237        > for &mut DeviceMonitorGetApSmeRequest
5238    {
5239        #[inline]
5240        unsafe fn encode(
5241            self,
5242            encoder: &mut fidl::encoding::Encoder<
5243                '_,
5244                fidl::encoding::DefaultFuchsiaResourceDialect,
5245            >,
5246            offset: usize,
5247            _depth: fidl::encoding::Depth,
5248        ) -> fidl::Result<()> {
5249            encoder.debug_check_bounds::<DeviceMonitorGetApSmeRequest>(offset);
5250            // Delegate to tuple encoding.
5251            fidl::encoding::Encode::<
5252                DeviceMonitorGetApSmeRequest,
5253                fidl::encoding::DefaultFuchsiaResourceDialect,
5254            >::encode(
5255                (
5256                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_id),
5257                    <fidl::encoding::Endpoint<
5258                        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
5259                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5260                        &mut self.sme_server
5261                    ),
5262                ),
5263                encoder,
5264                offset,
5265                _depth,
5266            )
5267        }
5268    }
5269    unsafe impl<
5270        T0: fidl::encoding::Encode<u16, fidl::encoding::DefaultFuchsiaResourceDialect>,
5271        T1: fidl::encoding::Encode<
5272                fidl::encoding::Endpoint<
5273                    fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
5274                >,
5275                fidl::encoding::DefaultFuchsiaResourceDialect,
5276            >,
5277    >
5278        fidl::encoding::Encode<
5279            DeviceMonitorGetApSmeRequest,
5280            fidl::encoding::DefaultFuchsiaResourceDialect,
5281        > for (T0, T1)
5282    {
5283        #[inline]
5284        unsafe fn encode(
5285            self,
5286            encoder: &mut fidl::encoding::Encoder<
5287                '_,
5288                fidl::encoding::DefaultFuchsiaResourceDialect,
5289            >,
5290            offset: usize,
5291            depth: fidl::encoding::Depth,
5292        ) -> fidl::Result<()> {
5293            encoder.debug_check_bounds::<DeviceMonitorGetApSmeRequest>(offset);
5294            // Zero out padding regions. There's no need to apply masks
5295            // because the unmasked parts will be overwritten by fields.
5296            unsafe {
5297                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5298                (ptr as *mut u32).write_unaligned(0);
5299            }
5300            // Write the fields.
5301            self.0.encode(encoder, offset + 0, depth)?;
5302            self.1.encode(encoder, offset + 4, depth)?;
5303            Ok(())
5304        }
5305    }
5306
5307    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5308        for DeviceMonitorGetApSmeRequest
5309    {
5310        #[inline(always)]
5311        fn new_empty() -> Self {
5312            Self {
5313                iface_id: fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect),
5314                sme_server: fidl::new_empty!(
5315                    fidl::encoding::Endpoint<
5316                        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
5317                    >,
5318                    fidl::encoding::DefaultFuchsiaResourceDialect
5319                ),
5320            }
5321        }
5322
5323        #[inline]
5324        unsafe fn decode(
5325            &mut self,
5326            decoder: &mut fidl::encoding::Decoder<
5327                '_,
5328                fidl::encoding::DefaultFuchsiaResourceDialect,
5329            >,
5330            offset: usize,
5331            _depth: fidl::encoding::Depth,
5332        ) -> fidl::Result<()> {
5333            decoder.debug_check_bounds::<Self>(offset);
5334            // Verify that padding bytes are zero.
5335            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
5336            let padval = unsafe { (ptr as *const u32).read_unaligned() };
5337            let mask = 0xffff0000u32;
5338            let maskedval = padval & mask;
5339            if maskedval != 0 {
5340                return Err(fidl::Error::NonZeroPadding {
5341                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5342                });
5343            }
5344            fidl::decode!(
5345                u16,
5346                fidl::encoding::DefaultFuchsiaResourceDialect,
5347                &mut self.iface_id,
5348                decoder,
5349                offset + 0,
5350                _depth
5351            )?;
5352            fidl::decode!(
5353                fidl::encoding::Endpoint<
5354                    fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ApSmeMarker>,
5355                >,
5356                fidl::encoding::DefaultFuchsiaResourceDialect,
5357                &mut self.sme_server,
5358                decoder,
5359                offset + 4,
5360                _depth
5361            )?;
5362            Ok(())
5363        }
5364    }
5365
5366    impl fidl::encoding::ResourceTypeMarker for DeviceMonitorGetClientSmeRequest {
5367        type Borrowed<'a> = &'a mut Self;
5368        fn take_or_borrow<'a>(
5369            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5370        ) -> Self::Borrowed<'a> {
5371            value
5372        }
5373    }
5374
5375    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetClientSmeRequest {
5376        type Owned = Self;
5377
5378        #[inline(always)]
5379        fn inline_align(_context: fidl::encoding::Context) -> usize {
5380            4
5381        }
5382
5383        #[inline(always)]
5384        fn inline_size(_context: fidl::encoding::Context) -> usize {
5385            8
5386        }
5387    }
5388
5389    unsafe impl
5390        fidl::encoding::Encode<
5391            DeviceMonitorGetClientSmeRequest,
5392            fidl::encoding::DefaultFuchsiaResourceDialect,
5393        > for &mut DeviceMonitorGetClientSmeRequest
5394    {
5395        #[inline]
5396        unsafe fn encode(
5397            self,
5398            encoder: &mut fidl::encoding::Encoder<
5399                '_,
5400                fidl::encoding::DefaultFuchsiaResourceDialect,
5401            >,
5402            offset: usize,
5403            _depth: fidl::encoding::Depth,
5404        ) -> fidl::Result<()> {
5405            encoder.debug_check_bounds::<DeviceMonitorGetClientSmeRequest>(offset);
5406            // Delegate to tuple encoding.
5407            fidl::encoding::Encode::<
5408                DeviceMonitorGetClientSmeRequest,
5409                fidl::encoding::DefaultFuchsiaResourceDialect,
5410            >::encode(
5411                (
5412                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_id),
5413                    <fidl::encoding::Endpoint<
5414                        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
5415                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5416                        &mut self.sme_server
5417                    ),
5418                ),
5419                encoder,
5420                offset,
5421                _depth,
5422            )
5423        }
5424    }
5425    unsafe impl<
5426        T0: fidl::encoding::Encode<u16, fidl::encoding::DefaultFuchsiaResourceDialect>,
5427        T1: fidl::encoding::Encode<
5428                fidl::encoding::Endpoint<
5429                    fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
5430                >,
5431                fidl::encoding::DefaultFuchsiaResourceDialect,
5432            >,
5433    >
5434        fidl::encoding::Encode<
5435            DeviceMonitorGetClientSmeRequest,
5436            fidl::encoding::DefaultFuchsiaResourceDialect,
5437        > for (T0, T1)
5438    {
5439        #[inline]
5440        unsafe fn encode(
5441            self,
5442            encoder: &mut fidl::encoding::Encoder<
5443                '_,
5444                fidl::encoding::DefaultFuchsiaResourceDialect,
5445            >,
5446            offset: usize,
5447            depth: fidl::encoding::Depth,
5448        ) -> fidl::Result<()> {
5449            encoder.debug_check_bounds::<DeviceMonitorGetClientSmeRequest>(offset);
5450            // Zero out padding regions. There's no need to apply masks
5451            // because the unmasked parts will be overwritten by fields.
5452            unsafe {
5453                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5454                (ptr as *mut u32).write_unaligned(0);
5455            }
5456            // Write the fields.
5457            self.0.encode(encoder, offset + 0, depth)?;
5458            self.1.encode(encoder, offset + 4, depth)?;
5459            Ok(())
5460        }
5461    }
5462
5463    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5464        for DeviceMonitorGetClientSmeRequest
5465    {
5466        #[inline(always)]
5467        fn new_empty() -> Self {
5468            Self {
5469                iface_id: fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect),
5470                sme_server: fidl::new_empty!(
5471                    fidl::encoding::Endpoint<
5472                        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
5473                    >,
5474                    fidl::encoding::DefaultFuchsiaResourceDialect
5475                ),
5476            }
5477        }
5478
5479        #[inline]
5480        unsafe fn decode(
5481            &mut self,
5482            decoder: &mut fidl::encoding::Decoder<
5483                '_,
5484                fidl::encoding::DefaultFuchsiaResourceDialect,
5485            >,
5486            offset: usize,
5487            _depth: fidl::encoding::Depth,
5488        ) -> fidl::Result<()> {
5489            decoder.debug_check_bounds::<Self>(offset);
5490            // Verify that padding bytes are zero.
5491            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
5492            let padval = unsafe { (ptr as *const u32).read_unaligned() };
5493            let mask = 0xffff0000u32;
5494            let maskedval = padval & mask;
5495            if maskedval != 0 {
5496                return Err(fidl::Error::NonZeroPadding {
5497                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5498                });
5499            }
5500            fidl::decode!(
5501                u16,
5502                fidl::encoding::DefaultFuchsiaResourceDialect,
5503                &mut self.iface_id,
5504                decoder,
5505                offset + 0,
5506                _depth
5507            )?;
5508            fidl::decode!(
5509                fidl::encoding::Endpoint<
5510                    fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::ClientSmeMarker>,
5511                >,
5512                fidl::encoding::DefaultFuchsiaResourceDialect,
5513                &mut self.sme_server,
5514                decoder,
5515                offset + 4,
5516                _depth
5517            )?;
5518            Ok(())
5519        }
5520    }
5521
5522    impl fidl::encoding::ResourceTypeMarker for DeviceMonitorGetSmeTelemetryRequest {
5523        type Borrowed<'a> = &'a mut Self;
5524        fn take_or_borrow<'a>(
5525            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5526        ) -> Self::Borrowed<'a> {
5527            value
5528        }
5529    }
5530
5531    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorGetSmeTelemetryRequest {
5532        type Owned = Self;
5533
5534        #[inline(always)]
5535        fn inline_align(_context: fidl::encoding::Context) -> usize {
5536            4
5537        }
5538
5539        #[inline(always)]
5540        fn inline_size(_context: fidl::encoding::Context) -> usize {
5541            8
5542        }
5543    }
5544
5545    unsafe impl
5546        fidl::encoding::Encode<
5547            DeviceMonitorGetSmeTelemetryRequest,
5548            fidl::encoding::DefaultFuchsiaResourceDialect,
5549        > for &mut DeviceMonitorGetSmeTelemetryRequest
5550    {
5551        #[inline]
5552        unsafe fn encode(
5553            self,
5554            encoder: &mut fidl::encoding::Encoder<
5555                '_,
5556                fidl::encoding::DefaultFuchsiaResourceDialect,
5557            >,
5558            offset: usize,
5559            _depth: fidl::encoding::Depth,
5560        ) -> fidl::Result<()> {
5561            encoder.debug_check_bounds::<DeviceMonitorGetSmeTelemetryRequest>(offset);
5562            // Delegate to tuple encoding.
5563            fidl::encoding::Encode::<
5564                DeviceMonitorGetSmeTelemetryRequest,
5565                fidl::encoding::DefaultFuchsiaResourceDialect,
5566            >::encode(
5567                (
5568                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.iface_id),
5569                    <fidl::encoding::Endpoint<
5570                        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
5571                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5572                        &mut self.telemetry_server,
5573                    ),
5574                ),
5575                encoder,
5576                offset,
5577                _depth,
5578            )
5579        }
5580    }
5581    unsafe impl<
5582        T0: fidl::encoding::Encode<u16, fidl::encoding::DefaultFuchsiaResourceDialect>,
5583        T1: fidl::encoding::Encode<
5584                fidl::encoding::Endpoint<
5585                    fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
5586                >,
5587                fidl::encoding::DefaultFuchsiaResourceDialect,
5588            >,
5589    >
5590        fidl::encoding::Encode<
5591            DeviceMonitorGetSmeTelemetryRequest,
5592            fidl::encoding::DefaultFuchsiaResourceDialect,
5593        > for (T0, T1)
5594    {
5595        #[inline]
5596        unsafe fn encode(
5597            self,
5598            encoder: &mut fidl::encoding::Encoder<
5599                '_,
5600                fidl::encoding::DefaultFuchsiaResourceDialect,
5601            >,
5602            offset: usize,
5603            depth: fidl::encoding::Depth,
5604        ) -> fidl::Result<()> {
5605            encoder.debug_check_bounds::<DeviceMonitorGetSmeTelemetryRequest>(offset);
5606            // Zero out padding regions. There's no need to apply masks
5607            // because the unmasked parts will be overwritten by fields.
5608            unsafe {
5609                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
5610                (ptr as *mut u32).write_unaligned(0);
5611            }
5612            // Write the fields.
5613            self.0.encode(encoder, offset + 0, depth)?;
5614            self.1.encode(encoder, offset + 4, depth)?;
5615            Ok(())
5616        }
5617    }
5618
5619    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5620        for DeviceMonitorGetSmeTelemetryRequest
5621    {
5622        #[inline(always)]
5623        fn new_empty() -> Self {
5624            Self {
5625                iface_id: fidl::new_empty!(u16, fidl::encoding::DefaultFuchsiaResourceDialect),
5626                telemetry_server: fidl::new_empty!(
5627                    fidl::encoding::Endpoint<
5628                        fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
5629                    >,
5630                    fidl::encoding::DefaultFuchsiaResourceDialect
5631                ),
5632            }
5633        }
5634
5635        #[inline]
5636        unsafe fn decode(
5637            &mut self,
5638            decoder: &mut fidl::encoding::Decoder<
5639                '_,
5640                fidl::encoding::DefaultFuchsiaResourceDialect,
5641            >,
5642            offset: usize,
5643            _depth: fidl::encoding::Depth,
5644        ) -> fidl::Result<()> {
5645            decoder.debug_check_bounds::<Self>(offset);
5646            // Verify that padding bytes are zero.
5647            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
5648            let padval = unsafe { (ptr as *const u32).read_unaligned() };
5649            let mask = 0xffff0000u32;
5650            let maskedval = padval & mask;
5651            if maskedval != 0 {
5652                return Err(fidl::Error::NonZeroPadding {
5653                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
5654                });
5655            }
5656            fidl::decode!(
5657                u16,
5658                fidl::encoding::DefaultFuchsiaResourceDialect,
5659                &mut self.iface_id,
5660                decoder,
5661                offset + 0,
5662                _depth
5663            )?;
5664            fidl::decode!(
5665                fidl::encoding::Endpoint<
5666                    fidl::endpoints::ServerEnd<fidl_fuchsia_wlan_sme::TelemetryMarker>,
5667                >,
5668                fidl::encoding::DefaultFuchsiaResourceDialect,
5669                &mut self.telemetry_server,
5670                decoder,
5671                offset + 4,
5672                _depth
5673            )?;
5674            Ok(())
5675        }
5676    }
5677
5678    impl fidl::encoding::ResourceTypeMarker for DeviceMonitorWatchDevicesRequest {
5679        type Borrowed<'a> = &'a mut Self;
5680        fn take_or_borrow<'a>(
5681            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5682        ) -> Self::Borrowed<'a> {
5683            value
5684        }
5685    }
5686
5687    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorWatchDevicesRequest {
5688        type Owned = Self;
5689
5690        #[inline(always)]
5691        fn inline_align(_context: fidl::encoding::Context) -> usize {
5692            4
5693        }
5694
5695        #[inline(always)]
5696        fn inline_size(_context: fidl::encoding::Context) -> usize {
5697            4
5698        }
5699    }
5700
5701    unsafe impl
5702        fidl::encoding::Encode<
5703            DeviceMonitorWatchDevicesRequest,
5704            fidl::encoding::DefaultFuchsiaResourceDialect,
5705        > for &mut DeviceMonitorWatchDevicesRequest
5706    {
5707        #[inline]
5708        unsafe fn encode(
5709            self,
5710            encoder: &mut fidl::encoding::Encoder<
5711                '_,
5712                fidl::encoding::DefaultFuchsiaResourceDialect,
5713            >,
5714            offset: usize,
5715            _depth: fidl::encoding::Depth,
5716        ) -> fidl::Result<()> {
5717            encoder.debug_check_bounds::<DeviceMonitorWatchDevicesRequest>(offset);
5718            // Delegate to tuple encoding.
5719            fidl::encoding::Encode::<DeviceMonitorWatchDevicesRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5720                (
5721                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
5722                ),
5723                encoder, offset, _depth
5724            )
5725        }
5726    }
5727    unsafe impl<
5728        T0: fidl::encoding::Encode<
5729                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>>,
5730                fidl::encoding::DefaultFuchsiaResourceDialect,
5731            >,
5732    >
5733        fidl::encoding::Encode<
5734            DeviceMonitorWatchDevicesRequest,
5735            fidl::encoding::DefaultFuchsiaResourceDialect,
5736        > for (T0,)
5737    {
5738        #[inline]
5739        unsafe fn encode(
5740            self,
5741            encoder: &mut fidl::encoding::Encoder<
5742                '_,
5743                fidl::encoding::DefaultFuchsiaResourceDialect,
5744            >,
5745            offset: usize,
5746            depth: fidl::encoding::Depth,
5747        ) -> fidl::Result<()> {
5748            encoder.debug_check_bounds::<DeviceMonitorWatchDevicesRequest>(offset);
5749            // Zero out padding regions. There's no need to apply masks
5750            // because the unmasked parts will be overwritten by fields.
5751            // Write the fields.
5752            self.0.encode(encoder, offset + 0, depth)?;
5753            Ok(())
5754        }
5755    }
5756
5757    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5758        for DeviceMonitorWatchDevicesRequest
5759    {
5760        #[inline(always)]
5761        fn new_empty() -> Self {
5762            Self {
5763                watcher: fidl::new_empty!(
5764                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>>,
5765                    fidl::encoding::DefaultFuchsiaResourceDialect
5766                ),
5767            }
5768        }
5769
5770        #[inline]
5771        unsafe fn decode(
5772            &mut self,
5773            decoder: &mut fidl::encoding::Decoder<
5774                '_,
5775                fidl::encoding::DefaultFuchsiaResourceDialect,
5776            >,
5777            offset: usize,
5778            _depth: fidl::encoding::Depth,
5779        ) -> fidl::Result<()> {
5780            decoder.debug_check_bounds::<Self>(offset);
5781            // Verify that padding bytes are zero.
5782            fidl::decode!(
5783                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DeviceWatcherMarker>>,
5784                fidl::encoding::DefaultFuchsiaResourceDialect,
5785                &mut self.watcher,
5786                decoder,
5787                offset + 0,
5788                _depth
5789            )?;
5790            Ok(())
5791        }
5792    }
5793
5794    impl fidl::encoding::ResourceTypeMarker for DeviceMonitorWatchPhyEventsRequest {
5795        type Borrowed<'a> = &'a mut Self;
5796        fn take_or_borrow<'a>(
5797            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5798        ) -> Self::Borrowed<'a> {
5799            value
5800        }
5801    }
5802
5803    unsafe impl fidl::encoding::TypeMarker for DeviceMonitorWatchPhyEventsRequest {
5804        type Owned = Self;
5805
5806        #[inline(always)]
5807        fn inline_align(_context: fidl::encoding::Context) -> usize {
5808            4
5809        }
5810
5811        #[inline(always)]
5812        fn inline_size(_context: fidl::encoding::Context) -> usize {
5813            4
5814        }
5815    }
5816
5817    unsafe impl
5818        fidl::encoding::Encode<
5819            DeviceMonitorWatchPhyEventsRequest,
5820            fidl::encoding::DefaultFuchsiaResourceDialect,
5821        > for &mut DeviceMonitorWatchPhyEventsRequest
5822    {
5823        #[inline]
5824        unsafe fn encode(
5825            self,
5826            encoder: &mut fidl::encoding::Encoder<
5827                '_,
5828                fidl::encoding::DefaultFuchsiaResourceDialect,
5829            >,
5830            offset: usize,
5831            _depth: fidl::encoding::Depth,
5832        ) -> fidl::Result<()> {
5833            encoder.debug_check_bounds::<DeviceMonitorWatchPhyEventsRequest>(offset);
5834            // Delegate to tuple encoding.
5835            fidl::encoding::Encode::<DeviceMonitorWatchPhyEventsRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
5836                (
5837                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PhyEventWatcherMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.watcher),
5838                ),
5839                encoder, offset, _depth
5840            )
5841        }
5842    }
5843    unsafe impl<
5844        T0: fidl::encoding::Encode<
5845                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PhyEventWatcherMarker>>,
5846                fidl::encoding::DefaultFuchsiaResourceDialect,
5847            >,
5848    >
5849        fidl::encoding::Encode<
5850            DeviceMonitorWatchPhyEventsRequest,
5851            fidl::encoding::DefaultFuchsiaResourceDialect,
5852        > for (T0,)
5853    {
5854        #[inline]
5855        unsafe fn encode(
5856            self,
5857            encoder: &mut fidl::encoding::Encoder<
5858                '_,
5859                fidl::encoding::DefaultFuchsiaResourceDialect,
5860            >,
5861            offset: usize,
5862            depth: fidl::encoding::Depth,
5863        ) -> fidl::Result<()> {
5864            encoder.debug_check_bounds::<DeviceMonitorWatchPhyEventsRequest>(offset);
5865            // Zero out padding regions. There's no need to apply masks
5866            // because the unmasked parts will be overwritten by fields.
5867            // Write the fields.
5868            self.0.encode(encoder, offset + 0, depth)?;
5869            Ok(())
5870        }
5871    }
5872
5873    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5874        for DeviceMonitorWatchPhyEventsRequest
5875    {
5876        #[inline(always)]
5877        fn new_empty() -> Self {
5878            Self {
5879                watcher: fidl::new_empty!(
5880                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PhyEventWatcherMarker>>,
5881                    fidl::encoding::DefaultFuchsiaResourceDialect
5882                ),
5883            }
5884        }
5885
5886        #[inline]
5887        unsafe fn decode(
5888            &mut self,
5889            decoder: &mut fidl::encoding::Decoder<
5890                '_,
5891                fidl::encoding::DefaultFuchsiaResourceDialect,
5892            >,
5893            offset: usize,
5894            _depth: fidl::encoding::Depth,
5895        ) -> fidl::Result<()> {
5896            decoder.debug_check_bounds::<Self>(offset);
5897            // Verify that padding bytes are zero.
5898            fidl::decode!(
5899                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<PhyEventWatcherMarker>>,
5900                fidl::encoding::DefaultFuchsiaResourceDialect,
5901                &mut self.watcher,
5902                decoder,
5903                offset + 0,
5904                _depth
5905            )?;
5906            Ok(())
5907        }
5908    }
5909}