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