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_net_neighbor_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct ViewOpenEntryIteratorRequest {
16 pub it: fidl::endpoints::ServerEnd<EntryIteratorMarker>,
17 pub options: EntryIteratorOptions,
19}
20
21impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
22 for ViewOpenEntryIteratorRequest
23{
24}
25
26#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
27pub struct ControllerMarker;
28
29impl fidl::endpoints::ProtocolMarker for ControllerMarker {
30 type Proxy = ControllerProxy;
31 type RequestStream = ControllerRequestStream;
32 #[cfg(target_os = "fuchsia")]
33 type SynchronousProxy = ControllerSynchronousProxy;
34
35 const DEBUG_NAME: &'static str = "fuchsia.net.neighbor.Controller";
36}
37impl fidl::endpoints::DiscoverableProtocolMarker for ControllerMarker {}
38pub type ControllerAddEntryResult = Result<(), i32>;
39pub type ControllerRemoveEntryResult = Result<(), i32>;
40pub type ControllerClearEntriesResult = Result<(), i32>;
41
42pub trait ControllerProxyInterface: Send + Sync {
43 type AddEntryResponseFut: std::future::Future<Output = Result<ControllerAddEntryResult, fidl::Error>>
44 + Send;
45 fn r#add_entry(
46 &self,
47 interface: u64,
48 neighbor: &fidl_fuchsia_net::IpAddress,
49 mac: &fidl_fuchsia_net::MacAddress,
50 ) -> Self::AddEntryResponseFut;
51 type RemoveEntryResponseFut: std::future::Future<Output = Result<ControllerRemoveEntryResult, fidl::Error>>
52 + Send;
53 fn r#remove_entry(
54 &self,
55 interface: u64,
56 neighbor: &fidl_fuchsia_net::IpAddress,
57 ) -> Self::RemoveEntryResponseFut;
58 type ClearEntriesResponseFut: std::future::Future<Output = Result<ControllerClearEntriesResult, fidl::Error>>
59 + Send;
60 fn r#clear_entries(
61 &self,
62 interface: u64,
63 ip_version: fidl_fuchsia_net::IpVersion,
64 ) -> Self::ClearEntriesResponseFut;
65}
66#[derive(Debug)]
67#[cfg(target_os = "fuchsia")]
68pub struct ControllerSynchronousProxy {
69 client: fidl::client::sync::Client,
70}
71
72#[cfg(target_os = "fuchsia")]
73impl fidl::endpoints::SynchronousProxy for ControllerSynchronousProxy {
74 type Proxy = ControllerProxy;
75 type Protocol = ControllerMarker;
76
77 fn from_channel(inner: fidl::Channel) -> Self {
78 Self::new(inner)
79 }
80
81 fn into_channel(self) -> fidl::Channel {
82 self.client.into_channel()
83 }
84
85 fn as_channel(&self) -> &fidl::Channel {
86 self.client.as_channel()
87 }
88}
89
90#[cfg(target_os = "fuchsia")]
91impl ControllerSynchronousProxy {
92 pub fn new(channel: fidl::Channel) -> Self {
93 let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
94 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
95 }
96
97 pub fn into_channel(self) -> fidl::Channel {
98 self.client.into_channel()
99 }
100
101 pub fn wait_for_event(
104 &self,
105 deadline: zx::MonotonicInstant,
106 ) -> Result<ControllerEvent, fidl::Error> {
107 ControllerEvent::decode(self.client.wait_for_event(deadline)?)
108 }
109
110 pub fn r#add_entry(
124 &self,
125 mut interface: u64,
126 mut neighbor: &fidl_fuchsia_net::IpAddress,
127 mut mac: &fidl_fuchsia_net::MacAddress,
128 ___deadline: zx::MonotonicInstant,
129 ) -> Result<ControllerAddEntryResult, fidl::Error> {
130 let _response = self.client.send_query::<
131 ControllerAddEntryRequest,
132 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
133 >(
134 (interface, neighbor, mac,),
135 0x778c829580aa23ac,
136 fidl::encoding::DynamicFlags::empty(),
137 ___deadline,
138 )?;
139 Ok(_response.map(|x| x))
140 }
141
142 pub fn r#remove_entry(
154 &self,
155 mut interface: u64,
156 mut neighbor: &fidl_fuchsia_net::IpAddress,
157 ___deadline: zx::MonotonicInstant,
158 ) -> Result<ControllerRemoveEntryResult, fidl::Error> {
159 let _response = self.client.send_query::<
160 ControllerRemoveEntryRequest,
161 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
162 >(
163 (interface, neighbor,),
164 0xfd0b52f53a0f815,
165 fidl::encoding::DynamicFlags::empty(),
166 ___deadline,
167 )?;
168 Ok(_response.map(|x| x))
169 }
170
171 pub fn r#clear_entries(
180 &self,
181 mut interface: u64,
182 mut ip_version: fidl_fuchsia_net::IpVersion,
183 ___deadline: zx::MonotonicInstant,
184 ) -> Result<ControllerClearEntriesResult, fidl::Error> {
185 let _response = self.client.send_query::<
186 ControllerClearEntriesRequest,
187 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
188 >(
189 (interface, ip_version,),
190 0x33e53d9769a999d,
191 fidl::encoding::DynamicFlags::empty(),
192 ___deadline,
193 )?;
194 Ok(_response.map(|x| x))
195 }
196}
197
198#[cfg(target_os = "fuchsia")]
199impl From<ControllerSynchronousProxy> for zx::Handle {
200 fn from(value: ControllerSynchronousProxy) -> Self {
201 value.into_channel().into()
202 }
203}
204
205#[cfg(target_os = "fuchsia")]
206impl From<fidl::Channel> for ControllerSynchronousProxy {
207 fn from(value: fidl::Channel) -> Self {
208 Self::new(value)
209 }
210}
211
212#[derive(Debug, Clone)]
213pub struct ControllerProxy {
214 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
215}
216
217impl fidl::endpoints::Proxy for ControllerProxy {
218 type Protocol = ControllerMarker;
219
220 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
221 Self::new(inner)
222 }
223
224 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
225 self.client.into_channel().map_err(|client| Self { client })
226 }
227
228 fn as_channel(&self) -> &::fidl::AsyncChannel {
229 self.client.as_channel()
230 }
231}
232
233impl ControllerProxy {
234 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
236 let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
237 Self { client: fidl::client::Client::new(channel, protocol_name) }
238 }
239
240 pub fn take_event_stream(&self) -> ControllerEventStream {
246 ControllerEventStream { event_receiver: self.client.take_event_receiver() }
247 }
248
249 pub fn r#add_entry(
263 &self,
264 mut interface: u64,
265 mut neighbor: &fidl_fuchsia_net::IpAddress,
266 mut mac: &fidl_fuchsia_net::MacAddress,
267 ) -> fidl::client::QueryResponseFut<
268 ControllerAddEntryResult,
269 fidl::encoding::DefaultFuchsiaResourceDialect,
270 > {
271 ControllerProxyInterface::r#add_entry(self, interface, neighbor, mac)
272 }
273
274 pub fn r#remove_entry(
286 &self,
287 mut interface: u64,
288 mut neighbor: &fidl_fuchsia_net::IpAddress,
289 ) -> fidl::client::QueryResponseFut<
290 ControllerRemoveEntryResult,
291 fidl::encoding::DefaultFuchsiaResourceDialect,
292 > {
293 ControllerProxyInterface::r#remove_entry(self, interface, neighbor)
294 }
295
296 pub fn r#clear_entries(
305 &self,
306 mut interface: u64,
307 mut ip_version: fidl_fuchsia_net::IpVersion,
308 ) -> fidl::client::QueryResponseFut<
309 ControllerClearEntriesResult,
310 fidl::encoding::DefaultFuchsiaResourceDialect,
311 > {
312 ControllerProxyInterface::r#clear_entries(self, interface, ip_version)
313 }
314}
315
316impl ControllerProxyInterface for ControllerProxy {
317 type AddEntryResponseFut = fidl::client::QueryResponseFut<
318 ControllerAddEntryResult,
319 fidl::encoding::DefaultFuchsiaResourceDialect,
320 >;
321 fn r#add_entry(
322 &self,
323 mut interface: u64,
324 mut neighbor: &fidl_fuchsia_net::IpAddress,
325 mut mac: &fidl_fuchsia_net::MacAddress,
326 ) -> Self::AddEntryResponseFut {
327 fn _decode(
328 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
329 ) -> Result<ControllerAddEntryResult, fidl::Error> {
330 let _response = fidl::client::decode_transaction_body::<
331 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
332 fidl::encoding::DefaultFuchsiaResourceDialect,
333 0x778c829580aa23ac,
334 >(_buf?)?;
335 Ok(_response.map(|x| x))
336 }
337 self.client.send_query_and_decode::<ControllerAddEntryRequest, ControllerAddEntryResult>(
338 (interface, neighbor, mac),
339 0x778c829580aa23ac,
340 fidl::encoding::DynamicFlags::empty(),
341 _decode,
342 )
343 }
344
345 type RemoveEntryResponseFut = fidl::client::QueryResponseFut<
346 ControllerRemoveEntryResult,
347 fidl::encoding::DefaultFuchsiaResourceDialect,
348 >;
349 fn r#remove_entry(
350 &self,
351 mut interface: u64,
352 mut neighbor: &fidl_fuchsia_net::IpAddress,
353 ) -> Self::RemoveEntryResponseFut {
354 fn _decode(
355 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
356 ) -> Result<ControllerRemoveEntryResult, fidl::Error> {
357 let _response = fidl::client::decode_transaction_body::<
358 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
359 fidl::encoding::DefaultFuchsiaResourceDialect,
360 0xfd0b52f53a0f815,
361 >(_buf?)?;
362 Ok(_response.map(|x| x))
363 }
364 self.client
365 .send_query_and_decode::<ControllerRemoveEntryRequest, ControllerRemoveEntryResult>(
366 (interface, neighbor),
367 0xfd0b52f53a0f815,
368 fidl::encoding::DynamicFlags::empty(),
369 _decode,
370 )
371 }
372
373 type ClearEntriesResponseFut = fidl::client::QueryResponseFut<
374 ControllerClearEntriesResult,
375 fidl::encoding::DefaultFuchsiaResourceDialect,
376 >;
377 fn r#clear_entries(
378 &self,
379 mut interface: u64,
380 mut ip_version: fidl_fuchsia_net::IpVersion,
381 ) -> Self::ClearEntriesResponseFut {
382 fn _decode(
383 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
384 ) -> Result<ControllerClearEntriesResult, fidl::Error> {
385 let _response = fidl::client::decode_transaction_body::<
386 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
387 fidl::encoding::DefaultFuchsiaResourceDialect,
388 0x33e53d9769a999d,
389 >(_buf?)?;
390 Ok(_response.map(|x| x))
391 }
392 self.client
393 .send_query_and_decode::<ControllerClearEntriesRequest, ControllerClearEntriesResult>(
394 (interface, ip_version),
395 0x33e53d9769a999d,
396 fidl::encoding::DynamicFlags::empty(),
397 _decode,
398 )
399 }
400}
401
402pub struct ControllerEventStream {
403 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
404}
405
406impl std::marker::Unpin for ControllerEventStream {}
407
408impl futures::stream::FusedStream for ControllerEventStream {
409 fn is_terminated(&self) -> bool {
410 self.event_receiver.is_terminated()
411 }
412}
413
414impl futures::Stream for ControllerEventStream {
415 type Item = Result<ControllerEvent, fidl::Error>;
416
417 fn poll_next(
418 mut self: std::pin::Pin<&mut Self>,
419 cx: &mut std::task::Context<'_>,
420 ) -> std::task::Poll<Option<Self::Item>> {
421 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
422 &mut self.event_receiver,
423 cx
424 )?) {
425 Some(buf) => std::task::Poll::Ready(Some(ControllerEvent::decode(buf))),
426 None => std::task::Poll::Ready(None),
427 }
428 }
429}
430
431#[derive(Debug)]
432pub enum ControllerEvent {}
433
434impl ControllerEvent {
435 fn decode(
437 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
438 ) -> Result<ControllerEvent, fidl::Error> {
439 let (bytes, _handles) = buf.split_mut();
440 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
441 debug_assert_eq!(tx_header.tx_id, 0);
442 match tx_header.ordinal {
443 _ => Err(fidl::Error::UnknownOrdinal {
444 ordinal: tx_header.ordinal,
445 protocol_name: <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
446 }),
447 }
448 }
449}
450
451pub struct ControllerRequestStream {
453 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
454 is_terminated: bool,
455}
456
457impl std::marker::Unpin for ControllerRequestStream {}
458
459impl futures::stream::FusedStream for ControllerRequestStream {
460 fn is_terminated(&self) -> bool {
461 self.is_terminated
462 }
463}
464
465impl fidl::endpoints::RequestStream for ControllerRequestStream {
466 type Protocol = ControllerMarker;
467 type ControlHandle = ControllerControlHandle;
468
469 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
470 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
471 }
472
473 fn control_handle(&self) -> Self::ControlHandle {
474 ControllerControlHandle { inner: self.inner.clone() }
475 }
476
477 fn into_inner(
478 self,
479 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
480 {
481 (self.inner, self.is_terminated)
482 }
483
484 fn from_inner(
485 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
486 is_terminated: bool,
487 ) -> Self {
488 Self { inner, is_terminated }
489 }
490}
491
492impl futures::Stream for ControllerRequestStream {
493 type Item = Result<ControllerRequest, fidl::Error>;
494
495 fn poll_next(
496 mut self: std::pin::Pin<&mut Self>,
497 cx: &mut std::task::Context<'_>,
498 ) -> std::task::Poll<Option<Self::Item>> {
499 let this = &mut *self;
500 if this.inner.check_shutdown(cx) {
501 this.is_terminated = true;
502 return std::task::Poll::Ready(None);
503 }
504 if this.is_terminated {
505 panic!("polled ControllerRequestStream after completion");
506 }
507 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
508 |bytes, handles| {
509 match this.inner.channel().read_etc(cx, bytes, handles) {
510 std::task::Poll::Ready(Ok(())) => {}
511 std::task::Poll::Pending => return std::task::Poll::Pending,
512 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
513 this.is_terminated = true;
514 return std::task::Poll::Ready(None);
515 }
516 std::task::Poll::Ready(Err(e)) => {
517 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
518 e.into(),
519 ))))
520 }
521 }
522
523 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
525
526 std::task::Poll::Ready(Some(match header.ordinal {
527 0x778c829580aa23ac => {
528 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
529 let mut req = fidl::new_empty!(
530 ControllerAddEntryRequest,
531 fidl::encoding::DefaultFuchsiaResourceDialect
532 );
533 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerAddEntryRequest>(&header, _body_bytes, handles, &mut req)?;
534 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
535 Ok(ControllerRequest::AddEntry {
536 interface: req.interface,
537 neighbor: req.neighbor,
538 mac: req.mac,
539
540 responder: ControllerAddEntryResponder {
541 control_handle: std::mem::ManuallyDrop::new(control_handle),
542 tx_id: header.tx_id,
543 },
544 })
545 }
546 0xfd0b52f53a0f815 => {
547 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
548 let mut req = fidl::new_empty!(
549 ControllerRemoveEntryRequest,
550 fidl::encoding::DefaultFuchsiaResourceDialect
551 );
552 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerRemoveEntryRequest>(&header, _body_bytes, handles, &mut req)?;
553 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
554 Ok(ControllerRequest::RemoveEntry {
555 interface: req.interface,
556 neighbor: req.neighbor,
557
558 responder: ControllerRemoveEntryResponder {
559 control_handle: std::mem::ManuallyDrop::new(control_handle),
560 tx_id: header.tx_id,
561 },
562 })
563 }
564 0x33e53d9769a999d => {
565 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
566 let mut req = fidl::new_empty!(
567 ControllerClearEntriesRequest,
568 fidl::encoding::DefaultFuchsiaResourceDialect
569 );
570 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerClearEntriesRequest>(&header, _body_bytes, handles, &mut req)?;
571 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
572 Ok(ControllerRequest::ClearEntries {
573 interface: req.interface,
574 ip_version: req.ip_version,
575
576 responder: ControllerClearEntriesResponder {
577 control_handle: std::mem::ManuallyDrop::new(control_handle),
578 tx_id: header.tx_id,
579 },
580 })
581 }
582 _ => Err(fidl::Error::UnknownOrdinal {
583 ordinal: header.ordinal,
584 protocol_name:
585 <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
586 }),
587 }))
588 },
589 )
590 }
591}
592
593#[derive(Debug)]
595pub enum ControllerRequest {
596 AddEntry {
610 interface: u64,
611 neighbor: fidl_fuchsia_net::IpAddress,
612 mac: fidl_fuchsia_net::MacAddress,
613 responder: ControllerAddEntryResponder,
614 },
615 RemoveEntry {
627 interface: u64,
628 neighbor: fidl_fuchsia_net::IpAddress,
629 responder: ControllerRemoveEntryResponder,
630 },
631 ClearEntries {
640 interface: u64,
641 ip_version: fidl_fuchsia_net::IpVersion,
642 responder: ControllerClearEntriesResponder,
643 },
644}
645
646impl ControllerRequest {
647 #[allow(irrefutable_let_patterns)]
648 pub fn into_add_entry(
649 self,
650 ) -> Option<(
651 u64,
652 fidl_fuchsia_net::IpAddress,
653 fidl_fuchsia_net::MacAddress,
654 ControllerAddEntryResponder,
655 )> {
656 if let ControllerRequest::AddEntry { interface, neighbor, mac, responder } = self {
657 Some((interface, neighbor, mac, responder))
658 } else {
659 None
660 }
661 }
662
663 #[allow(irrefutable_let_patterns)]
664 pub fn into_remove_entry(
665 self,
666 ) -> Option<(u64, fidl_fuchsia_net::IpAddress, ControllerRemoveEntryResponder)> {
667 if let ControllerRequest::RemoveEntry { interface, neighbor, responder } = self {
668 Some((interface, neighbor, responder))
669 } else {
670 None
671 }
672 }
673
674 #[allow(irrefutable_let_patterns)]
675 pub fn into_clear_entries(
676 self,
677 ) -> Option<(u64, fidl_fuchsia_net::IpVersion, ControllerClearEntriesResponder)> {
678 if let ControllerRequest::ClearEntries { interface, ip_version, responder } = self {
679 Some((interface, ip_version, responder))
680 } else {
681 None
682 }
683 }
684
685 pub fn method_name(&self) -> &'static str {
687 match *self {
688 ControllerRequest::AddEntry { .. } => "add_entry",
689 ControllerRequest::RemoveEntry { .. } => "remove_entry",
690 ControllerRequest::ClearEntries { .. } => "clear_entries",
691 }
692 }
693}
694
695#[derive(Debug, Clone)]
696pub struct ControllerControlHandle {
697 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
698}
699
700impl fidl::endpoints::ControlHandle for ControllerControlHandle {
701 fn shutdown(&self) {
702 self.inner.shutdown()
703 }
704 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
705 self.inner.shutdown_with_epitaph(status)
706 }
707
708 fn is_closed(&self) -> bool {
709 self.inner.channel().is_closed()
710 }
711 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
712 self.inner.channel().on_closed()
713 }
714
715 #[cfg(target_os = "fuchsia")]
716 fn signal_peer(
717 &self,
718 clear_mask: zx::Signals,
719 set_mask: zx::Signals,
720 ) -> Result<(), zx_status::Status> {
721 use fidl::Peered;
722 self.inner.channel().signal_peer(clear_mask, set_mask)
723 }
724}
725
726impl ControllerControlHandle {}
727
728#[must_use = "FIDL methods require a response to be sent"]
729#[derive(Debug)]
730pub struct ControllerAddEntryResponder {
731 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
732 tx_id: u32,
733}
734
735impl std::ops::Drop for ControllerAddEntryResponder {
739 fn drop(&mut self) {
740 self.control_handle.shutdown();
741 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
743 }
744}
745
746impl fidl::endpoints::Responder for ControllerAddEntryResponder {
747 type ControlHandle = ControllerControlHandle;
748
749 fn control_handle(&self) -> &ControllerControlHandle {
750 &self.control_handle
751 }
752
753 fn drop_without_shutdown(mut self) {
754 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
756 std::mem::forget(self);
758 }
759}
760
761impl ControllerAddEntryResponder {
762 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
766 let _result = self.send_raw(result);
767 if _result.is_err() {
768 self.control_handle.shutdown();
769 }
770 self.drop_without_shutdown();
771 _result
772 }
773
774 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
776 let _result = self.send_raw(result);
777 self.drop_without_shutdown();
778 _result
779 }
780
781 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
782 self.control_handle
783 .inner
784 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
785 result,
786 self.tx_id,
787 0x778c829580aa23ac,
788 fidl::encoding::DynamicFlags::empty(),
789 )
790 }
791}
792
793#[must_use = "FIDL methods require a response to be sent"]
794#[derive(Debug)]
795pub struct ControllerRemoveEntryResponder {
796 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
797 tx_id: u32,
798}
799
800impl std::ops::Drop for ControllerRemoveEntryResponder {
804 fn drop(&mut self) {
805 self.control_handle.shutdown();
806 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
808 }
809}
810
811impl fidl::endpoints::Responder for ControllerRemoveEntryResponder {
812 type ControlHandle = ControllerControlHandle;
813
814 fn control_handle(&self) -> &ControllerControlHandle {
815 &self.control_handle
816 }
817
818 fn drop_without_shutdown(mut self) {
819 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
821 std::mem::forget(self);
823 }
824}
825
826impl ControllerRemoveEntryResponder {
827 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
831 let _result = self.send_raw(result);
832 if _result.is_err() {
833 self.control_handle.shutdown();
834 }
835 self.drop_without_shutdown();
836 _result
837 }
838
839 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
841 let _result = self.send_raw(result);
842 self.drop_without_shutdown();
843 _result
844 }
845
846 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
847 self.control_handle
848 .inner
849 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
850 result,
851 self.tx_id,
852 0xfd0b52f53a0f815,
853 fidl::encoding::DynamicFlags::empty(),
854 )
855 }
856}
857
858#[must_use = "FIDL methods require a response to be sent"]
859#[derive(Debug)]
860pub struct ControllerClearEntriesResponder {
861 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
862 tx_id: u32,
863}
864
865impl std::ops::Drop for ControllerClearEntriesResponder {
869 fn drop(&mut self) {
870 self.control_handle.shutdown();
871 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
873 }
874}
875
876impl fidl::endpoints::Responder for ControllerClearEntriesResponder {
877 type ControlHandle = ControllerControlHandle;
878
879 fn control_handle(&self) -> &ControllerControlHandle {
880 &self.control_handle
881 }
882
883 fn drop_without_shutdown(mut self) {
884 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
886 std::mem::forget(self);
888 }
889}
890
891impl ControllerClearEntriesResponder {
892 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
896 let _result = self.send_raw(result);
897 if _result.is_err() {
898 self.control_handle.shutdown();
899 }
900 self.drop_without_shutdown();
901 _result
902 }
903
904 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
906 let _result = self.send_raw(result);
907 self.drop_without_shutdown();
908 _result
909 }
910
911 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
912 self.control_handle
913 .inner
914 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
915 result,
916 self.tx_id,
917 0x33e53d9769a999d,
918 fidl::encoding::DynamicFlags::empty(),
919 )
920 }
921}
922
923#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
924pub struct EntryIteratorMarker;
925
926impl fidl::endpoints::ProtocolMarker for EntryIteratorMarker {
927 type Proxy = EntryIteratorProxy;
928 type RequestStream = EntryIteratorRequestStream;
929 #[cfg(target_os = "fuchsia")]
930 type SynchronousProxy = EntryIteratorSynchronousProxy;
931
932 const DEBUG_NAME: &'static str = "(anonymous) EntryIterator";
933}
934
935pub trait EntryIteratorProxyInterface: Send + Sync {
936 type GetNextResponseFut: std::future::Future<Output = Result<Vec<EntryIteratorItem>, fidl::Error>>
937 + Send;
938 fn r#get_next(&self) -> Self::GetNextResponseFut;
939}
940#[derive(Debug)]
941#[cfg(target_os = "fuchsia")]
942pub struct EntryIteratorSynchronousProxy {
943 client: fidl::client::sync::Client,
944}
945
946#[cfg(target_os = "fuchsia")]
947impl fidl::endpoints::SynchronousProxy for EntryIteratorSynchronousProxy {
948 type Proxy = EntryIteratorProxy;
949 type Protocol = EntryIteratorMarker;
950
951 fn from_channel(inner: fidl::Channel) -> Self {
952 Self::new(inner)
953 }
954
955 fn into_channel(self) -> fidl::Channel {
956 self.client.into_channel()
957 }
958
959 fn as_channel(&self) -> &fidl::Channel {
960 self.client.as_channel()
961 }
962}
963
964#[cfg(target_os = "fuchsia")]
965impl EntryIteratorSynchronousProxy {
966 pub fn new(channel: fidl::Channel) -> Self {
967 let protocol_name = <EntryIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
968 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
969 }
970
971 pub fn into_channel(self) -> fidl::Channel {
972 self.client.into_channel()
973 }
974
975 pub fn wait_for_event(
978 &self,
979 deadline: zx::MonotonicInstant,
980 ) -> Result<EntryIteratorEvent, fidl::Error> {
981 EntryIteratorEvent::decode(self.client.wait_for_event(deadline)?)
982 }
983
984 pub fn r#get_next(
998 &self,
999 ___deadline: zx::MonotonicInstant,
1000 ) -> Result<Vec<EntryIteratorItem>, fidl::Error> {
1001 let _response =
1002 self.client.send_query::<fidl::encoding::EmptyPayload, EntryIteratorGetNextResponse>(
1003 (),
1004 0x6d03407803da8647,
1005 fidl::encoding::DynamicFlags::empty(),
1006 ___deadline,
1007 )?;
1008 Ok(_response.events)
1009 }
1010}
1011
1012#[cfg(target_os = "fuchsia")]
1013impl From<EntryIteratorSynchronousProxy> for zx::Handle {
1014 fn from(value: EntryIteratorSynchronousProxy) -> Self {
1015 value.into_channel().into()
1016 }
1017}
1018
1019#[cfg(target_os = "fuchsia")]
1020impl From<fidl::Channel> for EntryIteratorSynchronousProxy {
1021 fn from(value: fidl::Channel) -> Self {
1022 Self::new(value)
1023 }
1024}
1025
1026#[derive(Debug, Clone)]
1027pub struct EntryIteratorProxy {
1028 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1029}
1030
1031impl fidl::endpoints::Proxy for EntryIteratorProxy {
1032 type Protocol = EntryIteratorMarker;
1033
1034 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1035 Self::new(inner)
1036 }
1037
1038 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1039 self.client.into_channel().map_err(|client| Self { client })
1040 }
1041
1042 fn as_channel(&self) -> &::fidl::AsyncChannel {
1043 self.client.as_channel()
1044 }
1045}
1046
1047impl EntryIteratorProxy {
1048 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1050 let protocol_name = <EntryIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1051 Self { client: fidl::client::Client::new(channel, protocol_name) }
1052 }
1053
1054 pub fn take_event_stream(&self) -> EntryIteratorEventStream {
1060 EntryIteratorEventStream { event_receiver: self.client.take_event_receiver() }
1061 }
1062
1063 pub fn r#get_next(
1077 &self,
1078 ) -> fidl::client::QueryResponseFut<
1079 Vec<EntryIteratorItem>,
1080 fidl::encoding::DefaultFuchsiaResourceDialect,
1081 > {
1082 EntryIteratorProxyInterface::r#get_next(self)
1083 }
1084}
1085
1086impl EntryIteratorProxyInterface for EntryIteratorProxy {
1087 type GetNextResponseFut = fidl::client::QueryResponseFut<
1088 Vec<EntryIteratorItem>,
1089 fidl::encoding::DefaultFuchsiaResourceDialect,
1090 >;
1091 fn r#get_next(&self) -> Self::GetNextResponseFut {
1092 fn _decode(
1093 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1094 ) -> Result<Vec<EntryIteratorItem>, fidl::Error> {
1095 let _response = fidl::client::decode_transaction_body::<
1096 EntryIteratorGetNextResponse,
1097 fidl::encoding::DefaultFuchsiaResourceDialect,
1098 0x6d03407803da8647,
1099 >(_buf?)?;
1100 Ok(_response.events)
1101 }
1102 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<EntryIteratorItem>>(
1103 (),
1104 0x6d03407803da8647,
1105 fidl::encoding::DynamicFlags::empty(),
1106 _decode,
1107 )
1108 }
1109}
1110
1111pub struct EntryIteratorEventStream {
1112 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1113}
1114
1115impl std::marker::Unpin for EntryIteratorEventStream {}
1116
1117impl futures::stream::FusedStream for EntryIteratorEventStream {
1118 fn is_terminated(&self) -> bool {
1119 self.event_receiver.is_terminated()
1120 }
1121}
1122
1123impl futures::Stream for EntryIteratorEventStream {
1124 type Item = Result<EntryIteratorEvent, fidl::Error>;
1125
1126 fn poll_next(
1127 mut self: std::pin::Pin<&mut Self>,
1128 cx: &mut std::task::Context<'_>,
1129 ) -> std::task::Poll<Option<Self::Item>> {
1130 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1131 &mut self.event_receiver,
1132 cx
1133 )?) {
1134 Some(buf) => std::task::Poll::Ready(Some(EntryIteratorEvent::decode(buf))),
1135 None => std::task::Poll::Ready(None),
1136 }
1137 }
1138}
1139
1140#[derive(Debug)]
1141pub enum EntryIteratorEvent {}
1142
1143impl EntryIteratorEvent {
1144 fn decode(
1146 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1147 ) -> Result<EntryIteratorEvent, fidl::Error> {
1148 let (bytes, _handles) = buf.split_mut();
1149 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1150 debug_assert_eq!(tx_header.tx_id, 0);
1151 match tx_header.ordinal {
1152 _ => Err(fidl::Error::UnknownOrdinal {
1153 ordinal: tx_header.ordinal,
1154 protocol_name: <EntryIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1155 }),
1156 }
1157 }
1158}
1159
1160pub struct EntryIteratorRequestStream {
1162 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1163 is_terminated: bool,
1164}
1165
1166impl std::marker::Unpin for EntryIteratorRequestStream {}
1167
1168impl futures::stream::FusedStream for EntryIteratorRequestStream {
1169 fn is_terminated(&self) -> bool {
1170 self.is_terminated
1171 }
1172}
1173
1174impl fidl::endpoints::RequestStream for EntryIteratorRequestStream {
1175 type Protocol = EntryIteratorMarker;
1176 type ControlHandle = EntryIteratorControlHandle;
1177
1178 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1179 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1180 }
1181
1182 fn control_handle(&self) -> Self::ControlHandle {
1183 EntryIteratorControlHandle { inner: self.inner.clone() }
1184 }
1185
1186 fn into_inner(
1187 self,
1188 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1189 {
1190 (self.inner, self.is_terminated)
1191 }
1192
1193 fn from_inner(
1194 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1195 is_terminated: bool,
1196 ) -> Self {
1197 Self { inner, is_terminated }
1198 }
1199}
1200
1201impl futures::Stream for EntryIteratorRequestStream {
1202 type Item = Result<EntryIteratorRequest, fidl::Error>;
1203
1204 fn poll_next(
1205 mut self: std::pin::Pin<&mut Self>,
1206 cx: &mut std::task::Context<'_>,
1207 ) -> std::task::Poll<Option<Self::Item>> {
1208 let this = &mut *self;
1209 if this.inner.check_shutdown(cx) {
1210 this.is_terminated = true;
1211 return std::task::Poll::Ready(None);
1212 }
1213 if this.is_terminated {
1214 panic!("polled EntryIteratorRequestStream after completion");
1215 }
1216 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1217 |bytes, handles| {
1218 match this.inner.channel().read_etc(cx, bytes, handles) {
1219 std::task::Poll::Ready(Ok(())) => {}
1220 std::task::Poll::Pending => return std::task::Poll::Pending,
1221 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1222 this.is_terminated = true;
1223 return std::task::Poll::Ready(None);
1224 }
1225 std::task::Poll::Ready(Err(e)) => {
1226 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1227 e.into(),
1228 ))))
1229 }
1230 }
1231
1232 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1234
1235 std::task::Poll::Ready(Some(match header.ordinal {
1236 0x6d03407803da8647 => {
1237 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1238 let mut req = fidl::new_empty!(
1239 fidl::encoding::EmptyPayload,
1240 fidl::encoding::DefaultFuchsiaResourceDialect
1241 );
1242 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1243 let control_handle =
1244 EntryIteratorControlHandle { inner: this.inner.clone() };
1245 Ok(EntryIteratorRequest::GetNext {
1246 responder: EntryIteratorGetNextResponder {
1247 control_handle: std::mem::ManuallyDrop::new(control_handle),
1248 tx_id: header.tx_id,
1249 },
1250 })
1251 }
1252 _ => Err(fidl::Error::UnknownOrdinal {
1253 ordinal: header.ordinal,
1254 protocol_name:
1255 <EntryIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1256 }),
1257 }))
1258 },
1259 )
1260 }
1261}
1262
1263#[derive(Debug)]
1271pub enum EntryIteratorRequest {
1272 GetNext { responder: EntryIteratorGetNextResponder },
1286}
1287
1288impl EntryIteratorRequest {
1289 #[allow(irrefutable_let_patterns)]
1290 pub fn into_get_next(self) -> Option<(EntryIteratorGetNextResponder)> {
1291 if let EntryIteratorRequest::GetNext { responder } = self {
1292 Some((responder))
1293 } else {
1294 None
1295 }
1296 }
1297
1298 pub fn method_name(&self) -> &'static str {
1300 match *self {
1301 EntryIteratorRequest::GetNext { .. } => "get_next",
1302 }
1303 }
1304}
1305
1306#[derive(Debug, Clone)]
1307pub struct EntryIteratorControlHandle {
1308 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1309}
1310
1311impl fidl::endpoints::ControlHandle for EntryIteratorControlHandle {
1312 fn shutdown(&self) {
1313 self.inner.shutdown()
1314 }
1315 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1316 self.inner.shutdown_with_epitaph(status)
1317 }
1318
1319 fn is_closed(&self) -> bool {
1320 self.inner.channel().is_closed()
1321 }
1322 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1323 self.inner.channel().on_closed()
1324 }
1325
1326 #[cfg(target_os = "fuchsia")]
1327 fn signal_peer(
1328 &self,
1329 clear_mask: zx::Signals,
1330 set_mask: zx::Signals,
1331 ) -> Result<(), zx_status::Status> {
1332 use fidl::Peered;
1333 self.inner.channel().signal_peer(clear_mask, set_mask)
1334 }
1335}
1336
1337impl EntryIteratorControlHandle {}
1338
1339#[must_use = "FIDL methods require a response to be sent"]
1340#[derive(Debug)]
1341pub struct EntryIteratorGetNextResponder {
1342 control_handle: std::mem::ManuallyDrop<EntryIteratorControlHandle>,
1343 tx_id: u32,
1344}
1345
1346impl std::ops::Drop for EntryIteratorGetNextResponder {
1350 fn drop(&mut self) {
1351 self.control_handle.shutdown();
1352 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1354 }
1355}
1356
1357impl fidl::endpoints::Responder for EntryIteratorGetNextResponder {
1358 type ControlHandle = EntryIteratorControlHandle;
1359
1360 fn control_handle(&self) -> &EntryIteratorControlHandle {
1361 &self.control_handle
1362 }
1363
1364 fn drop_without_shutdown(mut self) {
1365 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1367 std::mem::forget(self);
1369 }
1370}
1371
1372impl EntryIteratorGetNextResponder {
1373 pub fn send(self, mut events: &[EntryIteratorItem]) -> Result<(), fidl::Error> {
1377 let _result = self.send_raw(events);
1378 if _result.is_err() {
1379 self.control_handle.shutdown();
1380 }
1381 self.drop_without_shutdown();
1382 _result
1383 }
1384
1385 pub fn send_no_shutdown_on_err(
1387 self,
1388 mut events: &[EntryIteratorItem],
1389 ) -> Result<(), fidl::Error> {
1390 let _result = self.send_raw(events);
1391 self.drop_without_shutdown();
1392 _result
1393 }
1394
1395 fn send_raw(&self, mut events: &[EntryIteratorItem]) -> Result<(), fidl::Error> {
1396 self.control_handle.inner.send::<EntryIteratorGetNextResponse>(
1397 (events,),
1398 self.tx_id,
1399 0x6d03407803da8647,
1400 fidl::encoding::DynamicFlags::empty(),
1401 )
1402 }
1403}
1404
1405#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1406pub struct ViewMarker;
1407
1408impl fidl::endpoints::ProtocolMarker for ViewMarker {
1409 type Proxy = ViewProxy;
1410 type RequestStream = ViewRequestStream;
1411 #[cfg(target_os = "fuchsia")]
1412 type SynchronousProxy = ViewSynchronousProxy;
1413
1414 const DEBUG_NAME: &'static str = "fuchsia.net.neighbor.View";
1415}
1416impl fidl::endpoints::DiscoverableProtocolMarker for ViewMarker {}
1417
1418pub trait ViewProxyInterface: Send + Sync {
1419 fn r#open_entry_iterator(
1420 &self,
1421 it: fidl::endpoints::ServerEnd<EntryIteratorMarker>,
1422 options: &EntryIteratorOptions,
1423 ) -> Result<(), fidl::Error>;
1424}
1425#[derive(Debug)]
1426#[cfg(target_os = "fuchsia")]
1427pub struct ViewSynchronousProxy {
1428 client: fidl::client::sync::Client,
1429}
1430
1431#[cfg(target_os = "fuchsia")]
1432impl fidl::endpoints::SynchronousProxy for ViewSynchronousProxy {
1433 type Proxy = ViewProxy;
1434 type Protocol = ViewMarker;
1435
1436 fn from_channel(inner: fidl::Channel) -> Self {
1437 Self::new(inner)
1438 }
1439
1440 fn into_channel(self) -> fidl::Channel {
1441 self.client.into_channel()
1442 }
1443
1444 fn as_channel(&self) -> &fidl::Channel {
1445 self.client.as_channel()
1446 }
1447}
1448
1449#[cfg(target_os = "fuchsia")]
1450impl ViewSynchronousProxy {
1451 pub fn new(channel: fidl::Channel) -> Self {
1452 let protocol_name = <ViewMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1453 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1454 }
1455
1456 pub fn into_channel(self) -> fidl::Channel {
1457 self.client.into_channel()
1458 }
1459
1460 pub fn wait_for_event(&self, deadline: zx::MonotonicInstant) -> Result<ViewEvent, fidl::Error> {
1463 ViewEvent::decode(self.client.wait_for_event(deadline)?)
1464 }
1465
1466 pub fn r#open_entry_iterator(
1472 &self,
1473 mut it: fidl::endpoints::ServerEnd<EntryIteratorMarker>,
1474 mut options: &EntryIteratorOptions,
1475 ) -> Result<(), fidl::Error> {
1476 self.client.send::<ViewOpenEntryIteratorRequest>(
1477 (it, options),
1478 0x3c9531929383e911,
1479 fidl::encoding::DynamicFlags::empty(),
1480 )
1481 }
1482}
1483
1484#[cfg(target_os = "fuchsia")]
1485impl From<ViewSynchronousProxy> for zx::Handle {
1486 fn from(value: ViewSynchronousProxy) -> Self {
1487 value.into_channel().into()
1488 }
1489}
1490
1491#[cfg(target_os = "fuchsia")]
1492impl From<fidl::Channel> for ViewSynchronousProxy {
1493 fn from(value: fidl::Channel) -> Self {
1494 Self::new(value)
1495 }
1496}
1497
1498#[derive(Debug, Clone)]
1499pub struct ViewProxy {
1500 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1501}
1502
1503impl fidl::endpoints::Proxy for ViewProxy {
1504 type Protocol = ViewMarker;
1505
1506 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1507 Self::new(inner)
1508 }
1509
1510 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1511 self.client.into_channel().map_err(|client| Self { client })
1512 }
1513
1514 fn as_channel(&self) -> &::fidl::AsyncChannel {
1515 self.client.as_channel()
1516 }
1517}
1518
1519impl ViewProxy {
1520 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1522 let protocol_name = <ViewMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1523 Self { client: fidl::client::Client::new(channel, protocol_name) }
1524 }
1525
1526 pub fn take_event_stream(&self) -> ViewEventStream {
1532 ViewEventStream { event_receiver: self.client.take_event_receiver() }
1533 }
1534
1535 pub fn r#open_entry_iterator(
1541 &self,
1542 mut it: fidl::endpoints::ServerEnd<EntryIteratorMarker>,
1543 mut options: &EntryIteratorOptions,
1544 ) -> Result<(), fidl::Error> {
1545 ViewProxyInterface::r#open_entry_iterator(self, it, options)
1546 }
1547}
1548
1549impl ViewProxyInterface for ViewProxy {
1550 fn r#open_entry_iterator(
1551 &self,
1552 mut it: fidl::endpoints::ServerEnd<EntryIteratorMarker>,
1553 mut options: &EntryIteratorOptions,
1554 ) -> Result<(), fidl::Error> {
1555 self.client.send::<ViewOpenEntryIteratorRequest>(
1556 (it, options),
1557 0x3c9531929383e911,
1558 fidl::encoding::DynamicFlags::empty(),
1559 )
1560 }
1561}
1562
1563pub struct ViewEventStream {
1564 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1565}
1566
1567impl std::marker::Unpin for ViewEventStream {}
1568
1569impl futures::stream::FusedStream for ViewEventStream {
1570 fn is_terminated(&self) -> bool {
1571 self.event_receiver.is_terminated()
1572 }
1573}
1574
1575impl futures::Stream for ViewEventStream {
1576 type Item = Result<ViewEvent, fidl::Error>;
1577
1578 fn poll_next(
1579 mut self: std::pin::Pin<&mut Self>,
1580 cx: &mut std::task::Context<'_>,
1581 ) -> std::task::Poll<Option<Self::Item>> {
1582 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1583 &mut self.event_receiver,
1584 cx
1585 )?) {
1586 Some(buf) => std::task::Poll::Ready(Some(ViewEvent::decode(buf))),
1587 None => std::task::Poll::Ready(None),
1588 }
1589 }
1590}
1591
1592#[derive(Debug)]
1593pub enum ViewEvent {}
1594
1595impl ViewEvent {
1596 fn decode(
1598 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1599 ) -> Result<ViewEvent, fidl::Error> {
1600 let (bytes, _handles) = buf.split_mut();
1601 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1602 debug_assert_eq!(tx_header.tx_id, 0);
1603 match tx_header.ordinal {
1604 _ => Err(fidl::Error::UnknownOrdinal {
1605 ordinal: tx_header.ordinal,
1606 protocol_name: <ViewMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1607 }),
1608 }
1609 }
1610}
1611
1612pub struct ViewRequestStream {
1614 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1615 is_terminated: bool,
1616}
1617
1618impl std::marker::Unpin for ViewRequestStream {}
1619
1620impl futures::stream::FusedStream for ViewRequestStream {
1621 fn is_terminated(&self) -> bool {
1622 self.is_terminated
1623 }
1624}
1625
1626impl fidl::endpoints::RequestStream for ViewRequestStream {
1627 type Protocol = ViewMarker;
1628 type ControlHandle = ViewControlHandle;
1629
1630 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1631 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1632 }
1633
1634 fn control_handle(&self) -> Self::ControlHandle {
1635 ViewControlHandle { inner: self.inner.clone() }
1636 }
1637
1638 fn into_inner(
1639 self,
1640 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1641 {
1642 (self.inner, self.is_terminated)
1643 }
1644
1645 fn from_inner(
1646 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1647 is_terminated: bool,
1648 ) -> Self {
1649 Self { inner, is_terminated }
1650 }
1651}
1652
1653impl futures::Stream for ViewRequestStream {
1654 type Item = Result<ViewRequest, fidl::Error>;
1655
1656 fn poll_next(
1657 mut self: std::pin::Pin<&mut Self>,
1658 cx: &mut std::task::Context<'_>,
1659 ) -> std::task::Poll<Option<Self::Item>> {
1660 let this = &mut *self;
1661 if this.inner.check_shutdown(cx) {
1662 this.is_terminated = true;
1663 return std::task::Poll::Ready(None);
1664 }
1665 if this.is_terminated {
1666 panic!("polled ViewRequestStream after completion");
1667 }
1668 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1669 |bytes, handles| {
1670 match this.inner.channel().read_etc(cx, bytes, handles) {
1671 std::task::Poll::Ready(Ok(())) => {}
1672 std::task::Poll::Pending => return std::task::Poll::Pending,
1673 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1674 this.is_terminated = true;
1675 return std::task::Poll::Ready(None);
1676 }
1677 std::task::Poll::Ready(Err(e)) => {
1678 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1679 e.into(),
1680 ))))
1681 }
1682 }
1683
1684 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1686
1687 std::task::Poll::Ready(Some(match header.ordinal {
1688 0x3c9531929383e911 => {
1689 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1690 let mut req = fidl::new_empty!(
1691 ViewOpenEntryIteratorRequest,
1692 fidl::encoding::DefaultFuchsiaResourceDialect
1693 );
1694 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ViewOpenEntryIteratorRequest>(&header, _body_bytes, handles, &mut req)?;
1695 let control_handle = ViewControlHandle { inner: this.inner.clone() };
1696 Ok(ViewRequest::OpenEntryIterator {
1697 it: req.it,
1698 options: req.options,
1699
1700 control_handle,
1701 })
1702 }
1703 _ => Err(fidl::Error::UnknownOrdinal {
1704 ordinal: header.ordinal,
1705 protocol_name: <ViewMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1706 }),
1707 }))
1708 },
1709 )
1710 }
1711}
1712
1713#[derive(Debug)]
1715pub enum ViewRequest {
1716 OpenEntryIterator {
1722 it: fidl::endpoints::ServerEnd<EntryIteratorMarker>,
1723 options: EntryIteratorOptions,
1724 control_handle: ViewControlHandle,
1725 },
1726}
1727
1728impl ViewRequest {
1729 #[allow(irrefutable_let_patterns)]
1730 pub fn into_open_entry_iterator(
1731 self,
1732 ) -> Option<(
1733 fidl::endpoints::ServerEnd<EntryIteratorMarker>,
1734 EntryIteratorOptions,
1735 ViewControlHandle,
1736 )> {
1737 if let ViewRequest::OpenEntryIterator { it, options, control_handle } = self {
1738 Some((it, options, control_handle))
1739 } else {
1740 None
1741 }
1742 }
1743
1744 pub fn method_name(&self) -> &'static str {
1746 match *self {
1747 ViewRequest::OpenEntryIterator { .. } => "open_entry_iterator",
1748 }
1749 }
1750}
1751
1752#[derive(Debug, Clone)]
1753pub struct ViewControlHandle {
1754 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1755}
1756
1757impl fidl::endpoints::ControlHandle for ViewControlHandle {
1758 fn shutdown(&self) {
1759 self.inner.shutdown()
1760 }
1761 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1762 self.inner.shutdown_with_epitaph(status)
1763 }
1764
1765 fn is_closed(&self) -> bool {
1766 self.inner.channel().is_closed()
1767 }
1768 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1769 self.inner.channel().on_closed()
1770 }
1771
1772 #[cfg(target_os = "fuchsia")]
1773 fn signal_peer(
1774 &self,
1775 clear_mask: zx::Signals,
1776 set_mask: zx::Signals,
1777 ) -> Result<(), zx_status::Status> {
1778 use fidl::Peered;
1779 self.inner.channel().signal_peer(clear_mask, set_mask)
1780 }
1781}
1782
1783impl ViewControlHandle {}
1784
1785mod internal {
1786 use super::*;
1787
1788 impl fidl::encoding::ResourceTypeMarker for ViewOpenEntryIteratorRequest {
1789 type Borrowed<'a> = &'a mut Self;
1790 fn take_or_borrow<'a>(
1791 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1792 ) -> Self::Borrowed<'a> {
1793 value
1794 }
1795 }
1796
1797 unsafe impl fidl::encoding::TypeMarker for ViewOpenEntryIteratorRequest {
1798 type Owned = Self;
1799
1800 #[inline(always)]
1801 fn inline_align(_context: fidl::encoding::Context) -> usize {
1802 8
1803 }
1804
1805 #[inline(always)]
1806 fn inline_size(_context: fidl::encoding::Context) -> usize {
1807 24
1808 }
1809 }
1810
1811 unsafe impl
1812 fidl::encoding::Encode<
1813 ViewOpenEntryIteratorRequest,
1814 fidl::encoding::DefaultFuchsiaResourceDialect,
1815 > for &mut ViewOpenEntryIteratorRequest
1816 {
1817 #[inline]
1818 unsafe fn encode(
1819 self,
1820 encoder: &mut fidl::encoding::Encoder<
1821 '_,
1822 fidl::encoding::DefaultFuchsiaResourceDialect,
1823 >,
1824 offset: usize,
1825 _depth: fidl::encoding::Depth,
1826 ) -> fidl::Result<()> {
1827 encoder.debug_check_bounds::<ViewOpenEntryIteratorRequest>(offset);
1828 fidl::encoding::Encode::<ViewOpenEntryIteratorRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1830 (
1831 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<EntryIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.it),
1832 <EntryIteratorOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
1833 ),
1834 encoder, offset, _depth
1835 )
1836 }
1837 }
1838 unsafe impl<
1839 T0: fidl::encoding::Encode<
1840 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<EntryIteratorMarker>>,
1841 fidl::encoding::DefaultFuchsiaResourceDialect,
1842 >,
1843 T1: fidl::encoding::Encode<
1844 EntryIteratorOptions,
1845 fidl::encoding::DefaultFuchsiaResourceDialect,
1846 >,
1847 >
1848 fidl::encoding::Encode<
1849 ViewOpenEntryIteratorRequest,
1850 fidl::encoding::DefaultFuchsiaResourceDialect,
1851 > for (T0, T1)
1852 {
1853 #[inline]
1854 unsafe fn encode(
1855 self,
1856 encoder: &mut fidl::encoding::Encoder<
1857 '_,
1858 fidl::encoding::DefaultFuchsiaResourceDialect,
1859 >,
1860 offset: usize,
1861 depth: fidl::encoding::Depth,
1862 ) -> fidl::Result<()> {
1863 encoder.debug_check_bounds::<ViewOpenEntryIteratorRequest>(offset);
1864 unsafe {
1867 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1868 (ptr as *mut u64).write_unaligned(0);
1869 }
1870 self.0.encode(encoder, offset + 0, depth)?;
1872 self.1.encode(encoder, offset + 8, depth)?;
1873 Ok(())
1874 }
1875 }
1876
1877 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1878 for ViewOpenEntryIteratorRequest
1879 {
1880 #[inline(always)]
1881 fn new_empty() -> Self {
1882 Self {
1883 it: fidl::new_empty!(
1884 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<EntryIteratorMarker>>,
1885 fidl::encoding::DefaultFuchsiaResourceDialect
1886 ),
1887 options: fidl::new_empty!(
1888 EntryIteratorOptions,
1889 fidl::encoding::DefaultFuchsiaResourceDialect
1890 ),
1891 }
1892 }
1893
1894 #[inline]
1895 unsafe fn decode(
1896 &mut self,
1897 decoder: &mut fidl::encoding::Decoder<
1898 '_,
1899 fidl::encoding::DefaultFuchsiaResourceDialect,
1900 >,
1901 offset: usize,
1902 _depth: fidl::encoding::Depth,
1903 ) -> fidl::Result<()> {
1904 decoder.debug_check_bounds::<Self>(offset);
1905 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1907 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1908 let mask = 0xffffffff00000000u64;
1909 let maskedval = padval & mask;
1910 if maskedval != 0 {
1911 return Err(fidl::Error::NonZeroPadding {
1912 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1913 });
1914 }
1915 fidl::decode!(
1916 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<EntryIteratorMarker>>,
1917 fidl::encoding::DefaultFuchsiaResourceDialect,
1918 &mut self.it,
1919 decoder,
1920 offset + 0,
1921 _depth
1922 )?;
1923 fidl::decode!(
1924 EntryIteratorOptions,
1925 fidl::encoding::DefaultFuchsiaResourceDialect,
1926 &mut self.options,
1927 decoder,
1928 offset + 8,
1929 _depth
1930 )?;
1931 Ok(())
1932 }
1933 }
1934}