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_settings__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15pub struct ControlMarker;
16
17impl fidl::endpoints::ProtocolMarker for ControlMarker {
18 type Proxy = ControlProxy;
19 type RequestStream = ControlRequestStream;
20 #[cfg(target_os = "fuchsia")]
21 type SynchronousProxy = ControlSynchronousProxy;
22
23 const DEBUG_NAME: &'static str = "fuchsia.net.settings.Control";
24}
25impl fidl::endpoints::DiscoverableProtocolMarker for ControlMarker {}
26pub type ControlUpdateInterfaceDefaultsResult =
27 Result<fidl_fuchsia_net_interfaces_admin::Configuration, UpdateError>;
28pub type ControlUpdateTcpResult = Result<Tcp, UpdateError>;
29pub type ControlUpdateUdpResult = Result<Udp, UpdateError>;
30pub type ControlUpdateIcmpResult = Result<Icmp, UpdateError>;
31pub type ControlUpdateIpResult = Result<Ip, UpdateError>;
32pub type ControlUpdateDeviceResult = Result<Device, UpdateError>;
33
34pub trait ControlProxyInterface: Send + Sync {
35 type UpdateInterfaceDefaultsResponseFut: std::future::Future<Output = Result<ControlUpdateInterfaceDefaultsResult, fidl::Error>>
36 + Send;
37 fn r#update_interface_defaults(
38 &self,
39 payload: &fidl_fuchsia_net_interfaces_admin::Configuration,
40 ) -> Self::UpdateInterfaceDefaultsResponseFut;
41 type UpdateTcpResponseFut: std::future::Future<Output = Result<ControlUpdateTcpResult, fidl::Error>>
42 + Send;
43 fn r#update_tcp(&self, payload: &Tcp) -> Self::UpdateTcpResponseFut;
44 type UpdateUdpResponseFut: std::future::Future<Output = Result<ControlUpdateUdpResult, fidl::Error>>
45 + Send;
46 fn r#update_udp(&self, payload: &Udp) -> Self::UpdateUdpResponseFut;
47 type UpdateIcmpResponseFut: std::future::Future<Output = Result<ControlUpdateIcmpResult, fidl::Error>>
48 + Send;
49 fn r#update_icmp(&self, payload: &Icmp) -> Self::UpdateIcmpResponseFut;
50 type UpdateIpResponseFut: std::future::Future<Output = Result<ControlUpdateIpResult, fidl::Error>>
51 + Send;
52 fn r#update_ip(&self, payload: &Ip) -> Self::UpdateIpResponseFut;
53 type UpdateDeviceResponseFut: std::future::Future<Output = Result<ControlUpdateDeviceResult, fidl::Error>>
54 + Send;
55 fn r#update_device(&self, payload: &Device) -> Self::UpdateDeviceResponseFut;
56}
57#[derive(Debug)]
58#[cfg(target_os = "fuchsia")]
59pub struct ControlSynchronousProxy {
60 client: fidl::client::sync::Client,
61}
62
63#[cfg(target_os = "fuchsia")]
64impl fidl::endpoints::SynchronousProxy for ControlSynchronousProxy {
65 type Proxy = ControlProxy;
66 type Protocol = ControlMarker;
67
68 fn from_channel(inner: fidl::Channel) -> Self {
69 Self::new(inner)
70 }
71
72 fn into_channel(self) -> fidl::Channel {
73 self.client.into_channel()
74 }
75
76 fn as_channel(&self) -> &fidl::Channel {
77 self.client.as_channel()
78 }
79}
80
81#[cfg(target_os = "fuchsia")]
82impl ControlSynchronousProxy {
83 pub fn new(channel: fidl::Channel) -> Self {
84 let protocol_name = <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
85 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
86 }
87
88 pub fn into_channel(self) -> fidl::Channel {
89 self.client.into_channel()
90 }
91
92 pub fn wait_for_event(
95 &self,
96 deadline: zx::MonotonicInstant,
97 ) -> Result<ControlEvent, fidl::Error> {
98 ControlEvent::decode(self.client.wait_for_event(deadline)?)
99 }
100
101 pub fn r#update_interface_defaults(
118 &self,
119 mut payload: &fidl_fuchsia_net_interfaces_admin::Configuration,
120 ___deadline: zx::MonotonicInstant,
121 ) -> Result<ControlUpdateInterfaceDefaultsResult, fidl::Error> {
122 let _response = self.client.send_query::<
123 fidl_fuchsia_net_interfaces_admin::Configuration,
124 fidl::encoding::ResultType<fidl_fuchsia_net_interfaces_admin::Configuration, UpdateError>,
125 >(
126 payload,
127 0x46ea2036390abecc,
128 fidl::encoding::DynamicFlags::empty(),
129 ___deadline,
130 )?;
131 Ok(_response.map(|x| x))
132 }
133
134 pub fn r#update_tcp(
145 &self,
146 mut payload: &Tcp,
147 ___deadline: zx::MonotonicInstant,
148 ) -> Result<ControlUpdateTcpResult, fidl::Error> {
149 let _response =
150 self.client.send_query::<Tcp, fidl::encoding::ResultType<Tcp, UpdateError>>(
151 payload,
152 0x4e768d74ec55450f,
153 fidl::encoding::DynamicFlags::empty(),
154 ___deadline,
155 )?;
156 Ok(_response.map(|x| x))
157 }
158
159 pub fn r#update_udp(
170 &self,
171 mut payload: &Udp,
172 ___deadline: zx::MonotonicInstant,
173 ) -> Result<ControlUpdateUdpResult, fidl::Error> {
174 let _response =
175 self.client.send_query::<Udp, fidl::encoding::ResultType<Udp, UpdateError>>(
176 payload,
177 0x6fb82be32e7338b4,
178 fidl::encoding::DynamicFlags::empty(),
179 ___deadline,
180 )?;
181 Ok(_response.map(|x| x))
182 }
183
184 pub fn r#update_icmp(
195 &self,
196 mut payload: &Icmp,
197 ___deadline: zx::MonotonicInstant,
198 ) -> Result<ControlUpdateIcmpResult, fidl::Error> {
199 let _response =
200 self.client.send_query::<Icmp, fidl::encoding::ResultType<Icmp, UpdateError>>(
201 payload,
202 0x42f130ff9cc3a8d5,
203 fidl::encoding::DynamicFlags::empty(),
204 ___deadline,
205 )?;
206 Ok(_response.map(|x| x))
207 }
208
209 pub fn r#update_ip(
220 &self,
221 mut payload: &Ip,
222 ___deadline: zx::MonotonicInstant,
223 ) -> Result<ControlUpdateIpResult, fidl::Error> {
224 let _response = self.client.send_query::<Ip, fidl::encoding::ResultType<Ip, UpdateError>>(
225 payload,
226 0x75d1074407e4d1c4,
227 fidl::encoding::DynamicFlags::empty(),
228 ___deadline,
229 )?;
230 Ok(_response.map(|x| x))
231 }
232
233 pub fn r#update_device(
245 &self,
246 mut payload: &Device,
247 ___deadline: zx::MonotonicInstant,
248 ) -> Result<ControlUpdateDeviceResult, fidl::Error> {
249 let _response =
250 self.client.send_query::<Device, fidl::encoding::ResultType<Device, UpdateError>>(
251 payload,
252 0x6080a91e617e9430,
253 fidl::encoding::DynamicFlags::empty(),
254 ___deadline,
255 )?;
256 Ok(_response.map(|x| x))
257 }
258}
259
260#[cfg(target_os = "fuchsia")]
261impl From<ControlSynchronousProxy> for zx::Handle {
262 fn from(value: ControlSynchronousProxy) -> Self {
263 value.into_channel().into()
264 }
265}
266
267#[cfg(target_os = "fuchsia")]
268impl From<fidl::Channel> for ControlSynchronousProxy {
269 fn from(value: fidl::Channel) -> Self {
270 Self::new(value)
271 }
272}
273
274#[cfg(target_os = "fuchsia")]
275impl fidl::endpoints::FromClient for ControlSynchronousProxy {
276 type Protocol = ControlMarker;
277
278 fn from_client(value: fidl::endpoints::ClientEnd<ControlMarker>) -> Self {
279 Self::new(value.into_channel())
280 }
281}
282
283#[derive(Debug, Clone)]
284pub struct ControlProxy {
285 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
286}
287
288impl fidl::endpoints::Proxy for ControlProxy {
289 type Protocol = ControlMarker;
290
291 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
292 Self::new(inner)
293 }
294
295 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
296 self.client.into_channel().map_err(|client| Self { client })
297 }
298
299 fn as_channel(&self) -> &::fidl::AsyncChannel {
300 self.client.as_channel()
301 }
302}
303
304impl ControlProxy {
305 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
307 let protocol_name = <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
308 Self { client: fidl::client::Client::new(channel, protocol_name) }
309 }
310
311 pub fn take_event_stream(&self) -> ControlEventStream {
317 ControlEventStream { event_receiver: self.client.take_event_receiver() }
318 }
319
320 pub fn r#update_interface_defaults(
337 &self,
338 mut payload: &fidl_fuchsia_net_interfaces_admin::Configuration,
339 ) -> fidl::client::QueryResponseFut<
340 ControlUpdateInterfaceDefaultsResult,
341 fidl::encoding::DefaultFuchsiaResourceDialect,
342 > {
343 ControlProxyInterface::r#update_interface_defaults(self, payload)
344 }
345
346 pub fn r#update_tcp(
357 &self,
358 mut payload: &Tcp,
359 ) -> fidl::client::QueryResponseFut<
360 ControlUpdateTcpResult,
361 fidl::encoding::DefaultFuchsiaResourceDialect,
362 > {
363 ControlProxyInterface::r#update_tcp(self, payload)
364 }
365
366 pub fn r#update_udp(
377 &self,
378 mut payload: &Udp,
379 ) -> fidl::client::QueryResponseFut<
380 ControlUpdateUdpResult,
381 fidl::encoding::DefaultFuchsiaResourceDialect,
382 > {
383 ControlProxyInterface::r#update_udp(self, payload)
384 }
385
386 pub fn r#update_icmp(
397 &self,
398 mut payload: &Icmp,
399 ) -> fidl::client::QueryResponseFut<
400 ControlUpdateIcmpResult,
401 fidl::encoding::DefaultFuchsiaResourceDialect,
402 > {
403 ControlProxyInterface::r#update_icmp(self, payload)
404 }
405
406 pub fn r#update_ip(
417 &self,
418 mut payload: &Ip,
419 ) -> fidl::client::QueryResponseFut<
420 ControlUpdateIpResult,
421 fidl::encoding::DefaultFuchsiaResourceDialect,
422 > {
423 ControlProxyInterface::r#update_ip(self, payload)
424 }
425
426 pub fn r#update_device(
438 &self,
439 mut payload: &Device,
440 ) -> fidl::client::QueryResponseFut<
441 ControlUpdateDeviceResult,
442 fidl::encoding::DefaultFuchsiaResourceDialect,
443 > {
444 ControlProxyInterface::r#update_device(self, payload)
445 }
446}
447
448impl ControlProxyInterface for ControlProxy {
449 type UpdateInterfaceDefaultsResponseFut = fidl::client::QueryResponseFut<
450 ControlUpdateInterfaceDefaultsResult,
451 fidl::encoding::DefaultFuchsiaResourceDialect,
452 >;
453 fn r#update_interface_defaults(
454 &self,
455 mut payload: &fidl_fuchsia_net_interfaces_admin::Configuration,
456 ) -> Self::UpdateInterfaceDefaultsResponseFut {
457 fn _decode(
458 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
459 ) -> Result<ControlUpdateInterfaceDefaultsResult, fidl::Error> {
460 let _response = fidl::client::decode_transaction_body::<
461 fidl::encoding::ResultType<
462 fidl_fuchsia_net_interfaces_admin::Configuration,
463 UpdateError,
464 >,
465 fidl::encoding::DefaultFuchsiaResourceDialect,
466 0x46ea2036390abecc,
467 >(_buf?)?;
468 Ok(_response.map(|x| x))
469 }
470 self.client.send_query_and_decode::<
471 fidl_fuchsia_net_interfaces_admin::Configuration,
472 ControlUpdateInterfaceDefaultsResult,
473 >(
474 payload,
475 0x46ea2036390abecc,
476 fidl::encoding::DynamicFlags::empty(),
477 _decode,
478 )
479 }
480
481 type UpdateTcpResponseFut = fidl::client::QueryResponseFut<
482 ControlUpdateTcpResult,
483 fidl::encoding::DefaultFuchsiaResourceDialect,
484 >;
485 fn r#update_tcp(&self, mut payload: &Tcp) -> Self::UpdateTcpResponseFut {
486 fn _decode(
487 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
488 ) -> Result<ControlUpdateTcpResult, fidl::Error> {
489 let _response = fidl::client::decode_transaction_body::<
490 fidl::encoding::ResultType<Tcp, UpdateError>,
491 fidl::encoding::DefaultFuchsiaResourceDialect,
492 0x4e768d74ec55450f,
493 >(_buf?)?;
494 Ok(_response.map(|x| x))
495 }
496 self.client.send_query_and_decode::<Tcp, ControlUpdateTcpResult>(
497 payload,
498 0x4e768d74ec55450f,
499 fidl::encoding::DynamicFlags::empty(),
500 _decode,
501 )
502 }
503
504 type UpdateUdpResponseFut = fidl::client::QueryResponseFut<
505 ControlUpdateUdpResult,
506 fidl::encoding::DefaultFuchsiaResourceDialect,
507 >;
508 fn r#update_udp(&self, mut payload: &Udp) -> Self::UpdateUdpResponseFut {
509 fn _decode(
510 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
511 ) -> Result<ControlUpdateUdpResult, fidl::Error> {
512 let _response = fidl::client::decode_transaction_body::<
513 fidl::encoding::ResultType<Udp, UpdateError>,
514 fidl::encoding::DefaultFuchsiaResourceDialect,
515 0x6fb82be32e7338b4,
516 >(_buf?)?;
517 Ok(_response.map(|x| x))
518 }
519 self.client.send_query_and_decode::<Udp, ControlUpdateUdpResult>(
520 payload,
521 0x6fb82be32e7338b4,
522 fidl::encoding::DynamicFlags::empty(),
523 _decode,
524 )
525 }
526
527 type UpdateIcmpResponseFut = fidl::client::QueryResponseFut<
528 ControlUpdateIcmpResult,
529 fidl::encoding::DefaultFuchsiaResourceDialect,
530 >;
531 fn r#update_icmp(&self, mut payload: &Icmp) -> Self::UpdateIcmpResponseFut {
532 fn _decode(
533 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
534 ) -> Result<ControlUpdateIcmpResult, fidl::Error> {
535 let _response = fidl::client::decode_transaction_body::<
536 fidl::encoding::ResultType<Icmp, UpdateError>,
537 fidl::encoding::DefaultFuchsiaResourceDialect,
538 0x42f130ff9cc3a8d5,
539 >(_buf?)?;
540 Ok(_response.map(|x| x))
541 }
542 self.client.send_query_and_decode::<Icmp, ControlUpdateIcmpResult>(
543 payload,
544 0x42f130ff9cc3a8d5,
545 fidl::encoding::DynamicFlags::empty(),
546 _decode,
547 )
548 }
549
550 type UpdateIpResponseFut = fidl::client::QueryResponseFut<
551 ControlUpdateIpResult,
552 fidl::encoding::DefaultFuchsiaResourceDialect,
553 >;
554 fn r#update_ip(&self, mut payload: &Ip) -> Self::UpdateIpResponseFut {
555 fn _decode(
556 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
557 ) -> Result<ControlUpdateIpResult, fidl::Error> {
558 let _response = fidl::client::decode_transaction_body::<
559 fidl::encoding::ResultType<Ip, UpdateError>,
560 fidl::encoding::DefaultFuchsiaResourceDialect,
561 0x75d1074407e4d1c4,
562 >(_buf?)?;
563 Ok(_response.map(|x| x))
564 }
565 self.client.send_query_and_decode::<Ip, ControlUpdateIpResult>(
566 payload,
567 0x75d1074407e4d1c4,
568 fidl::encoding::DynamicFlags::empty(),
569 _decode,
570 )
571 }
572
573 type UpdateDeviceResponseFut = fidl::client::QueryResponseFut<
574 ControlUpdateDeviceResult,
575 fidl::encoding::DefaultFuchsiaResourceDialect,
576 >;
577 fn r#update_device(&self, mut payload: &Device) -> Self::UpdateDeviceResponseFut {
578 fn _decode(
579 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
580 ) -> Result<ControlUpdateDeviceResult, fidl::Error> {
581 let _response = fidl::client::decode_transaction_body::<
582 fidl::encoding::ResultType<Device, UpdateError>,
583 fidl::encoding::DefaultFuchsiaResourceDialect,
584 0x6080a91e617e9430,
585 >(_buf?)?;
586 Ok(_response.map(|x| x))
587 }
588 self.client.send_query_and_decode::<Device, ControlUpdateDeviceResult>(
589 payload,
590 0x6080a91e617e9430,
591 fidl::encoding::DynamicFlags::empty(),
592 _decode,
593 )
594 }
595}
596
597pub struct ControlEventStream {
598 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
599}
600
601impl std::marker::Unpin for ControlEventStream {}
602
603impl futures::stream::FusedStream for ControlEventStream {
604 fn is_terminated(&self) -> bool {
605 self.event_receiver.is_terminated()
606 }
607}
608
609impl futures::Stream for ControlEventStream {
610 type Item = Result<ControlEvent, fidl::Error>;
611
612 fn poll_next(
613 mut self: std::pin::Pin<&mut Self>,
614 cx: &mut std::task::Context<'_>,
615 ) -> std::task::Poll<Option<Self::Item>> {
616 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
617 &mut self.event_receiver,
618 cx
619 )?) {
620 Some(buf) => std::task::Poll::Ready(Some(ControlEvent::decode(buf))),
621 None => std::task::Poll::Ready(None),
622 }
623 }
624}
625
626#[derive(Debug)]
627pub enum ControlEvent {}
628
629impl ControlEvent {
630 fn decode(
632 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
633 ) -> Result<ControlEvent, fidl::Error> {
634 let (bytes, _handles) = buf.split_mut();
635 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
636 debug_assert_eq!(tx_header.tx_id, 0);
637 match tx_header.ordinal {
638 _ => Err(fidl::Error::UnknownOrdinal {
639 ordinal: tx_header.ordinal,
640 protocol_name: <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
641 }),
642 }
643 }
644}
645
646pub struct ControlRequestStream {
648 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
649 is_terminated: bool,
650}
651
652impl std::marker::Unpin for ControlRequestStream {}
653
654impl futures::stream::FusedStream for ControlRequestStream {
655 fn is_terminated(&self) -> bool {
656 self.is_terminated
657 }
658}
659
660impl fidl::endpoints::RequestStream for ControlRequestStream {
661 type Protocol = ControlMarker;
662 type ControlHandle = ControlControlHandle;
663
664 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
665 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
666 }
667
668 fn control_handle(&self) -> Self::ControlHandle {
669 ControlControlHandle { inner: self.inner.clone() }
670 }
671
672 fn into_inner(
673 self,
674 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
675 {
676 (self.inner, self.is_terminated)
677 }
678
679 fn from_inner(
680 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
681 is_terminated: bool,
682 ) -> Self {
683 Self { inner, is_terminated }
684 }
685}
686
687impl futures::Stream for ControlRequestStream {
688 type Item = Result<ControlRequest, fidl::Error>;
689
690 fn poll_next(
691 mut self: std::pin::Pin<&mut Self>,
692 cx: &mut std::task::Context<'_>,
693 ) -> std::task::Poll<Option<Self::Item>> {
694 let this = &mut *self;
695 if this.inner.check_shutdown(cx) {
696 this.is_terminated = true;
697 return std::task::Poll::Ready(None);
698 }
699 if this.is_terminated {
700 panic!("polled ControlRequestStream after completion");
701 }
702 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
703 |bytes, handles| {
704 match this.inner.channel().read_etc(cx, bytes, handles) {
705 std::task::Poll::Ready(Ok(())) => {}
706 std::task::Poll::Pending => return std::task::Poll::Pending,
707 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
708 this.is_terminated = true;
709 return std::task::Poll::Ready(None);
710 }
711 std::task::Poll::Ready(Err(e)) => {
712 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
713 e.into(),
714 ))));
715 }
716 }
717
718 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
720
721 std::task::Poll::Ready(Some(match header.ordinal {
722 0x46ea2036390abecc => {
723 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
724 let mut req = fidl::new_empty!(
725 fidl_fuchsia_net_interfaces_admin::Configuration,
726 fidl::encoding::DefaultFuchsiaResourceDialect
727 );
728 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_net_interfaces_admin::Configuration>(&header, _body_bytes, handles, &mut req)?;
729 let control_handle = ControlControlHandle { inner: this.inner.clone() };
730 Ok(ControlRequest::UpdateInterfaceDefaults {
731 payload: req,
732 responder: ControlUpdateInterfaceDefaultsResponder {
733 control_handle: std::mem::ManuallyDrop::new(control_handle),
734 tx_id: header.tx_id,
735 },
736 })
737 }
738 0x4e768d74ec55450f => {
739 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
740 let mut req =
741 fidl::new_empty!(Tcp, fidl::encoding::DefaultFuchsiaResourceDialect);
742 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Tcp>(&header, _body_bytes, handles, &mut req)?;
743 let control_handle = ControlControlHandle { inner: this.inner.clone() };
744 Ok(ControlRequest::UpdateTcp {
745 payload: req,
746 responder: ControlUpdateTcpResponder {
747 control_handle: std::mem::ManuallyDrop::new(control_handle),
748 tx_id: header.tx_id,
749 },
750 })
751 }
752 0x6fb82be32e7338b4 => {
753 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
754 let mut req =
755 fidl::new_empty!(Udp, fidl::encoding::DefaultFuchsiaResourceDialect);
756 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Udp>(&header, _body_bytes, handles, &mut req)?;
757 let control_handle = ControlControlHandle { inner: this.inner.clone() };
758 Ok(ControlRequest::UpdateUdp {
759 payload: req,
760 responder: ControlUpdateUdpResponder {
761 control_handle: std::mem::ManuallyDrop::new(control_handle),
762 tx_id: header.tx_id,
763 },
764 })
765 }
766 0x42f130ff9cc3a8d5 => {
767 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
768 let mut req =
769 fidl::new_empty!(Icmp, fidl::encoding::DefaultFuchsiaResourceDialect);
770 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Icmp>(&header, _body_bytes, handles, &mut req)?;
771 let control_handle = ControlControlHandle { inner: this.inner.clone() };
772 Ok(ControlRequest::UpdateIcmp {
773 payload: req,
774 responder: ControlUpdateIcmpResponder {
775 control_handle: std::mem::ManuallyDrop::new(control_handle),
776 tx_id: header.tx_id,
777 },
778 })
779 }
780 0x75d1074407e4d1c4 => {
781 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
782 let mut req =
783 fidl::new_empty!(Ip, fidl::encoding::DefaultFuchsiaResourceDialect);
784 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Ip>(&header, _body_bytes, handles, &mut req)?;
785 let control_handle = ControlControlHandle { inner: this.inner.clone() };
786 Ok(ControlRequest::UpdateIp {
787 payload: req,
788 responder: ControlUpdateIpResponder {
789 control_handle: std::mem::ManuallyDrop::new(control_handle),
790 tx_id: header.tx_id,
791 },
792 })
793 }
794 0x6080a91e617e9430 => {
795 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
796 let mut req =
797 fidl::new_empty!(Device, fidl::encoding::DefaultFuchsiaResourceDialect);
798 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<Device>(&header, _body_bytes, handles, &mut req)?;
799 let control_handle = ControlControlHandle { inner: this.inner.clone() };
800 Ok(ControlRequest::UpdateDevice {
801 payload: req,
802 responder: ControlUpdateDeviceResponder {
803 control_handle: std::mem::ManuallyDrop::new(control_handle),
804 tx_id: header.tx_id,
805 },
806 })
807 }
808 _ => Err(fidl::Error::UnknownOrdinal {
809 ordinal: header.ordinal,
810 protocol_name:
811 <ControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
812 }),
813 }))
814 },
815 )
816 }
817}
818
819#[derive(Debug)]
821pub enum ControlRequest {
822 UpdateInterfaceDefaults {
839 payload: fidl_fuchsia_net_interfaces_admin::Configuration,
840 responder: ControlUpdateInterfaceDefaultsResponder,
841 },
842 UpdateTcp { payload: Tcp, responder: ControlUpdateTcpResponder },
853 UpdateUdp { payload: Udp, responder: ControlUpdateUdpResponder },
864 UpdateIcmp { payload: Icmp, responder: ControlUpdateIcmpResponder },
875 UpdateIp { payload: Ip, responder: ControlUpdateIpResponder },
886 UpdateDevice { payload: Device, responder: ControlUpdateDeviceResponder },
898}
899
900impl ControlRequest {
901 #[allow(irrefutable_let_patterns)]
902 pub fn into_update_interface_defaults(
903 self,
904 ) -> Option<(
905 fidl_fuchsia_net_interfaces_admin::Configuration,
906 ControlUpdateInterfaceDefaultsResponder,
907 )> {
908 if let ControlRequest::UpdateInterfaceDefaults { payload, responder } = self {
909 Some((payload, responder))
910 } else {
911 None
912 }
913 }
914
915 #[allow(irrefutable_let_patterns)]
916 pub fn into_update_tcp(self) -> Option<(Tcp, ControlUpdateTcpResponder)> {
917 if let ControlRequest::UpdateTcp { payload, responder } = self {
918 Some((payload, responder))
919 } else {
920 None
921 }
922 }
923
924 #[allow(irrefutable_let_patterns)]
925 pub fn into_update_udp(self) -> Option<(Udp, ControlUpdateUdpResponder)> {
926 if let ControlRequest::UpdateUdp { payload, responder } = self {
927 Some((payload, responder))
928 } else {
929 None
930 }
931 }
932
933 #[allow(irrefutable_let_patterns)]
934 pub fn into_update_icmp(self) -> Option<(Icmp, ControlUpdateIcmpResponder)> {
935 if let ControlRequest::UpdateIcmp { payload, responder } = self {
936 Some((payload, responder))
937 } else {
938 None
939 }
940 }
941
942 #[allow(irrefutable_let_patterns)]
943 pub fn into_update_ip(self) -> Option<(Ip, ControlUpdateIpResponder)> {
944 if let ControlRequest::UpdateIp { payload, responder } = self {
945 Some((payload, responder))
946 } else {
947 None
948 }
949 }
950
951 #[allow(irrefutable_let_patterns)]
952 pub fn into_update_device(self) -> Option<(Device, ControlUpdateDeviceResponder)> {
953 if let ControlRequest::UpdateDevice { payload, responder } = self {
954 Some((payload, responder))
955 } else {
956 None
957 }
958 }
959
960 pub fn method_name(&self) -> &'static str {
962 match *self {
963 ControlRequest::UpdateInterfaceDefaults { .. } => "update_interface_defaults",
964 ControlRequest::UpdateTcp { .. } => "update_tcp",
965 ControlRequest::UpdateUdp { .. } => "update_udp",
966 ControlRequest::UpdateIcmp { .. } => "update_icmp",
967 ControlRequest::UpdateIp { .. } => "update_ip",
968 ControlRequest::UpdateDevice { .. } => "update_device",
969 }
970 }
971}
972
973#[derive(Debug, Clone)]
974pub struct ControlControlHandle {
975 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
976}
977
978impl fidl::endpoints::ControlHandle for ControlControlHandle {
979 fn shutdown(&self) {
980 self.inner.shutdown()
981 }
982 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
983 self.inner.shutdown_with_epitaph(status)
984 }
985
986 fn is_closed(&self) -> bool {
987 self.inner.channel().is_closed()
988 }
989 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
990 self.inner.channel().on_closed()
991 }
992
993 #[cfg(target_os = "fuchsia")]
994 fn signal_peer(
995 &self,
996 clear_mask: zx::Signals,
997 set_mask: zx::Signals,
998 ) -> Result<(), zx_status::Status> {
999 use fidl::Peered;
1000 self.inner.channel().signal_peer(clear_mask, set_mask)
1001 }
1002}
1003
1004impl ControlControlHandle {}
1005
1006#[must_use = "FIDL methods require a response to be sent"]
1007#[derive(Debug)]
1008pub struct ControlUpdateInterfaceDefaultsResponder {
1009 control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
1010 tx_id: u32,
1011}
1012
1013impl std::ops::Drop for ControlUpdateInterfaceDefaultsResponder {
1017 fn drop(&mut self) {
1018 self.control_handle.shutdown();
1019 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1021 }
1022}
1023
1024impl fidl::endpoints::Responder for ControlUpdateInterfaceDefaultsResponder {
1025 type ControlHandle = ControlControlHandle;
1026
1027 fn control_handle(&self) -> &ControlControlHandle {
1028 &self.control_handle
1029 }
1030
1031 fn drop_without_shutdown(mut self) {
1032 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1034 std::mem::forget(self);
1036 }
1037}
1038
1039impl ControlUpdateInterfaceDefaultsResponder {
1040 pub fn send(
1044 self,
1045 mut result: Result<&fidl_fuchsia_net_interfaces_admin::Configuration, UpdateError>,
1046 ) -> Result<(), fidl::Error> {
1047 let _result = self.send_raw(result);
1048 if _result.is_err() {
1049 self.control_handle.shutdown();
1050 }
1051 self.drop_without_shutdown();
1052 _result
1053 }
1054
1055 pub fn send_no_shutdown_on_err(
1057 self,
1058 mut result: Result<&fidl_fuchsia_net_interfaces_admin::Configuration, UpdateError>,
1059 ) -> Result<(), fidl::Error> {
1060 let _result = self.send_raw(result);
1061 self.drop_without_shutdown();
1062 _result
1063 }
1064
1065 fn send_raw(
1066 &self,
1067 mut result: Result<&fidl_fuchsia_net_interfaces_admin::Configuration, UpdateError>,
1068 ) -> Result<(), fidl::Error> {
1069 self.control_handle.inner.send::<fidl::encoding::ResultType<
1070 fidl_fuchsia_net_interfaces_admin::Configuration,
1071 UpdateError,
1072 >>(
1073 result,
1074 self.tx_id,
1075 0x46ea2036390abecc,
1076 fidl::encoding::DynamicFlags::empty(),
1077 )
1078 }
1079}
1080
1081#[must_use = "FIDL methods require a response to be sent"]
1082#[derive(Debug)]
1083pub struct ControlUpdateTcpResponder {
1084 control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
1085 tx_id: u32,
1086}
1087
1088impl std::ops::Drop for ControlUpdateTcpResponder {
1092 fn drop(&mut self) {
1093 self.control_handle.shutdown();
1094 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1096 }
1097}
1098
1099impl fidl::endpoints::Responder for ControlUpdateTcpResponder {
1100 type ControlHandle = ControlControlHandle;
1101
1102 fn control_handle(&self) -> &ControlControlHandle {
1103 &self.control_handle
1104 }
1105
1106 fn drop_without_shutdown(mut self) {
1107 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1109 std::mem::forget(self);
1111 }
1112}
1113
1114impl ControlUpdateTcpResponder {
1115 pub fn send(self, mut result: Result<&Tcp, UpdateError>) -> Result<(), fidl::Error> {
1119 let _result = self.send_raw(result);
1120 if _result.is_err() {
1121 self.control_handle.shutdown();
1122 }
1123 self.drop_without_shutdown();
1124 _result
1125 }
1126
1127 pub fn send_no_shutdown_on_err(
1129 self,
1130 mut result: Result<&Tcp, UpdateError>,
1131 ) -> Result<(), fidl::Error> {
1132 let _result = self.send_raw(result);
1133 self.drop_without_shutdown();
1134 _result
1135 }
1136
1137 fn send_raw(&self, mut result: Result<&Tcp, UpdateError>) -> Result<(), fidl::Error> {
1138 self.control_handle.inner.send::<fidl::encoding::ResultType<Tcp, UpdateError>>(
1139 result,
1140 self.tx_id,
1141 0x4e768d74ec55450f,
1142 fidl::encoding::DynamicFlags::empty(),
1143 )
1144 }
1145}
1146
1147#[must_use = "FIDL methods require a response to be sent"]
1148#[derive(Debug)]
1149pub struct ControlUpdateUdpResponder {
1150 control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
1151 tx_id: u32,
1152}
1153
1154impl std::ops::Drop for ControlUpdateUdpResponder {
1158 fn drop(&mut self) {
1159 self.control_handle.shutdown();
1160 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1162 }
1163}
1164
1165impl fidl::endpoints::Responder for ControlUpdateUdpResponder {
1166 type ControlHandle = ControlControlHandle;
1167
1168 fn control_handle(&self) -> &ControlControlHandle {
1169 &self.control_handle
1170 }
1171
1172 fn drop_without_shutdown(mut self) {
1173 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1175 std::mem::forget(self);
1177 }
1178}
1179
1180impl ControlUpdateUdpResponder {
1181 pub fn send(self, mut result: Result<&Udp, UpdateError>) -> Result<(), fidl::Error> {
1185 let _result = self.send_raw(result);
1186 if _result.is_err() {
1187 self.control_handle.shutdown();
1188 }
1189 self.drop_without_shutdown();
1190 _result
1191 }
1192
1193 pub fn send_no_shutdown_on_err(
1195 self,
1196 mut result: Result<&Udp, UpdateError>,
1197 ) -> Result<(), fidl::Error> {
1198 let _result = self.send_raw(result);
1199 self.drop_without_shutdown();
1200 _result
1201 }
1202
1203 fn send_raw(&self, mut result: Result<&Udp, UpdateError>) -> Result<(), fidl::Error> {
1204 self.control_handle.inner.send::<fidl::encoding::ResultType<Udp, UpdateError>>(
1205 result,
1206 self.tx_id,
1207 0x6fb82be32e7338b4,
1208 fidl::encoding::DynamicFlags::empty(),
1209 )
1210 }
1211}
1212
1213#[must_use = "FIDL methods require a response to be sent"]
1214#[derive(Debug)]
1215pub struct ControlUpdateIcmpResponder {
1216 control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
1217 tx_id: u32,
1218}
1219
1220impl std::ops::Drop for ControlUpdateIcmpResponder {
1224 fn drop(&mut self) {
1225 self.control_handle.shutdown();
1226 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1228 }
1229}
1230
1231impl fidl::endpoints::Responder for ControlUpdateIcmpResponder {
1232 type ControlHandle = ControlControlHandle;
1233
1234 fn control_handle(&self) -> &ControlControlHandle {
1235 &self.control_handle
1236 }
1237
1238 fn drop_without_shutdown(mut self) {
1239 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1241 std::mem::forget(self);
1243 }
1244}
1245
1246impl ControlUpdateIcmpResponder {
1247 pub fn send(self, mut result: Result<&Icmp, UpdateError>) -> Result<(), fidl::Error> {
1251 let _result = self.send_raw(result);
1252 if _result.is_err() {
1253 self.control_handle.shutdown();
1254 }
1255 self.drop_without_shutdown();
1256 _result
1257 }
1258
1259 pub fn send_no_shutdown_on_err(
1261 self,
1262 mut result: Result<&Icmp, UpdateError>,
1263 ) -> Result<(), fidl::Error> {
1264 let _result = self.send_raw(result);
1265 self.drop_without_shutdown();
1266 _result
1267 }
1268
1269 fn send_raw(&self, mut result: Result<&Icmp, UpdateError>) -> Result<(), fidl::Error> {
1270 self.control_handle.inner.send::<fidl::encoding::ResultType<Icmp, UpdateError>>(
1271 result,
1272 self.tx_id,
1273 0x42f130ff9cc3a8d5,
1274 fidl::encoding::DynamicFlags::empty(),
1275 )
1276 }
1277}
1278
1279#[must_use = "FIDL methods require a response to be sent"]
1280#[derive(Debug)]
1281pub struct ControlUpdateIpResponder {
1282 control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
1283 tx_id: u32,
1284}
1285
1286impl std::ops::Drop for ControlUpdateIpResponder {
1290 fn drop(&mut self) {
1291 self.control_handle.shutdown();
1292 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1294 }
1295}
1296
1297impl fidl::endpoints::Responder for ControlUpdateIpResponder {
1298 type ControlHandle = ControlControlHandle;
1299
1300 fn control_handle(&self) -> &ControlControlHandle {
1301 &self.control_handle
1302 }
1303
1304 fn drop_without_shutdown(mut self) {
1305 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1307 std::mem::forget(self);
1309 }
1310}
1311
1312impl ControlUpdateIpResponder {
1313 pub fn send(self, mut result: Result<&Ip, UpdateError>) -> Result<(), fidl::Error> {
1317 let _result = self.send_raw(result);
1318 if _result.is_err() {
1319 self.control_handle.shutdown();
1320 }
1321 self.drop_without_shutdown();
1322 _result
1323 }
1324
1325 pub fn send_no_shutdown_on_err(
1327 self,
1328 mut result: Result<&Ip, UpdateError>,
1329 ) -> Result<(), fidl::Error> {
1330 let _result = self.send_raw(result);
1331 self.drop_without_shutdown();
1332 _result
1333 }
1334
1335 fn send_raw(&self, mut result: Result<&Ip, UpdateError>) -> Result<(), fidl::Error> {
1336 self.control_handle.inner.send::<fidl::encoding::ResultType<Ip, UpdateError>>(
1337 result,
1338 self.tx_id,
1339 0x75d1074407e4d1c4,
1340 fidl::encoding::DynamicFlags::empty(),
1341 )
1342 }
1343}
1344
1345#[must_use = "FIDL methods require a response to be sent"]
1346#[derive(Debug)]
1347pub struct ControlUpdateDeviceResponder {
1348 control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
1349 tx_id: u32,
1350}
1351
1352impl std::ops::Drop for ControlUpdateDeviceResponder {
1356 fn drop(&mut self) {
1357 self.control_handle.shutdown();
1358 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1360 }
1361}
1362
1363impl fidl::endpoints::Responder for ControlUpdateDeviceResponder {
1364 type ControlHandle = ControlControlHandle;
1365
1366 fn control_handle(&self) -> &ControlControlHandle {
1367 &self.control_handle
1368 }
1369
1370 fn drop_without_shutdown(mut self) {
1371 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1373 std::mem::forget(self);
1375 }
1376}
1377
1378impl ControlUpdateDeviceResponder {
1379 pub fn send(self, mut result: Result<&Device, UpdateError>) -> Result<(), fidl::Error> {
1383 let _result = self.send_raw(result);
1384 if _result.is_err() {
1385 self.control_handle.shutdown();
1386 }
1387 self.drop_without_shutdown();
1388 _result
1389 }
1390
1391 pub fn send_no_shutdown_on_err(
1393 self,
1394 mut result: Result<&Device, UpdateError>,
1395 ) -> Result<(), fidl::Error> {
1396 let _result = self.send_raw(result);
1397 self.drop_without_shutdown();
1398 _result
1399 }
1400
1401 fn send_raw(&self, mut result: Result<&Device, UpdateError>) -> Result<(), fidl::Error> {
1402 self.control_handle.inner.send::<fidl::encoding::ResultType<Device, UpdateError>>(
1403 result,
1404 self.tx_id,
1405 0x6080a91e617e9430,
1406 fidl::encoding::DynamicFlags::empty(),
1407 )
1408 }
1409}
1410
1411#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1412pub struct StateMarker;
1413
1414impl fidl::endpoints::ProtocolMarker for StateMarker {
1415 type Proxy = StateProxy;
1416 type RequestStream = StateRequestStream;
1417 #[cfg(target_os = "fuchsia")]
1418 type SynchronousProxy = StateSynchronousProxy;
1419
1420 const DEBUG_NAME: &'static str = "fuchsia.net.settings.State";
1421}
1422impl fidl::endpoints::DiscoverableProtocolMarker for StateMarker {}
1423
1424pub trait StateProxyInterface: Send + Sync {
1425 type GetInterfaceDefaultsResponseFut: std::future::Future<
1426 Output = Result<fidl_fuchsia_net_interfaces_admin::Configuration, fidl::Error>,
1427 > + Send;
1428 fn r#get_interface_defaults(&self) -> Self::GetInterfaceDefaultsResponseFut;
1429 type GetTcpResponseFut: std::future::Future<Output = Result<Tcp, fidl::Error>> + Send;
1430 fn r#get_tcp(&self) -> Self::GetTcpResponseFut;
1431 type GetUdpResponseFut: std::future::Future<Output = Result<Udp, fidl::Error>> + Send;
1432 fn r#get_udp(&self) -> Self::GetUdpResponseFut;
1433 type GetIcmpResponseFut: std::future::Future<Output = Result<Icmp, fidl::Error>> + Send;
1434 fn r#get_icmp(&self) -> Self::GetIcmpResponseFut;
1435 type GetIpResponseFut: std::future::Future<Output = Result<Ip, fidl::Error>> + Send;
1436 fn r#get_ip(&self) -> Self::GetIpResponseFut;
1437 type GetDeviceResponseFut: std::future::Future<Output = Result<Device, fidl::Error>> + Send;
1438 fn r#get_device(&self) -> Self::GetDeviceResponseFut;
1439}
1440#[derive(Debug)]
1441#[cfg(target_os = "fuchsia")]
1442pub struct StateSynchronousProxy {
1443 client: fidl::client::sync::Client,
1444}
1445
1446#[cfg(target_os = "fuchsia")]
1447impl fidl::endpoints::SynchronousProxy for StateSynchronousProxy {
1448 type Proxy = StateProxy;
1449 type Protocol = StateMarker;
1450
1451 fn from_channel(inner: fidl::Channel) -> Self {
1452 Self::new(inner)
1453 }
1454
1455 fn into_channel(self) -> fidl::Channel {
1456 self.client.into_channel()
1457 }
1458
1459 fn as_channel(&self) -> &fidl::Channel {
1460 self.client.as_channel()
1461 }
1462}
1463
1464#[cfg(target_os = "fuchsia")]
1465impl StateSynchronousProxy {
1466 pub fn new(channel: fidl::Channel) -> Self {
1467 let protocol_name = <StateMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1468 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1469 }
1470
1471 pub fn into_channel(self) -> fidl::Channel {
1472 self.client.into_channel()
1473 }
1474
1475 pub fn wait_for_event(
1478 &self,
1479 deadline: zx::MonotonicInstant,
1480 ) -> Result<StateEvent, fidl::Error> {
1481 StateEvent::decode(self.client.wait_for_event(deadline)?)
1482 }
1483
1484 pub fn r#get_interface_defaults(
1486 &self,
1487 ___deadline: zx::MonotonicInstant,
1488 ) -> Result<fidl_fuchsia_net_interfaces_admin::Configuration, fidl::Error> {
1489 let _response = self.client.send_query::<
1490 fidl::encoding::EmptyPayload,
1491 fidl_fuchsia_net_interfaces_admin::Configuration,
1492 >(
1493 (),
1494 0x4c4824a322a705e3,
1495 fidl::encoding::DynamicFlags::empty(),
1496 ___deadline,
1497 )?;
1498 Ok(_response)
1499 }
1500
1501 pub fn r#get_tcp(&self, ___deadline: zx::MonotonicInstant) -> Result<Tcp, fidl::Error> {
1503 let _response = self.client.send_query::<fidl::encoding::EmptyPayload, Tcp>(
1504 (),
1505 0x4e818d8a89985b70,
1506 fidl::encoding::DynamicFlags::empty(),
1507 ___deadline,
1508 )?;
1509 Ok(_response)
1510 }
1511
1512 pub fn r#get_udp(&self, ___deadline: zx::MonotonicInstant) -> Result<Udp, fidl::Error> {
1514 let _response = self.client.send_query::<fidl::encoding::EmptyPayload, Udp>(
1515 (),
1516 0x1af3bc1507b7a196,
1517 fidl::encoding::DynamicFlags::empty(),
1518 ___deadline,
1519 )?;
1520 Ok(_response)
1521 }
1522
1523 pub fn r#get_icmp(&self, ___deadline: zx::MonotonicInstant) -> Result<Icmp, fidl::Error> {
1525 let _response = self.client.send_query::<fidl::encoding::EmptyPayload, Icmp>(
1526 (),
1527 0x4079fd71ca65e33f,
1528 fidl::encoding::DynamicFlags::empty(),
1529 ___deadline,
1530 )?;
1531 Ok(_response)
1532 }
1533
1534 pub fn r#get_ip(&self, ___deadline: zx::MonotonicInstant) -> Result<Ip, fidl::Error> {
1536 let _response = self.client.send_query::<fidl::encoding::EmptyPayload, Ip>(
1537 (),
1538 0x2c1cc13f4874956,
1539 fidl::encoding::DynamicFlags::empty(),
1540 ___deadline,
1541 )?;
1542 Ok(_response)
1543 }
1544
1545 pub fn r#get_device(&self, ___deadline: zx::MonotonicInstant) -> Result<Device, fidl::Error> {
1547 let _response = self.client.send_query::<fidl::encoding::EmptyPayload, Device>(
1548 (),
1549 0x5713a85352e43887,
1550 fidl::encoding::DynamicFlags::empty(),
1551 ___deadline,
1552 )?;
1553 Ok(_response)
1554 }
1555}
1556
1557#[cfg(target_os = "fuchsia")]
1558impl From<StateSynchronousProxy> for zx::Handle {
1559 fn from(value: StateSynchronousProxy) -> Self {
1560 value.into_channel().into()
1561 }
1562}
1563
1564#[cfg(target_os = "fuchsia")]
1565impl From<fidl::Channel> for StateSynchronousProxy {
1566 fn from(value: fidl::Channel) -> Self {
1567 Self::new(value)
1568 }
1569}
1570
1571#[cfg(target_os = "fuchsia")]
1572impl fidl::endpoints::FromClient for StateSynchronousProxy {
1573 type Protocol = StateMarker;
1574
1575 fn from_client(value: fidl::endpoints::ClientEnd<StateMarker>) -> Self {
1576 Self::new(value.into_channel())
1577 }
1578}
1579
1580#[derive(Debug, Clone)]
1581pub struct StateProxy {
1582 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1583}
1584
1585impl fidl::endpoints::Proxy for StateProxy {
1586 type Protocol = StateMarker;
1587
1588 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1589 Self::new(inner)
1590 }
1591
1592 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1593 self.client.into_channel().map_err(|client| Self { client })
1594 }
1595
1596 fn as_channel(&self) -> &::fidl::AsyncChannel {
1597 self.client.as_channel()
1598 }
1599}
1600
1601impl StateProxy {
1602 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1604 let protocol_name = <StateMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1605 Self { client: fidl::client::Client::new(channel, protocol_name) }
1606 }
1607
1608 pub fn take_event_stream(&self) -> StateEventStream {
1614 StateEventStream { event_receiver: self.client.take_event_receiver() }
1615 }
1616
1617 pub fn r#get_interface_defaults(
1619 &self,
1620 ) -> fidl::client::QueryResponseFut<
1621 fidl_fuchsia_net_interfaces_admin::Configuration,
1622 fidl::encoding::DefaultFuchsiaResourceDialect,
1623 > {
1624 StateProxyInterface::r#get_interface_defaults(self)
1625 }
1626
1627 pub fn r#get_tcp(
1629 &self,
1630 ) -> fidl::client::QueryResponseFut<Tcp, fidl::encoding::DefaultFuchsiaResourceDialect> {
1631 StateProxyInterface::r#get_tcp(self)
1632 }
1633
1634 pub fn r#get_udp(
1636 &self,
1637 ) -> fidl::client::QueryResponseFut<Udp, fidl::encoding::DefaultFuchsiaResourceDialect> {
1638 StateProxyInterface::r#get_udp(self)
1639 }
1640
1641 pub fn r#get_icmp(
1643 &self,
1644 ) -> fidl::client::QueryResponseFut<Icmp, fidl::encoding::DefaultFuchsiaResourceDialect> {
1645 StateProxyInterface::r#get_icmp(self)
1646 }
1647
1648 pub fn r#get_ip(
1650 &self,
1651 ) -> fidl::client::QueryResponseFut<Ip, fidl::encoding::DefaultFuchsiaResourceDialect> {
1652 StateProxyInterface::r#get_ip(self)
1653 }
1654
1655 pub fn r#get_device(
1657 &self,
1658 ) -> fidl::client::QueryResponseFut<Device, fidl::encoding::DefaultFuchsiaResourceDialect> {
1659 StateProxyInterface::r#get_device(self)
1660 }
1661}
1662
1663impl StateProxyInterface for StateProxy {
1664 type GetInterfaceDefaultsResponseFut = fidl::client::QueryResponseFut<
1665 fidl_fuchsia_net_interfaces_admin::Configuration,
1666 fidl::encoding::DefaultFuchsiaResourceDialect,
1667 >;
1668 fn r#get_interface_defaults(&self) -> Self::GetInterfaceDefaultsResponseFut {
1669 fn _decode(
1670 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1671 ) -> Result<fidl_fuchsia_net_interfaces_admin::Configuration, fidl::Error> {
1672 let _response = fidl::client::decode_transaction_body::<
1673 fidl_fuchsia_net_interfaces_admin::Configuration,
1674 fidl::encoding::DefaultFuchsiaResourceDialect,
1675 0x4c4824a322a705e3,
1676 >(_buf?)?;
1677 Ok(_response)
1678 }
1679 self.client.send_query_and_decode::<
1680 fidl::encoding::EmptyPayload,
1681 fidl_fuchsia_net_interfaces_admin::Configuration,
1682 >(
1683 (),
1684 0x4c4824a322a705e3,
1685 fidl::encoding::DynamicFlags::empty(),
1686 _decode,
1687 )
1688 }
1689
1690 type GetTcpResponseFut =
1691 fidl::client::QueryResponseFut<Tcp, fidl::encoding::DefaultFuchsiaResourceDialect>;
1692 fn r#get_tcp(&self) -> Self::GetTcpResponseFut {
1693 fn _decode(
1694 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1695 ) -> Result<Tcp, fidl::Error> {
1696 let _response = fidl::client::decode_transaction_body::<
1697 Tcp,
1698 fidl::encoding::DefaultFuchsiaResourceDialect,
1699 0x4e818d8a89985b70,
1700 >(_buf?)?;
1701 Ok(_response)
1702 }
1703 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Tcp>(
1704 (),
1705 0x4e818d8a89985b70,
1706 fidl::encoding::DynamicFlags::empty(),
1707 _decode,
1708 )
1709 }
1710
1711 type GetUdpResponseFut =
1712 fidl::client::QueryResponseFut<Udp, fidl::encoding::DefaultFuchsiaResourceDialect>;
1713 fn r#get_udp(&self) -> Self::GetUdpResponseFut {
1714 fn _decode(
1715 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1716 ) -> Result<Udp, fidl::Error> {
1717 let _response = fidl::client::decode_transaction_body::<
1718 Udp,
1719 fidl::encoding::DefaultFuchsiaResourceDialect,
1720 0x1af3bc1507b7a196,
1721 >(_buf?)?;
1722 Ok(_response)
1723 }
1724 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Udp>(
1725 (),
1726 0x1af3bc1507b7a196,
1727 fidl::encoding::DynamicFlags::empty(),
1728 _decode,
1729 )
1730 }
1731
1732 type GetIcmpResponseFut =
1733 fidl::client::QueryResponseFut<Icmp, fidl::encoding::DefaultFuchsiaResourceDialect>;
1734 fn r#get_icmp(&self) -> Self::GetIcmpResponseFut {
1735 fn _decode(
1736 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1737 ) -> Result<Icmp, fidl::Error> {
1738 let _response = fidl::client::decode_transaction_body::<
1739 Icmp,
1740 fidl::encoding::DefaultFuchsiaResourceDialect,
1741 0x4079fd71ca65e33f,
1742 >(_buf?)?;
1743 Ok(_response)
1744 }
1745 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Icmp>(
1746 (),
1747 0x4079fd71ca65e33f,
1748 fidl::encoding::DynamicFlags::empty(),
1749 _decode,
1750 )
1751 }
1752
1753 type GetIpResponseFut =
1754 fidl::client::QueryResponseFut<Ip, fidl::encoding::DefaultFuchsiaResourceDialect>;
1755 fn r#get_ip(&self) -> Self::GetIpResponseFut {
1756 fn _decode(
1757 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1758 ) -> Result<Ip, fidl::Error> {
1759 let _response = fidl::client::decode_transaction_body::<
1760 Ip,
1761 fidl::encoding::DefaultFuchsiaResourceDialect,
1762 0x2c1cc13f4874956,
1763 >(_buf?)?;
1764 Ok(_response)
1765 }
1766 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Ip>(
1767 (),
1768 0x2c1cc13f4874956,
1769 fidl::encoding::DynamicFlags::empty(),
1770 _decode,
1771 )
1772 }
1773
1774 type GetDeviceResponseFut =
1775 fidl::client::QueryResponseFut<Device, fidl::encoding::DefaultFuchsiaResourceDialect>;
1776 fn r#get_device(&self) -> Self::GetDeviceResponseFut {
1777 fn _decode(
1778 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1779 ) -> Result<Device, fidl::Error> {
1780 let _response = fidl::client::decode_transaction_body::<
1781 Device,
1782 fidl::encoding::DefaultFuchsiaResourceDialect,
1783 0x5713a85352e43887,
1784 >(_buf?)?;
1785 Ok(_response)
1786 }
1787 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Device>(
1788 (),
1789 0x5713a85352e43887,
1790 fidl::encoding::DynamicFlags::empty(),
1791 _decode,
1792 )
1793 }
1794}
1795
1796pub struct StateEventStream {
1797 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1798}
1799
1800impl std::marker::Unpin for StateEventStream {}
1801
1802impl futures::stream::FusedStream for StateEventStream {
1803 fn is_terminated(&self) -> bool {
1804 self.event_receiver.is_terminated()
1805 }
1806}
1807
1808impl futures::Stream for StateEventStream {
1809 type Item = Result<StateEvent, fidl::Error>;
1810
1811 fn poll_next(
1812 mut self: std::pin::Pin<&mut Self>,
1813 cx: &mut std::task::Context<'_>,
1814 ) -> std::task::Poll<Option<Self::Item>> {
1815 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1816 &mut self.event_receiver,
1817 cx
1818 )?) {
1819 Some(buf) => std::task::Poll::Ready(Some(StateEvent::decode(buf))),
1820 None => std::task::Poll::Ready(None),
1821 }
1822 }
1823}
1824
1825#[derive(Debug)]
1826pub enum StateEvent {}
1827
1828impl StateEvent {
1829 fn decode(
1831 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1832 ) -> Result<StateEvent, fidl::Error> {
1833 let (bytes, _handles) = buf.split_mut();
1834 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1835 debug_assert_eq!(tx_header.tx_id, 0);
1836 match tx_header.ordinal {
1837 _ => Err(fidl::Error::UnknownOrdinal {
1838 ordinal: tx_header.ordinal,
1839 protocol_name: <StateMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1840 }),
1841 }
1842 }
1843}
1844
1845pub struct StateRequestStream {
1847 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1848 is_terminated: bool,
1849}
1850
1851impl std::marker::Unpin for StateRequestStream {}
1852
1853impl futures::stream::FusedStream for StateRequestStream {
1854 fn is_terminated(&self) -> bool {
1855 self.is_terminated
1856 }
1857}
1858
1859impl fidl::endpoints::RequestStream for StateRequestStream {
1860 type Protocol = StateMarker;
1861 type ControlHandle = StateControlHandle;
1862
1863 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1864 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1865 }
1866
1867 fn control_handle(&self) -> Self::ControlHandle {
1868 StateControlHandle { inner: self.inner.clone() }
1869 }
1870
1871 fn into_inner(
1872 self,
1873 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1874 {
1875 (self.inner, self.is_terminated)
1876 }
1877
1878 fn from_inner(
1879 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1880 is_terminated: bool,
1881 ) -> Self {
1882 Self { inner, is_terminated }
1883 }
1884}
1885
1886impl futures::Stream for StateRequestStream {
1887 type Item = Result<StateRequest, fidl::Error>;
1888
1889 fn poll_next(
1890 mut self: std::pin::Pin<&mut Self>,
1891 cx: &mut std::task::Context<'_>,
1892 ) -> std::task::Poll<Option<Self::Item>> {
1893 let this = &mut *self;
1894 if this.inner.check_shutdown(cx) {
1895 this.is_terminated = true;
1896 return std::task::Poll::Ready(None);
1897 }
1898 if this.is_terminated {
1899 panic!("polled StateRequestStream after completion");
1900 }
1901 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1902 |bytes, handles| {
1903 match this.inner.channel().read_etc(cx, bytes, handles) {
1904 std::task::Poll::Ready(Ok(())) => {}
1905 std::task::Poll::Pending => return std::task::Poll::Pending,
1906 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1907 this.is_terminated = true;
1908 return std::task::Poll::Ready(None);
1909 }
1910 std::task::Poll::Ready(Err(e)) => {
1911 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1912 e.into(),
1913 ))));
1914 }
1915 }
1916
1917 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1919
1920 std::task::Poll::Ready(Some(match header.ordinal {
1921 0x4c4824a322a705e3 => {
1922 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1923 let mut req = fidl::new_empty!(
1924 fidl::encoding::EmptyPayload,
1925 fidl::encoding::DefaultFuchsiaResourceDialect
1926 );
1927 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1928 let control_handle = StateControlHandle { inner: this.inner.clone() };
1929 Ok(StateRequest::GetInterfaceDefaults {
1930 responder: StateGetInterfaceDefaultsResponder {
1931 control_handle: std::mem::ManuallyDrop::new(control_handle),
1932 tx_id: header.tx_id,
1933 },
1934 })
1935 }
1936 0x4e818d8a89985b70 => {
1937 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1938 let mut req = fidl::new_empty!(
1939 fidl::encoding::EmptyPayload,
1940 fidl::encoding::DefaultFuchsiaResourceDialect
1941 );
1942 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1943 let control_handle = StateControlHandle { inner: this.inner.clone() };
1944 Ok(StateRequest::GetTcp {
1945 responder: StateGetTcpResponder {
1946 control_handle: std::mem::ManuallyDrop::new(control_handle),
1947 tx_id: header.tx_id,
1948 },
1949 })
1950 }
1951 0x1af3bc1507b7a196 => {
1952 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1953 let mut req = fidl::new_empty!(
1954 fidl::encoding::EmptyPayload,
1955 fidl::encoding::DefaultFuchsiaResourceDialect
1956 );
1957 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1958 let control_handle = StateControlHandle { inner: this.inner.clone() };
1959 Ok(StateRequest::GetUdp {
1960 responder: StateGetUdpResponder {
1961 control_handle: std::mem::ManuallyDrop::new(control_handle),
1962 tx_id: header.tx_id,
1963 },
1964 })
1965 }
1966 0x4079fd71ca65e33f => {
1967 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1968 let mut req = fidl::new_empty!(
1969 fidl::encoding::EmptyPayload,
1970 fidl::encoding::DefaultFuchsiaResourceDialect
1971 );
1972 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1973 let control_handle = StateControlHandle { inner: this.inner.clone() };
1974 Ok(StateRequest::GetIcmp {
1975 responder: StateGetIcmpResponder {
1976 control_handle: std::mem::ManuallyDrop::new(control_handle),
1977 tx_id: header.tx_id,
1978 },
1979 })
1980 }
1981 0x2c1cc13f4874956 => {
1982 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1983 let mut req = fidl::new_empty!(
1984 fidl::encoding::EmptyPayload,
1985 fidl::encoding::DefaultFuchsiaResourceDialect
1986 );
1987 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1988 let control_handle = StateControlHandle { inner: this.inner.clone() };
1989 Ok(StateRequest::GetIp {
1990 responder: StateGetIpResponder {
1991 control_handle: std::mem::ManuallyDrop::new(control_handle),
1992 tx_id: header.tx_id,
1993 },
1994 })
1995 }
1996 0x5713a85352e43887 => {
1997 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1998 let mut req = fidl::new_empty!(
1999 fidl::encoding::EmptyPayload,
2000 fidl::encoding::DefaultFuchsiaResourceDialect
2001 );
2002 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2003 let control_handle = StateControlHandle { inner: this.inner.clone() };
2004 Ok(StateRequest::GetDevice {
2005 responder: StateGetDeviceResponder {
2006 control_handle: std::mem::ManuallyDrop::new(control_handle),
2007 tx_id: header.tx_id,
2008 },
2009 })
2010 }
2011 _ => Err(fidl::Error::UnknownOrdinal {
2012 ordinal: header.ordinal,
2013 protocol_name: <StateMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2014 }),
2015 }))
2016 },
2017 )
2018 }
2019}
2020
2021#[derive(Debug)]
2023pub enum StateRequest {
2024 GetInterfaceDefaults { responder: StateGetInterfaceDefaultsResponder },
2026 GetTcp { responder: StateGetTcpResponder },
2028 GetUdp { responder: StateGetUdpResponder },
2030 GetIcmp { responder: StateGetIcmpResponder },
2032 GetIp { responder: StateGetIpResponder },
2034 GetDevice { responder: StateGetDeviceResponder },
2036}
2037
2038impl StateRequest {
2039 #[allow(irrefutable_let_patterns)]
2040 pub fn into_get_interface_defaults(self) -> Option<(StateGetInterfaceDefaultsResponder)> {
2041 if let StateRequest::GetInterfaceDefaults { responder } = self {
2042 Some((responder))
2043 } else {
2044 None
2045 }
2046 }
2047
2048 #[allow(irrefutable_let_patterns)]
2049 pub fn into_get_tcp(self) -> Option<(StateGetTcpResponder)> {
2050 if let StateRequest::GetTcp { responder } = self { Some((responder)) } else { None }
2051 }
2052
2053 #[allow(irrefutable_let_patterns)]
2054 pub fn into_get_udp(self) -> Option<(StateGetUdpResponder)> {
2055 if let StateRequest::GetUdp { responder } = self { Some((responder)) } else { None }
2056 }
2057
2058 #[allow(irrefutable_let_patterns)]
2059 pub fn into_get_icmp(self) -> Option<(StateGetIcmpResponder)> {
2060 if let StateRequest::GetIcmp { responder } = self { Some((responder)) } else { None }
2061 }
2062
2063 #[allow(irrefutable_let_patterns)]
2064 pub fn into_get_ip(self) -> Option<(StateGetIpResponder)> {
2065 if let StateRequest::GetIp { responder } = self { Some((responder)) } else { None }
2066 }
2067
2068 #[allow(irrefutable_let_patterns)]
2069 pub fn into_get_device(self) -> Option<(StateGetDeviceResponder)> {
2070 if let StateRequest::GetDevice { responder } = self { Some((responder)) } else { None }
2071 }
2072
2073 pub fn method_name(&self) -> &'static str {
2075 match *self {
2076 StateRequest::GetInterfaceDefaults { .. } => "get_interface_defaults",
2077 StateRequest::GetTcp { .. } => "get_tcp",
2078 StateRequest::GetUdp { .. } => "get_udp",
2079 StateRequest::GetIcmp { .. } => "get_icmp",
2080 StateRequest::GetIp { .. } => "get_ip",
2081 StateRequest::GetDevice { .. } => "get_device",
2082 }
2083 }
2084}
2085
2086#[derive(Debug, Clone)]
2087pub struct StateControlHandle {
2088 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2089}
2090
2091impl fidl::endpoints::ControlHandle for StateControlHandle {
2092 fn shutdown(&self) {
2093 self.inner.shutdown()
2094 }
2095 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2096 self.inner.shutdown_with_epitaph(status)
2097 }
2098
2099 fn is_closed(&self) -> bool {
2100 self.inner.channel().is_closed()
2101 }
2102 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2103 self.inner.channel().on_closed()
2104 }
2105
2106 #[cfg(target_os = "fuchsia")]
2107 fn signal_peer(
2108 &self,
2109 clear_mask: zx::Signals,
2110 set_mask: zx::Signals,
2111 ) -> Result<(), zx_status::Status> {
2112 use fidl::Peered;
2113 self.inner.channel().signal_peer(clear_mask, set_mask)
2114 }
2115}
2116
2117impl StateControlHandle {}
2118
2119#[must_use = "FIDL methods require a response to be sent"]
2120#[derive(Debug)]
2121pub struct StateGetInterfaceDefaultsResponder {
2122 control_handle: std::mem::ManuallyDrop<StateControlHandle>,
2123 tx_id: u32,
2124}
2125
2126impl std::ops::Drop for StateGetInterfaceDefaultsResponder {
2130 fn drop(&mut self) {
2131 self.control_handle.shutdown();
2132 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2134 }
2135}
2136
2137impl fidl::endpoints::Responder for StateGetInterfaceDefaultsResponder {
2138 type ControlHandle = StateControlHandle;
2139
2140 fn control_handle(&self) -> &StateControlHandle {
2141 &self.control_handle
2142 }
2143
2144 fn drop_without_shutdown(mut self) {
2145 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2147 std::mem::forget(self);
2149 }
2150}
2151
2152impl StateGetInterfaceDefaultsResponder {
2153 pub fn send(
2157 self,
2158 mut payload: &fidl_fuchsia_net_interfaces_admin::Configuration,
2159 ) -> Result<(), fidl::Error> {
2160 let _result = self.send_raw(payload);
2161 if _result.is_err() {
2162 self.control_handle.shutdown();
2163 }
2164 self.drop_without_shutdown();
2165 _result
2166 }
2167
2168 pub fn send_no_shutdown_on_err(
2170 self,
2171 mut payload: &fidl_fuchsia_net_interfaces_admin::Configuration,
2172 ) -> Result<(), fidl::Error> {
2173 let _result = self.send_raw(payload);
2174 self.drop_without_shutdown();
2175 _result
2176 }
2177
2178 fn send_raw(
2179 &self,
2180 mut payload: &fidl_fuchsia_net_interfaces_admin::Configuration,
2181 ) -> Result<(), fidl::Error> {
2182 self.control_handle.inner.send::<fidl_fuchsia_net_interfaces_admin::Configuration>(
2183 payload,
2184 self.tx_id,
2185 0x4c4824a322a705e3,
2186 fidl::encoding::DynamicFlags::empty(),
2187 )
2188 }
2189}
2190
2191#[must_use = "FIDL methods require a response to be sent"]
2192#[derive(Debug)]
2193pub struct StateGetTcpResponder {
2194 control_handle: std::mem::ManuallyDrop<StateControlHandle>,
2195 tx_id: u32,
2196}
2197
2198impl std::ops::Drop for StateGetTcpResponder {
2202 fn drop(&mut self) {
2203 self.control_handle.shutdown();
2204 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2206 }
2207}
2208
2209impl fidl::endpoints::Responder for StateGetTcpResponder {
2210 type ControlHandle = StateControlHandle;
2211
2212 fn control_handle(&self) -> &StateControlHandle {
2213 &self.control_handle
2214 }
2215
2216 fn drop_without_shutdown(mut self) {
2217 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2219 std::mem::forget(self);
2221 }
2222}
2223
2224impl StateGetTcpResponder {
2225 pub fn send(self, mut payload: &Tcp) -> Result<(), fidl::Error> {
2229 let _result = self.send_raw(payload);
2230 if _result.is_err() {
2231 self.control_handle.shutdown();
2232 }
2233 self.drop_without_shutdown();
2234 _result
2235 }
2236
2237 pub fn send_no_shutdown_on_err(self, mut payload: &Tcp) -> Result<(), fidl::Error> {
2239 let _result = self.send_raw(payload);
2240 self.drop_without_shutdown();
2241 _result
2242 }
2243
2244 fn send_raw(&self, mut payload: &Tcp) -> Result<(), fidl::Error> {
2245 self.control_handle.inner.send::<Tcp>(
2246 payload,
2247 self.tx_id,
2248 0x4e818d8a89985b70,
2249 fidl::encoding::DynamicFlags::empty(),
2250 )
2251 }
2252}
2253
2254#[must_use = "FIDL methods require a response to be sent"]
2255#[derive(Debug)]
2256pub struct StateGetUdpResponder {
2257 control_handle: std::mem::ManuallyDrop<StateControlHandle>,
2258 tx_id: u32,
2259}
2260
2261impl std::ops::Drop for StateGetUdpResponder {
2265 fn drop(&mut self) {
2266 self.control_handle.shutdown();
2267 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2269 }
2270}
2271
2272impl fidl::endpoints::Responder for StateGetUdpResponder {
2273 type ControlHandle = StateControlHandle;
2274
2275 fn control_handle(&self) -> &StateControlHandle {
2276 &self.control_handle
2277 }
2278
2279 fn drop_without_shutdown(mut self) {
2280 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2282 std::mem::forget(self);
2284 }
2285}
2286
2287impl StateGetUdpResponder {
2288 pub fn send(self, mut payload: &Udp) -> Result<(), fidl::Error> {
2292 let _result = self.send_raw(payload);
2293 if _result.is_err() {
2294 self.control_handle.shutdown();
2295 }
2296 self.drop_without_shutdown();
2297 _result
2298 }
2299
2300 pub fn send_no_shutdown_on_err(self, mut payload: &Udp) -> Result<(), fidl::Error> {
2302 let _result = self.send_raw(payload);
2303 self.drop_without_shutdown();
2304 _result
2305 }
2306
2307 fn send_raw(&self, mut payload: &Udp) -> Result<(), fidl::Error> {
2308 self.control_handle.inner.send::<Udp>(
2309 payload,
2310 self.tx_id,
2311 0x1af3bc1507b7a196,
2312 fidl::encoding::DynamicFlags::empty(),
2313 )
2314 }
2315}
2316
2317#[must_use = "FIDL methods require a response to be sent"]
2318#[derive(Debug)]
2319pub struct StateGetIcmpResponder {
2320 control_handle: std::mem::ManuallyDrop<StateControlHandle>,
2321 tx_id: u32,
2322}
2323
2324impl std::ops::Drop for StateGetIcmpResponder {
2328 fn drop(&mut self) {
2329 self.control_handle.shutdown();
2330 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2332 }
2333}
2334
2335impl fidl::endpoints::Responder for StateGetIcmpResponder {
2336 type ControlHandle = StateControlHandle;
2337
2338 fn control_handle(&self) -> &StateControlHandle {
2339 &self.control_handle
2340 }
2341
2342 fn drop_without_shutdown(mut self) {
2343 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2345 std::mem::forget(self);
2347 }
2348}
2349
2350impl StateGetIcmpResponder {
2351 pub fn send(self, mut payload: &Icmp) -> Result<(), fidl::Error> {
2355 let _result = self.send_raw(payload);
2356 if _result.is_err() {
2357 self.control_handle.shutdown();
2358 }
2359 self.drop_without_shutdown();
2360 _result
2361 }
2362
2363 pub fn send_no_shutdown_on_err(self, mut payload: &Icmp) -> Result<(), fidl::Error> {
2365 let _result = self.send_raw(payload);
2366 self.drop_without_shutdown();
2367 _result
2368 }
2369
2370 fn send_raw(&self, mut payload: &Icmp) -> Result<(), fidl::Error> {
2371 self.control_handle.inner.send::<Icmp>(
2372 payload,
2373 self.tx_id,
2374 0x4079fd71ca65e33f,
2375 fidl::encoding::DynamicFlags::empty(),
2376 )
2377 }
2378}
2379
2380#[must_use = "FIDL methods require a response to be sent"]
2381#[derive(Debug)]
2382pub struct StateGetIpResponder {
2383 control_handle: std::mem::ManuallyDrop<StateControlHandle>,
2384 tx_id: u32,
2385}
2386
2387impl std::ops::Drop for StateGetIpResponder {
2391 fn drop(&mut self) {
2392 self.control_handle.shutdown();
2393 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2395 }
2396}
2397
2398impl fidl::endpoints::Responder for StateGetIpResponder {
2399 type ControlHandle = StateControlHandle;
2400
2401 fn control_handle(&self) -> &StateControlHandle {
2402 &self.control_handle
2403 }
2404
2405 fn drop_without_shutdown(mut self) {
2406 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2408 std::mem::forget(self);
2410 }
2411}
2412
2413impl StateGetIpResponder {
2414 pub fn send(self, mut payload: &Ip) -> Result<(), fidl::Error> {
2418 let _result = self.send_raw(payload);
2419 if _result.is_err() {
2420 self.control_handle.shutdown();
2421 }
2422 self.drop_without_shutdown();
2423 _result
2424 }
2425
2426 pub fn send_no_shutdown_on_err(self, mut payload: &Ip) -> Result<(), fidl::Error> {
2428 let _result = self.send_raw(payload);
2429 self.drop_without_shutdown();
2430 _result
2431 }
2432
2433 fn send_raw(&self, mut payload: &Ip) -> Result<(), fidl::Error> {
2434 self.control_handle.inner.send::<Ip>(
2435 payload,
2436 self.tx_id,
2437 0x2c1cc13f4874956,
2438 fidl::encoding::DynamicFlags::empty(),
2439 )
2440 }
2441}
2442
2443#[must_use = "FIDL methods require a response to be sent"]
2444#[derive(Debug)]
2445pub struct StateGetDeviceResponder {
2446 control_handle: std::mem::ManuallyDrop<StateControlHandle>,
2447 tx_id: u32,
2448}
2449
2450impl std::ops::Drop for StateGetDeviceResponder {
2454 fn drop(&mut self) {
2455 self.control_handle.shutdown();
2456 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2458 }
2459}
2460
2461impl fidl::endpoints::Responder for StateGetDeviceResponder {
2462 type ControlHandle = StateControlHandle;
2463
2464 fn control_handle(&self) -> &StateControlHandle {
2465 &self.control_handle
2466 }
2467
2468 fn drop_without_shutdown(mut self) {
2469 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2471 std::mem::forget(self);
2473 }
2474}
2475
2476impl StateGetDeviceResponder {
2477 pub fn send(self, mut payload: &Device) -> Result<(), fidl::Error> {
2481 let _result = self.send_raw(payload);
2482 if _result.is_err() {
2483 self.control_handle.shutdown();
2484 }
2485 self.drop_without_shutdown();
2486 _result
2487 }
2488
2489 pub fn send_no_shutdown_on_err(self, mut payload: &Device) -> Result<(), fidl::Error> {
2491 let _result = self.send_raw(payload);
2492 self.drop_without_shutdown();
2493 _result
2494 }
2495
2496 fn send_raw(&self, mut payload: &Device) -> Result<(), fidl::Error> {
2497 self.control_handle.inner.send::<Device>(
2498 payload,
2499 self.tx_id,
2500 0x5713a85352e43887,
2501 fidl::encoding::DynamicFlags::empty(),
2502 )
2503 }
2504}
2505
2506mod internal {
2507 use super::*;
2508}