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