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_root_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct FilterOpenControllerRequest {
16 pub id: String,
17 pub request: fidl::endpoints::ServerEnd<fidl_fuchsia_net_filter::NamespaceControllerMarker>,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
21 for FilterOpenControllerRequest
22{
23}
24
25#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
26pub struct InterfacesGetAdminRequest {
27 pub id: u64,
28 pub control: fidl::endpoints::ServerEnd<fidl_fuchsia_net_interfaces_admin::ControlMarker>,
29}
30
31impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for InterfacesGetAdminRequest {}
32
33#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
34pub struct RoutesV4GlobalRouteSetRequest {
35 pub route_set: fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV4Marker>,
36}
37
38impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
39 for RoutesV4GlobalRouteSetRequest
40{
41}
42
43#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
44pub struct RoutesV6GlobalRouteSetRequest {
45 pub route_set: fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV6Marker>,
46}
47
48impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
49 for RoutesV6GlobalRouteSetRequest
50{
51}
52
53#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
54pub struct FilterMarker;
55
56impl fidl::endpoints::ProtocolMarker for FilterMarker {
57 type Proxy = FilterProxy;
58 type RequestStream = FilterRequestStream;
59 #[cfg(target_os = "fuchsia")]
60 type SynchronousProxy = FilterSynchronousProxy;
61
62 const DEBUG_NAME: &'static str = "fuchsia.net.root.Filter";
63}
64impl fidl::endpoints::DiscoverableProtocolMarker for FilterMarker {}
65
66pub trait FilterProxyInterface: Send + Sync {
67 fn r#open_controller(
68 &self,
69 id: &str,
70 request: fidl::endpoints::ServerEnd<fidl_fuchsia_net_filter::NamespaceControllerMarker>,
71 ) -> Result<(), fidl::Error>;
72}
73#[derive(Debug)]
74#[cfg(target_os = "fuchsia")]
75pub struct FilterSynchronousProxy {
76 client: fidl::client::sync::Client,
77}
78
79#[cfg(target_os = "fuchsia")]
80impl fidl::endpoints::SynchronousProxy for FilterSynchronousProxy {
81 type Proxy = FilterProxy;
82 type Protocol = FilterMarker;
83
84 fn from_channel(inner: fidl::Channel) -> Self {
85 Self::new(inner)
86 }
87
88 fn into_channel(self) -> fidl::Channel {
89 self.client.into_channel()
90 }
91
92 fn as_channel(&self) -> &fidl::Channel {
93 self.client.as_channel()
94 }
95}
96
97#[cfg(target_os = "fuchsia")]
98impl FilterSynchronousProxy {
99 pub fn new(channel: fidl::Channel) -> Self {
100 let protocol_name = <FilterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
101 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
102 }
103
104 pub fn into_channel(self) -> fidl::Channel {
105 self.client.into_channel()
106 }
107
108 pub fn wait_for_event(
111 &self,
112 deadline: zx::MonotonicInstant,
113 ) -> Result<FilterEvent, fidl::Error> {
114 FilterEvent::decode(self.client.wait_for_event(deadline)?)
115 }
116
117 pub fn r#open_controller(
128 &self,
129 mut id: &str,
130 mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_net_filter::NamespaceControllerMarker>,
131 ) -> Result<(), fidl::Error> {
132 self.client.send::<FilterOpenControllerRequest>(
133 (id, request),
134 0x4f8742ed854ea1d1,
135 fidl::encoding::DynamicFlags::empty(),
136 )
137 }
138}
139
140#[cfg(target_os = "fuchsia")]
141impl From<FilterSynchronousProxy> for zx::Handle {
142 fn from(value: FilterSynchronousProxy) -> Self {
143 value.into_channel().into()
144 }
145}
146
147#[cfg(target_os = "fuchsia")]
148impl From<fidl::Channel> for FilterSynchronousProxy {
149 fn from(value: fidl::Channel) -> Self {
150 Self::new(value)
151 }
152}
153
154#[derive(Debug, Clone)]
155pub struct FilterProxy {
156 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
157}
158
159impl fidl::endpoints::Proxy for FilterProxy {
160 type Protocol = FilterMarker;
161
162 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
163 Self::new(inner)
164 }
165
166 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
167 self.client.into_channel().map_err(|client| Self { client })
168 }
169
170 fn as_channel(&self) -> &::fidl::AsyncChannel {
171 self.client.as_channel()
172 }
173}
174
175impl FilterProxy {
176 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
178 let protocol_name = <FilterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
179 Self { client: fidl::client::Client::new(channel, protocol_name) }
180 }
181
182 pub fn take_event_stream(&self) -> FilterEventStream {
188 FilterEventStream { event_receiver: self.client.take_event_receiver() }
189 }
190
191 pub fn r#open_controller(
202 &self,
203 mut id: &str,
204 mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_net_filter::NamespaceControllerMarker>,
205 ) -> Result<(), fidl::Error> {
206 FilterProxyInterface::r#open_controller(self, id, request)
207 }
208}
209
210impl FilterProxyInterface for FilterProxy {
211 fn r#open_controller(
212 &self,
213 mut id: &str,
214 mut request: fidl::endpoints::ServerEnd<fidl_fuchsia_net_filter::NamespaceControllerMarker>,
215 ) -> Result<(), fidl::Error> {
216 self.client.send::<FilterOpenControllerRequest>(
217 (id, request),
218 0x4f8742ed854ea1d1,
219 fidl::encoding::DynamicFlags::empty(),
220 )
221 }
222}
223
224pub struct FilterEventStream {
225 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
226}
227
228impl std::marker::Unpin for FilterEventStream {}
229
230impl futures::stream::FusedStream for FilterEventStream {
231 fn is_terminated(&self) -> bool {
232 self.event_receiver.is_terminated()
233 }
234}
235
236impl futures::Stream for FilterEventStream {
237 type Item = Result<FilterEvent, fidl::Error>;
238
239 fn poll_next(
240 mut self: std::pin::Pin<&mut Self>,
241 cx: &mut std::task::Context<'_>,
242 ) -> std::task::Poll<Option<Self::Item>> {
243 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
244 &mut self.event_receiver,
245 cx
246 )?) {
247 Some(buf) => std::task::Poll::Ready(Some(FilterEvent::decode(buf))),
248 None => std::task::Poll::Ready(None),
249 }
250 }
251}
252
253#[derive(Debug)]
254pub enum FilterEvent {}
255
256impl FilterEvent {
257 fn decode(
259 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
260 ) -> Result<FilterEvent, fidl::Error> {
261 let (bytes, _handles) = buf.split_mut();
262 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
263 debug_assert_eq!(tx_header.tx_id, 0);
264 match tx_header.ordinal {
265 _ => Err(fidl::Error::UnknownOrdinal {
266 ordinal: tx_header.ordinal,
267 protocol_name: <FilterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
268 }),
269 }
270 }
271}
272
273pub struct FilterRequestStream {
275 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
276 is_terminated: bool,
277}
278
279impl std::marker::Unpin for FilterRequestStream {}
280
281impl futures::stream::FusedStream for FilterRequestStream {
282 fn is_terminated(&self) -> bool {
283 self.is_terminated
284 }
285}
286
287impl fidl::endpoints::RequestStream for FilterRequestStream {
288 type Protocol = FilterMarker;
289 type ControlHandle = FilterControlHandle;
290
291 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
292 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
293 }
294
295 fn control_handle(&self) -> Self::ControlHandle {
296 FilterControlHandle { inner: self.inner.clone() }
297 }
298
299 fn into_inner(
300 self,
301 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
302 {
303 (self.inner, self.is_terminated)
304 }
305
306 fn from_inner(
307 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
308 is_terminated: bool,
309 ) -> Self {
310 Self { inner, is_terminated }
311 }
312}
313
314impl futures::Stream for FilterRequestStream {
315 type Item = Result<FilterRequest, fidl::Error>;
316
317 fn poll_next(
318 mut self: std::pin::Pin<&mut Self>,
319 cx: &mut std::task::Context<'_>,
320 ) -> std::task::Poll<Option<Self::Item>> {
321 let this = &mut *self;
322 if this.inner.check_shutdown(cx) {
323 this.is_terminated = true;
324 return std::task::Poll::Ready(None);
325 }
326 if this.is_terminated {
327 panic!("polled FilterRequestStream after completion");
328 }
329 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
330 |bytes, handles| {
331 match this.inner.channel().read_etc(cx, bytes, handles) {
332 std::task::Poll::Ready(Ok(())) => {}
333 std::task::Poll::Pending => return std::task::Poll::Pending,
334 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
335 this.is_terminated = true;
336 return std::task::Poll::Ready(None);
337 }
338 std::task::Poll::Ready(Err(e)) => {
339 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
340 e.into(),
341 ))))
342 }
343 }
344
345 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
347
348 std::task::Poll::Ready(Some(match header.ordinal {
349 0x4f8742ed854ea1d1 => {
350 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
351 let mut req = fidl::new_empty!(
352 FilterOpenControllerRequest,
353 fidl::encoding::DefaultFuchsiaResourceDialect
354 );
355 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<FilterOpenControllerRequest>(&header, _body_bytes, handles, &mut req)?;
356 let control_handle = FilterControlHandle { inner: this.inner.clone() };
357 Ok(FilterRequest::OpenController {
358 id: req.id,
359 request: req.request,
360
361 control_handle,
362 })
363 }
364 _ => Err(fidl::Error::UnknownOrdinal {
365 ordinal: header.ordinal,
366 protocol_name:
367 <FilterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
368 }),
369 }))
370 },
371 )
372 }
373}
374
375#[derive(Debug)]
386pub enum FilterRequest {
387 OpenController {
398 id: String,
399 request: fidl::endpoints::ServerEnd<fidl_fuchsia_net_filter::NamespaceControllerMarker>,
400 control_handle: FilterControlHandle,
401 },
402}
403
404impl FilterRequest {
405 #[allow(irrefutable_let_patterns)]
406 pub fn into_open_controller(
407 self,
408 ) -> Option<(
409 String,
410 fidl::endpoints::ServerEnd<fidl_fuchsia_net_filter::NamespaceControllerMarker>,
411 FilterControlHandle,
412 )> {
413 if let FilterRequest::OpenController { id, request, control_handle } = self {
414 Some((id, request, control_handle))
415 } else {
416 None
417 }
418 }
419
420 pub fn method_name(&self) -> &'static str {
422 match *self {
423 FilterRequest::OpenController { .. } => "open_controller",
424 }
425 }
426}
427
428#[derive(Debug, Clone)]
429pub struct FilterControlHandle {
430 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
431}
432
433impl fidl::endpoints::ControlHandle for FilterControlHandle {
434 fn shutdown(&self) {
435 self.inner.shutdown()
436 }
437 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
438 self.inner.shutdown_with_epitaph(status)
439 }
440
441 fn is_closed(&self) -> bool {
442 self.inner.channel().is_closed()
443 }
444 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
445 self.inner.channel().on_closed()
446 }
447
448 #[cfg(target_os = "fuchsia")]
449 fn signal_peer(
450 &self,
451 clear_mask: zx::Signals,
452 set_mask: zx::Signals,
453 ) -> Result<(), zx_status::Status> {
454 use fidl::Peered;
455 self.inner.channel().signal_peer(clear_mask, set_mask)
456 }
457}
458
459impl FilterControlHandle {}
460
461#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
462pub struct InterfacesMarker;
463
464impl fidl::endpoints::ProtocolMarker for InterfacesMarker {
465 type Proxy = InterfacesProxy;
466 type RequestStream = InterfacesRequestStream;
467 #[cfg(target_os = "fuchsia")]
468 type SynchronousProxy = InterfacesSynchronousProxy;
469
470 const DEBUG_NAME: &'static str = "fuchsia.net.root.Interfaces";
471}
472impl fidl::endpoints::DiscoverableProtocolMarker for InterfacesMarker {}
473pub type InterfacesGetMacResult =
474 Result<Option<Box<fidl_fuchsia_net::MacAddress>>, InterfacesGetMacError>;
475
476pub trait InterfacesProxyInterface: Send + Sync {
477 fn r#get_admin(
478 &self,
479 id: u64,
480 control: fidl::endpoints::ServerEnd<fidl_fuchsia_net_interfaces_admin::ControlMarker>,
481 ) -> Result<(), fidl::Error>;
482 type GetMacResponseFut: std::future::Future<Output = Result<InterfacesGetMacResult, fidl::Error>>
483 + Send;
484 fn r#get_mac(&self, id: u64) -> Self::GetMacResponseFut;
485}
486#[derive(Debug)]
487#[cfg(target_os = "fuchsia")]
488pub struct InterfacesSynchronousProxy {
489 client: fidl::client::sync::Client,
490}
491
492#[cfg(target_os = "fuchsia")]
493impl fidl::endpoints::SynchronousProxy for InterfacesSynchronousProxy {
494 type Proxy = InterfacesProxy;
495 type Protocol = InterfacesMarker;
496
497 fn from_channel(inner: fidl::Channel) -> Self {
498 Self::new(inner)
499 }
500
501 fn into_channel(self) -> fidl::Channel {
502 self.client.into_channel()
503 }
504
505 fn as_channel(&self) -> &fidl::Channel {
506 self.client.as_channel()
507 }
508}
509
510#[cfg(target_os = "fuchsia")]
511impl InterfacesSynchronousProxy {
512 pub fn new(channel: fidl::Channel) -> Self {
513 let protocol_name = <InterfacesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
514 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
515 }
516
517 pub fn into_channel(self) -> fidl::Channel {
518 self.client.into_channel()
519 }
520
521 pub fn wait_for_event(
524 &self,
525 deadline: zx::MonotonicInstant,
526 ) -> Result<InterfacesEvent, fidl::Error> {
527 InterfacesEvent::decode(self.client.wait_for_event(deadline)?)
528 }
529
530 pub fn r#get_admin(
537 &self,
538 mut id: u64,
539 mut control: fidl::endpoints::ServerEnd<fidl_fuchsia_net_interfaces_admin::ControlMarker>,
540 ) -> Result<(), fidl::Error> {
541 self.client.send::<InterfacesGetAdminRequest>(
542 (id, control),
543 0x3cdcbf2452babedd,
544 fidl::encoding::DynamicFlags::empty(),
545 )
546 }
547
548 pub fn r#get_mac(
553 &self,
554 mut id: u64,
555 ___deadline: zx::MonotonicInstant,
556 ) -> Result<InterfacesGetMacResult, fidl::Error> {
557 let _response =
558 self.client.send_query::<InterfacesGetMacRequest, fidl::encoding::ResultType<
559 InterfacesGetMacResponse,
560 InterfacesGetMacError,
561 >>(
562 (id,),
563 0x720643bc62a26d61,
564 fidl::encoding::DynamicFlags::empty(),
565 ___deadline,
566 )?;
567 Ok(_response.map(|x| x.mac))
568 }
569}
570
571#[cfg(target_os = "fuchsia")]
572impl From<InterfacesSynchronousProxy> for zx::Handle {
573 fn from(value: InterfacesSynchronousProxy) -> Self {
574 value.into_channel().into()
575 }
576}
577
578#[cfg(target_os = "fuchsia")]
579impl From<fidl::Channel> for InterfacesSynchronousProxy {
580 fn from(value: fidl::Channel) -> Self {
581 Self::new(value)
582 }
583}
584
585#[derive(Debug, Clone)]
586pub struct InterfacesProxy {
587 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
588}
589
590impl fidl::endpoints::Proxy for InterfacesProxy {
591 type Protocol = InterfacesMarker;
592
593 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
594 Self::new(inner)
595 }
596
597 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
598 self.client.into_channel().map_err(|client| Self { client })
599 }
600
601 fn as_channel(&self) -> &::fidl::AsyncChannel {
602 self.client.as_channel()
603 }
604}
605
606impl InterfacesProxy {
607 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
609 let protocol_name = <InterfacesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
610 Self { client: fidl::client::Client::new(channel, protocol_name) }
611 }
612
613 pub fn take_event_stream(&self) -> InterfacesEventStream {
619 InterfacesEventStream { event_receiver: self.client.take_event_receiver() }
620 }
621
622 pub fn r#get_admin(
629 &self,
630 mut id: u64,
631 mut control: fidl::endpoints::ServerEnd<fidl_fuchsia_net_interfaces_admin::ControlMarker>,
632 ) -> Result<(), fidl::Error> {
633 InterfacesProxyInterface::r#get_admin(self, id, control)
634 }
635
636 pub fn r#get_mac(
641 &self,
642 mut id: u64,
643 ) -> fidl::client::QueryResponseFut<
644 InterfacesGetMacResult,
645 fidl::encoding::DefaultFuchsiaResourceDialect,
646 > {
647 InterfacesProxyInterface::r#get_mac(self, id)
648 }
649}
650
651impl InterfacesProxyInterface for InterfacesProxy {
652 fn r#get_admin(
653 &self,
654 mut id: u64,
655 mut control: fidl::endpoints::ServerEnd<fidl_fuchsia_net_interfaces_admin::ControlMarker>,
656 ) -> Result<(), fidl::Error> {
657 self.client.send::<InterfacesGetAdminRequest>(
658 (id, control),
659 0x3cdcbf2452babedd,
660 fidl::encoding::DynamicFlags::empty(),
661 )
662 }
663
664 type GetMacResponseFut = fidl::client::QueryResponseFut<
665 InterfacesGetMacResult,
666 fidl::encoding::DefaultFuchsiaResourceDialect,
667 >;
668 fn r#get_mac(&self, mut id: u64) -> Self::GetMacResponseFut {
669 fn _decode(
670 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
671 ) -> Result<InterfacesGetMacResult, fidl::Error> {
672 let _response = fidl::client::decode_transaction_body::<
673 fidl::encoding::ResultType<InterfacesGetMacResponse, InterfacesGetMacError>,
674 fidl::encoding::DefaultFuchsiaResourceDialect,
675 0x720643bc62a26d61,
676 >(_buf?)?;
677 Ok(_response.map(|x| x.mac))
678 }
679 self.client.send_query_and_decode::<InterfacesGetMacRequest, InterfacesGetMacResult>(
680 (id,),
681 0x720643bc62a26d61,
682 fidl::encoding::DynamicFlags::empty(),
683 _decode,
684 )
685 }
686}
687
688pub struct InterfacesEventStream {
689 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
690}
691
692impl std::marker::Unpin for InterfacesEventStream {}
693
694impl futures::stream::FusedStream for InterfacesEventStream {
695 fn is_terminated(&self) -> bool {
696 self.event_receiver.is_terminated()
697 }
698}
699
700impl futures::Stream for InterfacesEventStream {
701 type Item = Result<InterfacesEvent, fidl::Error>;
702
703 fn poll_next(
704 mut self: std::pin::Pin<&mut Self>,
705 cx: &mut std::task::Context<'_>,
706 ) -> std::task::Poll<Option<Self::Item>> {
707 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
708 &mut self.event_receiver,
709 cx
710 )?) {
711 Some(buf) => std::task::Poll::Ready(Some(InterfacesEvent::decode(buf))),
712 None => std::task::Poll::Ready(None),
713 }
714 }
715}
716
717#[derive(Debug)]
718pub enum InterfacesEvent {}
719
720impl InterfacesEvent {
721 fn decode(
723 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
724 ) -> Result<InterfacesEvent, fidl::Error> {
725 let (bytes, _handles) = buf.split_mut();
726 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
727 debug_assert_eq!(tx_header.tx_id, 0);
728 match tx_header.ordinal {
729 _ => Err(fidl::Error::UnknownOrdinal {
730 ordinal: tx_header.ordinal,
731 protocol_name: <InterfacesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
732 }),
733 }
734 }
735}
736
737pub struct InterfacesRequestStream {
739 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
740 is_terminated: bool,
741}
742
743impl std::marker::Unpin for InterfacesRequestStream {}
744
745impl futures::stream::FusedStream for InterfacesRequestStream {
746 fn is_terminated(&self) -> bool {
747 self.is_terminated
748 }
749}
750
751impl fidl::endpoints::RequestStream for InterfacesRequestStream {
752 type Protocol = InterfacesMarker;
753 type ControlHandle = InterfacesControlHandle;
754
755 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
756 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
757 }
758
759 fn control_handle(&self) -> Self::ControlHandle {
760 InterfacesControlHandle { inner: self.inner.clone() }
761 }
762
763 fn into_inner(
764 self,
765 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
766 {
767 (self.inner, self.is_terminated)
768 }
769
770 fn from_inner(
771 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
772 is_terminated: bool,
773 ) -> Self {
774 Self { inner, is_terminated }
775 }
776}
777
778impl futures::Stream for InterfacesRequestStream {
779 type Item = Result<InterfacesRequest, fidl::Error>;
780
781 fn poll_next(
782 mut self: std::pin::Pin<&mut Self>,
783 cx: &mut std::task::Context<'_>,
784 ) -> std::task::Poll<Option<Self::Item>> {
785 let this = &mut *self;
786 if this.inner.check_shutdown(cx) {
787 this.is_terminated = true;
788 return std::task::Poll::Ready(None);
789 }
790 if this.is_terminated {
791 panic!("polled InterfacesRequestStream after completion");
792 }
793 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
794 |bytes, handles| {
795 match this.inner.channel().read_etc(cx, bytes, handles) {
796 std::task::Poll::Ready(Ok(())) => {}
797 std::task::Poll::Pending => return std::task::Poll::Pending,
798 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
799 this.is_terminated = true;
800 return std::task::Poll::Ready(None);
801 }
802 std::task::Poll::Ready(Err(e)) => {
803 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
804 e.into(),
805 ))))
806 }
807 }
808
809 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
811
812 std::task::Poll::Ready(Some(match header.ordinal {
813 0x3cdcbf2452babedd => {
814 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
815 let mut req = fidl::new_empty!(
816 InterfacesGetAdminRequest,
817 fidl::encoding::DefaultFuchsiaResourceDialect
818 );
819 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InterfacesGetAdminRequest>(&header, _body_bytes, handles, &mut req)?;
820 let control_handle = InterfacesControlHandle { inner: this.inner.clone() };
821 Ok(InterfacesRequest::GetAdmin {
822 id: req.id,
823 control: req.control,
824
825 control_handle,
826 })
827 }
828 0x720643bc62a26d61 => {
829 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
830 let mut req = fidl::new_empty!(
831 InterfacesGetMacRequest,
832 fidl::encoding::DefaultFuchsiaResourceDialect
833 );
834 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<InterfacesGetMacRequest>(&header, _body_bytes, handles, &mut req)?;
835 let control_handle = InterfacesControlHandle { inner: this.inner.clone() };
836 Ok(InterfacesRequest::GetMac {
837 id: req.id,
838
839 responder: InterfacesGetMacResponder {
840 control_handle: std::mem::ManuallyDrop::new(control_handle),
841 tx_id: header.tx_id,
842 },
843 })
844 }
845 _ => Err(fidl::Error::UnknownOrdinal {
846 ordinal: header.ordinal,
847 protocol_name:
848 <InterfacesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
849 }),
850 }))
851 },
852 )
853 }
854}
855
856#[derive(Debug)]
867pub enum InterfacesRequest {
868 GetAdmin {
875 id: u64,
876 control: fidl::endpoints::ServerEnd<fidl_fuchsia_net_interfaces_admin::ControlMarker>,
877 control_handle: InterfacesControlHandle,
878 },
879 GetMac { id: u64, responder: InterfacesGetMacResponder },
884}
885
886impl InterfacesRequest {
887 #[allow(irrefutable_let_patterns)]
888 pub fn into_get_admin(
889 self,
890 ) -> Option<(
891 u64,
892 fidl::endpoints::ServerEnd<fidl_fuchsia_net_interfaces_admin::ControlMarker>,
893 InterfacesControlHandle,
894 )> {
895 if let InterfacesRequest::GetAdmin { id, control, control_handle } = self {
896 Some((id, control, control_handle))
897 } else {
898 None
899 }
900 }
901
902 #[allow(irrefutable_let_patterns)]
903 pub fn into_get_mac(self) -> Option<(u64, InterfacesGetMacResponder)> {
904 if let InterfacesRequest::GetMac { id, responder } = self {
905 Some((id, responder))
906 } else {
907 None
908 }
909 }
910
911 pub fn method_name(&self) -> &'static str {
913 match *self {
914 InterfacesRequest::GetAdmin { .. } => "get_admin",
915 InterfacesRequest::GetMac { .. } => "get_mac",
916 }
917 }
918}
919
920#[derive(Debug, Clone)]
921pub struct InterfacesControlHandle {
922 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
923}
924
925impl fidl::endpoints::ControlHandle for InterfacesControlHandle {
926 fn shutdown(&self) {
927 self.inner.shutdown()
928 }
929 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
930 self.inner.shutdown_with_epitaph(status)
931 }
932
933 fn is_closed(&self) -> bool {
934 self.inner.channel().is_closed()
935 }
936 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
937 self.inner.channel().on_closed()
938 }
939
940 #[cfg(target_os = "fuchsia")]
941 fn signal_peer(
942 &self,
943 clear_mask: zx::Signals,
944 set_mask: zx::Signals,
945 ) -> Result<(), zx_status::Status> {
946 use fidl::Peered;
947 self.inner.channel().signal_peer(clear_mask, set_mask)
948 }
949}
950
951impl InterfacesControlHandle {}
952
953#[must_use = "FIDL methods require a response to be sent"]
954#[derive(Debug)]
955pub struct InterfacesGetMacResponder {
956 control_handle: std::mem::ManuallyDrop<InterfacesControlHandle>,
957 tx_id: u32,
958}
959
960impl std::ops::Drop for InterfacesGetMacResponder {
964 fn drop(&mut self) {
965 self.control_handle.shutdown();
966 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
968 }
969}
970
971impl fidl::endpoints::Responder for InterfacesGetMacResponder {
972 type ControlHandle = InterfacesControlHandle;
973
974 fn control_handle(&self) -> &InterfacesControlHandle {
975 &self.control_handle
976 }
977
978 fn drop_without_shutdown(mut self) {
979 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
981 std::mem::forget(self);
983 }
984}
985
986impl InterfacesGetMacResponder {
987 pub fn send(
991 self,
992 mut result: Result<Option<&fidl_fuchsia_net::MacAddress>, InterfacesGetMacError>,
993 ) -> Result<(), fidl::Error> {
994 let _result = self.send_raw(result);
995 if _result.is_err() {
996 self.control_handle.shutdown();
997 }
998 self.drop_without_shutdown();
999 _result
1000 }
1001
1002 pub fn send_no_shutdown_on_err(
1004 self,
1005 mut result: Result<Option<&fidl_fuchsia_net::MacAddress>, InterfacesGetMacError>,
1006 ) -> Result<(), fidl::Error> {
1007 let _result = self.send_raw(result);
1008 self.drop_without_shutdown();
1009 _result
1010 }
1011
1012 fn send_raw(
1013 &self,
1014 mut result: Result<Option<&fidl_fuchsia_net::MacAddress>, InterfacesGetMacError>,
1015 ) -> Result<(), fidl::Error> {
1016 self.control_handle.inner.send::<fidl::encoding::ResultType<
1017 InterfacesGetMacResponse,
1018 InterfacesGetMacError,
1019 >>(
1020 result.map(|mac| (mac,)),
1021 self.tx_id,
1022 0x720643bc62a26d61,
1023 fidl::encoding::DynamicFlags::empty(),
1024 )
1025 }
1026}
1027
1028#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1029pub struct RoutesV4Marker;
1030
1031impl fidl::endpoints::ProtocolMarker for RoutesV4Marker {
1032 type Proxy = RoutesV4Proxy;
1033 type RequestStream = RoutesV4RequestStream;
1034 #[cfg(target_os = "fuchsia")]
1035 type SynchronousProxy = RoutesV4SynchronousProxy;
1036
1037 const DEBUG_NAME: &'static str = "fuchsia.net.root.RoutesV4";
1038}
1039impl fidl::endpoints::DiscoverableProtocolMarker for RoutesV4Marker {}
1040
1041pub trait RoutesV4ProxyInterface: Send + Sync {
1042 fn r#global_route_set(
1043 &self,
1044 route_set: fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV4Marker>,
1045 ) -> Result<(), fidl::Error>;
1046}
1047#[derive(Debug)]
1048#[cfg(target_os = "fuchsia")]
1049pub struct RoutesV4SynchronousProxy {
1050 client: fidl::client::sync::Client,
1051}
1052
1053#[cfg(target_os = "fuchsia")]
1054impl fidl::endpoints::SynchronousProxy for RoutesV4SynchronousProxy {
1055 type Proxy = RoutesV4Proxy;
1056 type Protocol = RoutesV4Marker;
1057
1058 fn from_channel(inner: fidl::Channel) -> Self {
1059 Self::new(inner)
1060 }
1061
1062 fn into_channel(self) -> fidl::Channel {
1063 self.client.into_channel()
1064 }
1065
1066 fn as_channel(&self) -> &fidl::Channel {
1067 self.client.as_channel()
1068 }
1069}
1070
1071#[cfg(target_os = "fuchsia")]
1072impl RoutesV4SynchronousProxy {
1073 pub fn new(channel: fidl::Channel) -> Self {
1074 let protocol_name = <RoutesV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1075 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1076 }
1077
1078 pub fn into_channel(self) -> fidl::Channel {
1079 self.client.into_channel()
1080 }
1081
1082 pub fn wait_for_event(
1085 &self,
1086 deadline: zx::MonotonicInstant,
1087 ) -> Result<RoutesV4Event, fidl::Error> {
1088 RoutesV4Event::decode(self.client.wait_for_event(deadline)?)
1089 }
1090
1091 pub fn r#global_route_set(
1111 &self,
1112 mut route_set: fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV4Marker>,
1113 ) -> Result<(), fidl::Error> {
1114 self.client.send::<RoutesV4GlobalRouteSetRequest>(
1115 (route_set,),
1116 0x3c0b279c61d81812,
1117 fidl::encoding::DynamicFlags::empty(),
1118 )
1119 }
1120}
1121
1122#[cfg(target_os = "fuchsia")]
1123impl From<RoutesV4SynchronousProxy> for zx::Handle {
1124 fn from(value: RoutesV4SynchronousProxy) -> Self {
1125 value.into_channel().into()
1126 }
1127}
1128
1129#[cfg(target_os = "fuchsia")]
1130impl From<fidl::Channel> for RoutesV4SynchronousProxy {
1131 fn from(value: fidl::Channel) -> Self {
1132 Self::new(value)
1133 }
1134}
1135
1136#[derive(Debug, Clone)]
1137pub struct RoutesV4Proxy {
1138 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1139}
1140
1141impl fidl::endpoints::Proxy for RoutesV4Proxy {
1142 type Protocol = RoutesV4Marker;
1143
1144 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1145 Self::new(inner)
1146 }
1147
1148 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1149 self.client.into_channel().map_err(|client| Self { client })
1150 }
1151
1152 fn as_channel(&self) -> &::fidl::AsyncChannel {
1153 self.client.as_channel()
1154 }
1155}
1156
1157impl RoutesV4Proxy {
1158 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1160 let protocol_name = <RoutesV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1161 Self { client: fidl::client::Client::new(channel, protocol_name) }
1162 }
1163
1164 pub fn take_event_stream(&self) -> RoutesV4EventStream {
1170 RoutesV4EventStream { event_receiver: self.client.take_event_receiver() }
1171 }
1172
1173 pub fn r#global_route_set(
1193 &self,
1194 mut route_set: fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV4Marker>,
1195 ) -> Result<(), fidl::Error> {
1196 RoutesV4ProxyInterface::r#global_route_set(self, route_set)
1197 }
1198}
1199
1200impl RoutesV4ProxyInterface for RoutesV4Proxy {
1201 fn r#global_route_set(
1202 &self,
1203 mut route_set: fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV4Marker>,
1204 ) -> Result<(), fidl::Error> {
1205 self.client.send::<RoutesV4GlobalRouteSetRequest>(
1206 (route_set,),
1207 0x3c0b279c61d81812,
1208 fidl::encoding::DynamicFlags::empty(),
1209 )
1210 }
1211}
1212
1213pub struct RoutesV4EventStream {
1214 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1215}
1216
1217impl std::marker::Unpin for RoutesV4EventStream {}
1218
1219impl futures::stream::FusedStream for RoutesV4EventStream {
1220 fn is_terminated(&self) -> bool {
1221 self.event_receiver.is_terminated()
1222 }
1223}
1224
1225impl futures::Stream for RoutesV4EventStream {
1226 type Item = Result<RoutesV4Event, fidl::Error>;
1227
1228 fn poll_next(
1229 mut self: std::pin::Pin<&mut Self>,
1230 cx: &mut std::task::Context<'_>,
1231 ) -> std::task::Poll<Option<Self::Item>> {
1232 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1233 &mut self.event_receiver,
1234 cx
1235 )?) {
1236 Some(buf) => std::task::Poll::Ready(Some(RoutesV4Event::decode(buf))),
1237 None => std::task::Poll::Ready(None),
1238 }
1239 }
1240}
1241
1242#[derive(Debug)]
1243pub enum RoutesV4Event {}
1244
1245impl RoutesV4Event {
1246 fn decode(
1248 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1249 ) -> Result<RoutesV4Event, fidl::Error> {
1250 let (bytes, _handles) = buf.split_mut();
1251 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1252 debug_assert_eq!(tx_header.tx_id, 0);
1253 match tx_header.ordinal {
1254 _ => Err(fidl::Error::UnknownOrdinal {
1255 ordinal: tx_header.ordinal,
1256 protocol_name: <RoutesV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1257 }),
1258 }
1259 }
1260}
1261
1262pub struct RoutesV4RequestStream {
1264 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1265 is_terminated: bool,
1266}
1267
1268impl std::marker::Unpin for RoutesV4RequestStream {}
1269
1270impl futures::stream::FusedStream for RoutesV4RequestStream {
1271 fn is_terminated(&self) -> bool {
1272 self.is_terminated
1273 }
1274}
1275
1276impl fidl::endpoints::RequestStream for RoutesV4RequestStream {
1277 type Protocol = RoutesV4Marker;
1278 type ControlHandle = RoutesV4ControlHandle;
1279
1280 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1281 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1282 }
1283
1284 fn control_handle(&self) -> Self::ControlHandle {
1285 RoutesV4ControlHandle { inner: self.inner.clone() }
1286 }
1287
1288 fn into_inner(
1289 self,
1290 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1291 {
1292 (self.inner, self.is_terminated)
1293 }
1294
1295 fn from_inner(
1296 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1297 is_terminated: bool,
1298 ) -> Self {
1299 Self { inner, is_terminated }
1300 }
1301}
1302
1303impl futures::Stream for RoutesV4RequestStream {
1304 type Item = Result<RoutesV4Request, fidl::Error>;
1305
1306 fn poll_next(
1307 mut self: std::pin::Pin<&mut Self>,
1308 cx: &mut std::task::Context<'_>,
1309 ) -> std::task::Poll<Option<Self::Item>> {
1310 let this = &mut *self;
1311 if this.inner.check_shutdown(cx) {
1312 this.is_terminated = true;
1313 return std::task::Poll::Ready(None);
1314 }
1315 if this.is_terminated {
1316 panic!("polled RoutesV4RequestStream after completion");
1317 }
1318 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1319 |bytes, handles| {
1320 match this.inner.channel().read_etc(cx, bytes, handles) {
1321 std::task::Poll::Ready(Ok(())) => {}
1322 std::task::Poll::Pending => return std::task::Poll::Pending,
1323 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1324 this.is_terminated = true;
1325 return std::task::Poll::Ready(None);
1326 }
1327 std::task::Poll::Ready(Err(e)) => {
1328 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1329 e.into(),
1330 ))))
1331 }
1332 }
1333
1334 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1336
1337 std::task::Poll::Ready(Some(match header.ordinal {
1338 0x3c0b279c61d81812 => {
1339 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1340 let mut req = fidl::new_empty!(
1341 RoutesV4GlobalRouteSetRequest,
1342 fidl::encoding::DefaultFuchsiaResourceDialect
1343 );
1344 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RoutesV4GlobalRouteSetRequest>(&header, _body_bytes, handles, &mut req)?;
1345 let control_handle = RoutesV4ControlHandle { inner: this.inner.clone() };
1346 Ok(RoutesV4Request::GlobalRouteSet {
1347 route_set: req.route_set,
1348
1349 control_handle,
1350 })
1351 }
1352 _ => Err(fidl::Error::UnknownOrdinal {
1353 ordinal: header.ordinal,
1354 protocol_name:
1355 <RoutesV4Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1356 }),
1357 }))
1358 },
1359 )
1360 }
1361}
1362
1363#[derive(Debug)]
1373pub enum RoutesV4Request {
1374 GlobalRouteSet {
1394 route_set: fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV4Marker>,
1395 control_handle: RoutesV4ControlHandle,
1396 },
1397}
1398
1399impl RoutesV4Request {
1400 #[allow(irrefutable_let_patterns)]
1401 pub fn into_global_route_set(
1402 self,
1403 ) -> Option<(
1404 fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV4Marker>,
1405 RoutesV4ControlHandle,
1406 )> {
1407 if let RoutesV4Request::GlobalRouteSet { route_set, control_handle } = self {
1408 Some((route_set, control_handle))
1409 } else {
1410 None
1411 }
1412 }
1413
1414 pub fn method_name(&self) -> &'static str {
1416 match *self {
1417 RoutesV4Request::GlobalRouteSet { .. } => "global_route_set",
1418 }
1419 }
1420}
1421
1422#[derive(Debug, Clone)]
1423pub struct RoutesV4ControlHandle {
1424 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1425}
1426
1427impl fidl::endpoints::ControlHandle for RoutesV4ControlHandle {
1428 fn shutdown(&self) {
1429 self.inner.shutdown()
1430 }
1431 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1432 self.inner.shutdown_with_epitaph(status)
1433 }
1434
1435 fn is_closed(&self) -> bool {
1436 self.inner.channel().is_closed()
1437 }
1438 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1439 self.inner.channel().on_closed()
1440 }
1441
1442 #[cfg(target_os = "fuchsia")]
1443 fn signal_peer(
1444 &self,
1445 clear_mask: zx::Signals,
1446 set_mask: zx::Signals,
1447 ) -> Result<(), zx_status::Status> {
1448 use fidl::Peered;
1449 self.inner.channel().signal_peer(clear_mask, set_mask)
1450 }
1451}
1452
1453impl RoutesV4ControlHandle {}
1454
1455#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1456pub struct RoutesV6Marker;
1457
1458impl fidl::endpoints::ProtocolMarker for RoutesV6Marker {
1459 type Proxy = RoutesV6Proxy;
1460 type RequestStream = RoutesV6RequestStream;
1461 #[cfg(target_os = "fuchsia")]
1462 type SynchronousProxy = RoutesV6SynchronousProxy;
1463
1464 const DEBUG_NAME: &'static str = "fuchsia.net.root.RoutesV6";
1465}
1466impl fidl::endpoints::DiscoverableProtocolMarker for RoutesV6Marker {}
1467
1468pub trait RoutesV6ProxyInterface: Send + Sync {
1469 fn r#global_route_set(
1470 &self,
1471 route_set: fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV6Marker>,
1472 ) -> Result<(), fidl::Error>;
1473}
1474#[derive(Debug)]
1475#[cfg(target_os = "fuchsia")]
1476pub struct RoutesV6SynchronousProxy {
1477 client: fidl::client::sync::Client,
1478}
1479
1480#[cfg(target_os = "fuchsia")]
1481impl fidl::endpoints::SynchronousProxy for RoutesV6SynchronousProxy {
1482 type Proxy = RoutesV6Proxy;
1483 type Protocol = RoutesV6Marker;
1484
1485 fn from_channel(inner: fidl::Channel) -> Self {
1486 Self::new(inner)
1487 }
1488
1489 fn into_channel(self) -> fidl::Channel {
1490 self.client.into_channel()
1491 }
1492
1493 fn as_channel(&self) -> &fidl::Channel {
1494 self.client.as_channel()
1495 }
1496}
1497
1498#[cfg(target_os = "fuchsia")]
1499impl RoutesV6SynchronousProxy {
1500 pub fn new(channel: fidl::Channel) -> Self {
1501 let protocol_name = <RoutesV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1502 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1503 }
1504
1505 pub fn into_channel(self) -> fidl::Channel {
1506 self.client.into_channel()
1507 }
1508
1509 pub fn wait_for_event(
1512 &self,
1513 deadline: zx::MonotonicInstant,
1514 ) -> Result<RoutesV6Event, fidl::Error> {
1515 RoutesV6Event::decode(self.client.wait_for_event(deadline)?)
1516 }
1517
1518 pub fn r#global_route_set(
1538 &self,
1539 mut route_set: fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV6Marker>,
1540 ) -> Result<(), fidl::Error> {
1541 self.client.send::<RoutesV6GlobalRouteSetRequest>(
1542 (route_set,),
1543 0x41336f581f8d6a61,
1544 fidl::encoding::DynamicFlags::empty(),
1545 )
1546 }
1547}
1548
1549#[cfg(target_os = "fuchsia")]
1550impl From<RoutesV6SynchronousProxy> for zx::Handle {
1551 fn from(value: RoutesV6SynchronousProxy) -> Self {
1552 value.into_channel().into()
1553 }
1554}
1555
1556#[cfg(target_os = "fuchsia")]
1557impl From<fidl::Channel> for RoutesV6SynchronousProxy {
1558 fn from(value: fidl::Channel) -> Self {
1559 Self::new(value)
1560 }
1561}
1562
1563#[derive(Debug, Clone)]
1564pub struct RoutesV6Proxy {
1565 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1566}
1567
1568impl fidl::endpoints::Proxy for RoutesV6Proxy {
1569 type Protocol = RoutesV6Marker;
1570
1571 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1572 Self::new(inner)
1573 }
1574
1575 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1576 self.client.into_channel().map_err(|client| Self { client })
1577 }
1578
1579 fn as_channel(&self) -> &::fidl::AsyncChannel {
1580 self.client.as_channel()
1581 }
1582}
1583
1584impl RoutesV6Proxy {
1585 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1587 let protocol_name = <RoutesV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1588 Self { client: fidl::client::Client::new(channel, protocol_name) }
1589 }
1590
1591 pub fn take_event_stream(&self) -> RoutesV6EventStream {
1597 RoutesV6EventStream { event_receiver: self.client.take_event_receiver() }
1598 }
1599
1600 pub fn r#global_route_set(
1620 &self,
1621 mut route_set: fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV6Marker>,
1622 ) -> Result<(), fidl::Error> {
1623 RoutesV6ProxyInterface::r#global_route_set(self, route_set)
1624 }
1625}
1626
1627impl RoutesV6ProxyInterface for RoutesV6Proxy {
1628 fn r#global_route_set(
1629 &self,
1630 mut route_set: fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV6Marker>,
1631 ) -> Result<(), fidl::Error> {
1632 self.client.send::<RoutesV6GlobalRouteSetRequest>(
1633 (route_set,),
1634 0x41336f581f8d6a61,
1635 fidl::encoding::DynamicFlags::empty(),
1636 )
1637 }
1638}
1639
1640pub struct RoutesV6EventStream {
1641 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1642}
1643
1644impl std::marker::Unpin for RoutesV6EventStream {}
1645
1646impl futures::stream::FusedStream for RoutesV6EventStream {
1647 fn is_terminated(&self) -> bool {
1648 self.event_receiver.is_terminated()
1649 }
1650}
1651
1652impl futures::Stream for RoutesV6EventStream {
1653 type Item = Result<RoutesV6Event, fidl::Error>;
1654
1655 fn poll_next(
1656 mut self: std::pin::Pin<&mut Self>,
1657 cx: &mut std::task::Context<'_>,
1658 ) -> std::task::Poll<Option<Self::Item>> {
1659 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1660 &mut self.event_receiver,
1661 cx
1662 )?) {
1663 Some(buf) => std::task::Poll::Ready(Some(RoutesV6Event::decode(buf))),
1664 None => std::task::Poll::Ready(None),
1665 }
1666 }
1667}
1668
1669#[derive(Debug)]
1670pub enum RoutesV6Event {}
1671
1672impl RoutesV6Event {
1673 fn decode(
1675 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1676 ) -> Result<RoutesV6Event, fidl::Error> {
1677 let (bytes, _handles) = buf.split_mut();
1678 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1679 debug_assert_eq!(tx_header.tx_id, 0);
1680 match tx_header.ordinal {
1681 _ => Err(fidl::Error::UnknownOrdinal {
1682 ordinal: tx_header.ordinal,
1683 protocol_name: <RoutesV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1684 }),
1685 }
1686 }
1687}
1688
1689pub struct RoutesV6RequestStream {
1691 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1692 is_terminated: bool,
1693}
1694
1695impl std::marker::Unpin for RoutesV6RequestStream {}
1696
1697impl futures::stream::FusedStream for RoutesV6RequestStream {
1698 fn is_terminated(&self) -> bool {
1699 self.is_terminated
1700 }
1701}
1702
1703impl fidl::endpoints::RequestStream for RoutesV6RequestStream {
1704 type Protocol = RoutesV6Marker;
1705 type ControlHandle = RoutesV6ControlHandle;
1706
1707 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1708 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1709 }
1710
1711 fn control_handle(&self) -> Self::ControlHandle {
1712 RoutesV6ControlHandle { inner: self.inner.clone() }
1713 }
1714
1715 fn into_inner(
1716 self,
1717 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1718 {
1719 (self.inner, self.is_terminated)
1720 }
1721
1722 fn from_inner(
1723 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1724 is_terminated: bool,
1725 ) -> Self {
1726 Self { inner, is_terminated }
1727 }
1728}
1729
1730impl futures::Stream for RoutesV6RequestStream {
1731 type Item = Result<RoutesV6Request, fidl::Error>;
1732
1733 fn poll_next(
1734 mut self: std::pin::Pin<&mut Self>,
1735 cx: &mut std::task::Context<'_>,
1736 ) -> std::task::Poll<Option<Self::Item>> {
1737 let this = &mut *self;
1738 if this.inner.check_shutdown(cx) {
1739 this.is_terminated = true;
1740 return std::task::Poll::Ready(None);
1741 }
1742 if this.is_terminated {
1743 panic!("polled RoutesV6RequestStream after completion");
1744 }
1745 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1746 |bytes, handles| {
1747 match this.inner.channel().read_etc(cx, bytes, handles) {
1748 std::task::Poll::Ready(Ok(())) => {}
1749 std::task::Poll::Pending => return std::task::Poll::Pending,
1750 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1751 this.is_terminated = true;
1752 return std::task::Poll::Ready(None);
1753 }
1754 std::task::Poll::Ready(Err(e)) => {
1755 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1756 e.into(),
1757 ))))
1758 }
1759 }
1760
1761 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1763
1764 std::task::Poll::Ready(Some(match header.ordinal {
1765 0x41336f581f8d6a61 => {
1766 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1767 let mut req = fidl::new_empty!(
1768 RoutesV6GlobalRouteSetRequest,
1769 fidl::encoding::DefaultFuchsiaResourceDialect
1770 );
1771 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RoutesV6GlobalRouteSetRequest>(&header, _body_bytes, handles, &mut req)?;
1772 let control_handle = RoutesV6ControlHandle { inner: this.inner.clone() };
1773 Ok(RoutesV6Request::GlobalRouteSet {
1774 route_set: req.route_set,
1775
1776 control_handle,
1777 })
1778 }
1779 _ => Err(fidl::Error::UnknownOrdinal {
1780 ordinal: header.ordinal,
1781 protocol_name:
1782 <RoutesV6Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1783 }),
1784 }))
1785 },
1786 )
1787 }
1788}
1789
1790#[derive(Debug)]
1800pub enum RoutesV6Request {
1801 GlobalRouteSet {
1821 route_set: fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV6Marker>,
1822 control_handle: RoutesV6ControlHandle,
1823 },
1824}
1825
1826impl RoutesV6Request {
1827 #[allow(irrefutable_let_patterns)]
1828 pub fn into_global_route_set(
1829 self,
1830 ) -> Option<(
1831 fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV6Marker>,
1832 RoutesV6ControlHandle,
1833 )> {
1834 if let RoutesV6Request::GlobalRouteSet { route_set, control_handle } = self {
1835 Some((route_set, control_handle))
1836 } else {
1837 None
1838 }
1839 }
1840
1841 pub fn method_name(&self) -> &'static str {
1843 match *self {
1844 RoutesV6Request::GlobalRouteSet { .. } => "global_route_set",
1845 }
1846 }
1847}
1848
1849#[derive(Debug, Clone)]
1850pub struct RoutesV6ControlHandle {
1851 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1852}
1853
1854impl fidl::endpoints::ControlHandle for RoutesV6ControlHandle {
1855 fn shutdown(&self) {
1856 self.inner.shutdown()
1857 }
1858 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1859 self.inner.shutdown_with_epitaph(status)
1860 }
1861
1862 fn is_closed(&self) -> bool {
1863 self.inner.channel().is_closed()
1864 }
1865 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1866 self.inner.channel().on_closed()
1867 }
1868
1869 #[cfg(target_os = "fuchsia")]
1870 fn signal_peer(
1871 &self,
1872 clear_mask: zx::Signals,
1873 set_mask: zx::Signals,
1874 ) -> Result<(), zx_status::Status> {
1875 use fidl::Peered;
1876 self.inner.channel().signal_peer(clear_mask, set_mask)
1877 }
1878}
1879
1880impl RoutesV6ControlHandle {}
1881
1882mod internal {
1883 use super::*;
1884
1885 impl fidl::encoding::ResourceTypeMarker for FilterOpenControllerRequest {
1886 type Borrowed<'a> = &'a mut Self;
1887 fn take_or_borrow<'a>(
1888 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1889 ) -> Self::Borrowed<'a> {
1890 value
1891 }
1892 }
1893
1894 unsafe impl fidl::encoding::TypeMarker for FilterOpenControllerRequest {
1895 type Owned = Self;
1896
1897 #[inline(always)]
1898 fn inline_align(_context: fidl::encoding::Context) -> usize {
1899 8
1900 }
1901
1902 #[inline(always)]
1903 fn inline_size(_context: fidl::encoding::Context) -> usize {
1904 24
1905 }
1906 }
1907
1908 unsafe impl
1909 fidl::encoding::Encode<
1910 FilterOpenControllerRequest,
1911 fidl::encoding::DefaultFuchsiaResourceDialect,
1912 > for &mut FilterOpenControllerRequest
1913 {
1914 #[inline]
1915 unsafe fn encode(
1916 self,
1917 encoder: &mut fidl::encoding::Encoder<
1918 '_,
1919 fidl::encoding::DefaultFuchsiaResourceDialect,
1920 >,
1921 offset: usize,
1922 _depth: fidl::encoding::Depth,
1923 ) -> fidl::Result<()> {
1924 encoder.debug_check_bounds::<FilterOpenControllerRequest>(offset);
1925 fidl::encoding::Encode::<
1927 FilterOpenControllerRequest,
1928 fidl::encoding::DefaultFuchsiaResourceDialect,
1929 >::encode(
1930 (
1931 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
1932 &self.id,
1933 ),
1934 <fidl::encoding::Endpoint<
1935 fidl::endpoints::ServerEnd<
1936 fidl_fuchsia_net_filter::NamespaceControllerMarker,
1937 >,
1938 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1939 &mut self.request
1940 ),
1941 ),
1942 encoder,
1943 offset,
1944 _depth,
1945 )
1946 }
1947 }
1948 unsafe impl<
1949 T0: fidl::encoding::Encode<
1950 fidl::encoding::BoundedString<255>,
1951 fidl::encoding::DefaultFuchsiaResourceDialect,
1952 >,
1953 T1: fidl::encoding::Encode<
1954 fidl::encoding::Endpoint<
1955 fidl::endpoints::ServerEnd<fidl_fuchsia_net_filter::NamespaceControllerMarker>,
1956 >,
1957 fidl::encoding::DefaultFuchsiaResourceDialect,
1958 >,
1959 >
1960 fidl::encoding::Encode<
1961 FilterOpenControllerRequest,
1962 fidl::encoding::DefaultFuchsiaResourceDialect,
1963 > for (T0, T1)
1964 {
1965 #[inline]
1966 unsafe fn encode(
1967 self,
1968 encoder: &mut fidl::encoding::Encoder<
1969 '_,
1970 fidl::encoding::DefaultFuchsiaResourceDialect,
1971 >,
1972 offset: usize,
1973 depth: fidl::encoding::Depth,
1974 ) -> fidl::Result<()> {
1975 encoder.debug_check_bounds::<FilterOpenControllerRequest>(offset);
1976 unsafe {
1979 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
1980 (ptr as *mut u64).write_unaligned(0);
1981 }
1982 self.0.encode(encoder, offset + 0, depth)?;
1984 self.1.encode(encoder, offset + 16, depth)?;
1985 Ok(())
1986 }
1987 }
1988
1989 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1990 for FilterOpenControllerRequest
1991 {
1992 #[inline(always)]
1993 fn new_empty() -> Self {
1994 Self {
1995 id: fidl::new_empty!(
1996 fidl::encoding::BoundedString<255>,
1997 fidl::encoding::DefaultFuchsiaResourceDialect
1998 ),
1999 request: fidl::new_empty!(
2000 fidl::encoding::Endpoint<
2001 fidl::endpoints::ServerEnd<
2002 fidl_fuchsia_net_filter::NamespaceControllerMarker,
2003 >,
2004 >,
2005 fidl::encoding::DefaultFuchsiaResourceDialect
2006 ),
2007 }
2008 }
2009
2010 #[inline]
2011 unsafe fn decode(
2012 &mut self,
2013 decoder: &mut fidl::encoding::Decoder<
2014 '_,
2015 fidl::encoding::DefaultFuchsiaResourceDialect,
2016 >,
2017 offset: usize,
2018 _depth: fidl::encoding::Depth,
2019 ) -> fidl::Result<()> {
2020 decoder.debug_check_bounds::<Self>(offset);
2021 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
2023 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2024 let mask = 0xffffffff00000000u64;
2025 let maskedval = padval & mask;
2026 if maskedval != 0 {
2027 return Err(fidl::Error::NonZeroPadding {
2028 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
2029 });
2030 }
2031 fidl::decode!(
2032 fidl::encoding::BoundedString<255>,
2033 fidl::encoding::DefaultFuchsiaResourceDialect,
2034 &mut self.id,
2035 decoder,
2036 offset + 0,
2037 _depth
2038 )?;
2039 fidl::decode!(
2040 fidl::encoding::Endpoint<
2041 fidl::endpoints::ServerEnd<fidl_fuchsia_net_filter::NamespaceControllerMarker>,
2042 >,
2043 fidl::encoding::DefaultFuchsiaResourceDialect,
2044 &mut self.request,
2045 decoder,
2046 offset + 16,
2047 _depth
2048 )?;
2049 Ok(())
2050 }
2051 }
2052
2053 impl fidl::encoding::ResourceTypeMarker for InterfacesGetAdminRequest {
2054 type Borrowed<'a> = &'a mut Self;
2055 fn take_or_borrow<'a>(
2056 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2057 ) -> Self::Borrowed<'a> {
2058 value
2059 }
2060 }
2061
2062 unsafe impl fidl::encoding::TypeMarker for InterfacesGetAdminRequest {
2063 type Owned = Self;
2064
2065 #[inline(always)]
2066 fn inline_align(_context: fidl::encoding::Context) -> usize {
2067 8
2068 }
2069
2070 #[inline(always)]
2071 fn inline_size(_context: fidl::encoding::Context) -> usize {
2072 16
2073 }
2074 }
2075
2076 unsafe impl
2077 fidl::encoding::Encode<
2078 InterfacesGetAdminRequest,
2079 fidl::encoding::DefaultFuchsiaResourceDialect,
2080 > for &mut InterfacesGetAdminRequest
2081 {
2082 #[inline]
2083 unsafe fn encode(
2084 self,
2085 encoder: &mut fidl::encoding::Encoder<
2086 '_,
2087 fidl::encoding::DefaultFuchsiaResourceDialect,
2088 >,
2089 offset: usize,
2090 _depth: fidl::encoding::Depth,
2091 ) -> fidl::Result<()> {
2092 encoder.debug_check_bounds::<InterfacesGetAdminRequest>(offset);
2093 fidl::encoding::Encode::<
2095 InterfacesGetAdminRequest,
2096 fidl::encoding::DefaultFuchsiaResourceDialect,
2097 >::encode(
2098 (
2099 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
2100 <fidl::encoding::Endpoint<
2101 fidl::endpoints::ServerEnd<
2102 fidl_fuchsia_net_interfaces_admin::ControlMarker,
2103 >,
2104 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2105 &mut self.control
2106 ),
2107 ),
2108 encoder,
2109 offset,
2110 _depth,
2111 )
2112 }
2113 }
2114 unsafe impl<
2115 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
2116 T1: fidl::encoding::Encode<
2117 fidl::encoding::Endpoint<
2118 fidl::endpoints::ServerEnd<fidl_fuchsia_net_interfaces_admin::ControlMarker>,
2119 >,
2120 fidl::encoding::DefaultFuchsiaResourceDialect,
2121 >,
2122 >
2123 fidl::encoding::Encode<
2124 InterfacesGetAdminRequest,
2125 fidl::encoding::DefaultFuchsiaResourceDialect,
2126 > for (T0, T1)
2127 {
2128 #[inline]
2129 unsafe fn encode(
2130 self,
2131 encoder: &mut fidl::encoding::Encoder<
2132 '_,
2133 fidl::encoding::DefaultFuchsiaResourceDialect,
2134 >,
2135 offset: usize,
2136 depth: fidl::encoding::Depth,
2137 ) -> fidl::Result<()> {
2138 encoder.debug_check_bounds::<InterfacesGetAdminRequest>(offset);
2139 unsafe {
2142 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2143 (ptr as *mut u64).write_unaligned(0);
2144 }
2145 self.0.encode(encoder, offset + 0, depth)?;
2147 self.1.encode(encoder, offset + 8, depth)?;
2148 Ok(())
2149 }
2150 }
2151
2152 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2153 for InterfacesGetAdminRequest
2154 {
2155 #[inline(always)]
2156 fn new_empty() -> Self {
2157 Self {
2158 id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
2159 control: fidl::new_empty!(
2160 fidl::encoding::Endpoint<
2161 fidl::endpoints::ServerEnd<
2162 fidl_fuchsia_net_interfaces_admin::ControlMarker,
2163 >,
2164 >,
2165 fidl::encoding::DefaultFuchsiaResourceDialect
2166 ),
2167 }
2168 }
2169
2170 #[inline]
2171 unsafe fn decode(
2172 &mut self,
2173 decoder: &mut fidl::encoding::Decoder<
2174 '_,
2175 fidl::encoding::DefaultFuchsiaResourceDialect,
2176 >,
2177 offset: usize,
2178 _depth: fidl::encoding::Depth,
2179 ) -> fidl::Result<()> {
2180 decoder.debug_check_bounds::<Self>(offset);
2181 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2183 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2184 let mask = 0xffffffff00000000u64;
2185 let maskedval = padval & mask;
2186 if maskedval != 0 {
2187 return Err(fidl::Error::NonZeroPadding {
2188 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2189 });
2190 }
2191 fidl::decode!(
2192 u64,
2193 fidl::encoding::DefaultFuchsiaResourceDialect,
2194 &mut self.id,
2195 decoder,
2196 offset + 0,
2197 _depth
2198 )?;
2199 fidl::decode!(
2200 fidl::encoding::Endpoint<
2201 fidl::endpoints::ServerEnd<fidl_fuchsia_net_interfaces_admin::ControlMarker>,
2202 >,
2203 fidl::encoding::DefaultFuchsiaResourceDialect,
2204 &mut self.control,
2205 decoder,
2206 offset + 8,
2207 _depth
2208 )?;
2209 Ok(())
2210 }
2211 }
2212
2213 impl fidl::encoding::ResourceTypeMarker for RoutesV4GlobalRouteSetRequest {
2214 type Borrowed<'a> = &'a mut Self;
2215 fn take_or_borrow<'a>(
2216 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2217 ) -> Self::Borrowed<'a> {
2218 value
2219 }
2220 }
2221
2222 unsafe impl fidl::encoding::TypeMarker for RoutesV4GlobalRouteSetRequest {
2223 type Owned = Self;
2224
2225 #[inline(always)]
2226 fn inline_align(_context: fidl::encoding::Context) -> usize {
2227 4
2228 }
2229
2230 #[inline(always)]
2231 fn inline_size(_context: fidl::encoding::Context) -> usize {
2232 4
2233 }
2234 }
2235
2236 unsafe impl
2237 fidl::encoding::Encode<
2238 RoutesV4GlobalRouteSetRequest,
2239 fidl::encoding::DefaultFuchsiaResourceDialect,
2240 > for &mut RoutesV4GlobalRouteSetRequest
2241 {
2242 #[inline]
2243 unsafe fn encode(
2244 self,
2245 encoder: &mut fidl::encoding::Encoder<
2246 '_,
2247 fidl::encoding::DefaultFuchsiaResourceDialect,
2248 >,
2249 offset: usize,
2250 _depth: fidl::encoding::Depth,
2251 ) -> fidl::Result<()> {
2252 encoder.debug_check_bounds::<RoutesV4GlobalRouteSetRequest>(offset);
2253 fidl::encoding::Encode::<
2255 RoutesV4GlobalRouteSetRequest,
2256 fidl::encoding::DefaultFuchsiaResourceDialect,
2257 >::encode(
2258 (<fidl::encoding::Endpoint<
2259 fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV4Marker>,
2260 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2261 &mut self.route_set
2262 ),),
2263 encoder,
2264 offset,
2265 _depth,
2266 )
2267 }
2268 }
2269 unsafe impl<
2270 T0: fidl::encoding::Encode<
2271 fidl::encoding::Endpoint<
2272 fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV4Marker>,
2273 >,
2274 fidl::encoding::DefaultFuchsiaResourceDialect,
2275 >,
2276 >
2277 fidl::encoding::Encode<
2278 RoutesV4GlobalRouteSetRequest,
2279 fidl::encoding::DefaultFuchsiaResourceDialect,
2280 > for (T0,)
2281 {
2282 #[inline]
2283 unsafe fn encode(
2284 self,
2285 encoder: &mut fidl::encoding::Encoder<
2286 '_,
2287 fidl::encoding::DefaultFuchsiaResourceDialect,
2288 >,
2289 offset: usize,
2290 depth: fidl::encoding::Depth,
2291 ) -> fidl::Result<()> {
2292 encoder.debug_check_bounds::<RoutesV4GlobalRouteSetRequest>(offset);
2293 self.0.encode(encoder, offset + 0, depth)?;
2297 Ok(())
2298 }
2299 }
2300
2301 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2302 for RoutesV4GlobalRouteSetRequest
2303 {
2304 #[inline(always)]
2305 fn new_empty() -> Self {
2306 Self {
2307 route_set: fidl::new_empty!(
2308 fidl::encoding::Endpoint<
2309 fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV4Marker>,
2310 >,
2311 fidl::encoding::DefaultFuchsiaResourceDialect
2312 ),
2313 }
2314 }
2315
2316 #[inline]
2317 unsafe fn decode(
2318 &mut self,
2319 decoder: &mut fidl::encoding::Decoder<
2320 '_,
2321 fidl::encoding::DefaultFuchsiaResourceDialect,
2322 >,
2323 offset: usize,
2324 _depth: fidl::encoding::Depth,
2325 ) -> fidl::Result<()> {
2326 decoder.debug_check_bounds::<Self>(offset);
2327 fidl::decode!(
2329 fidl::encoding::Endpoint<
2330 fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV4Marker>,
2331 >,
2332 fidl::encoding::DefaultFuchsiaResourceDialect,
2333 &mut self.route_set,
2334 decoder,
2335 offset + 0,
2336 _depth
2337 )?;
2338 Ok(())
2339 }
2340 }
2341
2342 impl fidl::encoding::ResourceTypeMarker for RoutesV6GlobalRouteSetRequest {
2343 type Borrowed<'a> = &'a mut Self;
2344 fn take_or_borrow<'a>(
2345 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
2346 ) -> Self::Borrowed<'a> {
2347 value
2348 }
2349 }
2350
2351 unsafe impl fidl::encoding::TypeMarker for RoutesV6GlobalRouteSetRequest {
2352 type Owned = Self;
2353
2354 #[inline(always)]
2355 fn inline_align(_context: fidl::encoding::Context) -> usize {
2356 4
2357 }
2358
2359 #[inline(always)]
2360 fn inline_size(_context: fidl::encoding::Context) -> usize {
2361 4
2362 }
2363 }
2364
2365 unsafe impl
2366 fidl::encoding::Encode<
2367 RoutesV6GlobalRouteSetRequest,
2368 fidl::encoding::DefaultFuchsiaResourceDialect,
2369 > for &mut RoutesV6GlobalRouteSetRequest
2370 {
2371 #[inline]
2372 unsafe fn encode(
2373 self,
2374 encoder: &mut fidl::encoding::Encoder<
2375 '_,
2376 fidl::encoding::DefaultFuchsiaResourceDialect,
2377 >,
2378 offset: usize,
2379 _depth: fidl::encoding::Depth,
2380 ) -> fidl::Result<()> {
2381 encoder.debug_check_bounds::<RoutesV6GlobalRouteSetRequest>(offset);
2382 fidl::encoding::Encode::<
2384 RoutesV6GlobalRouteSetRequest,
2385 fidl::encoding::DefaultFuchsiaResourceDialect,
2386 >::encode(
2387 (<fidl::encoding::Endpoint<
2388 fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV6Marker>,
2389 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
2390 &mut self.route_set
2391 ),),
2392 encoder,
2393 offset,
2394 _depth,
2395 )
2396 }
2397 }
2398 unsafe impl<
2399 T0: fidl::encoding::Encode<
2400 fidl::encoding::Endpoint<
2401 fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV6Marker>,
2402 >,
2403 fidl::encoding::DefaultFuchsiaResourceDialect,
2404 >,
2405 >
2406 fidl::encoding::Encode<
2407 RoutesV6GlobalRouteSetRequest,
2408 fidl::encoding::DefaultFuchsiaResourceDialect,
2409 > for (T0,)
2410 {
2411 #[inline]
2412 unsafe fn encode(
2413 self,
2414 encoder: &mut fidl::encoding::Encoder<
2415 '_,
2416 fidl::encoding::DefaultFuchsiaResourceDialect,
2417 >,
2418 offset: usize,
2419 depth: fidl::encoding::Depth,
2420 ) -> fidl::Result<()> {
2421 encoder.debug_check_bounds::<RoutesV6GlobalRouteSetRequest>(offset);
2422 self.0.encode(encoder, offset + 0, depth)?;
2426 Ok(())
2427 }
2428 }
2429
2430 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
2431 for RoutesV6GlobalRouteSetRequest
2432 {
2433 #[inline(always)]
2434 fn new_empty() -> Self {
2435 Self {
2436 route_set: fidl::new_empty!(
2437 fidl::encoding::Endpoint<
2438 fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV6Marker>,
2439 >,
2440 fidl::encoding::DefaultFuchsiaResourceDialect
2441 ),
2442 }
2443 }
2444
2445 #[inline]
2446 unsafe fn decode(
2447 &mut self,
2448 decoder: &mut fidl::encoding::Decoder<
2449 '_,
2450 fidl::encoding::DefaultFuchsiaResourceDialect,
2451 >,
2452 offset: usize,
2453 _depth: fidl::encoding::Depth,
2454 ) -> fidl::Result<()> {
2455 decoder.debug_check_bounds::<Self>(offset);
2456 fidl::decode!(
2458 fidl::encoding::Endpoint<
2459 fidl::endpoints::ServerEnd<fidl_fuchsia_net_routes_admin::RouteSetV6Marker>,
2460 >,
2461 fidl::encoding::DefaultFuchsiaResourceDialect,
2462 &mut self.route_set,
2463 decoder,
2464 offset + 0,
2465 _depth
2466 )?;
2467 Ok(())
2468 }
2469 }
2470}