Skip to main content

fidl_fuchsia_wlan_sme/
fidl_fuchsia_wlan_sme.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_sme_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct ClientSmeConnectRequest {
16    pub req: ConnectRequest,
17    pub txn: Option<fidl::endpoints::ServerEnd<ConnectTransactionMarker>>,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ClientSmeConnectRequest {}
21
22#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
23pub struct ClientSmeScanForControllerRequest {
24    pub req: ScanRequest,
25}
26
27impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
28    for ClientSmeScanForControllerRequest
29{
30}
31
32#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
33pub struct ClientSmeScanRequest {
34    pub req: ScanRequest,
35}
36
37impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ClientSmeScanRequest {}
38
39#[derive(Debug, PartialEq)]
40pub struct ClientSmeStartScheduledScanRequest {
41    pub req: fidl_fuchsia_wlan_common::ScheduledScanRequest,
42    pub txn: fidl::endpoints::ServerEnd<ScheduledScanTransactionMarker>,
43}
44
45impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
46    for ClientSmeStartScheduledScanRequest
47{
48}
49
50#[derive(Debug, PartialEq)]
51pub struct ClientSmeScanForControllerResponse {
52    pub scan_results: Vec<ScanResult>,
53}
54
55impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
56    for ClientSmeScanForControllerResponse
57{
58}
59
60#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
61pub struct ClientSmeScanResponse {
62    pub scan_results: fidl::Vmo,
63}
64
65impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ClientSmeScanResponse {}
66
67#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
68pub struct GenericSmeGetApSmeRequest {
69    pub sme_server: fidl::endpoints::ServerEnd<ApSmeMarker>,
70}
71
72impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for GenericSmeGetApSmeRequest {}
73
74#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
75pub struct GenericSmeGetClientSmeRequest {
76    pub sme_server: fidl::endpoints::ServerEnd<ClientSmeMarker>,
77}
78
79impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
80    for GenericSmeGetClientSmeRequest
81{
82}
83
84#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
85pub struct GenericSmeGetSmeTelemetryRequest {
86    pub telemetry_server: fidl::endpoints::ServerEnd<TelemetryMarker>,
87}
88
89impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
90    for GenericSmeGetSmeTelemetryRequest
91{
92}
93
94#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
95pub struct GenericSmeQueryResponse {
96    pub resp: GenericSmeQuery,
97}
98
99impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for GenericSmeQueryResponse {}
100
101#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
102pub struct ScheduledScanTransactionOnScheduledScanMatchesAvailableRequest {
103    pub scan_results: fidl::Vmo,
104}
105
106impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
107    for ScheduledScanTransactionOnScheduledScanMatchesAvailableRequest
108{
109}
110
111#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
112pub struct TelemetryCloneInspectVmoResponse {
113    pub inspect_vmo: fidl::Vmo,
114}
115
116impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
117    for TelemetryCloneInspectVmoResponse
118{
119}
120
121#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
122pub struct UsmeBootstrapStartRequest {
123    pub generic_sme_server: fidl::endpoints::ServerEnd<GenericSmeMarker>,
124    pub legacy_privacy_support: LegacyPrivacySupport,
125}
126
127impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for UsmeBootstrapStartRequest {}
128
129#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
130pub struct UsmeBootstrapStartResponse {
131    pub inspect_vmo: fidl::Vmo,
132}
133
134impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
135    for UsmeBootstrapStartResponse
136{
137}
138
139#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
140pub struct ApSmeMarker;
141
142impl fidl::endpoints::ProtocolMarker for ApSmeMarker {
143    type Proxy = ApSmeProxy;
144    type RequestStream = ApSmeRequestStream;
145    #[cfg(target_os = "fuchsia")]
146    type SynchronousProxy = ApSmeSynchronousProxy;
147
148    const DEBUG_NAME: &'static str = "(anonymous) ApSme";
149}
150
151pub trait ApSmeProxyInterface: Send + Sync {
152    type StartResponseFut: std::future::Future<Output = Result<StartApResultCode, fidl::Error>>
153        + Send;
154    fn r#start(&self, config: &ApConfig) -> Self::StartResponseFut;
155    type StopResponseFut: std::future::Future<Output = Result<StopApResultCode, fidl::Error>> + Send;
156    fn r#stop(&self) -> Self::StopResponseFut;
157    type StatusResponseFut: std::future::Future<Output = Result<ApStatusResponse, fidl::Error>>
158        + Send;
159    fn r#status(&self) -> Self::StatusResponseFut;
160}
161#[derive(Debug)]
162#[cfg(target_os = "fuchsia")]
163pub struct ApSmeSynchronousProxy {
164    client: fidl::client::sync::Client,
165}
166
167#[cfg(target_os = "fuchsia")]
168impl fidl::endpoints::SynchronousProxy for ApSmeSynchronousProxy {
169    type Proxy = ApSmeProxy;
170    type Protocol = ApSmeMarker;
171
172    fn from_channel(inner: fidl::Channel) -> Self {
173        Self::new(inner)
174    }
175
176    fn into_channel(self) -> fidl::Channel {
177        self.client.into_channel()
178    }
179
180    fn as_channel(&self) -> &fidl::Channel {
181        self.client.as_channel()
182    }
183}
184
185#[cfg(target_os = "fuchsia")]
186impl ApSmeSynchronousProxy {
187    pub fn new(channel: fidl::Channel) -> Self {
188        Self { client: fidl::client::sync::Client::new(channel) }
189    }
190
191    pub fn into_channel(self) -> fidl::Channel {
192        self.client.into_channel()
193    }
194
195    /// Waits until an event arrives and returns it. It is safe for other
196    /// threads to make concurrent requests while waiting for an event.
197    pub fn wait_for_event(
198        &self,
199        deadline: zx::MonotonicInstant,
200    ) -> Result<ApSmeEvent, fidl::Error> {
201        ApSmeEvent::decode(self.client.wait_for_event::<ApSmeMarker>(deadline)?)
202    }
203
204    pub fn r#start(
205        &self,
206        mut config: &ApConfig,
207        ___deadline: zx::MonotonicInstant,
208    ) -> Result<StartApResultCode, fidl::Error> {
209        let _response =
210            self.client.send_query::<ApSmeStartRequest, ApSmeStartResponse, ApSmeMarker>(
211                (config,),
212                0x33fa134ceda8624d,
213                fidl::encoding::DynamicFlags::empty(),
214                ___deadline,
215            )?;
216        Ok(_response.code)
217    }
218
219    pub fn r#stop(
220        &self,
221        ___deadline: zx::MonotonicInstant,
222    ) -> Result<StopApResultCode, fidl::Error> {
223        let _response = self
224            .client
225            .send_query::<fidl::encoding::EmptyPayload, ApSmeStopResponse, ApSmeMarker>(
226                (),
227                0x56423f5b49a2e851,
228                fidl::encoding::DynamicFlags::empty(),
229                ___deadline,
230            )?;
231        Ok(_response.code)
232    }
233
234    pub fn r#status(
235        &self,
236        ___deadline: zx::MonotonicInstant,
237    ) -> Result<ApStatusResponse, fidl::Error> {
238        let _response = self
239            .client
240            .send_query::<fidl::encoding::EmptyPayload, ApSmeStatusResponse, ApSmeMarker>(
241                (),
242                0x51c688ac7a101606,
243                fidl::encoding::DynamicFlags::empty(),
244                ___deadline,
245            )?;
246        Ok(_response.resp)
247    }
248}
249
250#[cfg(target_os = "fuchsia")]
251impl From<ApSmeSynchronousProxy> for zx::NullableHandle {
252    fn from(value: ApSmeSynchronousProxy) -> Self {
253        value.into_channel().into()
254    }
255}
256
257#[cfg(target_os = "fuchsia")]
258impl From<fidl::Channel> for ApSmeSynchronousProxy {
259    fn from(value: fidl::Channel) -> Self {
260        Self::new(value)
261    }
262}
263
264#[cfg(target_os = "fuchsia")]
265impl fidl::endpoints::FromClient for ApSmeSynchronousProxy {
266    type Protocol = ApSmeMarker;
267
268    fn from_client(value: fidl::endpoints::ClientEnd<ApSmeMarker>) -> Self {
269        Self::new(value.into_channel())
270    }
271}
272
273#[derive(Debug, Clone)]
274pub struct ApSmeProxy {
275    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
276}
277
278impl fidl::endpoints::Proxy for ApSmeProxy {
279    type Protocol = ApSmeMarker;
280
281    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
282        Self::new(inner)
283    }
284
285    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
286        self.client.into_channel().map_err(|client| Self { client })
287    }
288
289    fn as_channel(&self) -> &::fidl::AsyncChannel {
290        self.client.as_channel()
291    }
292}
293
294impl ApSmeProxy {
295    /// Create a new Proxy for fuchsia.wlan.sme/ApSme.
296    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
297        let protocol_name = <ApSmeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
298        Self { client: fidl::client::Client::new(channel, protocol_name) }
299    }
300
301    /// Get a Stream of events from the remote end of the protocol.
302    ///
303    /// # Panics
304    ///
305    /// Panics if the event stream was already taken.
306    pub fn take_event_stream(&self) -> ApSmeEventStream {
307        ApSmeEventStream { event_receiver: self.client.take_event_receiver() }
308    }
309
310    pub fn r#start(
311        &self,
312        mut config: &ApConfig,
313    ) -> fidl::client::QueryResponseFut<
314        StartApResultCode,
315        fidl::encoding::DefaultFuchsiaResourceDialect,
316    > {
317        ApSmeProxyInterface::r#start(self, config)
318    }
319
320    pub fn r#stop(
321        &self,
322    ) -> fidl::client::QueryResponseFut<
323        StopApResultCode,
324        fidl::encoding::DefaultFuchsiaResourceDialect,
325    > {
326        ApSmeProxyInterface::r#stop(self)
327    }
328
329    pub fn r#status(
330        &self,
331    ) -> fidl::client::QueryResponseFut<
332        ApStatusResponse,
333        fidl::encoding::DefaultFuchsiaResourceDialect,
334    > {
335        ApSmeProxyInterface::r#status(self)
336    }
337}
338
339impl ApSmeProxyInterface for ApSmeProxy {
340    type StartResponseFut = fidl::client::QueryResponseFut<
341        StartApResultCode,
342        fidl::encoding::DefaultFuchsiaResourceDialect,
343    >;
344    fn r#start(&self, mut config: &ApConfig) -> Self::StartResponseFut {
345        fn _decode(
346            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
347        ) -> Result<StartApResultCode, fidl::Error> {
348            let _response = fidl::client::decode_transaction_body::<
349                ApSmeStartResponse,
350                fidl::encoding::DefaultFuchsiaResourceDialect,
351                0x33fa134ceda8624d,
352            >(_buf?)?;
353            Ok(_response.code)
354        }
355        self.client.send_query_and_decode::<ApSmeStartRequest, StartApResultCode>(
356            (config,),
357            0x33fa134ceda8624d,
358            fidl::encoding::DynamicFlags::empty(),
359            _decode,
360        )
361    }
362
363    type StopResponseFut = fidl::client::QueryResponseFut<
364        StopApResultCode,
365        fidl::encoding::DefaultFuchsiaResourceDialect,
366    >;
367    fn r#stop(&self) -> Self::StopResponseFut {
368        fn _decode(
369            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
370        ) -> Result<StopApResultCode, fidl::Error> {
371            let _response = fidl::client::decode_transaction_body::<
372                ApSmeStopResponse,
373                fidl::encoding::DefaultFuchsiaResourceDialect,
374                0x56423f5b49a2e851,
375            >(_buf?)?;
376            Ok(_response.code)
377        }
378        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, StopApResultCode>(
379            (),
380            0x56423f5b49a2e851,
381            fidl::encoding::DynamicFlags::empty(),
382            _decode,
383        )
384    }
385
386    type StatusResponseFut = fidl::client::QueryResponseFut<
387        ApStatusResponse,
388        fidl::encoding::DefaultFuchsiaResourceDialect,
389    >;
390    fn r#status(&self) -> Self::StatusResponseFut {
391        fn _decode(
392            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
393        ) -> Result<ApStatusResponse, fidl::Error> {
394            let _response = fidl::client::decode_transaction_body::<
395                ApSmeStatusResponse,
396                fidl::encoding::DefaultFuchsiaResourceDialect,
397                0x51c688ac7a101606,
398            >(_buf?)?;
399            Ok(_response.resp)
400        }
401        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ApStatusResponse>(
402            (),
403            0x51c688ac7a101606,
404            fidl::encoding::DynamicFlags::empty(),
405            _decode,
406        )
407    }
408}
409
410pub struct ApSmeEventStream {
411    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
412}
413
414impl std::marker::Unpin for ApSmeEventStream {}
415
416impl futures::stream::FusedStream for ApSmeEventStream {
417    fn is_terminated(&self) -> bool {
418        self.event_receiver.is_terminated()
419    }
420}
421
422impl futures::Stream for ApSmeEventStream {
423    type Item = Result<ApSmeEvent, fidl::Error>;
424
425    fn poll_next(
426        mut self: std::pin::Pin<&mut Self>,
427        cx: &mut std::task::Context<'_>,
428    ) -> std::task::Poll<Option<Self::Item>> {
429        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
430            &mut self.event_receiver,
431            cx
432        )?) {
433            Some(buf) => std::task::Poll::Ready(Some(ApSmeEvent::decode(buf))),
434            None => std::task::Poll::Ready(None),
435        }
436    }
437}
438
439#[derive(Debug)]
440pub enum ApSmeEvent {}
441
442impl ApSmeEvent {
443    /// Decodes a message buffer as a [`ApSmeEvent`].
444    fn decode(
445        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
446    ) -> Result<ApSmeEvent, fidl::Error> {
447        let (bytes, _handles) = buf.split_mut();
448        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
449        debug_assert_eq!(tx_header.tx_id, 0);
450        match tx_header.ordinal {
451            _ => Err(fidl::Error::UnknownOrdinal {
452                ordinal: tx_header.ordinal,
453                protocol_name: <ApSmeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
454            }),
455        }
456    }
457}
458
459/// A Stream of incoming requests for fuchsia.wlan.sme/ApSme.
460pub struct ApSmeRequestStream {
461    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
462    is_terminated: bool,
463}
464
465impl std::marker::Unpin for ApSmeRequestStream {}
466
467impl futures::stream::FusedStream for ApSmeRequestStream {
468    fn is_terminated(&self) -> bool {
469        self.is_terminated
470    }
471}
472
473impl fidl::endpoints::RequestStream for ApSmeRequestStream {
474    type Protocol = ApSmeMarker;
475    type ControlHandle = ApSmeControlHandle;
476
477    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
478        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
479    }
480
481    fn control_handle(&self) -> Self::ControlHandle {
482        ApSmeControlHandle { inner: self.inner.clone() }
483    }
484
485    fn into_inner(
486        self,
487    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
488    {
489        (self.inner, self.is_terminated)
490    }
491
492    fn from_inner(
493        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
494        is_terminated: bool,
495    ) -> Self {
496        Self { inner, is_terminated }
497    }
498}
499
500impl futures::Stream for ApSmeRequestStream {
501    type Item = Result<ApSmeRequest, fidl::Error>;
502
503    fn poll_next(
504        mut self: std::pin::Pin<&mut Self>,
505        cx: &mut std::task::Context<'_>,
506    ) -> std::task::Poll<Option<Self::Item>> {
507        let this = &mut *self;
508        if this.inner.check_shutdown(cx) {
509            this.is_terminated = true;
510            return std::task::Poll::Ready(None);
511        }
512        if this.is_terminated {
513            panic!("polled ApSmeRequestStream after completion");
514        }
515        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
516            |bytes, handles| {
517                match this.inner.channel().read_etc(cx, bytes, handles) {
518                    std::task::Poll::Ready(Ok(())) => {}
519                    std::task::Poll::Pending => return std::task::Poll::Pending,
520                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
521                        this.is_terminated = true;
522                        return std::task::Poll::Ready(None);
523                    }
524                    std::task::Poll::Ready(Err(e)) => {
525                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
526                            e.into(),
527                        ))));
528                    }
529                }
530
531                // A message has been received from the channel
532                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
533
534                std::task::Poll::Ready(Some(match header.ordinal {
535                    0x33fa134ceda8624d => {
536                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
537                        let mut req = fidl::new_empty!(
538                            ApSmeStartRequest,
539                            fidl::encoding::DefaultFuchsiaResourceDialect
540                        );
541                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ApSmeStartRequest>(&header, _body_bytes, handles, &mut req)?;
542                        let control_handle = ApSmeControlHandle { inner: this.inner.clone() };
543                        Ok(ApSmeRequest::Start {
544                            config: req.config,
545
546                            responder: ApSmeStartResponder {
547                                control_handle: std::mem::ManuallyDrop::new(control_handle),
548                                tx_id: header.tx_id,
549                            },
550                        })
551                    }
552                    0x56423f5b49a2e851 => {
553                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
554                        let mut req = fidl::new_empty!(
555                            fidl::encoding::EmptyPayload,
556                            fidl::encoding::DefaultFuchsiaResourceDialect
557                        );
558                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
559                        let control_handle = ApSmeControlHandle { inner: this.inner.clone() };
560                        Ok(ApSmeRequest::Stop {
561                            responder: ApSmeStopResponder {
562                                control_handle: std::mem::ManuallyDrop::new(control_handle),
563                                tx_id: header.tx_id,
564                            },
565                        })
566                    }
567                    0x51c688ac7a101606 => {
568                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
569                        let mut req = fidl::new_empty!(
570                            fidl::encoding::EmptyPayload,
571                            fidl::encoding::DefaultFuchsiaResourceDialect
572                        );
573                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
574                        let control_handle = ApSmeControlHandle { inner: this.inner.clone() };
575                        Ok(ApSmeRequest::Status {
576                            responder: ApSmeStatusResponder {
577                                control_handle: std::mem::ManuallyDrop::new(control_handle),
578                                tx_id: header.tx_id,
579                            },
580                        })
581                    }
582                    _ => Err(fidl::Error::UnknownOrdinal {
583                        ordinal: header.ordinal,
584                        protocol_name: <ApSmeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
585                    }),
586                }))
587            },
588        )
589    }
590}
591
592#[derive(Debug)]
593pub enum ApSmeRequest {
594    Start { config: ApConfig, responder: ApSmeStartResponder },
595    Stop { responder: ApSmeStopResponder },
596    Status { responder: ApSmeStatusResponder },
597}
598
599impl ApSmeRequest {
600    #[allow(irrefutable_let_patterns)]
601    pub fn into_start(self) -> Option<(ApConfig, ApSmeStartResponder)> {
602        if let ApSmeRequest::Start { config, responder } = self {
603            Some((config, responder))
604        } else {
605            None
606        }
607    }
608
609    #[allow(irrefutable_let_patterns)]
610    pub fn into_stop(self) -> Option<(ApSmeStopResponder)> {
611        if let ApSmeRequest::Stop { responder } = self { Some((responder)) } else { None }
612    }
613
614    #[allow(irrefutable_let_patterns)]
615    pub fn into_status(self) -> Option<(ApSmeStatusResponder)> {
616        if let ApSmeRequest::Status { responder } = self { Some((responder)) } else { None }
617    }
618
619    /// Name of the method defined in FIDL
620    pub fn method_name(&self) -> &'static str {
621        match *self {
622            ApSmeRequest::Start { .. } => "start",
623            ApSmeRequest::Stop { .. } => "stop",
624            ApSmeRequest::Status { .. } => "status",
625        }
626    }
627}
628
629#[derive(Debug, Clone)]
630pub struct ApSmeControlHandle {
631    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
632}
633
634impl ApSmeControlHandle {
635    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
636        self.inner.shutdown_with_epitaph(status.into())
637    }
638}
639
640impl fidl::endpoints::ControlHandle for ApSmeControlHandle {
641    fn shutdown(&self) {
642        self.inner.shutdown()
643    }
644
645    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
646        self.inner.shutdown_with_epitaph(status)
647    }
648
649    fn is_closed(&self) -> bool {
650        self.inner.channel().is_closed()
651    }
652    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
653        self.inner.channel().on_closed()
654    }
655
656    #[cfg(target_os = "fuchsia")]
657    fn signal_peer(
658        &self,
659        clear_mask: zx::Signals,
660        set_mask: zx::Signals,
661    ) -> Result<(), zx_status::Status> {
662        use fidl::Peered;
663        self.inner.channel().signal_peer(clear_mask, set_mask)
664    }
665}
666
667impl ApSmeControlHandle {}
668
669#[must_use = "FIDL methods require a response to be sent"]
670#[derive(Debug)]
671pub struct ApSmeStartResponder {
672    control_handle: std::mem::ManuallyDrop<ApSmeControlHandle>,
673    tx_id: u32,
674}
675
676/// Set the the channel to be shutdown (see [`ApSmeControlHandle::shutdown`])
677/// if the responder is dropped without sending a response, so that the client
678/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
679impl std::ops::Drop for ApSmeStartResponder {
680    fn drop(&mut self) {
681        self.control_handle.shutdown();
682        // Safety: drops once, never accessed again
683        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
684    }
685}
686
687impl fidl::endpoints::Responder for ApSmeStartResponder {
688    type ControlHandle = ApSmeControlHandle;
689
690    fn control_handle(&self) -> &ApSmeControlHandle {
691        &self.control_handle
692    }
693
694    fn drop_without_shutdown(mut self) {
695        // Safety: drops once, never accessed again due to mem::forget
696        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
697        // Prevent Drop from running (which would shut down the channel)
698        std::mem::forget(self);
699    }
700}
701
702impl ApSmeStartResponder {
703    /// Sends a response to the FIDL transaction.
704    ///
705    /// Sets the channel to shutdown if an error occurs.
706    pub fn send(self, mut code: StartApResultCode) -> Result<(), fidl::Error> {
707        let _result = self.send_raw(code);
708        if _result.is_err() {
709            self.control_handle.shutdown();
710        }
711        self.drop_without_shutdown();
712        _result
713    }
714
715    /// Similar to "send" but does not shutdown the channel if an error occurs.
716    pub fn send_no_shutdown_on_err(self, mut code: StartApResultCode) -> Result<(), fidl::Error> {
717        let _result = self.send_raw(code);
718        self.drop_without_shutdown();
719        _result
720    }
721
722    fn send_raw(&self, mut code: StartApResultCode) -> Result<(), fidl::Error> {
723        self.control_handle.inner.send::<ApSmeStartResponse>(
724            (code,),
725            self.tx_id,
726            0x33fa134ceda8624d,
727            fidl::encoding::DynamicFlags::empty(),
728        )
729    }
730}
731
732#[must_use = "FIDL methods require a response to be sent"]
733#[derive(Debug)]
734pub struct ApSmeStopResponder {
735    control_handle: std::mem::ManuallyDrop<ApSmeControlHandle>,
736    tx_id: u32,
737}
738
739/// Set the the channel to be shutdown (see [`ApSmeControlHandle::shutdown`])
740/// if the responder is dropped without sending a response, so that the client
741/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
742impl std::ops::Drop for ApSmeStopResponder {
743    fn drop(&mut self) {
744        self.control_handle.shutdown();
745        // Safety: drops once, never accessed again
746        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
747    }
748}
749
750impl fidl::endpoints::Responder for ApSmeStopResponder {
751    type ControlHandle = ApSmeControlHandle;
752
753    fn control_handle(&self) -> &ApSmeControlHandle {
754        &self.control_handle
755    }
756
757    fn drop_without_shutdown(mut self) {
758        // Safety: drops once, never accessed again due to mem::forget
759        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
760        // Prevent Drop from running (which would shut down the channel)
761        std::mem::forget(self);
762    }
763}
764
765impl ApSmeStopResponder {
766    /// Sends a response to the FIDL transaction.
767    ///
768    /// Sets the channel to shutdown if an error occurs.
769    pub fn send(self, mut code: StopApResultCode) -> Result<(), fidl::Error> {
770        let _result = self.send_raw(code);
771        if _result.is_err() {
772            self.control_handle.shutdown();
773        }
774        self.drop_without_shutdown();
775        _result
776    }
777
778    /// Similar to "send" but does not shutdown the channel if an error occurs.
779    pub fn send_no_shutdown_on_err(self, mut code: StopApResultCode) -> Result<(), fidl::Error> {
780        let _result = self.send_raw(code);
781        self.drop_without_shutdown();
782        _result
783    }
784
785    fn send_raw(&self, mut code: StopApResultCode) -> Result<(), fidl::Error> {
786        self.control_handle.inner.send::<ApSmeStopResponse>(
787            (code,),
788            self.tx_id,
789            0x56423f5b49a2e851,
790            fidl::encoding::DynamicFlags::empty(),
791        )
792    }
793}
794
795#[must_use = "FIDL methods require a response to be sent"]
796#[derive(Debug)]
797pub struct ApSmeStatusResponder {
798    control_handle: std::mem::ManuallyDrop<ApSmeControlHandle>,
799    tx_id: u32,
800}
801
802/// Set the the channel to be shutdown (see [`ApSmeControlHandle::shutdown`])
803/// if the responder is dropped without sending a response, so that the client
804/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
805impl std::ops::Drop for ApSmeStatusResponder {
806    fn drop(&mut self) {
807        self.control_handle.shutdown();
808        // Safety: drops once, never accessed again
809        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
810    }
811}
812
813impl fidl::endpoints::Responder for ApSmeStatusResponder {
814    type ControlHandle = ApSmeControlHandle;
815
816    fn control_handle(&self) -> &ApSmeControlHandle {
817        &self.control_handle
818    }
819
820    fn drop_without_shutdown(mut self) {
821        // Safety: drops once, never accessed again due to mem::forget
822        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
823        // Prevent Drop from running (which would shut down the channel)
824        std::mem::forget(self);
825    }
826}
827
828impl ApSmeStatusResponder {
829    /// Sends a response to the FIDL transaction.
830    ///
831    /// Sets the channel to shutdown if an error occurs.
832    pub fn send(self, mut resp: &ApStatusResponse) -> Result<(), fidl::Error> {
833        let _result = self.send_raw(resp);
834        if _result.is_err() {
835            self.control_handle.shutdown();
836        }
837        self.drop_without_shutdown();
838        _result
839    }
840
841    /// Similar to "send" but does not shutdown the channel if an error occurs.
842    pub fn send_no_shutdown_on_err(self, mut resp: &ApStatusResponse) -> Result<(), fidl::Error> {
843        let _result = self.send_raw(resp);
844        self.drop_without_shutdown();
845        _result
846    }
847
848    fn send_raw(&self, mut resp: &ApStatusResponse) -> Result<(), fidl::Error> {
849        self.control_handle.inner.send::<ApSmeStatusResponse>(
850            (resp,),
851            self.tx_id,
852            0x51c688ac7a101606,
853            fidl::encoding::DynamicFlags::empty(),
854        )
855    }
856}
857
858#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
859pub struct ClientSmeMarker;
860
861impl fidl::endpoints::ProtocolMarker for ClientSmeMarker {
862    type Proxy = ClientSmeProxy;
863    type RequestStream = ClientSmeRequestStream;
864    #[cfg(target_os = "fuchsia")]
865    type SynchronousProxy = ClientSmeSynchronousProxy;
866
867    const DEBUG_NAME: &'static str = "(anonymous) ClientSme";
868}
869pub type ClientSmeScanResult = Result<fidl::Vmo, ScanErrorCode>;
870pub type ClientSmeStartScheduledScanResult = Result<(), i32>;
871pub type ClientSmeGetScheduledScanEnabledResult = Result<bool, i32>;
872pub type ClientSmeWmmStatusResult = Result<fidl_fuchsia_wlan_internal::WmmStatusResponse, i32>;
873pub type ClientSmeScanForControllerResult = Result<Vec<ScanResult>, ScanErrorCode>;
874pub type ClientSmeSetMacAddressResult = Result<(), i32>;
875pub type ClientSmeInstallApfPacketFilterResult = Result<(), i32>;
876pub type ClientSmeReadApfPacketFilterDataResult = Result<Vec<u8>, i32>;
877pub type ClientSmeSetApfPacketFilterEnabledResult = Result<(), i32>;
878pub type ClientSmeGetApfPacketFilterEnabledResult = Result<bool, i32>;
879
880pub trait ClientSmeProxyInterface: Send + Sync {
881    type ScanResponseFut: std::future::Future<Output = Result<ClientSmeScanResult, fidl::Error>>
882        + Send;
883    fn r#scan(&self, req: &ScanRequest) -> Self::ScanResponseFut;
884    type StartScheduledScanResponseFut: std::future::Future<Output = Result<ClientSmeStartScheduledScanResult, fidl::Error>>
885        + Send;
886    fn r#start_scheduled_scan(
887        &self,
888        req: &fidl_fuchsia_wlan_common::ScheduledScanRequest,
889        txn: fidl::endpoints::ServerEnd<ScheduledScanTransactionMarker>,
890    ) -> Self::StartScheduledScanResponseFut;
891    type GetScheduledScanEnabledResponseFut: std::future::Future<Output = Result<ClientSmeGetScheduledScanEnabledResult, fidl::Error>>
892        + Send;
893    fn r#get_scheduled_scan_enabled(&self) -> Self::GetScheduledScanEnabledResponseFut;
894    fn r#connect(
895        &self,
896        req: &ConnectRequest,
897        txn: Option<fidl::endpoints::ServerEnd<ConnectTransactionMarker>>,
898    ) -> Result<(), fidl::Error>;
899    fn r#roam(&self, req: &RoamRequest) -> Result<(), fidl::Error>;
900    type DisconnectResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
901    fn r#disconnect(&self, reason: UserDisconnectReason) -> Self::DisconnectResponseFut;
902    type StatusResponseFut: std::future::Future<Output = Result<ClientStatusResponse, fidl::Error>>
903        + Send;
904    fn r#status(&self) -> Self::StatusResponseFut;
905    type WmmStatusResponseFut: std::future::Future<Output = Result<ClientSmeWmmStatusResult, fidl::Error>>
906        + Send;
907    fn r#wmm_status(&self) -> Self::WmmStatusResponseFut;
908    type ScanForControllerResponseFut: std::future::Future<Output = Result<ClientSmeScanForControllerResult, fidl::Error>>
909        + Send;
910    fn r#scan_for_controller(&self, req: &ScanRequest) -> Self::ScanForControllerResponseFut;
911    type SetMacAddressResponseFut: std::future::Future<Output = Result<ClientSmeSetMacAddressResult, fidl::Error>>
912        + Send;
913    fn r#set_mac_address(&self, mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut;
914    type InstallApfPacketFilterResponseFut: std::future::Future<Output = Result<ClientSmeInstallApfPacketFilterResult, fidl::Error>>
915        + Send;
916    fn r#install_apf_packet_filter(
917        &self,
918        program: &[u8],
919    ) -> Self::InstallApfPacketFilterResponseFut;
920    type ReadApfPacketFilterDataResponseFut: std::future::Future<Output = Result<ClientSmeReadApfPacketFilterDataResult, fidl::Error>>
921        + Send;
922    fn r#read_apf_packet_filter_data(&self) -> Self::ReadApfPacketFilterDataResponseFut;
923    type SetApfPacketFilterEnabledResponseFut: std::future::Future<Output = Result<ClientSmeSetApfPacketFilterEnabledResult, fidl::Error>>
924        + Send;
925    fn r#set_apf_packet_filter_enabled(
926        &self,
927        enabled: bool,
928    ) -> Self::SetApfPacketFilterEnabledResponseFut;
929    type GetApfPacketFilterEnabledResponseFut: std::future::Future<Output = Result<ClientSmeGetApfPacketFilterEnabledResult, fidl::Error>>
930        + Send;
931    fn r#get_apf_packet_filter_enabled(&self) -> Self::GetApfPacketFilterEnabledResponseFut;
932}
933#[derive(Debug)]
934#[cfg(target_os = "fuchsia")]
935pub struct ClientSmeSynchronousProxy {
936    client: fidl::client::sync::Client,
937}
938
939#[cfg(target_os = "fuchsia")]
940impl fidl::endpoints::SynchronousProxy for ClientSmeSynchronousProxy {
941    type Proxy = ClientSmeProxy;
942    type Protocol = ClientSmeMarker;
943
944    fn from_channel(inner: fidl::Channel) -> Self {
945        Self::new(inner)
946    }
947
948    fn into_channel(self) -> fidl::Channel {
949        self.client.into_channel()
950    }
951
952    fn as_channel(&self) -> &fidl::Channel {
953        self.client.as_channel()
954    }
955}
956
957#[cfg(target_os = "fuchsia")]
958impl ClientSmeSynchronousProxy {
959    pub fn new(channel: fidl::Channel) -> Self {
960        Self { client: fidl::client::sync::Client::new(channel) }
961    }
962
963    pub fn into_channel(self) -> fidl::Channel {
964        self.client.into_channel()
965    }
966
967    /// Waits until an event arrives and returns it. It is safe for other
968    /// threads to make concurrent requests while waiting for an event.
969    pub fn wait_for_event(
970        &self,
971        deadline: zx::MonotonicInstant,
972    ) -> Result<ClientSmeEvent, fidl::Error> {
973        ClientSmeEvent::decode(self.client.wait_for_event::<ClientSmeMarker>(deadline)?)
974    }
975
976    pub fn r#scan(
977        &self,
978        mut req: &ScanRequest,
979        ___deadline: zx::MonotonicInstant,
980    ) -> Result<ClientSmeScanResult, fidl::Error> {
981        let _response = self.client.send_query::<ClientSmeScanRequest, fidl::encoding::ResultType<
982            ClientSmeScanResponse,
983            ScanErrorCode,
984        >, ClientSmeMarker>(
985            (req,),
986            0xded0ce3b1685822,
987            fidl::encoding::DynamicFlags::empty(),
988            ___deadline,
989        )?;
990        Ok(_response.map(|x| x.scan_results))
991    }
992
993    /// Starts scheduled scanning.
994    pub fn r#start_scheduled_scan(
995        &self,
996        mut req: &fidl_fuchsia_wlan_common::ScheduledScanRequest,
997        mut txn: fidl::endpoints::ServerEnd<ScheduledScanTransactionMarker>,
998        ___deadline: zx::MonotonicInstant,
999    ) -> Result<ClientSmeStartScheduledScanResult, fidl::Error> {
1000        let _response = self.client.send_query::<
1001            ClientSmeStartScheduledScanRequest,
1002            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1003            ClientSmeMarker,
1004        >(
1005            (req, txn,),
1006            0x97eedb559e6bdb8,
1007            fidl::encoding::DynamicFlags::empty(),
1008            ___deadline,
1009        )?;
1010        Ok(_response.map(|x| x))
1011    }
1012
1013    /// Returns whether any scheduled scans are currently active.
1014    pub fn r#get_scheduled_scan_enabled(
1015        &self,
1016        ___deadline: zx::MonotonicInstant,
1017    ) -> Result<ClientSmeGetScheduledScanEnabledResult, fidl::Error> {
1018        let _response = self.client.send_query::<
1019            fidl::encoding::EmptyPayload,
1020            fidl::encoding::ResultType<ClientSmeGetScheduledScanEnabledResponse, i32>,
1021            ClientSmeMarker,
1022        >(
1023            (),
1024            0x777e3c8854ff2710,
1025            fidl::encoding::DynamicFlags::empty(),
1026            ___deadline,
1027        )?;
1028        Ok(_response.map(|x| x.enabled))
1029    }
1030
1031    pub fn r#connect(
1032        &self,
1033        mut req: &ConnectRequest,
1034        mut txn: Option<fidl::endpoints::ServerEnd<ConnectTransactionMarker>>,
1035    ) -> Result<(), fidl::Error> {
1036        self.client.send::<ClientSmeConnectRequest>(
1037            (req, txn),
1038            0x250a0f6fe9f85351,
1039            fidl::encoding::DynamicFlags::empty(),
1040        )
1041    }
1042
1043    pub fn r#roam(&self, mut req: &RoamRequest) -> Result<(), fidl::Error> {
1044        self.client.send::<ClientSmeRoamRequest>(
1045            (req,),
1046            0x107ead7d84723921,
1047            fidl::encoding::DynamicFlags::empty(),
1048        )
1049    }
1050
1051    pub fn r#disconnect(
1052        &self,
1053        mut reason: UserDisconnectReason,
1054        ___deadline: zx::MonotonicInstant,
1055    ) -> Result<(), fidl::Error> {
1056        let _response = self.client.send_query::<
1057            ClientSmeDisconnectRequest,
1058            fidl::encoding::EmptyPayload,
1059            ClientSmeMarker,
1060        >(
1061            (reason,),
1062            0x39a578de9a107304,
1063            fidl::encoding::DynamicFlags::empty(),
1064            ___deadline,
1065        )?;
1066        Ok(_response)
1067    }
1068
1069    pub fn r#status(
1070        &self,
1071        ___deadline: zx::MonotonicInstant,
1072    ) -> Result<ClientStatusResponse, fidl::Error> {
1073        let _response = self
1074            .client
1075            .send_query::<fidl::encoding::EmptyPayload, ClientSmeStatusResponse, ClientSmeMarker>(
1076                (),
1077                0xda00b607470faf2,
1078                fidl::encoding::DynamicFlags::empty(),
1079                ___deadline,
1080            )?;
1081        Ok(_response.resp)
1082    }
1083
1084    pub fn r#wmm_status(
1085        &self,
1086        ___deadline: zx::MonotonicInstant,
1087    ) -> Result<ClientSmeWmmStatusResult, fidl::Error> {
1088        let _response = self.client.send_query::<
1089            fidl::encoding::EmptyPayload,
1090            fidl::encoding::ResultType<ClientSmeWmmStatusResponse, i32>,
1091            ClientSmeMarker,
1092        >(
1093            (),
1094            0x3d0ccc75f6baa9e3,
1095            fidl::encoding::DynamicFlags::empty(),
1096            ___deadline,
1097        )?;
1098        Ok(_response.map(|x| x.resp))
1099    }
1100
1101    pub fn r#scan_for_controller(
1102        &self,
1103        mut req: &ScanRequest,
1104        ___deadline: zx::MonotonicInstant,
1105    ) -> Result<ClientSmeScanForControllerResult, fidl::Error> {
1106        let _response = self.client.send_query::<
1107            ClientSmeScanForControllerRequest,
1108            fidl::encoding::ResultType<ClientSmeScanForControllerResponse, ScanErrorCode>,
1109            ClientSmeMarker,
1110        >(
1111            (req,),
1112            0x21f00ab22ff79a12,
1113            fidl::encoding::DynamicFlags::empty(),
1114            ___deadline,
1115        )?;
1116        Ok(_response.map(|x| x.scan_results))
1117    }
1118
1119    pub fn r#set_mac_address(
1120        &self,
1121        mut mac_addr: &[u8; 6],
1122        ___deadline: zx::MonotonicInstant,
1123    ) -> Result<ClientSmeSetMacAddressResult, fidl::Error> {
1124        let _response = self.client.send_query::<
1125            ClientSmeSetMacAddressRequest,
1126            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1127            ClientSmeMarker,
1128        >(
1129            (mac_addr,),
1130            0x13e0a0bee8962f58,
1131            fidl::encoding::DynamicFlags::empty(),
1132            ___deadline,
1133        )?;
1134        Ok(_response.map(|x| x))
1135    }
1136
1137    pub fn r#install_apf_packet_filter(
1138        &self,
1139        mut program: &[u8],
1140        ___deadline: zx::MonotonicInstant,
1141    ) -> Result<ClientSmeInstallApfPacketFilterResult, fidl::Error> {
1142        let _response = self.client.send_query::<
1143            ClientSmeInstallApfPacketFilterRequest,
1144            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1145            ClientSmeMarker,
1146        >(
1147            (program,),
1148            0x77435965e7bfaf83,
1149            fidl::encoding::DynamicFlags::empty(),
1150            ___deadline,
1151        )?;
1152        Ok(_response.map(|x| x))
1153    }
1154
1155    pub fn r#read_apf_packet_filter_data(
1156        &self,
1157        ___deadline: zx::MonotonicInstant,
1158    ) -> Result<ClientSmeReadApfPacketFilterDataResult, fidl::Error> {
1159        let _response = self.client.send_query::<
1160            fidl::encoding::EmptyPayload,
1161            fidl::encoding::ResultType<ClientSmeReadApfPacketFilterDataResponse, i32>,
1162            ClientSmeMarker,
1163        >(
1164            (),
1165            0x66fc6616b9963023,
1166            fidl::encoding::DynamicFlags::empty(),
1167            ___deadline,
1168        )?;
1169        Ok(_response.map(|x| x.memory))
1170    }
1171
1172    pub fn r#set_apf_packet_filter_enabled(
1173        &self,
1174        mut enabled: bool,
1175        ___deadline: zx::MonotonicInstant,
1176    ) -> Result<ClientSmeSetApfPacketFilterEnabledResult, fidl::Error> {
1177        let _response = self.client.send_query::<
1178            ClientSmeSetApfPacketFilterEnabledRequest,
1179            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1180            ClientSmeMarker,
1181        >(
1182            (enabled,),
1183            0x5070d2ed31580b81,
1184            fidl::encoding::DynamicFlags::empty(),
1185            ___deadline,
1186        )?;
1187        Ok(_response.map(|x| x))
1188    }
1189
1190    pub fn r#get_apf_packet_filter_enabled(
1191        &self,
1192        ___deadline: zx::MonotonicInstant,
1193    ) -> Result<ClientSmeGetApfPacketFilterEnabledResult, fidl::Error> {
1194        let _response =
1195            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1196                ClientSmeGetApfPacketFilterEnabledResponse,
1197                i32,
1198            >, ClientSmeMarker>(
1199                (),
1200                0xdda5c1533526869,
1201                fidl::encoding::DynamicFlags::empty(),
1202                ___deadline,
1203            )?;
1204        Ok(_response.map(|x| x.enabled))
1205    }
1206}
1207
1208#[cfg(target_os = "fuchsia")]
1209impl From<ClientSmeSynchronousProxy> for zx::NullableHandle {
1210    fn from(value: ClientSmeSynchronousProxy) -> Self {
1211        value.into_channel().into()
1212    }
1213}
1214
1215#[cfg(target_os = "fuchsia")]
1216impl From<fidl::Channel> for ClientSmeSynchronousProxy {
1217    fn from(value: fidl::Channel) -> Self {
1218        Self::new(value)
1219    }
1220}
1221
1222#[cfg(target_os = "fuchsia")]
1223impl fidl::endpoints::FromClient for ClientSmeSynchronousProxy {
1224    type Protocol = ClientSmeMarker;
1225
1226    fn from_client(value: fidl::endpoints::ClientEnd<ClientSmeMarker>) -> Self {
1227        Self::new(value.into_channel())
1228    }
1229}
1230
1231#[derive(Debug, Clone)]
1232pub struct ClientSmeProxy {
1233    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1234}
1235
1236impl fidl::endpoints::Proxy for ClientSmeProxy {
1237    type Protocol = ClientSmeMarker;
1238
1239    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1240        Self::new(inner)
1241    }
1242
1243    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1244        self.client.into_channel().map_err(|client| Self { client })
1245    }
1246
1247    fn as_channel(&self) -> &::fidl::AsyncChannel {
1248        self.client.as_channel()
1249    }
1250}
1251
1252impl ClientSmeProxy {
1253    /// Create a new Proxy for fuchsia.wlan.sme/ClientSme.
1254    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1255        let protocol_name = <ClientSmeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1256        Self { client: fidl::client::Client::new(channel, protocol_name) }
1257    }
1258
1259    /// Get a Stream of events from the remote end of the protocol.
1260    ///
1261    /// # Panics
1262    ///
1263    /// Panics if the event stream was already taken.
1264    pub fn take_event_stream(&self) -> ClientSmeEventStream {
1265        ClientSmeEventStream { event_receiver: self.client.take_event_receiver() }
1266    }
1267
1268    pub fn r#scan(
1269        &self,
1270        mut req: &ScanRequest,
1271    ) -> fidl::client::QueryResponseFut<
1272        ClientSmeScanResult,
1273        fidl::encoding::DefaultFuchsiaResourceDialect,
1274    > {
1275        ClientSmeProxyInterface::r#scan(self, req)
1276    }
1277
1278    /// Starts scheduled scanning.
1279    pub fn r#start_scheduled_scan(
1280        &self,
1281        mut req: &fidl_fuchsia_wlan_common::ScheduledScanRequest,
1282        mut txn: fidl::endpoints::ServerEnd<ScheduledScanTransactionMarker>,
1283    ) -> fidl::client::QueryResponseFut<
1284        ClientSmeStartScheduledScanResult,
1285        fidl::encoding::DefaultFuchsiaResourceDialect,
1286    > {
1287        ClientSmeProxyInterface::r#start_scheduled_scan(self, req, txn)
1288    }
1289
1290    /// Returns whether any scheduled scans are currently active.
1291    pub fn r#get_scheduled_scan_enabled(
1292        &self,
1293    ) -> fidl::client::QueryResponseFut<
1294        ClientSmeGetScheduledScanEnabledResult,
1295        fidl::encoding::DefaultFuchsiaResourceDialect,
1296    > {
1297        ClientSmeProxyInterface::r#get_scheduled_scan_enabled(self)
1298    }
1299
1300    pub fn r#connect(
1301        &self,
1302        mut req: &ConnectRequest,
1303        mut txn: Option<fidl::endpoints::ServerEnd<ConnectTransactionMarker>>,
1304    ) -> Result<(), fidl::Error> {
1305        ClientSmeProxyInterface::r#connect(self, req, txn)
1306    }
1307
1308    pub fn r#roam(&self, mut req: &RoamRequest) -> Result<(), fidl::Error> {
1309        ClientSmeProxyInterface::r#roam(self, req)
1310    }
1311
1312    pub fn r#disconnect(
1313        &self,
1314        mut reason: UserDisconnectReason,
1315    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1316        ClientSmeProxyInterface::r#disconnect(self, reason)
1317    }
1318
1319    pub fn r#status(
1320        &self,
1321    ) -> fidl::client::QueryResponseFut<
1322        ClientStatusResponse,
1323        fidl::encoding::DefaultFuchsiaResourceDialect,
1324    > {
1325        ClientSmeProxyInterface::r#status(self)
1326    }
1327
1328    pub fn r#wmm_status(
1329        &self,
1330    ) -> fidl::client::QueryResponseFut<
1331        ClientSmeWmmStatusResult,
1332        fidl::encoding::DefaultFuchsiaResourceDialect,
1333    > {
1334        ClientSmeProxyInterface::r#wmm_status(self)
1335    }
1336
1337    pub fn r#scan_for_controller(
1338        &self,
1339        mut req: &ScanRequest,
1340    ) -> fidl::client::QueryResponseFut<
1341        ClientSmeScanForControllerResult,
1342        fidl::encoding::DefaultFuchsiaResourceDialect,
1343    > {
1344        ClientSmeProxyInterface::r#scan_for_controller(self, req)
1345    }
1346
1347    pub fn r#set_mac_address(
1348        &self,
1349        mut mac_addr: &[u8; 6],
1350    ) -> fidl::client::QueryResponseFut<
1351        ClientSmeSetMacAddressResult,
1352        fidl::encoding::DefaultFuchsiaResourceDialect,
1353    > {
1354        ClientSmeProxyInterface::r#set_mac_address(self, mac_addr)
1355    }
1356
1357    pub fn r#install_apf_packet_filter(
1358        &self,
1359        mut program: &[u8],
1360    ) -> fidl::client::QueryResponseFut<
1361        ClientSmeInstallApfPacketFilterResult,
1362        fidl::encoding::DefaultFuchsiaResourceDialect,
1363    > {
1364        ClientSmeProxyInterface::r#install_apf_packet_filter(self, program)
1365    }
1366
1367    pub fn r#read_apf_packet_filter_data(
1368        &self,
1369    ) -> fidl::client::QueryResponseFut<
1370        ClientSmeReadApfPacketFilterDataResult,
1371        fidl::encoding::DefaultFuchsiaResourceDialect,
1372    > {
1373        ClientSmeProxyInterface::r#read_apf_packet_filter_data(self)
1374    }
1375
1376    pub fn r#set_apf_packet_filter_enabled(
1377        &self,
1378        mut enabled: bool,
1379    ) -> fidl::client::QueryResponseFut<
1380        ClientSmeSetApfPacketFilterEnabledResult,
1381        fidl::encoding::DefaultFuchsiaResourceDialect,
1382    > {
1383        ClientSmeProxyInterface::r#set_apf_packet_filter_enabled(self, enabled)
1384    }
1385
1386    pub fn r#get_apf_packet_filter_enabled(
1387        &self,
1388    ) -> fidl::client::QueryResponseFut<
1389        ClientSmeGetApfPacketFilterEnabledResult,
1390        fidl::encoding::DefaultFuchsiaResourceDialect,
1391    > {
1392        ClientSmeProxyInterface::r#get_apf_packet_filter_enabled(self)
1393    }
1394}
1395
1396impl ClientSmeProxyInterface for ClientSmeProxy {
1397    type ScanResponseFut = fidl::client::QueryResponseFut<
1398        ClientSmeScanResult,
1399        fidl::encoding::DefaultFuchsiaResourceDialect,
1400    >;
1401    fn r#scan(&self, mut req: &ScanRequest) -> Self::ScanResponseFut {
1402        fn _decode(
1403            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1404        ) -> Result<ClientSmeScanResult, fidl::Error> {
1405            let _response = fidl::client::decode_transaction_body::<
1406                fidl::encoding::ResultType<ClientSmeScanResponse, ScanErrorCode>,
1407                fidl::encoding::DefaultFuchsiaResourceDialect,
1408                0xded0ce3b1685822,
1409            >(_buf?)?;
1410            Ok(_response.map(|x| x.scan_results))
1411        }
1412        self.client.send_query_and_decode::<ClientSmeScanRequest, ClientSmeScanResult>(
1413            (req,),
1414            0xded0ce3b1685822,
1415            fidl::encoding::DynamicFlags::empty(),
1416            _decode,
1417        )
1418    }
1419
1420    type StartScheduledScanResponseFut = fidl::client::QueryResponseFut<
1421        ClientSmeStartScheduledScanResult,
1422        fidl::encoding::DefaultFuchsiaResourceDialect,
1423    >;
1424    fn r#start_scheduled_scan(
1425        &self,
1426        mut req: &fidl_fuchsia_wlan_common::ScheduledScanRequest,
1427        mut txn: fidl::endpoints::ServerEnd<ScheduledScanTransactionMarker>,
1428    ) -> Self::StartScheduledScanResponseFut {
1429        fn _decode(
1430            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1431        ) -> Result<ClientSmeStartScheduledScanResult, fidl::Error> {
1432            let _response = fidl::client::decode_transaction_body::<
1433                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1434                fidl::encoding::DefaultFuchsiaResourceDialect,
1435                0x97eedb559e6bdb8,
1436            >(_buf?)?;
1437            Ok(_response.map(|x| x))
1438        }
1439        self.client.send_query_and_decode::<
1440            ClientSmeStartScheduledScanRequest,
1441            ClientSmeStartScheduledScanResult,
1442        >(
1443            (req, txn,),
1444            0x97eedb559e6bdb8,
1445            fidl::encoding::DynamicFlags::empty(),
1446            _decode,
1447        )
1448    }
1449
1450    type GetScheduledScanEnabledResponseFut = fidl::client::QueryResponseFut<
1451        ClientSmeGetScheduledScanEnabledResult,
1452        fidl::encoding::DefaultFuchsiaResourceDialect,
1453    >;
1454    fn r#get_scheduled_scan_enabled(&self) -> Self::GetScheduledScanEnabledResponseFut {
1455        fn _decode(
1456            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1457        ) -> Result<ClientSmeGetScheduledScanEnabledResult, fidl::Error> {
1458            let _response = fidl::client::decode_transaction_body::<
1459                fidl::encoding::ResultType<ClientSmeGetScheduledScanEnabledResponse, i32>,
1460                fidl::encoding::DefaultFuchsiaResourceDialect,
1461                0x777e3c8854ff2710,
1462            >(_buf?)?;
1463            Ok(_response.map(|x| x.enabled))
1464        }
1465        self.client.send_query_and_decode::<
1466            fidl::encoding::EmptyPayload,
1467            ClientSmeGetScheduledScanEnabledResult,
1468        >(
1469            (),
1470            0x777e3c8854ff2710,
1471            fidl::encoding::DynamicFlags::empty(),
1472            _decode,
1473        )
1474    }
1475
1476    fn r#connect(
1477        &self,
1478        mut req: &ConnectRequest,
1479        mut txn: Option<fidl::endpoints::ServerEnd<ConnectTransactionMarker>>,
1480    ) -> Result<(), fidl::Error> {
1481        self.client.send::<ClientSmeConnectRequest>(
1482            (req, txn),
1483            0x250a0f6fe9f85351,
1484            fidl::encoding::DynamicFlags::empty(),
1485        )
1486    }
1487
1488    fn r#roam(&self, mut req: &RoamRequest) -> Result<(), fidl::Error> {
1489        self.client.send::<ClientSmeRoamRequest>(
1490            (req,),
1491            0x107ead7d84723921,
1492            fidl::encoding::DynamicFlags::empty(),
1493        )
1494    }
1495
1496    type DisconnectResponseFut =
1497        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1498    fn r#disconnect(&self, mut reason: UserDisconnectReason) -> Self::DisconnectResponseFut {
1499        fn _decode(
1500            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1501        ) -> Result<(), fidl::Error> {
1502            let _response = fidl::client::decode_transaction_body::<
1503                fidl::encoding::EmptyPayload,
1504                fidl::encoding::DefaultFuchsiaResourceDialect,
1505                0x39a578de9a107304,
1506            >(_buf?)?;
1507            Ok(_response)
1508        }
1509        self.client.send_query_and_decode::<ClientSmeDisconnectRequest, ()>(
1510            (reason,),
1511            0x39a578de9a107304,
1512            fidl::encoding::DynamicFlags::empty(),
1513            _decode,
1514        )
1515    }
1516
1517    type StatusResponseFut = fidl::client::QueryResponseFut<
1518        ClientStatusResponse,
1519        fidl::encoding::DefaultFuchsiaResourceDialect,
1520    >;
1521    fn r#status(&self) -> Self::StatusResponseFut {
1522        fn _decode(
1523            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1524        ) -> Result<ClientStatusResponse, fidl::Error> {
1525            let _response = fidl::client::decode_transaction_body::<
1526                ClientSmeStatusResponse,
1527                fidl::encoding::DefaultFuchsiaResourceDialect,
1528                0xda00b607470faf2,
1529            >(_buf?)?;
1530            Ok(_response.resp)
1531        }
1532        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ClientStatusResponse>(
1533            (),
1534            0xda00b607470faf2,
1535            fidl::encoding::DynamicFlags::empty(),
1536            _decode,
1537        )
1538    }
1539
1540    type WmmStatusResponseFut = fidl::client::QueryResponseFut<
1541        ClientSmeWmmStatusResult,
1542        fidl::encoding::DefaultFuchsiaResourceDialect,
1543    >;
1544    fn r#wmm_status(&self) -> Self::WmmStatusResponseFut {
1545        fn _decode(
1546            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1547        ) -> Result<ClientSmeWmmStatusResult, fidl::Error> {
1548            let _response = fidl::client::decode_transaction_body::<
1549                fidl::encoding::ResultType<ClientSmeWmmStatusResponse, i32>,
1550                fidl::encoding::DefaultFuchsiaResourceDialect,
1551                0x3d0ccc75f6baa9e3,
1552            >(_buf?)?;
1553            Ok(_response.map(|x| x.resp))
1554        }
1555        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ClientSmeWmmStatusResult>(
1556            (),
1557            0x3d0ccc75f6baa9e3,
1558            fidl::encoding::DynamicFlags::empty(),
1559            _decode,
1560        )
1561    }
1562
1563    type ScanForControllerResponseFut = fidl::client::QueryResponseFut<
1564        ClientSmeScanForControllerResult,
1565        fidl::encoding::DefaultFuchsiaResourceDialect,
1566    >;
1567    fn r#scan_for_controller(&self, mut req: &ScanRequest) -> Self::ScanForControllerResponseFut {
1568        fn _decode(
1569            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1570        ) -> Result<ClientSmeScanForControllerResult, fidl::Error> {
1571            let _response = fidl::client::decode_transaction_body::<
1572                fidl::encoding::ResultType<ClientSmeScanForControllerResponse, ScanErrorCode>,
1573                fidl::encoding::DefaultFuchsiaResourceDialect,
1574                0x21f00ab22ff79a12,
1575            >(_buf?)?;
1576            Ok(_response.map(|x| x.scan_results))
1577        }
1578        self.client.send_query_and_decode::<
1579            ClientSmeScanForControllerRequest,
1580            ClientSmeScanForControllerResult,
1581        >(
1582            (req,),
1583            0x21f00ab22ff79a12,
1584            fidl::encoding::DynamicFlags::empty(),
1585            _decode,
1586        )
1587    }
1588
1589    type SetMacAddressResponseFut = fidl::client::QueryResponseFut<
1590        ClientSmeSetMacAddressResult,
1591        fidl::encoding::DefaultFuchsiaResourceDialect,
1592    >;
1593    fn r#set_mac_address(&self, mut mac_addr: &[u8; 6]) -> Self::SetMacAddressResponseFut {
1594        fn _decode(
1595            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1596        ) -> Result<ClientSmeSetMacAddressResult, fidl::Error> {
1597            let _response = fidl::client::decode_transaction_body::<
1598                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1599                fidl::encoding::DefaultFuchsiaResourceDialect,
1600                0x13e0a0bee8962f58,
1601            >(_buf?)?;
1602            Ok(_response.map(|x| x))
1603        }
1604        self.client
1605            .send_query_and_decode::<ClientSmeSetMacAddressRequest, ClientSmeSetMacAddressResult>(
1606                (mac_addr,),
1607                0x13e0a0bee8962f58,
1608                fidl::encoding::DynamicFlags::empty(),
1609                _decode,
1610            )
1611    }
1612
1613    type InstallApfPacketFilterResponseFut = fidl::client::QueryResponseFut<
1614        ClientSmeInstallApfPacketFilterResult,
1615        fidl::encoding::DefaultFuchsiaResourceDialect,
1616    >;
1617    fn r#install_apf_packet_filter(
1618        &self,
1619        mut program: &[u8],
1620    ) -> Self::InstallApfPacketFilterResponseFut {
1621        fn _decode(
1622            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1623        ) -> Result<ClientSmeInstallApfPacketFilterResult, fidl::Error> {
1624            let _response = fidl::client::decode_transaction_body::<
1625                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1626                fidl::encoding::DefaultFuchsiaResourceDialect,
1627                0x77435965e7bfaf83,
1628            >(_buf?)?;
1629            Ok(_response.map(|x| x))
1630        }
1631        self.client.send_query_and_decode::<
1632            ClientSmeInstallApfPacketFilterRequest,
1633            ClientSmeInstallApfPacketFilterResult,
1634        >(
1635            (program,),
1636            0x77435965e7bfaf83,
1637            fidl::encoding::DynamicFlags::empty(),
1638            _decode,
1639        )
1640    }
1641
1642    type ReadApfPacketFilterDataResponseFut = fidl::client::QueryResponseFut<
1643        ClientSmeReadApfPacketFilterDataResult,
1644        fidl::encoding::DefaultFuchsiaResourceDialect,
1645    >;
1646    fn r#read_apf_packet_filter_data(&self) -> Self::ReadApfPacketFilterDataResponseFut {
1647        fn _decode(
1648            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1649        ) -> Result<ClientSmeReadApfPacketFilterDataResult, fidl::Error> {
1650            let _response = fidl::client::decode_transaction_body::<
1651                fidl::encoding::ResultType<ClientSmeReadApfPacketFilterDataResponse, i32>,
1652                fidl::encoding::DefaultFuchsiaResourceDialect,
1653                0x66fc6616b9963023,
1654            >(_buf?)?;
1655            Ok(_response.map(|x| x.memory))
1656        }
1657        self.client.send_query_and_decode::<
1658            fidl::encoding::EmptyPayload,
1659            ClientSmeReadApfPacketFilterDataResult,
1660        >(
1661            (),
1662            0x66fc6616b9963023,
1663            fidl::encoding::DynamicFlags::empty(),
1664            _decode,
1665        )
1666    }
1667
1668    type SetApfPacketFilterEnabledResponseFut = fidl::client::QueryResponseFut<
1669        ClientSmeSetApfPacketFilterEnabledResult,
1670        fidl::encoding::DefaultFuchsiaResourceDialect,
1671    >;
1672    fn r#set_apf_packet_filter_enabled(
1673        &self,
1674        mut enabled: bool,
1675    ) -> Self::SetApfPacketFilterEnabledResponseFut {
1676        fn _decode(
1677            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1678        ) -> Result<ClientSmeSetApfPacketFilterEnabledResult, fidl::Error> {
1679            let _response = fidl::client::decode_transaction_body::<
1680                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1681                fidl::encoding::DefaultFuchsiaResourceDialect,
1682                0x5070d2ed31580b81,
1683            >(_buf?)?;
1684            Ok(_response.map(|x| x))
1685        }
1686        self.client.send_query_and_decode::<
1687            ClientSmeSetApfPacketFilterEnabledRequest,
1688            ClientSmeSetApfPacketFilterEnabledResult,
1689        >(
1690            (enabled,),
1691            0x5070d2ed31580b81,
1692            fidl::encoding::DynamicFlags::empty(),
1693            _decode,
1694        )
1695    }
1696
1697    type GetApfPacketFilterEnabledResponseFut = fidl::client::QueryResponseFut<
1698        ClientSmeGetApfPacketFilterEnabledResult,
1699        fidl::encoding::DefaultFuchsiaResourceDialect,
1700    >;
1701    fn r#get_apf_packet_filter_enabled(&self) -> Self::GetApfPacketFilterEnabledResponseFut {
1702        fn _decode(
1703            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1704        ) -> Result<ClientSmeGetApfPacketFilterEnabledResult, fidl::Error> {
1705            let _response = fidl::client::decode_transaction_body::<
1706                fidl::encoding::ResultType<ClientSmeGetApfPacketFilterEnabledResponse, i32>,
1707                fidl::encoding::DefaultFuchsiaResourceDialect,
1708                0xdda5c1533526869,
1709            >(_buf?)?;
1710            Ok(_response.map(|x| x.enabled))
1711        }
1712        self.client.send_query_and_decode::<
1713            fidl::encoding::EmptyPayload,
1714            ClientSmeGetApfPacketFilterEnabledResult,
1715        >(
1716            (),
1717            0xdda5c1533526869,
1718            fidl::encoding::DynamicFlags::empty(),
1719            _decode,
1720        )
1721    }
1722}
1723
1724pub struct ClientSmeEventStream {
1725    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1726}
1727
1728impl std::marker::Unpin for ClientSmeEventStream {}
1729
1730impl futures::stream::FusedStream for ClientSmeEventStream {
1731    fn is_terminated(&self) -> bool {
1732        self.event_receiver.is_terminated()
1733    }
1734}
1735
1736impl futures::Stream for ClientSmeEventStream {
1737    type Item = Result<ClientSmeEvent, fidl::Error>;
1738
1739    fn poll_next(
1740        mut self: std::pin::Pin<&mut Self>,
1741        cx: &mut std::task::Context<'_>,
1742    ) -> std::task::Poll<Option<Self::Item>> {
1743        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1744            &mut self.event_receiver,
1745            cx
1746        )?) {
1747            Some(buf) => std::task::Poll::Ready(Some(ClientSmeEvent::decode(buf))),
1748            None => std::task::Poll::Ready(None),
1749        }
1750    }
1751}
1752
1753#[derive(Debug)]
1754pub enum ClientSmeEvent {}
1755
1756impl ClientSmeEvent {
1757    /// Decodes a message buffer as a [`ClientSmeEvent`].
1758    fn decode(
1759        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1760    ) -> Result<ClientSmeEvent, fidl::Error> {
1761        let (bytes, _handles) = buf.split_mut();
1762        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1763        debug_assert_eq!(tx_header.tx_id, 0);
1764        match tx_header.ordinal {
1765            _ => Err(fidl::Error::UnknownOrdinal {
1766                ordinal: tx_header.ordinal,
1767                protocol_name: <ClientSmeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1768            }),
1769        }
1770    }
1771}
1772
1773/// A Stream of incoming requests for fuchsia.wlan.sme/ClientSme.
1774pub struct ClientSmeRequestStream {
1775    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1776    is_terminated: bool,
1777}
1778
1779impl std::marker::Unpin for ClientSmeRequestStream {}
1780
1781impl futures::stream::FusedStream for ClientSmeRequestStream {
1782    fn is_terminated(&self) -> bool {
1783        self.is_terminated
1784    }
1785}
1786
1787impl fidl::endpoints::RequestStream for ClientSmeRequestStream {
1788    type Protocol = ClientSmeMarker;
1789    type ControlHandle = ClientSmeControlHandle;
1790
1791    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1792        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1793    }
1794
1795    fn control_handle(&self) -> Self::ControlHandle {
1796        ClientSmeControlHandle { inner: self.inner.clone() }
1797    }
1798
1799    fn into_inner(
1800        self,
1801    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1802    {
1803        (self.inner, self.is_terminated)
1804    }
1805
1806    fn from_inner(
1807        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1808        is_terminated: bool,
1809    ) -> Self {
1810        Self { inner, is_terminated }
1811    }
1812}
1813
1814impl futures::Stream for ClientSmeRequestStream {
1815    type Item = Result<ClientSmeRequest, fidl::Error>;
1816
1817    fn poll_next(
1818        mut self: std::pin::Pin<&mut Self>,
1819        cx: &mut std::task::Context<'_>,
1820    ) -> std::task::Poll<Option<Self::Item>> {
1821        let this = &mut *self;
1822        if this.inner.check_shutdown(cx) {
1823            this.is_terminated = true;
1824            return std::task::Poll::Ready(None);
1825        }
1826        if this.is_terminated {
1827            panic!("polled ClientSmeRequestStream after completion");
1828        }
1829        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1830            |bytes, handles| {
1831                match this.inner.channel().read_etc(cx, bytes, handles) {
1832                    std::task::Poll::Ready(Ok(())) => {}
1833                    std::task::Poll::Pending => return std::task::Poll::Pending,
1834                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1835                        this.is_terminated = true;
1836                        return std::task::Poll::Ready(None);
1837                    }
1838                    std::task::Poll::Ready(Err(e)) => {
1839                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1840                            e.into(),
1841                        ))));
1842                    }
1843                }
1844
1845                // A message has been received from the channel
1846                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1847
1848                std::task::Poll::Ready(Some(match header.ordinal {
1849                    0xded0ce3b1685822 => {
1850                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1851                        let mut req = fidl::new_empty!(
1852                            ClientSmeScanRequest,
1853                            fidl::encoding::DefaultFuchsiaResourceDialect
1854                        );
1855                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientSmeScanRequest>(&header, _body_bytes, handles, &mut req)?;
1856                        let control_handle = ClientSmeControlHandle { inner: this.inner.clone() };
1857                        Ok(ClientSmeRequest::Scan {
1858                            req: req.req,
1859
1860                            responder: ClientSmeScanResponder {
1861                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1862                                tx_id: header.tx_id,
1863                            },
1864                        })
1865                    }
1866                    0x97eedb559e6bdb8 => {
1867                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1868                        let mut req = fidl::new_empty!(
1869                            ClientSmeStartScheduledScanRequest,
1870                            fidl::encoding::DefaultFuchsiaResourceDialect
1871                        );
1872                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientSmeStartScheduledScanRequest>(&header, _body_bytes, handles, &mut req)?;
1873                        let control_handle = ClientSmeControlHandle { inner: this.inner.clone() };
1874                        Ok(ClientSmeRequest::StartScheduledScan {
1875                            req: req.req,
1876                            txn: req.txn,
1877
1878                            responder: ClientSmeStartScheduledScanResponder {
1879                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1880                                tx_id: header.tx_id,
1881                            },
1882                        })
1883                    }
1884                    0x777e3c8854ff2710 => {
1885                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1886                        let mut req = fidl::new_empty!(
1887                            fidl::encoding::EmptyPayload,
1888                            fidl::encoding::DefaultFuchsiaResourceDialect
1889                        );
1890                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1891                        let control_handle = ClientSmeControlHandle { inner: this.inner.clone() };
1892                        Ok(ClientSmeRequest::GetScheduledScanEnabled {
1893                            responder: ClientSmeGetScheduledScanEnabledResponder {
1894                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1895                                tx_id: header.tx_id,
1896                            },
1897                        })
1898                    }
1899                    0x250a0f6fe9f85351 => {
1900                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1901                        let mut req = fidl::new_empty!(
1902                            ClientSmeConnectRequest,
1903                            fidl::encoding::DefaultFuchsiaResourceDialect
1904                        );
1905                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientSmeConnectRequest>(&header, _body_bytes, handles, &mut req)?;
1906                        let control_handle = ClientSmeControlHandle { inner: this.inner.clone() };
1907                        Ok(ClientSmeRequest::Connect { req: req.req, txn: req.txn, control_handle })
1908                    }
1909                    0x107ead7d84723921 => {
1910                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1911                        let mut req = fidl::new_empty!(
1912                            ClientSmeRoamRequest,
1913                            fidl::encoding::DefaultFuchsiaResourceDialect
1914                        );
1915                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientSmeRoamRequest>(&header, _body_bytes, handles, &mut req)?;
1916                        let control_handle = ClientSmeControlHandle { inner: this.inner.clone() };
1917                        Ok(ClientSmeRequest::Roam { req: req.req, control_handle })
1918                    }
1919                    0x39a578de9a107304 => {
1920                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1921                        let mut req = fidl::new_empty!(
1922                            ClientSmeDisconnectRequest,
1923                            fidl::encoding::DefaultFuchsiaResourceDialect
1924                        );
1925                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientSmeDisconnectRequest>(&header, _body_bytes, handles, &mut req)?;
1926                        let control_handle = ClientSmeControlHandle { inner: this.inner.clone() };
1927                        Ok(ClientSmeRequest::Disconnect {
1928                            reason: req.reason,
1929
1930                            responder: ClientSmeDisconnectResponder {
1931                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1932                                tx_id: header.tx_id,
1933                            },
1934                        })
1935                    }
1936                    0xda00b607470faf2 => {
1937                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1938                        let mut req = fidl::new_empty!(
1939                            fidl::encoding::EmptyPayload,
1940                            fidl::encoding::DefaultFuchsiaResourceDialect
1941                        );
1942                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1943                        let control_handle = ClientSmeControlHandle { inner: this.inner.clone() };
1944                        Ok(ClientSmeRequest::Status {
1945                            responder: ClientSmeStatusResponder {
1946                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1947                                tx_id: header.tx_id,
1948                            },
1949                        })
1950                    }
1951                    0x3d0ccc75f6baa9e3 => {
1952                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1953                        let mut req = fidl::new_empty!(
1954                            fidl::encoding::EmptyPayload,
1955                            fidl::encoding::DefaultFuchsiaResourceDialect
1956                        );
1957                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1958                        let control_handle = ClientSmeControlHandle { inner: this.inner.clone() };
1959                        Ok(ClientSmeRequest::WmmStatus {
1960                            responder: ClientSmeWmmStatusResponder {
1961                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1962                                tx_id: header.tx_id,
1963                            },
1964                        })
1965                    }
1966                    0x21f00ab22ff79a12 => {
1967                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1968                        let mut req = fidl::new_empty!(
1969                            ClientSmeScanForControllerRequest,
1970                            fidl::encoding::DefaultFuchsiaResourceDialect
1971                        );
1972                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientSmeScanForControllerRequest>(&header, _body_bytes, handles, &mut req)?;
1973                        let control_handle = ClientSmeControlHandle { inner: this.inner.clone() };
1974                        Ok(ClientSmeRequest::ScanForController {
1975                            req: req.req,
1976
1977                            responder: ClientSmeScanForControllerResponder {
1978                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1979                                tx_id: header.tx_id,
1980                            },
1981                        })
1982                    }
1983                    0x13e0a0bee8962f58 => {
1984                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1985                        let mut req = fidl::new_empty!(
1986                            ClientSmeSetMacAddressRequest,
1987                            fidl::encoding::DefaultFuchsiaResourceDialect
1988                        );
1989                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientSmeSetMacAddressRequest>(&header, _body_bytes, handles, &mut req)?;
1990                        let control_handle = ClientSmeControlHandle { inner: this.inner.clone() };
1991                        Ok(ClientSmeRequest::SetMacAddress {
1992                            mac_addr: req.mac_addr,
1993
1994                            responder: ClientSmeSetMacAddressResponder {
1995                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1996                                tx_id: header.tx_id,
1997                            },
1998                        })
1999                    }
2000                    0x77435965e7bfaf83 => {
2001                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2002                        let mut req = fidl::new_empty!(
2003                            ClientSmeInstallApfPacketFilterRequest,
2004                            fidl::encoding::DefaultFuchsiaResourceDialect
2005                        );
2006                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientSmeInstallApfPacketFilterRequest>(&header, _body_bytes, handles, &mut req)?;
2007                        let control_handle = ClientSmeControlHandle { inner: this.inner.clone() };
2008                        Ok(ClientSmeRequest::InstallApfPacketFilter {
2009                            program: req.program,
2010
2011                            responder: ClientSmeInstallApfPacketFilterResponder {
2012                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2013                                tx_id: header.tx_id,
2014                            },
2015                        })
2016                    }
2017                    0x66fc6616b9963023 => {
2018                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2019                        let mut req = fidl::new_empty!(
2020                            fidl::encoding::EmptyPayload,
2021                            fidl::encoding::DefaultFuchsiaResourceDialect
2022                        );
2023                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2024                        let control_handle = ClientSmeControlHandle { inner: this.inner.clone() };
2025                        Ok(ClientSmeRequest::ReadApfPacketFilterData {
2026                            responder: ClientSmeReadApfPacketFilterDataResponder {
2027                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2028                                tx_id: header.tx_id,
2029                            },
2030                        })
2031                    }
2032                    0x5070d2ed31580b81 => {
2033                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2034                        let mut req = fidl::new_empty!(
2035                            ClientSmeSetApfPacketFilterEnabledRequest,
2036                            fidl::encoding::DefaultFuchsiaResourceDialect
2037                        );
2038                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientSmeSetApfPacketFilterEnabledRequest>(&header, _body_bytes, handles, &mut req)?;
2039                        let control_handle = ClientSmeControlHandle { inner: this.inner.clone() };
2040                        Ok(ClientSmeRequest::SetApfPacketFilterEnabled {
2041                            enabled: req.enabled,
2042
2043                            responder: ClientSmeSetApfPacketFilterEnabledResponder {
2044                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2045                                tx_id: header.tx_id,
2046                            },
2047                        })
2048                    }
2049                    0xdda5c1533526869 => {
2050                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2051                        let mut req = fidl::new_empty!(
2052                            fidl::encoding::EmptyPayload,
2053                            fidl::encoding::DefaultFuchsiaResourceDialect
2054                        );
2055                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2056                        let control_handle = ClientSmeControlHandle { inner: this.inner.clone() };
2057                        Ok(ClientSmeRequest::GetApfPacketFilterEnabled {
2058                            responder: ClientSmeGetApfPacketFilterEnabledResponder {
2059                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2060                                tx_id: header.tx_id,
2061                            },
2062                        })
2063                    }
2064                    _ => Err(fidl::Error::UnknownOrdinal {
2065                        ordinal: header.ordinal,
2066                        protocol_name:
2067                            <ClientSmeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2068                    }),
2069                }))
2070            },
2071        )
2072    }
2073}
2074
2075#[derive(Debug)]
2076pub enum ClientSmeRequest {
2077    Scan {
2078        req: ScanRequest,
2079        responder: ClientSmeScanResponder,
2080    },
2081    /// Starts scheduled scanning.
2082    StartScheduledScan {
2083        req: fidl_fuchsia_wlan_common::ScheduledScanRequest,
2084        txn: fidl::endpoints::ServerEnd<ScheduledScanTransactionMarker>,
2085        responder: ClientSmeStartScheduledScanResponder,
2086    },
2087    /// Returns whether any scheduled scans are currently active.
2088    GetScheduledScanEnabled {
2089        responder: ClientSmeGetScheduledScanEnabledResponder,
2090    },
2091    Connect {
2092        req: ConnectRequest,
2093        txn: Option<fidl::endpoints::ServerEnd<ConnectTransactionMarker>>,
2094        control_handle: ClientSmeControlHandle,
2095    },
2096    Roam {
2097        req: RoamRequest,
2098        control_handle: ClientSmeControlHandle,
2099    },
2100    Disconnect {
2101        reason: UserDisconnectReason,
2102        responder: ClientSmeDisconnectResponder,
2103    },
2104    Status {
2105        responder: ClientSmeStatusResponder,
2106    },
2107    WmmStatus {
2108        responder: ClientSmeWmmStatusResponder,
2109    },
2110    ScanForController {
2111        req: ScanRequest,
2112        responder: ClientSmeScanForControllerResponder,
2113    },
2114    SetMacAddress {
2115        mac_addr: [u8; 6],
2116        responder: ClientSmeSetMacAddressResponder,
2117    },
2118    InstallApfPacketFilter {
2119        program: Vec<u8>,
2120        responder: ClientSmeInstallApfPacketFilterResponder,
2121    },
2122    ReadApfPacketFilterData {
2123        responder: ClientSmeReadApfPacketFilterDataResponder,
2124    },
2125    SetApfPacketFilterEnabled {
2126        enabled: bool,
2127        responder: ClientSmeSetApfPacketFilterEnabledResponder,
2128    },
2129    GetApfPacketFilterEnabled {
2130        responder: ClientSmeGetApfPacketFilterEnabledResponder,
2131    },
2132}
2133
2134impl ClientSmeRequest {
2135    #[allow(irrefutable_let_patterns)]
2136    pub fn into_scan(self) -> Option<(ScanRequest, ClientSmeScanResponder)> {
2137        if let ClientSmeRequest::Scan { req, responder } = self {
2138            Some((req, responder))
2139        } else {
2140            None
2141        }
2142    }
2143
2144    #[allow(irrefutable_let_patterns)]
2145    pub fn into_start_scheduled_scan(
2146        self,
2147    ) -> Option<(
2148        fidl_fuchsia_wlan_common::ScheduledScanRequest,
2149        fidl::endpoints::ServerEnd<ScheduledScanTransactionMarker>,
2150        ClientSmeStartScheduledScanResponder,
2151    )> {
2152        if let ClientSmeRequest::StartScheduledScan { req, txn, responder } = self {
2153            Some((req, txn, responder))
2154        } else {
2155            None
2156        }
2157    }
2158
2159    #[allow(irrefutable_let_patterns)]
2160    pub fn into_get_scheduled_scan_enabled(
2161        self,
2162    ) -> Option<(ClientSmeGetScheduledScanEnabledResponder)> {
2163        if let ClientSmeRequest::GetScheduledScanEnabled { responder } = self {
2164            Some((responder))
2165        } else {
2166            None
2167        }
2168    }
2169
2170    #[allow(irrefutable_let_patterns)]
2171    pub fn into_connect(
2172        self,
2173    ) -> Option<(
2174        ConnectRequest,
2175        Option<fidl::endpoints::ServerEnd<ConnectTransactionMarker>>,
2176        ClientSmeControlHandle,
2177    )> {
2178        if let ClientSmeRequest::Connect { req, txn, control_handle } = self {
2179            Some((req, txn, control_handle))
2180        } else {
2181            None
2182        }
2183    }
2184
2185    #[allow(irrefutable_let_patterns)]
2186    pub fn into_roam(self) -> Option<(RoamRequest, ClientSmeControlHandle)> {
2187        if let ClientSmeRequest::Roam { req, control_handle } = self {
2188            Some((req, control_handle))
2189        } else {
2190            None
2191        }
2192    }
2193
2194    #[allow(irrefutable_let_patterns)]
2195    pub fn into_disconnect(self) -> Option<(UserDisconnectReason, ClientSmeDisconnectResponder)> {
2196        if let ClientSmeRequest::Disconnect { reason, responder } = self {
2197            Some((reason, responder))
2198        } else {
2199            None
2200        }
2201    }
2202
2203    #[allow(irrefutable_let_patterns)]
2204    pub fn into_status(self) -> Option<(ClientSmeStatusResponder)> {
2205        if let ClientSmeRequest::Status { responder } = self { Some((responder)) } else { None }
2206    }
2207
2208    #[allow(irrefutable_let_patterns)]
2209    pub fn into_wmm_status(self) -> Option<(ClientSmeWmmStatusResponder)> {
2210        if let ClientSmeRequest::WmmStatus { responder } = self { Some((responder)) } else { None }
2211    }
2212
2213    #[allow(irrefutable_let_patterns)]
2214    pub fn into_scan_for_controller(
2215        self,
2216    ) -> Option<(ScanRequest, ClientSmeScanForControllerResponder)> {
2217        if let ClientSmeRequest::ScanForController { req, responder } = self {
2218            Some((req, responder))
2219        } else {
2220            None
2221        }
2222    }
2223
2224    #[allow(irrefutable_let_patterns)]
2225    pub fn into_set_mac_address(self) -> Option<([u8; 6], ClientSmeSetMacAddressResponder)> {
2226        if let ClientSmeRequest::SetMacAddress { mac_addr, responder } = self {
2227            Some((mac_addr, responder))
2228        } else {
2229            None
2230        }
2231    }
2232
2233    #[allow(irrefutable_let_patterns)]
2234    pub fn into_install_apf_packet_filter(
2235        self,
2236    ) -> Option<(Vec<u8>, ClientSmeInstallApfPacketFilterResponder)> {
2237        if let ClientSmeRequest::InstallApfPacketFilter { program, responder } = self {
2238            Some((program, responder))
2239        } else {
2240            None
2241        }
2242    }
2243
2244    #[allow(irrefutable_let_patterns)]
2245    pub fn into_read_apf_packet_filter_data(
2246        self,
2247    ) -> Option<(ClientSmeReadApfPacketFilterDataResponder)> {
2248        if let ClientSmeRequest::ReadApfPacketFilterData { responder } = self {
2249            Some((responder))
2250        } else {
2251            None
2252        }
2253    }
2254
2255    #[allow(irrefutable_let_patterns)]
2256    pub fn into_set_apf_packet_filter_enabled(
2257        self,
2258    ) -> Option<(bool, ClientSmeSetApfPacketFilterEnabledResponder)> {
2259        if let ClientSmeRequest::SetApfPacketFilterEnabled { enabled, responder } = self {
2260            Some((enabled, responder))
2261        } else {
2262            None
2263        }
2264    }
2265
2266    #[allow(irrefutable_let_patterns)]
2267    pub fn into_get_apf_packet_filter_enabled(
2268        self,
2269    ) -> Option<(ClientSmeGetApfPacketFilterEnabledResponder)> {
2270        if let ClientSmeRequest::GetApfPacketFilterEnabled { responder } = self {
2271            Some((responder))
2272        } else {
2273            None
2274        }
2275    }
2276
2277    /// Name of the method defined in FIDL
2278    pub fn method_name(&self) -> &'static str {
2279        match *self {
2280            ClientSmeRequest::Scan { .. } => "scan",
2281            ClientSmeRequest::StartScheduledScan { .. } => "start_scheduled_scan",
2282            ClientSmeRequest::GetScheduledScanEnabled { .. } => "get_scheduled_scan_enabled",
2283            ClientSmeRequest::Connect { .. } => "connect",
2284            ClientSmeRequest::Roam { .. } => "roam",
2285            ClientSmeRequest::Disconnect { .. } => "disconnect",
2286            ClientSmeRequest::Status { .. } => "status",
2287            ClientSmeRequest::WmmStatus { .. } => "wmm_status",
2288            ClientSmeRequest::ScanForController { .. } => "scan_for_controller",
2289            ClientSmeRequest::SetMacAddress { .. } => "set_mac_address",
2290            ClientSmeRequest::InstallApfPacketFilter { .. } => "install_apf_packet_filter",
2291            ClientSmeRequest::ReadApfPacketFilterData { .. } => "read_apf_packet_filter_data",
2292            ClientSmeRequest::SetApfPacketFilterEnabled { .. } => "set_apf_packet_filter_enabled",
2293            ClientSmeRequest::GetApfPacketFilterEnabled { .. } => "get_apf_packet_filter_enabled",
2294        }
2295    }
2296}
2297
2298#[derive(Debug, Clone)]
2299pub struct ClientSmeControlHandle {
2300    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2301}
2302
2303impl ClientSmeControlHandle {
2304    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
2305        self.inner.shutdown_with_epitaph(status.into())
2306    }
2307}
2308
2309impl fidl::endpoints::ControlHandle for ClientSmeControlHandle {
2310    fn shutdown(&self) {
2311        self.inner.shutdown()
2312    }
2313
2314    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
2315        self.inner.shutdown_with_epitaph(status)
2316    }
2317
2318    fn is_closed(&self) -> bool {
2319        self.inner.channel().is_closed()
2320    }
2321    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2322        self.inner.channel().on_closed()
2323    }
2324
2325    #[cfg(target_os = "fuchsia")]
2326    fn signal_peer(
2327        &self,
2328        clear_mask: zx::Signals,
2329        set_mask: zx::Signals,
2330    ) -> Result<(), zx_status::Status> {
2331        use fidl::Peered;
2332        self.inner.channel().signal_peer(clear_mask, set_mask)
2333    }
2334}
2335
2336impl ClientSmeControlHandle {}
2337
2338#[must_use = "FIDL methods require a response to be sent"]
2339#[derive(Debug)]
2340pub struct ClientSmeScanResponder {
2341    control_handle: std::mem::ManuallyDrop<ClientSmeControlHandle>,
2342    tx_id: u32,
2343}
2344
2345/// Set the the channel to be shutdown (see [`ClientSmeControlHandle::shutdown`])
2346/// if the responder is dropped without sending a response, so that the client
2347/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2348impl std::ops::Drop for ClientSmeScanResponder {
2349    fn drop(&mut self) {
2350        self.control_handle.shutdown();
2351        // Safety: drops once, never accessed again
2352        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2353    }
2354}
2355
2356impl fidl::endpoints::Responder for ClientSmeScanResponder {
2357    type ControlHandle = ClientSmeControlHandle;
2358
2359    fn control_handle(&self) -> &ClientSmeControlHandle {
2360        &self.control_handle
2361    }
2362
2363    fn drop_without_shutdown(mut self) {
2364        // Safety: drops once, never accessed again due to mem::forget
2365        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2366        // Prevent Drop from running (which would shut down the channel)
2367        std::mem::forget(self);
2368    }
2369}
2370
2371impl ClientSmeScanResponder {
2372    /// Sends a response to the FIDL transaction.
2373    ///
2374    /// Sets the channel to shutdown if an error occurs.
2375    pub fn send(self, mut result: Result<fidl::Vmo, ScanErrorCode>) -> Result<(), fidl::Error> {
2376        let _result = self.send_raw(result);
2377        if _result.is_err() {
2378            self.control_handle.shutdown();
2379        }
2380        self.drop_without_shutdown();
2381        _result
2382    }
2383
2384    /// Similar to "send" but does not shutdown the channel if an error occurs.
2385    pub fn send_no_shutdown_on_err(
2386        self,
2387        mut result: Result<fidl::Vmo, ScanErrorCode>,
2388    ) -> Result<(), fidl::Error> {
2389        let _result = self.send_raw(result);
2390        self.drop_without_shutdown();
2391        _result
2392    }
2393
2394    fn send_raw(&self, mut result: Result<fidl::Vmo, ScanErrorCode>) -> Result<(), fidl::Error> {
2395        self.control_handle
2396            .inner
2397            .send::<fidl::encoding::ResultType<ClientSmeScanResponse, ScanErrorCode>>(
2398                result.map(|scan_results| (scan_results,)),
2399                self.tx_id,
2400                0xded0ce3b1685822,
2401                fidl::encoding::DynamicFlags::empty(),
2402            )
2403    }
2404}
2405
2406#[must_use = "FIDL methods require a response to be sent"]
2407#[derive(Debug)]
2408pub struct ClientSmeStartScheduledScanResponder {
2409    control_handle: std::mem::ManuallyDrop<ClientSmeControlHandle>,
2410    tx_id: u32,
2411}
2412
2413/// Set the the channel to be shutdown (see [`ClientSmeControlHandle::shutdown`])
2414/// if the responder is dropped without sending a response, so that the client
2415/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2416impl std::ops::Drop for ClientSmeStartScheduledScanResponder {
2417    fn drop(&mut self) {
2418        self.control_handle.shutdown();
2419        // Safety: drops once, never accessed again
2420        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2421    }
2422}
2423
2424impl fidl::endpoints::Responder for ClientSmeStartScheduledScanResponder {
2425    type ControlHandle = ClientSmeControlHandle;
2426
2427    fn control_handle(&self) -> &ClientSmeControlHandle {
2428        &self.control_handle
2429    }
2430
2431    fn drop_without_shutdown(mut self) {
2432        // Safety: drops once, never accessed again due to mem::forget
2433        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2434        // Prevent Drop from running (which would shut down the channel)
2435        std::mem::forget(self);
2436    }
2437}
2438
2439impl ClientSmeStartScheduledScanResponder {
2440    /// Sends a response to the FIDL transaction.
2441    ///
2442    /// Sets the channel to shutdown if an error occurs.
2443    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2444        let _result = self.send_raw(result);
2445        if _result.is_err() {
2446            self.control_handle.shutdown();
2447        }
2448        self.drop_without_shutdown();
2449        _result
2450    }
2451
2452    /// Similar to "send" but does not shutdown the channel if an error occurs.
2453    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2454        let _result = self.send_raw(result);
2455        self.drop_without_shutdown();
2456        _result
2457    }
2458
2459    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2460        self.control_handle
2461            .inner
2462            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2463                result,
2464                self.tx_id,
2465                0x97eedb559e6bdb8,
2466                fidl::encoding::DynamicFlags::empty(),
2467            )
2468    }
2469}
2470
2471#[must_use = "FIDL methods require a response to be sent"]
2472#[derive(Debug)]
2473pub struct ClientSmeGetScheduledScanEnabledResponder {
2474    control_handle: std::mem::ManuallyDrop<ClientSmeControlHandle>,
2475    tx_id: u32,
2476}
2477
2478/// Set the the channel to be shutdown (see [`ClientSmeControlHandle::shutdown`])
2479/// if the responder is dropped without sending a response, so that the client
2480/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2481impl std::ops::Drop for ClientSmeGetScheduledScanEnabledResponder {
2482    fn drop(&mut self) {
2483        self.control_handle.shutdown();
2484        // Safety: drops once, never accessed again
2485        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2486    }
2487}
2488
2489impl fidl::endpoints::Responder for ClientSmeGetScheduledScanEnabledResponder {
2490    type ControlHandle = ClientSmeControlHandle;
2491
2492    fn control_handle(&self) -> &ClientSmeControlHandle {
2493        &self.control_handle
2494    }
2495
2496    fn drop_without_shutdown(mut self) {
2497        // Safety: drops once, never accessed again due to mem::forget
2498        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2499        // Prevent Drop from running (which would shut down the channel)
2500        std::mem::forget(self);
2501    }
2502}
2503
2504impl ClientSmeGetScheduledScanEnabledResponder {
2505    /// Sends a response to the FIDL transaction.
2506    ///
2507    /// Sets the channel to shutdown if an error occurs.
2508    pub fn send(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
2509        let _result = self.send_raw(result);
2510        if _result.is_err() {
2511            self.control_handle.shutdown();
2512        }
2513        self.drop_without_shutdown();
2514        _result
2515    }
2516
2517    /// Similar to "send" but does not shutdown the channel if an error occurs.
2518    pub fn send_no_shutdown_on_err(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
2519        let _result = self.send_raw(result);
2520        self.drop_without_shutdown();
2521        _result
2522    }
2523
2524    fn send_raw(&self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
2525        self.control_handle.inner.send::<fidl::encoding::ResultType<
2526            ClientSmeGetScheduledScanEnabledResponse,
2527            i32,
2528        >>(
2529            result.map(|enabled| (enabled,)),
2530            self.tx_id,
2531            0x777e3c8854ff2710,
2532            fidl::encoding::DynamicFlags::empty(),
2533        )
2534    }
2535}
2536
2537#[must_use = "FIDL methods require a response to be sent"]
2538#[derive(Debug)]
2539pub struct ClientSmeDisconnectResponder {
2540    control_handle: std::mem::ManuallyDrop<ClientSmeControlHandle>,
2541    tx_id: u32,
2542}
2543
2544/// Set the the channel to be shutdown (see [`ClientSmeControlHandle::shutdown`])
2545/// if the responder is dropped without sending a response, so that the client
2546/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2547impl std::ops::Drop for ClientSmeDisconnectResponder {
2548    fn drop(&mut self) {
2549        self.control_handle.shutdown();
2550        // Safety: drops once, never accessed again
2551        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2552    }
2553}
2554
2555impl fidl::endpoints::Responder for ClientSmeDisconnectResponder {
2556    type ControlHandle = ClientSmeControlHandle;
2557
2558    fn control_handle(&self) -> &ClientSmeControlHandle {
2559        &self.control_handle
2560    }
2561
2562    fn drop_without_shutdown(mut self) {
2563        // Safety: drops once, never accessed again due to mem::forget
2564        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2565        // Prevent Drop from running (which would shut down the channel)
2566        std::mem::forget(self);
2567    }
2568}
2569
2570impl ClientSmeDisconnectResponder {
2571    /// Sends a response to the FIDL transaction.
2572    ///
2573    /// Sets the channel to shutdown if an error occurs.
2574    pub fn send(self) -> Result<(), fidl::Error> {
2575        let _result = self.send_raw();
2576        if _result.is_err() {
2577            self.control_handle.shutdown();
2578        }
2579        self.drop_without_shutdown();
2580        _result
2581    }
2582
2583    /// Similar to "send" but does not shutdown the channel if an error occurs.
2584    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2585        let _result = self.send_raw();
2586        self.drop_without_shutdown();
2587        _result
2588    }
2589
2590    fn send_raw(&self) -> Result<(), fidl::Error> {
2591        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2592            (),
2593            self.tx_id,
2594            0x39a578de9a107304,
2595            fidl::encoding::DynamicFlags::empty(),
2596        )
2597    }
2598}
2599
2600#[must_use = "FIDL methods require a response to be sent"]
2601#[derive(Debug)]
2602pub struct ClientSmeStatusResponder {
2603    control_handle: std::mem::ManuallyDrop<ClientSmeControlHandle>,
2604    tx_id: u32,
2605}
2606
2607/// Set the the channel to be shutdown (see [`ClientSmeControlHandle::shutdown`])
2608/// if the responder is dropped without sending a response, so that the client
2609/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2610impl std::ops::Drop for ClientSmeStatusResponder {
2611    fn drop(&mut self) {
2612        self.control_handle.shutdown();
2613        // Safety: drops once, never accessed again
2614        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2615    }
2616}
2617
2618impl fidl::endpoints::Responder for ClientSmeStatusResponder {
2619    type ControlHandle = ClientSmeControlHandle;
2620
2621    fn control_handle(&self) -> &ClientSmeControlHandle {
2622        &self.control_handle
2623    }
2624
2625    fn drop_without_shutdown(mut self) {
2626        // Safety: drops once, never accessed again due to mem::forget
2627        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2628        // Prevent Drop from running (which would shut down the channel)
2629        std::mem::forget(self);
2630    }
2631}
2632
2633impl ClientSmeStatusResponder {
2634    /// Sends a response to the FIDL transaction.
2635    ///
2636    /// Sets the channel to shutdown if an error occurs.
2637    pub fn send(self, mut resp: &ClientStatusResponse) -> Result<(), fidl::Error> {
2638        let _result = self.send_raw(resp);
2639        if _result.is_err() {
2640            self.control_handle.shutdown();
2641        }
2642        self.drop_without_shutdown();
2643        _result
2644    }
2645
2646    /// Similar to "send" but does not shutdown the channel if an error occurs.
2647    pub fn send_no_shutdown_on_err(
2648        self,
2649        mut resp: &ClientStatusResponse,
2650    ) -> Result<(), fidl::Error> {
2651        let _result = self.send_raw(resp);
2652        self.drop_without_shutdown();
2653        _result
2654    }
2655
2656    fn send_raw(&self, mut resp: &ClientStatusResponse) -> Result<(), fidl::Error> {
2657        self.control_handle.inner.send::<ClientSmeStatusResponse>(
2658            (resp,),
2659            self.tx_id,
2660            0xda00b607470faf2,
2661            fidl::encoding::DynamicFlags::empty(),
2662        )
2663    }
2664}
2665
2666#[must_use = "FIDL methods require a response to be sent"]
2667#[derive(Debug)]
2668pub struct ClientSmeWmmStatusResponder {
2669    control_handle: std::mem::ManuallyDrop<ClientSmeControlHandle>,
2670    tx_id: u32,
2671}
2672
2673/// Set the the channel to be shutdown (see [`ClientSmeControlHandle::shutdown`])
2674/// if the responder is dropped without sending a response, so that the client
2675/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2676impl std::ops::Drop for ClientSmeWmmStatusResponder {
2677    fn drop(&mut self) {
2678        self.control_handle.shutdown();
2679        // Safety: drops once, never accessed again
2680        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2681    }
2682}
2683
2684impl fidl::endpoints::Responder for ClientSmeWmmStatusResponder {
2685    type ControlHandle = ClientSmeControlHandle;
2686
2687    fn control_handle(&self) -> &ClientSmeControlHandle {
2688        &self.control_handle
2689    }
2690
2691    fn drop_without_shutdown(mut self) {
2692        // Safety: drops once, never accessed again due to mem::forget
2693        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2694        // Prevent Drop from running (which would shut down the channel)
2695        std::mem::forget(self);
2696    }
2697}
2698
2699impl ClientSmeWmmStatusResponder {
2700    /// Sends a response to the FIDL transaction.
2701    ///
2702    /// Sets the channel to shutdown if an error occurs.
2703    pub fn send(
2704        self,
2705        mut result: Result<&fidl_fuchsia_wlan_internal::WmmStatusResponse, i32>,
2706    ) -> Result<(), fidl::Error> {
2707        let _result = self.send_raw(result);
2708        if _result.is_err() {
2709            self.control_handle.shutdown();
2710        }
2711        self.drop_without_shutdown();
2712        _result
2713    }
2714
2715    /// Similar to "send" but does not shutdown the channel if an error occurs.
2716    pub fn send_no_shutdown_on_err(
2717        self,
2718        mut result: Result<&fidl_fuchsia_wlan_internal::WmmStatusResponse, i32>,
2719    ) -> Result<(), fidl::Error> {
2720        let _result = self.send_raw(result);
2721        self.drop_without_shutdown();
2722        _result
2723    }
2724
2725    fn send_raw(
2726        &self,
2727        mut result: Result<&fidl_fuchsia_wlan_internal::WmmStatusResponse, i32>,
2728    ) -> Result<(), fidl::Error> {
2729        self.control_handle
2730            .inner
2731            .send::<fidl::encoding::ResultType<ClientSmeWmmStatusResponse, i32>>(
2732                result.map(|resp| (resp,)),
2733                self.tx_id,
2734                0x3d0ccc75f6baa9e3,
2735                fidl::encoding::DynamicFlags::empty(),
2736            )
2737    }
2738}
2739
2740#[must_use = "FIDL methods require a response to be sent"]
2741#[derive(Debug)]
2742pub struct ClientSmeScanForControllerResponder {
2743    control_handle: std::mem::ManuallyDrop<ClientSmeControlHandle>,
2744    tx_id: u32,
2745}
2746
2747/// Set the the channel to be shutdown (see [`ClientSmeControlHandle::shutdown`])
2748/// if the responder is dropped without sending a response, so that the client
2749/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2750impl std::ops::Drop for ClientSmeScanForControllerResponder {
2751    fn drop(&mut self) {
2752        self.control_handle.shutdown();
2753        // Safety: drops once, never accessed again
2754        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2755    }
2756}
2757
2758impl fidl::endpoints::Responder for ClientSmeScanForControllerResponder {
2759    type ControlHandle = ClientSmeControlHandle;
2760
2761    fn control_handle(&self) -> &ClientSmeControlHandle {
2762        &self.control_handle
2763    }
2764
2765    fn drop_without_shutdown(mut self) {
2766        // Safety: drops once, never accessed again due to mem::forget
2767        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2768        // Prevent Drop from running (which would shut down the channel)
2769        std::mem::forget(self);
2770    }
2771}
2772
2773impl ClientSmeScanForControllerResponder {
2774    /// Sends a response to the FIDL transaction.
2775    ///
2776    /// Sets the channel to shutdown if an error occurs.
2777    pub fn send(self, mut result: Result<&[ScanResult], ScanErrorCode>) -> Result<(), fidl::Error> {
2778        let _result = self.send_raw(result);
2779        if _result.is_err() {
2780            self.control_handle.shutdown();
2781        }
2782        self.drop_without_shutdown();
2783        _result
2784    }
2785
2786    /// Similar to "send" but does not shutdown the channel if an error occurs.
2787    pub fn send_no_shutdown_on_err(
2788        self,
2789        mut result: Result<&[ScanResult], ScanErrorCode>,
2790    ) -> Result<(), fidl::Error> {
2791        let _result = self.send_raw(result);
2792        self.drop_without_shutdown();
2793        _result
2794    }
2795
2796    fn send_raw(
2797        &self,
2798        mut result: Result<&[ScanResult], ScanErrorCode>,
2799    ) -> Result<(), fidl::Error> {
2800        self.control_handle.inner.send::<fidl::encoding::ResultType<
2801            ClientSmeScanForControllerResponse,
2802            ScanErrorCode,
2803        >>(
2804            result.map(|scan_results| (scan_results,)),
2805            self.tx_id,
2806            0x21f00ab22ff79a12,
2807            fidl::encoding::DynamicFlags::empty(),
2808        )
2809    }
2810}
2811
2812#[must_use = "FIDL methods require a response to be sent"]
2813#[derive(Debug)]
2814pub struct ClientSmeSetMacAddressResponder {
2815    control_handle: std::mem::ManuallyDrop<ClientSmeControlHandle>,
2816    tx_id: u32,
2817}
2818
2819/// Set the the channel to be shutdown (see [`ClientSmeControlHandle::shutdown`])
2820/// if the responder is dropped without sending a response, so that the client
2821/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2822impl std::ops::Drop for ClientSmeSetMacAddressResponder {
2823    fn drop(&mut self) {
2824        self.control_handle.shutdown();
2825        // Safety: drops once, never accessed again
2826        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2827    }
2828}
2829
2830impl fidl::endpoints::Responder for ClientSmeSetMacAddressResponder {
2831    type ControlHandle = ClientSmeControlHandle;
2832
2833    fn control_handle(&self) -> &ClientSmeControlHandle {
2834        &self.control_handle
2835    }
2836
2837    fn drop_without_shutdown(mut self) {
2838        // Safety: drops once, never accessed again due to mem::forget
2839        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2840        // Prevent Drop from running (which would shut down the channel)
2841        std::mem::forget(self);
2842    }
2843}
2844
2845impl ClientSmeSetMacAddressResponder {
2846    /// Sends a response to the FIDL transaction.
2847    ///
2848    /// Sets the channel to shutdown if an error occurs.
2849    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2850        let _result = self.send_raw(result);
2851        if _result.is_err() {
2852            self.control_handle.shutdown();
2853        }
2854        self.drop_without_shutdown();
2855        _result
2856    }
2857
2858    /// Similar to "send" but does not shutdown the channel if an error occurs.
2859    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2860        let _result = self.send_raw(result);
2861        self.drop_without_shutdown();
2862        _result
2863    }
2864
2865    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2866        self.control_handle
2867            .inner
2868            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2869                result,
2870                self.tx_id,
2871                0x13e0a0bee8962f58,
2872                fidl::encoding::DynamicFlags::empty(),
2873            )
2874    }
2875}
2876
2877#[must_use = "FIDL methods require a response to be sent"]
2878#[derive(Debug)]
2879pub struct ClientSmeInstallApfPacketFilterResponder {
2880    control_handle: std::mem::ManuallyDrop<ClientSmeControlHandle>,
2881    tx_id: u32,
2882}
2883
2884/// Set the the channel to be shutdown (see [`ClientSmeControlHandle::shutdown`])
2885/// if the responder is dropped without sending a response, so that the client
2886/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2887impl std::ops::Drop for ClientSmeInstallApfPacketFilterResponder {
2888    fn drop(&mut self) {
2889        self.control_handle.shutdown();
2890        // Safety: drops once, never accessed again
2891        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2892    }
2893}
2894
2895impl fidl::endpoints::Responder for ClientSmeInstallApfPacketFilterResponder {
2896    type ControlHandle = ClientSmeControlHandle;
2897
2898    fn control_handle(&self) -> &ClientSmeControlHandle {
2899        &self.control_handle
2900    }
2901
2902    fn drop_without_shutdown(mut self) {
2903        // Safety: drops once, never accessed again due to mem::forget
2904        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2905        // Prevent Drop from running (which would shut down the channel)
2906        std::mem::forget(self);
2907    }
2908}
2909
2910impl ClientSmeInstallApfPacketFilterResponder {
2911    /// Sends a response to the FIDL transaction.
2912    ///
2913    /// Sets the channel to shutdown if an error occurs.
2914    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2915        let _result = self.send_raw(result);
2916        if _result.is_err() {
2917            self.control_handle.shutdown();
2918        }
2919        self.drop_without_shutdown();
2920        _result
2921    }
2922
2923    /// Similar to "send" but does not shutdown the channel if an error occurs.
2924    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2925        let _result = self.send_raw(result);
2926        self.drop_without_shutdown();
2927        _result
2928    }
2929
2930    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2931        self.control_handle
2932            .inner
2933            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2934                result,
2935                self.tx_id,
2936                0x77435965e7bfaf83,
2937                fidl::encoding::DynamicFlags::empty(),
2938            )
2939    }
2940}
2941
2942#[must_use = "FIDL methods require a response to be sent"]
2943#[derive(Debug)]
2944pub struct ClientSmeReadApfPacketFilterDataResponder {
2945    control_handle: std::mem::ManuallyDrop<ClientSmeControlHandle>,
2946    tx_id: u32,
2947}
2948
2949/// Set the the channel to be shutdown (see [`ClientSmeControlHandle::shutdown`])
2950/// if the responder is dropped without sending a response, so that the client
2951/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2952impl std::ops::Drop for ClientSmeReadApfPacketFilterDataResponder {
2953    fn drop(&mut self) {
2954        self.control_handle.shutdown();
2955        // Safety: drops once, never accessed again
2956        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2957    }
2958}
2959
2960impl fidl::endpoints::Responder for ClientSmeReadApfPacketFilterDataResponder {
2961    type ControlHandle = ClientSmeControlHandle;
2962
2963    fn control_handle(&self) -> &ClientSmeControlHandle {
2964        &self.control_handle
2965    }
2966
2967    fn drop_without_shutdown(mut self) {
2968        // Safety: drops once, never accessed again due to mem::forget
2969        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2970        // Prevent Drop from running (which would shut down the channel)
2971        std::mem::forget(self);
2972    }
2973}
2974
2975impl ClientSmeReadApfPacketFilterDataResponder {
2976    /// Sends a response to the FIDL transaction.
2977    ///
2978    /// Sets the channel to shutdown if an error occurs.
2979    pub fn send(self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
2980        let _result = self.send_raw(result);
2981        if _result.is_err() {
2982            self.control_handle.shutdown();
2983        }
2984        self.drop_without_shutdown();
2985        _result
2986    }
2987
2988    /// Similar to "send" but does not shutdown the channel if an error occurs.
2989    pub fn send_no_shutdown_on_err(
2990        self,
2991        mut result: Result<&[u8], i32>,
2992    ) -> Result<(), fidl::Error> {
2993        let _result = self.send_raw(result);
2994        self.drop_without_shutdown();
2995        _result
2996    }
2997
2998    fn send_raw(&self, mut result: Result<&[u8], i32>) -> Result<(), fidl::Error> {
2999        self.control_handle.inner.send::<fidl::encoding::ResultType<
3000            ClientSmeReadApfPacketFilterDataResponse,
3001            i32,
3002        >>(
3003            result.map(|memory| (memory,)),
3004            self.tx_id,
3005            0x66fc6616b9963023,
3006            fidl::encoding::DynamicFlags::empty(),
3007        )
3008    }
3009}
3010
3011#[must_use = "FIDL methods require a response to be sent"]
3012#[derive(Debug)]
3013pub struct ClientSmeSetApfPacketFilterEnabledResponder {
3014    control_handle: std::mem::ManuallyDrop<ClientSmeControlHandle>,
3015    tx_id: u32,
3016}
3017
3018/// Set the the channel to be shutdown (see [`ClientSmeControlHandle::shutdown`])
3019/// if the responder is dropped without sending a response, so that the client
3020/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3021impl std::ops::Drop for ClientSmeSetApfPacketFilterEnabledResponder {
3022    fn drop(&mut self) {
3023        self.control_handle.shutdown();
3024        // Safety: drops once, never accessed again
3025        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3026    }
3027}
3028
3029impl fidl::endpoints::Responder for ClientSmeSetApfPacketFilterEnabledResponder {
3030    type ControlHandle = ClientSmeControlHandle;
3031
3032    fn control_handle(&self) -> &ClientSmeControlHandle {
3033        &self.control_handle
3034    }
3035
3036    fn drop_without_shutdown(mut self) {
3037        // Safety: drops once, never accessed again due to mem::forget
3038        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3039        // Prevent Drop from running (which would shut down the channel)
3040        std::mem::forget(self);
3041    }
3042}
3043
3044impl ClientSmeSetApfPacketFilterEnabledResponder {
3045    /// Sends a response to the FIDL transaction.
3046    ///
3047    /// Sets the channel to shutdown if an error occurs.
3048    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3049        let _result = self.send_raw(result);
3050        if _result.is_err() {
3051            self.control_handle.shutdown();
3052        }
3053        self.drop_without_shutdown();
3054        _result
3055    }
3056
3057    /// Similar to "send" but does not shutdown the channel if an error occurs.
3058    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3059        let _result = self.send_raw(result);
3060        self.drop_without_shutdown();
3061        _result
3062    }
3063
3064    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3065        self.control_handle
3066            .inner
3067            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3068                result,
3069                self.tx_id,
3070                0x5070d2ed31580b81,
3071                fidl::encoding::DynamicFlags::empty(),
3072            )
3073    }
3074}
3075
3076#[must_use = "FIDL methods require a response to be sent"]
3077#[derive(Debug)]
3078pub struct ClientSmeGetApfPacketFilterEnabledResponder {
3079    control_handle: std::mem::ManuallyDrop<ClientSmeControlHandle>,
3080    tx_id: u32,
3081}
3082
3083/// Set the the channel to be shutdown (see [`ClientSmeControlHandle::shutdown`])
3084/// if the responder is dropped without sending a response, so that the client
3085/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3086impl std::ops::Drop for ClientSmeGetApfPacketFilterEnabledResponder {
3087    fn drop(&mut self) {
3088        self.control_handle.shutdown();
3089        // Safety: drops once, never accessed again
3090        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3091    }
3092}
3093
3094impl fidl::endpoints::Responder for ClientSmeGetApfPacketFilterEnabledResponder {
3095    type ControlHandle = ClientSmeControlHandle;
3096
3097    fn control_handle(&self) -> &ClientSmeControlHandle {
3098        &self.control_handle
3099    }
3100
3101    fn drop_without_shutdown(mut self) {
3102        // Safety: drops once, never accessed again due to mem::forget
3103        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3104        // Prevent Drop from running (which would shut down the channel)
3105        std::mem::forget(self);
3106    }
3107}
3108
3109impl ClientSmeGetApfPacketFilterEnabledResponder {
3110    /// Sends a response to the FIDL transaction.
3111    ///
3112    /// Sets the channel to shutdown if an error occurs.
3113    pub fn send(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3114        let _result = self.send_raw(result);
3115        if _result.is_err() {
3116            self.control_handle.shutdown();
3117        }
3118        self.drop_without_shutdown();
3119        _result
3120    }
3121
3122    /// Similar to "send" but does not shutdown the channel if an error occurs.
3123    pub fn send_no_shutdown_on_err(self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3124        let _result = self.send_raw(result);
3125        self.drop_without_shutdown();
3126        _result
3127    }
3128
3129    fn send_raw(&self, mut result: Result<bool, i32>) -> Result<(), fidl::Error> {
3130        self.control_handle.inner.send::<fidl::encoding::ResultType<
3131            ClientSmeGetApfPacketFilterEnabledResponse,
3132            i32,
3133        >>(
3134            result.map(|enabled| (enabled,)),
3135            self.tx_id,
3136            0xdda5c1533526869,
3137            fidl::encoding::DynamicFlags::empty(),
3138        )
3139    }
3140}
3141
3142#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3143pub struct ConnectTransactionMarker;
3144
3145impl fidl::endpoints::ProtocolMarker for ConnectTransactionMarker {
3146    type Proxy = ConnectTransactionProxy;
3147    type RequestStream = ConnectTransactionRequestStream;
3148    #[cfg(target_os = "fuchsia")]
3149    type SynchronousProxy = ConnectTransactionSynchronousProxy;
3150
3151    const DEBUG_NAME: &'static str = "(anonymous) ConnectTransaction";
3152}
3153
3154pub trait ConnectTransactionProxyInterface: Send + Sync {}
3155#[derive(Debug)]
3156#[cfg(target_os = "fuchsia")]
3157pub struct ConnectTransactionSynchronousProxy {
3158    client: fidl::client::sync::Client,
3159}
3160
3161#[cfg(target_os = "fuchsia")]
3162impl fidl::endpoints::SynchronousProxy for ConnectTransactionSynchronousProxy {
3163    type Proxy = ConnectTransactionProxy;
3164    type Protocol = ConnectTransactionMarker;
3165
3166    fn from_channel(inner: fidl::Channel) -> Self {
3167        Self::new(inner)
3168    }
3169
3170    fn into_channel(self) -> fidl::Channel {
3171        self.client.into_channel()
3172    }
3173
3174    fn as_channel(&self) -> &fidl::Channel {
3175        self.client.as_channel()
3176    }
3177}
3178
3179#[cfg(target_os = "fuchsia")]
3180impl ConnectTransactionSynchronousProxy {
3181    pub fn new(channel: fidl::Channel) -> Self {
3182        Self { client: fidl::client::sync::Client::new(channel) }
3183    }
3184
3185    pub fn into_channel(self) -> fidl::Channel {
3186        self.client.into_channel()
3187    }
3188
3189    /// Waits until an event arrives and returns it. It is safe for other
3190    /// threads to make concurrent requests while waiting for an event.
3191    pub fn wait_for_event(
3192        &self,
3193        deadline: zx::MonotonicInstant,
3194    ) -> Result<ConnectTransactionEvent, fidl::Error> {
3195        ConnectTransactionEvent::decode(
3196            self.client.wait_for_event::<ConnectTransactionMarker>(deadline)?,
3197        )
3198    }
3199}
3200
3201#[cfg(target_os = "fuchsia")]
3202impl From<ConnectTransactionSynchronousProxy> for zx::NullableHandle {
3203    fn from(value: ConnectTransactionSynchronousProxy) -> Self {
3204        value.into_channel().into()
3205    }
3206}
3207
3208#[cfg(target_os = "fuchsia")]
3209impl From<fidl::Channel> for ConnectTransactionSynchronousProxy {
3210    fn from(value: fidl::Channel) -> Self {
3211        Self::new(value)
3212    }
3213}
3214
3215#[cfg(target_os = "fuchsia")]
3216impl fidl::endpoints::FromClient for ConnectTransactionSynchronousProxy {
3217    type Protocol = ConnectTransactionMarker;
3218
3219    fn from_client(value: fidl::endpoints::ClientEnd<ConnectTransactionMarker>) -> Self {
3220        Self::new(value.into_channel())
3221    }
3222}
3223
3224#[derive(Debug, Clone)]
3225pub struct ConnectTransactionProxy {
3226    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3227}
3228
3229impl fidl::endpoints::Proxy for ConnectTransactionProxy {
3230    type Protocol = ConnectTransactionMarker;
3231
3232    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3233        Self::new(inner)
3234    }
3235
3236    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3237        self.client.into_channel().map_err(|client| Self { client })
3238    }
3239
3240    fn as_channel(&self) -> &::fidl::AsyncChannel {
3241        self.client.as_channel()
3242    }
3243}
3244
3245impl ConnectTransactionProxy {
3246    /// Create a new Proxy for fuchsia.wlan.sme/ConnectTransaction.
3247    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3248        let protocol_name =
3249            <ConnectTransactionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3250        Self { client: fidl::client::Client::new(channel, protocol_name) }
3251    }
3252
3253    /// Get a Stream of events from the remote end of the protocol.
3254    ///
3255    /// # Panics
3256    ///
3257    /// Panics if the event stream was already taken.
3258    pub fn take_event_stream(&self) -> ConnectTransactionEventStream {
3259        ConnectTransactionEventStream { event_receiver: self.client.take_event_receiver() }
3260    }
3261}
3262
3263impl ConnectTransactionProxyInterface for ConnectTransactionProxy {}
3264
3265pub struct ConnectTransactionEventStream {
3266    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3267}
3268
3269impl std::marker::Unpin for ConnectTransactionEventStream {}
3270
3271impl futures::stream::FusedStream for ConnectTransactionEventStream {
3272    fn is_terminated(&self) -> bool {
3273        self.event_receiver.is_terminated()
3274    }
3275}
3276
3277impl futures::Stream for ConnectTransactionEventStream {
3278    type Item = Result<ConnectTransactionEvent, fidl::Error>;
3279
3280    fn poll_next(
3281        mut self: std::pin::Pin<&mut Self>,
3282        cx: &mut std::task::Context<'_>,
3283    ) -> std::task::Poll<Option<Self::Item>> {
3284        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3285            &mut self.event_receiver,
3286            cx
3287        )?) {
3288            Some(buf) => std::task::Poll::Ready(Some(ConnectTransactionEvent::decode(buf))),
3289            None => std::task::Poll::Ready(None),
3290        }
3291    }
3292}
3293
3294#[derive(Debug)]
3295pub enum ConnectTransactionEvent {
3296    OnConnectResult { result: ConnectResult },
3297    OnDisconnect { info: DisconnectInfo },
3298    OnRoamResult { result: RoamResult },
3299    OnSignalReport { ind: fidl_fuchsia_wlan_internal::SignalReportIndication },
3300    OnChannelSwitched { info: fidl_fuchsia_wlan_internal::ChannelSwitchInfo },
3301}
3302
3303impl ConnectTransactionEvent {
3304    #[allow(irrefutable_let_patterns)]
3305    pub fn into_on_connect_result(self) -> Option<ConnectResult> {
3306        if let ConnectTransactionEvent::OnConnectResult { result } = self {
3307            Some((result))
3308        } else {
3309            None
3310        }
3311    }
3312    #[allow(irrefutable_let_patterns)]
3313    pub fn into_on_disconnect(self) -> Option<DisconnectInfo> {
3314        if let ConnectTransactionEvent::OnDisconnect { info } = self { Some((info)) } else { None }
3315    }
3316    #[allow(irrefutable_let_patterns)]
3317    pub fn into_on_roam_result(self) -> Option<RoamResult> {
3318        if let ConnectTransactionEvent::OnRoamResult { result } = self {
3319            Some((result))
3320        } else {
3321            None
3322        }
3323    }
3324    #[allow(irrefutable_let_patterns)]
3325    pub fn into_on_signal_report(
3326        self,
3327    ) -> Option<fidl_fuchsia_wlan_internal::SignalReportIndication> {
3328        if let ConnectTransactionEvent::OnSignalReport { ind } = self { Some((ind)) } else { None }
3329    }
3330    #[allow(irrefutable_let_patterns)]
3331    pub fn into_on_channel_switched(self) -> Option<fidl_fuchsia_wlan_internal::ChannelSwitchInfo> {
3332        if let ConnectTransactionEvent::OnChannelSwitched { info } = self {
3333            Some((info))
3334        } else {
3335            None
3336        }
3337    }
3338
3339    /// Decodes a message buffer as a [`ConnectTransactionEvent`].
3340    fn decode(
3341        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3342    ) -> Result<ConnectTransactionEvent, fidl::Error> {
3343        let (bytes, _handles) = buf.split_mut();
3344        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3345        debug_assert_eq!(tx_header.tx_id, 0);
3346        match tx_header.ordinal {
3347            0x48d2cf407da489a7 => {
3348                let mut out = fidl::new_empty!(
3349                    ConnectTransactionOnConnectResultRequest,
3350                    fidl::encoding::DefaultFuchsiaResourceDialect
3351                );
3352                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConnectTransactionOnConnectResultRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3353                Ok((ConnectTransactionEvent::OnConnectResult { result: out.result }))
3354            }
3355            0x40dea7b1449cc733 => {
3356                let mut out = fidl::new_empty!(
3357                    ConnectTransactionOnDisconnectRequest,
3358                    fidl::encoding::DefaultFuchsiaResourceDialect
3359                );
3360                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConnectTransactionOnDisconnectRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3361                Ok((ConnectTransactionEvent::OnDisconnect { info: out.info }))
3362            }
3363            0x656267da4ccf2a41 => {
3364                let mut out = fidl::new_empty!(
3365                    ConnectTransactionOnRoamResultRequest,
3366                    fidl::encoding::DefaultFuchsiaResourceDialect
3367                );
3368                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConnectTransactionOnRoamResultRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3369                Ok((ConnectTransactionEvent::OnRoamResult { result: out.result }))
3370            }
3371            0x5e968bd5e267e262 => {
3372                let mut out = fidl::new_empty!(
3373                    ConnectTransactionOnSignalReportRequest,
3374                    fidl::encoding::DefaultFuchsiaResourceDialect
3375                );
3376                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConnectTransactionOnSignalReportRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3377                Ok((ConnectTransactionEvent::OnSignalReport { ind: out.ind }))
3378            }
3379            0x5f5153778cd70512 => {
3380                let mut out = fidl::new_empty!(
3381                    ConnectTransactionOnChannelSwitchedRequest,
3382                    fidl::encoding::DefaultFuchsiaResourceDialect
3383                );
3384                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ConnectTransactionOnChannelSwitchedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3385                Ok((ConnectTransactionEvent::OnChannelSwitched { info: out.info }))
3386            }
3387            _ => Err(fidl::Error::UnknownOrdinal {
3388                ordinal: tx_header.ordinal,
3389                protocol_name:
3390                    <ConnectTransactionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3391            }),
3392        }
3393    }
3394}
3395
3396/// A Stream of incoming requests for fuchsia.wlan.sme/ConnectTransaction.
3397pub struct ConnectTransactionRequestStream {
3398    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3399    is_terminated: bool,
3400}
3401
3402impl std::marker::Unpin for ConnectTransactionRequestStream {}
3403
3404impl futures::stream::FusedStream for ConnectTransactionRequestStream {
3405    fn is_terminated(&self) -> bool {
3406        self.is_terminated
3407    }
3408}
3409
3410impl fidl::endpoints::RequestStream for ConnectTransactionRequestStream {
3411    type Protocol = ConnectTransactionMarker;
3412    type ControlHandle = ConnectTransactionControlHandle;
3413
3414    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3415        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3416    }
3417
3418    fn control_handle(&self) -> Self::ControlHandle {
3419        ConnectTransactionControlHandle { inner: self.inner.clone() }
3420    }
3421
3422    fn into_inner(
3423        self,
3424    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3425    {
3426        (self.inner, self.is_terminated)
3427    }
3428
3429    fn from_inner(
3430        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3431        is_terminated: bool,
3432    ) -> Self {
3433        Self { inner, is_terminated }
3434    }
3435}
3436
3437impl futures::Stream for ConnectTransactionRequestStream {
3438    type Item = Result<ConnectTransactionRequest, fidl::Error>;
3439
3440    fn poll_next(
3441        mut self: std::pin::Pin<&mut Self>,
3442        cx: &mut std::task::Context<'_>,
3443    ) -> std::task::Poll<Option<Self::Item>> {
3444        let this = &mut *self;
3445        if this.inner.check_shutdown(cx) {
3446            this.is_terminated = true;
3447            return std::task::Poll::Ready(None);
3448        }
3449        if this.is_terminated {
3450            panic!("polled ConnectTransactionRequestStream after completion");
3451        }
3452        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3453            |bytes, handles| {
3454                match this.inner.channel().read_etc(cx, bytes, handles) {
3455                    std::task::Poll::Ready(Ok(())) => {}
3456                    std::task::Poll::Pending => return std::task::Poll::Pending,
3457                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3458                        this.is_terminated = true;
3459                        return std::task::Poll::Ready(None);
3460                    }
3461                    std::task::Poll::Ready(Err(e)) => {
3462                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3463                            e.into(),
3464                        ))));
3465                    }
3466                }
3467
3468                // A message has been received from the channel
3469                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3470
3471                std::task::Poll::Ready(Some(match header.ordinal {
3472                _ => Err(fidl::Error::UnknownOrdinal {
3473                    ordinal: header.ordinal,
3474                    protocol_name: <ConnectTransactionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3475                }),
3476            }))
3477            },
3478        )
3479    }
3480}
3481
3482#[derive(Debug)]
3483pub enum ConnectTransactionRequest {}
3484
3485impl ConnectTransactionRequest {
3486    /// Name of the method defined in FIDL
3487    pub fn method_name(&self) -> &'static str {
3488        match *self {}
3489    }
3490}
3491
3492#[derive(Debug, Clone)]
3493pub struct ConnectTransactionControlHandle {
3494    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3495}
3496
3497impl ConnectTransactionControlHandle {
3498    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3499        self.inner.shutdown_with_epitaph(status.into())
3500    }
3501}
3502
3503impl fidl::endpoints::ControlHandle for ConnectTransactionControlHandle {
3504    fn shutdown(&self) {
3505        self.inner.shutdown()
3506    }
3507
3508    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3509        self.inner.shutdown_with_epitaph(status)
3510    }
3511
3512    fn is_closed(&self) -> bool {
3513        self.inner.channel().is_closed()
3514    }
3515    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3516        self.inner.channel().on_closed()
3517    }
3518
3519    #[cfg(target_os = "fuchsia")]
3520    fn signal_peer(
3521        &self,
3522        clear_mask: zx::Signals,
3523        set_mask: zx::Signals,
3524    ) -> Result<(), zx_status::Status> {
3525        use fidl::Peered;
3526        self.inner.channel().signal_peer(clear_mask, set_mask)
3527    }
3528}
3529
3530impl ConnectTransactionControlHandle {
3531    pub fn send_on_connect_result(&self, mut result: &ConnectResult) -> Result<(), fidl::Error> {
3532        self.inner.send::<ConnectTransactionOnConnectResultRequest>(
3533            (result,),
3534            0,
3535            0x48d2cf407da489a7,
3536            fidl::encoding::DynamicFlags::empty(),
3537        )
3538    }
3539
3540    pub fn send_on_disconnect(&self, mut info: &DisconnectInfo) -> Result<(), fidl::Error> {
3541        self.inner.send::<ConnectTransactionOnDisconnectRequest>(
3542            (info,),
3543            0,
3544            0x40dea7b1449cc733,
3545            fidl::encoding::DynamicFlags::empty(),
3546        )
3547    }
3548
3549    pub fn send_on_roam_result(&self, mut result: &RoamResult) -> Result<(), fidl::Error> {
3550        self.inner.send::<ConnectTransactionOnRoamResultRequest>(
3551            (result,),
3552            0,
3553            0x656267da4ccf2a41,
3554            fidl::encoding::DynamicFlags::empty(),
3555        )
3556    }
3557
3558    pub fn send_on_signal_report(
3559        &self,
3560        mut ind: &fidl_fuchsia_wlan_internal::SignalReportIndication,
3561    ) -> Result<(), fidl::Error> {
3562        self.inner.send::<ConnectTransactionOnSignalReportRequest>(
3563            (ind,),
3564            0,
3565            0x5e968bd5e267e262,
3566            fidl::encoding::DynamicFlags::empty(),
3567        )
3568    }
3569
3570    pub fn send_on_channel_switched(
3571        &self,
3572        mut info: &fidl_fuchsia_wlan_internal::ChannelSwitchInfo,
3573    ) -> Result<(), fidl::Error> {
3574        self.inner.send::<ConnectTransactionOnChannelSwitchedRequest>(
3575            (info,),
3576            0,
3577            0x5f5153778cd70512,
3578            fidl::encoding::DynamicFlags::empty(),
3579        )
3580    }
3581}
3582
3583#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3584pub struct GenericSmeMarker;
3585
3586impl fidl::endpoints::ProtocolMarker for GenericSmeMarker {
3587    type Proxy = GenericSmeProxy;
3588    type RequestStream = GenericSmeRequestStream;
3589    #[cfg(target_os = "fuchsia")]
3590    type SynchronousProxy = GenericSmeSynchronousProxy;
3591
3592    const DEBUG_NAME: &'static str = "(anonymous) GenericSme";
3593}
3594pub type GenericSmeQueryIfaceCapabilitiesResult =
3595    Result<fidl_fuchsia_wlan_common::ApfPacketFilterSupport, i32>;
3596pub type GenericSmeGetClientSmeResult = Result<(), i32>;
3597pub type GenericSmeGetApSmeResult = Result<(), i32>;
3598pub type GenericSmeGetSmeTelemetryResult = Result<(), i32>;
3599
3600pub trait GenericSmeProxyInterface: Send + Sync {
3601    type QueryResponseFut: std::future::Future<Output = Result<GenericSmeQuery, fidl::Error>> + Send;
3602    fn r#query(&self) -> Self::QueryResponseFut;
3603    type QueryIfaceCapabilitiesResponseFut: std::future::Future<Output = Result<GenericSmeQueryIfaceCapabilitiesResult, fidl::Error>>
3604        + Send;
3605    fn r#query_iface_capabilities(&self) -> Self::QueryIfaceCapabilitiesResponseFut;
3606    type GetClientSmeResponseFut: std::future::Future<Output = Result<GenericSmeGetClientSmeResult, fidl::Error>>
3607        + Send;
3608    fn r#get_client_sme(
3609        &self,
3610        sme_server: fidl::endpoints::ServerEnd<ClientSmeMarker>,
3611    ) -> Self::GetClientSmeResponseFut;
3612    type GetApSmeResponseFut: std::future::Future<Output = Result<GenericSmeGetApSmeResult, fidl::Error>>
3613        + Send;
3614    fn r#get_ap_sme(
3615        &self,
3616        sme_server: fidl::endpoints::ServerEnd<ApSmeMarker>,
3617    ) -> Self::GetApSmeResponseFut;
3618    type GetSmeTelemetryResponseFut: std::future::Future<Output = Result<GenericSmeGetSmeTelemetryResult, fidl::Error>>
3619        + Send;
3620    fn r#get_sme_telemetry(
3621        &self,
3622        telemetry_server: fidl::endpoints::ServerEnd<TelemetryMarker>,
3623    ) -> Self::GetSmeTelemetryResponseFut;
3624}
3625#[derive(Debug)]
3626#[cfg(target_os = "fuchsia")]
3627pub struct GenericSmeSynchronousProxy {
3628    client: fidl::client::sync::Client,
3629}
3630
3631#[cfg(target_os = "fuchsia")]
3632impl fidl::endpoints::SynchronousProxy for GenericSmeSynchronousProxy {
3633    type Proxy = GenericSmeProxy;
3634    type Protocol = GenericSmeMarker;
3635
3636    fn from_channel(inner: fidl::Channel) -> Self {
3637        Self::new(inner)
3638    }
3639
3640    fn into_channel(self) -> fidl::Channel {
3641        self.client.into_channel()
3642    }
3643
3644    fn as_channel(&self) -> &fidl::Channel {
3645        self.client.as_channel()
3646    }
3647}
3648
3649#[cfg(target_os = "fuchsia")]
3650impl GenericSmeSynchronousProxy {
3651    pub fn new(channel: fidl::Channel) -> Self {
3652        Self { client: fidl::client::sync::Client::new(channel) }
3653    }
3654
3655    pub fn into_channel(self) -> fidl::Channel {
3656        self.client.into_channel()
3657    }
3658
3659    /// Waits until an event arrives and returns it. It is safe for other
3660    /// threads to make concurrent requests while waiting for an event.
3661    pub fn wait_for_event(
3662        &self,
3663        deadline: zx::MonotonicInstant,
3664    ) -> Result<GenericSmeEvent, fidl::Error> {
3665        GenericSmeEvent::decode(self.client.wait_for_event::<GenericSmeMarker>(deadline)?)
3666    }
3667
3668    /// Query the underlying SME to determine basic properties. This should
3669    /// generally be called first to determine which SME protocol to request
3670    /// for the SME.
3671    pub fn r#query(
3672        &self,
3673        ___deadline: zx::MonotonicInstant,
3674    ) -> Result<GenericSmeQuery, fidl::Error> {
3675        let _response = self
3676            .client
3677            .send_query::<fidl::encoding::EmptyPayload, GenericSmeQueryResponse, GenericSmeMarker>(
3678                (),
3679                0x6ef4a820c153e249,
3680                fidl::encoding::DynamicFlags::empty(),
3681                ___deadline,
3682            )?;
3683        Ok(_response.resp)
3684    }
3685
3686    /// Query the underlying SME to determine extended properties.
3687    pub fn r#query_iface_capabilities(
3688        &self,
3689        ___deadline: zx::MonotonicInstant,
3690    ) -> Result<GenericSmeQueryIfaceCapabilitiesResult, fidl::Error> {
3691        let _response = self.client.send_query::<
3692            fidl::encoding::EmptyPayload,
3693            fidl::encoding::ResultType<GenericSmeQueryIfaceCapabilitiesResponse, i32>,
3694            GenericSmeMarker,
3695        >(
3696            (),
3697            0x2f483964e794fbba,
3698            fidl::encoding::DynamicFlags::empty(),
3699            ___deadline,
3700        )?;
3701        Ok(_response.map(|x| x.apf_support))
3702    }
3703
3704    /// Attempt to establish a new connection to an underlying Client SME.
3705    /// Connections may be established for the whole lifetime of the SME,
3706    /// but concurrent connections might lead to unexpected behavior.
3707    /// Likely errors include:
3708    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
3709    ///     * PEER_CLOSED: The underlying SME is shutting down.
3710    pub fn r#get_client_sme(
3711        &self,
3712        mut sme_server: fidl::endpoints::ServerEnd<ClientSmeMarker>,
3713        ___deadline: zx::MonotonicInstant,
3714    ) -> Result<GenericSmeGetClientSmeResult, fidl::Error> {
3715        let _response = self.client.send_query::<
3716            GenericSmeGetClientSmeRequest,
3717            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3718            GenericSmeMarker,
3719        >(
3720            (sme_server,),
3721            0x2439ad714c642f15,
3722            fidl::encoding::DynamicFlags::empty(),
3723            ___deadline,
3724        )?;
3725        Ok(_response.map(|x| x))
3726    }
3727
3728    /// Attempt to establish a new connection to an underlying AP SME.
3729    /// Connections may be established for the whole lifetime of the SME,
3730    /// but concurrent connections might lead to unexpected behavior.
3731    /// Likely errors include:
3732    ///     * NOT_SUPPORTED: The underlying SME is not an AP SME.
3733    ///     * PEER_CLOSED: The underlying SME is shutting down.
3734    pub fn r#get_ap_sme(
3735        &self,
3736        mut sme_server: fidl::endpoints::ServerEnd<ApSmeMarker>,
3737        ___deadline: zx::MonotonicInstant,
3738    ) -> Result<GenericSmeGetApSmeResult, fidl::Error> {
3739        let _response = self.client.send_query::<
3740            GenericSmeGetApSmeRequest,
3741            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3742            GenericSmeMarker,
3743        >(
3744            (sme_server,),
3745            0x4d2a40be2b44ad6c,
3746            fidl::encoding::DynamicFlags::empty(),
3747            ___deadline,
3748        )?;
3749        Ok(_response.map(|x| x))
3750    }
3751
3752    /// Attempt to establish a new connection to telemetry information for the
3753    /// underlying SME.
3754    /// Connections may be established for the whole lifetime of the SME, and
3755    /// concurrent connections are safe since this is a read-only API.
3756    /// Likely errors include:
3757    ///     * NOT_SUPPORTED: The underlying SME does not support telemetry.
3758    ///     * PEER_CLOSED: The underlying SME is shutting down.
3759    pub fn r#get_sme_telemetry(
3760        &self,
3761        mut telemetry_server: fidl::endpoints::ServerEnd<TelemetryMarker>,
3762        ___deadline: zx::MonotonicInstant,
3763    ) -> Result<GenericSmeGetSmeTelemetryResult, fidl::Error> {
3764        let _response = self.client.send_query::<
3765            GenericSmeGetSmeTelemetryRequest,
3766            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3767            GenericSmeMarker,
3768        >(
3769            (telemetry_server,),
3770            0x7ea015b3060fa,
3771            fidl::encoding::DynamicFlags::empty(),
3772            ___deadline,
3773        )?;
3774        Ok(_response.map(|x| x))
3775    }
3776}
3777
3778#[cfg(target_os = "fuchsia")]
3779impl From<GenericSmeSynchronousProxy> for zx::NullableHandle {
3780    fn from(value: GenericSmeSynchronousProxy) -> Self {
3781        value.into_channel().into()
3782    }
3783}
3784
3785#[cfg(target_os = "fuchsia")]
3786impl From<fidl::Channel> for GenericSmeSynchronousProxy {
3787    fn from(value: fidl::Channel) -> Self {
3788        Self::new(value)
3789    }
3790}
3791
3792#[cfg(target_os = "fuchsia")]
3793impl fidl::endpoints::FromClient for GenericSmeSynchronousProxy {
3794    type Protocol = GenericSmeMarker;
3795
3796    fn from_client(value: fidl::endpoints::ClientEnd<GenericSmeMarker>) -> Self {
3797        Self::new(value.into_channel())
3798    }
3799}
3800
3801#[derive(Debug, Clone)]
3802pub struct GenericSmeProxy {
3803    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3804}
3805
3806impl fidl::endpoints::Proxy for GenericSmeProxy {
3807    type Protocol = GenericSmeMarker;
3808
3809    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3810        Self::new(inner)
3811    }
3812
3813    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3814        self.client.into_channel().map_err(|client| Self { client })
3815    }
3816
3817    fn as_channel(&self) -> &::fidl::AsyncChannel {
3818        self.client.as_channel()
3819    }
3820}
3821
3822impl GenericSmeProxy {
3823    /// Create a new Proxy for fuchsia.wlan.sme/GenericSme.
3824    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3825        let protocol_name = <GenericSmeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3826        Self { client: fidl::client::Client::new(channel, protocol_name) }
3827    }
3828
3829    /// Get a Stream of events from the remote end of the protocol.
3830    ///
3831    /// # Panics
3832    ///
3833    /// Panics if the event stream was already taken.
3834    pub fn take_event_stream(&self) -> GenericSmeEventStream {
3835        GenericSmeEventStream { event_receiver: self.client.take_event_receiver() }
3836    }
3837
3838    /// Query the underlying SME to determine basic properties. This should
3839    /// generally be called first to determine which SME protocol to request
3840    /// for the SME.
3841    pub fn r#query(
3842        &self,
3843    ) -> fidl::client::QueryResponseFut<
3844        GenericSmeQuery,
3845        fidl::encoding::DefaultFuchsiaResourceDialect,
3846    > {
3847        GenericSmeProxyInterface::r#query(self)
3848    }
3849
3850    /// Query the underlying SME to determine extended properties.
3851    pub fn r#query_iface_capabilities(
3852        &self,
3853    ) -> fidl::client::QueryResponseFut<
3854        GenericSmeQueryIfaceCapabilitiesResult,
3855        fidl::encoding::DefaultFuchsiaResourceDialect,
3856    > {
3857        GenericSmeProxyInterface::r#query_iface_capabilities(self)
3858    }
3859
3860    /// Attempt to establish a new connection to an underlying Client SME.
3861    /// Connections may be established for the whole lifetime of the SME,
3862    /// but concurrent connections might lead to unexpected behavior.
3863    /// Likely errors include:
3864    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
3865    ///     * PEER_CLOSED: The underlying SME is shutting down.
3866    pub fn r#get_client_sme(
3867        &self,
3868        mut sme_server: fidl::endpoints::ServerEnd<ClientSmeMarker>,
3869    ) -> fidl::client::QueryResponseFut<
3870        GenericSmeGetClientSmeResult,
3871        fidl::encoding::DefaultFuchsiaResourceDialect,
3872    > {
3873        GenericSmeProxyInterface::r#get_client_sme(self, sme_server)
3874    }
3875
3876    /// Attempt to establish a new connection to an underlying AP SME.
3877    /// Connections may be established for the whole lifetime of the SME,
3878    /// but concurrent connections might lead to unexpected behavior.
3879    /// Likely errors include:
3880    ///     * NOT_SUPPORTED: The underlying SME is not an AP SME.
3881    ///     * PEER_CLOSED: The underlying SME is shutting down.
3882    pub fn r#get_ap_sme(
3883        &self,
3884        mut sme_server: fidl::endpoints::ServerEnd<ApSmeMarker>,
3885    ) -> fidl::client::QueryResponseFut<
3886        GenericSmeGetApSmeResult,
3887        fidl::encoding::DefaultFuchsiaResourceDialect,
3888    > {
3889        GenericSmeProxyInterface::r#get_ap_sme(self, sme_server)
3890    }
3891
3892    /// Attempt to establish a new connection to telemetry information for the
3893    /// underlying SME.
3894    /// Connections may be established for the whole lifetime of the SME, and
3895    /// concurrent connections are safe since this is a read-only API.
3896    /// Likely errors include:
3897    ///     * NOT_SUPPORTED: The underlying SME does not support telemetry.
3898    ///     * PEER_CLOSED: The underlying SME is shutting down.
3899    pub fn r#get_sme_telemetry(
3900        &self,
3901        mut telemetry_server: fidl::endpoints::ServerEnd<TelemetryMarker>,
3902    ) -> fidl::client::QueryResponseFut<
3903        GenericSmeGetSmeTelemetryResult,
3904        fidl::encoding::DefaultFuchsiaResourceDialect,
3905    > {
3906        GenericSmeProxyInterface::r#get_sme_telemetry(self, telemetry_server)
3907    }
3908}
3909
3910impl GenericSmeProxyInterface for GenericSmeProxy {
3911    type QueryResponseFut = fidl::client::QueryResponseFut<
3912        GenericSmeQuery,
3913        fidl::encoding::DefaultFuchsiaResourceDialect,
3914    >;
3915    fn r#query(&self) -> Self::QueryResponseFut {
3916        fn _decode(
3917            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3918        ) -> Result<GenericSmeQuery, fidl::Error> {
3919            let _response = fidl::client::decode_transaction_body::<
3920                GenericSmeQueryResponse,
3921                fidl::encoding::DefaultFuchsiaResourceDialect,
3922                0x6ef4a820c153e249,
3923            >(_buf?)?;
3924            Ok(_response.resp)
3925        }
3926        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, GenericSmeQuery>(
3927            (),
3928            0x6ef4a820c153e249,
3929            fidl::encoding::DynamicFlags::empty(),
3930            _decode,
3931        )
3932    }
3933
3934    type QueryIfaceCapabilitiesResponseFut = fidl::client::QueryResponseFut<
3935        GenericSmeQueryIfaceCapabilitiesResult,
3936        fidl::encoding::DefaultFuchsiaResourceDialect,
3937    >;
3938    fn r#query_iface_capabilities(&self) -> Self::QueryIfaceCapabilitiesResponseFut {
3939        fn _decode(
3940            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3941        ) -> Result<GenericSmeQueryIfaceCapabilitiesResult, fidl::Error> {
3942            let _response = fidl::client::decode_transaction_body::<
3943                fidl::encoding::ResultType<GenericSmeQueryIfaceCapabilitiesResponse, i32>,
3944                fidl::encoding::DefaultFuchsiaResourceDialect,
3945                0x2f483964e794fbba,
3946            >(_buf?)?;
3947            Ok(_response.map(|x| x.apf_support))
3948        }
3949        self.client.send_query_and_decode::<
3950            fidl::encoding::EmptyPayload,
3951            GenericSmeQueryIfaceCapabilitiesResult,
3952        >(
3953            (),
3954            0x2f483964e794fbba,
3955            fidl::encoding::DynamicFlags::empty(),
3956            _decode,
3957        )
3958    }
3959
3960    type GetClientSmeResponseFut = fidl::client::QueryResponseFut<
3961        GenericSmeGetClientSmeResult,
3962        fidl::encoding::DefaultFuchsiaResourceDialect,
3963    >;
3964    fn r#get_client_sme(
3965        &self,
3966        mut sme_server: fidl::endpoints::ServerEnd<ClientSmeMarker>,
3967    ) -> Self::GetClientSmeResponseFut {
3968        fn _decode(
3969            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3970        ) -> Result<GenericSmeGetClientSmeResult, fidl::Error> {
3971            let _response = fidl::client::decode_transaction_body::<
3972                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3973                fidl::encoding::DefaultFuchsiaResourceDialect,
3974                0x2439ad714c642f15,
3975            >(_buf?)?;
3976            Ok(_response.map(|x| x))
3977        }
3978        self.client
3979            .send_query_and_decode::<GenericSmeGetClientSmeRequest, GenericSmeGetClientSmeResult>(
3980                (sme_server,),
3981                0x2439ad714c642f15,
3982                fidl::encoding::DynamicFlags::empty(),
3983                _decode,
3984            )
3985    }
3986
3987    type GetApSmeResponseFut = fidl::client::QueryResponseFut<
3988        GenericSmeGetApSmeResult,
3989        fidl::encoding::DefaultFuchsiaResourceDialect,
3990    >;
3991    fn r#get_ap_sme(
3992        &self,
3993        mut sme_server: fidl::endpoints::ServerEnd<ApSmeMarker>,
3994    ) -> Self::GetApSmeResponseFut {
3995        fn _decode(
3996            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3997        ) -> Result<GenericSmeGetApSmeResult, fidl::Error> {
3998            let _response = fidl::client::decode_transaction_body::<
3999                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4000                fidl::encoding::DefaultFuchsiaResourceDialect,
4001                0x4d2a40be2b44ad6c,
4002            >(_buf?)?;
4003            Ok(_response.map(|x| x))
4004        }
4005        self.client.send_query_and_decode::<GenericSmeGetApSmeRequest, GenericSmeGetApSmeResult>(
4006            (sme_server,),
4007            0x4d2a40be2b44ad6c,
4008            fidl::encoding::DynamicFlags::empty(),
4009            _decode,
4010        )
4011    }
4012
4013    type GetSmeTelemetryResponseFut = fidl::client::QueryResponseFut<
4014        GenericSmeGetSmeTelemetryResult,
4015        fidl::encoding::DefaultFuchsiaResourceDialect,
4016    >;
4017    fn r#get_sme_telemetry(
4018        &self,
4019        mut telemetry_server: fidl::endpoints::ServerEnd<TelemetryMarker>,
4020    ) -> Self::GetSmeTelemetryResponseFut {
4021        fn _decode(
4022            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4023        ) -> Result<GenericSmeGetSmeTelemetryResult, fidl::Error> {
4024            let _response = fidl::client::decode_transaction_body::<
4025                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
4026                fidl::encoding::DefaultFuchsiaResourceDialect,
4027                0x7ea015b3060fa,
4028            >(_buf?)?;
4029            Ok(_response.map(|x| x))
4030        }
4031        self.client.send_query_and_decode::<
4032            GenericSmeGetSmeTelemetryRequest,
4033            GenericSmeGetSmeTelemetryResult,
4034        >(
4035            (telemetry_server,),
4036            0x7ea015b3060fa,
4037            fidl::encoding::DynamicFlags::empty(),
4038            _decode,
4039        )
4040    }
4041}
4042
4043pub struct GenericSmeEventStream {
4044    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4045}
4046
4047impl std::marker::Unpin for GenericSmeEventStream {}
4048
4049impl futures::stream::FusedStream for GenericSmeEventStream {
4050    fn is_terminated(&self) -> bool {
4051        self.event_receiver.is_terminated()
4052    }
4053}
4054
4055impl futures::Stream for GenericSmeEventStream {
4056    type Item = Result<GenericSmeEvent, fidl::Error>;
4057
4058    fn poll_next(
4059        mut self: std::pin::Pin<&mut Self>,
4060        cx: &mut std::task::Context<'_>,
4061    ) -> std::task::Poll<Option<Self::Item>> {
4062        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4063            &mut self.event_receiver,
4064            cx
4065        )?) {
4066            Some(buf) => std::task::Poll::Ready(Some(GenericSmeEvent::decode(buf))),
4067            None => std::task::Poll::Ready(None),
4068        }
4069    }
4070}
4071
4072#[derive(Debug)]
4073pub enum GenericSmeEvent {}
4074
4075impl GenericSmeEvent {
4076    /// Decodes a message buffer as a [`GenericSmeEvent`].
4077    fn decode(
4078        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4079    ) -> Result<GenericSmeEvent, fidl::Error> {
4080        let (bytes, _handles) = buf.split_mut();
4081        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4082        debug_assert_eq!(tx_header.tx_id, 0);
4083        match tx_header.ordinal {
4084            _ => Err(fidl::Error::UnknownOrdinal {
4085                ordinal: tx_header.ordinal,
4086                protocol_name: <GenericSmeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4087            }),
4088        }
4089    }
4090}
4091
4092/// A Stream of incoming requests for fuchsia.wlan.sme/GenericSme.
4093pub struct GenericSmeRequestStream {
4094    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4095    is_terminated: bool,
4096}
4097
4098impl std::marker::Unpin for GenericSmeRequestStream {}
4099
4100impl futures::stream::FusedStream for GenericSmeRequestStream {
4101    fn is_terminated(&self) -> bool {
4102        self.is_terminated
4103    }
4104}
4105
4106impl fidl::endpoints::RequestStream for GenericSmeRequestStream {
4107    type Protocol = GenericSmeMarker;
4108    type ControlHandle = GenericSmeControlHandle;
4109
4110    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4111        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4112    }
4113
4114    fn control_handle(&self) -> Self::ControlHandle {
4115        GenericSmeControlHandle { inner: self.inner.clone() }
4116    }
4117
4118    fn into_inner(
4119        self,
4120    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4121    {
4122        (self.inner, self.is_terminated)
4123    }
4124
4125    fn from_inner(
4126        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4127        is_terminated: bool,
4128    ) -> Self {
4129        Self { inner, is_terminated }
4130    }
4131}
4132
4133impl futures::Stream for GenericSmeRequestStream {
4134    type Item = Result<GenericSmeRequest, fidl::Error>;
4135
4136    fn poll_next(
4137        mut self: std::pin::Pin<&mut Self>,
4138        cx: &mut std::task::Context<'_>,
4139    ) -> std::task::Poll<Option<Self::Item>> {
4140        let this = &mut *self;
4141        if this.inner.check_shutdown(cx) {
4142            this.is_terminated = true;
4143            return std::task::Poll::Ready(None);
4144        }
4145        if this.is_terminated {
4146            panic!("polled GenericSmeRequestStream after completion");
4147        }
4148        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4149            |bytes, handles| {
4150                match this.inner.channel().read_etc(cx, bytes, handles) {
4151                    std::task::Poll::Ready(Ok(())) => {}
4152                    std::task::Poll::Pending => return std::task::Poll::Pending,
4153                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4154                        this.is_terminated = true;
4155                        return std::task::Poll::Ready(None);
4156                    }
4157                    std::task::Poll::Ready(Err(e)) => {
4158                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4159                            e.into(),
4160                        ))));
4161                    }
4162                }
4163
4164                // A message has been received from the channel
4165                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4166
4167                std::task::Poll::Ready(Some(match header.ordinal {
4168                    0x6ef4a820c153e249 => {
4169                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4170                        let mut req = fidl::new_empty!(
4171                            fidl::encoding::EmptyPayload,
4172                            fidl::encoding::DefaultFuchsiaResourceDialect
4173                        );
4174                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4175                        let control_handle = GenericSmeControlHandle { inner: this.inner.clone() };
4176                        Ok(GenericSmeRequest::Query {
4177                            responder: GenericSmeQueryResponder {
4178                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4179                                tx_id: header.tx_id,
4180                            },
4181                        })
4182                    }
4183                    0x2f483964e794fbba => {
4184                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4185                        let mut req = fidl::new_empty!(
4186                            fidl::encoding::EmptyPayload,
4187                            fidl::encoding::DefaultFuchsiaResourceDialect
4188                        );
4189                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4190                        let control_handle = GenericSmeControlHandle { inner: this.inner.clone() };
4191                        Ok(GenericSmeRequest::QueryIfaceCapabilities {
4192                            responder: GenericSmeQueryIfaceCapabilitiesResponder {
4193                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4194                                tx_id: header.tx_id,
4195                            },
4196                        })
4197                    }
4198                    0x2439ad714c642f15 => {
4199                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4200                        let mut req = fidl::new_empty!(
4201                            GenericSmeGetClientSmeRequest,
4202                            fidl::encoding::DefaultFuchsiaResourceDialect
4203                        );
4204                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GenericSmeGetClientSmeRequest>(&header, _body_bytes, handles, &mut req)?;
4205                        let control_handle = GenericSmeControlHandle { inner: this.inner.clone() };
4206                        Ok(GenericSmeRequest::GetClientSme {
4207                            sme_server: req.sme_server,
4208
4209                            responder: GenericSmeGetClientSmeResponder {
4210                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4211                                tx_id: header.tx_id,
4212                            },
4213                        })
4214                    }
4215                    0x4d2a40be2b44ad6c => {
4216                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4217                        let mut req = fidl::new_empty!(
4218                            GenericSmeGetApSmeRequest,
4219                            fidl::encoding::DefaultFuchsiaResourceDialect
4220                        );
4221                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GenericSmeGetApSmeRequest>(&header, _body_bytes, handles, &mut req)?;
4222                        let control_handle = GenericSmeControlHandle { inner: this.inner.clone() };
4223                        Ok(GenericSmeRequest::GetApSme {
4224                            sme_server: req.sme_server,
4225
4226                            responder: GenericSmeGetApSmeResponder {
4227                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4228                                tx_id: header.tx_id,
4229                            },
4230                        })
4231                    }
4232                    0x7ea015b3060fa => {
4233                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4234                        let mut req = fidl::new_empty!(
4235                            GenericSmeGetSmeTelemetryRequest,
4236                            fidl::encoding::DefaultFuchsiaResourceDialect
4237                        );
4238                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GenericSmeGetSmeTelemetryRequest>(&header, _body_bytes, handles, &mut req)?;
4239                        let control_handle = GenericSmeControlHandle { inner: this.inner.clone() };
4240                        Ok(GenericSmeRequest::GetSmeTelemetry {
4241                            telemetry_server: req.telemetry_server,
4242
4243                            responder: GenericSmeGetSmeTelemetryResponder {
4244                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4245                                tx_id: header.tx_id,
4246                            },
4247                        })
4248                    }
4249                    _ => Err(fidl::Error::UnknownOrdinal {
4250                        ordinal: header.ordinal,
4251                        protocol_name:
4252                            <GenericSmeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4253                    }),
4254                }))
4255            },
4256        )
4257    }
4258}
4259
4260#[derive(Debug)]
4261pub enum GenericSmeRequest {
4262    /// Query the underlying SME to determine basic properties. This should
4263    /// generally be called first to determine which SME protocol to request
4264    /// for the SME.
4265    Query { responder: GenericSmeQueryResponder },
4266    /// Query the underlying SME to determine extended properties.
4267    QueryIfaceCapabilities { responder: GenericSmeQueryIfaceCapabilitiesResponder },
4268    /// Attempt to establish a new connection to an underlying Client SME.
4269    /// Connections may be established for the whole lifetime of the SME,
4270    /// but concurrent connections might lead to unexpected behavior.
4271    /// Likely errors include:
4272    ///     * NOT_SUPPORTED: The underlying SME is not a Client SME.
4273    ///     * PEER_CLOSED: The underlying SME is shutting down.
4274    GetClientSme {
4275        sme_server: fidl::endpoints::ServerEnd<ClientSmeMarker>,
4276        responder: GenericSmeGetClientSmeResponder,
4277    },
4278    /// Attempt to establish a new connection to an underlying AP SME.
4279    /// Connections may be established for the whole lifetime of the SME,
4280    /// but concurrent connections might lead to unexpected behavior.
4281    /// Likely errors include:
4282    ///     * NOT_SUPPORTED: The underlying SME is not an AP SME.
4283    ///     * PEER_CLOSED: The underlying SME is shutting down.
4284    GetApSme {
4285        sme_server: fidl::endpoints::ServerEnd<ApSmeMarker>,
4286        responder: GenericSmeGetApSmeResponder,
4287    },
4288    /// Attempt to establish a new connection to telemetry information for the
4289    /// underlying SME.
4290    /// Connections may be established for the whole lifetime of the SME, and
4291    /// concurrent connections are safe since this is a read-only API.
4292    /// Likely errors include:
4293    ///     * NOT_SUPPORTED: The underlying SME does not support telemetry.
4294    ///     * PEER_CLOSED: The underlying SME is shutting down.
4295    GetSmeTelemetry {
4296        telemetry_server: fidl::endpoints::ServerEnd<TelemetryMarker>,
4297        responder: GenericSmeGetSmeTelemetryResponder,
4298    },
4299}
4300
4301impl GenericSmeRequest {
4302    #[allow(irrefutable_let_patterns)]
4303    pub fn into_query(self) -> Option<(GenericSmeQueryResponder)> {
4304        if let GenericSmeRequest::Query { responder } = self { Some((responder)) } else { None }
4305    }
4306
4307    #[allow(irrefutable_let_patterns)]
4308    pub fn into_query_iface_capabilities(
4309        self,
4310    ) -> Option<(GenericSmeQueryIfaceCapabilitiesResponder)> {
4311        if let GenericSmeRequest::QueryIfaceCapabilities { responder } = self {
4312            Some((responder))
4313        } else {
4314            None
4315        }
4316    }
4317
4318    #[allow(irrefutable_let_patterns)]
4319    pub fn into_get_client_sme(
4320        self,
4321    ) -> Option<(fidl::endpoints::ServerEnd<ClientSmeMarker>, GenericSmeGetClientSmeResponder)>
4322    {
4323        if let GenericSmeRequest::GetClientSme { sme_server, responder } = self {
4324            Some((sme_server, responder))
4325        } else {
4326            None
4327        }
4328    }
4329
4330    #[allow(irrefutable_let_patterns)]
4331    pub fn into_get_ap_sme(
4332        self,
4333    ) -> Option<(fidl::endpoints::ServerEnd<ApSmeMarker>, GenericSmeGetApSmeResponder)> {
4334        if let GenericSmeRequest::GetApSme { sme_server, responder } = self {
4335            Some((sme_server, responder))
4336        } else {
4337            None
4338        }
4339    }
4340
4341    #[allow(irrefutable_let_patterns)]
4342    pub fn into_get_sme_telemetry(
4343        self,
4344    ) -> Option<(fidl::endpoints::ServerEnd<TelemetryMarker>, GenericSmeGetSmeTelemetryResponder)>
4345    {
4346        if let GenericSmeRequest::GetSmeTelemetry { telemetry_server, responder } = self {
4347            Some((telemetry_server, responder))
4348        } else {
4349            None
4350        }
4351    }
4352
4353    /// Name of the method defined in FIDL
4354    pub fn method_name(&self) -> &'static str {
4355        match *self {
4356            GenericSmeRequest::Query { .. } => "query",
4357            GenericSmeRequest::QueryIfaceCapabilities { .. } => "query_iface_capabilities",
4358            GenericSmeRequest::GetClientSme { .. } => "get_client_sme",
4359            GenericSmeRequest::GetApSme { .. } => "get_ap_sme",
4360            GenericSmeRequest::GetSmeTelemetry { .. } => "get_sme_telemetry",
4361        }
4362    }
4363}
4364
4365#[derive(Debug, Clone)]
4366pub struct GenericSmeControlHandle {
4367    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4368}
4369
4370impl GenericSmeControlHandle {
4371    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
4372        self.inner.shutdown_with_epitaph(status.into())
4373    }
4374}
4375
4376impl fidl::endpoints::ControlHandle for GenericSmeControlHandle {
4377    fn shutdown(&self) {
4378        self.inner.shutdown()
4379    }
4380
4381    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
4382        self.inner.shutdown_with_epitaph(status)
4383    }
4384
4385    fn is_closed(&self) -> bool {
4386        self.inner.channel().is_closed()
4387    }
4388    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4389        self.inner.channel().on_closed()
4390    }
4391
4392    #[cfg(target_os = "fuchsia")]
4393    fn signal_peer(
4394        &self,
4395        clear_mask: zx::Signals,
4396        set_mask: zx::Signals,
4397    ) -> Result<(), zx_status::Status> {
4398        use fidl::Peered;
4399        self.inner.channel().signal_peer(clear_mask, set_mask)
4400    }
4401}
4402
4403impl GenericSmeControlHandle {}
4404
4405#[must_use = "FIDL methods require a response to be sent"]
4406#[derive(Debug)]
4407pub struct GenericSmeQueryResponder {
4408    control_handle: std::mem::ManuallyDrop<GenericSmeControlHandle>,
4409    tx_id: u32,
4410}
4411
4412/// Set the the channel to be shutdown (see [`GenericSmeControlHandle::shutdown`])
4413/// if the responder is dropped without sending a response, so that the client
4414/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4415impl std::ops::Drop for GenericSmeQueryResponder {
4416    fn drop(&mut self) {
4417        self.control_handle.shutdown();
4418        // Safety: drops once, never accessed again
4419        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4420    }
4421}
4422
4423impl fidl::endpoints::Responder for GenericSmeQueryResponder {
4424    type ControlHandle = GenericSmeControlHandle;
4425
4426    fn control_handle(&self) -> &GenericSmeControlHandle {
4427        &self.control_handle
4428    }
4429
4430    fn drop_without_shutdown(mut self) {
4431        // Safety: drops once, never accessed again due to mem::forget
4432        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4433        // Prevent Drop from running (which would shut down the channel)
4434        std::mem::forget(self);
4435    }
4436}
4437
4438impl GenericSmeQueryResponder {
4439    /// Sends a response to the FIDL transaction.
4440    ///
4441    /// Sets the channel to shutdown if an error occurs.
4442    pub fn send(self, mut resp: &GenericSmeQuery) -> Result<(), fidl::Error> {
4443        let _result = self.send_raw(resp);
4444        if _result.is_err() {
4445            self.control_handle.shutdown();
4446        }
4447        self.drop_without_shutdown();
4448        _result
4449    }
4450
4451    /// Similar to "send" but does not shutdown the channel if an error occurs.
4452    pub fn send_no_shutdown_on_err(self, mut resp: &GenericSmeQuery) -> Result<(), fidl::Error> {
4453        let _result = self.send_raw(resp);
4454        self.drop_without_shutdown();
4455        _result
4456    }
4457
4458    fn send_raw(&self, mut resp: &GenericSmeQuery) -> Result<(), fidl::Error> {
4459        self.control_handle.inner.send::<GenericSmeQueryResponse>(
4460            (resp,),
4461            self.tx_id,
4462            0x6ef4a820c153e249,
4463            fidl::encoding::DynamicFlags::empty(),
4464        )
4465    }
4466}
4467
4468#[must_use = "FIDL methods require a response to be sent"]
4469#[derive(Debug)]
4470pub struct GenericSmeQueryIfaceCapabilitiesResponder {
4471    control_handle: std::mem::ManuallyDrop<GenericSmeControlHandle>,
4472    tx_id: u32,
4473}
4474
4475/// Set the the channel to be shutdown (see [`GenericSmeControlHandle::shutdown`])
4476/// if the responder is dropped without sending a response, so that the client
4477/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4478impl std::ops::Drop for GenericSmeQueryIfaceCapabilitiesResponder {
4479    fn drop(&mut self) {
4480        self.control_handle.shutdown();
4481        // Safety: drops once, never accessed again
4482        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4483    }
4484}
4485
4486impl fidl::endpoints::Responder for GenericSmeQueryIfaceCapabilitiesResponder {
4487    type ControlHandle = GenericSmeControlHandle;
4488
4489    fn control_handle(&self) -> &GenericSmeControlHandle {
4490        &self.control_handle
4491    }
4492
4493    fn drop_without_shutdown(mut self) {
4494        // Safety: drops once, never accessed again due to mem::forget
4495        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4496        // Prevent Drop from running (which would shut down the channel)
4497        std::mem::forget(self);
4498    }
4499}
4500
4501impl GenericSmeQueryIfaceCapabilitiesResponder {
4502    /// Sends a response to the FIDL transaction.
4503    ///
4504    /// Sets the channel to shutdown if an error occurs.
4505    pub fn send(
4506        self,
4507        mut result: Result<&fidl_fuchsia_wlan_common::ApfPacketFilterSupport, i32>,
4508    ) -> Result<(), fidl::Error> {
4509        let _result = self.send_raw(result);
4510        if _result.is_err() {
4511            self.control_handle.shutdown();
4512        }
4513        self.drop_without_shutdown();
4514        _result
4515    }
4516
4517    /// Similar to "send" but does not shutdown the channel if an error occurs.
4518    pub fn send_no_shutdown_on_err(
4519        self,
4520        mut result: Result<&fidl_fuchsia_wlan_common::ApfPacketFilterSupport, i32>,
4521    ) -> Result<(), fidl::Error> {
4522        let _result = self.send_raw(result);
4523        self.drop_without_shutdown();
4524        _result
4525    }
4526
4527    fn send_raw(
4528        &self,
4529        mut result: Result<&fidl_fuchsia_wlan_common::ApfPacketFilterSupport, i32>,
4530    ) -> Result<(), fidl::Error> {
4531        self.control_handle.inner.send::<fidl::encoding::ResultType<
4532            GenericSmeQueryIfaceCapabilitiesResponse,
4533            i32,
4534        >>(
4535            result.map(|apf_support| (apf_support,)),
4536            self.tx_id,
4537            0x2f483964e794fbba,
4538            fidl::encoding::DynamicFlags::empty(),
4539        )
4540    }
4541}
4542
4543#[must_use = "FIDL methods require a response to be sent"]
4544#[derive(Debug)]
4545pub struct GenericSmeGetClientSmeResponder {
4546    control_handle: std::mem::ManuallyDrop<GenericSmeControlHandle>,
4547    tx_id: u32,
4548}
4549
4550/// Set the the channel to be shutdown (see [`GenericSmeControlHandle::shutdown`])
4551/// if the responder is dropped without sending a response, so that the client
4552/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4553impl std::ops::Drop for GenericSmeGetClientSmeResponder {
4554    fn drop(&mut self) {
4555        self.control_handle.shutdown();
4556        // Safety: drops once, never accessed again
4557        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4558    }
4559}
4560
4561impl fidl::endpoints::Responder for GenericSmeGetClientSmeResponder {
4562    type ControlHandle = GenericSmeControlHandle;
4563
4564    fn control_handle(&self) -> &GenericSmeControlHandle {
4565        &self.control_handle
4566    }
4567
4568    fn drop_without_shutdown(mut self) {
4569        // Safety: drops once, never accessed again due to mem::forget
4570        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4571        // Prevent Drop from running (which would shut down the channel)
4572        std::mem::forget(self);
4573    }
4574}
4575
4576impl GenericSmeGetClientSmeResponder {
4577    /// Sends a response to the FIDL transaction.
4578    ///
4579    /// Sets the channel to shutdown if an error occurs.
4580    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4581        let _result = self.send_raw(result);
4582        if _result.is_err() {
4583            self.control_handle.shutdown();
4584        }
4585        self.drop_without_shutdown();
4586        _result
4587    }
4588
4589    /// Similar to "send" but does not shutdown the channel if an error occurs.
4590    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4591        let _result = self.send_raw(result);
4592        self.drop_without_shutdown();
4593        _result
4594    }
4595
4596    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4597        self.control_handle
4598            .inner
4599            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4600                result,
4601                self.tx_id,
4602                0x2439ad714c642f15,
4603                fidl::encoding::DynamicFlags::empty(),
4604            )
4605    }
4606}
4607
4608#[must_use = "FIDL methods require a response to be sent"]
4609#[derive(Debug)]
4610pub struct GenericSmeGetApSmeResponder {
4611    control_handle: std::mem::ManuallyDrop<GenericSmeControlHandle>,
4612    tx_id: u32,
4613}
4614
4615/// Set the the channel to be shutdown (see [`GenericSmeControlHandle::shutdown`])
4616/// if the responder is dropped without sending a response, so that the client
4617/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4618impl std::ops::Drop for GenericSmeGetApSmeResponder {
4619    fn drop(&mut self) {
4620        self.control_handle.shutdown();
4621        // Safety: drops once, never accessed again
4622        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4623    }
4624}
4625
4626impl fidl::endpoints::Responder for GenericSmeGetApSmeResponder {
4627    type ControlHandle = GenericSmeControlHandle;
4628
4629    fn control_handle(&self) -> &GenericSmeControlHandle {
4630        &self.control_handle
4631    }
4632
4633    fn drop_without_shutdown(mut self) {
4634        // Safety: drops once, never accessed again due to mem::forget
4635        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4636        // Prevent Drop from running (which would shut down the channel)
4637        std::mem::forget(self);
4638    }
4639}
4640
4641impl GenericSmeGetApSmeResponder {
4642    /// Sends a response to the FIDL transaction.
4643    ///
4644    /// Sets the channel to shutdown if an error occurs.
4645    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4646        let _result = self.send_raw(result);
4647        if _result.is_err() {
4648            self.control_handle.shutdown();
4649        }
4650        self.drop_without_shutdown();
4651        _result
4652    }
4653
4654    /// Similar to "send" but does not shutdown the channel if an error occurs.
4655    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4656        let _result = self.send_raw(result);
4657        self.drop_without_shutdown();
4658        _result
4659    }
4660
4661    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4662        self.control_handle
4663            .inner
4664            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4665                result,
4666                self.tx_id,
4667                0x4d2a40be2b44ad6c,
4668                fidl::encoding::DynamicFlags::empty(),
4669            )
4670    }
4671}
4672
4673#[must_use = "FIDL methods require a response to be sent"]
4674#[derive(Debug)]
4675pub struct GenericSmeGetSmeTelemetryResponder {
4676    control_handle: std::mem::ManuallyDrop<GenericSmeControlHandle>,
4677    tx_id: u32,
4678}
4679
4680/// Set the the channel to be shutdown (see [`GenericSmeControlHandle::shutdown`])
4681/// if the responder is dropped without sending a response, so that the client
4682/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4683impl std::ops::Drop for GenericSmeGetSmeTelemetryResponder {
4684    fn drop(&mut self) {
4685        self.control_handle.shutdown();
4686        // Safety: drops once, never accessed again
4687        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4688    }
4689}
4690
4691impl fidl::endpoints::Responder for GenericSmeGetSmeTelemetryResponder {
4692    type ControlHandle = GenericSmeControlHandle;
4693
4694    fn control_handle(&self) -> &GenericSmeControlHandle {
4695        &self.control_handle
4696    }
4697
4698    fn drop_without_shutdown(mut self) {
4699        // Safety: drops once, never accessed again due to mem::forget
4700        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4701        // Prevent Drop from running (which would shut down the channel)
4702        std::mem::forget(self);
4703    }
4704}
4705
4706impl GenericSmeGetSmeTelemetryResponder {
4707    /// Sends a response to the FIDL transaction.
4708    ///
4709    /// Sets the channel to shutdown if an error occurs.
4710    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4711        let _result = self.send_raw(result);
4712        if _result.is_err() {
4713            self.control_handle.shutdown();
4714        }
4715        self.drop_without_shutdown();
4716        _result
4717    }
4718
4719    /// Similar to "send" but does not shutdown the channel if an error occurs.
4720    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4721        let _result = self.send_raw(result);
4722        self.drop_without_shutdown();
4723        _result
4724    }
4725
4726    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4727        self.control_handle
4728            .inner
4729            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4730                result,
4731                self.tx_id,
4732                0x7ea015b3060fa,
4733                fidl::encoding::DynamicFlags::empty(),
4734            )
4735    }
4736}
4737
4738#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4739pub struct ScheduledScanTransactionMarker;
4740
4741impl fidl::endpoints::ProtocolMarker for ScheduledScanTransactionMarker {
4742    type Proxy = ScheduledScanTransactionProxy;
4743    type RequestStream = ScheduledScanTransactionRequestStream;
4744    #[cfg(target_os = "fuchsia")]
4745    type SynchronousProxy = ScheduledScanTransactionSynchronousProxy;
4746
4747    const DEBUG_NAME: &'static str = "(anonymous) ScheduledScanTransaction";
4748}
4749
4750pub trait ScheduledScanTransactionProxyInterface: Send + Sync {}
4751#[derive(Debug)]
4752#[cfg(target_os = "fuchsia")]
4753pub struct ScheduledScanTransactionSynchronousProxy {
4754    client: fidl::client::sync::Client,
4755}
4756
4757#[cfg(target_os = "fuchsia")]
4758impl fidl::endpoints::SynchronousProxy for ScheduledScanTransactionSynchronousProxy {
4759    type Proxy = ScheduledScanTransactionProxy;
4760    type Protocol = ScheduledScanTransactionMarker;
4761
4762    fn from_channel(inner: fidl::Channel) -> Self {
4763        Self::new(inner)
4764    }
4765
4766    fn into_channel(self) -> fidl::Channel {
4767        self.client.into_channel()
4768    }
4769
4770    fn as_channel(&self) -> &fidl::Channel {
4771        self.client.as_channel()
4772    }
4773}
4774
4775#[cfg(target_os = "fuchsia")]
4776impl ScheduledScanTransactionSynchronousProxy {
4777    pub fn new(channel: fidl::Channel) -> Self {
4778        Self { client: fidl::client::sync::Client::new(channel) }
4779    }
4780
4781    pub fn into_channel(self) -> fidl::Channel {
4782        self.client.into_channel()
4783    }
4784
4785    /// Waits until an event arrives and returns it. It is safe for other
4786    /// threads to make concurrent requests while waiting for an event.
4787    pub fn wait_for_event(
4788        &self,
4789        deadline: zx::MonotonicInstant,
4790    ) -> Result<ScheduledScanTransactionEvent, fidl::Error> {
4791        ScheduledScanTransactionEvent::decode(
4792            self.client.wait_for_event::<ScheduledScanTransactionMarker>(deadline)?,
4793        )
4794    }
4795}
4796
4797#[cfg(target_os = "fuchsia")]
4798impl From<ScheduledScanTransactionSynchronousProxy> for zx::NullableHandle {
4799    fn from(value: ScheduledScanTransactionSynchronousProxy) -> Self {
4800        value.into_channel().into()
4801    }
4802}
4803
4804#[cfg(target_os = "fuchsia")]
4805impl From<fidl::Channel> for ScheduledScanTransactionSynchronousProxy {
4806    fn from(value: fidl::Channel) -> Self {
4807        Self::new(value)
4808    }
4809}
4810
4811#[cfg(target_os = "fuchsia")]
4812impl fidl::endpoints::FromClient for ScheduledScanTransactionSynchronousProxy {
4813    type Protocol = ScheduledScanTransactionMarker;
4814
4815    fn from_client(value: fidl::endpoints::ClientEnd<ScheduledScanTransactionMarker>) -> Self {
4816        Self::new(value.into_channel())
4817    }
4818}
4819
4820#[derive(Debug, Clone)]
4821pub struct ScheduledScanTransactionProxy {
4822    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4823}
4824
4825impl fidl::endpoints::Proxy for ScheduledScanTransactionProxy {
4826    type Protocol = ScheduledScanTransactionMarker;
4827
4828    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4829        Self::new(inner)
4830    }
4831
4832    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4833        self.client.into_channel().map_err(|client| Self { client })
4834    }
4835
4836    fn as_channel(&self) -> &::fidl::AsyncChannel {
4837        self.client.as_channel()
4838    }
4839}
4840
4841impl ScheduledScanTransactionProxy {
4842    /// Create a new Proxy for fuchsia.wlan.sme/ScheduledScanTransaction.
4843    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4844        let protocol_name =
4845            <ScheduledScanTransactionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4846        Self { client: fidl::client::Client::new(channel, protocol_name) }
4847    }
4848
4849    /// Get a Stream of events from the remote end of the protocol.
4850    ///
4851    /// # Panics
4852    ///
4853    /// Panics if the event stream was already taken.
4854    pub fn take_event_stream(&self) -> ScheduledScanTransactionEventStream {
4855        ScheduledScanTransactionEventStream { event_receiver: self.client.take_event_receiver() }
4856    }
4857}
4858
4859impl ScheduledScanTransactionProxyInterface for ScheduledScanTransactionProxy {}
4860
4861pub struct ScheduledScanTransactionEventStream {
4862    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4863}
4864
4865impl std::marker::Unpin for ScheduledScanTransactionEventStream {}
4866
4867impl futures::stream::FusedStream for ScheduledScanTransactionEventStream {
4868    fn is_terminated(&self) -> bool {
4869        self.event_receiver.is_terminated()
4870    }
4871}
4872
4873impl futures::Stream for ScheduledScanTransactionEventStream {
4874    type Item = Result<ScheduledScanTransactionEvent, fidl::Error>;
4875
4876    fn poll_next(
4877        mut self: std::pin::Pin<&mut Self>,
4878        cx: &mut std::task::Context<'_>,
4879    ) -> std::task::Poll<Option<Self::Item>> {
4880        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4881            &mut self.event_receiver,
4882            cx
4883        )?) {
4884            Some(buf) => std::task::Poll::Ready(Some(ScheduledScanTransactionEvent::decode(buf))),
4885            None => std::task::Poll::Ready(None),
4886        }
4887    }
4888}
4889
4890#[derive(Debug)]
4891pub enum ScheduledScanTransactionEvent {
4892    OnScheduledScanMatchesAvailable { scan_results: fidl::Vmo },
4893}
4894
4895impl ScheduledScanTransactionEvent {
4896    #[allow(irrefutable_let_patterns)]
4897    pub fn into_on_scheduled_scan_matches_available(self) -> Option<fidl::Vmo> {
4898        if let ScheduledScanTransactionEvent::OnScheduledScanMatchesAvailable { scan_results } =
4899            self
4900        {
4901            Some((scan_results))
4902        } else {
4903            None
4904        }
4905    }
4906
4907    /// Decodes a message buffer as a [`ScheduledScanTransactionEvent`].
4908    fn decode(
4909        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4910    ) -> Result<ScheduledScanTransactionEvent, fidl::Error> {
4911        let (bytes, _handles) = buf.split_mut();
4912        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4913        debug_assert_eq!(tx_header.tx_id, 0);
4914        match tx_header.ordinal {
4915            0x49ff004527d01bd8 => {
4916                let mut out = fidl::new_empty!(
4917                    ScheduledScanTransactionOnScheduledScanMatchesAvailableRequest,
4918                    fidl::encoding::DefaultFuchsiaResourceDialect
4919                );
4920                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ScheduledScanTransactionOnScheduledScanMatchesAvailableRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
4921                Ok((ScheduledScanTransactionEvent::OnScheduledScanMatchesAvailable {
4922                    scan_results: out.scan_results,
4923                }))
4924            }
4925            _ => Err(fidl::Error::UnknownOrdinal {
4926                ordinal: tx_header.ordinal,
4927                protocol_name:
4928                    <ScheduledScanTransactionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4929            }),
4930        }
4931    }
4932}
4933
4934/// A Stream of incoming requests for fuchsia.wlan.sme/ScheduledScanTransaction.
4935pub struct ScheduledScanTransactionRequestStream {
4936    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4937    is_terminated: bool,
4938}
4939
4940impl std::marker::Unpin for ScheduledScanTransactionRequestStream {}
4941
4942impl futures::stream::FusedStream for ScheduledScanTransactionRequestStream {
4943    fn is_terminated(&self) -> bool {
4944        self.is_terminated
4945    }
4946}
4947
4948impl fidl::endpoints::RequestStream for ScheduledScanTransactionRequestStream {
4949    type Protocol = ScheduledScanTransactionMarker;
4950    type ControlHandle = ScheduledScanTransactionControlHandle;
4951
4952    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4953        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4954    }
4955
4956    fn control_handle(&self) -> Self::ControlHandle {
4957        ScheduledScanTransactionControlHandle { inner: self.inner.clone() }
4958    }
4959
4960    fn into_inner(
4961        self,
4962    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4963    {
4964        (self.inner, self.is_terminated)
4965    }
4966
4967    fn from_inner(
4968        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4969        is_terminated: bool,
4970    ) -> Self {
4971        Self { inner, is_terminated }
4972    }
4973}
4974
4975impl futures::Stream for ScheduledScanTransactionRequestStream {
4976    type Item = Result<ScheduledScanTransactionRequest, fidl::Error>;
4977
4978    fn poll_next(
4979        mut self: std::pin::Pin<&mut Self>,
4980        cx: &mut std::task::Context<'_>,
4981    ) -> std::task::Poll<Option<Self::Item>> {
4982        let this = &mut *self;
4983        if this.inner.check_shutdown(cx) {
4984            this.is_terminated = true;
4985            return std::task::Poll::Ready(None);
4986        }
4987        if this.is_terminated {
4988            panic!("polled ScheduledScanTransactionRequestStream after completion");
4989        }
4990        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4991            |bytes, handles| {
4992                match this.inner.channel().read_etc(cx, bytes, handles) {
4993                    std::task::Poll::Ready(Ok(())) => {}
4994                    std::task::Poll::Pending => return std::task::Poll::Pending,
4995                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4996                        this.is_terminated = true;
4997                        return std::task::Poll::Ready(None);
4998                    }
4999                    std::task::Poll::Ready(Err(e)) => {
5000                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5001                            e.into(),
5002                        ))));
5003                    }
5004                }
5005
5006                // A message has been received from the channel
5007                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5008
5009                std::task::Poll::Ready(Some(match header.ordinal {
5010                _ => Err(fidl::Error::UnknownOrdinal {
5011                    ordinal: header.ordinal,
5012                    protocol_name: <ScheduledScanTransactionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5013                }),
5014            }))
5015            },
5016        )
5017    }
5018}
5019
5020/// Transaction channel for a scheduled scan operation. To cancel a scheduled scan, drop this
5021/// channel. If the scan is canceled by the driver/firmware, this channel will be closed by SME.
5022#[derive(Debug)]
5023pub enum ScheduledScanTransactionRequest {}
5024
5025impl ScheduledScanTransactionRequest {
5026    /// Name of the method defined in FIDL
5027    pub fn method_name(&self) -> &'static str {
5028        match *self {}
5029    }
5030}
5031
5032#[derive(Debug, Clone)]
5033pub struct ScheduledScanTransactionControlHandle {
5034    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5035}
5036
5037impl ScheduledScanTransactionControlHandle {
5038    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
5039        self.inner.shutdown_with_epitaph(status.into())
5040    }
5041}
5042
5043impl fidl::endpoints::ControlHandle for ScheduledScanTransactionControlHandle {
5044    fn shutdown(&self) {
5045        self.inner.shutdown()
5046    }
5047
5048    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
5049        self.inner.shutdown_with_epitaph(status)
5050    }
5051
5052    fn is_closed(&self) -> bool {
5053        self.inner.channel().is_closed()
5054    }
5055    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5056        self.inner.channel().on_closed()
5057    }
5058
5059    #[cfg(target_os = "fuchsia")]
5060    fn signal_peer(
5061        &self,
5062        clear_mask: zx::Signals,
5063        set_mask: zx::Signals,
5064    ) -> Result<(), zx_status::Status> {
5065        use fidl::Peered;
5066        self.inner.channel().signal_peer(clear_mask, set_mask)
5067    }
5068}
5069
5070impl ScheduledScanTransactionControlHandle {
5071    pub fn send_on_scheduled_scan_matches_available(
5072        &self,
5073        mut scan_results: fidl::Vmo,
5074    ) -> Result<(), fidl::Error> {
5075        self.inner.send::<ScheduledScanTransactionOnScheduledScanMatchesAvailableRequest>(
5076            (scan_results,),
5077            0,
5078            0x49ff004527d01bd8,
5079            fidl::encoding::DynamicFlags::empty(),
5080        )
5081    }
5082}
5083
5084#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5085pub struct TelemetryMarker;
5086
5087impl fidl::endpoints::ProtocolMarker for TelemetryMarker {
5088    type Proxy = TelemetryProxy;
5089    type RequestStream = TelemetryRequestStream;
5090    #[cfg(target_os = "fuchsia")]
5091    type SynchronousProxy = TelemetrySynchronousProxy;
5092
5093    const DEBUG_NAME: &'static str = "(anonymous) Telemetry";
5094}
5095pub type TelemetryQueryTelemetrySupportResult =
5096    Result<fidl_fuchsia_wlan_stats::TelemetrySupport, i32>;
5097pub type TelemetryGetIfaceStatsResult = Result<fidl_fuchsia_wlan_stats::IfaceStats, i32>;
5098pub type TelemetryGetHistogramStatsResult =
5099    Result<fidl_fuchsia_wlan_stats::IfaceHistogramStats, i32>;
5100pub type TelemetryGetSignalReportResult = Result<fidl_fuchsia_wlan_stats::SignalReport, i32>;
5101pub type TelemetryCloneInspectVmoResult = Result<fidl::Vmo, i32>;
5102
5103pub trait TelemetryProxyInterface: Send + Sync {
5104    type QueryTelemetrySupportResponseFut: std::future::Future<Output = Result<TelemetryQueryTelemetrySupportResult, fidl::Error>>
5105        + Send;
5106    fn r#query_telemetry_support(&self) -> Self::QueryTelemetrySupportResponseFut;
5107    type GetIfaceStatsResponseFut: std::future::Future<Output = Result<TelemetryGetIfaceStatsResult, fidl::Error>>
5108        + Send;
5109    fn r#get_iface_stats(&self) -> Self::GetIfaceStatsResponseFut;
5110    type GetHistogramStatsResponseFut: std::future::Future<Output = Result<TelemetryGetHistogramStatsResult, fidl::Error>>
5111        + Send;
5112    fn r#get_histogram_stats(&self) -> Self::GetHistogramStatsResponseFut;
5113    type GetSignalReportResponseFut: std::future::Future<Output = Result<TelemetryGetSignalReportResult, fidl::Error>>
5114        + Send;
5115    fn r#get_signal_report(&self) -> Self::GetSignalReportResponseFut;
5116    type CloneInspectVmoResponseFut: std::future::Future<Output = Result<TelemetryCloneInspectVmoResult, fidl::Error>>
5117        + Send;
5118    fn r#clone_inspect_vmo(&self) -> Self::CloneInspectVmoResponseFut;
5119}
5120#[derive(Debug)]
5121#[cfg(target_os = "fuchsia")]
5122pub struct TelemetrySynchronousProxy {
5123    client: fidl::client::sync::Client,
5124}
5125
5126#[cfg(target_os = "fuchsia")]
5127impl fidl::endpoints::SynchronousProxy for TelemetrySynchronousProxy {
5128    type Proxy = TelemetryProxy;
5129    type Protocol = TelemetryMarker;
5130
5131    fn from_channel(inner: fidl::Channel) -> Self {
5132        Self::new(inner)
5133    }
5134
5135    fn into_channel(self) -> fidl::Channel {
5136        self.client.into_channel()
5137    }
5138
5139    fn as_channel(&self) -> &fidl::Channel {
5140        self.client.as_channel()
5141    }
5142}
5143
5144#[cfg(target_os = "fuchsia")]
5145impl TelemetrySynchronousProxy {
5146    pub fn new(channel: fidl::Channel) -> Self {
5147        Self { client: fidl::client::sync::Client::new(channel) }
5148    }
5149
5150    pub fn into_channel(self) -> fidl::Channel {
5151        self.client.into_channel()
5152    }
5153
5154    /// Waits until an event arrives and returns it. It is safe for other
5155    /// threads to make concurrent requests while waiting for an event.
5156    pub fn wait_for_event(
5157        &self,
5158        deadline: zx::MonotonicInstant,
5159    ) -> Result<TelemetryEvent, fidl::Error> {
5160        TelemetryEvent::decode(self.client.wait_for_event::<TelemetryMarker>(deadline)?)
5161    }
5162
5163    pub fn r#query_telemetry_support(
5164        &self,
5165        ___deadline: zx::MonotonicInstant,
5166    ) -> Result<TelemetryQueryTelemetrySupportResult, fidl::Error> {
5167        let _response = self.client.send_query::<
5168            fidl::encoding::EmptyPayload,
5169            fidl::encoding::ResultType<TelemetryQueryTelemetrySupportResponse, i32>,
5170            TelemetryMarker,
5171        >(
5172            (),
5173            0x69443ad35b204686,
5174            fidl::encoding::DynamicFlags::empty(),
5175            ___deadline,
5176        )?;
5177        Ok(_response.map(|x| x.resp))
5178    }
5179
5180    pub fn r#get_iface_stats(
5181        &self,
5182        ___deadline: zx::MonotonicInstant,
5183    ) -> Result<TelemetryGetIfaceStatsResult, fidl::Error> {
5184        let _response = self.client.send_query::<
5185            fidl::encoding::EmptyPayload,
5186            fidl::encoding::ResultType<TelemetryGetIfaceStatsResponse, i32>,
5187            TelemetryMarker,
5188        >(
5189            (),
5190            0x6af057f3a017f572,
5191            fidl::encoding::DynamicFlags::empty(),
5192            ___deadline,
5193        )?;
5194        Ok(_response.map(|x| x.stats))
5195    }
5196
5197    pub fn r#get_histogram_stats(
5198        &self,
5199        ___deadline: zx::MonotonicInstant,
5200    ) -> Result<TelemetryGetHistogramStatsResult, fidl::Error> {
5201        let _response = self.client.send_query::<
5202            fidl::encoding::EmptyPayload,
5203            fidl::encoding::ResultType<TelemetryGetHistogramStatsResponse, i32>,
5204            TelemetryMarker,
5205        >(
5206            (),
5207            0x46d2b6a23f764564,
5208            fidl::encoding::DynamicFlags::empty(),
5209            ___deadline,
5210        )?;
5211        Ok(_response.map(|x| x.stats))
5212    }
5213
5214    pub fn r#get_signal_report(
5215        &self,
5216        ___deadline: zx::MonotonicInstant,
5217    ) -> Result<TelemetryGetSignalReportResult, fidl::Error> {
5218        let _response = self.client.send_query::<
5219            fidl::encoding::EmptyPayload,
5220            fidl::encoding::ResultType<TelemetryGetSignalReportResponse, i32>,
5221            TelemetryMarker,
5222        >(
5223            (),
5224            0x24133aeac3225e28,
5225            fidl::encoding::DynamicFlags::empty(),
5226            ___deadline,
5227        )?;
5228        Ok(_response.map(|x| x.stats))
5229    }
5230
5231    pub fn r#clone_inspect_vmo(
5232        &self,
5233        ___deadline: zx::MonotonicInstant,
5234    ) -> Result<TelemetryCloneInspectVmoResult, fidl::Error> {
5235        let _response = self.client.send_query::<
5236            fidl::encoding::EmptyPayload,
5237            fidl::encoding::ResultType<TelemetryCloneInspectVmoResponse, i32>,
5238            TelemetryMarker,
5239        >(
5240            (),
5241            0x47153917e84c5a21,
5242            fidl::encoding::DynamicFlags::empty(),
5243            ___deadline,
5244        )?;
5245        Ok(_response.map(|x| x.inspect_vmo))
5246    }
5247}
5248
5249#[cfg(target_os = "fuchsia")]
5250impl From<TelemetrySynchronousProxy> for zx::NullableHandle {
5251    fn from(value: TelemetrySynchronousProxy) -> Self {
5252        value.into_channel().into()
5253    }
5254}
5255
5256#[cfg(target_os = "fuchsia")]
5257impl From<fidl::Channel> for TelemetrySynchronousProxy {
5258    fn from(value: fidl::Channel) -> Self {
5259        Self::new(value)
5260    }
5261}
5262
5263#[cfg(target_os = "fuchsia")]
5264impl fidl::endpoints::FromClient for TelemetrySynchronousProxy {
5265    type Protocol = TelemetryMarker;
5266
5267    fn from_client(value: fidl::endpoints::ClientEnd<TelemetryMarker>) -> Self {
5268        Self::new(value.into_channel())
5269    }
5270}
5271
5272#[derive(Debug, Clone)]
5273pub struct TelemetryProxy {
5274    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5275}
5276
5277impl fidl::endpoints::Proxy for TelemetryProxy {
5278    type Protocol = TelemetryMarker;
5279
5280    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5281        Self::new(inner)
5282    }
5283
5284    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5285        self.client.into_channel().map_err(|client| Self { client })
5286    }
5287
5288    fn as_channel(&self) -> &::fidl::AsyncChannel {
5289        self.client.as_channel()
5290    }
5291}
5292
5293impl TelemetryProxy {
5294    /// Create a new Proxy for fuchsia.wlan.sme/Telemetry.
5295    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5296        let protocol_name = <TelemetryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5297        Self { client: fidl::client::Client::new(channel, protocol_name) }
5298    }
5299
5300    /// Get a Stream of events from the remote end of the protocol.
5301    ///
5302    /// # Panics
5303    ///
5304    /// Panics if the event stream was already taken.
5305    pub fn take_event_stream(&self) -> TelemetryEventStream {
5306        TelemetryEventStream { event_receiver: self.client.take_event_receiver() }
5307    }
5308
5309    pub fn r#query_telemetry_support(
5310        &self,
5311    ) -> fidl::client::QueryResponseFut<
5312        TelemetryQueryTelemetrySupportResult,
5313        fidl::encoding::DefaultFuchsiaResourceDialect,
5314    > {
5315        TelemetryProxyInterface::r#query_telemetry_support(self)
5316    }
5317
5318    pub fn r#get_iface_stats(
5319        &self,
5320    ) -> fidl::client::QueryResponseFut<
5321        TelemetryGetIfaceStatsResult,
5322        fidl::encoding::DefaultFuchsiaResourceDialect,
5323    > {
5324        TelemetryProxyInterface::r#get_iface_stats(self)
5325    }
5326
5327    pub fn r#get_histogram_stats(
5328        &self,
5329    ) -> fidl::client::QueryResponseFut<
5330        TelemetryGetHistogramStatsResult,
5331        fidl::encoding::DefaultFuchsiaResourceDialect,
5332    > {
5333        TelemetryProxyInterface::r#get_histogram_stats(self)
5334    }
5335
5336    pub fn r#get_signal_report(
5337        &self,
5338    ) -> fidl::client::QueryResponseFut<
5339        TelemetryGetSignalReportResult,
5340        fidl::encoding::DefaultFuchsiaResourceDialect,
5341    > {
5342        TelemetryProxyInterface::r#get_signal_report(self)
5343    }
5344
5345    pub fn r#clone_inspect_vmo(
5346        &self,
5347    ) -> fidl::client::QueryResponseFut<
5348        TelemetryCloneInspectVmoResult,
5349        fidl::encoding::DefaultFuchsiaResourceDialect,
5350    > {
5351        TelemetryProxyInterface::r#clone_inspect_vmo(self)
5352    }
5353}
5354
5355impl TelemetryProxyInterface for TelemetryProxy {
5356    type QueryTelemetrySupportResponseFut = fidl::client::QueryResponseFut<
5357        TelemetryQueryTelemetrySupportResult,
5358        fidl::encoding::DefaultFuchsiaResourceDialect,
5359    >;
5360    fn r#query_telemetry_support(&self) -> Self::QueryTelemetrySupportResponseFut {
5361        fn _decode(
5362            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5363        ) -> Result<TelemetryQueryTelemetrySupportResult, fidl::Error> {
5364            let _response = fidl::client::decode_transaction_body::<
5365                fidl::encoding::ResultType<TelemetryQueryTelemetrySupportResponse, i32>,
5366                fidl::encoding::DefaultFuchsiaResourceDialect,
5367                0x69443ad35b204686,
5368            >(_buf?)?;
5369            Ok(_response.map(|x| x.resp))
5370        }
5371        self.client.send_query_and_decode::<
5372            fidl::encoding::EmptyPayload,
5373            TelemetryQueryTelemetrySupportResult,
5374        >(
5375            (),
5376            0x69443ad35b204686,
5377            fidl::encoding::DynamicFlags::empty(),
5378            _decode,
5379        )
5380    }
5381
5382    type GetIfaceStatsResponseFut = fidl::client::QueryResponseFut<
5383        TelemetryGetIfaceStatsResult,
5384        fidl::encoding::DefaultFuchsiaResourceDialect,
5385    >;
5386    fn r#get_iface_stats(&self) -> Self::GetIfaceStatsResponseFut {
5387        fn _decode(
5388            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5389        ) -> Result<TelemetryGetIfaceStatsResult, fidl::Error> {
5390            let _response = fidl::client::decode_transaction_body::<
5391                fidl::encoding::ResultType<TelemetryGetIfaceStatsResponse, i32>,
5392                fidl::encoding::DefaultFuchsiaResourceDialect,
5393                0x6af057f3a017f572,
5394            >(_buf?)?;
5395            Ok(_response.map(|x| x.stats))
5396        }
5397        self.client
5398            .send_query_and_decode::<fidl::encoding::EmptyPayload, TelemetryGetIfaceStatsResult>(
5399                (),
5400                0x6af057f3a017f572,
5401                fidl::encoding::DynamicFlags::empty(),
5402                _decode,
5403            )
5404    }
5405
5406    type GetHistogramStatsResponseFut = fidl::client::QueryResponseFut<
5407        TelemetryGetHistogramStatsResult,
5408        fidl::encoding::DefaultFuchsiaResourceDialect,
5409    >;
5410    fn r#get_histogram_stats(&self) -> Self::GetHistogramStatsResponseFut {
5411        fn _decode(
5412            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5413        ) -> Result<TelemetryGetHistogramStatsResult, fidl::Error> {
5414            let _response = fidl::client::decode_transaction_body::<
5415                fidl::encoding::ResultType<TelemetryGetHistogramStatsResponse, i32>,
5416                fidl::encoding::DefaultFuchsiaResourceDialect,
5417                0x46d2b6a23f764564,
5418            >(_buf?)?;
5419            Ok(_response.map(|x| x.stats))
5420        }
5421        self.client.send_query_and_decode::<
5422            fidl::encoding::EmptyPayload,
5423            TelemetryGetHistogramStatsResult,
5424        >(
5425            (),
5426            0x46d2b6a23f764564,
5427            fidl::encoding::DynamicFlags::empty(),
5428            _decode,
5429        )
5430    }
5431
5432    type GetSignalReportResponseFut = fidl::client::QueryResponseFut<
5433        TelemetryGetSignalReportResult,
5434        fidl::encoding::DefaultFuchsiaResourceDialect,
5435    >;
5436    fn r#get_signal_report(&self) -> Self::GetSignalReportResponseFut {
5437        fn _decode(
5438            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5439        ) -> Result<TelemetryGetSignalReportResult, fidl::Error> {
5440            let _response = fidl::client::decode_transaction_body::<
5441                fidl::encoding::ResultType<TelemetryGetSignalReportResponse, i32>,
5442                fidl::encoding::DefaultFuchsiaResourceDialect,
5443                0x24133aeac3225e28,
5444            >(_buf?)?;
5445            Ok(_response.map(|x| x.stats))
5446        }
5447        self.client
5448            .send_query_and_decode::<fidl::encoding::EmptyPayload, TelemetryGetSignalReportResult>(
5449                (),
5450                0x24133aeac3225e28,
5451                fidl::encoding::DynamicFlags::empty(),
5452                _decode,
5453            )
5454    }
5455
5456    type CloneInspectVmoResponseFut = fidl::client::QueryResponseFut<
5457        TelemetryCloneInspectVmoResult,
5458        fidl::encoding::DefaultFuchsiaResourceDialect,
5459    >;
5460    fn r#clone_inspect_vmo(&self) -> Self::CloneInspectVmoResponseFut {
5461        fn _decode(
5462            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5463        ) -> Result<TelemetryCloneInspectVmoResult, fidl::Error> {
5464            let _response = fidl::client::decode_transaction_body::<
5465                fidl::encoding::ResultType<TelemetryCloneInspectVmoResponse, i32>,
5466                fidl::encoding::DefaultFuchsiaResourceDialect,
5467                0x47153917e84c5a21,
5468            >(_buf?)?;
5469            Ok(_response.map(|x| x.inspect_vmo))
5470        }
5471        self.client
5472            .send_query_and_decode::<fidl::encoding::EmptyPayload, TelemetryCloneInspectVmoResult>(
5473                (),
5474                0x47153917e84c5a21,
5475                fidl::encoding::DynamicFlags::empty(),
5476                _decode,
5477            )
5478    }
5479}
5480
5481pub struct TelemetryEventStream {
5482    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5483}
5484
5485impl std::marker::Unpin for TelemetryEventStream {}
5486
5487impl futures::stream::FusedStream for TelemetryEventStream {
5488    fn is_terminated(&self) -> bool {
5489        self.event_receiver.is_terminated()
5490    }
5491}
5492
5493impl futures::Stream for TelemetryEventStream {
5494    type Item = Result<TelemetryEvent, fidl::Error>;
5495
5496    fn poll_next(
5497        mut self: std::pin::Pin<&mut Self>,
5498        cx: &mut std::task::Context<'_>,
5499    ) -> std::task::Poll<Option<Self::Item>> {
5500        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5501            &mut self.event_receiver,
5502            cx
5503        )?) {
5504            Some(buf) => std::task::Poll::Ready(Some(TelemetryEvent::decode(buf))),
5505            None => std::task::Poll::Ready(None),
5506        }
5507    }
5508}
5509
5510#[derive(Debug)]
5511pub enum TelemetryEvent {}
5512
5513impl TelemetryEvent {
5514    /// Decodes a message buffer as a [`TelemetryEvent`].
5515    fn decode(
5516        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5517    ) -> Result<TelemetryEvent, fidl::Error> {
5518        let (bytes, _handles) = buf.split_mut();
5519        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5520        debug_assert_eq!(tx_header.tx_id, 0);
5521        match tx_header.ordinal {
5522            _ => Err(fidl::Error::UnknownOrdinal {
5523                ordinal: tx_header.ordinal,
5524                protocol_name: <TelemetryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5525            }),
5526        }
5527    }
5528}
5529
5530/// A Stream of incoming requests for fuchsia.wlan.sme/Telemetry.
5531pub struct TelemetryRequestStream {
5532    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5533    is_terminated: bool,
5534}
5535
5536impl std::marker::Unpin for TelemetryRequestStream {}
5537
5538impl futures::stream::FusedStream for TelemetryRequestStream {
5539    fn is_terminated(&self) -> bool {
5540        self.is_terminated
5541    }
5542}
5543
5544impl fidl::endpoints::RequestStream for TelemetryRequestStream {
5545    type Protocol = TelemetryMarker;
5546    type ControlHandle = TelemetryControlHandle;
5547
5548    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5549        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5550    }
5551
5552    fn control_handle(&self) -> Self::ControlHandle {
5553        TelemetryControlHandle { inner: self.inner.clone() }
5554    }
5555
5556    fn into_inner(
5557        self,
5558    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5559    {
5560        (self.inner, self.is_terminated)
5561    }
5562
5563    fn from_inner(
5564        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5565        is_terminated: bool,
5566    ) -> Self {
5567        Self { inner, is_terminated }
5568    }
5569}
5570
5571impl futures::Stream for TelemetryRequestStream {
5572    type Item = Result<TelemetryRequest, fidl::Error>;
5573
5574    fn poll_next(
5575        mut self: std::pin::Pin<&mut Self>,
5576        cx: &mut std::task::Context<'_>,
5577    ) -> std::task::Poll<Option<Self::Item>> {
5578        let this = &mut *self;
5579        if this.inner.check_shutdown(cx) {
5580            this.is_terminated = true;
5581            return std::task::Poll::Ready(None);
5582        }
5583        if this.is_terminated {
5584            panic!("polled TelemetryRequestStream after completion");
5585        }
5586        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5587            |bytes, handles| {
5588                match this.inner.channel().read_etc(cx, bytes, handles) {
5589                    std::task::Poll::Ready(Ok(())) => {}
5590                    std::task::Poll::Pending => return std::task::Poll::Pending,
5591                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5592                        this.is_terminated = true;
5593                        return std::task::Poll::Ready(None);
5594                    }
5595                    std::task::Poll::Ready(Err(e)) => {
5596                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5597                            e.into(),
5598                        ))));
5599                    }
5600                }
5601
5602                // A message has been received from the channel
5603                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5604
5605                std::task::Poll::Ready(Some(match header.ordinal {
5606                    0x69443ad35b204686 => {
5607                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5608                        let mut req = fidl::new_empty!(
5609                            fidl::encoding::EmptyPayload,
5610                            fidl::encoding::DefaultFuchsiaResourceDialect
5611                        );
5612                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5613                        let control_handle = TelemetryControlHandle { inner: this.inner.clone() };
5614                        Ok(TelemetryRequest::QueryTelemetrySupport {
5615                            responder: TelemetryQueryTelemetrySupportResponder {
5616                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5617                                tx_id: header.tx_id,
5618                            },
5619                        })
5620                    }
5621                    0x6af057f3a017f572 => {
5622                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5623                        let mut req = fidl::new_empty!(
5624                            fidl::encoding::EmptyPayload,
5625                            fidl::encoding::DefaultFuchsiaResourceDialect
5626                        );
5627                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5628                        let control_handle = TelemetryControlHandle { inner: this.inner.clone() };
5629                        Ok(TelemetryRequest::GetIfaceStats {
5630                            responder: TelemetryGetIfaceStatsResponder {
5631                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5632                                tx_id: header.tx_id,
5633                            },
5634                        })
5635                    }
5636                    0x46d2b6a23f764564 => {
5637                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5638                        let mut req = fidl::new_empty!(
5639                            fidl::encoding::EmptyPayload,
5640                            fidl::encoding::DefaultFuchsiaResourceDialect
5641                        );
5642                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5643                        let control_handle = TelemetryControlHandle { inner: this.inner.clone() };
5644                        Ok(TelemetryRequest::GetHistogramStats {
5645                            responder: TelemetryGetHistogramStatsResponder {
5646                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5647                                tx_id: header.tx_id,
5648                            },
5649                        })
5650                    }
5651                    0x24133aeac3225e28 => {
5652                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5653                        let mut req = fidl::new_empty!(
5654                            fidl::encoding::EmptyPayload,
5655                            fidl::encoding::DefaultFuchsiaResourceDialect
5656                        );
5657                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5658                        let control_handle = TelemetryControlHandle { inner: this.inner.clone() };
5659                        Ok(TelemetryRequest::GetSignalReport {
5660                            responder: TelemetryGetSignalReportResponder {
5661                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5662                                tx_id: header.tx_id,
5663                            },
5664                        })
5665                    }
5666                    0x47153917e84c5a21 => {
5667                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5668                        let mut req = fidl::new_empty!(
5669                            fidl::encoding::EmptyPayload,
5670                            fidl::encoding::DefaultFuchsiaResourceDialect
5671                        );
5672                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5673                        let control_handle = TelemetryControlHandle { inner: this.inner.clone() };
5674                        Ok(TelemetryRequest::CloneInspectVmo {
5675                            responder: TelemetryCloneInspectVmoResponder {
5676                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5677                                tx_id: header.tx_id,
5678                            },
5679                        })
5680                    }
5681                    _ => Err(fidl::Error::UnknownOrdinal {
5682                        ordinal: header.ordinal,
5683                        protocol_name:
5684                            <TelemetryMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5685                    }),
5686                }))
5687            },
5688        )
5689    }
5690}
5691
5692#[derive(Debug)]
5693pub enum TelemetryRequest {
5694    QueryTelemetrySupport { responder: TelemetryQueryTelemetrySupportResponder },
5695    GetIfaceStats { responder: TelemetryGetIfaceStatsResponder },
5696    GetHistogramStats { responder: TelemetryGetHistogramStatsResponder },
5697    GetSignalReport { responder: TelemetryGetSignalReportResponder },
5698    CloneInspectVmo { responder: TelemetryCloneInspectVmoResponder },
5699}
5700
5701impl TelemetryRequest {
5702    #[allow(irrefutable_let_patterns)]
5703    pub fn into_query_telemetry_support(self) -> Option<(TelemetryQueryTelemetrySupportResponder)> {
5704        if let TelemetryRequest::QueryTelemetrySupport { responder } = self {
5705            Some((responder))
5706        } else {
5707            None
5708        }
5709    }
5710
5711    #[allow(irrefutable_let_patterns)]
5712    pub fn into_get_iface_stats(self) -> Option<(TelemetryGetIfaceStatsResponder)> {
5713        if let TelemetryRequest::GetIfaceStats { responder } = self {
5714            Some((responder))
5715        } else {
5716            None
5717        }
5718    }
5719
5720    #[allow(irrefutable_let_patterns)]
5721    pub fn into_get_histogram_stats(self) -> Option<(TelemetryGetHistogramStatsResponder)> {
5722        if let TelemetryRequest::GetHistogramStats { responder } = self {
5723            Some((responder))
5724        } else {
5725            None
5726        }
5727    }
5728
5729    #[allow(irrefutable_let_patterns)]
5730    pub fn into_get_signal_report(self) -> Option<(TelemetryGetSignalReportResponder)> {
5731        if let TelemetryRequest::GetSignalReport { responder } = self {
5732            Some((responder))
5733        } else {
5734            None
5735        }
5736    }
5737
5738    #[allow(irrefutable_let_patterns)]
5739    pub fn into_clone_inspect_vmo(self) -> Option<(TelemetryCloneInspectVmoResponder)> {
5740        if let TelemetryRequest::CloneInspectVmo { responder } = self {
5741            Some((responder))
5742        } else {
5743            None
5744        }
5745    }
5746
5747    /// Name of the method defined in FIDL
5748    pub fn method_name(&self) -> &'static str {
5749        match *self {
5750            TelemetryRequest::QueryTelemetrySupport { .. } => "query_telemetry_support",
5751            TelemetryRequest::GetIfaceStats { .. } => "get_iface_stats",
5752            TelemetryRequest::GetHistogramStats { .. } => "get_histogram_stats",
5753            TelemetryRequest::GetSignalReport { .. } => "get_signal_report",
5754            TelemetryRequest::CloneInspectVmo { .. } => "clone_inspect_vmo",
5755        }
5756    }
5757}
5758
5759#[derive(Debug, Clone)]
5760pub struct TelemetryControlHandle {
5761    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5762}
5763
5764impl TelemetryControlHandle {
5765    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
5766        self.inner.shutdown_with_epitaph(status.into())
5767    }
5768}
5769
5770impl fidl::endpoints::ControlHandle for TelemetryControlHandle {
5771    fn shutdown(&self) {
5772        self.inner.shutdown()
5773    }
5774
5775    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
5776        self.inner.shutdown_with_epitaph(status)
5777    }
5778
5779    fn is_closed(&self) -> bool {
5780        self.inner.channel().is_closed()
5781    }
5782    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5783        self.inner.channel().on_closed()
5784    }
5785
5786    #[cfg(target_os = "fuchsia")]
5787    fn signal_peer(
5788        &self,
5789        clear_mask: zx::Signals,
5790        set_mask: zx::Signals,
5791    ) -> Result<(), zx_status::Status> {
5792        use fidl::Peered;
5793        self.inner.channel().signal_peer(clear_mask, set_mask)
5794    }
5795}
5796
5797impl TelemetryControlHandle {}
5798
5799#[must_use = "FIDL methods require a response to be sent"]
5800#[derive(Debug)]
5801pub struct TelemetryQueryTelemetrySupportResponder {
5802    control_handle: std::mem::ManuallyDrop<TelemetryControlHandle>,
5803    tx_id: u32,
5804}
5805
5806/// Set the the channel to be shutdown (see [`TelemetryControlHandle::shutdown`])
5807/// if the responder is dropped without sending a response, so that the client
5808/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5809impl std::ops::Drop for TelemetryQueryTelemetrySupportResponder {
5810    fn drop(&mut self) {
5811        self.control_handle.shutdown();
5812        // Safety: drops once, never accessed again
5813        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5814    }
5815}
5816
5817impl fidl::endpoints::Responder for TelemetryQueryTelemetrySupportResponder {
5818    type ControlHandle = TelemetryControlHandle;
5819
5820    fn control_handle(&self) -> &TelemetryControlHandle {
5821        &self.control_handle
5822    }
5823
5824    fn drop_without_shutdown(mut self) {
5825        // Safety: drops once, never accessed again due to mem::forget
5826        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5827        // Prevent Drop from running (which would shut down the channel)
5828        std::mem::forget(self);
5829    }
5830}
5831
5832impl TelemetryQueryTelemetrySupportResponder {
5833    /// Sends a response to the FIDL transaction.
5834    ///
5835    /// Sets the channel to shutdown if an error occurs.
5836    pub fn send(
5837        self,
5838        mut result: Result<&fidl_fuchsia_wlan_stats::TelemetrySupport, i32>,
5839    ) -> Result<(), fidl::Error> {
5840        let _result = self.send_raw(result);
5841        if _result.is_err() {
5842            self.control_handle.shutdown();
5843        }
5844        self.drop_without_shutdown();
5845        _result
5846    }
5847
5848    /// Similar to "send" but does not shutdown the channel if an error occurs.
5849    pub fn send_no_shutdown_on_err(
5850        self,
5851        mut result: Result<&fidl_fuchsia_wlan_stats::TelemetrySupport, i32>,
5852    ) -> Result<(), fidl::Error> {
5853        let _result = self.send_raw(result);
5854        self.drop_without_shutdown();
5855        _result
5856    }
5857
5858    fn send_raw(
5859        &self,
5860        mut result: Result<&fidl_fuchsia_wlan_stats::TelemetrySupport, i32>,
5861    ) -> Result<(), fidl::Error> {
5862        self.control_handle.inner.send::<fidl::encoding::ResultType<
5863            TelemetryQueryTelemetrySupportResponse,
5864            i32,
5865        >>(
5866            result.map(|resp| (resp,)),
5867            self.tx_id,
5868            0x69443ad35b204686,
5869            fidl::encoding::DynamicFlags::empty(),
5870        )
5871    }
5872}
5873
5874#[must_use = "FIDL methods require a response to be sent"]
5875#[derive(Debug)]
5876pub struct TelemetryGetIfaceStatsResponder {
5877    control_handle: std::mem::ManuallyDrop<TelemetryControlHandle>,
5878    tx_id: u32,
5879}
5880
5881/// Set the the channel to be shutdown (see [`TelemetryControlHandle::shutdown`])
5882/// if the responder is dropped without sending a response, so that the client
5883/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5884impl std::ops::Drop for TelemetryGetIfaceStatsResponder {
5885    fn drop(&mut self) {
5886        self.control_handle.shutdown();
5887        // Safety: drops once, never accessed again
5888        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5889    }
5890}
5891
5892impl fidl::endpoints::Responder for TelemetryGetIfaceStatsResponder {
5893    type ControlHandle = TelemetryControlHandle;
5894
5895    fn control_handle(&self) -> &TelemetryControlHandle {
5896        &self.control_handle
5897    }
5898
5899    fn drop_without_shutdown(mut self) {
5900        // Safety: drops once, never accessed again due to mem::forget
5901        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5902        // Prevent Drop from running (which would shut down the channel)
5903        std::mem::forget(self);
5904    }
5905}
5906
5907impl TelemetryGetIfaceStatsResponder {
5908    /// Sends a response to the FIDL transaction.
5909    ///
5910    /// Sets the channel to shutdown if an error occurs.
5911    pub fn send(
5912        self,
5913        mut result: Result<&fidl_fuchsia_wlan_stats::IfaceStats, i32>,
5914    ) -> Result<(), fidl::Error> {
5915        let _result = self.send_raw(result);
5916        if _result.is_err() {
5917            self.control_handle.shutdown();
5918        }
5919        self.drop_without_shutdown();
5920        _result
5921    }
5922
5923    /// Similar to "send" but does not shutdown the channel if an error occurs.
5924    pub fn send_no_shutdown_on_err(
5925        self,
5926        mut result: Result<&fidl_fuchsia_wlan_stats::IfaceStats, i32>,
5927    ) -> Result<(), fidl::Error> {
5928        let _result = self.send_raw(result);
5929        self.drop_without_shutdown();
5930        _result
5931    }
5932
5933    fn send_raw(
5934        &self,
5935        mut result: Result<&fidl_fuchsia_wlan_stats::IfaceStats, i32>,
5936    ) -> Result<(), fidl::Error> {
5937        self.control_handle
5938            .inner
5939            .send::<fidl::encoding::ResultType<TelemetryGetIfaceStatsResponse, i32>>(
5940                result.map(|stats| (stats,)),
5941                self.tx_id,
5942                0x6af057f3a017f572,
5943                fidl::encoding::DynamicFlags::empty(),
5944            )
5945    }
5946}
5947
5948#[must_use = "FIDL methods require a response to be sent"]
5949#[derive(Debug)]
5950pub struct TelemetryGetHistogramStatsResponder {
5951    control_handle: std::mem::ManuallyDrop<TelemetryControlHandle>,
5952    tx_id: u32,
5953}
5954
5955/// Set the the channel to be shutdown (see [`TelemetryControlHandle::shutdown`])
5956/// if the responder is dropped without sending a response, so that the client
5957/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5958impl std::ops::Drop for TelemetryGetHistogramStatsResponder {
5959    fn drop(&mut self) {
5960        self.control_handle.shutdown();
5961        // Safety: drops once, never accessed again
5962        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5963    }
5964}
5965
5966impl fidl::endpoints::Responder for TelemetryGetHistogramStatsResponder {
5967    type ControlHandle = TelemetryControlHandle;
5968
5969    fn control_handle(&self) -> &TelemetryControlHandle {
5970        &self.control_handle
5971    }
5972
5973    fn drop_without_shutdown(mut self) {
5974        // Safety: drops once, never accessed again due to mem::forget
5975        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5976        // Prevent Drop from running (which would shut down the channel)
5977        std::mem::forget(self);
5978    }
5979}
5980
5981impl TelemetryGetHistogramStatsResponder {
5982    /// Sends a response to the FIDL transaction.
5983    ///
5984    /// Sets the channel to shutdown if an error occurs.
5985    pub fn send(
5986        self,
5987        mut result: Result<&fidl_fuchsia_wlan_stats::IfaceHistogramStats, i32>,
5988    ) -> Result<(), fidl::Error> {
5989        let _result = self.send_raw(result);
5990        if _result.is_err() {
5991            self.control_handle.shutdown();
5992        }
5993        self.drop_without_shutdown();
5994        _result
5995    }
5996
5997    /// Similar to "send" but does not shutdown the channel if an error occurs.
5998    pub fn send_no_shutdown_on_err(
5999        self,
6000        mut result: Result<&fidl_fuchsia_wlan_stats::IfaceHistogramStats, i32>,
6001    ) -> Result<(), fidl::Error> {
6002        let _result = self.send_raw(result);
6003        self.drop_without_shutdown();
6004        _result
6005    }
6006
6007    fn send_raw(
6008        &self,
6009        mut result: Result<&fidl_fuchsia_wlan_stats::IfaceHistogramStats, i32>,
6010    ) -> Result<(), fidl::Error> {
6011        self.control_handle
6012            .inner
6013            .send::<fidl::encoding::ResultType<TelemetryGetHistogramStatsResponse, i32>>(
6014                result.map(|stats| (stats,)),
6015                self.tx_id,
6016                0x46d2b6a23f764564,
6017                fidl::encoding::DynamicFlags::empty(),
6018            )
6019    }
6020}
6021
6022#[must_use = "FIDL methods require a response to be sent"]
6023#[derive(Debug)]
6024pub struct TelemetryGetSignalReportResponder {
6025    control_handle: std::mem::ManuallyDrop<TelemetryControlHandle>,
6026    tx_id: u32,
6027}
6028
6029/// Set the the channel to be shutdown (see [`TelemetryControlHandle::shutdown`])
6030/// if the responder is dropped without sending a response, so that the client
6031/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6032impl std::ops::Drop for TelemetryGetSignalReportResponder {
6033    fn drop(&mut self) {
6034        self.control_handle.shutdown();
6035        // Safety: drops once, never accessed again
6036        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6037    }
6038}
6039
6040impl fidl::endpoints::Responder for TelemetryGetSignalReportResponder {
6041    type ControlHandle = TelemetryControlHandle;
6042
6043    fn control_handle(&self) -> &TelemetryControlHandle {
6044        &self.control_handle
6045    }
6046
6047    fn drop_without_shutdown(mut self) {
6048        // Safety: drops once, never accessed again due to mem::forget
6049        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6050        // Prevent Drop from running (which would shut down the channel)
6051        std::mem::forget(self);
6052    }
6053}
6054
6055impl TelemetryGetSignalReportResponder {
6056    /// Sends a response to the FIDL transaction.
6057    ///
6058    /// Sets the channel to shutdown if an error occurs.
6059    pub fn send(
6060        self,
6061        mut result: Result<&fidl_fuchsia_wlan_stats::SignalReport, i32>,
6062    ) -> Result<(), fidl::Error> {
6063        let _result = self.send_raw(result);
6064        if _result.is_err() {
6065            self.control_handle.shutdown();
6066        }
6067        self.drop_without_shutdown();
6068        _result
6069    }
6070
6071    /// Similar to "send" but does not shutdown the channel if an error occurs.
6072    pub fn send_no_shutdown_on_err(
6073        self,
6074        mut result: Result<&fidl_fuchsia_wlan_stats::SignalReport, i32>,
6075    ) -> Result<(), fidl::Error> {
6076        let _result = self.send_raw(result);
6077        self.drop_without_shutdown();
6078        _result
6079    }
6080
6081    fn send_raw(
6082        &self,
6083        mut result: Result<&fidl_fuchsia_wlan_stats::SignalReport, i32>,
6084    ) -> Result<(), fidl::Error> {
6085        self.control_handle
6086            .inner
6087            .send::<fidl::encoding::ResultType<TelemetryGetSignalReportResponse, i32>>(
6088                result.map(|stats| (stats,)),
6089                self.tx_id,
6090                0x24133aeac3225e28,
6091                fidl::encoding::DynamicFlags::empty(),
6092            )
6093    }
6094}
6095
6096#[must_use = "FIDL methods require a response to be sent"]
6097#[derive(Debug)]
6098pub struct TelemetryCloneInspectVmoResponder {
6099    control_handle: std::mem::ManuallyDrop<TelemetryControlHandle>,
6100    tx_id: u32,
6101}
6102
6103/// Set the the channel to be shutdown (see [`TelemetryControlHandle::shutdown`])
6104/// if the responder is dropped without sending a response, so that the client
6105/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6106impl std::ops::Drop for TelemetryCloneInspectVmoResponder {
6107    fn drop(&mut self) {
6108        self.control_handle.shutdown();
6109        // Safety: drops once, never accessed again
6110        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6111    }
6112}
6113
6114impl fidl::endpoints::Responder for TelemetryCloneInspectVmoResponder {
6115    type ControlHandle = TelemetryControlHandle;
6116
6117    fn control_handle(&self) -> &TelemetryControlHandle {
6118        &self.control_handle
6119    }
6120
6121    fn drop_without_shutdown(mut self) {
6122        // Safety: drops once, never accessed again due to mem::forget
6123        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6124        // Prevent Drop from running (which would shut down the channel)
6125        std::mem::forget(self);
6126    }
6127}
6128
6129impl TelemetryCloneInspectVmoResponder {
6130    /// Sends a response to the FIDL transaction.
6131    ///
6132    /// Sets the channel to shutdown if an error occurs.
6133    pub fn send(self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
6134        let _result = self.send_raw(result);
6135        if _result.is_err() {
6136            self.control_handle.shutdown();
6137        }
6138        self.drop_without_shutdown();
6139        _result
6140    }
6141
6142    /// Similar to "send" but does not shutdown the channel if an error occurs.
6143    pub fn send_no_shutdown_on_err(
6144        self,
6145        mut result: Result<fidl::Vmo, i32>,
6146    ) -> Result<(), fidl::Error> {
6147        let _result = self.send_raw(result);
6148        self.drop_without_shutdown();
6149        _result
6150    }
6151
6152    fn send_raw(&self, mut result: Result<fidl::Vmo, i32>) -> Result<(), fidl::Error> {
6153        self.control_handle
6154            .inner
6155            .send::<fidl::encoding::ResultType<TelemetryCloneInspectVmoResponse, i32>>(
6156                result.map(|inspect_vmo| (inspect_vmo,)),
6157                self.tx_id,
6158                0x47153917e84c5a21,
6159                fidl::encoding::DynamicFlags::empty(),
6160            )
6161    }
6162}
6163
6164#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6165pub struct UsmeBootstrapMarker;
6166
6167impl fidl::endpoints::ProtocolMarker for UsmeBootstrapMarker {
6168    type Proxy = UsmeBootstrapProxy;
6169    type RequestStream = UsmeBootstrapRequestStream;
6170    #[cfg(target_os = "fuchsia")]
6171    type SynchronousProxy = UsmeBootstrapSynchronousProxy;
6172
6173    const DEBUG_NAME: &'static str = "(anonymous) UsmeBootstrap";
6174}
6175
6176pub trait UsmeBootstrapProxyInterface: Send + Sync {
6177    type StartResponseFut: std::future::Future<Output = Result<fidl::Vmo, fidl::Error>> + Send;
6178    fn r#start(
6179        &self,
6180        generic_sme_server: fidl::endpoints::ServerEnd<GenericSmeMarker>,
6181        legacy_privacy_support: &LegacyPrivacySupport,
6182    ) -> Self::StartResponseFut;
6183}
6184#[derive(Debug)]
6185#[cfg(target_os = "fuchsia")]
6186pub struct UsmeBootstrapSynchronousProxy {
6187    client: fidl::client::sync::Client,
6188}
6189
6190#[cfg(target_os = "fuchsia")]
6191impl fidl::endpoints::SynchronousProxy for UsmeBootstrapSynchronousProxy {
6192    type Proxy = UsmeBootstrapProxy;
6193    type Protocol = UsmeBootstrapMarker;
6194
6195    fn from_channel(inner: fidl::Channel) -> Self {
6196        Self::new(inner)
6197    }
6198
6199    fn into_channel(self) -> fidl::Channel {
6200        self.client.into_channel()
6201    }
6202
6203    fn as_channel(&self) -> &fidl::Channel {
6204        self.client.as_channel()
6205    }
6206}
6207
6208#[cfg(target_os = "fuchsia")]
6209impl UsmeBootstrapSynchronousProxy {
6210    pub fn new(channel: fidl::Channel) -> Self {
6211        Self { client: fidl::client::sync::Client::new(channel) }
6212    }
6213
6214    pub fn into_channel(self) -> fidl::Channel {
6215        self.client.into_channel()
6216    }
6217
6218    /// Waits until an event arrives and returns it. It is safe for other
6219    /// threads to make concurrent requests while waiting for an event.
6220    pub fn wait_for_event(
6221        &self,
6222        deadline: zx::MonotonicInstant,
6223    ) -> Result<UsmeBootstrapEvent, fidl::Error> {
6224        UsmeBootstrapEvent::decode(self.client.wait_for_event::<UsmeBootstrapMarker>(deadline)?)
6225    }
6226
6227    pub fn r#start(
6228        &self,
6229        mut generic_sme_server: fidl::endpoints::ServerEnd<GenericSmeMarker>,
6230        mut legacy_privacy_support: &LegacyPrivacySupport,
6231        ___deadline: zx::MonotonicInstant,
6232    ) -> Result<fidl::Vmo, fidl::Error> {
6233        let _response = self.client.send_query::<
6234            UsmeBootstrapStartRequest,
6235            UsmeBootstrapStartResponse,
6236            UsmeBootstrapMarker,
6237        >(
6238            (generic_sme_server, legacy_privacy_support,),
6239            0x58850dfb76c29a0e,
6240            fidl::encoding::DynamicFlags::empty(),
6241            ___deadline,
6242        )?;
6243        Ok(_response.inspect_vmo)
6244    }
6245}
6246
6247#[cfg(target_os = "fuchsia")]
6248impl From<UsmeBootstrapSynchronousProxy> for zx::NullableHandle {
6249    fn from(value: UsmeBootstrapSynchronousProxy) -> Self {
6250        value.into_channel().into()
6251    }
6252}
6253
6254#[cfg(target_os = "fuchsia")]
6255impl From<fidl::Channel> for UsmeBootstrapSynchronousProxy {
6256    fn from(value: fidl::Channel) -> Self {
6257        Self::new(value)
6258    }
6259}
6260
6261#[cfg(target_os = "fuchsia")]
6262impl fidl::endpoints::FromClient for UsmeBootstrapSynchronousProxy {
6263    type Protocol = UsmeBootstrapMarker;
6264
6265    fn from_client(value: fidl::endpoints::ClientEnd<UsmeBootstrapMarker>) -> Self {
6266        Self::new(value.into_channel())
6267    }
6268}
6269
6270#[derive(Debug, Clone)]
6271pub struct UsmeBootstrapProxy {
6272    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6273}
6274
6275impl fidl::endpoints::Proxy for UsmeBootstrapProxy {
6276    type Protocol = UsmeBootstrapMarker;
6277
6278    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6279        Self::new(inner)
6280    }
6281
6282    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6283        self.client.into_channel().map_err(|client| Self { client })
6284    }
6285
6286    fn as_channel(&self) -> &::fidl::AsyncChannel {
6287        self.client.as_channel()
6288    }
6289}
6290
6291impl UsmeBootstrapProxy {
6292    /// Create a new Proxy for fuchsia.wlan.sme/UsmeBootstrap.
6293    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6294        let protocol_name = <UsmeBootstrapMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6295        Self { client: fidl::client::Client::new(channel, protocol_name) }
6296    }
6297
6298    /// Get a Stream of events from the remote end of the protocol.
6299    ///
6300    /// # Panics
6301    ///
6302    /// Panics if the event stream was already taken.
6303    pub fn take_event_stream(&self) -> UsmeBootstrapEventStream {
6304        UsmeBootstrapEventStream { event_receiver: self.client.take_event_receiver() }
6305    }
6306
6307    pub fn r#start(
6308        &self,
6309        mut generic_sme_server: fidl::endpoints::ServerEnd<GenericSmeMarker>,
6310        mut legacy_privacy_support: &LegacyPrivacySupport,
6311    ) -> fidl::client::QueryResponseFut<fidl::Vmo, fidl::encoding::DefaultFuchsiaResourceDialect>
6312    {
6313        UsmeBootstrapProxyInterface::r#start(self, generic_sme_server, legacy_privacy_support)
6314    }
6315}
6316
6317impl UsmeBootstrapProxyInterface for UsmeBootstrapProxy {
6318    type StartResponseFut =
6319        fidl::client::QueryResponseFut<fidl::Vmo, fidl::encoding::DefaultFuchsiaResourceDialect>;
6320    fn r#start(
6321        &self,
6322        mut generic_sme_server: fidl::endpoints::ServerEnd<GenericSmeMarker>,
6323        mut legacy_privacy_support: &LegacyPrivacySupport,
6324    ) -> Self::StartResponseFut {
6325        fn _decode(
6326            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6327        ) -> Result<fidl::Vmo, fidl::Error> {
6328            let _response = fidl::client::decode_transaction_body::<
6329                UsmeBootstrapStartResponse,
6330                fidl::encoding::DefaultFuchsiaResourceDialect,
6331                0x58850dfb76c29a0e,
6332            >(_buf?)?;
6333            Ok(_response.inspect_vmo)
6334        }
6335        self.client.send_query_and_decode::<UsmeBootstrapStartRequest, fidl::Vmo>(
6336            (generic_sme_server, legacy_privacy_support),
6337            0x58850dfb76c29a0e,
6338            fidl::encoding::DynamicFlags::empty(),
6339            _decode,
6340        )
6341    }
6342}
6343
6344pub struct UsmeBootstrapEventStream {
6345    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6346}
6347
6348impl std::marker::Unpin for UsmeBootstrapEventStream {}
6349
6350impl futures::stream::FusedStream for UsmeBootstrapEventStream {
6351    fn is_terminated(&self) -> bool {
6352        self.event_receiver.is_terminated()
6353    }
6354}
6355
6356impl futures::Stream for UsmeBootstrapEventStream {
6357    type Item = Result<UsmeBootstrapEvent, fidl::Error>;
6358
6359    fn poll_next(
6360        mut self: std::pin::Pin<&mut Self>,
6361        cx: &mut std::task::Context<'_>,
6362    ) -> std::task::Poll<Option<Self::Item>> {
6363        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6364            &mut self.event_receiver,
6365            cx
6366        )?) {
6367            Some(buf) => std::task::Poll::Ready(Some(UsmeBootstrapEvent::decode(buf))),
6368            None => std::task::Poll::Ready(None),
6369        }
6370    }
6371}
6372
6373#[derive(Debug)]
6374pub enum UsmeBootstrapEvent {}
6375
6376impl UsmeBootstrapEvent {
6377    /// Decodes a message buffer as a [`UsmeBootstrapEvent`].
6378    fn decode(
6379        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6380    ) -> Result<UsmeBootstrapEvent, fidl::Error> {
6381        let (bytes, _handles) = buf.split_mut();
6382        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6383        debug_assert_eq!(tx_header.tx_id, 0);
6384        match tx_header.ordinal {
6385            _ => Err(fidl::Error::UnknownOrdinal {
6386                ordinal: tx_header.ordinal,
6387                protocol_name: <UsmeBootstrapMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6388            }),
6389        }
6390    }
6391}
6392
6393/// A Stream of incoming requests for fuchsia.wlan.sme/UsmeBootstrap.
6394pub struct UsmeBootstrapRequestStream {
6395    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6396    is_terminated: bool,
6397}
6398
6399impl std::marker::Unpin for UsmeBootstrapRequestStream {}
6400
6401impl futures::stream::FusedStream for UsmeBootstrapRequestStream {
6402    fn is_terminated(&self) -> bool {
6403        self.is_terminated
6404    }
6405}
6406
6407impl fidl::endpoints::RequestStream for UsmeBootstrapRequestStream {
6408    type Protocol = UsmeBootstrapMarker;
6409    type ControlHandle = UsmeBootstrapControlHandle;
6410
6411    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6412        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6413    }
6414
6415    fn control_handle(&self) -> Self::ControlHandle {
6416        UsmeBootstrapControlHandle { inner: self.inner.clone() }
6417    }
6418
6419    fn into_inner(
6420        self,
6421    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6422    {
6423        (self.inner, self.is_terminated)
6424    }
6425
6426    fn from_inner(
6427        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6428        is_terminated: bool,
6429    ) -> Self {
6430        Self { inner, is_terminated }
6431    }
6432}
6433
6434impl futures::Stream for UsmeBootstrapRequestStream {
6435    type Item = Result<UsmeBootstrapRequest, fidl::Error>;
6436
6437    fn poll_next(
6438        mut self: std::pin::Pin<&mut Self>,
6439        cx: &mut std::task::Context<'_>,
6440    ) -> std::task::Poll<Option<Self::Item>> {
6441        let this = &mut *self;
6442        if this.inner.check_shutdown(cx) {
6443            this.is_terminated = true;
6444            return std::task::Poll::Ready(None);
6445        }
6446        if this.is_terminated {
6447            panic!("polled UsmeBootstrapRequestStream after completion");
6448        }
6449        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6450            |bytes, handles| {
6451                match this.inner.channel().read_etc(cx, bytes, handles) {
6452                    std::task::Poll::Ready(Ok(())) => {}
6453                    std::task::Poll::Pending => return std::task::Poll::Pending,
6454                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6455                        this.is_terminated = true;
6456                        return std::task::Poll::Ready(None);
6457                    }
6458                    std::task::Poll::Ready(Err(e)) => {
6459                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6460                            e.into(),
6461                        ))));
6462                    }
6463                }
6464
6465                // A message has been received from the channel
6466                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6467
6468                std::task::Poll::Ready(Some(match header.ordinal {
6469                    0x58850dfb76c29a0e => {
6470                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6471                        let mut req = fidl::new_empty!(
6472                            UsmeBootstrapStartRequest,
6473                            fidl::encoding::DefaultFuchsiaResourceDialect
6474                        );
6475                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<UsmeBootstrapStartRequest>(&header, _body_bytes, handles, &mut req)?;
6476                        let control_handle =
6477                            UsmeBootstrapControlHandle { inner: this.inner.clone() };
6478                        Ok(UsmeBootstrapRequest::Start {
6479                            generic_sme_server: req.generic_sme_server,
6480                            legacy_privacy_support: req.legacy_privacy_support,
6481
6482                            responder: UsmeBootstrapStartResponder {
6483                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6484                                tx_id: header.tx_id,
6485                            },
6486                        })
6487                    }
6488                    _ => Err(fidl::Error::UnknownOrdinal {
6489                        ordinal: header.ordinal,
6490                        protocol_name:
6491                            <UsmeBootstrapMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6492                    }),
6493                }))
6494            },
6495        )
6496    }
6497}
6498
6499#[derive(Debug)]
6500pub enum UsmeBootstrapRequest {
6501    Start {
6502        generic_sme_server: fidl::endpoints::ServerEnd<GenericSmeMarker>,
6503        legacy_privacy_support: LegacyPrivacySupport,
6504        responder: UsmeBootstrapStartResponder,
6505    },
6506}
6507
6508impl UsmeBootstrapRequest {
6509    #[allow(irrefutable_let_patterns)]
6510    pub fn into_start(
6511        self,
6512    ) -> Option<(
6513        fidl::endpoints::ServerEnd<GenericSmeMarker>,
6514        LegacyPrivacySupport,
6515        UsmeBootstrapStartResponder,
6516    )> {
6517        if let UsmeBootstrapRequest::Start {
6518            generic_sme_server,
6519            legacy_privacy_support,
6520            responder,
6521        } = self
6522        {
6523            Some((generic_sme_server, legacy_privacy_support, responder))
6524        } else {
6525            None
6526        }
6527    }
6528
6529    /// Name of the method defined in FIDL
6530    pub fn method_name(&self) -> &'static str {
6531        match *self {
6532            UsmeBootstrapRequest::Start { .. } => "start",
6533        }
6534    }
6535}
6536
6537#[derive(Debug, Clone)]
6538pub struct UsmeBootstrapControlHandle {
6539    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6540}
6541
6542impl UsmeBootstrapControlHandle {
6543    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
6544        self.inner.shutdown_with_epitaph(status.into())
6545    }
6546}
6547
6548impl fidl::endpoints::ControlHandle for UsmeBootstrapControlHandle {
6549    fn shutdown(&self) {
6550        self.inner.shutdown()
6551    }
6552
6553    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
6554        self.inner.shutdown_with_epitaph(status)
6555    }
6556
6557    fn is_closed(&self) -> bool {
6558        self.inner.channel().is_closed()
6559    }
6560    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6561        self.inner.channel().on_closed()
6562    }
6563
6564    #[cfg(target_os = "fuchsia")]
6565    fn signal_peer(
6566        &self,
6567        clear_mask: zx::Signals,
6568        set_mask: zx::Signals,
6569    ) -> Result<(), zx_status::Status> {
6570        use fidl::Peered;
6571        self.inner.channel().signal_peer(clear_mask, set_mask)
6572    }
6573}
6574
6575impl UsmeBootstrapControlHandle {}
6576
6577#[must_use = "FIDL methods require a response to be sent"]
6578#[derive(Debug)]
6579pub struct UsmeBootstrapStartResponder {
6580    control_handle: std::mem::ManuallyDrop<UsmeBootstrapControlHandle>,
6581    tx_id: u32,
6582}
6583
6584/// Set the the channel to be shutdown (see [`UsmeBootstrapControlHandle::shutdown`])
6585/// if the responder is dropped without sending a response, so that the client
6586/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6587impl std::ops::Drop for UsmeBootstrapStartResponder {
6588    fn drop(&mut self) {
6589        self.control_handle.shutdown();
6590        // Safety: drops once, never accessed again
6591        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6592    }
6593}
6594
6595impl fidl::endpoints::Responder for UsmeBootstrapStartResponder {
6596    type ControlHandle = UsmeBootstrapControlHandle;
6597
6598    fn control_handle(&self) -> &UsmeBootstrapControlHandle {
6599        &self.control_handle
6600    }
6601
6602    fn drop_without_shutdown(mut self) {
6603        // Safety: drops once, never accessed again due to mem::forget
6604        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6605        // Prevent Drop from running (which would shut down the channel)
6606        std::mem::forget(self);
6607    }
6608}
6609
6610impl UsmeBootstrapStartResponder {
6611    /// Sends a response to the FIDL transaction.
6612    ///
6613    /// Sets the channel to shutdown if an error occurs.
6614    pub fn send(self, mut inspect_vmo: fidl::Vmo) -> Result<(), fidl::Error> {
6615        let _result = self.send_raw(inspect_vmo);
6616        if _result.is_err() {
6617            self.control_handle.shutdown();
6618        }
6619        self.drop_without_shutdown();
6620        _result
6621    }
6622
6623    /// Similar to "send" but does not shutdown the channel if an error occurs.
6624    pub fn send_no_shutdown_on_err(self, mut inspect_vmo: fidl::Vmo) -> Result<(), fidl::Error> {
6625        let _result = self.send_raw(inspect_vmo);
6626        self.drop_without_shutdown();
6627        _result
6628    }
6629
6630    fn send_raw(&self, mut inspect_vmo: fidl::Vmo) -> Result<(), fidl::Error> {
6631        self.control_handle.inner.send::<UsmeBootstrapStartResponse>(
6632            (inspect_vmo,),
6633            self.tx_id,
6634            0x58850dfb76c29a0e,
6635            fidl::encoding::DynamicFlags::empty(),
6636        )
6637    }
6638}
6639
6640mod internal {
6641    use super::*;
6642
6643    impl fidl::encoding::ResourceTypeMarker for ClientSmeConnectRequest {
6644        type Borrowed<'a> = &'a mut Self;
6645        fn take_or_borrow<'a>(
6646            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6647        ) -> Self::Borrowed<'a> {
6648            value
6649        }
6650    }
6651
6652    unsafe impl fidl::encoding::TypeMarker for ClientSmeConnectRequest {
6653        type Owned = Self;
6654
6655        #[inline(always)]
6656        fn inline_align(_context: fidl::encoding::Context) -> usize {
6657            8
6658        }
6659
6660        #[inline(always)]
6661        fn inline_size(_context: fidl::encoding::Context) -> usize {
6662            112
6663        }
6664    }
6665
6666    unsafe impl
6667        fidl::encoding::Encode<
6668            ClientSmeConnectRequest,
6669            fidl::encoding::DefaultFuchsiaResourceDialect,
6670        > for &mut ClientSmeConnectRequest
6671    {
6672        #[inline]
6673        unsafe fn encode(
6674            self,
6675            encoder: &mut fidl::encoding::Encoder<
6676                '_,
6677                fidl::encoding::DefaultFuchsiaResourceDialect,
6678            >,
6679            offset: usize,
6680            _depth: fidl::encoding::Depth,
6681        ) -> fidl::Result<()> {
6682            encoder.debug_check_bounds::<ClientSmeConnectRequest>(offset);
6683            // Delegate to tuple encoding.
6684            fidl::encoding::Encode::<
6685                ClientSmeConnectRequest,
6686                fidl::encoding::DefaultFuchsiaResourceDialect,
6687            >::encode(
6688                (
6689                    <ConnectRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.req),
6690                    <fidl::encoding::Optional<
6691                        fidl::encoding::Endpoint<
6692                            fidl::endpoints::ServerEnd<ConnectTransactionMarker>,
6693                        >,
6694                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6695                        &mut self.txn
6696                    ),
6697                ),
6698                encoder,
6699                offset,
6700                _depth,
6701            )
6702        }
6703    }
6704    unsafe impl<
6705        T0: fidl::encoding::Encode<ConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
6706        T1: fidl::encoding::Encode<
6707                fidl::encoding::Optional<
6708                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ConnectTransactionMarker>>,
6709                >,
6710                fidl::encoding::DefaultFuchsiaResourceDialect,
6711            >,
6712    >
6713        fidl::encoding::Encode<
6714            ClientSmeConnectRequest,
6715            fidl::encoding::DefaultFuchsiaResourceDialect,
6716        > for (T0, T1)
6717    {
6718        #[inline]
6719        unsafe fn encode(
6720            self,
6721            encoder: &mut fidl::encoding::Encoder<
6722                '_,
6723                fidl::encoding::DefaultFuchsiaResourceDialect,
6724            >,
6725            offset: usize,
6726            depth: fidl::encoding::Depth,
6727        ) -> fidl::Result<()> {
6728            encoder.debug_check_bounds::<ClientSmeConnectRequest>(offset);
6729            // Zero out padding regions. There's no need to apply masks
6730            // because the unmasked parts will be overwritten by fields.
6731            unsafe {
6732                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(104);
6733                (ptr as *mut u64).write_unaligned(0);
6734            }
6735            // Write the fields.
6736            self.0.encode(encoder, offset + 0, depth)?;
6737            self.1.encode(encoder, offset + 104, depth)?;
6738            Ok(())
6739        }
6740    }
6741
6742    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6743        for ClientSmeConnectRequest
6744    {
6745        #[inline(always)]
6746        fn new_empty() -> Self {
6747            Self {
6748                req: fidl::new_empty!(
6749                    ConnectRequest,
6750                    fidl::encoding::DefaultFuchsiaResourceDialect
6751                ),
6752                txn: fidl::new_empty!(
6753                    fidl::encoding::Optional<
6754                        fidl::encoding::Endpoint<
6755                            fidl::endpoints::ServerEnd<ConnectTransactionMarker>,
6756                        >,
6757                    >,
6758                    fidl::encoding::DefaultFuchsiaResourceDialect
6759                ),
6760            }
6761        }
6762
6763        #[inline]
6764        unsafe fn decode(
6765            &mut self,
6766            decoder: &mut fidl::encoding::Decoder<
6767                '_,
6768                fidl::encoding::DefaultFuchsiaResourceDialect,
6769            >,
6770            offset: usize,
6771            _depth: fidl::encoding::Depth,
6772        ) -> fidl::Result<()> {
6773            decoder.debug_check_bounds::<Self>(offset);
6774            // Verify that padding bytes are zero.
6775            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(104) };
6776            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6777            let mask = 0xffffffff00000000u64;
6778            let maskedval = padval & mask;
6779            if maskedval != 0 {
6780                return Err(fidl::Error::NonZeroPadding {
6781                    padding_start: offset + 104 + ((mask as u64).trailing_zeros() / 8) as usize,
6782                });
6783            }
6784            fidl::decode!(
6785                ConnectRequest,
6786                fidl::encoding::DefaultFuchsiaResourceDialect,
6787                &mut self.req,
6788                decoder,
6789                offset + 0,
6790                _depth
6791            )?;
6792            fidl::decode!(
6793                fidl::encoding::Optional<
6794                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ConnectTransactionMarker>>,
6795                >,
6796                fidl::encoding::DefaultFuchsiaResourceDialect,
6797                &mut self.txn,
6798                decoder,
6799                offset + 104,
6800                _depth
6801            )?;
6802            Ok(())
6803        }
6804    }
6805
6806    impl fidl::encoding::ResourceTypeMarker for ClientSmeScanForControllerRequest {
6807        type Borrowed<'a> = &'a mut Self;
6808        fn take_or_borrow<'a>(
6809            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6810        ) -> Self::Borrowed<'a> {
6811            value
6812        }
6813    }
6814
6815    unsafe impl fidl::encoding::TypeMarker for ClientSmeScanForControllerRequest {
6816        type Owned = Self;
6817
6818        #[inline(always)]
6819        fn inline_align(_context: fidl::encoding::Context) -> usize {
6820            8
6821        }
6822
6823        #[inline(always)]
6824        fn inline_size(_context: fidl::encoding::Context) -> usize {
6825            16
6826        }
6827    }
6828
6829    unsafe impl
6830        fidl::encoding::Encode<
6831            ClientSmeScanForControllerRequest,
6832            fidl::encoding::DefaultFuchsiaResourceDialect,
6833        > for &mut ClientSmeScanForControllerRequest
6834    {
6835        #[inline]
6836        unsafe fn encode(
6837            self,
6838            encoder: &mut fidl::encoding::Encoder<
6839                '_,
6840                fidl::encoding::DefaultFuchsiaResourceDialect,
6841            >,
6842            offset: usize,
6843            _depth: fidl::encoding::Depth,
6844        ) -> fidl::Result<()> {
6845            encoder.debug_check_bounds::<ClientSmeScanForControllerRequest>(offset);
6846            // Delegate to tuple encoding.
6847            fidl::encoding::Encode::<
6848                ClientSmeScanForControllerRequest,
6849                fidl::encoding::DefaultFuchsiaResourceDialect,
6850            >::encode(
6851                (<ScanRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.req),),
6852                encoder,
6853                offset,
6854                _depth,
6855            )
6856        }
6857    }
6858    unsafe impl<
6859        T0: fidl::encoding::Encode<ScanRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
6860    >
6861        fidl::encoding::Encode<
6862            ClientSmeScanForControllerRequest,
6863            fidl::encoding::DefaultFuchsiaResourceDialect,
6864        > for (T0,)
6865    {
6866        #[inline]
6867        unsafe fn encode(
6868            self,
6869            encoder: &mut fidl::encoding::Encoder<
6870                '_,
6871                fidl::encoding::DefaultFuchsiaResourceDialect,
6872            >,
6873            offset: usize,
6874            depth: fidl::encoding::Depth,
6875        ) -> fidl::Result<()> {
6876            encoder.debug_check_bounds::<ClientSmeScanForControllerRequest>(offset);
6877            // Zero out padding regions. There's no need to apply masks
6878            // because the unmasked parts will be overwritten by fields.
6879            // Write the fields.
6880            self.0.encode(encoder, offset + 0, depth)?;
6881            Ok(())
6882        }
6883    }
6884
6885    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6886        for ClientSmeScanForControllerRequest
6887    {
6888        #[inline(always)]
6889        fn new_empty() -> Self {
6890            Self {
6891                req: fidl::new_empty!(ScanRequest, fidl::encoding::DefaultFuchsiaResourceDialect),
6892            }
6893        }
6894
6895        #[inline]
6896        unsafe fn decode(
6897            &mut self,
6898            decoder: &mut fidl::encoding::Decoder<
6899                '_,
6900                fidl::encoding::DefaultFuchsiaResourceDialect,
6901            >,
6902            offset: usize,
6903            _depth: fidl::encoding::Depth,
6904        ) -> fidl::Result<()> {
6905            decoder.debug_check_bounds::<Self>(offset);
6906            // Verify that padding bytes are zero.
6907            fidl::decode!(
6908                ScanRequest,
6909                fidl::encoding::DefaultFuchsiaResourceDialect,
6910                &mut self.req,
6911                decoder,
6912                offset + 0,
6913                _depth
6914            )?;
6915            Ok(())
6916        }
6917    }
6918
6919    impl fidl::encoding::ResourceTypeMarker for ClientSmeScanRequest {
6920        type Borrowed<'a> = &'a mut Self;
6921        fn take_or_borrow<'a>(
6922            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6923        ) -> Self::Borrowed<'a> {
6924            value
6925        }
6926    }
6927
6928    unsafe impl fidl::encoding::TypeMarker for ClientSmeScanRequest {
6929        type Owned = Self;
6930
6931        #[inline(always)]
6932        fn inline_align(_context: fidl::encoding::Context) -> usize {
6933            8
6934        }
6935
6936        #[inline(always)]
6937        fn inline_size(_context: fidl::encoding::Context) -> usize {
6938            16
6939        }
6940    }
6941
6942    unsafe impl
6943        fidl::encoding::Encode<ClientSmeScanRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
6944        for &mut ClientSmeScanRequest
6945    {
6946        #[inline]
6947        unsafe fn encode(
6948            self,
6949            encoder: &mut fidl::encoding::Encoder<
6950                '_,
6951                fidl::encoding::DefaultFuchsiaResourceDialect,
6952            >,
6953            offset: usize,
6954            _depth: fidl::encoding::Depth,
6955        ) -> fidl::Result<()> {
6956            encoder.debug_check_bounds::<ClientSmeScanRequest>(offset);
6957            // Delegate to tuple encoding.
6958            fidl::encoding::Encode::<
6959                ClientSmeScanRequest,
6960                fidl::encoding::DefaultFuchsiaResourceDialect,
6961            >::encode(
6962                (<ScanRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.req),),
6963                encoder,
6964                offset,
6965                _depth,
6966            )
6967        }
6968    }
6969    unsafe impl<
6970        T0: fidl::encoding::Encode<ScanRequest, fidl::encoding::DefaultFuchsiaResourceDialect>,
6971    >
6972        fidl::encoding::Encode<ClientSmeScanRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
6973        for (T0,)
6974    {
6975        #[inline]
6976        unsafe fn encode(
6977            self,
6978            encoder: &mut fidl::encoding::Encoder<
6979                '_,
6980                fidl::encoding::DefaultFuchsiaResourceDialect,
6981            >,
6982            offset: usize,
6983            depth: fidl::encoding::Depth,
6984        ) -> fidl::Result<()> {
6985            encoder.debug_check_bounds::<ClientSmeScanRequest>(offset);
6986            // Zero out padding regions. There's no need to apply masks
6987            // because the unmasked parts will be overwritten by fields.
6988            // Write the fields.
6989            self.0.encode(encoder, offset + 0, depth)?;
6990            Ok(())
6991        }
6992    }
6993
6994    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
6995        for ClientSmeScanRequest
6996    {
6997        #[inline(always)]
6998        fn new_empty() -> Self {
6999            Self {
7000                req: fidl::new_empty!(ScanRequest, fidl::encoding::DefaultFuchsiaResourceDialect),
7001            }
7002        }
7003
7004        #[inline]
7005        unsafe fn decode(
7006            &mut self,
7007            decoder: &mut fidl::encoding::Decoder<
7008                '_,
7009                fidl::encoding::DefaultFuchsiaResourceDialect,
7010            >,
7011            offset: usize,
7012            _depth: fidl::encoding::Depth,
7013        ) -> fidl::Result<()> {
7014            decoder.debug_check_bounds::<Self>(offset);
7015            // Verify that padding bytes are zero.
7016            fidl::decode!(
7017                ScanRequest,
7018                fidl::encoding::DefaultFuchsiaResourceDialect,
7019                &mut self.req,
7020                decoder,
7021                offset + 0,
7022                _depth
7023            )?;
7024            Ok(())
7025        }
7026    }
7027
7028    impl fidl::encoding::ResourceTypeMarker for ClientSmeStartScheduledScanRequest {
7029        type Borrowed<'a> = &'a mut Self;
7030        fn take_or_borrow<'a>(
7031            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7032        ) -> Self::Borrowed<'a> {
7033            value
7034        }
7035    }
7036
7037    unsafe impl fidl::encoding::TypeMarker for ClientSmeStartScheduledScanRequest {
7038        type Owned = Self;
7039
7040        #[inline(always)]
7041        fn inline_align(_context: fidl::encoding::Context) -> usize {
7042            8
7043        }
7044
7045        #[inline(always)]
7046        fn inline_size(_context: fidl::encoding::Context) -> usize {
7047            24
7048        }
7049    }
7050
7051    unsafe impl
7052        fidl::encoding::Encode<
7053            ClientSmeStartScheduledScanRequest,
7054            fidl::encoding::DefaultFuchsiaResourceDialect,
7055        > for &mut ClientSmeStartScheduledScanRequest
7056    {
7057        #[inline]
7058        unsafe fn encode(
7059            self,
7060            encoder: &mut fidl::encoding::Encoder<
7061                '_,
7062                fidl::encoding::DefaultFuchsiaResourceDialect,
7063            >,
7064            offset: usize,
7065            _depth: fidl::encoding::Depth,
7066        ) -> fidl::Result<()> {
7067            encoder.debug_check_bounds::<ClientSmeStartScheduledScanRequest>(offset);
7068            // Delegate to tuple encoding.
7069            fidl::encoding::Encode::<ClientSmeStartScheduledScanRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7070                (
7071                    <fidl_fuchsia_wlan_common::ScheduledScanRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.req),
7072                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ScheduledScanTransactionMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.txn),
7073                ),
7074                encoder, offset, _depth
7075            )
7076        }
7077    }
7078    unsafe impl<
7079        T0: fidl::encoding::Encode<
7080                fidl_fuchsia_wlan_common::ScheduledScanRequest,
7081                fidl::encoding::DefaultFuchsiaResourceDialect,
7082            >,
7083        T1: fidl::encoding::Encode<
7084                fidl::encoding::Endpoint<
7085                    fidl::endpoints::ServerEnd<ScheduledScanTransactionMarker>,
7086                >,
7087                fidl::encoding::DefaultFuchsiaResourceDialect,
7088            >,
7089    >
7090        fidl::encoding::Encode<
7091            ClientSmeStartScheduledScanRequest,
7092            fidl::encoding::DefaultFuchsiaResourceDialect,
7093        > for (T0, T1)
7094    {
7095        #[inline]
7096        unsafe fn encode(
7097            self,
7098            encoder: &mut fidl::encoding::Encoder<
7099                '_,
7100                fidl::encoding::DefaultFuchsiaResourceDialect,
7101            >,
7102            offset: usize,
7103            depth: fidl::encoding::Depth,
7104        ) -> fidl::Result<()> {
7105            encoder.debug_check_bounds::<ClientSmeStartScheduledScanRequest>(offset);
7106            // Zero out padding regions. There's no need to apply masks
7107            // because the unmasked parts will be overwritten by fields.
7108            unsafe {
7109                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7110                (ptr as *mut u64).write_unaligned(0);
7111            }
7112            // Write the fields.
7113            self.0.encode(encoder, offset + 0, depth)?;
7114            self.1.encode(encoder, offset + 16, depth)?;
7115            Ok(())
7116        }
7117    }
7118
7119    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7120        for ClientSmeStartScheduledScanRequest
7121    {
7122        #[inline(always)]
7123        fn new_empty() -> Self {
7124            Self {
7125                req: fidl::new_empty!(
7126                    fidl_fuchsia_wlan_common::ScheduledScanRequest,
7127                    fidl::encoding::DefaultFuchsiaResourceDialect
7128                ),
7129                txn: fidl::new_empty!(
7130                    fidl::encoding::Endpoint<
7131                        fidl::endpoints::ServerEnd<ScheduledScanTransactionMarker>,
7132                    >,
7133                    fidl::encoding::DefaultFuchsiaResourceDialect
7134                ),
7135            }
7136        }
7137
7138        #[inline]
7139        unsafe fn decode(
7140            &mut self,
7141            decoder: &mut fidl::encoding::Decoder<
7142                '_,
7143                fidl::encoding::DefaultFuchsiaResourceDialect,
7144            >,
7145            offset: usize,
7146            _depth: fidl::encoding::Depth,
7147        ) -> fidl::Result<()> {
7148            decoder.debug_check_bounds::<Self>(offset);
7149            // Verify that padding bytes are zero.
7150            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7151            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7152            let mask = 0xffffffff00000000u64;
7153            let maskedval = padval & mask;
7154            if maskedval != 0 {
7155                return Err(fidl::Error::NonZeroPadding {
7156                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7157                });
7158            }
7159            fidl::decode!(
7160                fidl_fuchsia_wlan_common::ScheduledScanRequest,
7161                fidl::encoding::DefaultFuchsiaResourceDialect,
7162                &mut self.req,
7163                decoder,
7164                offset + 0,
7165                _depth
7166            )?;
7167            fidl::decode!(
7168                fidl::encoding::Endpoint<
7169                    fidl::endpoints::ServerEnd<ScheduledScanTransactionMarker>,
7170                >,
7171                fidl::encoding::DefaultFuchsiaResourceDialect,
7172                &mut self.txn,
7173                decoder,
7174                offset + 16,
7175                _depth
7176            )?;
7177            Ok(())
7178        }
7179    }
7180
7181    impl fidl::encoding::ResourceTypeMarker for ClientSmeScanForControllerResponse {
7182        type Borrowed<'a> = &'a mut Self;
7183        fn take_or_borrow<'a>(
7184            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7185        ) -> Self::Borrowed<'a> {
7186            value
7187        }
7188    }
7189
7190    unsafe impl fidl::encoding::TypeMarker for ClientSmeScanForControllerResponse {
7191        type Owned = Self;
7192
7193        #[inline(always)]
7194        fn inline_align(_context: fidl::encoding::Context) -> usize {
7195            8
7196        }
7197
7198        #[inline(always)]
7199        fn inline_size(_context: fidl::encoding::Context) -> usize {
7200            16
7201        }
7202    }
7203
7204    unsafe impl
7205        fidl::encoding::Encode<
7206            ClientSmeScanForControllerResponse,
7207            fidl::encoding::DefaultFuchsiaResourceDialect,
7208        > for &mut ClientSmeScanForControllerResponse
7209    {
7210        #[inline]
7211        unsafe fn encode(
7212            self,
7213            encoder: &mut fidl::encoding::Encoder<
7214                '_,
7215                fidl::encoding::DefaultFuchsiaResourceDialect,
7216            >,
7217            offset: usize,
7218            _depth: fidl::encoding::Depth,
7219        ) -> fidl::Result<()> {
7220            encoder.debug_check_bounds::<ClientSmeScanForControllerResponse>(offset);
7221            // Delegate to tuple encoding.
7222            fidl::encoding::Encode::<ClientSmeScanForControllerResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7223                (
7224                    <fidl::encoding::UnboundedVector<ScanResult> as fidl::encoding::ValueTypeMarker>::borrow(&self.scan_results),
7225                ),
7226                encoder, offset, _depth
7227            )
7228        }
7229    }
7230    unsafe impl<
7231        T0: fidl::encoding::Encode<
7232                fidl::encoding::UnboundedVector<ScanResult>,
7233                fidl::encoding::DefaultFuchsiaResourceDialect,
7234            >,
7235    >
7236        fidl::encoding::Encode<
7237            ClientSmeScanForControllerResponse,
7238            fidl::encoding::DefaultFuchsiaResourceDialect,
7239        > for (T0,)
7240    {
7241        #[inline]
7242        unsafe fn encode(
7243            self,
7244            encoder: &mut fidl::encoding::Encoder<
7245                '_,
7246                fidl::encoding::DefaultFuchsiaResourceDialect,
7247            >,
7248            offset: usize,
7249            depth: fidl::encoding::Depth,
7250        ) -> fidl::Result<()> {
7251            encoder.debug_check_bounds::<ClientSmeScanForControllerResponse>(offset);
7252            // Zero out padding regions. There's no need to apply masks
7253            // because the unmasked parts will be overwritten by fields.
7254            // Write the fields.
7255            self.0.encode(encoder, offset + 0, depth)?;
7256            Ok(())
7257        }
7258    }
7259
7260    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7261        for ClientSmeScanForControllerResponse
7262    {
7263        #[inline(always)]
7264        fn new_empty() -> Self {
7265            Self {
7266                scan_results: fidl::new_empty!(
7267                    fidl::encoding::UnboundedVector<ScanResult>,
7268                    fidl::encoding::DefaultFuchsiaResourceDialect
7269                ),
7270            }
7271        }
7272
7273        #[inline]
7274        unsafe fn decode(
7275            &mut self,
7276            decoder: &mut fidl::encoding::Decoder<
7277                '_,
7278                fidl::encoding::DefaultFuchsiaResourceDialect,
7279            >,
7280            offset: usize,
7281            _depth: fidl::encoding::Depth,
7282        ) -> fidl::Result<()> {
7283            decoder.debug_check_bounds::<Self>(offset);
7284            // Verify that padding bytes are zero.
7285            fidl::decode!(
7286                fidl::encoding::UnboundedVector<ScanResult>,
7287                fidl::encoding::DefaultFuchsiaResourceDialect,
7288                &mut self.scan_results,
7289                decoder,
7290                offset + 0,
7291                _depth
7292            )?;
7293            Ok(())
7294        }
7295    }
7296
7297    impl fidl::encoding::ResourceTypeMarker for ClientSmeScanResponse {
7298        type Borrowed<'a> = &'a mut Self;
7299        fn take_or_borrow<'a>(
7300            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7301        ) -> Self::Borrowed<'a> {
7302            value
7303        }
7304    }
7305
7306    unsafe impl fidl::encoding::TypeMarker for ClientSmeScanResponse {
7307        type Owned = Self;
7308
7309        #[inline(always)]
7310        fn inline_align(_context: fidl::encoding::Context) -> usize {
7311            4
7312        }
7313
7314        #[inline(always)]
7315        fn inline_size(_context: fidl::encoding::Context) -> usize {
7316            4
7317        }
7318    }
7319
7320    unsafe impl
7321        fidl::encoding::Encode<ClientSmeScanResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
7322        for &mut ClientSmeScanResponse
7323    {
7324        #[inline]
7325        unsafe fn encode(
7326            self,
7327            encoder: &mut fidl::encoding::Encoder<
7328                '_,
7329                fidl::encoding::DefaultFuchsiaResourceDialect,
7330            >,
7331            offset: usize,
7332            _depth: fidl::encoding::Depth,
7333        ) -> fidl::Result<()> {
7334            encoder.debug_check_bounds::<ClientSmeScanResponse>(offset);
7335            // Delegate to tuple encoding.
7336            fidl::encoding::Encode::<
7337                ClientSmeScanResponse,
7338                fidl::encoding::DefaultFuchsiaResourceDialect,
7339            >::encode(
7340                (<fidl::encoding::HandleType<
7341                    fidl::Vmo,
7342                    { fidl::ObjectType::VMO.into_raw() },
7343                    2147483648,
7344                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7345                    &mut self.scan_results
7346                ),),
7347                encoder,
7348                offset,
7349                _depth,
7350            )
7351        }
7352    }
7353    unsafe impl<
7354        T0: fidl::encoding::Encode<
7355                fidl::encoding::HandleType<
7356                    fidl::Vmo,
7357                    { fidl::ObjectType::VMO.into_raw() },
7358                    2147483648,
7359                >,
7360                fidl::encoding::DefaultFuchsiaResourceDialect,
7361            >,
7362    >
7363        fidl::encoding::Encode<ClientSmeScanResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
7364        for (T0,)
7365    {
7366        #[inline]
7367        unsafe fn encode(
7368            self,
7369            encoder: &mut fidl::encoding::Encoder<
7370                '_,
7371                fidl::encoding::DefaultFuchsiaResourceDialect,
7372            >,
7373            offset: usize,
7374            depth: fidl::encoding::Depth,
7375        ) -> fidl::Result<()> {
7376            encoder.debug_check_bounds::<ClientSmeScanResponse>(offset);
7377            // Zero out padding regions. There's no need to apply masks
7378            // because the unmasked parts will be overwritten by fields.
7379            // Write the fields.
7380            self.0.encode(encoder, offset + 0, depth)?;
7381            Ok(())
7382        }
7383    }
7384
7385    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7386        for ClientSmeScanResponse
7387    {
7388        #[inline(always)]
7389        fn new_empty() -> Self {
7390            Self {
7391                scan_results: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
7392            }
7393        }
7394
7395        #[inline]
7396        unsafe fn decode(
7397            &mut self,
7398            decoder: &mut fidl::encoding::Decoder<
7399                '_,
7400                fidl::encoding::DefaultFuchsiaResourceDialect,
7401            >,
7402            offset: usize,
7403            _depth: fidl::encoding::Depth,
7404        ) -> fidl::Result<()> {
7405            decoder.debug_check_bounds::<Self>(offset);
7406            // Verify that padding bytes are zero.
7407            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.scan_results, decoder, offset + 0, _depth)?;
7408            Ok(())
7409        }
7410    }
7411
7412    impl fidl::encoding::ResourceTypeMarker for GenericSmeGetApSmeRequest {
7413        type Borrowed<'a> = &'a mut Self;
7414        fn take_or_borrow<'a>(
7415            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7416        ) -> Self::Borrowed<'a> {
7417            value
7418        }
7419    }
7420
7421    unsafe impl fidl::encoding::TypeMarker for GenericSmeGetApSmeRequest {
7422        type Owned = Self;
7423
7424        #[inline(always)]
7425        fn inline_align(_context: fidl::encoding::Context) -> usize {
7426            4
7427        }
7428
7429        #[inline(always)]
7430        fn inline_size(_context: fidl::encoding::Context) -> usize {
7431            4
7432        }
7433    }
7434
7435    unsafe impl
7436        fidl::encoding::Encode<
7437            GenericSmeGetApSmeRequest,
7438            fidl::encoding::DefaultFuchsiaResourceDialect,
7439        > for &mut GenericSmeGetApSmeRequest
7440    {
7441        #[inline]
7442        unsafe fn encode(
7443            self,
7444            encoder: &mut fidl::encoding::Encoder<
7445                '_,
7446                fidl::encoding::DefaultFuchsiaResourceDialect,
7447            >,
7448            offset: usize,
7449            _depth: fidl::encoding::Depth,
7450        ) -> fidl::Result<()> {
7451            encoder.debug_check_bounds::<GenericSmeGetApSmeRequest>(offset);
7452            // Delegate to tuple encoding.
7453            fidl::encoding::Encode::<GenericSmeGetApSmeRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7454                (
7455                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ApSmeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.sme_server),
7456                ),
7457                encoder, offset, _depth
7458            )
7459        }
7460    }
7461    unsafe impl<
7462        T0: fidl::encoding::Encode<
7463                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ApSmeMarker>>,
7464                fidl::encoding::DefaultFuchsiaResourceDialect,
7465            >,
7466    >
7467        fidl::encoding::Encode<
7468            GenericSmeGetApSmeRequest,
7469            fidl::encoding::DefaultFuchsiaResourceDialect,
7470        > for (T0,)
7471    {
7472        #[inline]
7473        unsafe fn encode(
7474            self,
7475            encoder: &mut fidl::encoding::Encoder<
7476                '_,
7477                fidl::encoding::DefaultFuchsiaResourceDialect,
7478            >,
7479            offset: usize,
7480            depth: fidl::encoding::Depth,
7481        ) -> fidl::Result<()> {
7482            encoder.debug_check_bounds::<GenericSmeGetApSmeRequest>(offset);
7483            // Zero out padding regions. There's no need to apply masks
7484            // because the unmasked parts will be overwritten by fields.
7485            // Write the fields.
7486            self.0.encode(encoder, offset + 0, depth)?;
7487            Ok(())
7488        }
7489    }
7490
7491    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7492        for GenericSmeGetApSmeRequest
7493    {
7494        #[inline(always)]
7495        fn new_empty() -> Self {
7496            Self {
7497                sme_server: fidl::new_empty!(
7498                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ApSmeMarker>>,
7499                    fidl::encoding::DefaultFuchsiaResourceDialect
7500                ),
7501            }
7502        }
7503
7504        #[inline]
7505        unsafe fn decode(
7506            &mut self,
7507            decoder: &mut fidl::encoding::Decoder<
7508                '_,
7509                fidl::encoding::DefaultFuchsiaResourceDialect,
7510            >,
7511            offset: usize,
7512            _depth: fidl::encoding::Depth,
7513        ) -> fidl::Result<()> {
7514            decoder.debug_check_bounds::<Self>(offset);
7515            // Verify that padding bytes are zero.
7516            fidl::decode!(
7517                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ApSmeMarker>>,
7518                fidl::encoding::DefaultFuchsiaResourceDialect,
7519                &mut self.sme_server,
7520                decoder,
7521                offset + 0,
7522                _depth
7523            )?;
7524            Ok(())
7525        }
7526    }
7527
7528    impl fidl::encoding::ResourceTypeMarker for GenericSmeGetClientSmeRequest {
7529        type Borrowed<'a> = &'a mut Self;
7530        fn take_or_borrow<'a>(
7531            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7532        ) -> Self::Borrowed<'a> {
7533            value
7534        }
7535    }
7536
7537    unsafe impl fidl::encoding::TypeMarker for GenericSmeGetClientSmeRequest {
7538        type Owned = Self;
7539
7540        #[inline(always)]
7541        fn inline_align(_context: fidl::encoding::Context) -> usize {
7542            4
7543        }
7544
7545        #[inline(always)]
7546        fn inline_size(_context: fidl::encoding::Context) -> usize {
7547            4
7548        }
7549    }
7550
7551    unsafe impl
7552        fidl::encoding::Encode<
7553            GenericSmeGetClientSmeRequest,
7554            fidl::encoding::DefaultFuchsiaResourceDialect,
7555        > for &mut GenericSmeGetClientSmeRequest
7556    {
7557        #[inline]
7558        unsafe fn encode(
7559            self,
7560            encoder: &mut fidl::encoding::Encoder<
7561                '_,
7562                fidl::encoding::DefaultFuchsiaResourceDialect,
7563            >,
7564            offset: usize,
7565            _depth: fidl::encoding::Depth,
7566        ) -> fidl::Result<()> {
7567            encoder.debug_check_bounds::<GenericSmeGetClientSmeRequest>(offset);
7568            // Delegate to tuple encoding.
7569            fidl::encoding::Encode::<GenericSmeGetClientSmeRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7570                (
7571                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClientSmeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.sme_server),
7572                ),
7573                encoder, offset, _depth
7574            )
7575        }
7576    }
7577    unsafe impl<
7578        T0: fidl::encoding::Encode<
7579                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClientSmeMarker>>,
7580                fidl::encoding::DefaultFuchsiaResourceDialect,
7581            >,
7582    >
7583        fidl::encoding::Encode<
7584            GenericSmeGetClientSmeRequest,
7585            fidl::encoding::DefaultFuchsiaResourceDialect,
7586        > for (T0,)
7587    {
7588        #[inline]
7589        unsafe fn encode(
7590            self,
7591            encoder: &mut fidl::encoding::Encoder<
7592                '_,
7593                fidl::encoding::DefaultFuchsiaResourceDialect,
7594            >,
7595            offset: usize,
7596            depth: fidl::encoding::Depth,
7597        ) -> fidl::Result<()> {
7598            encoder.debug_check_bounds::<GenericSmeGetClientSmeRequest>(offset);
7599            // Zero out padding regions. There's no need to apply masks
7600            // because the unmasked parts will be overwritten by fields.
7601            // Write the fields.
7602            self.0.encode(encoder, offset + 0, depth)?;
7603            Ok(())
7604        }
7605    }
7606
7607    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7608        for GenericSmeGetClientSmeRequest
7609    {
7610        #[inline(always)]
7611        fn new_empty() -> Self {
7612            Self {
7613                sme_server: fidl::new_empty!(
7614                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClientSmeMarker>>,
7615                    fidl::encoding::DefaultFuchsiaResourceDialect
7616                ),
7617            }
7618        }
7619
7620        #[inline]
7621        unsafe fn decode(
7622            &mut self,
7623            decoder: &mut fidl::encoding::Decoder<
7624                '_,
7625                fidl::encoding::DefaultFuchsiaResourceDialect,
7626            >,
7627            offset: usize,
7628            _depth: fidl::encoding::Depth,
7629        ) -> fidl::Result<()> {
7630            decoder.debug_check_bounds::<Self>(offset);
7631            // Verify that padding bytes are zero.
7632            fidl::decode!(
7633                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClientSmeMarker>>,
7634                fidl::encoding::DefaultFuchsiaResourceDialect,
7635                &mut self.sme_server,
7636                decoder,
7637                offset + 0,
7638                _depth
7639            )?;
7640            Ok(())
7641        }
7642    }
7643
7644    impl fidl::encoding::ResourceTypeMarker for GenericSmeGetSmeTelemetryRequest {
7645        type Borrowed<'a> = &'a mut Self;
7646        fn take_or_borrow<'a>(
7647            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7648        ) -> Self::Borrowed<'a> {
7649            value
7650        }
7651    }
7652
7653    unsafe impl fidl::encoding::TypeMarker for GenericSmeGetSmeTelemetryRequest {
7654        type Owned = Self;
7655
7656        #[inline(always)]
7657        fn inline_align(_context: fidl::encoding::Context) -> usize {
7658            4
7659        }
7660
7661        #[inline(always)]
7662        fn inline_size(_context: fidl::encoding::Context) -> usize {
7663            4
7664        }
7665    }
7666
7667    unsafe impl
7668        fidl::encoding::Encode<
7669            GenericSmeGetSmeTelemetryRequest,
7670            fidl::encoding::DefaultFuchsiaResourceDialect,
7671        > for &mut GenericSmeGetSmeTelemetryRequest
7672    {
7673        #[inline]
7674        unsafe fn encode(
7675            self,
7676            encoder: &mut fidl::encoding::Encoder<
7677                '_,
7678                fidl::encoding::DefaultFuchsiaResourceDialect,
7679            >,
7680            offset: usize,
7681            _depth: fidl::encoding::Depth,
7682        ) -> fidl::Result<()> {
7683            encoder.debug_check_bounds::<GenericSmeGetSmeTelemetryRequest>(offset);
7684            // Delegate to tuple encoding.
7685            fidl::encoding::Encode::<GenericSmeGetSmeTelemetryRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
7686                (
7687                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TelemetryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.telemetry_server),
7688                ),
7689                encoder, offset, _depth
7690            )
7691        }
7692    }
7693    unsafe impl<
7694        T0: fidl::encoding::Encode<
7695                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TelemetryMarker>>,
7696                fidl::encoding::DefaultFuchsiaResourceDialect,
7697            >,
7698    >
7699        fidl::encoding::Encode<
7700            GenericSmeGetSmeTelemetryRequest,
7701            fidl::encoding::DefaultFuchsiaResourceDialect,
7702        > for (T0,)
7703    {
7704        #[inline]
7705        unsafe fn encode(
7706            self,
7707            encoder: &mut fidl::encoding::Encoder<
7708                '_,
7709                fidl::encoding::DefaultFuchsiaResourceDialect,
7710            >,
7711            offset: usize,
7712            depth: fidl::encoding::Depth,
7713        ) -> fidl::Result<()> {
7714            encoder.debug_check_bounds::<GenericSmeGetSmeTelemetryRequest>(offset);
7715            // Zero out padding regions. There's no need to apply masks
7716            // because the unmasked parts will be overwritten by fields.
7717            // Write the fields.
7718            self.0.encode(encoder, offset + 0, depth)?;
7719            Ok(())
7720        }
7721    }
7722
7723    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7724        for GenericSmeGetSmeTelemetryRequest
7725    {
7726        #[inline(always)]
7727        fn new_empty() -> Self {
7728            Self {
7729                telemetry_server: fidl::new_empty!(
7730                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TelemetryMarker>>,
7731                    fidl::encoding::DefaultFuchsiaResourceDialect
7732                ),
7733            }
7734        }
7735
7736        #[inline]
7737        unsafe fn decode(
7738            &mut self,
7739            decoder: &mut fidl::encoding::Decoder<
7740                '_,
7741                fidl::encoding::DefaultFuchsiaResourceDialect,
7742            >,
7743            offset: usize,
7744            _depth: fidl::encoding::Depth,
7745        ) -> fidl::Result<()> {
7746            decoder.debug_check_bounds::<Self>(offset);
7747            // Verify that padding bytes are zero.
7748            fidl::decode!(
7749                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<TelemetryMarker>>,
7750                fidl::encoding::DefaultFuchsiaResourceDialect,
7751                &mut self.telemetry_server,
7752                decoder,
7753                offset + 0,
7754                _depth
7755            )?;
7756            Ok(())
7757        }
7758    }
7759
7760    impl fidl::encoding::ResourceTypeMarker for GenericSmeQueryResponse {
7761        type Borrowed<'a> = &'a mut Self;
7762        fn take_or_borrow<'a>(
7763            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7764        ) -> Self::Borrowed<'a> {
7765            value
7766        }
7767    }
7768
7769    unsafe impl fidl::encoding::TypeMarker for GenericSmeQueryResponse {
7770        type Owned = Self;
7771
7772        #[inline(always)]
7773        fn inline_align(_context: fidl::encoding::Context) -> usize {
7774            4
7775        }
7776
7777        #[inline(always)]
7778        fn inline_size(_context: fidl::encoding::Context) -> usize {
7779            16
7780        }
7781    }
7782
7783    unsafe impl
7784        fidl::encoding::Encode<
7785            GenericSmeQueryResponse,
7786            fidl::encoding::DefaultFuchsiaResourceDialect,
7787        > for &mut GenericSmeQueryResponse
7788    {
7789        #[inline]
7790        unsafe fn encode(
7791            self,
7792            encoder: &mut fidl::encoding::Encoder<
7793                '_,
7794                fidl::encoding::DefaultFuchsiaResourceDialect,
7795            >,
7796            offset: usize,
7797            _depth: fidl::encoding::Depth,
7798        ) -> fidl::Result<()> {
7799            encoder.debug_check_bounds::<GenericSmeQueryResponse>(offset);
7800            // Delegate to tuple encoding.
7801            fidl::encoding::Encode::<
7802                GenericSmeQueryResponse,
7803                fidl::encoding::DefaultFuchsiaResourceDialect,
7804            >::encode(
7805                (<GenericSmeQuery as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),),
7806                encoder,
7807                offset,
7808                _depth,
7809            )
7810        }
7811    }
7812    unsafe impl<
7813        T0: fidl::encoding::Encode<GenericSmeQuery, fidl::encoding::DefaultFuchsiaResourceDialect>,
7814    >
7815        fidl::encoding::Encode<
7816            GenericSmeQueryResponse,
7817            fidl::encoding::DefaultFuchsiaResourceDialect,
7818        > for (T0,)
7819    {
7820        #[inline]
7821        unsafe fn encode(
7822            self,
7823            encoder: &mut fidl::encoding::Encoder<
7824                '_,
7825                fidl::encoding::DefaultFuchsiaResourceDialect,
7826            >,
7827            offset: usize,
7828            depth: fidl::encoding::Depth,
7829        ) -> fidl::Result<()> {
7830            encoder.debug_check_bounds::<GenericSmeQueryResponse>(offset);
7831            // Zero out padding regions. There's no need to apply masks
7832            // because the unmasked parts will be overwritten by fields.
7833            // Write the fields.
7834            self.0.encode(encoder, offset + 0, depth)?;
7835            Ok(())
7836        }
7837    }
7838
7839    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7840        for GenericSmeQueryResponse
7841    {
7842        #[inline(always)]
7843        fn new_empty() -> Self {
7844            Self {
7845                resp: fidl::new_empty!(
7846                    GenericSmeQuery,
7847                    fidl::encoding::DefaultFuchsiaResourceDialect
7848                ),
7849            }
7850        }
7851
7852        #[inline]
7853        unsafe fn decode(
7854            &mut self,
7855            decoder: &mut fidl::encoding::Decoder<
7856                '_,
7857                fidl::encoding::DefaultFuchsiaResourceDialect,
7858            >,
7859            offset: usize,
7860            _depth: fidl::encoding::Depth,
7861        ) -> fidl::Result<()> {
7862            decoder.debug_check_bounds::<Self>(offset);
7863            // Verify that padding bytes are zero.
7864            fidl::decode!(
7865                GenericSmeQuery,
7866                fidl::encoding::DefaultFuchsiaResourceDialect,
7867                &mut self.resp,
7868                decoder,
7869                offset + 0,
7870                _depth
7871            )?;
7872            Ok(())
7873        }
7874    }
7875
7876    impl fidl::encoding::ResourceTypeMarker
7877        for ScheduledScanTransactionOnScheduledScanMatchesAvailableRequest
7878    {
7879        type Borrowed<'a> = &'a mut Self;
7880        fn take_or_borrow<'a>(
7881            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7882        ) -> Self::Borrowed<'a> {
7883            value
7884        }
7885    }
7886
7887    unsafe impl fidl::encoding::TypeMarker
7888        for ScheduledScanTransactionOnScheduledScanMatchesAvailableRequest
7889    {
7890        type Owned = Self;
7891
7892        #[inline(always)]
7893        fn inline_align(_context: fidl::encoding::Context) -> usize {
7894            4
7895        }
7896
7897        #[inline(always)]
7898        fn inline_size(_context: fidl::encoding::Context) -> usize {
7899            4
7900        }
7901    }
7902
7903    unsafe impl
7904        fidl::encoding::Encode<
7905            ScheduledScanTransactionOnScheduledScanMatchesAvailableRequest,
7906            fidl::encoding::DefaultFuchsiaResourceDialect,
7907        > for &mut ScheduledScanTransactionOnScheduledScanMatchesAvailableRequest
7908    {
7909        #[inline]
7910        unsafe fn encode(
7911            self,
7912            encoder: &mut fidl::encoding::Encoder<
7913                '_,
7914                fidl::encoding::DefaultFuchsiaResourceDialect,
7915            >,
7916            offset: usize,
7917            _depth: fidl::encoding::Depth,
7918        ) -> fidl::Result<()> {
7919            encoder.debug_check_bounds::<ScheduledScanTransactionOnScheduledScanMatchesAvailableRequest>(offset);
7920            // Delegate to tuple encoding.
7921            fidl::encoding::Encode::<
7922                ScheduledScanTransactionOnScheduledScanMatchesAvailableRequest,
7923                fidl::encoding::DefaultFuchsiaResourceDialect,
7924            >::encode(
7925                (<fidl::encoding::HandleType<
7926                    fidl::Vmo,
7927                    { fidl::ObjectType::VMO.into_raw() },
7928                    2147483648,
7929                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7930                    &mut self.scan_results
7931                ),),
7932                encoder,
7933                offset,
7934                _depth,
7935            )
7936        }
7937    }
7938    unsafe impl<
7939        T0: fidl::encoding::Encode<
7940                fidl::encoding::HandleType<
7941                    fidl::Vmo,
7942                    { fidl::ObjectType::VMO.into_raw() },
7943                    2147483648,
7944                >,
7945                fidl::encoding::DefaultFuchsiaResourceDialect,
7946            >,
7947    >
7948        fidl::encoding::Encode<
7949            ScheduledScanTransactionOnScheduledScanMatchesAvailableRequest,
7950            fidl::encoding::DefaultFuchsiaResourceDialect,
7951        > for (T0,)
7952    {
7953        #[inline]
7954        unsafe fn encode(
7955            self,
7956            encoder: &mut fidl::encoding::Encoder<
7957                '_,
7958                fidl::encoding::DefaultFuchsiaResourceDialect,
7959            >,
7960            offset: usize,
7961            depth: fidl::encoding::Depth,
7962        ) -> fidl::Result<()> {
7963            encoder.debug_check_bounds::<ScheduledScanTransactionOnScheduledScanMatchesAvailableRequest>(offset);
7964            // Zero out padding regions. There's no need to apply masks
7965            // because the unmasked parts will be overwritten by fields.
7966            // Write the fields.
7967            self.0.encode(encoder, offset + 0, depth)?;
7968            Ok(())
7969        }
7970    }
7971
7972    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
7973        for ScheduledScanTransactionOnScheduledScanMatchesAvailableRequest
7974    {
7975        #[inline(always)]
7976        fn new_empty() -> Self {
7977            Self {
7978                scan_results: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
7979            }
7980        }
7981
7982        #[inline]
7983        unsafe fn decode(
7984            &mut self,
7985            decoder: &mut fidl::encoding::Decoder<
7986                '_,
7987                fidl::encoding::DefaultFuchsiaResourceDialect,
7988            >,
7989            offset: usize,
7990            _depth: fidl::encoding::Depth,
7991        ) -> fidl::Result<()> {
7992            decoder.debug_check_bounds::<Self>(offset);
7993            // Verify that padding bytes are zero.
7994            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.scan_results, decoder, offset + 0, _depth)?;
7995            Ok(())
7996        }
7997    }
7998
7999    impl fidl::encoding::ResourceTypeMarker for TelemetryCloneInspectVmoResponse {
8000        type Borrowed<'a> = &'a mut Self;
8001        fn take_or_borrow<'a>(
8002            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8003        ) -> Self::Borrowed<'a> {
8004            value
8005        }
8006    }
8007
8008    unsafe impl fidl::encoding::TypeMarker for TelemetryCloneInspectVmoResponse {
8009        type Owned = Self;
8010
8011        #[inline(always)]
8012        fn inline_align(_context: fidl::encoding::Context) -> usize {
8013            4
8014        }
8015
8016        #[inline(always)]
8017        fn inline_size(_context: fidl::encoding::Context) -> usize {
8018            4
8019        }
8020    }
8021
8022    unsafe impl
8023        fidl::encoding::Encode<
8024            TelemetryCloneInspectVmoResponse,
8025            fidl::encoding::DefaultFuchsiaResourceDialect,
8026        > for &mut TelemetryCloneInspectVmoResponse
8027    {
8028        #[inline]
8029        unsafe fn encode(
8030            self,
8031            encoder: &mut fidl::encoding::Encoder<
8032                '_,
8033                fidl::encoding::DefaultFuchsiaResourceDialect,
8034            >,
8035            offset: usize,
8036            _depth: fidl::encoding::Depth,
8037        ) -> fidl::Result<()> {
8038            encoder.debug_check_bounds::<TelemetryCloneInspectVmoResponse>(offset);
8039            // Delegate to tuple encoding.
8040            fidl::encoding::Encode::<
8041                TelemetryCloneInspectVmoResponse,
8042                fidl::encoding::DefaultFuchsiaResourceDialect,
8043            >::encode(
8044                (<fidl::encoding::HandleType<
8045                    fidl::Vmo,
8046                    { fidl::ObjectType::VMO.into_raw() },
8047                    2147483648,
8048                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8049                    &mut self.inspect_vmo
8050                ),),
8051                encoder,
8052                offset,
8053                _depth,
8054            )
8055        }
8056    }
8057    unsafe impl<
8058        T0: fidl::encoding::Encode<
8059                fidl::encoding::HandleType<
8060                    fidl::Vmo,
8061                    { fidl::ObjectType::VMO.into_raw() },
8062                    2147483648,
8063                >,
8064                fidl::encoding::DefaultFuchsiaResourceDialect,
8065            >,
8066    >
8067        fidl::encoding::Encode<
8068            TelemetryCloneInspectVmoResponse,
8069            fidl::encoding::DefaultFuchsiaResourceDialect,
8070        > for (T0,)
8071    {
8072        #[inline]
8073        unsafe fn encode(
8074            self,
8075            encoder: &mut fidl::encoding::Encoder<
8076                '_,
8077                fidl::encoding::DefaultFuchsiaResourceDialect,
8078            >,
8079            offset: usize,
8080            depth: fidl::encoding::Depth,
8081        ) -> fidl::Result<()> {
8082            encoder.debug_check_bounds::<TelemetryCloneInspectVmoResponse>(offset);
8083            // Zero out padding regions. There's no need to apply masks
8084            // because the unmasked parts will be overwritten by fields.
8085            // Write the fields.
8086            self.0.encode(encoder, offset + 0, depth)?;
8087            Ok(())
8088        }
8089    }
8090
8091    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8092        for TelemetryCloneInspectVmoResponse
8093    {
8094        #[inline(always)]
8095        fn new_empty() -> Self {
8096            Self {
8097                inspect_vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8098            }
8099        }
8100
8101        #[inline]
8102        unsafe fn decode(
8103            &mut self,
8104            decoder: &mut fidl::encoding::Decoder<
8105                '_,
8106                fidl::encoding::DefaultFuchsiaResourceDialect,
8107            >,
8108            offset: usize,
8109            _depth: fidl::encoding::Depth,
8110        ) -> fidl::Result<()> {
8111            decoder.debug_check_bounds::<Self>(offset);
8112            // Verify that padding bytes are zero.
8113            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.inspect_vmo, decoder, offset + 0, _depth)?;
8114            Ok(())
8115        }
8116    }
8117
8118    impl fidl::encoding::ResourceTypeMarker for UsmeBootstrapStartRequest {
8119        type Borrowed<'a> = &'a mut Self;
8120        fn take_or_borrow<'a>(
8121            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8122        ) -> Self::Borrowed<'a> {
8123            value
8124        }
8125    }
8126
8127    unsafe impl fidl::encoding::TypeMarker for UsmeBootstrapStartRequest {
8128        type Owned = Self;
8129
8130        #[inline(always)]
8131        fn inline_align(_context: fidl::encoding::Context) -> usize {
8132            4
8133        }
8134
8135        #[inline(always)]
8136        fn inline_size(_context: fidl::encoding::Context) -> usize {
8137            8
8138        }
8139    }
8140
8141    unsafe impl
8142        fidl::encoding::Encode<
8143            UsmeBootstrapStartRequest,
8144            fidl::encoding::DefaultFuchsiaResourceDialect,
8145        > for &mut UsmeBootstrapStartRequest
8146    {
8147        #[inline]
8148        unsafe fn encode(
8149            self,
8150            encoder: &mut fidl::encoding::Encoder<
8151                '_,
8152                fidl::encoding::DefaultFuchsiaResourceDialect,
8153            >,
8154            offset: usize,
8155            _depth: fidl::encoding::Depth,
8156        ) -> fidl::Result<()> {
8157            encoder.debug_check_bounds::<UsmeBootstrapStartRequest>(offset);
8158            // Delegate to tuple encoding.
8159            fidl::encoding::Encode::<UsmeBootstrapStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8160                (
8161                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GenericSmeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.generic_sme_server),
8162                    <LegacyPrivacySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.legacy_privacy_support),
8163                ),
8164                encoder, offset, _depth
8165            )
8166        }
8167    }
8168    unsafe impl<
8169        T0: fidl::encoding::Encode<
8170                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GenericSmeMarker>>,
8171                fidl::encoding::DefaultFuchsiaResourceDialect,
8172            >,
8173        T1: fidl::encoding::Encode<LegacyPrivacySupport, fidl::encoding::DefaultFuchsiaResourceDialect>,
8174    >
8175        fidl::encoding::Encode<
8176            UsmeBootstrapStartRequest,
8177            fidl::encoding::DefaultFuchsiaResourceDialect,
8178        > for (T0, T1)
8179    {
8180        #[inline]
8181        unsafe fn encode(
8182            self,
8183            encoder: &mut fidl::encoding::Encoder<
8184                '_,
8185                fidl::encoding::DefaultFuchsiaResourceDialect,
8186            >,
8187            offset: usize,
8188            depth: fidl::encoding::Depth,
8189        ) -> fidl::Result<()> {
8190            encoder.debug_check_bounds::<UsmeBootstrapStartRequest>(offset);
8191            // Zero out padding regions. There's no need to apply masks
8192            // because the unmasked parts will be overwritten by fields.
8193            unsafe {
8194                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
8195                (ptr as *mut u32).write_unaligned(0);
8196            }
8197            // Write the fields.
8198            self.0.encode(encoder, offset + 0, depth)?;
8199            self.1.encode(encoder, offset + 4, depth)?;
8200            Ok(())
8201        }
8202    }
8203
8204    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8205        for UsmeBootstrapStartRequest
8206    {
8207        #[inline(always)]
8208        fn new_empty() -> Self {
8209            Self {
8210                generic_sme_server: fidl::new_empty!(
8211                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GenericSmeMarker>>,
8212                    fidl::encoding::DefaultFuchsiaResourceDialect
8213                ),
8214                legacy_privacy_support: fidl::new_empty!(
8215                    LegacyPrivacySupport,
8216                    fidl::encoding::DefaultFuchsiaResourceDialect
8217                ),
8218            }
8219        }
8220
8221        #[inline]
8222        unsafe fn decode(
8223            &mut self,
8224            decoder: &mut fidl::encoding::Decoder<
8225                '_,
8226                fidl::encoding::DefaultFuchsiaResourceDialect,
8227            >,
8228            offset: usize,
8229            _depth: fidl::encoding::Depth,
8230        ) -> fidl::Result<()> {
8231            decoder.debug_check_bounds::<Self>(offset);
8232            // Verify that padding bytes are zero.
8233            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
8234            let padval = unsafe { (ptr as *const u32).read_unaligned() };
8235            let mask = 0xffff0000u32;
8236            let maskedval = padval & mask;
8237            if maskedval != 0 {
8238                return Err(fidl::Error::NonZeroPadding {
8239                    padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
8240                });
8241            }
8242            fidl::decode!(
8243                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GenericSmeMarker>>,
8244                fidl::encoding::DefaultFuchsiaResourceDialect,
8245                &mut self.generic_sme_server,
8246                decoder,
8247                offset + 0,
8248                _depth
8249            )?;
8250            fidl::decode!(
8251                LegacyPrivacySupport,
8252                fidl::encoding::DefaultFuchsiaResourceDialect,
8253                &mut self.legacy_privacy_support,
8254                decoder,
8255                offset + 4,
8256                _depth
8257            )?;
8258            Ok(())
8259        }
8260    }
8261
8262    impl fidl::encoding::ResourceTypeMarker for UsmeBootstrapStartResponse {
8263        type Borrowed<'a> = &'a mut Self;
8264        fn take_or_borrow<'a>(
8265            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8266        ) -> Self::Borrowed<'a> {
8267            value
8268        }
8269    }
8270
8271    unsafe impl fidl::encoding::TypeMarker for UsmeBootstrapStartResponse {
8272        type Owned = Self;
8273
8274        #[inline(always)]
8275        fn inline_align(_context: fidl::encoding::Context) -> usize {
8276            4
8277        }
8278
8279        #[inline(always)]
8280        fn inline_size(_context: fidl::encoding::Context) -> usize {
8281            4
8282        }
8283    }
8284
8285    unsafe impl
8286        fidl::encoding::Encode<
8287            UsmeBootstrapStartResponse,
8288            fidl::encoding::DefaultFuchsiaResourceDialect,
8289        > for &mut UsmeBootstrapStartResponse
8290    {
8291        #[inline]
8292        unsafe fn encode(
8293            self,
8294            encoder: &mut fidl::encoding::Encoder<
8295                '_,
8296                fidl::encoding::DefaultFuchsiaResourceDialect,
8297            >,
8298            offset: usize,
8299            _depth: fidl::encoding::Depth,
8300        ) -> fidl::Result<()> {
8301            encoder.debug_check_bounds::<UsmeBootstrapStartResponse>(offset);
8302            // Delegate to tuple encoding.
8303            fidl::encoding::Encode::<
8304                UsmeBootstrapStartResponse,
8305                fidl::encoding::DefaultFuchsiaResourceDialect,
8306            >::encode(
8307                (<fidl::encoding::HandleType<
8308                    fidl::Vmo,
8309                    { fidl::ObjectType::VMO.into_raw() },
8310                    2147483648,
8311                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8312                    &mut self.inspect_vmo
8313                ),),
8314                encoder,
8315                offset,
8316                _depth,
8317            )
8318        }
8319    }
8320    unsafe impl<
8321        T0: fidl::encoding::Encode<
8322                fidl::encoding::HandleType<
8323                    fidl::Vmo,
8324                    { fidl::ObjectType::VMO.into_raw() },
8325                    2147483648,
8326                >,
8327                fidl::encoding::DefaultFuchsiaResourceDialect,
8328            >,
8329    >
8330        fidl::encoding::Encode<
8331            UsmeBootstrapStartResponse,
8332            fidl::encoding::DefaultFuchsiaResourceDialect,
8333        > for (T0,)
8334    {
8335        #[inline]
8336        unsafe fn encode(
8337            self,
8338            encoder: &mut fidl::encoding::Encoder<
8339                '_,
8340                fidl::encoding::DefaultFuchsiaResourceDialect,
8341            >,
8342            offset: usize,
8343            depth: fidl::encoding::Depth,
8344        ) -> fidl::Result<()> {
8345            encoder.debug_check_bounds::<UsmeBootstrapStartResponse>(offset);
8346            // Zero out padding regions. There's no need to apply masks
8347            // because the unmasked parts will be overwritten by fields.
8348            // Write the fields.
8349            self.0.encode(encoder, offset + 0, depth)?;
8350            Ok(())
8351        }
8352    }
8353
8354    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8355        for UsmeBootstrapStartResponse
8356    {
8357        #[inline(always)]
8358        fn new_empty() -> Self {
8359            Self {
8360                inspect_vmo: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8361            }
8362        }
8363
8364        #[inline]
8365        unsafe fn decode(
8366            &mut self,
8367            decoder: &mut fidl::encoding::Decoder<
8368                '_,
8369                fidl::encoding::DefaultFuchsiaResourceDialect,
8370            >,
8371            offset: usize,
8372            _depth: fidl::encoding::Depth,
8373        ) -> fidl::Result<()> {
8374            decoder.debug_check_bounds::<Self>(offset);
8375            // Verify that padding bytes are zero.
8376            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.inspect_vmo, decoder, offset + 0, _depth)?;
8377            Ok(())
8378        }
8379    }
8380}