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