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