fidl_fuchsia_net_dhcp/
fidl_fuchsia_net_dhcp.rs

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