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