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