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