Skip to main content

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