fidl_fuchsia_net_dhcp/
fidl_fuchsia_net_dhcp.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_dhcp__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct ClientProviderNewClientRequest {
16    /// The ID of the interface the client runs on.
17    pub interface_id: u64,
18    /// The parameters with which to create the DHCP client.
19    /// If `configuration_to_request` is unset and `request_ip_address` is
20    /// false, `request` is closed with terminal event `INVALID_PARAMS`.
21    pub params: NewClientParams,
22    pub request: fidl::endpoints::ServerEnd<ClientMarker>,
23}
24
25impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
26    for ClientProviderNewClientRequest
27{
28}
29
30#[derive(Debug, Default, PartialEq)]
31pub struct Address {
32    /// The assigned address and prefix length.
33    pub address: Option<fidl_fuchsia_net::Ipv4AddressWithPrefix>,
34    /// The parameters of the address.
35    pub address_parameters: Option<fidl_fuchsia_net_interfaces_admin::AddressParameters>,
36    /// Provides address assignment state and enables updating address
37    /// properties; the DHCP client closes the client end if the address
38    /// becomes invalid (its valid lifetime expires and Renew and Rebind
39    /// have not succeeded).
40    /// The server end can be closed with a terminal OnAddressRemoved
41    /// value in order to signal to the DHCP client that an address is
42    /// rejected (e.g. due to failing duplicate address detection).
43    pub address_state_provider: Option<
44        fidl::endpoints::ServerEnd<fidl_fuchsia_net_interfaces_admin::AddressStateProviderMarker>,
45    >,
46    #[doc(hidden)]
47    pub __source_breaking: fidl::marker::SourceBreaking,
48}
49
50impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Address {}
51
52#[derive(Debug, Default, PartialEq)]
53pub struct ClientWatchConfigurationResponse {
54    pub address: Option<Address>,
55    pub dns_servers: Option<Vec<fidl_fuchsia_net::Ipv4Address>>,
56    pub routers: Option<Vec<fidl_fuchsia_net::Ipv4Address>>,
57    #[doc(hidden)]
58    pub __source_breaking: fidl::marker::SourceBreaking,
59}
60
61impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
62    for ClientWatchConfigurationResponse
63{
64}
65
66#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
67pub struct ClientMarker;
68
69impl fidl::endpoints::ProtocolMarker for ClientMarker {
70    type Proxy = ClientProxy;
71    type RequestStream = ClientRequestStream;
72    #[cfg(target_os = "fuchsia")]
73    type SynchronousProxy = ClientSynchronousProxy;
74
75    const DEBUG_NAME: &'static str = "(anonymous) Client";
76}
77
78pub trait ClientProxyInterface: Send + Sync {
79    type WatchConfigurationResponseFut: std::future::Future<Output = Result<ClientWatchConfigurationResponse, fidl::Error>>
80        + Send;
81    fn r#watch_configuration(&self) -> Self::WatchConfigurationResponseFut;
82    fn r#shutdown(&self) -> Result<(), fidl::Error>;
83}
84#[derive(Debug)]
85#[cfg(target_os = "fuchsia")]
86pub struct ClientSynchronousProxy {
87    client: fidl::client::sync::Client,
88}
89
90#[cfg(target_os = "fuchsia")]
91impl fidl::endpoints::SynchronousProxy for ClientSynchronousProxy {
92    type Proxy = ClientProxy;
93    type Protocol = ClientMarker;
94
95    fn from_channel(inner: fidl::Channel) -> Self {
96        Self::new(inner)
97    }
98
99    fn into_channel(self) -> fidl::Channel {
100        self.client.into_channel()
101    }
102
103    fn as_channel(&self) -> &fidl::Channel {
104        self.client.as_channel()
105    }
106}
107
108#[cfg(target_os = "fuchsia")]
109impl ClientSynchronousProxy {
110    pub fn new(channel: fidl::Channel) -> Self {
111        let protocol_name = <ClientMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
112        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
113    }
114
115    pub fn into_channel(self) -> fidl::Channel {
116        self.client.into_channel()
117    }
118
119    /// Waits until an event arrives and returns it. It is safe for other
120    /// threads to make concurrent requests while waiting for an event.
121    pub fn wait_for_event(
122        &self,
123        deadline: zx::MonotonicInstant,
124    ) -> Result<ClientEvent, fidl::Error> {
125        ClientEvent::decode(self.client.wait_for_event(deadline)?)
126    }
127
128    /// Returns acquired DHCP configuration.
129    ///
130    /// Yields a value whenever the client acquires new configuration. Notably,
131    /// does not yield a value upon DHCP lease expiry; instead, expiry of the IP
132    /// address is communicated via the `AddressStateProvider` (refer to
133    /// documentation of `fuchsia.net.interfaces.admin/AddressStateProvider` for
134    /// details). Non-address configuration does not expire, but is replaced by
135    /// new configuration once a new DHCP lease is obtained.
136    ///
137    /// It is invalid to call this method while a previous call is pending.
138    /// Doing so causes the server end of the protocol to be closed.
139    ///
140    /// - response `address` the assigned address. If set, the client has
141    ///     acquired a new lease on an IP address. If not set, then either the
142    ///     client has not requested an IP address (in which case this `Client`
143    ///     instance has never yielded an address), or the client continues to
144    ///     hold a lease on a previously-acquired IP address (whose lifetime is
145    ///     updated via `AddressStateProvider`).
146    /// - response `dns_servers` addresses of discovered DNS servers. If absent,
147    ///     must be interpreted as empty (the client's configuration indicates
148    ///     no DNS servers, even if previously-yielded configuration included
149    ///     DNS servers).
150    /// - response `routers` addresses of discovered routers on the client's
151    ///     subnet, in descending order of preference according to the DHCP
152    ///     server. If absent, must be interpreted as empty (the client's
153    ///     configuration indicates no routers, even if previously-yielded
154    ///     configuration included routers).
155    pub fn r#watch_configuration(
156        &self,
157        ___deadline: zx::MonotonicInstant,
158    ) -> Result<ClientWatchConfigurationResponse, fidl::Error> {
159        let _response = self
160            .client
161            .send_query::<fidl::encoding::EmptyPayload, ClientWatchConfigurationResponse>(
162                (),
163                0x2b6f7c7d3bcc6682,
164                fidl::encoding::DynamicFlags::empty(),
165                ___deadline,
166            )?;
167        Ok(_response)
168    }
169
170    /// Instructs the client to shut down gracefully (releasing any DHCP lease
171    /// currently held). When the client is finished shutting down, it yields
172    /// the `ClientExitReason::GRACEFUL_SHUTDOWN` `OnExit` event.
173    pub fn r#shutdown(&self) -> Result<(), fidl::Error> {
174        self.client.send::<fidl::encoding::EmptyPayload>(
175            (),
176            0x265a3213e9a8abde,
177            fidl::encoding::DynamicFlags::empty(),
178        )
179    }
180}
181
182#[cfg(target_os = "fuchsia")]
183impl From<ClientSynchronousProxy> for zx::NullableHandle {
184    fn from(value: ClientSynchronousProxy) -> Self {
185        value.into_channel().into()
186    }
187}
188
189#[cfg(target_os = "fuchsia")]
190impl From<fidl::Channel> for ClientSynchronousProxy {
191    fn from(value: fidl::Channel) -> Self {
192        Self::new(value)
193    }
194}
195
196#[cfg(target_os = "fuchsia")]
197impl fidl::endpoints::FromClient for ClientSynchronousProxy {
198    type Protocol = ClientMarker;
199
200    fn from_client(value: fidl::endpoints::ClientEnd<ClientMarker>) -> Self {
201        Self::new(value.into_channel())
202    }
203}
204
205#[derive(Debug, Clone)]
206pub struct ClientProxy {
207    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
208}
209
210impl fidl::endpoints::Proxy for ClientProxy {
211    type Protocol = ClientMarker;
212
213    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
214        Self::new(inner)
215    }
216
217    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
218        self.client.into_channel().map_err(|client| Self { client })
219    }
220
221    fn as_channel(&self) -> &::fidl::AsyncChannel {
222        self.client.as_channel()
223    }
224}
225
226impl ClientProxy {
227    /// Create a new Proxy for fuchsia.net.dhcp/Client.
228    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
229        let protocol_name = <ClientMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
230        Self { client: fidl::client::Client::new(channel, protocol_name) }
231    }
232
233    /// Get a Stream of events from the remote end of the protocol.
234    ///
235    /// # Panics
236    ///
237    /// Panics if the event stream was already taken.
238    pub fn take_event_stream(&self) -> ClientEventStream {
239        ClientEventStream { event_receiver: self.client.take_event_receiver() }
240    }
241
242    /// Returns acquired DHCP configuration.
243    ///
244    /// Yields a value whenever the client acquires new configuration. Notably,
245    /// does not yield a value upon DHCP lease expiry; instead, expiry of the IP
246    /// address is communicated via the `AddressStateProvider` (refer to
247    /// documentation of `fuchsia.net.interfaces.admin/AddressStateProvider` for
248    /// details). Non-address configuration does not expire, but is replaced by
249    /// new configuration once a new DHCP lease is obtained.
250    ///
251    /// It is invalid to call this method while a previous call is pending.
252    /// Doing so causes the server end of the protocol to be closed.
253    ///
254    /// - response `address` the assigned address. If set, the client has
255    ///     acquired a new lease on an IP address. If not set, then either the
256    ///     client has not requested an IP address (in which case this `Client`
257    ///     instance has never yielded an address), or the client continues to
258    ///     hold a lease on a previously-acquired IP address (whose lifetime is
259    ///     updated via `AddressStateProvider`).
260    /// - response `dns_servers` addresses of discovered DNS servers. If absent,
261    ///     must be interpreted as empty (the client's configuration indicates
262    ///     no DNS servers, even if previously-yielded configuration included
263    ///     DNS servers).
264    /// - response `routers` addresses of discovered routers on the client's
265    ///     subnet, in descending order of preference according to the DHCP
266    ///     server. If absent, must be interpreted as empty (the client's
267    ///     configuration indicates no routers, even if previously-yielded
268    ///     configuration included routers).
269    pub fn r#watch_configuration(
270        &self,
271    ) -> fidl::client::QueryResponseFut<
272        ClientWatchConfigurationResponse,
273        fidl::encoding::DefaultFuchsiaResourceDialect,
274    > {
275        ClientProxyInterface::r#watch_configuration(self)
276    }
277
278    /// Instructs the client to shut down gracefully (releasing any DHCP lease
279    /// currently held). When the client is finished shutting down, it yields
280    /// the `ClientExitReason::GRACEFUL_SHUTDOWN` `OnExit` event.
281    pub fn r#shutdown(&self) -> Result<(), fidl::Error> {
282        ClientProxyInterface::r#shutdown(self)
283    }
284}
285
286impl ClientProxyInterface for ClientProxy {
287    type WatchConfigurationResponseFut = fidl::client::QueryResponseFut<
288        ClientWatchConfigurationResponse,
289        fidl::encoding::DefaultFuchsiaResourceDialect,
290    >;
291    fn r#watch_configuration(&self) -> Self::WatchConfigurationResponseFut {
292        fn _decode(
293            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
294        ) -> Result<ClientWatchConfigurationResponse, fidl::Error> {
295            let _response = fidl::client::decode_transaction_body::<
296                ClientWatchConfigurationResponse,
297                fidl::encoding::DefaultFuchsiaResourceDialect,
298                0x2b6f7c7d3bcc6682,
299            >(_buf?)?;
300            Ok(_response)
301        }
302        self.client.send_query_and_decode::<
303            fidl::encoding::EmptyPayload,
304            ClientWatchConfigurationResponse,
305        >(
306            (),
307            0x2b6f7c7d3bcc6682,
308            fidl::encoding::DynamicFlags::empty(),
309            _decode,
310        )
311    }
312
313    fn r#shutdown(&self) -> Result<(), fidl::Error> {
314        self.client.send::<fidl::encoding::EmptyPayload>(
315            (),
316            0x265a3213e9a8abde,
317            fidl::encoding::DynamicFlags::empty(),
318        )
319    }
320}
321
322pub struct ClientEventStream {
323    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
324}
325
326impl std::marker::Unpin for ClientEventStream {}
327
328impl futures::stream::FusedStream for ClientEventStream {
329    fn is_terminated(&self) -> bool {
330        self.event_receiver.is_terminated()
331    }
332}
333
334impl futures::Stream for ClientEventStream {
335    type Item = Result<ClientEvent, fidl::Error>;
336
337    fn poll_next(
338        mut self: std::pin::Pin<&mut Self>,
339        cx: &mut std::task::Context<'_>,
340    ) -> std::task::Poll<Option<Self::Item>> {
341        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
342            &mut self.event_receiver,
343            cx
344        )?) {
345            Some(buf) => std::task::Poll::Ready(Some(ClientEvent::decode(buf))),
346            None => std::task::Poll::Ready(None),
347        }
348    }
349}
350
351#[derive(Debug)]
352pub enum ClientEvent {
353    OnExit { reason: ClientExitReason },
354}
355
356impl ClientEvent {
357    #[allow(irrefutable_let_patterns)]
358    pub fn into_on_exit(self) -> Option<ClientExitReason> {
359        if let ClientEvent::OnExit { reason } = self { Some((reason)) } else { None }
360    }
361
362    /// Decodes a message buffer as a [`ClientEvent`].
363    fn decode(
364        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
365    ) -> Result<ClientEvent, fidl::Error> {
366        let (bytes, _handles) = buf.split_mut();
367        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
368        debug_assert_eq!(tx_header.tx_id, 0);
369        match tx_header.ordinal {
370            0x2a2a052260f657c0 => {
371                let mut out = fidl::new_empty!(
372                    ClientOnExitRequest,
373                    fidl::encoding::DefaultFuchsiaResourceDialect
374                );
375                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientOnExitRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
376                Ok((ClientEvent::OnExit { reason: out.reason }))
377            }
378            _ => Err(fidl::Error::UnknownOrdinal {
379                ordinal: tx_header.ordinal,
380                protocol_name: <ClientMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
381            }),
382        }
383    }
384}
385
386/// A Stream of incoming requests for fuchsia.net.dhcp/Client.
387pub struct ClientRequestStream {
388    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
389    is_terminated: bool,
390}
391
392impl std::marker::Unpin for ClientRequestStream {}
393
394impl futures::stream::FusedStream for ClientRequestStream {
395    fn is_terminated(&self) -> bool {
396        self.is_terminated
397    }
398}
399
400impl fidl::endpoints::RequestStream for ClientRequestStream {
401    type Protocol = ClientMarker;
402    type ControlHandle = ClientControlHandle;
403
404    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
405        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
406    }
407
408    fn control_handle(&self) -> Self::ControlHandle {
409        ClientControlHandle { inner: self.inner.clone() }
410    }
411
412    fn into_inner(
413        self,
414    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
415    {
416        (self.inner, self.is_terminated)
417    }
418
419    fn from_inner(
420        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
421        is_terminated: bool,
422    ) -> Self {
423        Self { inner, is_terminated }
424    }
425}
426
427impl futures::Stream for ClientRequestStream {
428    type Item = Result<ClientRequest, fidl::Error>;
429
430    fn poll_next(
431        mut self: std::pin::Pin<&mut Self>,
432        cx: &mut std::task::Context<'_>,
433    ) -> std::task::Poll<Option<Self::Item>> {
434        let this = &mut *self;
435        if this.inner.check_shutdown(cx) {
436            this.is_terminated = true;
437            return std::task::Poll::Ready(None);
438        }
439        if this.is_terminated {
440            panic!("polled ClientRequestStream after completion");
441        }
442        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
443            |bytes, handles| {
444                match this.inner.channel().read_etc(cx, bytes, handles) {
445                    std::task::Poll::Ready(Ok(())) => {}
446                    std::task::Poll::Pending => return std::task::Poll::Pending,
447                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
448                        this.is_terminated = true;
449                        return std::task::Poll::Ready(None);
450                    }
451                    std::task::Poll::Ready(Err(e)) => {
452                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
453                            e.into(),
454                        ))));
455                    }
456                }
457
458                // A message has been received from the channel
459                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
460
461                std::task::Poll::Ready(Some(match header.ordinal {
462                    0x2b6f7c7d3bcc6682 => {
463                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
464                        let mut req = fidl::new_empty!(
465                            fidl::encoding::EmptyPayload,
466                            fidl::encoding::DefaultFuchsiaResourceDialect
467                        );
468                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
469                        let control_handle = ClientControlHandle { inner: this.inner.clone() };
470                        Ok(ClientRequest::WatchConfiguration {
471                            responder: ClientWatchConfigurationResponder {
472                                control_handle: std::mem::ManuallyDrop::new(control_handle),
473                                tx_id: header.tx_id,
474                            },
475                        })
476                    }
477                    0x265a3213e9a8abde => {
478                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
479                        let mut req = fidl::new_empty!(
480                            fidl::encoding::EmptyPayload,
481                            fidl::encoding::DefaultFuchsiaResourceDialect
482                        );
483                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
484                        let control_handle = ClientControlHandle { inner: this.inner.clone() };
485                        Ok(ClientRequest::Shutdown { control_handle })
486                    }
487                    _ => Err(fidl::Error::UnknownOrdinal {
488                        ordinal: header.ordinal,
489                        protocol_name:
490                            <ClientMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
491                    }),
492                }))
493            },
494        )
495    }
496}
497
498/// Provides methods to watch for discovered network configurations and control
499/// the DHCP client discovering them.
500///
501/// This protocol encodes the DHCP client's lifetime in both directions;
502/// the DHCP client remains alive iff both ends of the protocol are open. That
503/// is:
504///
505/// - Closing the client end causes the DHCP client to be destroyed.
506/// - Observing a closure of the server end indicates the DHCP client no longer
507///   exists.
508#[derive(Debug)]
509pub enum ClientRequest {
510    /// Returns acquired DHCP configuration.
511    ///
512    /// Yields a value whenever the client acquires new configuration. Notably,
513    /// does not yield a value upon DHCP lease expiry; instead, expiry of the IP
514    /// address is communicated via the `AddressStateProvider` (refer to
515    /// documentation of `fuchsia.net.interfaces.admin/AddressStateProvider` for
516    /// details). Non-address configuration does not expire, but is replaced by
517    /// new configuration once a new DHCP lease is obtained.
518    ///
519    /// It is invalid to call this method while a previous call is pending.
520    /// Doing so causes the server end of the protocol to be closed.
521    ///
522    /// - response `address` the assigned address. If set, the client has
523    ///     acquired a new lease on an IP address. If not set, then either the
524    ///     client has not requested an IP address (in which case this `Client`
525    ///     instance has never yielded an address), or the client continues to
526    ///     hold a lease on a previously-acquired IP address (whose lifetime is
527    ///     updated via `AddressStateProvider`).
528    /// - response `dns_servers` addresses of discovered DNS servers. If absent,
529    ///     must be interpreted as empty (the client's configuration indicates
530    ///     no DNS servers, even if previously-yielded configuration included
531    ///     DNS servers).
532    /// - response `routers` addresses of discovered routers on the client's
533    ///     subnet, in descending order of preference according to the DHCP
534    ///     server. If absent, must be interpreted as empty (the client's
535    ///     configuration indicates no routers, even if previously-yielded
536    ///     configuration included routers).
537    WatchConfiguration { responder: ClientWatchConfigurationResponder },
538    /// Instructs the client to shut down gracefully (releasing any DHCP lease
539    /// currently held). When the client is finished shutting down, it yields
540    /// the `ClientExitReason::GRACEFUL_SHUTDOWN` `OnExit` event.
541    Shutdown { control_handle: ClientControlHandle },
542}
543
544impl ClientRequest {
545    #[allow(irrefutable_let_patterns)]
546    pub fn into_watch_configuration(self) -> Option<(ClientWatchConfigurationResponder)> {
547        if let ClientRequest::WatchConfiguration { responder } = self {
548            Some((responder))
549        } else {
550            None
551        }
552    }
553
554    #[allow(irrefutable_let_patterns)]
555    pub fn into_shutdown(self) -> Option<(ClientControlHandle)> {
556        if let ClientRequest::Shutdown { control_handle } = self {
557            Some((control_handle))
558        } else {
559            None
560        }
561    }
562
563    /// Name of the method defined in FIDL
564    pub fn method_name(&self) -> &'static str {
565        match *self {
566            ClientRequest::WatchConfiguration { .. } => "watch_configuration",
567            ClientRequest::Shutdown { .. } => "shutdown",
568        }
569    }
570}
571
572#[derive(Debug, Clone)]
573pub struct ClientControlHandle {
574    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
575}
576
577impl fidl::endpoints::ControlHandle for ClientControlHandle {
578    fn shutdown(&self) {
579        self.inner.shutdown()
580    }
581
582    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
583        self.inner.shutdown_with_epitaph(status)
584    }
585
586    fn is_closed(&self) -> bool {
587        self.inner.channel().is_closed()
588    }
589    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
590        self.inner.channel().on_closed()
591    }
592
593    #[cfg(target_os = "fuchsia")]
594    fn signal_peer(
595        &self,
596        clear_mask: zx::Signals,
597        set_mask: zx::Signals,
598    ) -> Result<(), zx_status::Status> {
599        use fidl::Peered;
600        self.inner.channel().signal_peer(clear_mask, set_mask)
601    }
602}
603
604impl ClientControlHandle {
605    pub fn send_on_exit(&self, mut reason: ClientExitReason) -> Result<(), fidl::Error> {
606        self.inner.send::<ClientOnExitRequest>(
607            (reason,),
608            0,
609            0x2a2a052260f657c0,
610            fidl::encoding::DynamicFlags::empty(),
611        )
612    }
613}
614
615#[must_use = "FIDL methods require a response to be sent"]
616#[derive(Debug)]
617pub struct ClientWatchConfigurationResponder {
618    control_handle: std::mem::ManuallyDrop<ClientControlHandle>,
619    tx_id: u32,
620}
621
622/// Set the the channel to be shutdown (see [`ClientControlHandle::shutdown`])
623/// if the responder is dropped without sending a response, so that the client
624/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
625impl std::ops::Drop for ClientWatchConfigurationResponder {
626    fn drop(&mut self) {
627        self.control_handle.shutdown();
628        // Safety: drops once, never accessed again
629        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
630    }
631}
632
633impl fidl::endpoints::Responder for ClientWatchConfigurationResponder {
634    type ControlHandle = ClientControlHandle;
635
636    fn control_handle(&self) -> &ClientControlHandle {
637        &self.control_handle
638    }
639
640    fn drop_without_shutdown(mut self) {
641        // Safety: drops once, never accessed again due to mem::forget
642        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
643        // Prevent Drop from running (which would shut down the channel)
644        std::mem::forget(self);
645    }
646}
647
648impl ClientWatchConfigurationResponder {
649    /// Sends a response to the FIDL transaction.
650    ///
651    /// Sets the channel to shutdown if an error occurs.
652    pub fn send(self, mut payload: ClientWatchConfigurationResponse) -> Result<(), fidl::Error> {
653        let _result = self.send_raw(payload);
654        if _result.is_err() {
655            self.control_handle.shutdown();
656        }
657        self.drop_without_shutdown();
658        _result
659    }
660
661    /// Similar to "send" but does not shutdown the channel if an error occurs.
662    pub fn send_no_shutdown_on_err(
663        self,
664        mut payload: ClientWatchConfigurationResponse,
665    ) -> Result<(), fidl::Error> {
666        let _result = self.send_raw(payload);
667        self.drop_without_shutdown();
668        _result
669    }
670
671    fn send_raw(&self, mut payload: ClientWatchConfigurationResponse) -> Result<(), fidl::Error> {
672        self.control_handle.inner.send::<ClientWatchConfigurationResponse>(
673            &mut payload,
674            self.tx_id,
675            0x2b6f7c7d3bcc6682,
676            fidl::encoding::DynamicFlags::empty(),
677        )
678    }
679}
680
681#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
682pub struct ClientProviderMarker;
683
684impl fidl::endpoints::ProtocolMarker for ClientProviderMarker {
685    type Proxy = ClientProviderProxy;
686    type RequestStream = ClientProviderRequestStream;
687    #[cfg(target_os = "fuchsia")]
688    type SynchronousProxy = ClientProviderSynchronousProxy;
689
690    const DEBUG_NAME: &'static str = "fuchsia.net.dhcp.ClientProvider";
691}
692impl fidl::endpoints::DiscoverableProtocolMarker for ClientProviderMarker {}
693
694pub trait ClientProviderProxyInterface: Send + Sync {
695    fn r#new_client(
696        &self,
697        interface_id: u64,
698        params: &NewClientParams,
699        request: fidl::endpoints::ServerEnd<ClientMarker>,
700    ) -> Result<(), fidl::Error>;
701    type CheckPresenceResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
702    fn r#check_presence(&self) -> Self::CheckPresenceResponseFut;
703}
704#[derive(Debug)]
705#[cfg(target_os = "fuchsia")]
706pub struct ClientProviderSynchronousProxy {
707    client: fidl::client::sync::Client,
708}
709
710#[cfg(target_os = "fuchsia")]
711impl fidl::endpoints::SynchronousProxy for ClientProviderSynchronousProxy {
712    type Proxy = ClientProviderProxy;
713    type Protocol = ClientProviderMarker;
714
715    fn from_channel(inner: fidl::Channel) -> Self {
716        Self::new(inner)
717    }
718
719    fn into_channel(self) -> fidl::Channel {
720        self.client.into_channel()
721    }
722
723    fn as_channel(&self) -> &fidl::Channel {
724        self.client.as_channel()
725    }
726}
727
728#[cfg(target_os = "fuchsia")]
729impl ClientProviderSynchronousProxy {
730    pub fn new(channel: fidl::Channel) -> Self {
731        let protocol_name = <ClientProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
732        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
733    }
734
735    pub fn into_channel(self) -> fidl::Channel {
736        self.client.into_channel()
737    }
738
739    /// Waits until an event arrives and returns it. It is safe for other
740    /// threads to make concurrent requests while waiting for an event.
741    pub fn wait_for_event(
742        &self,
743        deadline: zx::MonotonicInstant,
744    ) -> Result<ClientProviderEvent, fidl::Error> {
745        ClientProviderEvent::decode(self.client.wait_for_event(deadline)?)
746    }
747
748    /// Provides a DHCPv4 client.
749    ///
750    /// + request `params` the parameters to create the client with.
751    /// + request `request` grants control over the client.
752    pub fn r#new_client(
753        &self,
754        mut interface_id: u64,
755        mut params: &NewClientParams,
756        mut request: fidl::endpoints::ServerEnd<ClientMarker>,
757    ) -> Result<(), fidl::Error> {
758        self.client.send::<ClientProviderNewClientRequest>(
759            (interface_id, params, request),
760            0x317e9af2e462cbcd,
761            fidl::encoding::DynamicFlags::empty(),
762        )
763    }
764
765    /// No-op method that allows checking for presence.
766    ///
767    /// TODO(https://fxbug.dev/296283299): It's not currently possible for a
768    /// client with an optionally-provided protocol to check whether there's
769    /// someone on the other end without making a FIDL call . This method
770    /// provides a workaround by giving a client a method that it can call to
771    /// check for liveness.
772    ///
773    /// TODO(https://fxbug.dev/42076541): Remove this once the DHCP out-of-stack
774    /// client is always being used.
775    pub fn r#check_presence(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
776        let _response =
777            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
778                (),
779                0x7ba657cd730bbf60,
780                fidl::encoding::DynamicFlags::empty(),
781                ___deadline,
782            )?;
783        Ok(_response)
784    }
785}
786
787#[cfg(target_os = "fuchsia")]
788impl From<ClientProviderSynchronousProxy> for zx::NullableHandle {
789    fn from(value: ClientProviderSynchronousProxy) -> Self {
790        value.into_channel().into()
791    }
792}
793
794#[cfg(target_os = "fuchsia")]
795impl From<fidl::Channel> for ClientProviderSynchronousProxy {
796    fn from(value: fidl::Channel) -> Self {
797        Self::new(value)
798    }
799}
800
801#[cfg(target_os = "fuchsia")]
802impl fidl::endpoints::FromClient for ClientProviderSynchronousProxy {
803    type Protocol = ClientProviderMarker;
804
805    fn from_client(value: fidl::endpoints::ClientEnd<ClientProviderMarker>) -> Self {
806        Self::new(value.into_channel())
807    }
808}
809
810#[derive(Debug, Clone)]
811pub struct ClientProviderProxy {
812    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
813}
814
815impl fidl::endpoints::Proxy for ClientProviderProxy {
816    type Protocol = ClientProviderMarker;
817
818    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
819        Self::new(inner)
820    }
821
822    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
823        self.client.into_channel().map_err(|client| Self { client })
824    }
825
826    fn as_channel(&self) -> &::fidl::AsyncChannel {
827        self.client.as_channel()
828    }
829}
830
831impl ClientProviderProxy {
832    /// Create a new Proxy for fuchsia.net.dhcp/ClientProvider.
833    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
834        let protocol_name = <ClientProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
835        Self { client: fidl::client::Client::new(channel, protocol_name) }
836    }
837
838    /// Get a Stream of events from the remote end of the protocol.
839    ///
840    /// # Panics
841    ///
842    /// Panics if the event stream was already taken.
843    pub fn take_event_stream(&self) -> ClientProviderEventStream {
844        ClientProviderEventStream { event_receiver: self.client.take_event_receiver() }
845    }
846
847    /// Provides a DHCPv4 client.
848    ///
849    /// + request `params` the parameters to create the client with.
850    /// + request `request` grants control over the client.
851    pub fn r#new_client(
852        &self,
853        mut interface_id: u64,
854        mut params: &NewClientParams,
855        mut request: fidl::endpoints::ServerEnd<ClientMarker>,
856    ) -> Result<(), fidl::Error> {
857        ClientProviderProxyInterface::r#new_client(self, interface_id, params, request)
858    }
859
860    /// No-op method that allows checking for presence.
861    ///
862    /// TODO(https://fxbug.dev/296283299): It's not currently possible for a
863    /// client with an optionally-provided protocol to check whether there's
864    /// someone on the other end without making a FIDL call . This method
865    /// provides a workaround by giving a client a method that it can call to
866    /// check for liveness.
867    ///
868    /// TODO(https://fxbug.dev/42076541): Remove this once the DHCP out-of-stack
869    /// client is always being used.
870    pub fn r#check_presence(
871        &self,
872    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
873        ClientProviderProxyInterface::r#check_presence(self)
874    }
875}
876
877impl ClientProviderProxyInterface for ClientProviderProxy {
878    fn r#new_client(
879        &self,
880        mut interface_id: u64,
881        mut params: &NewClientParams,
882        mut request: fidl::endpoints::ServerEnd<ClientMarker>,
883    ) -> Result<(), fidl::Error> {
884        self.client.send::<ClientProviderNewClientRequest>(
885            (interface_id, params, request),
886            0x317e9af2e462cbcd,
887            fidl::encoding::DynamicFlags::empty(),
888        )
889    }
890
891    type CheckPresenceResponseFut =
892        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
893    fn r#check_presence(&self) -> Self::CheckPresenceResponseFut {
894        fn _decode(
895            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
896        ) -> Result<(), fidl::Error> {
897            let _response = fidl::client::decode_transaction_body::<
898                fidl::encoding::EmptyPayload,
899                fidl::encoding::DefaultFuchsiaResourceDialect,
900                0x7ba657cd730bbf60,
901            >(_buf?)?;
902            Ok(_response)
903        }
904        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
905            (),
906            0x7ba657cd730bbf60,
907            fidl::encoding::DynamicFlags::empty(),
908            _decode,
909        )
910    }
911}
912
913pub struct ClientProviderEventStream {
914    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
915}
916
917impl std::marker::Unpin for ClientProviderEventStream {}
918
919impl futures::stream::FusedStream for ClientProviderEventStream {
920    fn is_terminated(&self) -> bool {
921        self.event_receiver.is_terminated()
922    }
923}
924
925impl futures::Stream for ClientProviderEventStream {
926    type Item = Result<ClientProviderEvent, fidl::Error>;
927
928    fn poll_next(
929        mut self: std::pin::Pin<&mut Self>,
930        cx: &mut std::task::Context<'_>,
931    ) -> std::task::Poll<Option<Self::Item>> {
932        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
933            &mut self.event_receiver,
934            cx
935        )?) {
936            Some(buf) => std::task::Poll::Ready(Some(ClientProviderEvent::decode(buf))),
937            None => std::task::Poll::Ready(None),
938        }
939    }
940}
941
942#[derive(Debug)]
943pub enum ClientProviderEvent {}
944
945impl ClientProviderEvent {
946    /// Decodes a message buffer as a [`ClientProviderEvent`].
947    fn decode(
948        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
949    ) -> Result<ClientProviderEvent, fidl::Error> {
950        let (bytes, _handles) = buf.split_mut();
951        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
952        debug_assert_eq!(tx_header.tx_id, 0);
953        match tx_header.ordinal {
954            _ => Err(fidl::Error::UnknownOrdinal {
955                ordinal: tx_header.ordinal,
956                protocol_name:
957                    <ClientProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
958            }),
959        }
960    }
961}
962
963/// A Stream of incoming requests for fuchsia.net.dhcp/ClientProvider.
964pub struct ClientProviderRequestStream {
965    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
966    is_terminated: bool,
967}
968
969impl std::marker::Unpin for ClientProviderRequestStream {}
970
971impl futures::stream::FusedStream for ClientProviderRequestStream {
972    fn is_terminated(&self) -> bool {
973        self.is_terminated
974    }
975}
976
977impl fidl::endpoints::RequestStream for ClientProviderRequestStream {
978    type Protocol = ClientProviderMarker;
979    type ControlHandle = ClientProviderControlHandle;
980
981    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
982        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
983    }
984
985    fn control_handle(&self) -> Self::ControlHandle {
986        ClientProviderControlHandle { inner: self.inner.clone() }
987    }
988
989    fn into_inner(
990        self,
991    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
992    {
993        (self.inner, self.is_terminated)
994    }
995
996    fn from_inner(
997        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
998        is_terminated: bool,
999    ) -> Self {
1000        Self { inner, is_terminated }
1001    }
1002}
1003
1004impl futures::Stream for ClientProviderRequestStream {
1005    type Item = Result<ClientProviderRequest, fidl::Error>;
1006
1007    fn poll_next(
1008        mut self: std::pin::Pin<&mut Self>,
1009        cx: &mut std::task::Context<'_>,
1010    ) -> std::task::Poll<Option<Self::Item>> {
1011        let this = &mut *self;
1012        if this.inner.check_shutdown(cx) {
1013            this.is_terminated = true;
1014            return std::task::Poll::Ready(None);
1015        }
1016        if this.is_terminated {
1017            panic!("polled ClientProviderRequestStream after completion");
1018        }
1019        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1020            |bytes, handles| {
1021                match this.inner.channel().read_etc(cx, bytes, handles) {
1022                    std::task::Poll::Ready(Ok(())) => {}
1023                    std::task::Poll::Pending => return std::task::Poll::Pending,
1024                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1025                        this.is_terminated = true;
1026                        return std::task::Poll::Ready(None);
1027                    }
1028                    std::task::Poll::Ready(Err(e)) => {
1029                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1030                            e.into(),
1031                        ))));
1032                    }
1033                }
1034
1035                // A message has been received from the channel
1036                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1037
1038                std::task::Poll::Ready(Some(match header.ordinal {
1039                    0x317e9af2e462cbcd => {
1040                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1041                        let mut req = fidl::new_empty!(
1042                            ClientProviderNewClientRequest,
1043                            fidl::encoding::DefaultFuchsiaResourceDialect
1044                        );
1045                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientProviderNewClientRequest>(&header, _body_bytes, handles, &mut req)?;
1046                        let control_handle =
1047                            ClientProviderControlHandle { inner: this.inner.clone() };
1048                        Ok(ClientProviderRequest::NewClient {
1049                            interface_id: req.interface_id,
1050                            params: req.params,
1051                            request: req.request,
1052
1053                            control_handle,
1054                        })
1055                    }
1056                    0x7ba657cd730bbf60 => {
1057                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1058                        let mut req = fidl::new_empty!(
1059                            fidl::encoding::EmptyPayload,
1060                            fidl::encoding::DefaultFuchsiaResourceDialect
1061                        );
1062                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1063                        let control_handle =
1064                            ClientProviderControlHandle { inner: this.inner.clone() };
1065                        Ok(ClientProviderRequest::CheckPresence {
1066                            responder: ClientProviderCheckPresenceResponder {
1067                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1068                                tx_id: header.tx_id,
1069                            },
1070                        })
1071                    }
1072                    _ => Err(fidl::Error::UnknownOrdinal {
1073                        ordinal: header.ordinal,
1074                        protocol_name:
1075                            <ClientProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1076                    }),
1077                }))
1078            },
1079        )
1080    }
1081}
1082
1083/// Provides a method to create new DHCP clients.
1084#[derive(Debug)]
1085pub enum ClientProviderRequest {
1086    /// Provides a DHCPv4 client.
1087    ///
1088    /// + request `params` the parameters to create the client with.
1089    /// + request `request` grants control over the client.
1090    NewClient {
1091        interface_id: u64,
1092        params: NewClientParams,
1093        request: fidl::endpoints::ServerEnd<ClientMarker>,
1094        control_handle: ClientProviderControlHandle,
1095    },
1096    /// No-op method that allows checking for presence.
1097    ///
1098    /// TODO(https://fxbug.dev/296283299): It's not currently possible for a
1099    /// client with an optionally-provided protocol to check whether there's
1100    /// someone on the other end without making a FIDL call . This method
1101    /// provides a workaround by giving a client a method that it can call to
1102    /// check for liveness.
1103    ///
1104    /// TODO(https://fxbug.dev/42076541): Remove this once the DHCP out-of-stack
1105    /// client is always being used.
1106    CheckPresence { responder: ClientProviderCheckPresenceResponder },
1107}
1108
1109impl ClientProviderRequest {
1110    #[allow(irrefutable_let_patterns)]
1111    pub fn into_new_client(
1112        self,
1113    ) -> Option<(
1114        u64,
1115        NewClientParams,
1116        fidl::endpoints::ServerEnd<ClientMarker>,
1117        ClientProviderControlHandle,
1118    )> {
1119        if let ClientProviderRequest::NewClient { interface_id, params, request, control_handle } =
1120            self
1121        {
1122            Some((interface_id, params, request, control_handle))
1123        } else {
1124            None
1125        }
1126    }
1127
1128    #[allow(irrefutable_let_patterns)]
1129    pub fn into_check_presence(self) -> Option<(ClientProviderCheckPresenceResponder)> {
1130        if let ClientProviderRequest::CheckPresence { responder } = self {
1131            Some((responder))
1132        } else {
1133            None
1134        }
1135    }
1136
1137    /// Name of the method defined in FIDL
1138    pub fn method_name(&self) -> &'static str {
1139        match *self {
1140            ClientProviderRequest::NewClient { .. } => "new_client",
1141            ClientProviderRequest::CheckPresence { .. } => "check_presence",
1142        }
1143    }
1144}
1145
1146#[derive(Debug, Clone)]
1147pub struct ClientProviderControlHandle {
1148    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1149}
1150
1151impl fidl::endpoints::ControlHandle for ClientProviderControlHandle {
1152    fn shutdown(&self) {
1153        self.inner.shutdown()
1154    }
1155
1156    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1157        self.inner.shutdown_with_epitaph(status)
1158    }
1159
1160    fn is_closed(&self) -> bool {
1161        self.inner.channel().is_closed()
1162    }
1163    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1164        self.inner.channel().on_closed()
1165    }
1166
1167    #[cfg(target_os = "fuchsia")]
1168    fn signal_peer(
1169        &self,
1170        clear_mask: zx::Signals,
1171        set_mask: zx::Signals,
1172    ) -> Result<(), zx_status::Status> {
1173        use fidl::Peered;
1174        self.inner.channel().signal_peer(clear_mask, set_mask)
1175    }
1176}
1177
1178impl ClientProviderControlHandle {}
1179
1180#[must_use = "FIDL methods require a response to be sent"]
1181#[derive(Debug)]
1182pub struct ClientProviderCheckPresenceResponder {
1183    control_handle: std::mem::ManuallyDrop<ClientProviderControlHandle>,
1184    tx_id: u32,
1185}
1186
1187/// Set the the channel to be shutdown (see [`ClientProviderControlHandle::shutdown`])
1188/// if the responder is dropped without sending a response, so that the client
1189/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1190impl std::ops::Drop for ClientProviderCheckPresenceResponder {
1191    fn drop(&mut self) {
1192        self.control_handle.shutdown();
1193        // Safety: drops once, never accessed again
1194        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1195    }
1196}
1197
1198impl fidl::endpoints::Responder for ClientProviderCheckPresenceResponder {
1199    type ControlHandle = ClientProviderControlHandle;
1200
1201    fn control_handle(&self) -> &ClientProviderControlHandle {
1202        &self.control_handle
1203    }
1204
1205    fn drop_without_shutdown(mut self) {
1206        // Safety: drops once, never accessed again due to mem::forget
1207        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1208        // Prevent Drop from running (which would shut down the channel)
1209        std::mem::forget(self);
1210    }
1211}
1212
1213impl ClientProviderCheckPresenceResponder {
1214    /// Sends a response to the FIDL transaction.
1215    ///
1216    /// Sets the channel to shutdown if an error occurs.
1217    pub fn send(self) -> Result<(), fidl::Error> {
1218        let _result = self.send_raw();
1219        if _result.is_err() {
1220            self.control_handle.shutdown();
1221        }
1222        self.drop_without_shutdown();
1223        _result
1224    }
1225
1226    /// Similar to "send" but does not shutdown the channel if an error occurs.
1227    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1228        let _result = self.send_raw();
1229        self.drop_without_shutdown();
1230        _result
1231    }
1232
1233    fn send_raw(&self) -> Result<(), fidl::Error> {
1234        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1235            (),
1236            self.tx_id,
1237            0x7ba657cd730bbf60,
1238            fidl::encoding::DynamicFlags::empty(),
1239        )
1240    }
1241}
1242
1243#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1244pub struct Server_Marker;
1245
1246impl fidl::endpoints::ProtocolMarker for Server_Marker {
1247    type Proxy = Server_Proxy;
1248    type RequestStream = Server_RequestStream;
1249    #[cfg(target_os = "fuchsia")]
1250    type SynchronousProxy = Server_SynchronousProxy;
1251
1252    const DEBUG_NAME: &'static str = "fuchsia.net.dhcp.Server";
1253}
1254impl fidl::endpoints::DiscoverableProtocolMarker for Server_Marker {}
1255pub type ServerStartServingResult = Result<(), i32>;
1256pub type ServerGetOptionResult = Result<Option_, i32>;
1257pub type ServerGetParameterResult = Result<Parameter, i32>;
1258pub type ServerSetOptionResult = Result<(), i32>;
1259pub type ServerSetParameterResult = Result<(), i32>;
1260pub type ServerListOptionsResult = Result<Vec<Option_>, i32>;
1261pub type ServerListParametersResult = Result<Vec<Parameter>, i32>;
1262pub type ServerResetOptionsResult = Result<(), i32>;
1263pub type ServerResetParametersResult = Result<(), i32>;
1264pub type ServerClearLeasesResult = Result<(), i32>;
1265
1266pub trait Server_ProxyInterface: Send + Sync {
1267    type StartServingResponseFut: std::future::Future<Output = Result<ServerStartServingResult, fidl::Error>>
1268        + Send;
1269    fn r#start_serving(&self) -> Self::StartServingResponseFut;
1270    type StopServingResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1271    fn r#stop_serving(&self) -> Self::StopServingResponseFut;
1272    type IsServingResponseFut: std::future::Future<Output = Result<bool, fidl::Error>> + Send;
1273    fn r#is_serving(&self) -> Self::IsServingResponseFut;
1274    type GetOptionResponseFut: std::future::Future<Output = Result<ServerGetOptionResult, fidl::Error>>
1275        + Send;
1276    fn r#get_option(&self, code: OptionCode) -> Self::GetOptionResponseFut;
1277    type GetParameterResponseFut: std::future::Future<Output = Result<ServerGetParameterResult, fidl::Error>>
1278        + Send;
1279    fn r#get_parameter(&self, name: ParameterName) -> Self::GetParameterResponseFut;
1280    type SetOptionResponseFut: std::future::Future<Output = Result<ServerSetOptionResult, fidl::Error>>
1281        + Send;
1282    fn r#set_option(&self, value: &Option_) -> Self::SetOptionResponseFut;
1283    type SetParameterResponseFut: std::future::Future<Output = Result<ServerSetParameterResult, fidl::Error>>
1284        + Send;
1285    fn r#set_parameter(&self, value: &Parameter) -> Self::SetParameterResponseFut;
1286    type ListOptionsResponseFut: std::future::Future<Output = Result<ServerListOptionsResult, fidl::Error>>
1287        + Send;
1288    fn r#list_options(&self) -> Self::ListOptionsResponseFut;
1289    type ListParametersResponseFut: std::future::Future<Output = Result<ServerListParametersResult, fidl::Error>>
1290        + Send;
1291    fn r#list_parameters(&self) -> Self::ListParametersResponseFut;
1292    type ResetOptionsResponseFut: std::future::Future<Output = Result<ServerResetOptionsResult, fidl::Error>>
1293        + Send;
1294    fn r#reset_options(&self) -> Self::ResetOptionsResponseFut;
1295    type ResetParametersResponseFut: std::future::Future<Output = Result<ServerResetParametersResult, fidl::Error>>
1296        + Send;
1297    fn r#reset_parameters(&self) -> Self::ResetParametersResponseFut;
1298    type ClearLeasesResponseFut: std::future::Future<Output = Result<ServerClearLeasesResult, fidl::Error>>
1299        + Send;
1300    fn r#clear_leases(&self) -> Self::ClearLeasesResponseFut;
1301}
1302#[derive(Debug)]
1303#[cfg(target_os = "fuchsia")]
1304pub struct Server_SynchronousProxy {
1305    client: fidl::client::sync::Client,
1306}
1307
1308#[cfg(target_os = "fuchsia")]
1309impl fidl::endpoints::SynchronousProxy for Server_SynchronousProxy {
1310    type Proxy = Server_Proxy;
1311    type Protocol = Server_Marker;
1312
1313    fn from_channel(inner: fidl::Channel) -> Self {
1314        Self::new(inner)
1315    }
1316
1317    fn into_channel(self) -> fidl::Channel {
1318        self.client.into_channel()
1319    }
1320
1321    fn as_channel(&self) -> &fidl::Channel {
1322        self.client.as_channel()
1323    }
1324}
1325
1326#[cfg(target_os = "fuchsia")]
1327impl Server_SynchronousProxy {
1328    pub fn new(channel: fidl::Channel) -> Self {
1329        let protocol_name = <Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1330        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1331    }
1332
1333    pub fn into_channel(self) -> fidl::Channel {
1334        self.client.into_channel()
1335    }
1336
1337    /// Waits until an event arrives and returns it. It is safe for other
1338    /// threads to make concurrent requests while waiting for an event.
1339    pub fn wait_for_event(
1340        &self,
1341        deadline: zx::MonotonicInstant,
1342    ) -> Result<Server_Event, fidl::Error> {
1343        Server_Event::decode(self.client.wait_for_event(deadline)?)
1344    }
1345
1346    /// Starts serving DHCP leases.
1347    ///
1348    /// Starts the DHCP server with the current set of parameters.
1349    ///
1350    /// On error the server remains in the stopped state. If the server is
1351    /// already serving, `StartServing` is a no-op.
1352    ///
1353    /// *error a zx.Status indicating why the server could not be started.
1354    pub fn r#start_serving(
1355        &self,
1356        ___deadline: zx::MonotonicInstant,
1357    ) -> Result<ServerStartServingResult, fidl::Error> {
1358        let _response = self.client.send_query::<
1359            fidl::encoding::EmptyPayload,
1360            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1361        >(
1362            (),
1363            0x10990e324ac53cd1,
1364            fidl::encoding::DynamicFlags::empty(),
1365            ___deadline,
1366        )?;
1367        Ok(_response.map(|x| x))
1368    }
1369
1370    /// Stops serving DHCP leases.
1371    ///
1372    /// Stopping causes all the listening ports to be closed.
1373    ///
1374    /// Configuring parameters on the DHCP server is only allowed when the
1375    /// server is stopped.
1376    ///
1377    /// If the server is not currently serving, `StopServing` is a no-op.
1378    pub fn r#stop_serving(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
1379        let _response =
1380            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
1381                (),
1382                0x7776cfe9f68a0dbe,
1383                fidl::encoding::DynamicFlags::empty(),
1384                ___deadline,
1385            )?;
1386        Ok(_response)
1387    }
1388
1389    /// Returns whether or not the server is serving DHCP leases.
1390    pub fn r#is_serving(&self, ___deadline: zx::MonotonicInstant) -> Result<bool, fidl::Error> {
1391        let _response =
1392            self.client.send_query::<fidl::encoding::EmptyPayload, ServerIsServingResponse>(
1393                (),
1394                0x45aadc35fcbe3826,
1395                fidl::encoding::DynamicFlags::empty(),
1396                ___deadline,
1397            )?;
1398        Ok(_response.enabled)
1399    }
1400
1401    /// Returns the requested Option if it is supported.
1402    ///
1403    /// + request `code` the code of an Option whose value has been requested.
1404    /// - response `value` the value of the requested Option.
1405    /// * error a zx.Status indicating why the value could not be retrieved.
1406    pub fn r#get_option(
1407        &self,
1408        mut code: OptionCode,
1409        ___deadline: zx::MonotonicInstant,
1410    ) -> Result<ServerGetOptionResult, fidl::Error> {
1411        let _response = self.client.send_query::<
1412            ServerGetOptionRequest,
1413            fidl::encoding::ResultType<ServerGetOptionResponse, i32>,
1414        >(
1415            (code,),
1416            0x5305ee2c593f68a,
1417            fidl::encoding::DynamicFlags::empty(),
1418            ___deadline,
1419        )?;
1420        Ok(_response.map(|x| x.value))
1421    }
1422
1423    /// Returns the requested Parameter if it is supported.
1424    ///
1425    /// + request `name` the name of a Parameter whose value has been requested.
1426    /// - response `value` the value of the requested Parameter.
1427    /// * error a zx.Status indicating why the value could not be retrieved.
1428    pub fn r#get_parameter(
1429        &self,
1430        mut name: ParameterName,
1431        ___deadline: zx::MonotonicInstant,
1432    ) -> Result<ServerGetParameterResult, fidl::Error> {
1433        let _response = self.client.send_query::<
1434            ServerGetParameterRequest,
1435            fidl::encoding::ResultType<ServerGetParameterResponse, i32>,
1436        >(
1437            (name,),
1438            0x1e8c98758fb82714,
1439            fidl::encoding::DynamicFlags::empty(),
1440            ___deadline,
1441        )?;
1442        Ok(_response.map(|x| x.value))
1443    }
1444
1445    /// Sets the Option to the argument. On success, a SetOption will take
1446    /// effect immediately.
1447    ///
1448    /// + request `value` an Option whose value will be set to the value of this
1449    /// argument.
1450    /// * error a zx.Status indicating the cause of failure.
1451    pub fn r#set_option(
1452        &self,
1453        mut value: &Option_,
1454        ___deadline: zx::MonotonicInstant,
1455    ) -> Result<ServerSetOptionResult, fidl::Error> {
1456        let _response = self.client.send_query::<
1457            ServerSetOptionRequest,
1458            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1459        >(
1460            (value,),
1461            0x63c98b670db8d96a,
1462            fidl::encoding::DynamicFlags::empty(),
1463            ___deadline,
1464        )?;
1465        Ok(_response.map(|x| x))
1466    }
1467
1468    /// Sets the Parameter to the argument. On success, the new parameter value
1469    /// can be queried by GetParameter or ListParameter immediately. However,
1470    /// the server may require a restart in order for the new Parameter value to
1471    /// take effect.
1472    ///
1473    /// Setting parameters is only allowed if the server is stopped.
1474    /// `ZX_ERR_BAD_STATE` is returned otherwise.
1475    ///
1476    /// + request `value` a Parameter whose value will be set to the value of
1477    /// this argument.
1478    /// * error a zx.Status indicating the cause of failure.
1479    pub fn r#set_parameter(
1480        &self,
1481        mut value: &Parameter,
1482        ___deadline: zx::MonotonicInstant,
1483    ) -> Result<ServerSetParameterResult, fidl::Error> {
1484        let _response = self.client.send_query::<
1485            ServerSetParameterRequest,
1486            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1487        >(
1488            (value,),
1489            0x3002d0d956eb4bdc,
1490            fidl::encoding::DynamicFlags::empty(),
1491            ___deadline,
1492        )?;
1493        Ok(_response.map(|x| x))
1494    }
1495
1496    /// Lists all DHCP options for which the Server has a value. Any option
1497    /// which does not have a value will be omitted from the returned list.
1498    /// ListOptions provides administrators a means to print a server's
1499    /// configuration as opposed to querying the value of a single Option.
1500    ///
1501    /// - response `options` a vector containing all of the options for which
1502    /// the Server has a value. Bounded to 256 as options are identified by a 1
1503    /// octet code and 256 is the maximum number of such codes.
1504    /// * error a zx.Status indicating the cause of failure.
1505    pub fn r#list_options(
1506        &self,
1507        ___deadline: zx::MonotonicInstant,
1508    ) -> Result<ServerListOptionsResult, fidl::Error> {
1509        let _response = self.client.send_query::<
1510            fidl::encoding::EmptyPayload,
1511            fidl::encoding::ResultType<ServerListOptionsResponse, i32>,
1512        >(
1513            (),
1514            0x72c8161c69ca67b,
1515            fidl::encoding::DynamicFlags::empty(),
1516            ___deadline,
1517        )?;
1518        Ok(_response.map(|x| x.options))
1519    }
1520
1521    /// Lists all DHCP server parameters. ListParameters provides administrators
1522    /// a means to print a server's configuration as opposed to querying the
1523    /// value of a single Parameter.
1524    ///
1525    /// - response `parameter` a vector containing the values of all of the
1526    /// Server's parameters. Bounded to 256 to provide a generous upper limit
1527    /// on the number of server parameters while being of the same size as
1528    /// ListOptions.
1529    /// * error a zx.Status indicating the cause of failure.
1530    pub fn r#list_parameters(
1531        &self,
1532        ___deadline: zx::MonotonicInstant,
1533    ) -> Result<ServerListParametersResult, fidl::Error> {
1534        let _response = self.client.send_query::<
1535            fidl::encoding::EmptyPayload,
1536            fidl::encoding::ResultType<ServerListParametersResponse, i32>,
1537        >(
1538            (),
1539            0xa201b1d6d121c59,
1540            fidl::encoding::DynamicFlags::empty(),
1541            ___deadline,
1542        )?;
1543        Ok(_response.map(|x| x.parameters))
1544    }
1545
1546    /// Resets all DHCP options to have no value. On success, ResetOptions will
1547    /// take effect immediately.
1548    ///
1549    /// * error a zx.Status indicating the cause of failure.
1550    pub fn r#reset_options(
1551        &self,
1552        ___deadline: zx::MonotonicInstant,
1553    ) -> Result<ServerResetOptionsResult, fidl::Error> {
1554        let _response = self.client.send_query::<
1555            fidl::encoding::EmptyPayload,
1556            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1557        >(
1558            (),
1559            0x31014911fd21cc13,
1560            fidl::encoding::DynamicFlags::empty(),
1561            ___deadline,
1562        )?;
1563        Ok(_response.map(|x| x))
1564    }
1565
1566    /// Resets all DHCP server parameters to their default value. On success,
1567    /// the reset parameter values can be queried immediately with GetParameter
1568    /// or ListParameters. However, the server must be restarted before all new
1569    /// parameter values take effect.
1570    ///
1571    /// Setting parameters is only allowed if the server is stopped.
1572    /// `ZX_ERR_BAD_STATE` is returned otherwise.
1573    ///
1574    /// * error a zx.Status indicating the cause of failure.
1575    pub fn r#reset_parameters(
1576        &self,
1577        ___deadline: zx::MonotonicInstant,
1578    ) -> Result<ServerResetParametersResult, fidl::Error> {
1579        let _response = self.client.send_query::<
1580            fidl::encoding::EmptyPayload,
1581            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1582        >(
1583            (),
1584            0x353fba50bcf4ecec,
1585            fidl::encoding::DynamicFlags::empty(),
1586            ___deadline,
1587        )?;
1588        Ok(_response.map(|x| x))
1589    }
1590
1591    /// Clears all leases maintained by the Server. On success, ClearLeases will
1592    /// take effect immediately. Server administrators should take care when
1593    /// calling this method as the DHCP protocol does not provide a mechanism by
1594    /// which a Server can notify a client that its lease has been cleared.
1595    ///
1596    /// * error a zx.Status indicating the cause of failure.
1597    pub fn r#clear_leases(
1598        &self,
1599        ___deadline: zx::MonotonicInstant,
1600    ) -> Result<ServerClearLeasesResult, fidl::Error> {
1601        let _response = self.client.send_query::<
1602            fidl::encoding::EmptyPayload,
1603            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1604        >(
1605            (),
1606            0xe39e35cda85a04d,
1607            fidl::encoding::DynamicFlags::empty(),
1608            ___deadline,
1609        )?;
1610        Ok(_response.map(|x| x))
1611    }
1612}
1613
1614#[cfg(target_os = "fuchsia")]
1615impl From<Server_SynchronousProxy> for zx::NullableHandle {
1616    fn from(value: Server_SynchronousProxy) -> Self {
1617        value.into_channel().into()
1618    }
1619}
1620
1621#[cfg(target_os = "fuchsia")]
1622impl From<fidl::Channel> for Server_SynchronousProxy {
1623    fn from(value: fidl::Channel) -> Self {
1624        Self::new(value)
1625    }
1626}
1627
1628#[cfg(target_os = "fuchsia")]
1629impl fidl::endpoints::FromClient for Server_SynchronousProxy {
1630    type Protocol = Server_Marker;
1631
1632    fn from_client(value: fidl::endpoints::ClientEnd<Server_Marker>) -> Self {
1633        Self::new(value.into_channel())
1634    }
1635}
1636
1637#[derive(Debug, Clone)]
1638pub struct Server_Proxy {
1639    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1640}
1641
1642impl fidl::endpoints::Proxy for Server_Proxy {
1643    type Protocol = Server_Marker;
1644
1645    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1646        Self::new(inner)
1647    }
1648
1649    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1650        self.client.into_channel().map_err(|client| Self { client })
1651    }
1652
1653    fn as_channel(&self) -> &::fidl::AsyncChannel {
1654        self.client.as_channel()
1655    }
1656}
1657
1658impl Server_Proxy {
1659    /// Create a new Proxy for fuchsia.net.dhcp/Server.
1660    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1661        let protocol_name = <Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1662        Self { client: fidl::client::Client::new(channel, protocol_name) }
1663    }
1664
1665    /// Get a Stream of events from the remote end of the protocol.
1666    ///
1667    /// # Panics
1668    ///
1669    /// Panics if the event stream was already taken.
1670    pub fn take_event_stream(&self) -> Server_EventStream {
1671        Server_EventStream { event_receiver: self.client.take_event_receiver() }
1672    }
1673
1674    /// Starts serving DHCP leases.
1675    ///
1676    /// Starts the DHCP server with the current set of parameters.
1677    ///
1678    /// On error the server remains in the stopped state. If the server is
1679    /// already serving, `StartServing` is a no-op.
1680    ///
1681    /// *error a zx.Status indicating why the server could not be started.
1682    pub fn r#start_serving(
1683        &self,
1684    ) -> fidl::client::QueryResponseFut<
1685        ServerStartServingResult,
1686        fidl::encoding::DefaultFuchsiaResourceDialect,
1687    > {
1688        Server_ProxyInterface::r#start_serving(self)
1689    }
1690
1691    /// Stops serving DHCP leases.
1692    ///
1693    /// Stopping causes all the listening ports to be closed.
1694    ///
1695    /// Configuring parameters on the DHCP server is only allowed when the
1696    /// server is stopped.
1697    ///
1698    /// If the server is not currently serving, `StopServing` is a no-op.
1699    pub fn r#stop_serving(
1700        &self,
1701    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1702        Server_ProxyInterface::r#stop_serving(self)
1703    }
1704
1705    /// Returns whether or not the server is serving DHCP leases.
1706    pub fn r#is_serving(
1707        &self,
1708    ) -> fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect> {
1709        Server_ProxyInterface::r#is_serving(self)
1710    }
1711
1712    /// Returns the requested Option if it is supported.
1713    ///
1714    /// + request `code` the code of an Option whose value has been requested.
1715    /// - response `value` the value of the requested Option.
1716    /// * error a zx.Status indicating why the value could not be retrieved.
1717    pub fn r#get_option(
1718        &self,
1719        mut code: OptionCode,
1720    ) -> fidl::client::QueryResponseFut<
1721        ServerGetOptionResult,
1722        fidl::encoding::DefaultFuchsiaResourceDialect,
1723    > {
1724        Server_ProxyInterface::r#get_option(self, code)
1725    }
1726
1727    /// Returns the requested Parameter if it is supported.
1728    ///
1729    /// + request `name` the name of a Parameter whose value has been requested.
1730    /// - response `value` the value of the requested Parameter.
1731    /// * error a zx.Status indicating why the value could not be retrieved.
1732    pub fn r#get_parameter(
1733        &self,
1734        mut name: ParameterName,
1735    ) -> fidl::client::QueryResponseFut<
1736        ServerGetParameterResult,
1737        fidl::encoding::DefaultFuchsiaResourceDialect,
1738    > {
1739        Server_ProxyInterface::r#get_parameter(self, name)
1740    }
1741
1742    /// Sets the Option to the argument. On success, a SetOption will take
1743    /// effect immediately.
1744    ///
1745    /// + request `value` an Option whose value will be set to the value of this
1746    /// argument.
1747    /// * error a zx.Status indicating the cause of failure.
1748    pub fn r#set_option(
1749        &self,
1750        mut value: &Option_,
1751    ) -> fidl::client::QueryResponseFut<
1752        ServerSetOptionResult,
1753        fidl::encoding::DefaultFuchsiaResourceDialect,
1754    > {
1755        Server_ProxyInterface::r#set_option(self, value)
1756    }
1757
1758    /// Sets the Parameter to the argument. On success, the new parameter value
1759    /// can be queried by GetParameter or ListParameter immediately. However,
1760    /// the server may require a restart in order for the new Parameter value to
1761    /// take effect.
1762    ///
1763    /// Setting parameters is only allowed if the server is stopped.
1764    /// `ZX_ERR_BAD_STATE` is returned otherwise.
1765    ///
1766    /// + request `value` a Parameter whose value will be set to the value of
1767    /// this argument.
1768    /// * error a zx.Status indicating the cause of failure.
1769    pub fn r#set_parameter(
1770        &self,
1771        mut value: &Parameter,
1772    ) -> fidl::client::QueryResponseFut<
1773        ServerSetParameterResult,
1774        fidl::encoding::DefaultFuchsiaResourceDialect,
1775    > {
1776        Server_ProxyInterface::r#set_parameter(self, value)
1777    }
1778
1779    /// Lists all DHCP options for which the Server has a value. Any option
1780    /// which does not have a value will be omitted from the returned list.
1781    /// ListOptions provides administrators a means to print a server's
1782    /// configuration as opposed to querying the value of a single Option.
1783    ///
1784    /// - response `options` a vector containing all of the options for which
1785    /// the Server has a value. Bounded to 256 as options are identified by a 1
1786    /// octet code and 256 is the maximum number of such codes.
1787    /// * error a zx.Status indicating the cause of failure.
1788    pub fn r#list_options(
1789        &self,
1790    ) -> fidl::client::QueryResponseFut<
1791        ServerListOptionsResult,
1792        fidl::encoding::DefaultFuchsiaResourceDialect,
1793    > {
1794        Server_ProxyInterface::r#list_options(self)
1795    }
1796
1797    /// Lists all DHCP server parameters. ListParameters provides administrators
1798    /// a means to print a server's configuration as opposed to querying the
1799    /// value of a single Parameter.
1800    ///
1801    /// - response `parameter` a vector containing the values of all of the
1802    /// Server's parameters. Bounded to 256 to provide a generous upper limit
1803    /// on the number of server parameters while being of the same size as
1804    /// ListOptions.
1805    /// * error a zx.Status indicating the cause of failure.
1806    pub fn r#list_parameters(
1807        &self,
1808    ) -> fidl::client::QueryResponseFut<
1809        ServerListParametersResult,
1810        fidl::encoding::DefaultFuchsiaResourceDialect,
1811    > {
1812        Server_ProxyInterface::r#list_parameters(self)
1813    }
1814
1815    /// Resets all DHCP options to have no value. On success, ResetOptions will
1816    /// take effect immediately.
1817    ///
1818    /// * error a zx.Status indicating the cause of failure.
1819    pub fn r#reset_options(
1820        &self,
1821    ) -> fidl::client::QueryResponseFut<
1822        ServerResetOptionsResult,
1823        fidl::encoding::DefaultFuchsiaResourceDialect,
1824    > {
1825        Server_ProxyInterface::r#reset_options(self)
1826    }
1827
1828    /// Resets all DHCP server parameters to their default value. On success,
1829    /// the reset parameter values can be queried immediately with GetParameter
1830    /// or ListParameters. However, the server must be restarted before all new
1831    /// parameter values take effect.
1832    ///
1833    /// Setting parameters is only allowed if the server is stopped.
1834    /// `ZX_ERR_BAD_STATE` is returned otherwise.
1835    ///
1836    /// * error a zx.Status indicating the cause of failure.
1837    pub fn r#reset_parameters(
1838        &self,
1839    ) -> fidl::client::QueryResponseFut<
1840        ServerResetParametersResult,
1841        fidl::encoding::DefaultFuchsiaResourceDialect,
1842    > {
1843        Server_ProxyInterface::r#reset_parameters(self)
1844    }
1845
1846    /// Clears all leases maintained by the Server. On success, ClearLeases will
1847    /// take effect immediately. Server administrators should take care when
1848    /// calling this method as the DHCP protocol does not provide a mechanism by
1849    /// which a Server can notify a client that its lease has been cleared.
1850    ///
1851    /// * error a zx.Status indicating the cause of failure.
1852    pub fn r#clear_leases(
1853        &self,
1854    ) -> fidl::client::QueryResponseFut<
1855        ServerClearLeasesResult,
1856        fidl::encoding::DefaultFuchsiaResourceDialect,
1857    > {
1858        Server_ProxyInterface::r#clear_leases(self)
1859    }
1860}
1861
1862impl Server_ProxyInterface for Server_Proxy {
1863    type StartServingResponseFut = fidl::client::QueryResponseFut<
1864        ServerStartServingResult,
1865        fidl::encoding::DefaultFuchsiaResourceDialect,
1866    >;
1867    fn r#start_serving(&self) -> Self::StartServingResponseFut {
1868        fn _decode(
1869            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1870        ) -> Result<ServerStartServingResult, fidl::Error> {
1871            let _response = fidl::client::decode_transaction_body::<
1872                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1873                fidl::encoding::DefaultFuchsiaResourceDialect,
1874                0x10990e324ac53cd1,
1875            >(_buf?)?;
1876            Ok(_response.map(|x| x))
1877        }
1878        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ServerStartServingResult>(
1879            (),
1880            0x10990e324ac53cd1,
1881            fidl::encoding::DynamicFlags::empty(),
1882            _decode,
1883        )
1884    }
1885
1886    type StopServingResponseFut =
1887        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1888    fn r#stop_serving(&self) -> Self::StopServingResponseFut {
1889        fn _decode(
1890            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1891        ) -> Result<(), fidl::Error> {
1892            let _response = fidl::client::decode_transaction_body::<
1893                fidl::encoding::EmptyPayload,
1894                fidl::encoding::DefaultFuchsiaResourceDialect,
1895                0x7776cfe9f68a0dbe,
1896            >(_buf?)?;
1897            Ok(_response)
1898        }
1899        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
1900            (),
1901            0x7776cfe9f68a0dbe,
1902            fidl::encoding::DynamicFlags::empty(),
1903            _decode,
1904        )
1905    }
1906
1907    type IsServingResponseFut =
1908        fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect>;
1909    fn r#is_serving(&self) -> Self::IsServingResponseFut {
1910        fn _decode(
1911            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1912        ) -> Result<bool, fidl::Error> {
1913            let _response = fidl::client::decode_transaction_body::<
1914                ServerIsServingResponse,
1915                fidl::encoding::DefaultFuchsiaResourceDialect,
1916                0x45aadc35fcbe3826,
1917            >(_buf?)?;
1918            Ok(_response.enabled)
1919        }
1920        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, bool>(
1921            (),
1922            0x45aadc35fcbe3826,
1923            fidl::encoding::DynamicFlags::empty(),
1924            _decode,
1925        )
1926    }
1927
1928    type GetOptionResponseFut = fidl::client::QueryResponseFut<
1929        ServerGetOptionResult,
1930        fidl::encoding::DefaultFuchsiaResourceDialect,
1931    >;
1932    fn r#get_option(&self, mut code: OptionCode) -> Self::GetOptionResponseFut {
1933        fn _decode(
1934            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1935        ) -> Result<ServerGetOptionResult, fidl::Error> {
1936            let _response = fidl::client::decode_transaction_body::<
1937                fidl::encoding::ResultType<ServerGetOptionResponse, i32>,
1938                fidl::encoding::DefaultFuchsiaResourceDialect,
1939                0x5305ee2c593f68a,
1940            >(_buf?)?;
1941            Ok(_response.map(|x| x.value))
1942        }
1943        self.client.send_query_and_decode::<ServerGetOptionRequest, ServerGetOptionResult>(
1944            (code,),
1945            0x5305ee2c593f68a,
1946            fidl::encoding::DynamicFlags::empty(),
1947            _decode,
1948        )
1949    }
1950
1951    type GetParameterResponseFut = fidl::client::QueryResponseFut<
1952        ServerGetParameterResult,
1953        fidl::encoding::DefaultFuchsiaResourceDialect,
1954    >;
1955    fn r#get_parameter(&self, mut name: ParameterName) -> Self::GetParameterResponseFut {
1956        fn _decode(
1957            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1958        ) -> Result<ServerGetParameterResult, fidl::Error> {
1959            let _response = fidl::client::decode_transaction_body::<
1960                fidl::encoding::ResultType<ServerGetParameterResponse, i32>,
1961                fidl::encoding::DefaultFuchsiaResourceDialect,
1962                0x1e8c98758fb82714,
1963            >(_buf?)?;
1964            Ok(_response.map(|x| x.value))
1965        }
1966        self.client.send_query_and_decode::<ServerGetParameterRequest, ServerGetParameterResult>(
1967            (name,),
1968            0x1e8c98758fb82714,
1969            fidl::encoding::DynamicFlags::empty(),
1970            _decode,
1971        )
1972    }
1973
1974    type SetOptionResponseFut = fidl::client::QueryResponseFut<
1975        ServerSetOptionResult,
1976        fidl::encoding::DefaultFuchsiaResourceDialect,
1977    >;
1978    fn r#set_option(&self, mut value: &Option_) -> Self::SetOptionResponseFut {
1979        fn _decode(
1980            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1981        ) -> Result<ServerSetOptionResult, fidl::Error> {
1982            let _response = fidl::client::decode_transaction_body::<
1983                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1984                fidl::encoding::DefaultFuchsiaResourceDialect,
1985                0x63c98b670db8d96a,
1986            >(_buf?)?;
1987            Ok(_response.map(|x| x))
1988        }
1989        self.client.send_query_and_decode::<ServerSetOptionRequest, ServerSetOptionResult>(
1990            (value,),
1991            0x63c98b670db8d96a,
1992            fidl::encoding::DynamicFlags::empty(),
1993            _decode,
1994        )
1995    }
1996
1997    type SetParameterResponseFut = fidl::client::QueryResponseFut<
1998        ServerSetParameterResult,
1999        fidl::encoding::DefaultFuchsiaResourceDialect,
2000    >;
2001    fn r#set_parameter(&self, mut value: &Parameter) -> Self::SetParameterResponseFut {
2002        fn _decode(
2003            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2004        ) -> Result<ServerSetParameterResult, fidl::Error> {
2005            let _response = fidl::client::decode_transaction_body::<
2006                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2007                fidl::encoding::DefaultFuchsiaResourceDialect,
2008                0x3002d0d956eb4bdc,
2009            >(_buf?)?;
2010            Ok(_response.map(|x| x))
2011        }
2012        self.client.send_query_and_decode::<ServerSetParameterRequest, ServerSetParameterResult>(
2013            (value,),
2014            0x3002d0d956eb4bdc,
2015            fidl::encoding::DynamicFlags::empty(),
2016            _decode,
2017        )
2018    }
2019
2020    type ListOptionsResponseFut = fidl::client::QueryResponseFut<
2021        ServerListOptionsResult,
2022        fidl::encoding::DefaultFuchsiaResourceDialect,
2023    >;
2024    fn r#list_options(&self) -> Self::ListOptionsResponseFut {
2025        fn _decode(
2026            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2027        ) -> Result<ServerListOptionsResult, fidl::Error> {
2028            let _response = fidl::client::decode_transaction_body::<
2029                fidl::encoding::ResultType<ServerListOptionsResponse, i32>,
2030                fidl::encoding::DefaultFuchsiaResourceDialect,
2031                0x72c8161c69ca67b,
2032            >(_buf?)?;
2033            Ok(_response.map(|x| x.options))
2034        }
2035        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ServerListOptionsResult>(
2036            (),
2037            0x72c8161c69ca67b,
2038            fidl::encoding::DynamicFlags::empty(),
2039            _decode,
2040        )
2041    }
2042
2043    type ListParametersResponseFut = fidl::client::QueryResponseFut<
2044        ServerListParametersResult,
2045        fidl::encoding::DefaultFuchsiaResourceDialect,
2046    >;
2047    fn r#list_parameters(&self) -> Self::ListParametersResponseFut {
2048        fn _decode(
2049            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2050        ) -> Result<ServerListParametersResult, fidl::Error> {
2051            let _response = fidl::client::decode_transaction_body::<
2052                fidl::encoding::ResultType<ServerListParametersResponse, i32>,
2053                fidl::encoding::DefaultFuchsiaResourceDialect,
2054                0xa201b1d6d121c59,
2055            >(_buf?)?;
2056            Ok(_response.map(|x| x.parameters))
2057        }
2058        self.client
2059            .send_query_and_decode::<fidl::encoding::EmptyPayload, ServerListParametersResult>(
2060                (),
2061                0xa201b1d6d121c59,
2062                fidl::encoding::DynamicFlags::empty(),
2063                _decode,
2064            )
2065    }
2066
2067    type ResetOptionsResponseFut = fidl::client::QueryResponseFut<
2068        ServerResetOptionsResult,
2069        fidl::encoding::DefaultFuchsiaResourceDialect,
2070    >;
2071    fn r#reset_options(&self) -> Self::ResetOptionsResponseFut {
2072        fn _decode(
2073            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2074        ) -> Result<ServerResetOptionsResult, fidl::Error> {
2075            let _response = fidl::client::decode_transaction_body::<
2076                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2077                fidl::encoding::DefaultFuchsiaResourceDialect,
2078                0x31014911fd21cc13,
2079            >(_buf?)?;
2080            Ok(_response.map(|x| x))
2081        }
2082        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ServerResetOptionsResult>(
2083            (),
2084            0x31014911fd21cc13,
2085            fidl::encoding::DynamicFlags::empty(),
2086            _decode,
2087        )
2088    }
2089
2090    type ResetParametersResponseFut = fidl::client::QueryResponseFut<
2091        ServerResetParametersResult,
2092        fidl::encoding::DefaultFuchsiaResourceDialect,
2093    >;
2094    fn r#reset_parameters(&self) -> Self::ResetParametersResponseFut {
2095        fn _decode(
2096            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2097        ) -> Result<ServerResetParametersResult, fidl::Error> {
2098            let _response = fidl::client::decode_transaction_body::<
2099                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2100                fidl::encoding::DefaultFuchsiaResourceDialect,
2101                0x353fba50bcf4ecec,
2102            >(_buf?)?;
2103            Ok(_response.map(|x| x))
2104        }
2105        self.client
2106            .send_query_and_decode::<fidl::encoding::EmptyPayload, ServerResetParametersResult>(
2107                (),
2108                0x353fba50bcf4ecec,
2109                fidl::encoding::DynamicFlags::empty(),
2110                _decode,
2111            )
2112    }
2113
2114    type ClearLeasesResponseFut = fidl::client::QueryResponseFut<
2115        ServerClearLeasesResult,
2116        fidl::encoding::DefaultFuchsiaResourceDialect,
2117    >;
2118    fn r#clear_leases(&self) -> Self::ClearLeasesResponseFut {
2119        fn _decode(
2120            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2121        ) -> Result<ServerClearLeasesResult, fidl::Error> {
2122            let _response = fidl::client::decode_transaction_body::<
2123                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2124                fidl::encoding::DefaultFuchsiaResourceDialect,
2125                0xe39e35cda85a04d,
2126            >(_buf?)?;
2127            Ok(_response.map(|x| x))
2128        }
2129        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ServerClearLeasesResult>(
2130            (),
2131            0xe39e35cda85a04d,
2132            fidl::encoding::DynamicFlags::empty(),
2133            _decode,
2134        )
2135    }
2136}
2137
2138pub struct Server_EventStream {
2139    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2140}
2141
2142impl std::marker::Unpin for Server_EventStream {}
2143
2144impl futures::stream::FusedStream for Server_EventStream {
2145    fn is_terminated(&self) -> bool {
2146        self.event_receiver.is_terminated()
2147    }
2148}
2149
2150impl futures::Stream for Server_EventStream {
2151    type Item = Result<Server_Event, fidl::Error>;
2152
2153    fn poll_next(
2154        mut self: std::pin::Pin<&mut Self>,
2155        cx: &mut std::task::Context<'_>,
2156    ) -> std::task::Poll<Option<Self::Item>> {
2157        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2158            &mut self.event_receiver,
2159            cx
2160        )?) {
2161            Some(buf) => std::task::Poll::Ready(Some(Server_Event::decode(buf))),
2162            None => std::task::Poll::Ready(None),
2163        }
2164    }
2165}
2166
2167#[derive(Debug)]
2168pub enum Server_Event {}
2169
2170impl Server_Event {
2171    /// Decodes a message buffer as a [`Server_Event`].
2172    fn decode(
2173        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2174    ) -> Result<Server_Event, fidl::Error> {
2175        let (bytes, _handles) = buf.split_mut();
2176        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2177        debug_assert_eq!(tx_header.tx_id, 0);
2178        match tx_header.ordinal {
2179            _ => Err(fidl::Error::UnknownOrdinal {
2180                ordinal: tx_header.ordinal,
2181                protocol_name: <Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2182            }),
2183        }
2184    }
2185}
2186
2187/// A Stream of incoming requests for fuchsia.net.dhcp/Server.
2188pub struct Server_RequestStream {
2189    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2190    is_terminated: bool,
2191}
2192
2193impl std::marker::Unpin for Server_RequestStream {}
2194
2195impl futures::stream::FusedStream for Server_RequestStream {
2196    fn is_terminated(&self) -> bool {
2197        self.is_terminated
2198    }
2199}
2200
2201impl fidl::endpoints::RequestStream for Server_RequestStream {
2202    type Protocol = Server_Marker;
2203    type ControlHandle = Server_ControlHandle;
2204
2205    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2206        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2207    }
2208
2209    fn control_handle(&self) -> Self::ControlHandle {
2210        Server_ControlHandle { inner: self.inner.clone() }
2211    }
2212
2213    fn into_inner(
2214        self,
2215    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2216    {
2217        (self.inner, self.is_terminated)
2218    }
2219
2220    fn from_inner(
2221        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2222        is_terminated: bool,
2223    ) -> Self {
2224        Self { inner, is_terminated }
2225    }
2226}
2227
2228impl futures::Stream for Server_RequestStream {
2229    type Item = Result<Server_Request, fidl::Error>;
2230
2231    fn poll_next(
2232        mut self: std::pin::Pin<&mut Self>,
2233        cx: &mut std::task::Context<'_>,
2234    ) -> std::task::Poll<Option<Self::Item>> {
2235        let this = &mut *self;
2236        if this.inner.check_shutdown(cx) {
2237            this.is_terminated = true;
2238            return std::task::Poll::Ready(None);
2239        }
2240        if this.is_terminated {
2241            panic!("polled Server_RequestStream after completion");
2242        }
2243        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2244            |bytes, handles| {
2245                match this.inner.channel().read_etc(cx, bytes, handles) {
2246                    std::task::Poll::Ready(Ok(())) => {}
2247                    std::task::Poll::Pending => return std::task::Poll::Pending,
2248                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2249                        this.is_terminated = true;
2250                        return std::task::Poll::Ready(None);
2251                    }
2252                    std::task::Poll::Ready(Err(e)) => {
2253                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2254                            e.into(),
2255                        ))));
2256                    }
2257                }
2258
2259                // A message has been received from the channel
2260                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2261
2262                std::task::Poll::Ready(Some(match header.ordinal {
2263                    0x10990e324ac53cd1 => {
2264                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2265                        let mut req = fidl::new_empty!(
2266                            fidl::encoding::EmptyPayload,
2267                            fidl::encoding::DefaultFuchsiaResourceDialect
2268                        );
2269                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2270                        let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2271                        Ok(Server_Request::StartServing {
2272                            responder: Server_StartServingResponder {
2273                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2274                                tx_id: header.tx_id,
2275                            },
2276                        })
2277                    }
2278                    0x7776cfe9f68a0dbe => {
2279                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2280                        let mut req = fidl::new_empty!(
2281                            fidl::encoding::EmptyPayload,
2282                            fidl::encoding::DefaultFuchsiaResourceDialect
2283                        );
2284                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2285                        let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2286                        Ok(Server_Request::StopServing {
2287                            responder: Server_StopServingResponder {
2288                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2289                                tx_id: header.tx_id,
2290                            },
2291                        })
2292                    }
2293                    0x45aadc35fcbe3826 => {
2294                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2295                        let mut req = fidl::new_empty!(
2296                            fidl::encoding::EmptyPayload,
2297                            fidl::encoding::DefaultFuchsiaResourceDialect
2298                        );
2299                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2300                        let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2301                        Ok(Server_Request::IsServing {
2302                            responder: Server_IsServingResponder {
2303                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2304                                tx_id: header.tx_id,
2305                            },
2306                        })
2307                    }
2308                    0x5305ee2c593f68a => {
2309                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2310                        let mut req = fidl::new_empty!(
2311                            ServerGetOptionRequest,
2312                            fidl::encoding::DefaultFuchsiaResourceDialect
2313                        );
2314                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ServerGetOptionRequest>(&header, _body_bytes, handles, &mut req)?;
2315                        let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2316                        Ok(Server_Request::GetOption {
2317                            code: req.code,
2318
2319                            responder: Server_GetOptionResponder {
2320                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2321                                tx_id: header.tx_id,
2322                            },
2323                        })
2324                    }
2325                    0x1e8c98758fb82714 => {
2326                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2327                        let mut req = fidl::new_empty!(
2328                            ServerGetParameterRequest,
2329                            fidl::encoding::DefaultFuchsiaResourceDialect
2330                        );
2331                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ServerGetParameterRequest>(&header, _body_bytes, handles, &mut req)?;
2332                        let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2333                        Ok(Server_Request::GetParameter {
2334                            name: req.name,
2335
2336                            responder: Server_GetParameterResponder {
2337                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2338                                tx_id: header.tx_id,
2339                            },
2340                        })
2341                    }
2342                    0x63c98b670db8d96a => {
2343                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2344                        let mut req = fidl::new_empty!(
2345                            ServerSetOptionRequest,
2346                            fidl::encoding::DefaultFuchsiaResourceDialect
2347                        );
2348                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ServerSetOptionRequest>(&header, _body_bytes, handles, &mut req)?;
2349                        let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2350                        Ok(Server_Request::SetOption {
2351                            value: req.value,
2352
2353                            responder: Server_SetOptionResponder {
2354                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2355                                tx_id: header.tx_id,
2356                            },
2357                        })
2358                    }
2359                    0x3002d0d956eb4bdc => {
2360                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2361                        let mut req = fidl::new_empty!(
2362                            ServerSetParameterRequest,
2363                            fidl::encoding::DefaultFuchsiaResourceDialect
2364                        );
2365                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ServerSetParameterRequest>(&header, _body_bytes, handles, &mut req)?;
2366                        let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2367                        Ok(Server_Request::SetParameter {
2368                            value: req.value,
2369
2370                            responder: Server_SetParameterResponder {
2371                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2372                                tx_id: header.tx_id,
2373                            },
2374                        })
2375                    }
2376                    0x72c8161c69ca67b => {
2377                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2378                        let mut req = fidl::new_empty!(
2379                            fidl::encoding::EmptyPayload,
2380                            fidl::encoding::DefaultFuchsiaResourceDialect
2381                        );
2382                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2383                        let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2384                        Ok(Server_Request::ListOptions {
2385                            responder: Server_ListOptionsResponder {
2386                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2387                                tx_id: header.tx_id,
2388                            },
2389                        })
2390                    }
2391                    0xa201b1d6d121c59 => {
2392                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2393                        let mut req = fidl::new_empty!(
2394                            fidl::encoding::EmptyPayload,
2395                            fidl::encoding::DefaultFuchsiaResourceDialect
2396                        );
2397                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2398                        let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2399                        Ok(Server_Request::ListParameters {
2400                            responder: Server_ListParametersResponder {
2401                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2402                                tx_id: header.tx_id,
2403                            },
2404                        })
2405                    }
2406                    0x31014911fd21cc13 => {
2407                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2408                        let mut req = fidl::new_empty!(
2409                            fidl::encoding::EmptyPayload,
2410                            fidl::encoding::DefaultFuchsiaResourceDialect
2411                        );
2412                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2413                        let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2414                        Ok(Server_Request::ResetOptions {
2415                            responder: Server_ResetOptionsResponder {
2416                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2417                                tx_id: header.tx_id,
2418                            },
2419                        })
2420                    }
2421                    0x353fba50bcf4ecec => {
2422                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2423                        let mut req = fidl::new_empty!(
2424                            fidl::encoding::EmptyPayload,
2425                            fidl::encoding::DefaultFuchsiaResourceDialect
2426                        );
2427                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2428                        let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2429                        Ok(Server_Request::ResetParameters {
2430                            responder: Server_ResetParametersResponder {
2431                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2432                                tx_id: header.tx_id,
2433                            },
2434                        })
2435                    }
2436                    0xe39e35cda85a04d => {
2437                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2438                        let mut req = fidl::new_empty!(
2439                            fidl::encoding::EmptyPayload,
2440                            fidl::encoding::DefaultFuchsiaResourceDialect
2441                        );
2442                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2443                        let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2444                        Ok(Server_Request::ClearLeases {
2445                            responder: Server_ClearLeasesResponder {
2446                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2447                                tx_id: header.tx_id,
2448                            },
2449                        })
2450                    }
2451                    _ => Err(fidl::Error::UnknownOrdinal {
2452                        ordinal: header.ordinal,
2453                        protocol_name:
2454                            <Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2455                    }),
2456                }))
2457            },
2458        )
2459    }
2460}
2461
2462/// Provides methods for DHCP Server configuration.
2463#[derive(Debug)]
2464pub enum Server_Request {
2465    /// Starts serving DHCP leases.
2466    ///
2467    /// Starts the DHCP server with the current set of parameters.
2468    ///
2469    /// On error the server remains in the stopped state. If the server is
2470    /// already serving, `StartServing` is a no-op.
2471    ///
2472    /// *error a zx.Status indicating why the server could not be started.
2473    StartServing { responder: Server_StartServingResponder },
2474    /// Stops serving DHCP leases.
2475    ///
2476    /// Stopping causes all the listening ports to be closed.
2477    ///
2478    /// Configuring parameters on the DHCP server is only allowed when the
2479    /// server is stopped.
2480    ///
2481    /// If the server is not currently serving, `StopServing` is a no-op.
2482    StopServing { responder: Server_StopServingResponder },
2483    /// Returns whether or not the server is serving DHCP leases.
2484    IsServing { responder: Server_IsServingResponder },
2485    /// Returns the requested Option if it is supported.
2486    ///
2487    /// + request `code` the code of an Option whose value has been requested.
2488    /// - response `value` the value of the requested Option.
2489    /// * error a zx.Status indicating why the value could not be retrieved.
2490    GetOption { code: OptionCode, responder: Server_GetOptionResponder },
2491    /// Returns the requested Parameter if it is supported.
2492    ///
2493    /// + request `name` the name of a Parameter whose value has been requested.
2494    /// - response `value` the value of the requested Parameter.
2495    /// * error a zx.Status indicating why the value could not be retrieved.
2496    GetParameter { name: ParameterName, responder: Server_GetParameterResponder },
2497    /// Sets the Option to the argument. On success, a SetOption will take
2498    /// effect immediately.
2499    ///
2500    /// + request `value` an Option whose value will be set to the value of this
2501    /// argument.
2502    /// * error a zx.Status indicating the cause of failure.
2503    SetOption { value: Option_, responder: Server_SetOptionResponder },
2504    /// Sets the Parameter to the argument. On success, the new parameter value
2505    /// can be queried by GetParameter or ListParameter immediately. However,
2506    /// the server may require a restart in order for the new Parameter value to
2507    /// take effect.
2508    ///
2509    /// Setting parameters is only allowed if the server is stopped.
2510    /// `ZX_ERR_BAD_STATE` is returned otherwise.
2511    ///
2512    /// + request `value` a Parameter whose value will be set to the value of
2513    /// this argument.
2514    /// * error a zx.Status indicating the cause of failure.
2515    SetParameter { value: Parameter, responder: Server_SetParameterResponder },
2516    /// Lists all DHCP options for which the Server has a value. Any option
2517    /// which does not have a value will be omitted from the returned list.
2518    /// ListOptions provides administrators a means to print a server's
2519    /// configuration as opposed to querying the value of a single Option.
2520    ///
2521    /// - response `options` a vector containing all of the options for which
2522    /// the Server has a value. Bounded to 256 as options are identified by a 1
2523    /// octet code and 256 is the maximum number of such codes.
2524    /// * error a zx.Status indicating the cause of failure.
2525    ListOptions { responder: Server_ListOptionsResponder },
2526    /// Lists all DHCP server parameters. ListParameters provides administrators
2527    /// a means to print a server's configuration as opposed to querying the
2528    /// value of a single Parameter.
2529    ///
2530    /// - response `parameter` a vector containing the values of all of the
2531    /// Server's parameters. Bounded to 256 to provide a generous upper limit
2532    /// on the number of server parameters while being of the same size as
2533    /// ListOptions.
2534    /// * error a zx.Status indicating the cause of failure.
2535    ListParameters { responder: Server_ListParametersResponder },
2536    /// Resets all DHCP options to have no value. On success, ResetOptions will
2537    /// take effect immediately.
2538    ///
2539    /// * error a zx.Status indicating the cause of failure.
2540    ResetOptions { responder: Server_ResetOptionsResponder },
2541    /// Resets all DHCP server parameters to their default value. On success,
2542    /// the reset parameter values can be queried immediately with GetParameter
2543    /// or ListParameters. However, the server must be restarted before all new
2544    /// parameter values take effect.
2545    ///
2546    /// Setting parameters is only allowed if the server is stopped.
2547    /// `ZX_ERR_BAD_STATE` is returned otherwise.
2548    ///
2549    /// * error a zx.Status indicating the cause of failure.
2550    ResetParameters { responder: Server_ResetParametersResponder },
2551    /// Clears all leases maintained by the Server. On success, ClearLeases will
2552    /// take effect immediately. Server administrators should take care when
2553    /// calling this method as the DHCP protocol does not provide a mechanism by
2554    /// which a Server can notify a client that its lease has been cleared.
2555    ///
2556    /// * error a zx.Status indicating the cause of failure.
2557    ClearLeases { responder: Server_ClearLeasesResponder },
2558}
2559
2560impl Server_Request {
2561    #[allow(irrefutable_let_patterns)]
2562    pub fn into_start_serving(self) -> Option<(Server_StartServingResponder)> {
2563        if let Server_Request::StartServing { responder } = self { Some((responder)) } else { None }
2564    }
2565
2566    #[allow(irrefutable_let_patterns)]
2567    pub fn into_stop_serving(self) -> Option<(Server_StopServingResponder)> {
2568        if let Server_Request::StopServing { responder } = self { Some((responder)) } else { None }
2569    }
2570
2571    #[allow(irrefutable_let_patterns)]
2572    pub fn into_is_serving(self) -> Option<(Server_IsServingResponder)> {
2573        if let Server_Request::IsServing { responder } = self { Some((responder)) } else { None }
2574    }
2575
2576    #[allow(irrefutable_let_patterns)]
2577    pub fn into_get_option(self) -> Option<(OptionCode, Server_GetOptionResponder)> {
2578        if let Server_Request::GetOption { code, responder } = self {
2579            Some((code, responder))
2580        } else {
2581            None
2582        }
2583    }
2584
2585    #[allow(irrefutable_let_patterns)]
2586    pub fn into_get_parameter(self) -> Option<(ParameterName, Server_GetParameterResponder)> {
2587        if let Server_Request::GetParameter { name, responder } = self {
2588            Some((name, responder))
2589        } else {
2590            None
2591        }
2592    }
2593
2594    #[allow(irrefutable_let_patterns)]
2595    pub fn into_set_option(self) -> Option<(Option_, Server_SetOptionResponder)> {
2596        if let Server_Request::SetOption { value, responder } = self {
2597            Some((value, responder))
2598        } else {
2599            None
2600        }
2601    }
2602
2603    #[allow(irrefutable_let_patterns)]
2604    pub fn into_set_parameter(self) -> Option<(Parameter, Server_SetParameterResponder)> {
2605        if let Server_Request::SetParameter { value, responder } = self {
2606            Some((value, responder))
2607        } else {
2608            None
2609        }
2610    }
2611
2612    #[allow(irrefutable_let_patterns)]
2613    pub fn into_list_options(self) -> Option<(Server_ListOptionsResponder)> {
2614        if let Server_Request::ListOptions { responder } = self { Some((responder)) } else { None }
2615    }
2616
2617    #[allow(irrefutable_let_patterns)]
2618    pub fn into_list_parameters(self) -> Option<(Server_ListParametersResponder)> {
2619        if let Server_Request::ListParameters { responder } = self {
2620            Some((responder))
2621        } else {
2622            None
2623        }
2624    }
2625
2626    #[allow(irrefutable_let_patterns)]
2627    pub fn into_reset_options(self) -> Option<(Server_ResetOptionsResponder)> {
2628        if let Server_Request::ResetOptions { responder } = self { Some((responder)) } else { None }
2629    }
2630
2631    #[allow(irrefutable_let_patterns)]
2632    pub fn into_reset_parameters(self) -> Option<(Server_ResetParametersResponder)> {
2633        if let Server_Request::ResetParameters { responder } = self {
2634            Some((responder))
2635        } else {
2636            None
2637        }
2638    }
2639
2640    #[allow(irrefutable_let_patterns)]
2641    pub fn into_clear_leases(self) -> Option<(Server_ClearLeasesResponder)> {
2642        if let Server_Request::ClearLeases { responder } = self { Some((responder)) } else { None }
2643    }
2644
2645    /// Name of the method defined in FIDL
2646    pub fn method_name(&self) -> &'static str {
2647        match *self {
2648            Server_Request::StartServing { .. } => "start_serving",
2649            Server_Request::StopServing { .. } => "stop_serving",
2650            Server_Request::IsServing { .. } => "is_serving",
2651            Server_Request::GetOption { .. } => "get_option",
2652            Server_Request::GetParameter { .. } => "get_parameter",
2653            Server_Request::SetOption { .. } => "set_option",
2654            Server_Request::SetParameter { .. } => "set_parameter",
2655            Server_Request::ListOptions { .. } => "list_options",
2656            Server_Request::ListParameters { .. } => "list_parameters",
2657            Server_Request::ResetOptions { .. } => "reset_options",
2658            Server_Request::ResetParameters { .. } => "reset_parameters",
2659            Server_Request::ClearLeases { .. } => "clear_leases",
2660        }
2661    }
2662}
2663
2664#[derive(Debug, Clone)]
2665pub struct Server_ControlHandle {
2666    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2667}
2668
2669impl fidl::endpoints::ControlHandle for Server_ControlHandle {
2670    fn shutdown(&self) {
2671        self.inner.shutdown()
2672    }
2673
2674    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2675        self.inner.shutdown_with_epitaph(status)
2676    }
2677
2678    fn is_closed(&self) -> bool {
2679        self.inner.channel().is_closed()
2680    }
2681    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2682        self.inner.channel().on_closed()
2683    }
2684
2685    #[cfg(target_os = "fuchsia")]
2686    fn signal_peer(
2687        &self,
2688        clear_mask: zx::Signals,
2689        set_mask: zx::Signals,
2690    ) -> Result<(), zx_status::Status> {
2691        use fidl::Peered;
2692        self.inner.channel().signal_peer(clear_mask, set_mask)
2693    }
2694}
2695
2696impl Server_ControlHandle {}
2697
2698#[must_use = "FIDL methods require a response to be sent"]
2699#[derive(Debug)]
2700pub struct Server_StartServingResponder {
2701    control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
2702    tx_id: u32,
2703}
2704
2705/// Set the the channel to be shutdown (see [`Server_ControlHandle::shutdown`])
2706/// if the responder is dropped without sending a response, so that the client
2707/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2708impl std::ops::Drop for Server_StartServingResponder {
2709    fn drop(&mut self) {
2710        self.control_handle.shutdown();
2711        // Safety: drops once, never accessed again
2712        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2713    }
2714}
2715
2716impl fidl::endpoints::Responder for Server_StartServingResponder {
2717    type ControlHandle = Server_ControlHandle;
2718
2719    fn control_handle(&self) -> &Server_ControlHandle {
2720        &self.control_handle
2721    }
2722
2723    fn drop_without_shutdown(mut self) {
2724        // Safety: drops once, never accessed again due to mem::forget
2725        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2726        // Prevent Drop from running (which would shut down the channel)
2727        std::mem::forget(self);
2728    }
2729}
2730
2731impl Server_StartServingResponder {
2732    /// Sends a response to the FIDL transaction.
2733    ///
2734    /// Sets the channel to shutdown if an error occurs.
2735    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2736        let _result = self.send_raw(result);
2737        if _result.is_err() {
2738            self.control_handle.shutdown();
2739        }
2740        self.drop_without_shutdown();
2741        _result
2742    }
2743
2744    /// Similar to "send" but does not shutdown the channel if an error occurs.
2745    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2746        let _result = self.send_raw(result);
2747        self.drop_without_shutdown();
2748        _result
2749    }
2750
2751    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2752        self.control_handle
2753            .inner
2754            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2755                result,
2756                self.tx_id,
2757                0x10990e324ac53cd1,
2758                fidl::encoding::DynamicFlags::empty(),
2759            )
2760    }
2761}
2762
2763#[must_use = "FIDL methods require a response to be sent"]
2764#[derive(Debug)]
2765pub struct Server_StopServingResponder {
2766    control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
2767    tx_id: u32,
2768}
2769
2770/// Set the the channel to be shutdown (see [`Server_ControlHandle::shutdown`])
2771/// if the responder is dropped without sending a response, so that the client
2772/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2773impl std::ops::Drop for Server_StopServingResponder {
2774    fn drop(&mut self) {
2775        self.control_handle.shutdown();
2776        // Safety: drops once, never accessed again
2777        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2778    }
2779}
2780
2781impl fidl::endpoints::Responder for Server_StopServingResponder {
2782    type ControlHandle = Server_ControlHandle;
2783
2784    fn control_handle(&self) -> &Server_ControlHandle {
2785        &self.control_handle
2786    }
2787
2788    fn drop_without_shutdown(mut self) {
2789        // Safety: drops once, never accessed again due to mem::forget
2790        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2791        // Prevent Drop from running (which would shut down the channel)
2792        std::mem::forget(self);
2793    }
2794}
2795
2796impl Server_StopServingResponder {
2797    /// Sends a response to the FIDL transaction.
2798    ///
2799    /// Sets the channel to shutdown if an error occurs.
2800    pub fn send(self) -> Result<(), fidl::Error> {
2801        let _result = self.send_raw();
2802        if _result.is_err() {
2803            self.control_handle.shutdown();
2804        }
2805        self.drop_without_shutdown();
2806        _result
2807    }
2808
2809    /// Similar to "send" but does not shutdown the channel if an error occurs.
2810    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2811        let _result = self.send_raw();
2812        self.drop_without_shutdown();
2813        _result
2814    }
2815
2816    fn send_raw(&self) -> Result<(), fidl::Error> {
2817        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2818            (),
2819            self.tx_id,
2820            0x7776cfe9f68a0dbe,
2821            fidl::encoding::DynamicFlags::empty(),
2822        )
2823    }
2824}
2825
2826#[must_use = "FIDL methods require a response to be sent"]
2827#[derive(Debug)]
2828pub struct Server_IsServingResponder {
2829    control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
2830    tx_id: u32,
2831}
2832
2833/// Set the the channel to be shutdown (see [`Server_ControlHandle::shutdown`])
2834/// if the responder is dropped without sending a response, so that the client
2835/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2836impl std::ops::Drop for Server_IsServingResponder {
2837    fn drop(&mut self) {
2838        self.control_handle.shutdown();
2839        // Safety: drops once, never accessed again
2840        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2841    }
2842}
2843
2844impl fidl::endpoints::Responder for Server_IsServingResponder {
2845    type ControlHandle = Server_ControlHandle;
2846
2847    fn control_handle(&self) -> &Server_ControlHandle {
2848        &self.control_handle
2849    }
2850
2851    fn drop_without_shutdown(mut self) {
2852        // Safety: drops once, never accessed again due to mem::forget
2853        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2854        // Prevent Drop from running (which would shut down the channel)
2855        std::mem::forget(self);
2856    }
2857}
2858
2859impl Server_IsServingResponder {
2860    /// Sends a response to the FIDL transaction.
2861    ///
2862    /// Sets the channel to shutdown if an error occurs.
2863    pub fn send(self, mut enabled: bool) -> Result<(), fidl::Error> {
2864        let _result = self.send_raw(enabled);
2865        if _result.is_err() {
2866            self.control_handle.shutdown();
2867        }
2868        self.drop_without_shutdown();
2869        _result
2870    }
2871
2872    /// Similar to "send" but does not shutdown the channel if an error occurs.
2873    pub fn send_no_shutdown_on_err(self, mut enabled: bool) -> Result<(), fidl::Error> {
2874        let _result = self.send_raw(enabled);
2875        self.drop_without_shutdown();
2876        _result
2877    }
2878
2879    fn send_raw(&self, mut enabled: bool) -> Result<(), fidl::Error> {
2880        self.control_handle.inner.send::<ServerIsServingResponse>(
2881            (enabled,),
2882            self.tx_id,
2883            0x45aadc35fcbe3826,
2884            fidl::encoding::DynamicFlags::empty(),
2885        )
2886    }
2887}
2888
2889#[must_use = "FIDL methods require a response to be sent"]
2890#[derive(Debug)]
2891pub struct Server_GetOptionResponder {
2892    control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
2893    tx_id: u32,
2894}
2895
2896/// Set the the channel to be shutdown (see [`Server_ControlHandle::shutdown`])
2897/// if the responder is dropped without sending a response, so that the client
2898/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2899impl std::ops::Drop for Server_GetOptionResponder {
2900    fn drop(&mut self) {
2901        self.control_handle.shutdown();
2902        // Safety: drops once, never accessed again
2903        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2904    }
2905}
2906
2907impl fidl::endpoints::Responder for Server_GetOptionResponder {
2908    type ControlHandle = Server_ControlHandle;
2909
2910    fn control_handle(&self) -> &Server_ControlHandle {
2911        &self.control_handle
2912    }
2913
2914    fn drop_without_shutdown(mut self) {
2915        // Safety: drops once, never accessed again due to mem::forget
2916        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2917        // Prevent Drop from running (which would shut down the channel)
2918        std::mem::forget(self);
2919    }
2920}
2921
2922impl Server_GetOptionResponder {
2923    /// Sends a response to the FIDL transaction.
2924    ///
2925    /// Sets the channel to shutdown if an error occurs.
2926    pub fn send(self, mut result: Result<&Option_, i32>) -> Result<(), fidl::Error> {
2927        let _result = self.send_raw(result);
2928        if _result.is_err() {
2929            self.control_handle.shutdown();
2930        }
2931        self.drop_without_shutdown();
2932        _result
2933    }
2934
2935    /// Similar to "send" but does not shutdown the channel if an error occurs.
2936    pub fn send_no_shutdown_on_err(
2937        self,
2938        mut result: Result<&Option_, i32>,
2939    ) -> Result<(), fidl::Error> {
2940        let _result = self.send_raw(result);
2941        self.drop_without_shutdown();
2942        _result
2943    }
2944
2945    fn send_raw(&self, mut result: Result<&Option_, i32>) -> Result<(), fidl::Error> {
2946        self.control_handle.inner.send::<fidl::encoding::ResultType<ServerGetOptionResponse, i32>>(
2947            result.map(|value| (value,)),
2948            self.tx_id,
2949            0x5305ee2c593f68a,
2950            fidl::encoding::DynamicFlags::empty(),
2951        )
2952    }
2953}
2954
2955#[must_use = "FIDL methods require a response to be sent"]
2956#[derive(Debug)]
2957pub struct Server_GetParameterResponder {
2958    control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
2959    tx_id: u32,
2960}
2961
2962/// Set the the channel to be shutdown (see [`Server_ControlHandle::shutdown`])
2963/// if the responder is dropped without sending a response, so that the client
2964/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2965impl std::ops::Drop for Server_GetParameterResponder {
2966    fn drop(&mut self) {
2967        self.control_handle.shutdown();
2968        // Safety: drops once, never accessed again
2969        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2970    }
2971}
2972
2973impl fidl::endpoints::Responder for Server_GetParameterResponder {
2974    type ControlHandle = Server_ControlHandle;
2975
2976    fn control_handle(&self) -> &Server_ControlHandle {
2977        &self.control_handle
2978    }
2979
2980    fn drop_without_shutdown(mut self) {
2981        // Safety: drops once, never accessed again due to mem::forget
2982        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2983        // Prevent Drop from running (which would shut down the channel)
2984        std::mem::forget(self);
2985    }
2986}
2987
2988impl Server_GetParameterResponder {
2989    /// Sends a response to the FIDL transaction.
2990    ///
2991    /// Sets the channel to shutdown if an error occurs.
2992    pub fn send(self, mut result: Result<&Parameter, i32>) -> Result<(), fidl::Error> {
2993        let _result = self.send_raw(result);
2994        if _result.is_err() {
2995            self.control_handle.shutdown();
2996        }
2997        self.drop_without_shutdown();
2998        _result
2999    }
3000
3001    /// Similar to "send" but does not shutdown the channel if an error occurs.
3002    pub fn send_no_shutdown_on_err(
3003        self,
3004        mut result: Result<&Parameter, i32>,
3005    ) -> Result<(), fidl::Error> {
3006        let _result = self.send_raw(result);
3007        self.drop_without_shutdown();
3008        _result
3009    }
3010
3011    fn send_raw(&self, mut result: Result<&Parameter, i32>) -> Result<(), fidl::Error> {
3012        self.control_handle
3013            .inner
3014            .send::<fidl::encoding::ResultType<ServerGetParameterResponse, i32>>(
3015                result.map(|value| (value,)),
3016                self.tx_id,
3017                0x1e8c98758fb82714,
3018                fidl::encoding::DynamicFlags::empty(),
3019            )
3020    }
3021}
3022
3023#[must_use = "FIDL methods require a response to be sent"]
3024#[derive(Debug)]
3025pub struct Server_SetOptionResponder {
3026    control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
3027    tx_id: u32,
3028}
3029
3030/// Set the the channel to be shutdown (see [`Server_ControlHandle::shutdown`])
3031/// if the responder is dropped without sending a response, so that the client
3032/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3033impl std::ops::Drop for Server_SetOptionResponder {
3034    fn drop(&mut self) {
3035        self.control_handle.shutdown();
3036        // Safety: drops once, never accessed again
3037        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3038    }
3039}
3040
3041impl fidl::endpoints::Responder for Server_SetOptionResponder {
3042    type ControlHandle = Server_ControlHandle;
3043
3044    fn control_handle(&self) -> &Server_ControlHandle {
3045        &self.control_handle
3046    }
3047
3048    fn drop_without_shutdown(mut self) {
3049        // Safety: drops once, never accessed again due to mem::forget
3050        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3051        // Prevent Drop from running (which would shut down the channel)
3052        std::mem::forget(self);
3053    }
3054}
3055
3056impl Server_SetOptionResponder {
3057    /// Sends a response to the FIDL transaction.
3058    ///
3059    /// Sets the channel to shutdown if an error occurs.
3060    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3061        let _result = self.send_raw(result);
3062        if _result.is_err() {
3063            self.control_handle.shutdown();
3064        }
3065        self.drop_without_shutdown();
3066        _result
3067    }
3068
3069    /// Similar to "send" but does not shutdown the channel if an error occurs.
3070    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3071        let _result = self.send_raw(result);
3072        self.drop_without_shutdown();
3073        _result
3074    }
3075
3076    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3077        self.control_handle
3078            .inner
3079            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3080                result,
3081                self.tx_id,
3082                0x63c98b670db8d96a,
3083                fidl::encoding::DynamicFlags::empty(),
3084            )
3085    }
3086}
3087
3088#[must_use = "FIDL methods require a response to be sent"]
3089#[derive(Debug)]
3090pub struct Server_SetParameterResponder {
3091    control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
3092    tx_id: u32,
3093}
3094
3095/// Set the the channel to be shutdown (see [`Server_ControlHandle::shutdown`])
3096/// if the responder is dropped without sending a response, so that the client
3097/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3098impl std::ops::Drop for Server_SetParameterResponder {
3099    fn drop(&mut self) {
3100        self.control_handle.shutdown();
3101        // Safety: drops once, never accessed again
3102        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3103    }
3104}
3105
3106impl fidl::endpoints::Responder for Server_SetParameterResponder {
3107    type ControlHandle = Server_ControlHandle;
3108
3109    fn control_handle(&self) -> &Server_ControlHandle {
3110        &self.control_handle
3111    }
3112
3113    fn drop_without_shutdown(mut self) {
3114        // Safety: drops once, never accessed again due to mem::forget
3115        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3116        // Prevent Drop from running (which would shut down the channel)
3117        std::mem::forget(self);
3118    }
3119}
3120
3121impl Server_SetParameterResponder {
3122    /// Sends a response to the FIDL transaction.
3123    ///
3124    /// Sets the channel to shutdown if an error occurs.
3125    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3126        let _result = self.send_raw(result);
3127        if _result.is_err() {
3128            self.control_handle.shutdown();
3129        }
3130        self.drop_without_shutdown();
3131        _result
3132    }
3133
3134    /// Similar to "send" but does not shutdown the channel if an error occurs.
3135    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3136        let _result = self.send_raw(result);
3137        self.drop_without_shutdown();
3138        _result
3139    }
3140
3141    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3142        self.control_handle
3143            .inner
3144            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3145                result,
3146                self.tx_id,
3147                0x3002d0d956eb4bdc,
3148                fidl::encoding::DynamicFlags::empty(),
3149            )
3150    }
3151}
3152
3153#[must_use = "FIDL methods require a response to be sent"]
3154#[derive(Debug)]
3155pub struct Server_ListOptionsResponder {
3156    control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
3157    tx_id: u32,
3158}
3159
3160/// Set the the channel to be shutdown (see [`Server_ControlHandle::shutdown`])
3161/// if the responder is dropped without sending a response, so that the client
3162/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3163impl std::ops::Drop for Server_ListOptionsResponder {
3164    fn drop(&mut self) {
3165        self.control_handle.shutdown();
3166        // Safety: drops once, never accessed again
3167        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3168    }
3169}
3170
3171impl fidl::endpoints::Responder for Server_ListOptionsResponder {
3172    type ControlHandle = Server_ControlHandle;
3173
3174    fn control_handle(&self) -> &Server_ControlHandle {
3175        &self.control_handle
3176    }
3177
3178    fn drop_without_shutdown(mut self) {
3179        // Safety: drops once, never accessed again due to mem::forget
3180        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3181        // Prevent Drop from running (which would shut down the channel)
3182        std::mem::forget(self);
3183    }
3184}
3185
3186impl Server_ListOptionsResponder {
3187    /// Sends a response to the FIDL transaction.
3188    ///
3189    /// Sets the channel to shutdown if an error occurs.
3190    pub fn send(self, mut result: Result<&[Option_], i32>) -> Result<(), fidl::Error> {
3191        let _result = self.send_raw(result);
3192        if _result.is_err() {
3193            self.control_handle.shutdown();
3194        }
3195        self.drop_without_shutdown();
3196        _result
3197    }
3198
3199    /// Similar to "send" but does not shutdown the channel if an error occurs.
3200    pub fn send_no_shutdown_on_err(
3201        self,
3202        mut result: Result<&[Option_], i32>,
3203    ) -> Result<(), fidl::Error> {
3204        let _result = self.send_raw(result);
3205        self.drop_without_shutdown();
3206        _result
3207    }
3208
3209    fn send_raw(&self, mut result: Result<&[Option_], i32>) -> Result<(), fidl::Error> {
3210        self.control_handle
3211            .inner
3212            .send::<fidl::encoding::ResultType<ServerListOptionsResponse, i32>>(
3213                result.map(|options| (options,)),
3214                self.tx_id,
3215                0x72c8161c69ca67b,
3216                fidl::encoding::DynamicFlags::empty(),
3217            )
3218    }
3219}
3220
3221#[must_use = "FIDL methods require a response to be sent"]
3222#[derive(Debug)]
3223pub struct Server_ListParametersResponder {
3224    control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
3225    tx_id: u32,
3226}
3227
3228/// Set the the channel to be shutdown (see [`Server_ControlHandle::shutdown`])
3229/// if the responder is dropped without sending a response, so that the client
3230/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3231impl std::ops::Drop for Server_ListParametersResponder {
3232    fn drop(&mut self) {
3233        self.control_handle.shutdown();
3234        // Safety: drops once, never accessed again
3235        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3236    }
3237}
3238
3239impl fidl::endpoints::Responder for Server_ListParametersResponder {
3240    type ControlHandle = Server_ControlHandle;
3241
3242    fn control_handle(&self) -> &Server_ControlHandle {
3243        &self.control_handle
3244    }
3245
3246    fn drop_without_shutdown(mut self) {
3247        // Safety: drops once, never accessed again due to mem::forget
3248        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3249        // Prevent Drop from running (which would shut down the channel)
3250        std::mem::forget(self);
3251    }
3252}
3253
3254impl Server_ListParametersResponder {
3255    /// Sends a response to the FIDL transaction.
3256    ///
3257    /// Sets the channel to shutdown if an error occurs.
3258    pub fn send(self, mut result: Result<&[Parameter], i32>) -> Result<(), fidl::Error> {
3259        let _result = self.send_raw(result);
3260        if _result.is_err() {
3261            self.control_handle.shutdown();
3262        }
3263        self.drop_without_shutdown();
3264        _result
3265    }
3266
3267    /// Similar to "send" but does not shutdown the channel if an error occurs.
3268    pub fn send_no_shutdown_on_err(
3269        self,
3270        mut result: Result<&[Parameter], i32>,
3271    ) -> Result<(), fidl::Error> {
3272        let _result = self.send_raw(result);
3273        self.drop_without_shutdown();
3274        _result
3275    }
3276
3277    fn send_raw(&self, mut result: Result<&[Parameter], i32>) -> Result<(), fidl::Error> {
3278        self.control_handle
3279            .inner
3280            .send::<fidl::encoding::ResultType<ServerListParametersResponse, i32>>(
3281                result.map(|parameters| (parameters,)),
3282                self.tx_id,
3283                0xa201b1d6d121c59,
3284                fidl::encoding::DynamicFlags::empty(),
3285            )
3286    }
3287}
3288
3289#[must_use = "FIDL methods require a response to be sent"]
3290#[derive(Debug)]
3291pub struct Server_ResetOptionsResponder {
3292    control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
3293    tx_id: u32,
3294}
3295
3296/// Set the the channel to be shutdown (see [`Server_ControlHandle::shutdown`])
3297/// if the responder is dropped without sending a response, so that the client
3298/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3299impl std::ops::Drop for Server_ResetOptionsResponder {
3300    fn drop(&mut self) {
3301        self.control_handle.shutdown();
3302        // Safety: drops once, never accessed again
3303        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3304    }
3305}
3306
3307impl fidl::endpoints::Responder for Server_ResetOptionsResponder {
3308    type ControlHandle = Server_ControlHandle;
3309
3310    fn control_handle(&self) -> &Server_ControlHandle {
3311        &self.control_handle
3312    }
3313
3314    fn drop_without_shutdown(mut self) {
3315        // Safety: drops once, never accessed again due to mem::forget
3316        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3317        // Prevent Drop from running (which would shut down the channel)
3318        std::mem::forget(self);
3319    }
3320}
3321
3322impl Server_ResetOptionsResponder {
3323    /// Sends a response to the FIDL transaction.
3324    ///
3325    /// Sets the channel to shutdown if an error occurs.
3326    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3327        let _result = self.send_raw(result);
3328        if _result.is_err() {
3329            self.control_handle.shutdown();
3330        }
3331        self.drop_without_shutdown();
3332        _result
3333    }
3334
3335    /// Similar to "send" but does not shutdown the channel if an error occurs.
3336    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3337        let _result = self.send_raw(result);
3338        self.drop_without_shutdown();
3339        _result
3340    }
3341
3342    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3343        self.control_handle
3344            .inner
3345            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3346                result,
3347                self.tx_id,
3348                0x31014911fd21cc13,
3349                fidl::encoding::DynamicFlags::empty(),
3350            )
3351    }
3352}
3353
3354#[must_use = "FIDL methods require a response to be sent"]
3355#[derive(Debug)]
3356pub struct Server_ResetParametersResponder {
3357    control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
3358    tx_id: u32,
3359}
3360
3361/// Set the the channel to be shutdown (see [`Server_ControlHandle::shutdown`])
3362/// if the responder is dropped without sending a response, so that the client
3363/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3364impl std::ops::Drop for Server_ResetParametersResponder {
3365    fn drop(&mut self) {
3366        self.control_handle.shutdown();
3367        // Safety: drops once, never accessed again
3368        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3369    }
3370}
3371
3372impl fidl::endpoints::Responder for Server_ResetParametersResponder {
3373    type ControlHandle = Server_ControlHandle;
3374
3375    fn control_handle(&self) -> &Server_ControlHandle {
3376        &self.control_handle
3377    }
3378
3379    fn drop_without_shutdown(mut self) {
3380        // Safety: drops once, never accessed again due to mem::forget
3381        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3382        // Prevent Drop from running (which would shut down the channel)
3383        std::mem::forget(self);
3384    }
3385}
3386
3387impl Server_ResetParametersResponder {
3388    /// Sends a response to the FIDL transaction.
3389    ///
3390    /// Sets the channel to shutdown if an error occurs.
3391    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3392        let _result = self.send_raw(result);
3393        if _result.is_err() {
3394            self.control_handle.shutdown();
3395        }
3396        self.drop_without_shutdown();
3397        _result
3398    }
3399
3400    /// Similar to "send" but does not shutdown the channel if an error occurs.
3401    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3402        let _result = self.send_raw(result);
3403        self.drop_without_shutdown();
3404        _result
3405    }
3406
3407    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3408        self.control_handle
3409            .inner
3410            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3411                result,
3412                self.tx_id,
3413                0x353fba50bcf4ecec,
3414                fidl::encoding::DynamicFlags::empty(),
3415            )
3416    }
3417}
3418
3419#[must_use = "FIDL methods require a response to be sent"]
3420#[derive(Debug)]
3421pub struct Server_ClearLeasesResponder {
3422    control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
3423    tx_id: u32,
3424}
3425
3426/// Set the the channel to be shutdown (see [`Server_ControlHandle::shutdown`])
3427/// if the responder is dropped without sending a response, so that the client
3428/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3429impl std::ops::Drop for Server_ClearLeasesResponder {
3430    fn drop(&mut self) {
3431        self.control_handle.shutdown();
3432        // Safety: drops once, never accessed again
3433        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3434    }
3435}
3436
3437impl fidl::endpoints::Responder for Server_ClearLeasesResponder {
3438    type ControlHandle = Server_ControlHandle;
3439
3440    fn control_handle(&self) -> &Server_ControlHandle {
3441        &self.control_handle
3442    }
3443
3444    fn drop_without_shutdown(mut self) {
3445        // Safety: drops once, never accessed again due to mem::forget
3446        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3447        // Prevent Drop from running (which would shut down the channel)
3448        std::mem::forget(self);
3449    }
3450}
3451
3452impl Server_ClearLeasesResponder {
3453    /// Sends a response to the FIDL transaction.
3454    ///
3455    /// Sets the channel to shutdown if an error occurs.
3456    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3457        let _result = self.send_raw(result);
3458        if _result.is_err() {
3459            self.control_handle.shutdown();
3460        }
3461        self.drop_without_shutdown();
3462        _result
3463    }
3464
3465    /// Similar to "send" but does not shutdown the channel if an error occurs.
3466    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3467        let _result = self.send_raw(result);
3468        self.drop_without_shutdown();
3469        _result
3470    }
3471
3472    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3473        self.control_handle
3474            .inner
3475            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3476                result,
3477                self.tx_id,
3478                0xe39e35cda85a04d,
3479                fidl::encoding::DynamicFlags::empty(),
3480            )
3481    }
3482}
3483
3484mod internal {
3485    use super::*;
3486
3487    impl fidl::encoding::ResourceTypeMarker for ClientProviderNewClientRequest {
3488        type Borrowed<'a> = &'a mut Self;
3489        fn take_or_borrow<'a>(
3490            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3491        ) -> Self::Borrowed<'a> {
3492            value
3493        }
3494    }
3495
3496    unsafe impl fidl::encoding::TypeMarker for ClientProviderNewClientRequest {
3497        type Owned = Self;
3498
3499        #[inline(always)]
3500        fn inline_align(_context: fidl::encoding::Context) -> usize {
3501            8
3502        }
3503
3504        #[inline(always)]
3505        fn inline_size(_context: fidl::encoding::Context) -> usize {
3506            32
3507        }
3508    }
3509
3510    unsafe impl
3511        fidl::encoding::Encode<
3512            ClientProviderNewClientRequest,
3513            fidl::encoding::DefaultFuchsiaResourceDialect,
3514        > for &mut ClientProviderNewClientRequest
3515    {
3516        #[inline]
3517        unsafe fn encode(
3518            self,
3519            encoder: &mut fidl::encoding::Encoder<
3520                '_,
3521                fidl::encoding::DefaultFuchsiaResourceDialect,
3522            >,
3523            offset: usize,
3524            _depth: fidl::encoding::Depth,
3525        ) -> fidl::Result<()> {
3526            encoder.debug_check_bounds::<ClientProviderNewClientRequest>(offset);
3527            // Delegate to tuple encoding.
3528            fidl::encoding::Encode::<ClientProviderNewClientRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3529                (
3530                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.interface_id),
3531                    <NewClientParams as fidl::encoding::ValueTypeMarker>::borrow(&self.params),
3532                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClientMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.request),
3533                ),
3534                encoder, offset, _depth
3535            )
3536        }
3537    }
3538    unsafe impl<
3539        T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
3540        T1: fidl::encoding::Encode<NewClientParams, fidl::encoding::DefaultFuchsiaResourceDialect>,
3541        T2: fidl::encoding::Encode<
3542                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClientMarker>>,
3543                fidl::encoding::DefaultFuchsiaResourceDialect,
3544            >,
3545    >
3546        fidl::encoding::Encode<
3547            ClientProviderNewClientRequest,
3548            fidl::encoding::DefaultFuchsiaResourceDialect,
3549        > for (T0, T1, T2)
3550    {
3551        #[inline]
3552        unsafe fn encode(
3553            self,
3554            encoder: &mut fidl::encoding::Encoder<
3555                '_,
3556                fidl::encoding::DefaultFuchsiaResourceDialect,
3557            >,
3558            offset: usize,
3559            depth: fidl::encoding::Depth,
3560        ) -> fidl::Result<()> {
3561            encoder.debug_check_bounds::<ClientProviderNewClientRequest>(offset);
3562            // Zero out padding regions. There's no need to apply masks
3563            // because the unmasked parts will be overwritten by fields.
3564            unsafe {
3565                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
3566                (ptr as *mut u64).write_unaligned(0);
3567            }
3568            // Write the fields.
3569            self.0.encode(encoder, offset + 0, depth)?;
3570            self.1.encode(encoder, offset + 8, depth)?;
3571            self.2.encode(encoder, offset + 24, depth)?;
3572            Ok(())
3573        }
3574    }
3575
3576    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3577        for ClientProviderNewClientRequest
3578    {
3579        #[inline(always)]
3580        fn new_empty() -> Self {
3581            Self {
3582                interface_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
3583                params: fidl::new_empty!(
3584                    NewClientParams,
3585                    fidl::encoding::DefaultFuchsiaResourceDialect
3586                ),
3587                request: fidl::new_empty!(
3588                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClientMarker>>,
3589                    fidl::encoding::DefaultFuchsiaResourceDialect
3590                ),
3591            }
3592        }
3593
3594        #[inline]
3595        unsafe fn decode(
3596            &mut self,
3597            decoder: &mut fidl::encoding::Decoder<
3598                '_,
3599                fidl::encoding::DefaultFuchsiaResourceDialect,
3600            >,
3601            offset: usize,
3602            _depth: fidl::encoding::Depth,
3603        ) -> fidl::Result<()> {
3604            decoder.debug_check_bounds::<Self>(offset);
3605            // Verify that padding bytes are zero.
3606            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
3607            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3608            let mask = 0xffffffff00000000u64;
3609            let maskedval = padval & mask;
3610            if maskedval != 0 {
3611                return Err(fidl::Error::NonZeroPadding {
3612                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
3613                });
3614            }
3615            fidl::decode!(
3616                u64,
3617                fidl::encoding::DefaultFuchsiaResourceDialect,
3618                &mut self.interface_id,
3619                decoder,
3620                offset + 0,
3621                _depth
3622            )?;
3623            fidl::decode!(
3624                NewClientParams,
3625                fidl::encoding::DefaultFuchsiaResourceDialect,
3626                &mut self.params,
3627                decoder,
3628                offset + 8,
3629                _depth
3630            )?;
3631            fidl::decode!(
3632                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClientMarker>>,
3633                fidl::encoding::DefaultFuchsiaResourceDialect,
3634                &mut self.request,
3635                decoder,
3636                offset + 24,
3637                _depth
3638            )?;
3639            Ok(())
3640        }
3641    }
3642
3643    impl Address {
3644        #[inline(always)]
3645        fn max_ordinal_present(&self) -> u64 {
3646            if let Some(_) = self.address_state_provider {
3647                return 3;
3648            }
3649            if let Some(_) = self.address_parameters {
3650                return 2;
3651            }
3652            if let Some(_) = self.address {
3653                return 1;
3654            }
3655            0
3656        }
3657    }
3658
3659    impl fidl::encoding::ResourceTypeMarker for Address {
3660        type Borrowed<'a> = &'a mut Self;
3661        fn take_or_borrow<'a>(
3662            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3663        ) -> Self::Borrowed<'a> {
3664            value
3665        }
3666    }
3667
3668    unsafe impl fidl::encoding::TypeMarker for Address {
3669        type Owned = Self;
3670
3671        #[inline(always)]
3672        fn inline_align(_context: fidl::encoding::Context) -> usize {
3673            8
3674        }
3675
3676        #[inline(always)]
3677        fn inline_size(_context: fidl::encoding::Context) -> usize {
3678            16
3679        }
3680    }
3681
3682    unsafe impl fidl::encoding::Encode<Address, fidl::encoding::DefaultFuchsiaResourceDialect>
3683        for &mut Address
3684    {
3685        unsafe fn encode(
3686            self,
3687            encoder: &mut fidl::encoding::Encoder<
3688                '_,
3689                fidl::encoding::DefaultFuchsiaResourceDialect,
3690            >,
3691            offset: usize,
3692            mut depth: fidl::encoding::Depth,
3693        ) -> fidl::Result<()> {
3694            encoder.debug_check_bounds::<Address>(offset);
3695            // Vector header
3696            let max_ordinal: u64 = self.max_ordinal_present();
3697            encoder.write_num(max_ordinal, offset);
3698            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3699            // Calling encoder.out_of_line_offset(0) is not allowed.
3700            if max_ordinal == 0 {
3701                return Ok(());
3702            }
3703            depth.increment()?;
3704            let envelope_size = 8;
3705            let bytes_len = max_ordinal as usize * envelope_size;
3706            #[allow(unused_variables)]
3707            let offset = encoder.out_of_line_offset(bytes_len);
3708            let mut _prev_end_offset: usize = 0;
3709            if 1 > max_ordinal {
3710                return Ok(());
3711            }
3712
3713            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3714            // are envelope_size bytes.
3715            let cur_offset: usize = (1 - 1) * envelope_size;
3716
3717            // Zero reserved fields.
3718            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3719
3720            // Safety:
3721            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3722            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3723            //   envelope_size bytes, there is always sufficient room.
3724            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net::Ipv4AddressWithPrefix, fidl::encoding::DefaultFuchsiaResourceDialect>(
3725            self.address.as_ref().map(<fidl_fuchsia_net::Ipv4AddressWithPrefix as fidl::encoding::ValueTypeMarker>::borrow),
3726            encoder, offset + cur_offset, depth
3727        )?;
3728
3729            _prev_end_offset = cur_offset + envelope_size;
3730            if 2 > max_ordinal {
3731                return Ok(());
3732            }
3733
3734            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3735            // are envelope_size bytes.
3736            let cur_offset: usize = (2 - 1) * envelope_size;
3737
3738            // Zero reserved fields.
3739            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3740
3741            // Safety:
3742            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3743            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3744            //   envelope_size bytes, there is always sufficient room.
3745            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net_interfaces_admin::AddressParameters, fidl::encoding::DefaultFuchsiaResourceDialect>(
3746            self.address_parameters.as_ref().map(<fidl_fuchsia_net_interfaces_admin::AddressParameters as fidl::encoding::ValueTypeMarker>::borrow),
3747            encoder, offset + cur_offset, depth
3748        )?;
3749
3750            _prev_end_offset = cur_offset + envelope_size;
3751            if 3 > max_ordinal {
3752                return Ok(());
3753            }
3754
3755            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3756            // are envelope_size bytes.
3757            let cur_offset: usize = (3 - 1) * envelope_size;
3758
3759            // Zero reserved fields.
3760            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3761
3762            // Safety:
3763            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3764            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3765            //   envelope_size bytes, there is always sufficient room.
3766            fidl::encoding::encode_in_envelope_optional::<
3767                fidl::encoding::Endpoint<
3768                    fidl::endpoints::ServerEnd<
3769                        fidl_fuchsia_net_interfaces_admin::AddressStateProviderMarker,
3770                    >,
3771                >,
3772                fidl::encoding::DefaultFuchsiaResourceDialect,
3773            >(
3774                self.address_state_provider.as_mut().map(
3775                    <fidl::encoding::Endpoint<
3776                        fidl::endpoints::ServerEnd<
3777                            fidl_fuchsia_net_interfaces_admin::AddressStateProviderMarker,
3778                        >,
3779                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3780                ),
3781                encoder,
3782                offset + cur_offset,
3783                depth,
3784            )?;
3785
3786            _prev_end_offset = cur_offset + envelope_size;
3787
3788            Ok(())
3789        }
3790    }
3791
3792    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Address {
3793        #[inline(always)]
3794        fn new_empty() -> Self {
3795            Self::default()
3796        }
3797
3798        unsafe fn decode(
3799            &mut self,
3800            decoder: &mut fidl::encoding::Decoder<
3801                '_,
3802                fidl::encoding::DefaultFuchsiaResourceDialect,
3803            >,
3804            offset: usize,
3805            mut depth: fidl::encoding::Depth,
3806        ) -> fidl::Result<()> {
3807            decoder.debug_check_bounds::<Self>(offset);
3808            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3809                None => return Err(fidl::Error::NotNullable),
3810                Some(len) => len,
3811            };
3812            // Calling decoder.out_of_line_offset(0) is not allowed.
3813            if len == 0 {
3814                return Ok(());
3815            };
3816            depth.increment()?;
3817            let envelope_size = 8;
3818            let bytes_len = len * envelope_size;
3819            let offset = decoder.out_of_line_offset(bytes_len)?;
3820            // Decode the envelope for each type.
3821            let mut _next_ordinal_to_read = 0;
3822            let mut next_offset = offset;
3823            let end_offset = offset + bytes_len;
3824            _next_ordinal_to_read += 1;
3825            if next_offset >= end_offset {
3826                return Ok(());
3827            }
3828
3829            // Decode unknown envelopes for gaps in ordinals.
3830            while _next_ordinal_to_read < 1 {
3831                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3832                _next_ordinal_to_read += 1;
3833                next_offset += envelope_size;
3834            }
3835
3836            let next_out_of_line = decoder.next_out_of_line();
3837            let handles_before = decoder.remaining_handles();
3838            if let Some((inlined, num_bytes, num_handles)) =
3839                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3840            {
3841                let member_inline_size = <fidl_fuchsia_net::Ipv4AddressWithPrefix as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3842                if inlined != (member_inline_size <= 4) {
3843                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3844                }
3845                let inner_offset;
3846                let mut inner_depth = depth.clone();
3847                if inlined {
3848                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3849                    inner_offset = next_offset;
3850                } else {
3851                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3852                    inner_depth.increment()?;
3853                }
3854                let val_ref = self.address.get_or_insert_with(|| {
3855                    fidl::new_empty!(
3856                        fidl_fuchsia_net::Ipv4AddressWithPrefix,
3857                        fidl::encoding::DefaultFuchsiaResourceDialect
3858                    )
3859                });
3860                fidl::decode!(
3861                    fidl_fuchsia_net::Ipv4AddressWithPrefix,
3862                    fidl::encoding::DefaultFuchsiaResourceDialect,
3863                    val_ref,
3864                    decoder,
3865                    inner_offset,
3866                    inner_depth
3867                )?;
3868                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3869                {
3870                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3871                }
3872                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3873                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3874                }
3875            }
3876
3877            next_offset += envelope_size;
3878            _next_ordinal_to_read += 1;
3879            if next_offset >= end_offset {
3880                return Ok(());
3881            }
3882
3883            // Decode unknown envelopes for gaps in ordinals.
3884            while _next_ordinal_to_read < 2 {
3885                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3886                _next_ordinal_to_read += 1;
3887                next_offset += envelope_size;
3888            }
3889
3890            let next_out_of_line = decoder.next_out_of_line();
3891            let handles_before = decoder.remaining_handles();
3892            if let Some((inlined, num_bytes, num_handles)) =
3893                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3894            {
3895                let member_inline_size = <fidl_fuchsia_net_interfaces_admin::AddressParameters as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3896                if inlined != (member_inline_size <= 4) {
3897                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3898                }
3899                let inner_offset;
3900                let mut inner_depth = depth.clone();
3901                if inlined {
3902                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3903                    inner_offset = next_offset;
3904                } else {
3905                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3906                    inner_depth.increment()?;
3907                }
3908                let val_ref = self.address_parameters.get_or_insert_with(|| {
3909                    fidl::new_empty!(
3910                        fidl_fuchsia_net_interfaces_admin::AddressParameters,
3911                        fidl::encoding::DefaultFuchsiaResourceDialect
3912                    )
3913                });
3914                fidl::decode!(
3915                    fidl_fuchsia_net_interfaces_admin::AddressParameters,
3916                    fidl::encoding::DefaultFuchsiaResourceDialect,
3917                    val_ref,
3918                    decoder,
3919                    inner_offset,
3920                    inner_depth
3921                )?;
3922                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3923                {
3924                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3925                }
3926                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3927                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3928                }
3929            }
3930
3931            next_offset += envelope_size;
3932            _next_ordinal_to_read += 1;
3933            if next_offset >= end_offset {
3934                return Ok(());
3935            }
3936
3937            // Decode unknown envelopes for gaps in ordinals.
3938            while _next_ordinal_to_read < 3 {
3939                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3940                _next_ordinal_to_read += 1;
3941                next_offset += envelope_size;
3942            }
3943
3944            let next_out_of_line = decoder.next_out_of_line();
3945            let handles_before = decoder.remaining_handles();
3946            if let Some((inlined, num_bytes, num_handles)) =
3947                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3948            {
3949                let member_inline_size = <fidl::encoding::Endpoint<
3950                    fidl::endpoints::ServerEnd<
3951                        fidl_fuchsia_net_interfaces_admin::AddressStateProviderMarker,
3952                    >,
3953                > as fidl::encoding::TypeMarker>::inline_size(
3954                    decoder.context
3955                );
3956                if inlined != (member_inline_size <= 4) {
3957                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3958                }
3959                let inner_offset;
3960                let mut inner_depth = depth.clone();
3961                if inlined {
3962                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3963                    inner_offset = next_offset;
3964                } else {
3965                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3966                    inner_depth.increment()?;
3967                }
3968                let val_ref = self.address_state_provider.get_or_insert_with(|| {
3969                    fidl::new_empty!(
3970                        fidl::encoding::Endpoint<
3971                            fidl::endpoints::ServerEnd<
3972                                fidl_fuchsia_net_interfaces_admin::AddressStateProviderMarker,
3973                            >,
3974                        >,
3975                        fidl::encoding::DefaultFuchsiaResourceDialect
3976                    )
3977                });
3978                fidl::decode!(
3979                    fidl::encoding::Endpoint<
3980                        fidl::endpoints::ServerEnd<
3981                            fidl_fuchsia_net_interfaces_admin::AddressStateProviderMarker,
3982                        >,
3983                    >,
3984                    fidl::encoding::DefaultFuchsiaResourceDialect,
3985                    val_ref,
3986                    decoder,
3987                    inner_offset,
3988                    inner_depth
3989                )?;
3990                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3991                {
3992                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3993                }
3994                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3995                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3996                }
3997            }
3998
3999            next_offset += envelope_size;
4000
4001            // Decode the remaining unknown envelopes.
4002            while next_offset < end_offset {
4003                _next_ordinal_to_read += 1;
4004                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4005                next_offset += envelope_size;
4006            }
4007
4008            Ok(())
4009        }
4010    }
4011
4012    impl ClientWatchConfigurationResponse {
4013        #[inline(always)]
4014        fn max_ordinal_present(&self) -> u64 {
4015            if let Some(_) = self.routers {
4016                return 3;
4017            }
4018            if let Some(_) = self.dns_servers {
4019                return 2;
4020            }
4021            if let Some(_) = self.address {
4022                return 1;
4023            }
4024            0
4025        }
4026    }
4027
4028    impl fidl::encoding::ResourceTypeMarker for ClientWatchConfigurationResponse {
4029        type Borrowed<'a> = &'a mut Self;
4030        fn take_or_borrow<'a>(
4031            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4032        ) -> Self::Borrowed<'a> {
4033            value
4034        }
4035    }
4036
4037    unsafe impl fidl::encoding::TypeMarker for ClientWatchConfigurationResponse {
4038        type Owned = Self;
4039
4040        #[inline(always)]
4041        fn inline_align(_context: fidl::encoding::Context) -> usize {
4042            8
4043        }
4044
4045        #[inline(always)]
4046        fn inline_size(_context: fidl::encoding::Context) -> usize {
4047            16
4048        }
4049    }
4050
4051    unsafe impl
4052        fidl::encoding::Encode<
4053            ClientWatchConfigurationResponse,
4054            fidl::encoding::DefaultFuchsiaResourceDialect,
4055        > for &mut ClientWatchConfigurationResponse
4056    {
4057        unsafe fn encode(
4058            self,
4059            encoder: &mut fidl::encoding::Encoder<
4060                '_,
4061                fidl::encoding::DefaultFuchsiaResourceDialect,
4062            >,
4063            offset: usize,
4064            mut depth: fidl::encoding::Depth,
4065        ) -> fidl::Result<()> {
4066            encoder.debug_check_bounds::<ClientWatchConfigurationResponse>(offset);
4067            // Vector header
4068            let max_ordinal: u64 = self.max_ordinal_present();
4069            encoder.write_num(max_ordinal, offset);
4070            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4071            // Calling encoder.out_of_line_offset(0) is not allowed.
4072            if max_ordinal == 0 {
4073                return Ok(());
4074            }
4075            depth.increment()?;
4076            let envelope_size = 8;
4077            let bytes_len = max_ordinal as usize * envelope_size;
4078            #[allow(unused_variables)]
4079            let offset = encoder.out_of_line_offset(bytes_len);
4080            let mut _prev_end_offset: usize = 0;
4081            if 1 > max_ordinal {
4082                return Ok(());
4083            }
4084
4085            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4086            // are envelope_size bytes.
4087            let cur_offset: usize = (1 - 1) * envelope_size;
4088
4089            // Zero reserved fields.
4090            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4091
4092            // Safety:
4093            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4094            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4095            //   envelope_size bytes, there is always sufficient room.
4096            fidl::encoding::encode_in_envelope_optional::<
4097                Address,
4098                fidl::encoding::DefaultFuchsiaResourceDialect,
4099            >(
4100                self.address
4101                    .as_mut()
4102                    .map(<Address as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
4103                encoder,
4104                offset + cur_offset,
4105                depth,
4106            )?;
4107
4108            _prev_end_offset = cur_offset + envelope_size;
4109            if 2 > max_ordinal {
4110                return Ok(());
4111            }
4112
4113            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4114            // are envelope_size bytes.
4115            let cur_offset: usize = (2 - 1) * envelope_size;
4116
4117            // Zero reserved fields.
4118            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4119
4120            // Safety:
4121            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4122            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4123            //   envelope_size bytes, there is always sufficient room.
4124            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4125            self.dns_servers.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64> as fidl::encoding::ValueTypeMarker>::borrow),
4126            encoder, offset + cur_offset, depth
4127        )?;
4128
4129            _prev_end_offset = cur_offset + envelope_size;
4130            if 3 > max_ordinal {
4131                return Ok(());
4132            }
4133
4134            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4135            // are envelope_size bytes.
4136            let cur_offset: usize = (3 - 1) * envelope_size;
4137
4138            // Zero reserved fields.
4139            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4140
4141            // Safety:
4142            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4143            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4144            //   envelope_size bytes, there is always sufficient room.
4145            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4146            self.routers.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64> as fidl::encoding::ValueTypeMarker>::borrow),
4147            encoder, offset + cur_offset, depth
4148        )?;
4149
4150            _prev_end_offset = cur_offset + envelope_size;
4151
4152            Ok(())
4153        }
4154    }
4155
4156    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4157        for ClientWatchConfigurationResponse
4158    {
4159        #[inline(always)]
4160        fn new_empty() -> Self {
4161            Self::default()
4162        }
4163
4164        unsafe fn decode(
4165            &mut self,
4166            decoder: &mut fidl::encoding::Decoder<
4167                '_,
4168                fidl::encoding::DefaultFuchsiaResourceDialect,
4169            >,
4170            offset: usize,
4171            mut depth: fidl::encoding::Depth,
4172        ) -> fidl::Result<()> {
4173            decoder.debug_check_bounds::<Self>(offset);
4174            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4175                None => return Err(fidl::Error::NotNullable),
4176                Some(len) => len,
4177            };
4178            // Calling decoder.out_of_line_offset(0) is not allowed.
4179            if len == 0 {
4180                return Ok(());
4181            };
4182            depth.increment()?;
4183            let envelope_size = 8;
4184            let bytes_len = len * envelope_size;
4185            let offset = decoder.out_of_line_offset(bytes_len)?;
4186            // Decode the envelope for each type.
4187            let mut _next_ordinal_to_read = 0;
4188            let mut next_offset = offset;
4189            let end_offset = offset + bytes_len;
4190            _next_ordinal_to_read += 1;
4191            if next_offset >= end_offset {
4192                return Ok(());
4193            }
4194
4195            // Decode unknown envelopes for gaps in ordinals.
4196            while _next_ordinal_to_read < 1 {
4197                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4198                _next_ordinal_to_read += 1;
4199                next_offset += envelope_size;
4200            }
4201
4202            let next_out_of_line = decoder.next_out_of_line();
4203            let handles_before = decoder.remaining_handles();
4204            if let Some((inlined, num_bytes, num_handles)) =
4205                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4206            {
4207                let member_inline_size =
4208                    <Address as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4209                if inlined != (member_inline_size <= 4) {
4210                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4211                }
4212                let inner_offset;
4213                let mut inner_depth = depth.clone();
4214                if inlined {
4215                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4216                    inner_offset = next_offset;
4217                } else {
4218                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4219                    inner_depth.increment()?;
4220                }
4221                let val_ref = self.address.get_or_insert_with(|| {
4222                    fidl::new_empty!(Address, fidl::encoding::DefaultFuchsiaResourceDialect)
4223                });
4224                fidl::decode!(
4225                    Address,
4226                    fidl::encoding::DefaultFuchsiaResourceDialect,
4227                    val_ref,
4228                    decoder,
4229                    inner_offset,
4230                    inner_depth
4231                )?;
4232                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4233                {
4234                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4235                }
4236                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4237                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4238                }
4239            }
4240
4241            next_offset += envelope_size;
4242            _next_ordinal_to_read += 1;
4243            if next_offset >= end_offset {
4244                return Ok(());
4245            }
4246
4247            // Decode unknown envelopes for gaps in ordinals.
4248            while _next_ordinal_to_read < 2 {
4249                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4250                _next_ordinal_to_read += 1;
4251                next_offset += envelope_size;
4252            }
4253
4254            let next_out_of_line = decoder.next_out_of_line();
4255            let handles_before = decoder.remaining_handles();
4256            if let Some((inlined, num_bytes, num_handles)) =
4257                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4258            {
4259                let member_inline_size = <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4260                if inlined != (member_inline_size <= 4) {
4261                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4262                }
4263                let inner_offset;
4264                let mut inner_depth = depth.clone();
4265                if inlined {
4266                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4267                    inner_offset = next_offset;
4268                } else {
4269                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4270                    inner_depth.increment()?;
4271                }
4272                let val_ref =
4273                self.dns_servers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect));
4274                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4275                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4276                {
4277                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4278                }
4279                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4280                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4281                }
4282            }
4283
4284            next_offset += envelope_size;
4285            _next_ordinal_to_read += 1;
4286            if next_offset >= end_offset {
4287                return Ok(());
4288            }
4289
4290            // Decode unknown envelopes for gaps in ordinals.
4291            while _next_ordinal_to_read < 3 {
4292                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4293                _next_ordinal_to_read += 1;
4294                next_offset += envelope_size;
4295            }
4296
4297            let next_out_of_line = decoder.next_out_of_line();
4298            let handles_before = decoder.remaining_handles();
4299            if let Some((inlined, num_bytes, num_handles)) =
4300                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4301            {
4302                let member_inline_size = <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4303                if inlined != (member_inline_size <= 4) {
4304                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4305                }
4306                let inner_offset;
4307                let mut inner_depth = depth.clone();
4308                if inlined {
4309                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4310                    inner_offset = next_offset;
4311                } else {
4312                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4313                    inner_depth.increment()?;
4314                }
4315                let val_ref =
4316                self.routers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect));
4317                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4318                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4319                {
4320                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4321                }
4322                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4323                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4324                }
4325            }
4326
4327            next_offset += envelope_size;
4328
4329            // Decode the remaining unknown envelopes.
4330            while next_offset < end_offset {
4331                _next_ordinal_to_read += 1;
4332                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4333                next_offset += envelope_size;
4334            }
4335
4336            Ok(())
4337        }
4338    }
4339}