Skip to main content

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