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