Skip to main content

fidl_fuchsia_wlan_sme/
fidl_fuchsia_wlan_sme.rs

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