fidl_fuchsia_net_settings/
fidl_fuchsia_net_settings.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_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    /// Waits until an event arrives and returns it. It is safe for other
93    /// threads to make concurrent requests while waiting for an event.
94    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    /// Updates the default configurations for interfaces.
102    ///
103    /// New interfaces created take default values from this configuration.
104    ///
105    /// Note that some interface types may not support specific configurations,
106    /// in which case the value is either ignored or the network stack assigns a
107    /// server-assigned value.
108    ///
109    /// Only fields present in the provided [`Interface`] are set; unset fields
110    /// are left unmodified. The server returns a `Interface` which holds the
111    /// previous configuration for fields that were set in the request.
112    ///
113    /// No values are changed if an error is returned.
114    ///
115    /// + request configuration fields to update on the interface defaults.
116    /// - response a partial snapshot of the previous default configuration.
117    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    /// Updates TCP settings.
135    ///
136    /// Only fields present in the provided [`Tcp`] are set; unset fields are
137    /// left unmodified. The server returns a `Tcp` which holds the previous
138    /// settings for fields that were set in the request.
139    ///
140    /// No values are changed if an error is returned.
141    ///
142    /// + request TCP settings fields to update.
143    /// - response a partial snapshot of the previous TCP settings.
144    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    /// Updates UDP settings.
160    ///
161    /// Only fields present in the provided [`Udp`] are set; unset fields are
162    /// left unmodified. The server returns a `Udp` which holds the previous
163    /// settings for fields that were set in the request.
164    ///
165    /// No values are changed if an error is returned.
166    ///
167    /// + request UDP settings fields to update.
168    /// - response a partial snapshot of the previous UDP settings.
169    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    /// Updates ICMP settings.
185    ///
186    /// Only fields present in the provided [`Icmp`] are set; unset fields are
187    /// left unmodified. The server returns a `Icmp` which holds the previous
188    /// settings for fields that were set in the request.
189    ///
190    /// No values are changed if an error is returned.
191    ///
192    /// + request ICMP settings fields to update.
193    /// - response a partial snapshot of the previous ICMP settings.
194    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    /// Updates IP settings.
210    ///
211    /// Only fields present in the provided [`Ip`] are set; unset fields are
212    /// left unmodified. The server returns a `Ip` which holds the previous
213    /// settings for fields that were set in the request.
214    ///
215    /// No values are changed if an error is returned.
216    ///
217    /// + request IP settings fields to update.
218    /// - response a partial snapshot of the previous IP settings.
219    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    /// Updates device layer settings.
234    ///
235    /// Only fields present in the provided [`Device`] are set; unset
236    /// fields are left unmodified. The server returns a `Device` which
237    /// holds the previous settings for fields that were set in the
238    /// request.
239    ///
240    /// No values are changed if an error is returned.
241    ///
242    /// + request device layer settings fields to update.
243    /// - response a partial snapshot of the previous device layer.
244    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::NullableHandle {
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    /// Create a new Proxy for fuchsia.net.settings/Control.
306    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    /// Get a Stream of events from the remote end of the protocol.
312    ///
313    /// # Panics
314    ///
315    /// Panics if the event stream was already taken.
316    pub fn take_event_stream(&self) -> ControlEventStream {
317        ControlEventStream { event_receiver: self.client.take_event_receiver() }
318    }
319
320    /// Updates the default configurations for interfaces.
321    ///
322    /// New interfaces created take default values from this configuration.
323    ///
324    /// Note that some interface types may not support specific configurations,
325    /// in which case the value is either ignored or the network stack assigns a
326    /// server-assigned value.
327    ///
328    /// Only fields present in the provided [`Interface`] are set; unset fields
329    /// are left unmodified. The server returns a `Interface` which holds the
330    /// previous configuration for fields that were set in the request.
331    ///
332    /// No values are changed if an error is returned.
333    ///
334    /// + request configuration fields to update on the interface defaults.
335    /// - response a partial snapshot of the previous default configuration.
336    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    /// Updates TCP settings.
347    ///
348    /// Only fields present in the provided [`Tcp`] are set; unset fields are
349    /// left unmodified. The server returns a `Tcp` which holds the previous
350    /// settings for fields that were set in the request.
351    ///
352    /// No values are changed if an error is returned.
353    ///
354    /// + request TCP settings fields to update.
355    /// - response a partial snapshot of the previous TCP settings.
356    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    /// Updates UDP settings.
367    ///
368    /// Only fields present in the provided [`Udp`] are set; unset fields are
369    /// left unmodified. The server returns a `Udp` which holds the previous
370    /// settings for fields that were set in the request.
371    ///
372    /// No values are changed if an error is returned.
373    ///
374    /// + request UDP settings fields to update.
375    /// - response a partial snapshot of the previous UDP settings.
376    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    /// Updates ICMP settings.
387    ///
388    /// Only fields present in the provided [`Icmp`] are set; unset fields are
389    /// left unmodified. The server returns a `Icmp` which holds the previous
390    /// settings for fields that were set in the request.
391    ///
392    /// No values are changed if an error is returned.
393    ///
394    /// + request ICMP settings fields to update.
395    /// - response a partial snapshot of the previous ICMP settings.
396    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    /// Updates IP settings.
407    ///
408    /// Only fields present in the provided [`Ip`] are set; unset fields are
409    /// left unmodified. The server returns a `Ip` which holds the previous
410    /// settings for fields that were set in the request.
411    ///
412    /// No values are changed if an error is returned.
413    ///
414    /// + request IP settings fields to update.
415    /// - response a partial snapshot of the previous IP settings.
416    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    /// Updates device layer settings.
427    ///
428    /// Only fields present in the provided [`Device`] are set; unset
429    /// fields are left unmodified. The server returns a `Device` which
430    /// holds the previous settings for fields that were set in the
431    /// request.
432    ///
433    /// No values are changed if an error is returned.
434    ///
435    /// + request device layer settings fields to update.
436    /// - response a partial snapshot of the previous device layer.
437    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    /// Decodes a message buffer as a [`ControlEvent`].
631    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
646/// A Stream of incoming requests for fuchsia.net.settings/Control.
647pub 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                // A message has been received from the channel
719                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/// Provides control over the network stack namespace-wide configuration.
820#[derive(Debug)]
821pub enum ControlRequest {
822    /// Updates the default configurations for interfaces.
823    ///
824    /// New interfaces created take default values from this configuration.
825    ///
826    /// Note that some interface types may not support specific configurations,
827    /// in which case the value is either ignored or the network stack assigns a
828    /// server-assigned value.
829    ///
830    /// Only fields present in the provided [`Interface`] are set; unset fields
831    /// are left unmodified. The server returns a `Interface` which holds the
832    /// previous configuration for fields that were set in the request.
833    ///
834    /// No values are changed if an error is returned.
835    ///
836    /// + request configuration fields to update on the interface defaults.
837    /// - response a partial snapshot of the previous default configuration.
838    UpdateInterfaceDefaults {
839        payload: fidl_fuchsia_net_interfaces_admin::Configuration,
840        responder: ControlUpdateInterfaceDefaultsResponder,
841    },
842    /// Updates TCP settings.
843    ///
844    /// Only fields present in the provided [`Tcp`] are set; unset fields are
845    /// left unmodified. The server returns a `Tcp` which holds the previous
846    /// settings for fields that were set in the request.
847    ///
848    /// No values are changed if an error is returned.
849    ///
850    /// + request TCP settings fields to update.
851    /// - response a partial snapshot of the previous TCP settings.
852    UpdateTcp { payload: Tcp, responder: ControlUpdateTcpResponder },
853    /// Updates UDP settings.
854    ///
855    /// Only fields present in the provided [`Udp`] are set; unset fields are
856    /// left unmodified. The server returns a `Udp` which holds the previous
857    /// settings for fields that were set in the request.
858    ///
859    /// No values are changed if an error is returned.
860    ///
861    /// + request UDP settings fields to update.
862    /// - response a partial snapshot of the previous UDP settings.
863    UpdateUdp { payload: Udp, responder: ControlUpdateUdpResponder },
864    /// Updates ICMP settings.
865    ///
866    /// Only fields present in the provided [`Icmp`] are set; unset fields are
867    /// left unmodified. The server returns a `Icmp` which holds the previous
868    /// settings for fields that were set in the request.
869    ///
870    /// No values are changed if an error is returned.
871    ///
872    /// + request ICMP settings fields to update.
873    /// - response a partial snapshot of the previous ICMP settings.
874    UpdateIcmp { payload: Icmp, responder: ControlUpdateIcmpResponder },
875    /// Updates IP settings.
876    ///
877    /// Only fields present in the provided [`Ip`] are set; unset fields are
878    /// left unmodified. The server returns a `Ip` which holds the previous
879    /// settings for fields that were set in the request.
880    ///
881    /// No values are changed if an error is returned.
882    ///
883    /// + request IP settings fields to update.
884    /// - response a partial snapshot of the previous IP settings.
885    UpdateIp { payload: Ip, responder: ControlUpdateIpResponder },
886    /// Updates device layer settings.
887    ///
888    /// Only fields present in the provided [`Device`] are set; unset
889    /// fields are left unmodified. The server returns a `Device` which
890    /// holds the previous settings for fields that were set in the
891    /// request.
892    ///
893    /// No values are changed if an error is returned.
894    ///
895    /// + request device layer settings fields to update.
896    /// - response a partial snapshot of the previous device layer.
897    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    /// Name of the method defined in FIDL
961    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
983    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
984        self.inner.shutdown_with_epitaph(status)
985    }
986
987    fn is_closed(&self) -> bool {
988        self.inner.channel().is_closed()
989    }
990    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
991        self.inner.channel().on_closed()
992    }
993
994    #[cfg(target_os = "fuchsia")]
995    fn signal_peer(
996        &self,
997        clear_mask: zx::Signals,
998        set_mask: zx::Signals,
999    ) -> Result<(), zx_status::Status> {
1000        use fidl::Peered;
1001        self.inner.channel().signal_peer(clear_mask, set_mask)
1002    }
1003}
1004
1005impl ControlControlHandle {}
1006
1007#[must_use = "FIDL methods require a response to be sent"]
1008#[derive(Debug)]
1009pub struct ControlUpdateInterfaceDefaultsResponder {
1010    control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
1011    tx_id: u32,
1012}
1013
1014/// Set the the channel to be shutdown (see [`ControlControlHandle::shutdown`])
1015/// if the responder is dropped without sending a response, so that the client
1016/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1017impl std::ops::Drop for ControlUpdateInterfaceDefaultsResponder {
1018    fn drop(&mut self) {
1019        self.control_handle.shutdown();
1020        // Safety: drops once, never accessed again
1021        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1022    }
1023}
1024
1025impl fidl::endpoints::Responder for ControlUpdateInterfaceDefaultsResponder {
1026    type ControlHandle = ControlControlHandle;
1027
1028    fn control_handle(&self) -> &ControlControlHandle {
1029        &self.control_handle
1030    }
1031
1032    fn drop_without_shutdown(mut self) {
1033        // Safety: drops once, never accessed again due to mem::forget
1034        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1035        // Prevent Drop from running (which would shut down the channel)
1036        std::mem::forget(self);
1037    }
1038}
1039
1040impl ControlUpdateInterfaceDefaultsResponder {
1041    /// Sends a response to the FIDL transaction.
1042    ///
1043    /// Sets the channel to shutdown if an error occurs.
1044    pub fn send(
1045        self,
1046        mut result: Result<&fidl_fuchsia_net_interfaces_admin::Configuration, UpdateError>,
1047    ) -> Result<(), fidl::Error> {
1048        let _result = self.send_raw(result);
1049        if _result.is_err() {
1050            self.control_handle.shutdown();
1051        }
1052        self.drop_without_shutdown();
1053        _result
1054    }
1055
1056    /// Similar to "send" but does not shutdown the channel if an error occurs.
1057    pub fn send_no_shutdown_on_err(
1058        self,
1059        mut result: Result<&fidl_fuchsia_net_interfaces_admin::Configuration, UpdateError>,
1060    ) -> Result<(), fidl::Error> {
1061        let _result = self.send_raw(result);
1062        self.drop_without_shutdown();
1063        _result
1064    }
1065
1066    fn send_raw(
1067        &self,
1068        mut result: Result<&fidl_fuchsia_net_interfaces_admin::Configuration, UpdateError>,
1069    ) -> Result<(), fidl::Error> {
1070        self.control_handle.inner.send::<fidl::encoding::ResultType<
1071            fidl_fuchsia_net_interfaces_admin::Configuration,
1072            UpdateError,
1073        >>(
1074            result,
1075            self.tx_id,
1076            0x46ea2036390abecc,
1077            fidl::encoding::DynamicFlags::empty(),
1078        )
1079    }
1080}
1081
1082#[must_use = "FIDL methods require a response to be sent"]
1083#[derive(Debug)]
1084pub struct ControlUpdateTcpResponder {
1085    control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
1086    tx_id: u32,
1087}
1088
1089/// Set the the channel to be shutdown (see [`ControlControlHandle::shutdown`])
1090/// if the responder is dropped without sending a response, so that the client
1091/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1092impl std::ops::Drop for ControlUpdateTcpResponder {
1093    fn drop(&mut self) {
1094        self.control_handle.shutdown();
1095        // Safety: drops once, never accessed again
1096        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1097    }
1098}
1099
1100impl fidl::endpoints::Responder for ControlUpdateTcpResponder {
1101    type ControlHandle = ControlControlHandle;
1102
1103    fn control_handle(&self) -> &ControlControlHandle {
1104        &self.control_handle
1105    }
1106
1107    fn drop_without_shutdown(mut self) {
1108        // Safety: drops once, never accessed again due to mem::forget
1109        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1110        // Prevent Drop from running (which would shut down the channel)
1111        std::mem::forget(self);
1112    }
1113}
1114
1115impl ControlUpdateTcpResponder {
1116    /// Sends a response to the FIDL transaction.
1117    ///
1118    /// Sets the channel to shutdown if an error occurs.
1119    pub fn send(self, mut result: Result<&Tcp, UpdateError>) -> Result<(), fidl::Error> {
1120        let _result = self.send_raw(result);
1121        if _result.is_err() {
1122            self.control_handle.shutdown();
1123        }
1124        self.drop_without_shutdown();
1125        _result
1126    }
1127
1128    /// Similar to "send" but does not shutdown the channel if an error occurs.
1129    pub fn send_no_shutdown_on_err(
1130        self,
1131        mut result: Result<&Tcp, UpdateError>,
1132    ) -> Result<(), fidl::Error> {
1133        let _result = self.send_raw(result);
1134        self.drop_without_shutdown();
1135        _result
1136    }
1137
1138    fn send_raw(&self, mut result: Result<&Tcp, UpdateError>) -> Result<(), fidl::Error> {
1139        self.control_handle.inner.send::<fidl::encoding::ResultType<Tcp, UpdateError>>(
1140            result,
1141            self.tx_id,
1142            0x4e768d74ec55450f,
1143            fidl::encoding::DynamicFlags::empty(),
1144        )
1145    }
1146}
1147
1148#[must_use = "FIDL methods require a response to be sent"]
1149#[derive(Debug)]
1150pub struct ControlUpdateUdpResponder {
1151    control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
1152    tx_id: u32,
1153}
1154
1155/// Set the the channel to be shutdown (see [`ControlControlHandle::shutdown`])
1156/// if the responder is dropped without sending a response, so that the client
1157/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1158impl std::ops::Drop for ControlUpdateUdpResponder {
1159    fn drop(&mut self) {
1160        self.control_handle.shutdown();
1161        // Safety: drops once, never accessed again
1162        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1163    }
1164}
1165
1166impl fidl::endpoints::Responder for ControlUpdateUdpResponder {
1167    type ControlHandle = ControlControlHandle;
1168
1169    fn control_handle(&self) -> &ControlControlHandle {
1170        &self.control_handle
1171    }
1172
1173    fn drop_without_shutdown(mut self) {
1174        // Safety: drops once, never accessed again due to mem::forget
1175        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1176        // Prevent Drop from running (which would shut down the channel)
1177        std::mem::forget(self);
1178    }
1179}
1180
1181impl ControlUpdateUdpResponder {
1182    /// Sends a response to the FIDL transaction.
1183    ///
1184    /// Sets the channel to shutdown if an error occurs.
1185    pub fn send(self, mut result: Result<&Udp, UpdateError>) -> Result<(), fidl::Error> {
1186        let _result = self.send_raw(result);
1187        if _result.is_err() {
1188            self.control_handle.shutdown();
1189        }
1190        self.drop_without_shutdown();
1191        _result
1192    }
1193
1194    /// Similar to "send" but does not shutdown the channel if an error occurs.
1195    pub fn send_no_shutdown_on_err(
1196        self,
1197        mut result: Result<&Udp, UpdateError>,
1198    ) -> Result<(), fidl::Error> {
1199        let _result = self.send_raw(result);
1200        self.drop_without_shutdown();
1201        _result
1202    }
1203
1204    fn send_raw(&self, mut result: Result<&Udp, UpdateError>) -> Result<(), fidl::Error> {
1205        self.control_handle.inner.send::<fidl::encoding::ResultType<Udp, UpdateError>>(
1206            result,
1207            self.tx_id,
1208            0x6fb82be32e7338b4,
1209            fidl::encoding::DynamicFlags::empty(),
1210        )
1211    }
1212}
1213
1214#[must_use = "FIDL methods require a response to be sent"]
1215#[derive(Debug)]
1216pub struct ControlUpdateIcmpResponder {
1217    control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
1218    tx_id: u32,
1219}
1220
1221/// Set the the channel to be shutdown (see [`ControlControlHandle::shutdown`])
1222/// if the responder is dropped without sending a response, so that the client
1223/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1224impl std::ops::Drop for ControlUpdateIcmpResponder {
1225    fn drop(&mut self) {
1226        self.control_handle.shutdown();
1227        // Safety: drops once, never accessed again
1228        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1229    }
1230}
1231
1232impl fidl::endpoints::Responder for ControlUpdateIcmpResponder {
1233    type ControlHandle = ControlControlHandle;
1234
1235    fn control_handle(&self) -> &ControlControlHandle {
1236        &self.control_handle
1237    }
1238
1239    fn drop_without_shutdown(mut self) {
1240        // Safety: drops once, never accessed again due to mem::forget
1241        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1242        // Prevent Drop from running (which would shut down the channel)
1243        std::mem::forget(self);
1244    }
1245}
1246
1247impl ControlUpdateIcmpResponder {
1248    /// Sends a response to the FIDL transaction.
1249    ///
1250    /// Sets the channel to shutdown if an error occurs.
1251    pub fn send(self, mut result: Result<&Icmp, UpdateError>) -> Result<(), fidl::Error> {
1252        let _result = self.send_raw(result);
1253        if _result.is_err() {
1254            self.control_handle.shutdown();
1255        }
1256        self.drop_without_shutdown();
1257        _result
1258    }
1259
1260    /// Similar to "send" but does not shutdown the channel if an error occurs.
1261    pub fn send_no_shutdown_on_err(
1262        self,
1263        mut result: Result<&Icmp, UpdateError>,
1264    ) -> Result<(), fidl::Error> {
1265        let _result = self.send_raw(result);
1266        self.drop_without_shutdown();
1267        _result
1268    }
1269
1270    fn send_raw(&self, mut result: Result<&Icmp, UpdateError>) -> Result<(), fidl::Error> {
1271        self.control_handle.inner.send::<fidl::encoding::ResultType<Icmp, UpdateError>>(
1272            result,
1273            self.tx_id,
1274            0x42f130ff9cc3a8d5,
1275            fidl::encoding::DynamicFlags::empty(),
1276        )
1277    }
1278}
1279
1280#[must_use = "FIDL methods require a response to be sent"]
1281#[derive(Debug)]
1282pub struct ControlUpdateIpResponder {
1283    control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
1284    tx_id: u32,
1285}
1286
1287/// Set the the channel to be shutdown (see [`ControlControlHandle::shutdown`])
1288/// if the responder is dropped without sending a response, so that the client
1289/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1290impl std::ops::Drop for ControlUpdateIpResponder {
1291    fn drop(&mut self) {
1292        self.control_handle.shutdown();
1293        // Safety: drops once, never accessed again
1294        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1295    }
1296}
1297
1298impl fidl::endpoints::Responder for ControlUpdateIpResponder {
1299    type ControlHandle = ControlControlHandle;
1300
1301    fn control_handle(&self) -> &ControlControlHandle {
1302        &self.control_handle
1303    }
1304
1305    fn drop_without_shutdown(mut self) {
1306        // Safety: drops once, never accessed again due to mem::forget
1307        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1308        // Prevent Drop from running (which would shut down the channel)
1309        std::mem::forget(self);
1310    }
1311}
1312
1313impl ControlUpdateIpResponder {
1314    /// Sends a response to the FIDL transaction.
1315    ///
1316    /// Sets the channel to shutdown if an error occurs.
1317    pub fn send(self, mut result: Result<&Ip, UpdateError>) -> Result<(), fidl::Error> {
1318        let _result = self.send_raw(result);
1319        if _result.is_err() {
1320            self.control_handle.shutdown();
1321        }
1322        self.drop_without_shutdown();
1323        _result
1324    }
1325
1326    /// Similar to "send" but does not shutdown the channel if an error occurs.
1327    pub fn send_no_shutdown_on_err(
1328        self,
1329        mut result: Result<&Ip, UpdateError>,
1330    ) -> Result<(), fidl::Error> {
1331        let _result = self.send_raw(result);
1332        self.drop_without_shutdown();
1333        _result
1334    }
1335
1336    fn send_raw(&self, mut result: Result<&Ip, UpdateError>) -> Result<(), fidl::Error> {
1337        self.control_handle.inner.send::<fidl::encoding::ResultType<Ip, UpdateError>>(
1338            result,
1339            self.tx_id,
1340            0x75d1074407e4d1c4,
1341            fidl::encoding::DynamicFlags::empty(),
1342        )
1343    }
1344}
1345
1346#[must_use = "FIDL methods require a response to be sent"]
1347#[derive(Debug)]
1348pub struct ControlUpdateDeviceResponder {
1349    control_handle: std::mem::ManuallyDrop<ControlControlHandle>,
1350    tx_id: u32,
1351}
1352
1353/// Set the the channel to be shutdown (see [`ControlControlHandle::shutdown`])
1354/// if the responder is dropped without sending a response, so that the client
1355/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1356impl std::ops::Drop for ControlUpdateDeviceResponder {
1357    fn drop(&mut self) {
1358        self.control_handle.shutdown();
1359        // Safety: drops once, never accessed again
1360        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1361    }
1362}
1363
1364impl fidl::endpoints::Responder for ControlUpdateDeviceResponder {
1365    type ControlHandle = ControlControlHandle;
1366
1367    fn control_handle(&self) -> &ControlControlHandle {
1368        &self.control_handle
1369    }
1370
1371    fn drop_without_shutdown(mut self) {
1372        // Safety: drops once, never accessed again due to mem::forget
1373        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1374        // Prevent Drop from running (which would shut down the channel)
1375        std::mem::forget(self);
1376    }
1377}
1378
1379impl ControlUpdateDeviceResponder {
1380    /// Sends a response to the FIDL transaction.
1381    ///
1382    /// Sets the channel to shutdown if an error occurs.
1383    pub fn send(self, mut result: Result<&Device, UpdateError>) -> Result<(), fidl::Error> {
1384        let _result = self.send_raw(result);
1385        if _result.is_err() {
1386            self.control_handle.shutdown();
1387        }
1388        self.drop_without_shutdown();
1389        _result
1390    }
1391
1392    /// Similar to "send" but does not shutdown the channel if an error occurs.
1393    pub fn send_no_shutdown_on_err(
1394        self,
1395        mut result: Result<&Device, UpdateError>,
1396    ) -> Result<(), fidl::Error> {
1397        let _result = self.send_raw(result);
1398        self.drop_without_shutdown();
1399        _result
1400    }
1401
1402    fn send_raw(&self, mut result: Result<&Device, UpdateError>) -> Result<(), fidl::Error> {
1403        self.control_handle.inner.send::<fidl::encoding::ResultType<Device, UpdateError>>(
1404            result,
1405            self.tx_id,
1406            0x6080a91e617e9430,
1407            fidl::encoding::DynamicFlags::empty(),
1408        )
1409    }
1410}
1411
1412#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1413pub struct StateMarker;
1414
1415impl fidl::endpoints::ProtocolMarker for StateMarker {
1416    type Proxy = StateProxy;
1417    type RequestStream = StateRequestStream;
1418    #[cfg(target_os = "fuchsia")]
1419    type SynchronousProxy = StateSynchronousProxy;
1420
1421    const DEBUG_NAME: &'static str = "fuchsia.net.settings.State";
1422}
1423impl fidl::endpoints::DiscoverableProtocolMarker for StateMarker {}
1424
1425pub trait StateProxyInterface: Send + Sync {
1426    type GetInterfaceDefaultsResponseFut: std::future::Future<
1427            Output = Result<fidl_fuchsia_net_interfaces_admin::Configuration, fidl::Error>,
1428        > + Send;
1429    fn r#get_interface_defaults(&self) -> Self::GetInterfaceDefaultsResponseFut;
1430    type GetTcpResponseFut: std::future::Future<Output = Result<Tcp, fidl::Error>> + Send;
1431    fn r#get_tcp(&self) -> Self::GetTcpResponseFut;
1432    type GetUdpResponseFut: std::future::Future<Output = Result<Udp, fidl::Error>> + Send;
1433    fn r#get_udp(&self) -> Self::GetUdpResponseFut;
1434    type GetIcmpResponseFut: std::future::Future<Output = Result<Icmp, fidl::Error>> + Send;
1435    fn r#get_icmp(&self) -> Self::GetIcmpResponseFut;
1436    type GetIpResponseFut: std::future::Future<Output = Result<Ip, fidl::Error>> + Send;
1437    fn r#get_ip(&self) -> Self::GetIpResponseFut;
1438    type GetDeviceResponseFut: std::future::Future<Output = Result<Device, fidl::Error>> + Send;
1439    fn r#get_device(&self) -> Self::GetDeviceResponseFut;
1440}
1441#[derive(Debug)]
1442#[cfg(target_os = "fuchsia")]
1443pub struct StateSynchronousProxy {
1444    client: fidl::client::sync::Client,
1445}
1446
1447#[cfg(target_os = "fuchsia")]
1448impl fidl::endpoints::SynchronousProxy for StateSynchronousProxy {
1449    type Proxy = StateProxy;
1450    type Protocol = StateMarker;
1451
1452    fn from_channel(inner: fidl::Channel) -> Self {
1453        Self::new(inner)
1454    }
1455
1456    fn into_channel(self) -> fidl::Channel {
1457        self.client.into_channel()
1458    }
1459
1460    fn as_channel(&self) -> &fidl::Channel {
1461        self.client.as_channel()
1462    }
1463}
1464
1465#[cfg(target_os = "fuchsia")]
1466impl StateSynchronousProxy {
1467    pub fn new(channel: fidl::Channel) -> Self {
1468        let protocol_name = <StateMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1469        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1470    }
1471
1472    pub fn into_channel(self) -> fidl::Channel {
1473        self.client.into_channel()
1474    }
1475
1476    /// Waits until an event arrives and returns it. It is safe for other
1477    /// threads to make concurrent requests while waiting for an event.
1478    pub fn wait_for_event(
1479        &self,
1480        deadline: zx::MonotonicInstant,
1481    ) -> Result<StateEvent, fidl::Error> {
1482        StateEvent::decode(self.client.wait_for_event(deadline)?)
1483    }
1484
1485    /// Returns the current default settings for interfaces.
1486    pub fn r#get_interface_defaults(
1487        &self,
1488        ___deadline: zx::MonotonicInstant,
1489    ) -> Result<fidl_fuchsia_net_interfaces_admin::Configuration, fidl::Error> {
1490        let _response = self.client.send_query::<
1491            fidl::encoding::EmptyPayload,
1492            fidl_fuchsia_net_interfaces_admin::Configuration,
1493        >(
1494            (),
1495            0x4c4824a322a705e3,
1496            fidl::encoding::DynamicFlags::empty(),
1497            ___deadline,
1498        )?;
1499        Ok(_response)
1500    }
1501
1502    /// Returns the current TCP settings values.
1503    pub fn r#get_tcp(&self, ___deadline: zx::MonotonicInstant) -> Result<Tcp, fidl::Error> {
1504        let _response = self.client.send_query::<fidl::encoding::EmptyPayload, Tcp>(
1505            (),
1506            0x4e818d8a89985b70,
1507            fidl::encoding::DynamicFlags::empty(),
1508            ___deadline,
1509        )?;
1510        Ok(_response)
1511    }
1512
1513    /// Returns the current UDP settings values.
1514    pub fn r#get_udp(&self, ___deadline: zx::MonotonicInstant) -> Result<Udp, fidl::Error> {
1515        let _response = self.client.send_query::<fidl::encoding::EmptyPayload, Udp>(
1516            (),
1517            0x1af3bc1507b7a196,
1518            fidl::encoding::DynamicFlags::empty(),
1519            ___deadline,
1520        )?;
1521        Ok(_response)
1522    }
1523
1524    /// Returns the current ICMP settings values.
1525    pub fn r#get_icmp(&self, ___deadline: zx::MonotonicInstant) -> Result<Icmp, fidl::Error> {
1526        let _response = self.client.send_query::<fidl::encoding::EmptyPayload, Icmp>(
1527            (),
1528            0x4079fd71ca65e33f,
1529            fidl::encoding::DynamicFlags::empty(),
1530            ___deadline,
1531        )?;
1532        Ok(_response)
1533    }
1534
1535    /// Returns the current IP settings values.
1536    pub fn r#get_ip(&self, ___deadline: zx::MonotonicInstant) -> Result<Ip, fidl::Error> {
1537        let _response = self.client.send_query::<fidl::encoding::EmptyPayload, Ip>(
1538            (),
1539            0x2c1cc13f4874956,
1540            fidl::encoding::DynamicFlags::empty(),
1541            ___deadline,
1542        )?;
1543        Ok(_response)
1544    }
1545
1546    /// Returns the current device layer settings values.
1547    pub fn r#get_device(&self, ___deadline: zx::MonotonicInstant) -> Result<Device, fidl::Error> {
1548        let _response = self.client.send_query::<fidl::encoding::EmptyPayload, Device>(
1549            (),
1550            0x5713a85352e43887,
1551            fidl::encoding::DynamicFlags::empty(),
1552            ___deadline,
1553        )?;
1554        Ok(_response)
1555    }
1556}
1557
1558#[cfg(target_os = "fuchsia")]
1559impl From<StateSynchronousProxy> for zx::NullableHandle {
1560    fn from(value: StateSynchronousProxy) -> Self {
1561        value.into_channel().into()
1562    }
1563}
1564
1565#[cfg(target_os = "fuchsia")]
1566impl From<fidl::Channel> for StateSynchronousProxy {
1567    fn from(value: fidl::Channel) -> Self {
1568        Self::new(value)
1569    }
1570}
1571
1572#[cfg(target_os = "fuchsia")]
1573impl fidl::endpoints::FromClient for StateSynchronousProxy {
1574    type Protocol = StateMarker;
1575
1576    fn from_client(value: fidl::endpoints::ClientEnd<StateMarker>) -> Self {
1577        Self::new(value.into_channel())
1578    }
1579}
1580
1581#[derive(Debug, Clone)]
1582pub struct StateProxy {
1583    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1584}
1585
1586impl fidl::endpoints::Proxy for StateProxy {
1587    type Protocol = StateMarker;
1588
1589    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1590        Self::new(inner)
1591    }
1592
1593    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1594        self.client.into_channel().map_err(|client| Self { client })
1595    }
1596
1597    fn as_channel(&self) -> &::fidl::AsyncChannel {
1598        self.client.as_channel()
1599    }
1600}
1601
1602impl StateProxy {
1603    /// Create a new Proxy for fuchsia.net.settings/State.
1604    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1605        let protocol_name = <StateMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1606        Self { client: fidl::client::Client::new(channel, protocol_name) }
1607    }
1608
1609    /// Get a Stream of events from the remote end of the protocol.
1610    ///
1611    /// # Panics
1612    ///
1613    /// Panics if the event stream was already taken.
1614    pub fn take_event_stream(&self) -> StateEventStream {
1615        StateEventStream { event_receiver: self.client.take_event_receiver() }
1616    }
1617
1618    /// Returns the current default settings for interfaces.
1619    pub fn r#get_interface_defaults(
1620        &self,
1621    ) -> fidl::client::QueryResponseFut<
1622        fidl_fuchsia_net_interfaces_admin::Configuration,
1623        fidl::encoding::DefaultFuchsiaResourceDialect,
1624    > {
1625        StateProxyInterface::r#get_interface_defaults(self)
1626    }
1627
1628    /// Returns the current TCP settings values.
1629    pub fn r#get_tcp(
1630        &self,
1631    ) -> fidl::client::QueryResponseFut<Tcp, fidl::encoding::DefaultFuchsiaResourceDialect> {
1632        StateProxyInterface::r#get_tcp(self)
1633    }
1634
1635    /// Returns the current UDP settings values.
1636    pub fn r#get_udp(
1637        &self,
1638    ) -> fidl::client::QueryResponseFut<Udp, fidl::encoding::DefaultFuchsiaResourceDialect> {
1639        StateProxyInterface::r#get_udp(self)
1640    }
1641
1642    /// Returns the current ICMP settings values.
1643    pub fn r#get_icmp(
1644        &self,
1645    ) -> fidl::client::QueryResponseFut<Icmp, fidl::encoding::DefaultFuchsiaResourceDialect> {
1646        StateProxyInterface::r#get_icmp(self)
1647    }
1648
1649    /// Returns the current IP settings values.
1650    pub fn r#get_ip(
1651        &self,
1652    ) -> fidl::client::QueryResponseFut<Ip, fidl::encoding::DefaultFuchsiaResourceDialect> {
1653        StateProxyInterface::r#get_ip(self)
1654    }
1655
1656    /// Returns the current device layer settings values.
1657    pub fn r#get_device(
1658        &self,
1659    ) -> fidl::client::QueryResponseFut<Device, fidl::encoding::DefaultFuchsiaResourceDialect> {
1660        StateProxyInterface::r#get_device(self)
1661    }
1662}
1663
1664impl StateProxyInterface for StateProxy {
1665    type GetInterfaceDefaultsResponseFut = fidl::client::QueryResponseFut<
1666        fidl_fuchsia_net_interfaces_admin::Configuration,
1667        fidl::encoding::DefaultFuchsiaResourceDialect,
1668    >;
1669    fn r#get_interface_defaults(&self) -> Self::GetInterfaceDefaultsResponseFut {
1670        fn _decode(
1671            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1672        ) -> Result<fidl_fuchsia_net_interfaces_admin::Configuration, fidl::Error> {
1673            let _response = fidl::client::decode_transaction_body::<
1674                fidl_fuchsia_net_interfaces_admin::Configuration,
1675                fidl::encoding::DefaultFuchsiaResourceDialect,
1676                0x4c4824a322a705e3,
1677            >(_buf?)?;
1678            Ok(_response)
1679        }
1680        self.client.send_query_and_decode::<
1681            fidl::encoding::EmptyPayload,
1682            fidl_fuchsia_net_interfaces_admin::Configuration,
1683        >(
1684            (),
1685            0x4c4824a322a705e3,
1686            fidl::encoding::DynamicFlags::empty(),
1687            _decode,
1688        )
1689    }
1690
1691    type GetTcpResponseFut =
1692        fidl::client::QueryResponseFut<Tcp, fidl::encoding::DefaultFuchsiaResourceDialect>;
1693    fn r#get_tcp(&self) -> Self::GetTcpResponseFut {
1694        fn _decode(
1695            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1696        ) -> Result<Tcp, fidl::Error> {
1697            let _response = fidl::client::decode_transaction_body::<
1698                Tcp,
1699                fidl::encoding::DefaultFuchsiaResourceDialect,
1700                0x4e818d8a89985b70,
1701            >(_buf?)?;
1702            Ok(_response)
1703        }
1704        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Tcp>(
1705            (),
1706            0x4e818d8a89985b70,
1707            fidl::encoding::DynamicFlags::empty(),
1708            _decode,
1709        )
1710    }
1711
1712    type GetUdpResponseFut =
1713        fidl::client::QueryResponseFut<Udp, fidl::encoding::DefaultFuchsiaResourceDialect>;
1714    fn r#get_udp(&self) -> Self::GetUdpResponseFut {
1715        fn _decode(
1716            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1717        ) -> Result<Udp, fidl::Error> {
1718            let _response = fidl::client::decode_transaction_body::<
1719                Udp,
1720                fidl::encoding::DefaultFuchsiaResourceDialect,
1721                0x1af3bc1507b7a196,
1722            >(_buf?)?;
1723            Ok(_response)
1724        }
1725        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Udp>(
1726            (),
1727            0x1af3bc1507b7a196,
1728            fidl::encoding::DynamicFlags::empty(),
1729            _decode,
1730        )
1731    }
1732
1733    type GetIcmpResponseFut =
1734        fidl::client::QueryResponseFut<Icmp, fidl::encoding::DefaultFuchsiaResourceDialect>;
1735    fn r#get_icmp(&self) -> Self::GetIcmpResponseFut {
1736        fn _decode(
1737            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1738        ) -> Result<Icmp, fidl::Error> {
1739            let _response = fidl::client::decode_transaction_body::<
1740                Icmp,
1741                fidl::encoding::DefaultFuchsiaResourceDialect,
1742                0x4079fd71ca65e33f,
1743            >(_buf?)?;
1744            Ok(_response)
1745        }
1746        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Icmp>(
1747            (),
1748            0x4079fd71ca65e33f,
1749            fidl::encoding::DynamicFlags::empty(),
1750            _decode,
1751        )
1752    }
1753
1754    type GetIpResponseFut =
1755        fidl::client::QueryResponseFut<Ip, fidl::encoding::DefaultFuchsiaResourceDialect>;
1756    fn r#get_ip(&self) -> Self::GetIpResponseFut {
1757        fn _decode(
1758            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1759        ) -> Result<Ip, fidl::Error> {
1760            let _response = fidl::client::decode_transaction_body::<
1761                Ip,
1762                fidl::encoding::DefaultFuchsiaResourceDialect,
1763                0x2c1cc13f4874956,
1764            >(_buf?)?;
1765            Ok(_response)
1766        }
1767        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Ip>(
1768            (),
1769            0x2c1cc13f4874956,
1770            fidl::encoding::DynamicFlags::empty(),
1771            _decode,
1772        )
1773    }
1774
1775    type GetDeviceResponseFut =
1776        fidl::client::QueryResponseFut<Device, fidl::encoding::DefaultFuchsiaResourceDialect>;
1777    fn r#get_device(&self) -> Self::GetDeviceResponseFut {
1778        fn _decode(
1779            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1780        ) -> Result<Device, fidl::Error> {
1781            let _response = fidl::client::decode_transaction_body::<
1782                Device,
1783                fidl::encoding::DefaultFuchsiaResourceDialect,
1784                0x5713a85352e43887,
1785            >(_buf?)?;
1786            Ok(_response)
1787        }
1788        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Device>(
1789            (),
1790            0x5713a85352e43887,
1791            fidl::encoding::DynamicFlags::empty(),
1792            _decode,
1793        )
1794    }
1795}
1796
1797pub struct StateEventStream {
1798    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1799}
1800
1801impl std::marker::Unpin for StateEventStream {}
1802
1803impl futures::stream::FusedStream for StateEventStream {
1804    fn is_terminated(&self) -> bool {
1805        self.event_receiver.is_terminated()
1806    }
1807}
1808
1809impl futures::Stream for StateEventStream {
1810    type Item = Result<StateEvent, fidl::Error>;
1811
1812    fn poll_next(
1813        mut self: std::pin::Pin<&mut Self>,
1814        cx: &mut std::task::Context<'_>,
1815    ) -> std::task::Poll<Option<Self::Item>> {
1816        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1817            &mut self.event_receiver,
1818            cx
1819        )?) {
1820            Some(buf) => std::task::Poll::Ready(Some(StateEvent::decode(buf))),
1821            None => std::task::Poll::Ready(None),
1822        }
1823    }
1824}
1825
1826#[derive(Debug)]
1827pub enum StateEvent {}
1828
1829impl StateEvent {
1830    /// Decodes a message buffer as a [`StateEvent`].
1831    fn decode(
1832        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1833    ) -> Result<StateEvent, fidl::Error> {
1834        let (bytes, _handles) = buf.split_mut();
1835        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1836        debug_assert_eq!(tx_header.tx_id, 0);
1837        match tx_header.ordinal {
1838            _ => Err(fidl::Error::UnknownOrdinal {
1839                ordinal: tx_header.ordinal,
1840                protocol_name: <StateMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1841            }),
1842        }
1843    }
1844}
1845
1846/// A Stream of incoming requests for fuchsia.net.settings/State.
1847pub struct StateRequestStream {
1848    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1849    is_terminated: bool,
1850}
1851
1852impl std::marker::Unpin for StateRequestStream {}
1853
1854impl futures::stream::FusedStream for StateRequestStream {
1855    fn is_terminated(&self) -> bool {
1856        self.is_terminated
1857    }
1858}
1859
1860impl fidl::endpoints::RequestStream for StateRequestStream {
1861    type Protocol = StateMarker;
1862    type ControlHandle = StateControlHandle;
1863
1864    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1865        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1866    }
1867
1868    fn control_handle(&self) -> Self::ControlHandle {
1869        StateControlHandle { inner: self.inner.clone() }
1870    }
1871
1872    fn into_inner(
1873        self,
1874    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1875    {
1876        (self.inner, self.is_terminated)
1877    }
1878
1879    fn from_inner(
1880        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1881        is_terminated: bool,
1882    ) -> Self {
1883        Self { inner, is_terminated }
1884    }
1885}
1886
1887impl futures::Stream for StateRequestStream {
1888    type Item = Result<StateRequest, fidl::Error>;
1889
1890    fn poll_next(
1891        mut self: std::pin::Pin<&mut Self>,
1892        cx: &mut std::task::Context<'_>,
1893    ) -> std::task::Poll<Option<Self::Item>> {
1894        let this = &mut *self;
1895        if this.inner.check_shutdown(cx) {
1896            this.is_terminated = true;
1897            return std::task::Poll::Ready(None);
1898        }
1899        if this.is_terminated {
1900            panic!("polled StateRequestStream after completion");
1901        }
1902        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1903            |bytes, handles| {
1904                match this.inner.channel().read_etc(cx, bytes, handles) {
1905                    std::task::Poll::Ready(Ok(())) => {}
1906                    std::task::Poll::Pending => return std::task::Poll::Pending,
1907                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1908                        this.is_terminated = true;
1909                        return std::task::Poll::Ready(None);
1910                    }
1911                    std::task::Poll::Ready(Err(e)) => {
1912                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1913                            e.into(),
1914                        ))));
1915                    }
1916                }
1917
1918                // A message has been received from the channel
1919                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1920
1921                std::task::Poll::Ready(Some(match header.ordinal {
1922                    0x4c4824a322a705e3 => {
1923                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1924                        let mut req = fidl::new_empty!(
1925                            fidl::encoding::EmptyPayload,
1926                            fidl::encoding::DefaultFuchsiaResourceDialect
1927                        );
1928                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1929                        let control_handle = StateControlHandle { inner: this.inner.clone() };
1930                        Ok(StateRequest::GetInterfaceDefaults {
1931                            responder: StateGetInterfaceDefaultsResponder {
1932                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1933                                tx_id: header.tx_id,
1934                            },
1935                        })
1936                    }
1937                    0x4e818d8a89985b70 => {
1938                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1939                        let mut req = fidl::new_empty!(
1940                            fidl::encoding::EmptyPayload,
1941                            fidl::encoding::DefaultFuchsiaResourceDialect
1942                        );
1943                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1944                        let control_handle = StateControlHandle { inner: this.inner.clone() };
1945                        Ok(StateRequest::GetTcp {
1946                            responder: StateGetTcpResponder {
1947                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1948                                tx_id: header.tx_id,
1949                            },
1950                        })
1951                    }
1952                    0x1af3bc1507b7a196 => {
1953                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1954                        let mut req = fidl::new_empty!(
1955                            fidl::encoding::EmptyPayload,
1956                            fidl::encoding::DefaultFuchsiaResourceDialect
1957                        );
1958                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1959                        let control_handle = StateControlHandle { inner: this.inner.clone() };
1960                        Ok(StateRequest::GetUdp {
1961                            responder: StateGetUdpResponder {
1962                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1963                                tx_id: header.tx_id,
1964                            },
1965                        })
1966                    }
1967                    0x4079fd71ca65e33f => {
1968                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1969                        let mut req = fidl::new_empty!(
1970                            fidl::encoding::EmptyPayload,
1971                            fidl::encoding::DefaultFuchsiaResourceDialect
1972                        );
1973                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1974                        let control_handle = StateControlHandle { inner: this.inner.clone() };
1975                        Ok(StateRequest::GetIcmp {
1976                            responder: StateGetIcmpResponder {
1977                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1978                                tx_id: header.tx_id,
1979                            },
1980                        })
1981                    }
1982                    0x2c1cc13f4874956 => {
1983                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1984                        let mut req = fidl::new_empty!(
1985                            fidl::encoding::EmptyPayload,
1986                            fidl::encoding::DefaultFuchsiaResourceDialect
1987                        );
1988                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1989                        let control_handle = StateControlHandle { inner: this.inner.clone() };
1990                        Ok(StateRequest::GetIp {
1991                            responder: StateGetIpResponder {
1992                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1993                                tx_id: header.tx_id,
1994                            },
1995                        })
1996                    }
1997                    0x5713a85352e43887 => {
1998                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1999                        let mut req = fidl::new_empty!(
2000                            fidl::encoding::EmptyPayload,
2001                            fidl::encoding::DefaultFuchsiaResourceDialect
2002                        );
2003                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2004                        let control_handle = StateControlHandle { inner: this.inner.clone() };
2005                        Ok(StateRequest::GetDevice {
2006                            responder: StateGetDeviceResponder {
2007                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2008                                tx_id: header.tx_id,
2009                            },
2010                        })
2011                    }
2012                    _ => Err(fidl::Error::UnknownOrdinal {
2013                        ordinal: header.ordinal,
2014                        protocol_name: <StateMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2015                    }),
2016                }))
2017            },
2018        )
2019    }
2020}
2021
2022/// Provides read access to the network stack namespace-wide settings.
2023#[derive(Debug)]
2024pub enum StateRequest {
2025    /// Returns the current default settings for interfaces.
2026    GetInterfaceDefaults { responder: StateGetInterfaceDefaultsResponder },
2027    /// Returns the current TCP settings values.
2028    GetTcp { responder: StateGetTcpResponder },
2029    /// Returns the current UDP settings values.
2030    GetUdp { responder: StateGetUdpResponder },
2031    /// Returns the current ICMP settings values.
2032    GetIcmp { responder: StateGetIcmpResponder },
2033    /// Returns the current IP settings values.
2034    GetIp { responder: StateGetIpResponder },
2035    /// Returns the current device layer settings values.
2036    GetDevice { responder: StateGetDeviceResponder },
2037}
2038
2039impl StateRequest {
2040    #[allow(irrefutable_let_patterns)]
2041    pub fn into_get_interface_defaults(self) -> Option<(StateGetInterfaceDefaultsResponder)> {
2042        if let StateRequest::GetInterfaceDefaults { responder } = self {
2043            Some((responder))
2044        } else {
2045            None
2046        }
2047    }
2048
2049    #[allow(irrefutable_let_patterns)]
2050    pub fn into_get_tcp(self) -> Option<(StateGetTcpResponder)> {
2051        if let StateRequest::GetTcp { responder } = self { Some((responder)) } else { None }
2052    }
2053
2054    #[allow(irrefutable_let_patterns)]
2055    pub fn into_get_udp(self) -> Option<(StateGetUdpResponder)> {
2056        if let StateRequest::GetUdp { responder } = self { Some((responder)) } else { None }
2057    }
2058
2059    #[allow(irrefutable_let_patterns)]
2060    pub fn into_get_icmp(self) -> Option<(StateGetIcmpResponder)> {
2061        if let StateRequest::GetIcmp { responder } = self { Some((responder)) } else { None }
2062    }
2063
2064    #[allow(irrefutable_let_patterns)]
2065    pub fn into_get_ip(self) -> Option<(StateGetIpResponder)> {
2066        if let StateRequest::GetIp { responder } = self { Some((responder)) } else { None }
2067    }
2068
2069    #[allow(irrefutable_let_patterns)]
2070    pub fn into_get_device(self) -> Option<(StateGetDeviceResponder)> {
2071        if let StateRequest::GetDevice { responder } = self { Some((responder)) } else { None }
2072    }
2073
2074    /// Name of the method defined in FIDL
2075    pub fn method_name(&self) -> &'static str {
2076        match *self {
2077            StateRequest::GetInterfaceDefaults { .. } => "get_interface_defaults",
2078            StateRequest::GetTcp { .. } => "get_tcp",
2079            StateRequest::GetUdp { .. } => "get_udp",
2080            StateRequest::GetIcmp { .. } => "get_icmp",
2081            StateRequest::GetIp { .. } => "get_ip",
2082            StateRequest::GetDevice { .. } => "get_device",
2083        }
2084    }
2085}
2086
2087#[derive(Debug, Clone)]
2088pub struct StateControlHandle {
2089    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2090}
2091
2092impl fidl::endpoints::ControlHandle for StateControlHandle {
2093    fn shutdown(&self) {
2094        self.inner.shutdown()
2095    }
2096
2097    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2098        self.inner.shutdown_with_epitaph(status)
2099    }
2100
2101    fn is_closed(&self) -> bool {
2102        self.inner.channel().is_closed()
2103    }
2104    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2105        self.inner.channel().on_closed()
2106    }
2107
2108    #[cfg(target_os = "fuchsia")]
2109    fn signal_peer(
2110        &self,
2111        clear_mask: zx::Signals,
2112        set_mask: zx::Signals,
2113    ) -> Result<(), zx_status::Status> {
2114        use fidl::Peered;
2115        self.inner.channel().signal_peer(clear_mask, set_mask)
2116    }
2117}
2118
2119impl StateControlHandle {}
2120
2121#[must_use = "FIDL methods require a response to be sent"]
2122#[derive(Debug)]
2123pub struct StateGetInterfaceDefaultsResponder {
2124    control_handle: std::mem::ManuallyDrop<StateControlHandle>,
2125    tx_id: u32,
2126}
2127
2128/// Set the the channel to be shutdown (see [`StateControlHandle::shutdown`])
2129/// if the responder is dropped without sending a response, so that the client
2130/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2131impl std::ops::Drop for StateGetInterfaceDefaultsResponder {
2132    fn drop(&mut self) {
2133        self.control_handle.shutdown();
2134        // Safety: drops once, never accessed again
2135        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2136    }
2137}
2138
2139impl fidl::endpoints::Responder for StateGetInterfaceDefaultsResponder {
2140    type ControlHandle = StateControlHandle;
2141
2142    fn control_handle(&self) -> &StateControlHandle {
2143        &self.control_handle
2144    }
2145
2146    fn drop_without_shutdown(mut self) {
2147        // Safety: drops once, never accessed again due to mem::forget
2148        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2149        // Prevent Drop from running (which would shut down the channel)
2150        std::mem::forget(self);
2151    }
2152}
2153
2154impl StateGetInterfaceDefaultsResponder {
2155    /// Sends a response to the FIDL transaction.
2156    ///
2157    /// Sets the channel to shutdown if an error occurs.
2158    pub fn send(
2159        self,
2160        mut payload: &fidl_fuchsia_net_interfaces_admin::Configuration,
2161    ) -> Result<(), fidl::Error> {
2162        let _result = self.send_raw(payload);
2163        if _result.is_err() {
2164            self.control_handle.shutdown();
2165        }
2166        self.drop_without_shutdown();
2167        _result
2168    }
2169
2170    /// Similar to "send" but does not shutdown the channel if an error occurs.
2171    pub fn send_no_shutdown_on_err(
2172        self,
2173        mut payload: &fidl_fuchsia_net_interfaces_admin::Configuration,
2174    ) -> Result<(), fidl::Error> {
2175        let _result = self.send_raw(payload);
2176        self.drop_without_shutdown();
2177        _result
2178    }
2179
2180    fn send_raw(
2181        &self,
2182        mut payload: &fidl_fuchsia_net_interfaces_admin::Configuration,
2183    ) -> Result<(), fidl::Error> {
2184        self.control_handle.inner.send::<fidl_fuchsia_net_interfaces_admin::Configuration>(
2185            payload,
2186            self.tx_id,
2187            0x4c4824a322a705e3,
2188            fidl::encoding::DynamicFlags::empty(),
2189        )
2190    }
2191}
2192
2193#[must_use = "FIDL methods require a response to be sent"]
2194#[derive(Debug)]
2195pub struct StateGetTcpResponder {
2196    control_handle: std::mem::ManuallyDrop<StateControlHandle>,
2197    tx_id: u32,
2198}
2199
2200/// Set the the channel to be shutdown (see [`StateControlHandle::shutdown`])
2201/// if the responder is dropped without sending a response, so that the client
2202/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2203impl std::ops::Drop for StateGetTcpResponder {
2204    fn drop(&mut self) {
2205        self.control_handle.shutdown();
2206        // Safety: drops once, never accessed again
2207        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2208    }
2209}
2210
2211impl fidl::endpoints::Responder for StateGetTcpResponder {
2212    type ControlHandle = StateControlHandle;
2213
2214    fn control_handle(&self) -> &StateControlHandle {
2215        &self.control_handle
2216    }
2217
2218    fn drop_without_shutdown(mut self) {
2219        // Safety: drops once, never accessed again due to mem::forget
2220        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2221        // Prevent Drop from running (which would shut down the channel)
2222        std::mem::forget(self);
2223    }
2224}
2225
2226impl StateGetTcpResponder {
2227    /// Sends a response to the FIDL transaction.
2228    ///
2229    /// Sets the channel to shutdown if an error occurs.
2230    pub fn send(self, mut payload: &Tcp) -> Result<(), fidl::Error> {
2231        let _result = self.send_raw(payload);
2232        if _result.is_err() {
2233            self.control_handle.shutdown();
2234        }
2235        self.drop_without_shutdown();
2236        _result
2237    }
2238
2239    /// Similar to "send" but does not shutdown the channel if an error occurs.
2240    pub fn send_no_shutdown_on_err(self, mut payload: &Tcp) -> Result<(), fidl::Error> {
2241        let _result = self.send_raw(payload);
2242        self.drop_without_shutdown();
2243        _result
2244    }
2245
2246    fn send_raw(&self, mut payload: &Tcp) -> Result<(), fidl::Error> {
2247        self.control_handle.inner.send::<Tcp>(
2248            payload,
2249            self.tx_id,
2250            0x4e818d8a89985b70,
2251            fidl::encoding::DynamicFlags::empty(),
2252        )
2253    }
2254}
2255
2256#[must_use = "FIDL methods require a response to be sent"]
2257#[derive(Debug)]
2258pub struct StateGetUdpResponder {
2259    control_handle: std::mem::ManuallyDrop<StateControlHandle>,
2260    tx_id: u32,
2261}
2262
2263/// Set the the channel to be shutdown (see [`StateControlHandle::shutdown`])
2264/// if the responder is dropped without sending a response, so that the client
2265/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2266impl std::ops::Drop for StateGetUdpResponder {
2267    fn drop(&mut self) {
2268        self.control_handle.shutdown();
2269        // Safety: drops once, never accessed again
2270        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2271    }
2272}
2273
2274impl fidl::endpoints::Responder for StateGetUdpResponder {
2275    type ControlHandle = StateControlHandle;
2276
2277    fn control_handle(&self) -> &StateControlHandle {
2278        &self.control_handle
2279    }
2280
2281    fn drop_without_shutdown(mut self) {
2282        // Safety: drops once, never accessed again due to mem::forget
2283        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2284        // Prevent Drop from running (which would shut down the channel)
2285        std::mem::forget(self);
2286    }
2287}
2288
2289impl StateGetUdpResponder {
2290    /// Sends a response to the FIDL transaction.
2291    ///
2292    /// Sets the channel to shutdown if an error occurs.
2293    pub fn send(self, mut payload: &Udp) -> Result<(), fidl::Error> {
2294        let _result = self.send_raw(payload);
2295        if _result.is_err() {
2296            self.control_handle.shutdown();
2297        }
2298        self.drop_without_shutdown();
2299        _result
2300    }
2301
2302    /// Similar to "send" but does not shutdown the channel if an error occurs.
2303    pub fn send_no_shutdown_on_err(self, mut payload: &Udp) -> Result<(), fidl::Error> {
2304        let _result = self.send_raw(payload);
2305        self.drop_without_shutdown();
2306        _result
2307    }
2308
2309    fn send_raw(&self, mut payload: &Udp) -> Result<(), fidl::Error> {
2310        self.control_handle.inner.send::<Udp>(
2311            payload,
2312            self.tx_id,
2313            0x1af3bc1507b7a196,
2314            fidl::encoding::DynamicFlags::empty(),
2315        )
2316    }
2317}
2318
2319#[must_use = "FIDL methods require a response to be sent"]
2320#[derive(Debug)]
2321pub struct StateGetIcmpResponder {
2322    control_handle: std::mem::ManuallyDrop<StateControlHandle>,
2323    tx_id: u32,
2324}
2325
2326/// Set the the channel to be shutdown (see [`StateControlHandle::shutdown`])
2327/// if the responder is dropped without sending a response, so that the client
2328/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2329impl std::ops::Drop for StateGetIcmpResponder {
2330    fn drop(&mut self) {
2331        self.control_handle.shutdown();
2332        // Safety: drops once, never accessed again
2333        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2334    }
2335}
2336
2337impl fidl::endpoints::Responder for StateGetIcmpResponder {
2338    type ControlHandle = StateControlHandle;
2339
2340    fn control_handle(&self) -> &StateControlHandle {
2341        &self.control_handle
2342    }
2343
2344    fn drop_without_shutdown(mut self) {
2345        // Safety: drops once, never accessed again due to mem::forget
2346        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2347        // Prevent Drop from running (which would shut down the channel)
2348        std::mem::forget(self);
2349    }
2350}
2351
2352impl StateGetIcmpResponder {
2353    /// Sends a response to the FIDL transaction.
2354    ///
2355    /// Sets the channel to shutdown if an error occurs.
2356    pub fn send(self, mut payload: &Icmp) -> Result<(), fidl::Error> {
2357        let _result = self.send_raw(payload);
2358        if _result.is_err() {
2359            self.control_handle.shutdown();
2360        }
2361        self.drop_without_shutdown();
2362        _result
2363    }
2364
2365    /// Similar to "send" but does not shutdown the channel if an error occurs.
2366    pub fn send_no_shutdown_on_err(self, mut payload: &Icmp) -> Result<(), fidl::Error> {
2367        let _result = self.send_raw(payload);
2368        self.drop_without_shutdown();
2369        _result
2370    }
2371
2372    fn send_raw(&self, mut payload: &Icmp) -> Result<(), fidl::Error> {
2373        self.control_handle.inner.send::<Icmp>(
2374            payload,
2375            self.tx_id,
2376            0x4079fd71ca65e33f,
2377            fidl::encoding::DynamicFlags::empty(),
2378        )
2379    }
2380}
2381
2382#[must_use = "FIDL methods require a response to be sent"]
2383#[derive(Debug)]
2384pub struct StateGetIpResponder {
2385    control_handle: std::mem::ManuallyDrop<StateControlHandle>,
2386    tx_id: u32,
2387}
2388
2389/// Set the the channel to be shutdown (see [`StateControlHandle::shutdown`])
2390/// if the responder is dropped without sending a response, so that the client
2391/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2392impl std::ops::Drop for StateGetIpResponder {
2393    fn drop(&mut self) {
2394        self.control_handle.shutdown();
2395        // Safety: drops once, never accessed again
2396        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2397    }
2398}
2399
2400impl fidl::endpoints::Responder for StateGetIpResponder {
2401    type ControlHandle = StateControlHandle;
2402
2403    fn control_handle(&self) -> &StateControlHandle {
2404        &self.control_handle
2405    }
2406
2407    fn drop_without_shutdown(mut self) {
2408        // Safety: drops once, never accessed again due to mem::forget
2409        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2410        // Prevent Drop from running (which would shut down the channel)
2411        std::mem::forget(self);
2412    }
2413}
2414
2415impl StateGetIpResponder {
2416    /// Sends a response to the FIDL transaction.
2417    ///
2418    /// Sets the channel to shutdown if an error occurs.
2419    pub fn send(self, mut payload: &Ip) -> Result<(), fidl::Error> {
2420        let _result = self.send_raw(payload);
2421        if _result.is_err() {
2422            self.control_handle.shutdown();
2423        }
2424        self.drop_without_shutdown();
2425        _result
2426    }
2427
2428    /// Similar to "send" but does not shutdown the channel if an error occurs.
2429    pub fn send_no_shutdown_on_err(self, mut payload: &Ip) -> Result<(), fidl::Error> {
2430        let _result = self.send_raw(payload);
2431        self.drop_without_shutdown();
2432        _result
2433    }
2434
2435    fn send_raw(&self, mut payload: &Ip) -> Result<(), fidl::Error> {
2436        self.control_handle.inner.send::<Ip>(
2437            payload,
2438            self.tx_id,
2439            0x2c1cc13f4874956,
2440            fidl::encoding::DynamicFlags::empty(),
2441        )
2442    }
2443}
2444
2445#[must_use = "FIDL methods require a response to be sent"]
2446#[derive(Debug)]
2447pub struct StateGetDeviceResponder {
2448    control_handle: std::mem::ManuallyDrop<StateControlHandle>,
2449    tx_id: u32,
2450}
2451
2452/// Set the the channel to be shutdown (see [`StateControlHandle::shutdown`])
2453/// if the responder is dropped without sending a response, so that the client
2454/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2455impl std::ops::Drop for StateGetDeviceResponder {
2456    fn drop(&mut self) {
2457        self.control_handle.shutdown();
2458        // Safety: drops once, never accessed again
2459        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2460    }
2461}
2462
2463impl fidl::endpoints::Responder for StateGetDeviceResponder {
2464    type ControlHandle = StateControlHandle;
2465
2466    fn control_handle(&self) -> &StateControlHandle {
2467        &self.control_handle
2468    }
2469
2470    fn drop_without_shutdown(mut self) {
2471        // Safety: drops once, never accessed again due to mem::forget
2472        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2473        // Prevent Drop from running (which would shut down the channel)
2474        std::mem::forget(self);
2475    }
2476}
2477
2478impl StateGetDeviceResponder {
2479    /// Sends a response to the FIDL transaction.
2480    ///
2481    /// Sets the channel to shutdown if an error occurs.
2482    pub fn send(self, mut payload: &Device) -> Result<(), fidl::Error> {
2483        let _result = self.send_raw(payload);
2484        if _result.is_err() {
2485            self.control_handle.shutdown();
2486        }
2487        self.drop_without_shutdown();
2488        _result
2489    }
2490
2491    /// Similar to "send" but does not shutdown the channel if an error occurs.
2492    pub fn send_no_shutdown_on_err(self, mut payload: &Device) -> Result<(), fidl::Error> {
2493        let _result = self.send_raw(payload);
2494        self.drop_without_shutdown();
2495        _result
2496    }
2497
2498    fn send_raw(&self, mut payload: &Device) -> Result<(), fidl::Error> {
2499        self.control_handle.inner.send::<Device>(
2500            payload,
2501            self.tx_id,
2502            0x5713a85352e43887,
2503            fidl::encoding::DynamicFlags::empty(),
2504        )
2505    }
2506}
2507
2508mod internal {
2509    use super::*;
2510}