1#![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 pub interface_id: u64,
18 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 pub address: Option<fidl_fuchsia_net::Ipv4AddressWithPrefix>,
34 pub address_parameters: Option<fidl_fuchsia_net_interfaces_admin::AddressParameters>,
36 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 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 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 pub fn r#shutdown(&self) -> Result<(), fidl::Error> {
174 self.client.send::<fidl::encoding::EmptyPayload>(
175 (),
176 0x265a3213e9a8abde,
177 fidl::encoding::DynamicFlags::empty(),
178 )
179 }
180}
181
182#[cfg(target_os = "fuchsia")]
183impl From<ClientSynchronousProxy> for zx::Handle {
184 fn from(value: ClientSynchronousProxy) -> Self {
185 value.into_channel().into()
186 }
187}
188
189#[cfg(target_os = "fuchsia")]
190impl From<fidl::Channel> for ClientSynchronousProxy {
191 fn from(value: fidl::Channel) -> Self {
192 Self::new(value)
193 }
194}
195
196#[derive(Debug, Clone)]
197pub struct ClientProxy {
198 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
199}
200
201impl fidl::endpoints::Proxy for ClientProxy {
202 type Protocol = ClientMarker;
203
204 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
205 Self::new(inner)
206 }
207
208 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
209 self.client.into_channel().map_err(|client| Self { client })
210 }
211
212 fn as_channel(&self) -> &::fidl::AsyncChannel {
213 self.client.as_channel()
214 }
215}
216
217impl ClientProxy {
218 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
220 let protocol_name = <ClientMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
221 Self { client: fidl::client::Client::new(channel, protocol_name) }
222 }
223
224 pub fn take_event_stream(&self) -> ClientEventStream {
230 ClientEventStream { event_receiver: self.client.take_event_receiver() }
231 }
232
233 pub fn r#watch_configuration(
261 &self,
262 ) -> fidl::client::QueryResponseFut<
263 ClientWatchConfigurationResponse,
264 fidl::encoding::DefaultFuchsiaResourceDialect,
265 > {
266 ClientProxyInterface::r#watch_configuration(self)
267 }
268
269 pub fn r#shutdown(&self) -> Result<(), fidl::Error> {
273 ClientProxyInterface::r#shutdown(self)
274 }
275}
276
277impl ClientProxyInterface for ClientProxy {
278 type WatchConfigurationResponseFut = fidl::client::QueryResponseFut<
279 ClientWatchConfigurationResponse,
280 fidl::encoding::DefaultFuchsiaResourceDialect,
281 >;
282 fn r#watch_configuration(&self) -> Self::WatchConfigurationResponseFut {
283 fn _decode(
284 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
285 ) -> Result<ClientWatchConfigurationResponse, fidl::Error> {
286 let _response = fidl::client::decode_transaction_body::<
287 ClientWatchConfigurationResponse,
288 fidl::encoding::DefaultFuchsiaResourceDialect,
289 0x2b6f7c7d3bcc6682,
290 >(_buf?)?;
291 Ok(_response)
292 }
293 self.client.send_query_and_decode::<
294 fidl::encoding::EmptyPayload,
295 ClientWatchConfigurationResponse,
296 >(
297 (),
298 0x2b6f7c7d3bcc6682,
299 fidl::encoding::DynamicFlags::empty(),
300 _decode,
301 )
302 }
303
304 fn r#shutdown(&self) -> Result<(), fidl::Error> {
305 self.client.send::<fidl::encoding::EmptyPayload>(
306 (),
307 0x265a3213e9a8abde,
308 fidl::encoding::DynamicFlags::empty(),
309 )
310 }
311}
312
313pub struct ClientEventStream {
314 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
315}
316
317impl std::marker::Unpin for ClientEventStream {}
318
319impl futures::stream::FusedStream for ClientEventStream {
320 fn is_terminated(&self) -> bool {
321 self.event_receiver.is_terminated()
322 }
323}
324
325impl futures::Stream for ClientEventStream {
326 type Item = Result<ClientEvent, fidl::Error>;
327
328 fn poll_next(
329 mut self: std::pin::Pin<&mut Self>,
330 cx: &mut std::task::Context<'_>,
331 ) -> std::task::Poll<Option<Self::Item>> {
332 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
333 &mut self.event_receiver,
334 cx
335 )?) {
336 Some(buf) => std::task::Poll::Ready(Some(ClientEvent::decode(buf))),
337 None => std::task::Poll::Ready(None),
338 }
339 }
340}
341
342#[derive(Debug)]
343pub enum ClientEvent {
344 OnExit { reason: ClientExitReason },
345}
346
347impl ClientEvent {
348 #[allow(irrefutable_let_patterns)]
349 pub fn into_on_exit(self) -> Option<ClientExitReason> {
350 if let ClientEvent::OnExit { reason } = self {
351 Some((reason))
352 } else {
353 None
354 }
355 }
356
357 fn decode(
359 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
360 ) -> Result<ClientEvent, fidl::Error> {
361 let (bytes, _handles) = buf.split_mut();
362 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
363 debug_assert_eq!(tx_header.tx_id, 0);
364 match tx_header.ordinal {
365 0x2a2a052260f657c0 => {
366 let mut out = fidl::new_empty!(
367 ClientOnExitRequest,
368 fidl::encoding::DefaultFuchsiaResourceDialect
369 );
370 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientOnExitRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
371 Ok((ClientEvent::OnExit { reason: out.reason }))
372 }
373 _ => Err(fidl::Error::UnknownOrdinal {
374 ordinal: tx_header.ordinal,
375 protocol_name: <ClientMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
376 }),
377 }
378 }
379}
380
381pub struct ClientRequestStream {
383 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
384 is_terminated: bool,
385}
386
387impl std::marker::Unpin for ClientRequestStream {}
388
389impl futures::stream::FusedStream for ClientRequestStream {
390 fn is_terminated(&self) -> bool {
391 self.is_terminated
392 }
393}
394
395impl fidl::endpoints::RequestStream for ClientRequestStream {
396 type Protocol = ClientMarker;
397 type ControlHandle = ClientControlHandle;
398
399 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
400 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
401 }
402
403 fn control_handle(&self) -> Self::ControlHandle {
404 ClientControlHandle { inner: self.inner.clone() }
405 }
406
407 fn into_inner(
408 self,
409 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
410 {
411 (self.inner, self.is_terminated)
412 }
413
414 fn from_inner(
415 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
416 is_terminated: bool,
417 ) -> Self {
418 Self { inner, is_terminated }
419 }
420}
421
422impl futures::Stream for ClientRequestStream {
423 type Item = Result<ClientRequest, fidl::Error>;
424
425 fn poll_next(
426 mut self: std::pin::Pin<&mut Self>,
427 cx: &mut std::task::Context<'_>,
428 ) -> std::task::Poll<Option<Self::Item>> {
429 let this = &mut *self;
430 if this.inner.check_shutdown(cx) {
431 this.is_terminated = true;
432 return std::task::Poll::Ready(None);
433 }
434 if this.is_terminated {
435 panic!("polled ClientRequestStream after completion");
436 }
437 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
438 |bytes, handles| {
439 match this.inner.channel().read_etc(cx, bytes, handles) {
440 std::task::Poll::Ready(Ok(())) => {}
441 std::task::Poll::Pending => return std::task::Poll::Pending,
442 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
443 this.is_terminated = true;
444 return std::task::Poll::Ready(None);
445 }
446 std::task::Poll::Ready(Err(e)) => {
447 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
448 e.into(),
449 ))))
450 }
451 }
452
453 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
455
456 std::task::Poll::Ready(Some(match header.ordinal {
457 0x2b6f7c7d3bcc6682 => {
458 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
459 let mut req = fidl::new_empty!(
460 fidl::encoding::EmptyPayload,
461 fidl::encoding::DefaultFuchsiaResourceDialect
462 );
463 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
464 let control_handle = ClientControlHandle { inner: this.inner.clone() };
465 Ok(ClientRequest::WatchConfiguration {
466 responder: ClientWatchConfigurationResponder {
467 control_handle: std::mem::ManuallyDrop::new(control_handle),
468 tx_id: header.tx_id,
469 },
470 })
471 }
472 0x265a3213e9a8abde => {
473 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
474 let mut req = fidl::new_empty!(
475 fidl::encoding::EmptyPayload,
476 fidl::encoding::DefaultFuchsiaResourceDialect
477 );
478 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
479 let control_handle = ClientControlHandle { inner: this.inner.clone() };
480 Ok(ClientRequest::Shutdown { control_handle })
481 }
482 _ => Err(fidl::Error::UnknownOrdinal {
483 ordinal: header.ordinal,
484 protocol_name:
485 <ClientMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
486 }),
487 }))
488 },
489 )
490 }
491}
492
493#[derive(Debug)]
504pub enum ClientRequest {
505 WatchConfiguration { responder: ClientWatchConfigurationResponder },
533 Shutdown { control_handle: ClientControlHandle },
537}
538
539impl ClientRequest {
540 #[allow(irrefutable_let_patterns)]
541 pub fn into_watch_configuration(self) -> Option<(ClientWatchConfigurationResponder)> {
542 if let ClientRequest::WatchConfiguration { responder } = self {
543 Some((responder))
544 } else {
545 None
546 }
547 }
548
549 #[allow(irrefutable_let_patterns)]
550 pub fn into_shutdown(self) -> Option<(ClientControlHandle)> {
551 if let ClientRequest::Shutdown { control_handle } = self {
552 Some((control_handle))
553 } else {
554 None
555 }
556 }
557
558 pub fn method_name(&self) -> &'static str {
560 match *self {
561 ClientRequest::WatchConfiguration { .. } => "watch_configuration",
562 ClientRequest::Shutdown { .. } => "shutdown",
563 }
564 }
565}
566
567#[derive(Debug, Clone)]
568pub struct ClientControlHandle {
569 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
570}
571
572impl fidl::endpoints::ControlHandle for ClientControlHandle {
573 fn shutdown(&self) {
574 self.inner.shutdown()
575 }
576 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
577 self.inner.shutdown_with_epitaph(status)
578 }
579
580 fn is_closed(&self) -> bool {
581 self.inner.channel().is_closed()
582 }
583 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
584 self.inner.channel().on_closed()
585 }
586
587 #[cfg(target_os = "fuchsia")]
588 fn signal_peer(
589 &self,
590 clear_mask: zx::Signals,
591 set_mask: zx::Signals,
592 ) -> Result<(), zx_status::Status> {
593 use fidl::Peered;
594 self.inner.channel().signal_peer(clear_mask, set_mask)
595 }
596}
597
598impl ClientControlHandle {
599 pub fn send_on_exit(&self, mut reason: ClientExitReason) -> Result<(), fidl::Error> {
600 self.inner.send::<ClientOnExitRequest>(
601 (reason,),
602 0,
603 0x2a2a052260f657c0,
604 fidl::encoding::DynamicFlags::empty(),
605 )
606 }
607}
608
609#[must_use = "FIDL methods require a response to be sent"]
610#[derive(Debug)]
611pub struct ClientWatchConfigurationResponder {
612 control_handle: std::mem::ManuallyDrop<ClientControlHandle>,
613 tx_id: u32,
614}
615
616impl std::ops::Drop for ClientWatchConfigurationResponder {
620 fn drop(&mut self) {
621 self.control_handle.shutdown();
622 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
624 }
625}
626
627impl fidl::endpoints::Responder for ClientWatchConfigurationResponder {
628 type ControlHandle = ClientControlHandle;
629
630 fn control_handle(&self) -> &ClientControlHandle {
631 &self.control_handle
632 }
633
634 fn drop_without_shutdown(mut self) {
635 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
637 std::mem::forget(self);
639 }
640}
641
642impl ClientWatchConfigurationResponder {
643 pub fn send(self, mut payload: ClientWatchConfigurationResponse) -> Result<(), fidl::Error> {
647 let _result = self.send_raw(payload);
648 if _result.is_err() {
649 self.control_handle.shutdown();
650 }
651 self.drop_without_shutdown();
652 _result
653 }
654
655 pub fn send_no_shutdown_on_err(
657 self,
658 mut payload: ClientWatchConfigurationResponse,
659 ) -> Result<(), fidl::Error> {
660 let _result = self.send_raw(payload);
661 self.drop_without_shutdown();
662 _result
663 }
664
665 fn send_raw(&self, mut payload: ClientWatchConfigurationResponse) -> Result<(), fidl::Error> {
666 self.control_handle.inner.send::<ClientWatchConfigurationResponse>(
667 &mut payload,
668 self.tx_id,
669 0x2b6f7c7d3bcc6682,
670 fidl::encoding::DynamicFlags::empty(),
671 )
672 }
673}
674
675#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
676pub struct ClientProviderMarker;
677
678impl fidl::endpoints::ProtocolMarker for ClientProviderMarker {
679 type Proxy = ClientProviderProxy;
680 type RequestStream = ClientProviderRequestStream;
681 #[cfg(target_os = "fuchsia")]
682 type SynchronousProxy = ClientProviderSynchronousProxy;
683
684 const DEBUG_NAME: &'static str = "fuchsia.net.dhcp.ClientProvider";
685}
686impl fidl::endpoints::DiscoverableProtocolMarker for ClientProviderMarker {}
687
688pub trait ClientProviderProxyInterface: Send + Sync {
689 fn r#new_client(
690 &self,
691 interface_id: u64,
692 params: &NewClientParams,
693 request: fidl::endpoints::ServerEnd<ClientMarker>,
694 ) -> Result<(), fidl::Error>;
695 type CheckPresenceResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
696 fn r#check_presence(&self) -> Self::CheckPresenceResponseFut;
697}
698#[derive(Debug)]
699#[cfg(target_os = "fuchsia")]
700pub struct ClientProviderSynchronousProxy {
701 client: fidl::client::sync::Client,
702}
703
704#[cfg(target_os = "fuchsia")]
705impl fidl::endpoints::SynchronousProxy for ClientProviderSynchronousProxy {
706 type Proxy = ClientProviderProxy;
707 type Protocol = ClientProviderMarker;
708
709 fn from_channel(inner: fidl::Channel) -> Self {
710 Self::new(inner)
711 }
712
713 fn into_channel(self) -> fidl::Channel {
714 self.client.into_channel()
715 }
716
717 fn as_channel(&self) -> &fidl::Channel {
718 self.client.as_channel()
719 }
720}
721
722#[cfg(target_os = "fuchsia")]
723impl ClientProviderSynchronousProxy {
724 pub fn new(channel: fidl::Channel) -> Self {
725 let protocol_name = <ClientProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
726 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
727 }
728
729 pub fn into_channel(self) -> fidl::Channel {
730 self.client.into_channel()
731 }
732
733 pub fn wait_for_event(
736 &self,
737 deadline: zx::MonotonicInstant,
738 ) -> Result<ClientProviderEvent, fidl::Error> {
739 ClientProviderEvent::decode(self.client.wait_for_event(deadline)?)
740 }
741
742 pub fn r#new_client(
747 &self,
748 mut interface_id: u64,
749 mut params: &NewClientParams,
750 mut request: fidl::endpoints::ServerEnd<ClientMarker>,
751 ) -> Result<(), fidl::Error> {
752 self.client.send::<ClientProviderNewClientRequest>(
753 (interface_id, params, request),
754 0x317e9af2e462cbcd,
755 fidl::encoding::DynamicFlags::empty(),
756 )
757 }
758
759 pub fn r#check_presence(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
770 let _response =
771 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
772 (),
773 0x7ba657cd730bbf60,
774 fidl::encoding::DynamicFlags::empty(),
775 ___deadline,
776 )?;
777 Ok(_response)
778 }
779}
780
781#[cfg(target_os = "fuchsia")]
782impl From<ClientProviderSynchronousProxy> for zx::Handle {
783 fn from(value: ClientProviderSynchronousProxy) -> Self {
784 value.into_channel().into()
785 }
786}
787
788#[cfg(target_os = "fuchsia")]
789impl From<fidl::Channel> for ClientProviderSynchronousProxy {
790 fn from(value: fidl::Channel) -> Self {
791 Self::new(value)
792 }
793}
794
795#[derive(Debug, Clone)]
796pub struct ClientProviderProxy {
797 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
798}
799
800impl fidl::endpoints::Proxy for ClientProviderProxy {
801 type Protocol = ClientProviderMarker;
802
803 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
804 Self::new(inner)
805 }
806
807 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
808 self.client.into_channel().map_err(|client| Self { client })
809 }
810
811 fn as_channel(&self) -> &::fidl::AsyncChannel {
812 self.client.as_channel()
813 }
814}
815
816impl ClientProviderProxy {
817 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
819 let protocol_name = <ClientProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
820 Self { client: fidl::client::Client::new(channel, protocol_name) }
821 }
822
823 pub fn take_event_stream(&self) -> ClientProviderEventStream {
829 ClientProviderEventStream { event_receiver: self.client.take_event_receiver() }
830 }
831
832 pub fn r#new_client(
837 &self,
838 mut interface_id: u64,
839 mut params: &NewClientParams,
840 mut request: fidl::endpoints::ServerEnd<ClientMarker>,
841 ) -> Result<(), fidl::Error> {
842 ClientProviderProxyInterface::r#new_client(self, interface_id, params, request)
843 }
844
845 pub fn r#check_presence(
856 &self,
857 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
858 ClientProviderProxyInterface::r#check_presence(self)
859 }
860}
861
862impl ClientProviderProxyInterface for ClientProviderProxy {
863 fn r#new_client(
864 &self,
865 mut interface_id: u64,
866 mut params: &NewClientParams,
867 mut request: fidl::endpoints::ServerEnd<ClientMarker>,
868 ) -> Result<(), fidl::Error> {
869 self.client.send::<ClientProviderNewClientRequest>(
870 (interface_id, params, request),
871 0x317e9af2e462cbcd,
872 fidl::encoding::DynamicFlags::empty(),
873 )
874 }
875
876 type CheckPresenceResponseFut =
877 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
878 fn r#check_presence(&self) -> Self::CheckPresenceResponseFut {
879 fn _decode(
880 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
881 ) -> Result<(), fidl::Error> {
882 let _response = fidl::client::decode_transaction_body::<
883 fidl::encoding::EmptyPayload,
884 fidl::encoding::DefaultFuchsiaResourceDialect,
885 0x7ba657cd730bbf60,
886 >(_buf?)?;
887 Ok(_response)
888 }
889 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
890 (),
891 0x7ba657cd730bbf60,
892 fidl::encoding::DynamicFlags::empty(),
893 _decode,
894 )
895 }
896}
897
898pub struct ClientProviderEventStream {
899 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
900}
901
902impl std::marker::Unpin for ClientProviderEventStream {}
903
904impl futures::stream::FusedStream for ClientProviderEventStream {
905 fn is_terminated(&self) -> bool {
906 self.event_receiver.is_terminated()
907 }
908}
909
910impl futures::Stream for ClientProviderEventStream {
911 type Item = Result<ClientProviderEvent, fidl::Error>;
912
913 fn poll_next(
914 mut self: std::pin::Pin<&mut Self>,
915 cx: &mut std::task::Context<'_>,
916 ) -> std::task::Poll<Option<Self::Item>> {
917 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
918 &mut self.event_receiver,
919 cx
920 )?) {
921 Some(buf) => std::task::Poll::Ready(Some(ClientProviderEvent::decode(buf))),
922 None => std::task::Poll::Ready(None),
923 }
924 }
925}
926
927#[derive(Debug)]
928pub enum ClientProviderEvent {}
929
930impl ClientProviderEvent {
931 fn decode(
933 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
934 ) -> Result<ClientProviderEvent, fidl::Error> {
935 let (bytes, _handles) = buf.split_mut();
936 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
937 debug_assert_eq!(tx_header.tx_id, 0);
938 match tx_header.ordinal {
939 _ => Err(fidl::Error::UnknownOrdinal {
940 ordinal: tx_header.ordinal,
941 protocol_name:
942 <ClientProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
943 }),
944 }
945 }
946}
947
948pub struct ClientProviderRequestStream {
950 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
951 is_terminated: bool,
952}
953
954impl std::marker::Unpin for ClientProviderRequestStream {}
955
956impl futures::stream::FusedStream for ClientProviderRequestStream {
957 fn is_terminated(&self) -> bool {
958 self.is_terminated
959 }
960}
961
962impl fidl::endpoints::RequestStream for ClientProviderRequestStream {
963 type Protocol = ClientProviderMarker;
964 type ControlHandle = ClientProviderControlHandle;
965
966 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
967 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
968 }
969
970 fn control_handle(&self) -> Self::ControlHandle {
971 ClientProviderControlHandle { inner: self.inner.clone() }
972 }
973
974 fn into_inner(
975 self,
976 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
977 {
978 (self.inner, self.is_terminated)
979 }
980
981 fn from_inner(
982 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
983 is_terminated: bool,
984 ) -> Self {
985 Self { inner, is_terminated }
986 }
987}
988
989impl futures::Stream for ClientProviderRequestStream {
990 type Item = Result<ClientProviderRequest, fidl::Error>;
991
992 fn poll_next(
993 mut self: std::pin::Pin<&mut Self>,
994 cx: &mut std::task::Context<'_>,
995 ) -> std::task::Poll<Option<Self::Item>> {
996 let this = &mut *self;
997 if this.inner.check_shutdown(cx) {
998 this.is_terminated = true;
999 return std::task::Poll::Ready(None);
1000 }
1001 if this.is_terminated {
1002 panic!("polled ClientProviderRequestStream after completion");
1003 }
1004 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1005 |bytes, handles| {
1006 match this.inner.channel().read_etc(cx, bytes, handles) {
1007 std::task::Poll::Ready(Ok(())) => {}
1008 std::task::Poll::Pending => return std::task::Poll::Pending,
1009 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1010 this.is_terminated = true;
1011 return std::task::Poll::Ready(None);
1012 }
1013 std::task::Poll::Ready(Err(e)) => {
1014 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1015 e.into(),
1016 ))))
1017 }
1018 }
1019
1020 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1022
1023 std::task::Poll::Ready(Some(match header.ordinal {
1024 0x317e9af2e462cbcd => {
1025 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1026 let mut req = fidl::new_empty!(
1027 ClientProviderNewClientRequest,
1028 fidl::encoding::DefaultFuchsiaResourceDialect
1029 );
1030 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ClientProviderNewClientRequest>(&header, _body_bytes, handles, &mut req)?;
1031 let control_handle =
1032 ClientProviderControlHandle { inner: this.inner.clone() };
1033 Ok(ClientProviderRequest::NewClient {
1034 interface_id: req.interface_id,
1035 params: req.params,
1036 request: req.request,
1037
1038 control_handle,
1039 })
1040 }
1041 0x7ba657cd730bbf60 => {
1042 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1043 let mut req = fidl::new_empty!(
1044 fidl::encoding::EmptyPayload,
1045 fidl::encoding::DefaultFuchsiaResourceDialect
1046 );
1047 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1048 let control_handle =
1049 ClientProviderControlHandle { inner: this.inner.clone() };
1050 Ok(ClientProviderRequest::CheckPresence {
1051 responder: ClientProviderCheckPresenceResponder {
1052 control_handle: std::mem::ManuallyDrop::new(control_handle),
1053 tx_id: header.tx_id,
1054 },
1055 })
1056 }
1057 _ => Err(fidl::Error::UnknownOrdinal {
1058 ordinal: header.ordinal,
1059 protocol_name:
1060 <ClientProviderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1061 }),
1062 }))
1063 },
1064 )
1065 }
1066}
1067
1068#[derive(Debug)]
1070pub enum ClientProviderRequest {
1071 NewClient {
1076 interface_id: u64,
1077 params: NewClientParams,
1078 request: fidl::endpoints::ServerEnd<ClientMarker>,
1079 control_handle: ClientProviderControlHandle,
1080 },
1081 CheckPresence { responder: ClientProviderCheckPresenceResponder },
1092}
1093
1094impl ClientProviderRequest {
1095 #[allow(irrefutable_let_patterns)]
1096 pub fn into_new_client(
1097 self,
1098 ) -> Option<(
1099 u64,
1100 NewClientParams,
1101 fidl::endpoints::ServerEnd<ClientMarker>,
1102 ClientProviderControlHandle,
1103 )> {
1104 if let ClientProviderRequest::NewClient { interface_id, params, request, control_handle } =
1105 self
1106 {
1107 Some((interface_id, params, request, control_handle))
1108 } else {
1109 None
1110 }
1111 }
1112
1113 #[allow(irrefutable_let_patterns)]
1114 pub fn into_check_presence(self) -> Option<(ClientProviderCheckPresenceResponder)> {
1115 if let ClientProviderRequest::CheckPresence { responder } = self {
1116 Some((responder))
1117 } else {
1118 None
1119 }
1120 }
1121
1122 pub fn method_name(&self) -> &'static str {
1124 match *self {
1125 ClientProviderRequest::NewClient { .. } => "new_client",
1126 ClientProviderRequest::CheckPresence { .. } => "check_presence",
1127 }
1128 }
1129}
1130
1131#[derive(Debug, Clone)]
1132pub struct ClientProviderControlHandle {
1133 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1134}
1135
1136impl fidl::endpoints::ControlHandle for ClientProviderControlHandle {
1137 fn shutdown(&self) {
1138 self.inner.shutdown()
1139 }
1140 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1141 self.inner.shutdown_with_epitaph(status)
1142 }
1143
1144 fn is_closed(&self) -> bool {
1145 self.inner.channel().is_closed()
1146 }
1147 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1148 self.inner.channel().on_closed()
1149 }
1150
1151 #[cfg(target_os = "fuchsia")]
1152 fn signal_peer(
1153 &self,
1154 clear_mask: zx::Signals,
1155 set_mask: zx::Signals,
1156 ) -> Result<(), zx_status::Status> {
1157 use fidl::Peered;
1158 self.inner.channel().signal_peer(clear_mask, set_mask)
1159 }
1160}
1161
1162impl ClientProviderControlHandle {}
1163
1164#[must_use = "FIDL methods require a response to be sent"]
1165#[derive(Debug)]
1166pub struct ClientProviderCheckPresenceResponder {
1167 control_handle: std::mem::ManuallyDrop<ClientProviderControlHandle>,
1168 tx_id: u32,
1169}
1170
1171impl std::ops::Drop for ClientProviderCheckPresenceResponder {
1175 fn drop(&mut self) {
1176 self.control_handle.shutdown();
1177 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1179 }
1180}
1181
1182impl fidl::endpoints::Responder for ClientProviderCheckPresenceResponder {
1183 type ControlHandle = ClientProviderControlHandle;
1184
1185 fn control_handle(&self) -> &ClientProviderControlHandle {
1186 &self.control_handle
1187 }
1188
1189 fn drop_without_shutdown(mut self) {
1190 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1192 std::mem::forget(self);
1194 }
1195}
1196
1197impl ClientProviderCheckPresenceResponder {
1198 pub fn send(self) -> Result<(), fidl::Error> {
1202 let _result = self.send_raw();
1203 if _result.is_err() {
1204 self.control_handle.shutdown();
1205 }
1206 self.drop_without_shutdown();
1207 _result
1208 }
1209
1210 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1212 let _result = self.send_raw();
1213 self.drop_without_shutdown();
1214 _result
1215 }
1216
1217 fn send_raw(&self) -> Result<(), fidl::Error> {
1218 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1219 (),
1220 self.tx_id,
1221 0x7ba657cd730bbf60,
1222 fidl::encoding::DynamicFlags::empty(),
1223 )
1224 }
1225}
1226
1227#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1228pub struct Server_Marker;
1229
1230impl fidl::endpoints::ProtocolMarker for Server_Marker {
1231 type Proxy = Server_Proxy;
1232 type RequestStream = Server_RequestStream;
1233 #[cfg(target_os = "fuchsia")]
1234 type SynchronousProxy = Server_SynchronousProxy;
1235
1236 const DEBUG_NAME: &'static str = "fuchsia.net.dhcp.Server";
1237}
1238impl fidl::endpoints::DiscoverableProtocolMarker for Server_Marker {}
1239pub type ServerStartServingResult = Result<(), i32>;
1240pub type ServerGetOptionResult = Result<Option_, i32>;
1241pub type ServerGetParameterResult = Result<Parameter, i32>;
1242pub type ServerSetOptionResult = Result<(), i32>;
1243pub type ServerSetParameterResult = Result<(), i32>;
1244pub type ServerListOptionsResult = Result<Vec<Option_>, i32>;
1245pub type ServerListParametersResult = Result<Vec<Parameter>, i32>;
1246pub type ServerResetOptionsResult = Result<(), i32>;
1247pub type ServerResetParametersResult = Result<(), i32>;
1248pub type ServerClearLeasesResult = Result<(), i32>;
1249
1250pub trait Server_ProxyInterface: Send + Sync {
1251 type StartServingResponseFut: std::future::Future<Output = Result<ServerStartServingResult, fidl::Error>>
1252 + Send;
1253 fn r#start_serving(&self) -> Self::StartServingResponseFut;
1254 type StopServingResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1255 fn r#stop_serving(&self) -> Self::StopServingResponseFut;
1256 type IsServingResponseFut: std::future::Future<Output = Result<bool, fidl::Error>> + Send;
1257 fn r#is_serving(&self) -> Self::IsServingResponseFut;
1258 type GetOptionResponseFut: std::future::Future<Output = Result<ServerGetOptionResult, fidl::Error>>
1259 + Send;
1260 fn r#get_option(&self, code: OptionCode) -> Self::GetOptionResponseFut;
1261 type GetParameterResponseFut: std::future::Future<Output = Result<ServerGetParameterResult, fidl::Error>>
1262 + Send;
1263 fn r#get_parameter(&self, name: ParameterName) -> Self::GetParameterResponseFut;
1264 type SetOptionResponseFut: std::future::Future<Output = Result<ServerSetOptionResult, fidl::Error>>
1265 + Send;
1266 fn r#set_option(&self, value: &Option_) -> Self::SetOptionResponseFut;
1267 type SetParameterResponseFut: std::future::Future<Output = Result<ServerSetParameterResult, fidl::Error>>
1268 + Send;
1269 fn r#set_parameter(&self, value: &Parameter) -> Self::SetParameterResponseFut;
1270 type ListOptionsResponseFut: std::future::Future<Output = Result<ServerListOptionsResult, fidl::Error>>
1271 + Send;
1272 fn r#list_options(&self) -> Self::ListOptionsResponseFut;
1273 type ListParametersResponseFut: std::future::Future<Output = Result<ServerListParametersResult, fidl::Error>>
1274 + Send;
1275 fn r#list_parameters(&self) -> Self::ListParametersResponseFut;
1276 type ResetOptionsResponseFut: std::future::Future<Output = Result<ServerResetOptionsResult, fidl::Error>>
1277 + Send;
1278 fn r#reset_options(&self) -> Self::ResetOptionsResponseFut;
1279 type ResetParametersResponseFut: std::future::Future<Output = Result<ServerResetParametersResult, fidl::Error>>
1280 + Send;
1281 fn r#reset_parameters(&self) -> Self::ResetParametersResponseFut;
1282 type ClearLeasesResponseFut: std::future::Future<Output = Result<ServerClearLeasesResult, fidl::Error>>
1283 + Send;
1284 fn r#clear_leases(&self) -> Self::ClearLeasesResponseFut;
1285}
1286#[derive(Debug)]
1287#[cfg(target_os = "fuchsia")]
1288pub struct Server_SynchronousProxy {
1289 client: fidl::client::sync::Client,
1290}
1291
1292#[cfg(target_os = "fuchsia")]
1293impl fidl::endpoints::SynchronousProxy for Server_SynchronousProxy {
1294 type Proxy = Server_Proxy;
1295 type Protocol = Server_Marker;
1296
1297 fn from_channel(inner: fidl::Channel) -> Self {
1298 Self::new(inner)
1299 }
1300
1301 fn into_channel(self) -> fidl::Channel {
1302 self.client.into_channel()
1303 }
1304
1305 fn as_channel(&self) -> &fidl::Channel {
1306 self.client.as_channel()
1307 }
1308}
1309
1310#[cfg(target_os = "fuchsia")]
1311impl Server_SynchronousProxy {
1312 pub fn new(channel: fidl::Channel) -> Self {
1313 let protocol_name = <Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1314 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1315 }
1316
1317 pub fn into_channel(self) -> fidl::Channel {
1318 self.client.into_channel()
1319 }
1320
1321 pub fn wait_for_event(
1324 &self,
1325 deadline: zx::MonotonicInstant,
1326 ) -> Result<Server_Event, fidl::Error> {
1327 Server_Event::decode(self.client.wait_for_event(deadline)?)
1328 }
1329
1330 pub fn r#start_serving(
1339 &self,
1340 ___deadline: zx::MonotonicInstant,
1341 ) -> Result<ServerStartServingResult, fidl::Error> {
1342 let _response = self.client.send_query::<
1343 fidl::encoding::EmptyPayload,
1344 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1345 >(
1346 (),
1347 0x10990e324ac53cd1,
1348 fidl::encoding::DynamicFlags::empty(),
1349 ___deadline,
1350 )?;
1351 Ok(_response.map(|x| x))
1352 }
1353
1354 pub fn r#stop_serving(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
1363 let _response =
1364 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
1365 (),
1366 0x7776cfe9f68a0dbe,
1367 fidl::encoding::DynamicFlags::empty(),
1368 ___deadline,
1369 )?;
1370 Ok(_response)
1371 }
1372
1373 pub fn r#is_serving(&self, ___deadline: zx::MonotonicInstant) -> Result<bool, fidl::Error> {
1375 let _response =
1376 self.client.send_query::<fidl::encoding::EmptyPayload, ServerIsServingResponse>(
1377 (),
1378 0x45aadc35fcbe3826,
1379 fidl::encoding::DynamicFlags::empty(),
1380 ___deadline,
1381 )?;
1382 Ok(_response.enabled)
1383 }
1384
1385 pub fn r#get_option(
1391 &self,
1392 mut code: OptionCode,
1393 ___deadline: zx::MonotonicInstant,
1394 ) -> Result<ServerGetOptionResult, fidl::Error> {
1395 let _response = self.client.send_query::<
1396 ServerGetOptionRequest,
1397 fidl::encoding::ResultType<ServerGetOptionResponse, i32>,
1398 >(
1399 (code,),
1400 0x5305ee2c593f68a,
1401 fidl::encoding::DynamicFlags::empty(),
1402 ___deadline,
1403 )?;
1404 Ok(_response.map(|x| x.value))
1405 }
1406
1407 pub fn r#get_parameter(
1413 &self,
1414 mut name: ParameterName,
1415 ___deadline: zx::MonotonicInstant,
1416 ) -> Result<ServerGetParameterResult, fidl::Error> {
1417 let _response = self.client.send_query::<
1418 ServerGetParameterRequest,
1419 fidl::encoding::ResultType<ServerGetParameterResponse, i32>,
1420 >(
1421 (name,),
1422 0x1e8c98758fb82714,
1423 fidl::encoding::DynamicFlags::empty(),
1424 ___deadline,
1425 )?;
1426 Ok(_response.map(|x| x.value))
1427 }
1428
1429 pub fn r#set_option(
1436 &self,
1437 mut value: &Option_,
1438 ___deadline: zx::MonotonicInstant,
1439 ) -> Result<ServerSetOptionResult, fidl::Error> {
1440 let _response = self.client.send_query::<
1441 ServerSetOptionRequest,
1442 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1443 >(
1444 (value,),
1445 0x63c98b670db8d96a,
1446 fidl::encoding::DynamicFlags::empty(),
1447 ___deadline,
1448 )?;
1449 Ok(_response.map(|x| x))
1450 }
1451
1452 pub fn r#set_parameter(
1464 &self,
1465 mut value: &Parameter,
1466 ___deadline: zx::MonotonicInstant,
1467 ) -> Result<ServerSetParameterResult, fidl::Error> {
1468 let _response = self.client.send_query::<
1469 ServerSetParameterRequest,
1470 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1471 >(
1472 (value,),
1473 0x3002d0d956eb4bdc,
1474 fidl::encoding::DynamicFlags::empty(),
1475 ___deadline,
1476 )?;
1477 Ok(_response.map(|x| x))
1478 }
1479
1480 pub fn r#list_options(
1490 &self,
1491 ___deadline: zx::MonotonicInstant,
1492 ) -> Result<ServerListOptionsResult, fidl::Error> {
1493 let _response = self.client.send_query::<
1494 fidl::encoding::EmptyPayload,
1495 fidl::encoding::ResultType<ServerListOptionsResponse, i32>,
1496 >(
1497 (),
1498 0x72c8161c69ca67b,
1499 fidl::encoding::DynamicFlags::empty(),
1500 ___deadline,
1501 )?;
1502 Ok(_response.map(|x| x.options))
1503 }
1504
1505 pub fn r#list_parameters(
1515 &self,
1516 ___deadline: zx::MonotonicInstant,
1517 ) -> Result<ServerListParametersResult, fidl::Error> {
1518 let _response = self.client.send_query::<
1519 fidl::encoding::EmptyPayload,
1520 fidl::encoding::ResultType<ServerListParametersResponse, i32>,
1521 >(
1522 (),
1523 0xa201b1d6d121c59,
1524 fidl::encoding::DynamicFlags::empty(),
1525 ___deadline,
1526 )?;
1527 Ok(_response.map(|x| x.parameters))
1528 }
1529
1530 pub fn r#reset_options(
1535 &self,
1536 ___deadline: zx::MonotonicInstant,
1537 ) -> Result<ServerResetOptionsResult, fidl::Error> {
1538 let _response = self.client.send_query::<
1539 fidl::encoding::EmptyPayload,
1540 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1541 >(
1542 (),
1543 0x31014911fd21cc13,
1544 fidl::encoding::DynamicFlags::empty(),
1545 ___deadline,
1546 )?;
1547 Ok(_response.map(|x| x))
1548 }
1549
1550 pub fn r#reset_parameters(
1560 &self,
1561 ___deadline: zx::MonotonicInstant,
1562 ) -> Result<ServerResetParametersResult, fidl::Error> {
1563 let _response = self.client.send_query::<
1564 fidl::encoding::EmptyPayload,
1565 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1566 >(
1567 (),
1568 0x353fba50bcf4ecec,
1569 fidl::encoding::DynamicFlags::empty(),
1570 ___deadline,
1571 )?;
1572 Ok(_response.map(|x| x))
1573 }
1574
1575 pub fn r#clear_leases(
1582 &self,
1583 ___deadline: zx::MonotonicInstant,
1584 ) -> Result<ServerClearLeasesResult, fidl::Error> {
1585 let _response = self.client.send_query::<
1586 fidl::encoding::EmptyPayload,
1587 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1588 >(
1589 (),
1590 0xe39e35cda85a04d,
1591 fidl::encoding::DynamicFlags::empty(),
1592 ___deadline,
1593 )?;
1594 Ok(_response.map(|x| x))
1595 }
1596}
1597
1598#[cfg(target_os = "fuchsia")]
1599impl From<Server_SynchronousProxy> for zx::Handle {
1600 fn from(value: Server_SynchronousProxy) -> Self {
1601 value.into_channel().into()
1602 }
1603}
1604
1605#[cfg(target_os = "fuchsia")]
1606impl From<fidl::Channel> for Server_SynchronousProxy {
1607 fn from(value: fidl::Channel) -> Self {
1608 Self::new(value)
1609 }
1610}
1611
1612#[derive(Debug, Clone)]
1613pub struct Server_Proxy {
1614 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1615}
1616
1617impl fidl::endpoints::Proxy for Server_Proxy {
1618 type Protocol = Server_Marker;
1619
1620 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1621 Self::new(inner)
1622 }
1623
1624 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1625 self.client.into_channel().map_err(|client| Self { client })
1626 }
1627
1628 fn as_channel(&self) -> &::fidl::AsyncChannel {
1629 self.client.as_channel()
1630 }
1631}
1632
1633impl Server_Proxy {
1634 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1636 let protocol_name = <Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1637 Self { client: fidl::client::Client::new(channel, protocol_name) }
1638 }
1639
1640 pub fn take_event_stream(&self) -> Server_EventStream {
1646 Server_EventStream { event_receiver: self.client.take_event_receiver() }
1647 }
1648
1649 pub fn r#start_serving(
1658 &self,
1659 ) -> fidl::client::QueryResponseFut<
1660 ServerStartServingResult,
1661 fidl::encoding::DefaultFuchsiaResourceDialect,
1662 > {
1663 Server_ProxyInterface::r#start_serving(self)
1664 }
1665
1666 pub fn r#stop_serving(
1675 &self,
1676 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1677 Server_ProxyInterface::r#stop_serving(self)
1678 }
1679
1680 pub fn r#is_serving(
1682 &self,
1683 ) -> fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect> {
1684 Server_ProxyInterface::r#is_serving(self)
1685 }
1686
1687 pub fn r#get_option(
1693 &self,
1694 mut code: OptionCode,
1695 ) -> fidl::client::QueryResponseFut<
1696 ServerGetOptionResult,
1697 fidl::encoding::DefaultFuchsiaResourceDialect,
1698 > {
1699 Server_ProxyInterface::r#get_option(self, code)
1700 }
1701
1702 pub fn r#get_parameter(
1708 &self,
1709 mut name: ParameterName,
1710 ) -> fidl::client::QueryResponseFut<
1711 ServerGetParameterResult,
1712 fidl::encoding::DefaultFuchsiaResourceDialect,
1713 > {
1714 Server_ProxyInterface::r#get_parameter(self, name)
1715 }
1716
1717 pub fn r#set_option(
1724 &self,
1725 mut value: &Option_,
1726 ) -> fidl::client::QueryResponseFut<
1727 ServerSetOptionResult,
1728 fidl::encoding::DefaultFuchsiaResourceDialect,
1729 > {
1730 Server_ProxyInterface::r#set_option(self, value)
1731 }
1732
1733 pub fn r#set_parameter(
1745 &self,
1746 mut value: &Parameter,
1747 ) -> fidl::client::QueryResponseFut<
1748 ServerSetParameterResult,
1749 fidl::encoding::DefaultFuchsiaResourceDialect,
1750 > {
1751 Server_ProxyInterface::r#set_parameter(self, value)
1752 }
1753
1754 pub fn r#list_options(
1764 &self,
1765 ) -> fidl::client::QueryResponseFut<
1766 ServerListOptionsResult,
1767 fidl::encoding::DefaultFuchsiaResourceDialect,
1768 > {
1769 Server_ProxyInterface::r#list_options(self)
1770 }
1771
1772 pub fn r#list_parameters(
1782 &self,
1783 ) -> fidl::client::QueryResponseFut<
1784 ServerListParametersResult,
1785 fidl::encoding::DefaultFuchsiaResourceDialect,
1786 > {
1787 Server_ProxyInterface::r#list_parameters(self)
1788 }
1789
1790 pub fn r#reset_options(
1795 &self,
1796 ) -> fidl::client::QueryResponseFut<
1797 ServerResetOptionsResult,
1798 fidl::encoding::DefaultFuchsiaResourceDialect,
1799 > {
1800 Server_ProxyInterface::r#reset_options(self)
1801 }
1802
1803 pub fn r#reset_parameters(
1813 &self,
1814 ) -> fidl::client::QueryResponseFut<
1815 ServerResetParametersResult,
1816 fidl::encoding::DefaultFuchsiaResourceDialect,
1817 > {
1818 Server_ProxyInterface::r#reset_parameters(self)
1819 }
1820
1821 pub fn r#clear_leases(
1828 &self,
1829 ) -> fidl::client::QueryResponseFut<
1830 ServerClearLeasesResult,
1831 fidl::encoding::DefaultFuchsiaResourceDialect,
1832 > {
1833 Server_ProxyInterface::r#clear_leases(self)
1834 }
1835}
1836
1837impl Server_ProxyInterface for Server_Proxy {
1838 type StartServingResponseFut = fidl::client::QueryResponseFut<
1839 ServerStartServingResult,
1840 fidl::encoding::DefaultFuchsiaResourceDialect,
1841 >;
1842 fn r#start_serving(&self) -> Self::StartServingResponseFut {
1843 fn _decode(
1844 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1845 ) -> Result<ServerStartServingResult, fidl::Error> {
1846 let _response = fidl::client::decode_transaction_body::<
1847 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1848 fidl::encoding::DefaultFuchsiaResourceDialect,
1849 0x10990e324ac53cd1,
1850 >(_buf?)?;
1851 Ok(_response.map(|x| x))
1852 }
1853 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ServerStartServingResult>(
1854 (),
1855 0x10990e324ac53cd1,
1856 fidl::encoding::DynamicFlags::empty(),
1857 _decode,
1858 )
1859 }
1860
1861 type StopServingResponseFut =
1862 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1863 fn r#stop_serving(&self) -> Self::StopServingResponseFut {
1864 fn _decode(
1865 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1866 ) -> Result<(), fidl::Error> {
1867 let _response = fidl::client::decode_transaction_body::<
1868 fidl::encoding::EmptyPayload,
1869 fidl::encoding::DefaultFuchsiaResourceDialect,
1870 0x7776cfe9f68a0dbe,
1871 >(_buf?)?;
1872 Ok(_response)
1873 }
1874 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
1875 (),
1876 0x7776cfe9f68a0dbe,
1877 fidl::encoding::DynamicFlags::empty(),
1878 _decode,
1879 )
1880 }
1881
1882 type IsServingResponseFut =
1883 fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect>;
1884 fn r#is_serving(&self) -> Self::IsServingResponseFut {
1885 fn _decode(
1886 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1887 ) -> Result<bool, fidl::Error> {
1888 let _response = fidl::client::decode_transaction_body::<
1889 ServerIsServingResponse,
1890 fidl::encoding::DefaultFuchsiaResourceDialect,
1891 0x45aadc35fcbe3826,
1892 >(_buf?)?;
1893 Ok(_response.enabled)
1894 }
1895 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, bool>(
1896 (),
1897 0x45aadc35fcbe3826,
1898 fidl::encoding::DynamicFlags::empty(),
1899 _decode,
1900 )
1901 }
1902
1903 type GetOptionResponseFut = fidl::client::QueryResponseFut<
1904 ServerGetOptionResult,
1905 fidl::encoding::DefaultFuchsiaResourceDialect,
1906 >;
1907 fn r#get_option(&self, mut code: OptionCode) -> Self::GetOptionResponseFut {
1908 fn _decode(
1909 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1910 ) -> Result<ServerGetOptionResult, fidl::Error> {
1911 let _response = fidl::client::decode_transaction_body::<
1912 fidl::encoding::ResultType<ServerGetOptionResponse, i32>,
1913 fidl::encoding::DefaultFuchsiaResourceDialect,
1914 0x5305ee2c593f68a,
1915 >(_buf?)?;
1916 Ok(_response.map(|x| x.value))
1917 }
1918 self.client.send_query_and_decode::<ServerGetOptionRequest, ServerGetOptionResult>(
1919 (code,),
1920 0x5305ee2c593f68a,
1921 fidl::encoding::DynamicFlags::empty(),
1922 _decode,
1923 )
1924 }
1925
1926 type GetParameterResponseFut = fidl::client::QueryResponseFut<
1927 ServerGetParameterResult,
1928 fidl::encoding::DefaultFuchsiaResourceDialect,
1929 >;
1930 fn r#get_parameter(&self, mut name: ParameterName) -> Self::GetParameterResponseFut {
1931 fn _decode(
1932 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1933 ) -> Result<ServerGetParameterResult, fidl::Error> {
1934 let _response = fidl::client::decode_transaction_body::<
1935 fidl::encoding::ResultType<ServerGetParameterResponse, i32>,
1936 fidl::encoding::DefaultFuchsiaResourceDialect,
1937 0x1e8c98758fb82714,
1938 >(_buf?)?;
1939 Ok(_response.map(|x| x.value))
1940 }
1941 self.client.send_query_and_decode::<ServerGetParameterRequest, ServerGetParameterResult>(
1942 (name,),
1943 0x1e8c98758fb82714,
1944 fidl::encoding::DynamicFlags::empty(),
1945 _decode,
1946 )
1947 }
1948
1949 type SetOptionResponseFut = fidl::client::QueryResponseFut<
1950 ServerSetOptionResult,
1951 fidl::encoding::DefaultFuchsiaResourceDialect,
1952 >;
1953 fn r#set_option(&self, mut value: &Option_) -> Self::SetOptionResponseFut {
1954 fn _decode(
1955 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1956 ) -> Result<ServerSetOptionResult, fidl::Error> {
1957 let _response = fidl::client::decode_transaction_body::<
1958 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1959 fidl::encoding::DefaultFuchsiaResourceDialect,
1960 0x63c98b670db8d96a,
1961 >(_buf?)?;
1962 Ok(_response.map(|x| x))
1963 }
1964 self.client.send_query_and_decode::<ServerSetOptionRequest, ServerSetOptionResult>(
1965 (value,),
1966 0x63c98b670db8d96a,
1967 fidl::encoding::DynamicFlags::empty(),
1968 _decode,
1969 )
1970 }
1971
1972 type SetParameterResponseFut = fidl::client::QueryResponseFut<
1973 ServerSetParameterResult,
1974 fidl::encoding::DefaultFuchsiaResourceDialect,
1975 >;
1976 fn r#set_parameter(&self, mut value: &Parameter) -> Self::SetParameterResponseFut {
1977 fn _decode(
1978 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1979 ) -> Result<ServerSetParameterResult, fidl::Error> {
1980 let _response = fidl::client::decode_transaction_body::<
1981 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1982 fidl::encoding::DefaultFuchsiaResourceDialect,
1983 0x3002d0d956eb4bdc,
1984 >(_buf?)?;
1985 Ok(_response.map(|x| x))
1986 }
1987 self.client.send_query_and_decode::<ServerSetParameterRequest, ServerSetParameterResult>(
1988 (value,),
1989 0x3002d0d956eb4bdc,
1990 fidl::encoding::DynamicFlags::empty(),
1991 _decode,
1992 )
1993 }
1994
1995 type ListOptionsResponseFut = fidl::client::QueryResponseFut<
1996 ServerListOptionsResult,
1997 fidl::encoding::DefaultFuchsiaResourceDialect,
1998 >;
1999 fn r#list_options(&self) -> Self::ListOptionsResponseFut {
2000 fn _decode(
2001 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2002 ) -> Result<ServerListOptionsResult, fidl::Error> {
2003 let _response = fidl::client::decode_transaction_body::<
2004 fidl::encoding::ResultType<ServerListOptionsResponse, i32>,
2005 fidl::encoding::DefaultFuchsiaResourceDialect,
2006 0x72c8161c69ca67b,
2007 >(_buf?)?;
2008 Ok(_response.map(|x| x.options))
2009 }
2010 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ServerListOptionsResult>(
2011 (),
2012 0x72c8161c69ca67b,
2013 fidl::encoding::DynamicFlags::empty(),
2014 _decode,
2015 )
2016 }
2017
2018 type ListParametersResponseFut = fidl::client::QueryResponseFut<
2019 ServerListParametersResult,
2020 fidl::encoding::DefaultFuchsiaResourceDialect,
2021 >;
2022 fn r#list_parameters(&self) -> Self::ListParametersResponseFut {
2023 fn _decode(
2024 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2025 ) -> Result<ServerListParametersResult, fidl::Error> {
2026 let _response = fidl::client::decode_transaction_body::<
2027 fidl::encoding::ResultType<ServerListParametersResponse, i32>,
2028 fidl::encoding::DefaultFuchsiaResourceDialect,
2029 0xa201b1d6d121c59,
2030 >(_buf?)?;
2031 Ok(_response.map(|x| x.parameters))
2032 }
2033 self.client
2034 .send_query_and_decode::<fidl::encoding::EmptyPayload, ServerListParametersResult>(
2035 (),
2036 0xa201b1d6d121c59,
2037 fidl::encoding::DynamicFlags::empty(),
2038 _decode,
2039 )
2040 }
2041
2042 type ResetOptionsResponseFut = fidl::client::QueryResponseFut<
2043 ServerResetOptionsResult,
2044 fidl::encoding::DefaultFuchsiaResourceDialect,
2045 >;
2046 fn r#reset_options(&self) -> Self::ResetOptionsResponseFut {
2047 fn _decode(
2048 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2049 ) -> Result<ServerResetOptionsResult, fidl::Error> {
2050 let _response = fidl::client::decode_transaction_body::<
2051 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2052 fidl::encoding::DefaultFuchsiaResourceDialect,
2053 0x31014911fd21cc13,
2054 >(_buf?)?;
2055 Ok(_response.map(|x| x))
2056 }
2057 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ServerResetOptionsResult>(
2058 (),
2059 0x31014911fd21cc13,
2060 fidl::encoding::DynamicFlags::empty(),
2061 _decode,
2062 )
2063 }
2064
2065 type ResetParametersResponseFut = fidl::client::QueryResponseFut<
2066 ServerResetParametersResult,
2067 fidl::encoding::DefaultFuchsiaResourceDialect,
2068 >;
2069 fn r#reset_parameters(&self) -> Self::ResetParametersResponseFut {
2070 fn _decode(
2071 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2072 ) -> Result<ServerResetParametersResult, fidl::Error> {
2073 let _response = fidl::client::decode_transaction_body::<
2074 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2075 fidl::encoding::DefaultFuchsiaResourceDialect,
2076 0x353fba50bcf4ecec,
2077 >(_buf?)?;
2078 Ok(_response.map(|x| x))
2079 }
2080 self.client
2081 .send_query_and_decode::<fidl::encoding::EmptyPayload, ServerResetParametersResult>(
2082 (),
2083 0x353fba50bcf4ecec,
2084 fidl::encoding::DynamicFlags::empty(),
2085 _decode,
2086 )
2087 }
2088
2089 type ClearLeasesResponseFut = fidl::client::QueryResponseFut<
2090 ServerClearLeasesResult,
2091 fidl::encoding::DefaultFuchsiaResourceDialect,
2092 >;
2093 fn r#clear_leases(&self) -> Self::ClearLeasesResponseFut {
2094 fn _decode(
2095 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2096 ) -> Result<ServerClearLeasesResult, fidl::Error> {
2097 let _response = fidl::client::decode_transaction_body::<
2098 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2099 fidl::encoding::DefaultFuchsiaResourceDialect,
2100 0xe39e35cda85a04d,
2101 >(_buf?)?;
2102 Ok(_response.map(|x| x))
2103 }
2104 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ServerClearLeasesResult>(
2105 (),
2106 0xe39e35cda85a04d,
2107 fidl::encoding::DynamicFlags::empty(),
2108 _decode,
2109 )
2110 }
2111}
2112
2113pub struct Server_EventStream {
2114 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2115}
2116
2117impl std::marker::Unpin for Server_EventStream {}
2118
2119impl futures::stream::FusedStream for Server_EventStream {
2120 fn is_terminated(&self) -> bool {
2121 self.event_receiver.is_terminated()
2122 }
2123}
2124
2125impl futures::Stream for Server_EventStream {
2126 type Item = Result<Server_Event, fidl::Error>;
2127
2128 fn poll_next(
2129 mut self: std::pin::Pin<&mut Self>,
2130 cx: &mut std::task::Context<'_>,
2131 ) -> std::task::Poll<Option<Self::Item>> {
2132 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2133 &mut self.event_receiver,
2134 cx
2135 )?) {
2136 Some(buf) => std::task::Poll::Ready(Some(Server_Event::decode(buf))),
2137 None => std::task::Poll::Ready(None),
2138 }
2139 }
2140}
2141
2142#[derive(Debug)]
2143pub enum Server_Event {}
2144
2145impl Server_Event {
2146 fn decode(
2148 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2149 ) -> Result<Server_Event, fidl::Error> {
2150 let (bytes, _handles) = buf.split_mut();
2151 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2152 debug_assert_eq!(tx_header.tx_id, 0);
2153 match tx_header.ordinal {
2154 _ => Err(fidl::Error::UnknownOrdinal {
2155 ordinal: tx_header.ordinal,
2156 protocol_name: <Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2157 }),
2158 }
2159 }
2160}
2161
2162pub struct Server_RequestStream {
2164 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2165 is_terminated: bool,
2166}
2167
2168impl std::marker::Unpin for Server_RequestStream {}
2169
2170impl futures::stream::FusedStream for Server_RequestStream {
2171 fn is_terminated(&self) -> bool {
2172 self.is_terminated
2173 }
2174}
2175
2176impl fidl::endpoints::RequestStream for Server_RequestStream {
2177 type Protocol = Server_Marker;
2178 type ControlHandle = Server_ControlHandle;
2179
2180 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2181 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2182 }
2183
2184 fn control_handle(&self) -> Self::ControlHandle {
2185 Server_ControlHandle { inner: self.inner.clone() }
2186 }
2187
2188 fn into_inner(
2189 self,
2190 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2191 {
2192 (self.inner, self.is_terminated)
2193 }
2194
2195 fn from_inner(
2196 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2197 is_terminated: bool,
2198 ) -> Self {
2199 Self { inner, is_terminated }
2200 }
2201}
2202
2203impl futures::Stream for Server_RequestStream {
2204 type Item = Result<Server_Request, fidl::Error>;
2205
2206 fn poll_next(
2207 mut self: std::pin::Pin<&mut Self>,
2208 cx: &mut std::task::Context<'_>,
2209 ) -> std::task::Poll<Option<Self::Item>> {
2210 let this = &mut *self;
2211 if this.inner.check_shutdown(cx) {
2212 this.is_terminated = true;
2213 return std::task::Poll::Ready(None);
2214 }
2215 if this.is_terminated {
2216 panic!("polled Server_RequestStream after completion");
2217 }
2218 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2219 |bytes, handles| {
2220 match this.inner.channel().read_etc(cx, bytes, handles) {
2221 std::task::Poll::Ready(Ok(())) => {}
2222 std::task::Poll::Pending => return std::task::Poll::Pending,
2223 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2224 this.is_terminated = true;
2225 return std::task::Poll::Ready(None);
2226 }
2227 std::task::Poll::Ready(Err(e)) => {
2228 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2229 e.into(),
2230 ))))
2231 }
2232 }
2233
2234 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2236
2237 std::task::Poll::Ready(Some(match header.ordinal {
2238 0x10990e324ac53cd1 => {
2239 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2240 let mut req = fidl::new_empty!(
2241 fidl::encoding::EmptyPayload,
2242 fidl::encoding::DefaultFuchsiaResourceDialect
2243 );
2244 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2245 let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2246 Ok(Server_Request::StartServing {
2247 responder: Server_StartServingResponder {
2248 control_handle: std::mem::ManuallyDrop::new(control_handle),
2249 tx_id: header.tx_id,
2250 },
2251 })
2252 }
2253 0x7776cfe9f68a0dbe => {
2254 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2255 let mut req = fidl::new_empty!(
2256 fidl::encoding::EmptyPayload,
2257 fidl::encoding::DefaultFuchsiaResourceDialect
2258 );
2259 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2260 let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2261 Ok(Server_Request::StopServing {
2262 responder: Server_StopServingResponder {
2263 control_handle: std::mem::ManuallyDrop::new(control_handle),
2264 tx_id: header.tx_id,
2265 },
2266 })
2267 }
2268 0x45aadc35fcbe3826 => {
2269 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2270 let mut req = fidl::new_empty!(
2271 fidl::encoding::EmptyPayload,
2272 fidl::encoding::DefaultFuchsiaResourceDialect
2273 );
2274 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2275 let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2276 Ok(Server_Request::IsServing {
2277 responder: Server_IsServingResponder {
2278 control_handle: std::mem::ManuallyDrop::new(control_handle),
2279 tx_id: header.tx_id,
2280 },
2281 })
2282 }
2283 0x5305ee2c593f68a => {
2284 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2285 let mut req = fidl::new_empty!(
2286 ServerGetOptionRequest,
2287 fidl::encoding::DefaultFuchsiaResourceDialect
2288 );
2289 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ServerGetOptionRequest>(&header, _body_bytes, handles, &mut req)?;
2290 let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2291 Ok(Server_Request::GetOption {
2292 code: req.code,
2293
2294 responder: Server_GetOptionResponder {
2295 control_handle: std::mem::ManuallyDrop::new(control_handle),
2296 tx_id: header.tx_id,
2297 },
2298 })
2299 }
2300 0x1e8c98758fb82714 => {
2301 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2302 let mut req = fidl::new_empty!(
2303 ServerGetParameterRequest,
2304 fidl::encoding::DefaultFuchsiaResourceDialect
2305 );
2306 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ServerGetParameterRequest>(&header, _body_bytes, handles, &mut req)?;
2307 let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2308 Ok(Server_Request::GetParameter {
2309 name: req.name,
2310
2311 responder: Server_GetParameterResponder {
2312 control_handle: std::mem::ManuallyDrop::new(control_handle),
2313 tx_id: header.tx_id,
2314 },
2315 })
2316 }
2317 0x63c98b670db8d96a => {
2318 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2319 let mut req = fidl::new_empty!(
2320 ServerSetOptionRequest,
2321 fidl::encoding::DefaultFuchsiaResourceDialect
2322 );
2323 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ServerSetOptionRequest>(&header, _body_bytes, handles, &mut req)?;
2324 let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2325 Ok(Server_Request::SetOption {
2326 value: req.value,
2327
2328 responder: Server_SetOptionResponder {
2329 control_handle: std::mem::ManuallyDrop::new(control_handle),
2330 tx_id: header.tx_id,
2331 },
2332 })
2333 }
2334 0x3002d0d956eb4bdc => {
2335 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2336 let mut req = fidl::new_empty!(
2337 ServerSetParameterRequest,
2338 fidl::encoding::DefaultFuchsiaResourceDialect
2339 );
2340 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ServerSetParameterRequest>(&header, _body_bytes, handles, &mut req)?;
2341 let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2342 Ok(Server_Request::SetParameter {
2343 value: req.value,
2344
2345 responder: Server_SetParameterResponder {
2346 control_handle: std::mem::ManuallyDrop::new(control_handle),
2347 tx_id: header.tx_id,
2348 },
2349 })
2350 }
2351 0x72c8161c69ca67b => {
2352 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2353 let mut req = fidl::new_empty!(
2354 fidl::encoding::EmptyPayload,
2355 fidl::encoding::DefaultFuchsiaResourceDialect
2356 );
2357 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2358 let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2359 Ok(Server_Request::ListOptions {
2360 responder: Server_ListOptionsResponder {
2361 control_handle: std::mem::ManuallyDrop::new(control_handle),
2362 tx_id: header.tx_id,
2363 },
2364 })
2365 }
2366 0xa201b1d6d121c59 => {
2367 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2368 let mut req = fidl::new_empty!(
2369 fidl::encoding::EmptyPayload,
2370 fidl::encoding::DefaultFuchsiaResourceDialect
2371 );
2372 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2373 let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2374 Ok(Server_Request::ListParameters {
2375 responder: Server_ListParametersResponder {
2376 control_handle: std::mem::ManuallyDrop::new(control_handle),
2377 tx_id: header.tx_id,
2378 },
2379 })
2380 }
2381 0x31014911fd21cc13 => {
2382 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2383 let mut req = fidl::new_empty!(
2384 fidl::encoding::EmptyPayload,
2385 fidl::encoding::DefaultFuchsiaResourceDialect
2386 );
2387 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2388 let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2389 Ok(Server_Request::ResetOptions {
2390 responder: Server_ResetOptionsResponder {
2391 control_handle: std::mem::ManuallyDrop::new(control_handle),
2392 tx_id: header.tx_id,
2393 },
2394 })
2395 }
2396 0x353fba50bcf4ecec => {
2397 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2398 let mut req = fidl::new_empty!(
2399 fidl::encoding::EmptyPayload,
2400 fidl::encoding::DefaultFuchsiaResourceDialect
2401 );
2402 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2403 let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2404 Ok(Server_Request::ResetParameters {
2405 responder: Server_ResetParametersResponder {
2406 control_handle: std::mem::ManuallyDrop::new(control_handle),
2407 tx_id: header.tx_id,
2408 },
2409 })
2410 }
2411 0xe39e35cda85a04d => {
2412 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2413 let mut req = fidl::new_empty!(
2414 fidl::encoding::EmptyPayload,
2415 fidl::encoding::DefaultFuchsiaResourceDialect
2416 );
2417 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2418 let control_handle = Server_ControlHandle { inner: this.inner.clone() };
2419 Ok(Server_Request::ClearLeases {
2420 responder: Server_ClearLeasesResponder {
2421 control_handle: std::mem::ManuallyDrop::new(control_handle),
2422 tx_id: header.tx_id,
2423 },
2424 })
2425 }
2426 _ => Err(fidl::Error::UnknownOrdinal {
2427 ordinal: header.ordinal,
2428 protocol_name:
2429 <Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2430 }),
2431 }))
2432 },
2433 )
2434 }
2435}
2436
2437#[derive(Debug)]
2439pub enum Server_Request {
2440 StartServing { responder: Server_StartServingResponder },
2449 StopServing { responder: Server_StopServingResponder },
2458 IsServing { responder: Server_IsServingResponder },
2460 GetOption { code: OptionCode, responder: Server_GetOptionResponder },
2466 GetParameter { name: ParameterName, responder: Server_GetParameterResponder },
2472 SetOption { value: Option_, responder: Server_SetOptionResponder },
2479 SetParameter { value: Parameter, responder: Server_SetParameterResponder },
2491 ListOptions { responder: Server_ListOptionsResponder },
2501 ListParameters { responder: Server_ListParametersResponder },
2511 ResetOptions { responder: Server_ResetOptionsResponder },
2516 ResetParameters { responder: Server_ResetParametersResponder },
2526 ClearLeases { responder: Server_ClearLeasesResponder },
2533}
2534
2535impl Server_Request {
2536 #[allow(irrefutable_let_patterns)]
2537 pub fn into_start_serving(self) -> Option<(Server_StartServingResponder)> {
2538 if let Server_Request::StartServing { responder } = self {
2539 Some((responder))
2540 } else {
2541 None
2542 }
2543 }
2544
2545 #[allow(irrefutable_let_patterns)]
2546 pub fn into_stop_serving(self) -> Option<(Server_StopServingResponder)> {
2547 if let Server_Request::StopServing { responder } = self {
2548 Some((responder))
2549 } else {
2550 None
2551 }
2552 }
2553
2554 #[allow(irrefutable_let_patterns)]
2555 pub fn into_is_serving(self) -> Option<(Server_IsServingResponder)> {
2556 if let Server_Request::IsServing { responder } = self {
2557 Some((responder))
2558 } else {
2559 None
2560 }
2561 }
2562
2563 #[allow(irrefutable_let_patterns)]
2564 pub fn into_get_option(self) -> Option<(OptionCode, Server_GetOptionResponder)> {
2565 if let Server_Request::GetOption { code, responder } = self {
2566 Some((code, responder))
2567 } else {
2568 None
2569 }
2570 }
2571
2572 #[allow(irrefutable_let_patterns)]
2573 pub fn into_get_parameter(self) -> Option<(ParameterName, Server_GetParameterResponder)> {
2574 if let Server_Request::GetParameter { name, responder } = self {
2575 Some((name, responder))
2576 } else {
2577 None
2578 }
2579 }
2580
2581 #[allow(irrefutable_let_patterns)]
2582 pub fn into_set_option(self) -> Option<(Option_, Server_SetOptionResponder)> {
2583 if let Server_Request::SetOption { value, responder } = self {
2584 Some((value, responder))
2585 } else {
2586 None
2587 }
2588 }
2589
2590 #[allow(irrefutable_let_patterns)]
2591 pub fn into_set_parameter(self) -> Option<(Parameter, Server_SetParameterResponder)> {
2592 if let Server_Request::SetParameter { value, responder } = self {
2593 Some((value, responder))
2594 } else {
2595 None
2596 }
2597 }
2598
2599 #[allow(irrefutable_let_patterns)]
2600 pub fn into_list_options(self) -> Option<(Server_ListOptionsResponder)> {
2601 if let Server_Request::ListOptions { responder } = self {
2602 Some((responder))
2603 } else {
2604 None
2605 }
2606 }
2607
2608 #[allow(irrefutable_let_patterns)]
2609 pub fn into_list_parameters(self) -> Option<(Server_ListParametersResponder)> {
2610 if let Server_Request::ListParameters { responder } = self {
2611 Some((responder))
2612 } else {
2613 None
2614 }
2615 }
2616
2617 #[allow(irrefutable_let_patterns)]
2618 pub fn into_reset_options(self) -> Option<(Server_ResetOptionsResponder)> {
2619 if let Server_Request::ResetOptions { responder } = self {
2620 Some((responder))
2621 } else {
2622 None
2623 }
2624 }
2625
2626 #[allow(irrefutable_let_patterns)]
2627 pub fn into_reset_parameters(self) -> Option<(Server_ResetParametersResponder)> {
2628 if let Server_Request::ResetParameters { responder } = self {
2629 Some((responder))
2630 } else {
2631 None
2632 }
2633 }
2634
2635 #[allow(irrefutable_let_patterns)]
2636 pub fn into_clear_leases(self) -> Option<(Server_ClearLeasesResponder)> {
2637 if let Server_Request::ClearLeases { responder } = self {
2638 Some((responder))
2639 } else {
2640 None
2641 }
2642 }
2643
2644 pub fn method_name(&self) -> &'static str {
2646 match *self {
2647 Server_Request::StartServing { .. } => "start_serving",
2648 Server_Request::StopServing { .. } => "stop_serving",
2649 Server_Request::IsServing { .. } => "is_serving",
2650 Server_Request::GetOption { .. } => "get_option",
2651 Server_Request::GetParameter { .. } => "get_parameter",
2652 Server_Request::SetOption { .. } => "set_option",
2653 Server_Request::SetParameter { .. } => "set_parameter",
2654 Server_Request::ListOptions { .. } => "list_options",
2655 Server_Request::ListParameters { .. } => "list_parameters",
2656 Server_Request::ResetOptions { .. } => "reset_options",
2657 Server_Request::ResetParameters { .. } => "reset_parameters",
2658 Server_Request::ClearLeases { .. } => "clear_leases",
2659 }
2660 }
2661}
2662
2663#[derive(Debug, Clone)]
2664pub struct Server_ControlHandle {
2665 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2666}
2667
2668impl fidl::endpoints::ControlHandle for Server_ControlHandle {
2669 fn shutdown(&self) {
2670 self.inner.shutdown()
2671 }
2672 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2673 self.inner.shutdown_with_epitaph(status)
2674 }
2675
2676 fn is_closed(&self) -> bool {
2677 self.inner.channel().is_closed()
2678 }
2679 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2680 self.inner.channel().on_closed()
2681 }
2682
2683 #[cfg(target_os = "fuchsia")]
2684 fn signal_peer(
2685 &self,
2686 clear_mask: zx::Signals,
2687 set_mask: zx::Signals,
2688 ) -> Result<(), zx_status::Status> {
2689 use fidl::Peered;
2690 self.inner.channel().signal_peer(clear_mask, set_mask)
2691 }
2692}
2693
2694impl Server_ControlHandle {}
2695
2696#[must_use = "FIDL methods require a response to be sent"]
2697#[derive(Debug)]
2698pub struct Server_StartServingResponder {
2699 control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
2700 tx_id: u32,
2701}
2702
2703impl std::ops::Drop for Server_StartServingResponder {
2707 fn drop(&mut self) {
2708 self.control_handle.shutdown();
2709 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2711 }
2712}
2713
2714impl fidl::endpoints::Responder for Server_StartServingResponder {
2715 type ControlHandle = Server_ControlHandle;
2716
2717 fn control_handle(&self) -> &Server_ControlHandle {
2718 &self.control_handle
2719 }
2720
2721 fn drop_without_shutdown(mut self) {
2722 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2724 std::mem::forget(self);
2726 }
2727}
2728
2729impl Server_StartServingResponder {
2730 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2734 let _result = self.send_raw(result);
2735 if _result.is_err() {
2736 self.control_handle.shutdown();
2737 }
2738 self.drop_without_shutdown();
2739 _result
2740 }
2741
2742 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2744 let _result = self.send_raw(result);
2745 self.drop_without_shutdown();
2746 _result
2747 }
2748
2749 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2750 self.control_handle
2751 .inner
2752 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2753 result,
2754 self.tx_id,
2755 0x10990e324ac53cd1,
2756 fidl::encoding::DynamicFlags::empty(),
2757 )
2758 }
2759}
2760
2761#[must_use = "FIDL methods require a response to be sent"]
2762#[derive(Debug)]
2763pub struct Server_StopServingResponder {
2764 control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
2765 tx_id: u32,
2766}
2767
2768impl std::ops::Drop for Server_StopServingResponder {
2772 fn drop(&mut self) {
2773 self.control_handle.shutdown();
2774 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2776 }
2777}
2778
2779impl fidl::endpoints::Responder for Server_StopServingResponder {
2780 type ControlHandle = Server_ControlHandle;
2781
2782 fn control_handle(&self) -> &Server_ControlHandle {
2783 &self.control_handle
2784 }
2785
2786 fn drop_without_shutdown(mut self) {
2787 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2789 std::mem::forget(self);
2791 }
2792}
2793
2794impl Server_StopServingResponder {
2795 pub fn send(self) -> Result<(), fidl::Error> {
2799 let _result = self.send_raw();
2800 if _result.is_err() {
2801 self.control_handle.shutdown();
2802 }
2803 self.drop_without_shutdown();
2804 _result
2805 }
2806
2807 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2809 let _result = self.send_raw();
2810 self.drop_without_shutdown();
2811 _result
2812 }
2813
2814 fn send_raw(&self) -> Result<(), fidl::Error> {
2815 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2816 (),
2817 self.tx_id,
2818 0x7776cfe9f68a0dbe,
2819 fidl::encoding::DynamicFlags::empty(),
2820 )
2821 }
2822}
2823
2824#[must_use = "FIDL methods require a response to be sent"]
2825#[derive(Debug)]
2826pub struct Server_IsServingResponder {
2827 control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
2828 tx_id: u32,
2829}
2830
2831impl std::ops::Drop for Server_IsServingResponder {
2835 fn drop(&mut self) {
2836 self.control_handle.shutdown();
2837 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2839 }
2840}
2841
2842impl fidl::endpoints::Responder for Server_IsServingResponder {
2843 type ControlHandle = Server_ControlHandle;
2844
2845 fn control_handle(&self) -> &Server_ControlHandle {
2846 &self.control_handle
2847 }
2848
2849 fn drop_without_shutdown(mut self) {
2850 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2852 std::mem::forget(self);
2854 }
2855}
2856
2857impl Server_IsServingResponder {
2858 pub fn send(self, mut enabled: bool) -> Result<(), fidl::Error> {
2862 let _result = self.send_raw(enabled);
2863 if _result.is_err() {
2864 self.control_handle.shutdown();
2865 }
2866 self.drop_without_shutdown();
2867 _result
2868 }
2869
2870 pub fn send_no_shutdown_on_err(self, mut enabled: bool) -> Result<(), fidl::Error> {
2872 let _result = self.send_raw(enabled);
2873 self.drop_without_shutdown();
2874 _result
2875 }
2876
2877 fn send_raw(&self, mut enabled: bool) -> Result<(), fidl::Error> {
2878 self.control_handle.inner.send::<ServerIsServingResponse>(
2879 (enabled,),
2880 self.tx_id,
2881 0x45aadc35fcbe3826,
2882 fidl::encoding::DynamicFlags::empty(),
2883 )
2884 }
2885}
2886
2887#[must_use = "FIDL methods require a response to be sent"]
2888#[derive(Debug)]
2889pub struct Server_GetOptionResponder {
2890 control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
2891 tx_id: u32,
2892}
2893
2894impl std::ops::Drop for Server_GetOptionResponder {
2898 fn drop(&mut self) {
2899 self.control_handle.shutdown();
2900 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2902 }
2903}
2904
2905impl fidl::endpoints::Responder for Server_GetOptionResponder {
2906 type ControlHandle = Server_ControlHandle;
2907
2908 fn control_handle(&self) -> &Server_ControlHandle {
2909 &self.control_handle
2910 }
2911
2912 fn drop_without_shutdown(mut self) {
2913 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2915 std::mem::forget(self);
2917 }
2918}
2919
2920impl Server_GetOptionResponder {
2921 pub fn send(self, mut result: Result<&Option_, i32>) -> Result<(), fidl::Error> {
2925 let _result = self.send_raw(result);
2926 if _result.is_err() {
2927 self.control_handle.shutdown();
2928 }
2929 self.drop_without_shutdown();
2930 _result
2931 }
2932
2933 pub fn send_no_shutdown_on_err(
2935 self,
2936 mut result: Result<&Option_, i32>,
2937 ) -> Result<(), fidl::Error> {
2938 let _result = self.send_raw(result);
2939 self.drop_without_shutdown();
2940 _result
2941 }
2942
2943 fn send_raw(&self, mut result: Result<&Option_, i32>) -> Result<(), fidl::Error> {
2944 self.control_handle.inner.send::<fidl::encoding::ResultType<ServerGetOptionResponse, i32>>(
2945 result.map(|value| (value,)),
2946 self.tx_id,
2947 0x5305ee2c593f68a,
2948 fidl::encoding::DynamicFlags::empty(),
2949 )
2950 }
2951}
2952
2953#[must_use = "FIDL methods require a response to be sent"]
2954#[derive(Debug)]
2955pub struct Server_GetParameterResponder {
2956 control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
2957 tx_id: u32,
2958}
2959
2960impl std::ops::Drop for Server_GetParameterResponder {
2964 fn drop(&mut self) {
2965 self.control_handle.shutdown();
2966 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2968 }
2969}
2970
2971impl fidl::endpoints::Responder for Server_GetParameterResponder {
2972 type ControlHandle = Server_ControlHandle;
2973
2974 fn control_handle(&self) -> &Server_ControlHandle {
2975 &self.control_handle
2976 }
2977
2978 fn drop_without_shutdown(mut self) {
2979 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2981 std::mem::forget(self);
2983 }
2984}
2985
2986impl Server_GetParameterResponder {
2987 pub fn send(self, mut result: Result<&Parameter, i32>) -> Result<(), fidl::Error> {
2991 let _result = self.send_raw(result);
2992 if _result.is_err() {
2993 self.control_handle.shutdown();
2994 }
2995 self.drop_without_shutdown();
2996 _result
2997 }
2998
2999 pub fn send_no_shutdown_on_err(
3001 self,
3002 mut result: Result<&Parameter, i32>,
3003 ) -> Result<(), fidl::Error> {
3004 let _result = self.send_raw(result);
3005 self.drop_without_shutdown();
3006 _result
3007 }
3008
3009 fn send_raw(&self, mut result: Result<&Parameter, i32>) -> Result<(), fidl::Error> {
3010 self.control_handle
3011 .inner
3012 .send::<fidl::encoding::ResultType<ServerGetParameterResponse, i32>>(
3013 result.map(|value| (value,)),
3014 self.tx_id,
3015 0x1e8c98758fb82714,
3016 fidl::encoding::DynamicFlags::empty(),
3017 )
3018 }
3019}
3020
3021#[must_use = "FIDL methods require a response to be sent"]
3022#[derive(Debug)]
3023pub struct Server_SetOptionResponder {
3024 control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
3025 tx_id: u32,
3026}
3027
3028impl std::ops::Drop for Server_SetOptionResponder {
3032 fn drop(&mut self) {
3033 self.control_handle.shutdown();
3034 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3036 }
3037}
3038
3039impl fidl::endpoints::Responder for Server_SetOptionResponder {
3040 type ControlHandle = Server_ControlHandle;
3041
3042 fn control_handle(&self) -> &Server_ControlHandle {
3043 &self.control_handle
3044 }
3045
3046 fn drop_without_shutdown(mut self) {
3047 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3049 std::mem::forget(self);
3051 }
3052}
3053
3054impl Server_SetOptionResponder {
3055 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3059 let _result = self.send_raw(result);
3060 if _result.is_err() {
3061 self.control_handle.shutdown();
3062 }
3063 self.drop_without_shutdown();
3064 _result
3065 }
3066
3067 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3069 let _result = self.send_raw(result);
3070 self.drop_without_shutdown();
3071 _result
3072 }
3073
3074 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3075 self.control_handle
3076 .inner
3077 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3078 result,
3079 self.tx_id,
3080 0x63c98b670db8d96a,
3081 fidl::encoding::DynamicFlags::empty(),
3082 )
3083 }
3084}
3085
3086#[must_use = "FIDL methods require a response to be sent"]
3087#[derive(Debug)]
3088pub struct Server_SetParameterResponder {
3089 control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
3090 tx_id: u32,
3091}
3092
3093impl std::ops::Drop for Server_SetParameterResponder {
3097 fn drop(&mut self) {
3098 self.control_handle.shutdown();
3099 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3101 }
3102}
3103
3104impl fidl::endpoints::Responder for Server_SetParameterResponder {
3105 type ControlHandle = Server_ControlHandle;
3106
3107 fn control_handle(&self) -> &Server_ControlHandle {
3108 &self.control_handle
3109 }
3110
3111 fn drop_without_shutdown(mut self) {
3112 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3114 std::mem::forget(self);
3116 }
3117}
3118
3119impl Server_SetParameterResponder {
3120 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3124 let _result = self.send_raw(result);
3125 if _result.is_err() {
3126 self.control_handle.shutdown();
3127 }
3128 self.drop_without_shutdown();
3129 _result
3130 }
3131
3132 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3134 let _result = self.send_raw(result);
3135 self.drop_without_shutdown();
3136 _result
3137 }
3138
3139 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3140 self.control_handle
3141 .inner
3142 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3143 result,
3144 self.tx_id,
3145 0x3002d0d956eb4bdc,
3146 fidl::encoding::DynamicFlags::empty(),
3147 )
3148 }
3149}
3150
3151#[must_use = "FIDL methods require a response to be sent"]
3152#[derive(Debug)]
3153pub struct Server_ListOptionsResponder {
3154 control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
3155 tx_id: u32,
3156}
3157
3158impl std::ops::Drop for Server_ListOptionsResponder {
3162 fn drop(&mut self) {
3163 self.control_handle.shutdown();
3164 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3166 }
3167}
3168
3169impl fidl::endpoints::Responder for Server_ListOptionsResponder {
3170 type ControlHandle = Server_ControlHandle;
3171
3172 fn control_handle(&self) -> &Server_ControlHandle {
3173 &self.control_handle
3174 }
3175
3176 fn drop_without_shutdown(mut self) {
3177 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3179 std::mem::forget(self);
3181 }
3182}
3183
3184impl Server_ListOptionsResponder {
3185 pub fn send(self, mut result: Result<&[Option_], i32>) -> Result<(), fidl::Error> {
3189 let _result = self.send_raw(result);
3190 if _result.is_err() {
3191 self.control_handle.shutdown();
3192 }
3193 self.drop_without_shutdown();
3194 _result
3195 }
3196
3197 pub fn send_no_shutdown_on_err(
3199 self,
3200 mut result: Result<&[Option_], i32>,
3201 ) -> Result<(), fidl::Error> {
3202 let _result = self.send_raw(result);
3203 self.drop_without_shutdown();
3204 _result
3205 }
3206
3207 fn send_raw(&self, mut result: Result<&[Option_], i32>) -> Result<(), fidl::Error> {
3208 self.control_handle
3209 .inner
3210 .send::<fidl::encoding::ResultType<ServerListOptionsResponse, i32>>(
3211 result.map(|options| (options,)),
3212 self.tx_id,
3213 0x72c8161c69ca67b,
3214 fidl::encoding::DynamicFlags::empty(),
3215 )
3216 }
3217}
3218
3219#[must_use = "FIDL methods require a response to be sent"]
3220#[derive(Debug)]
3221pub struct Server_ListParametersResponder {
3222 control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
3223 tx_id: u32,
3224}
3225
3226impl std::ops::Drop for Server_ListParametersResponder {
3230 fn drop(&mut self) {
3231 self.control_handle.shutdown();
3232 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3234 }
3235}
3236
3237impl fidl::endpoints::Responder for Server_ListParametersResponder {
3238 type ControlHandle = Server_ControlHandle;
3239
3240 fn control_handle(&self) -> &Server_ControlHandle {
3241 &self.control_handle
3242 }
3243
3244 fn drop_without_shutdown(mut self) {
3245 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3247 std::mem::forget(self);
3249 }
3250}
3251
3252impl Server_ListParametersResponder {
3253 pub fn send(self, mut result: Result<&[Parameter], i32>) -> Result<(), fidl::Error> {
3257 let _result = self.send_raw(result);
3258 if _result.is_err() {
3259 self.control_handle.shutdown();
3260 }
3261 self.drop_without_shutdown();
3262 _result
3263 }
3264
3265 pub fn send_no_shutdown_on_err(
3267 self,
3268 mut result: Result<&[Parameter], i32>,
3269 ) -> Result<(), fidl::Error> {
3270 let _result = self.send_raw(result);
3271 self.drop_without_shutdown();
3272 _result
3273 }
3274
3275 fn send_raw(&self, mut result: Result<&[Parameter], i32>) -> Result<(), fidl::Error> {
3276 self.control_handle
3277 .inner
3278 .send::<fidl::encoding::ResultType<ServerListParametersResponse, i32>>(
3279 result.map(|parameters| (parameters,)),
3280 self.tx_id,
3281 0xa201b1d6d121c59,
3282 fidl::encoding::DynamicFlags::empty(),
3283 )
3284 }
3285}
3286
3287#[must_use = "FIDL methods require a response to be sent"]
3288#[derive(Debug)]
3289pub struct Server_ResetOptionsResponder {
3290 control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
3291 tx_id: u32,
3292}
3293
3294impl std::ops::Drop for Server_ResetOptionsResponder {
3298 fn drop(&mut self) {
3299 self.control_handle.shutdown();
3300 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3302 }
3303}
3304
3305impl fidl::endpoints::Responder for Server_ResetOptionsResponder {
3306 type ControlHandle = Server_ControlHandle;
3307
3308 fn control_handle(&self) -> &Server_ControlHandle {
3309 &self.control_handle
3310 }
3311
3312 fn drop_without_shutdown(mut self) {
3313 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3315 std::mem::forget(self);
3317 }
3318}
3319
3320impl Server_ResetOptionsResponder {
3321 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3325 let _result = self.send_raw(result);
3326 if _result.is_err() {
3327 self.control_handle.shutdown();
3328 }
3329 self.drop_without_shutdown();
3330 _result
3331 }
3332
3333 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3335 let _result = self.send_raw(result);
3336 self.drop_without_shutdown();
3337 _result
3338 }
3339
3340 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3341 self.control_handle
3342 .inner
3343 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3344 result,
3345 self.tx_id,
3346 0x31014911fd21cc13,
3347 fidl::encoding::DynamicFlags::empty(),
3348 )
3349 }
3350}
3351
3352#[must_use = "FIDL methods require a response to be sent"]
3353#[derive(Debug)]
3354pub struct Server_ResetParametersResponder {
3355 control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
3356 tx_id: u32,
3357}
3358
3359impl std::ops::Drop for Server_ResetParametersResponder {
3363 fn drop(&mut self) {
3364 self.control_handle.shutdown();
3365 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3367 }
3368}
3369
3370impl fidl::endpoints::Responder for Server_ResetParametersResponder {
3371 type ControlHandle = Server_ControlHandle;
3372
3373 fn control_handle(&self) -> &Server_ControlHandle {
3374 &self.control_handle
3375 }
3376
3377 fn drop_without_shutdown(mut self) {
3378 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3380 std::mem::forget(self);
3382 }
3383}
3384
3385impl Server_ResetParametersResponder {
3386 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3390 let _result = self.send_raw(result);
3391 if _result.is_err() {
3392 self.control_handle.shutdown();
3393 }
3394 self.drop_without_shutdown();
3395 _result
3396 }
3397
3398 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3400 let _result = self.send_raw(result);
3401 self.drop_without_shutdown();
3402 _result
3403 }
3404
3405 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3406 self.control_handle
3407 .inner
3408 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3409 result,
3410 self.tx_id,
3411 0x353fba50bcf4ecec,
3412 fidl::encoding::DynamicFlags::empty(),
3413 )
3414 }
3415}
3416
3417#[must_use = "FIDL methods require a response to be sent"]
3418#[derive(Debug)]
3419pub struct Server_ClearLeasesResponder {
3420 control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
3421 tx_id: u32,
3422}
3423
3424impl std::ops::Drop for Server_ClearLeasesResponder {
3428 fn drop(&mut self) {
3429 self.control_handle.shutdown();
3430 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3432 }
3433}
3434
3435impl fidl::endpoints::Responder for Server_ClearLeasesResponder {
3436 type ControlHandle = Server_ControlHandle;
3437
3438 fn control_handle(&self) -> &Server_ControlHandle {
3439 &self.control_handle
3440 }
3441
3442 fn drop_without_shutdown(mut self) {
3443 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3445 std::mem::forget(self);
3447 }
3448}
3449
3450impl Server_ClearLeasesResponder {
3451 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3455 let _result = self.send_raw(result);
3456 if _result.is_err() {
3457 self.control_handle.shutdown();
3458 }
3459 self.drop_without_shutdown();
3460 _result
3461 }
3462
3463 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3465 let _result = self.send_raw(result);
3466 self.drop_without_shutdown();
3467 _result
3468 }
3469
3470 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3471 self.control_handle
3472 .inner
3473 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3474 result,
3475 self.tx_id,
3476 0xe39e35cda85a04d,
3477 fidl::encoding::DynamicFlags::empty(),
3478 )
3479 }
3480}
3481
3482mod internal {
3483 use super::*;
3484
3485 impl fidl::encoding::ResourceTypeMarker for ClientProviderNewClientRequest {
3486 type Borrowed<'a> = &'a mut Self;
3487 fn take_or_borrow<'a>(
3488 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3489 ) -> Self::Borrowed<'a> {
3490 value
3491 }
3492 }
3493
3494 unsafe impl fidl::encoding::TypeMarker for ClientProviderNewClientRequest {
3495 type Owned = Self;
3496
3497 #[inline(always)]
3498 fn inline_align(_context: fidl::encoding::Context) -> usize {
3499 8
3500 }
3501
3502 #[inline(always)]
3503 fn inline_size(_context: fidl::encoding::Context) -> usize {
3504 32
3505 }
3506 }
3507
3508 unsafe impl
3509 fidl::encoding::Encode<
3510 ClientProviderNewClientRequest,
3511 fidl::encoding::DefaultFuchsiaResourceDialect,
3512 > for &mut ClientProviderNewClientRequest
3513 {
3514 #[inline]
3515 unsafe fn encode(
3516 self,
3517 encoder: &mut fidl::encoding::Encoder<
3518 '_,
3519 fidl::encoding::DefaultFuchsiaResourceDialect,
3520 >,
3521 offset: usize,
3522 _depth: fidl::encoding::Depth,
3523 ) -> fidl::Result<()> {
3524 encoder.debug_check_bounds::<ClientProviderNewClientRequest>(offset);
3525 fidl::encoding::Encode::<ClientProviderNewClientRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3527 (
3528 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.interface_id),
3529 <NewClientParams as fidl::encoding::ValueTypeMarker>::borrow(&self.params),
3530 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClientMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.request),
3531 ),
3532 encoder, offset, _depth
3533 )
3534 }
3535 }
3536 unsafe impl<
3537 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
3538 T1: fidl::encoding::Encode<NewClientParams, fidl::encoding::DefaultFuchsiaResourceDialect>,
3539 T2: fidl::encoding::Encode<
3540 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClientMarker>>,
3541 fidl::encoding::DefaultFuchsiaResourceDialect,
3542 >,
3543 >
3544 fidl::encoding::Encode<
3545 ClientProviderNewClientRequest,
3546 fidl::encoding::DefaultFuchsiaResourceDialect,
3547 > for (T0, T1, T2)
3548 {
3549 #[inline]
3550 unsafe fn encode(
3551 self,
3552 encoder: &mut fidl::encoding::Encoder<
3553 '_,
3554 fidl::encoding::DefaultFuchsiaResourceDialect,
3555 >,
3556 offset: usize,
3557 depth: fidl::encoding::Depth,
3558 ) -> fidl::Result<()> {
3559 encoder.debug_check_bounds::<ClientProviderNewClientRequest>(offset);
3560 unsafe {
3563 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
3564 (ptr as *mut u64).write_unaligned(0);
3565 }
3566 self.0.encode(encoder, offset + 0, depth)?;
3568 self.1.encode(encoder, offset + 8, depth)?;
3569 self.2.encode(encoder, offset + 24, depth)?;
3570 Ok(())
3571 }
3572 }
3573
3574 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3575 for ClientProviderNewClientRequest
3576 {
3577 #[inline(always)]
3578 fn new_empty() -> Self {
3579 Self {
3580 interface_id: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
3581 params: fidl::new_empty!(
3582 NewClientParams,
3583 fidl::encoding::DefaultFuchsiaResourceDialect
3584 ),
3585 request: fidl::new_empty!(
3586 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClientMarker>>,
3587 fidl::encoding::DefaultFuchsiaResourceDialect
3588 ),
3589 }
3590 }
3591
3592 #[inline]
3593 unsafe fn decode(
3594 &mut self,
3595 decoder: &mut fidl::encoding::Decoder<
3596 '_,
3597 fidl::encoding::DefaultFuchsiaResourceDialect,
3598 >,
3599 offset: usize,
3600 _depth: fidl::encoding::Depth,
3601 ) -> fidl::Result<()> {
3602 decoder.debug_check_bounds::<Self>(offset);
3603 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
3605 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3606 let mask = 0xffffffff00000000u64;
3607 let maskedval = padval & mask;
3608 if maskedval != 0 {
3609 return Err(fidl::Error::NonZeroPadding {
3610 padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
3611 });
3612 }
3613 fidl::decode!(
3614 u64,
3615 fidl::encoding::DefaultFuchsiaResourceDialect,
3616 &mut self.interface_id,
3617 decoder,
3618 offset + 0,
3619 _depth
3620 )?;
3621 fidl::decode!(
3622 NewClientParams,
3623 fidl::encoding::DefaultFuchsiaResourceDialect,
3624 &mut self.params,
3625 decoder,
3626 offset + 8,
3627 _depth
3628 )?;
3629 fidl::decode!(
3630 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ClientMarker>>,
3631 fidl::encoding::DefaultFuchsiaResourceDialect,
3632 &mut self.request,
3633 decoder,
3634 offset + 24,
3635 _depth
3636 )?;
3637 Ok(())
3638 }
3639 }
3640
3641 impl Address {
3642 #[inline(always)]
3643 fn max_ordinal_present(&self) -> u64 {
3644 if let Some(_) = self.address_state_provider {
3645 return 3;
3646 }
3647 if let Some(_) = self.address_parameters {
3648 return 2;
3649 }
3650 if let Some(_) = self.address {
3651 return 1;
3652 }
3653 0
3654 }
3655 }
3656
3657 impl fidl::encoding::ResourceTypeMarker for Address {
3658 type Borrowed<'a> = &'a mut Self;
3659 fn take_or_borrow<'a>(
3660 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3661 ) -> Self::Borrowed<'a> {
3662 value
3663 }
3664 }
3665
3666 unsafe impl fidl::encoding::TypeMarker for Address {
3667 type Owned = Self;
3668
3669 #[inline(always)]
3670 fn inline_align(_context: fidl::encoding::Context) -> usize {
3671 8
3672 }
3673
3674 #[inline(always)]
3675 fn inline_size(_context: fidl::encoding::Context) -> usize {
3676 16
3677 }
3678 }
3679
3680 unsafe impl fidl::encoding::Encode<Address, fidl::encoding::DefaultFuchsiaResourceDialect>
3681 for &mut Address
3682 {
3683 unsafe fn encode(
3684 self,
3685 encoder: &mut fidl::encoding::Encoder<
3686 '_,
3687 fidl::encoding::DefaultFuchsiaResourceDialect,
3688 >,
3689 offset: usize,
3690 mut depth: fidl::encoding::Depth,
3691 ) -> fidl::Result<()> {
3692 encoder.debug_check_bounds::<Address>(offset);
3693 let max_ordinal: u64 = self.max_ordinal_present();
3695 encoder.write_num(max_ordinal, offset);
3696 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3697 if max_ordinal == 0 {
3699 return Ok(());
3700 }
3701 depth.increment()?;
3702 let envelope_size = 8;
3703 let bytes_len = max_ordinal as usize * envelope_size;
3704 #[allow(unused_variables)]
3705 let offset = encoder.out_of_line_offset(bytes_len);
3706 let mut _prev_end_offset: usize = 0;
3707 if 1 > max_ordinal {
3708 return Ok(());
3709 }
3710
3711 let cur_offset: usize = (1 - 1) * envelope_size;
3714
3715 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3717
3718 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net::Ipv4AddressWithPrefix, fidl::encoding::DefaultFuchsiaResourceDialect>(
3723 self.address.as_ref().map(<fidl_fuchsia_net::Ipv4AddressWithPrefix as fidl::encoding::ValueTypeMarker>::borrow),
3724 encoder, offset + cur_offset, depth
3725 )?;
3726
3727 _prev_end_offset = cur_offset + envelope_size;
3728 if 2 > max_ordinal {
3729 return Ok(());
3730 }
3731
3732 let cur_offset: usize = (2 - 1) * envelope_size;
3735
3736 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3738
3739 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_net_interfaces_admin::AddressParameters, fidl::encoding::DefaultFuchsiaResourceDialect>(
3744 self.address_parameters.as_ref().map(<fidl_fuchsia_net_interfaces_admin::AddressParameters as fidl::encoding::ValueTypeMarker>::borrow),
3745 encoder, offset + cur_offset, depth
3746 )?;
3747
3748 _prev_end_offset = cur_offset + envelope_size;
3749 if 3 > max_ordinal {
3750 return Ok(());
3751 }
3752
3753 let cur_offset: usize = (3 - 1) * envelope_size;
3756
3757 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3759
3760 fidl::encoding::encode_in_envelope_optional::<
3765 fidl::encoding::Endpoint<
3766 fidl::endpoints::ServerEnd<
3767 fidl_fuchsia_net_interfaces_admin::AddressStateProviderMarker,
3768 >,
3769 >,
3770 fidl::encoding::DefaultFuchsiaResourceDialect,
3771 >(
3772 self.address_state_provider.as_mut().map(
3773 <fidl::encoding::Endpoint<
3774 fidl::endpoints::ServerEnd<
3775 fidl_fuchsia_net_interfaces_admin::AddressStateProviderMarker,
3776 >,
3777 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
3778 ),
3779 encoder,
3780 offset + cur_offset,
3781 depth,
3782 )?;
3783
3784 _prev_end_offset = cur_offset + envelope_size;
3785
3786 Ok(())
3787 }
3788 }
3789
3790 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Address {
3791 #[inline(always)]
3792 fn new_empty() -> Self {
3793 Self::default()
3794 }
3795
3796 unsafe fn decode(
3797 &mut self,
3798 decoder: &mut fidl::encoding::Decoder<
3799 '_,
3800 fidl::encoding::DefaultFuchsiaResourceDialect,
3801 >,
3802 offset: usize,
3803 mut depth: fidl::encoding::Depth,
3804 ) -> fidl::Result<()> {
3805 decoder.debug_check_bounds::<Self>(offset);
3806 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3807 None => return Err(fidl::Error::NotNullable),
3808 Some(len) => len,
3809 };
3810 if len == 0 {
3812 return Ok(());
3813 };
3814 depth.increment()?;
3815 let envelope_size = 8;
3816 let bytes_len = len * envelope_size;
3817 let offset = decoder.out_of_line_offset(bytes_len)?;
3818 let mut _next_ordinal_to_read = 0;
3820 let mut next_offset = offset;
3821 let end_offset = offset + bytes_len;
3822 _next_ordinal_to_read += 1;
3823 if next_offset >= end_offset {
3824 return Ok(());
3825 }
3826
3827 while _next_ordinal_to_read < 1 {
3829 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3830 _next_ordinal_to_read += 1;
3831 next_offset += envelope_size;
3832 }
3833
3834 let next_out_of_line = decoder.next_out_of_line();
3835 let handles_before = decoder.remaining_handles();
3836 if let Some((inlined, num_bytes, num_handles)) =
3837 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3838 {
3839 let member_inline_size = <fidl_fuchsia_net::Ipv4AddressWithPrefix as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3840 if inlined != (member_inline_size <= 4) {
3841 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3842 }
3843 let inner_offset;
3844 let mut inner_depth = depth.clone();
3845 if inlined {
3846 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3847 inner_offset = next_offset;
3848 } else {
3849 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3850 inner_depth.increment()?;
3851 }
3852 let val_ref = self.address.get_or_insert_with(|| {
3853 fidl::new_empty!(
3854 fidl_fuchsia_net::Ipv4AddressWithPrefix,
3855 fidl::encoding::DefaultFuchsiaResourceDialect
3856 )
3857 });
3858 fidl::decode!(
3859 fidl_fuchsia_net::Ipv4AddressWithPrefix,
3860 fidl::encoding::DefaultFuchsiaResourceDialect,
3861 val_ref,
3862 decoder,
3863 inner_offset,
3864 inner_depth
3865 )?;
3866 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3867 {
3868 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3869 }
3870 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3871 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3872 }
3873 }
3874
3875 next_offset += envelope_size;
3876 _next_ordinal_to_read += 1;
3877 if next_offset >= end_offset {
3878 return Ok(());
3879 }
3880
3881 while _next_ordinal_to_read < 2 {
3883 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3884 _next_ordinal_to_read += 1;
3885 next_offset += envelope_size;
3886 }
3887
3888 let next_out_of_line = decoder.next_out_of_line();
3889 let handles_before = decoder.remaining_handles();
3890 if let Some((inlined, num_bytes, num_handles)) =
3891 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3892 {
3893 let member_inline_size = <fidl_fuchsia_net_interfaces_admin::AddressParameters as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3894 if inlined != (member_inline_size <= 4) {
3895 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3896 }
3897 let inner_offset;
3898 let mut inner_depth = depth.clone();
3899 if inlined {
3900 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3901 inner_offset = next_offset;
3902 } else {
3903 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3904 inner_depth.increment()?;
3905 }
3906 let val_ref = self.address_parameters.get_or_insert_with(|| {
3907 fidl::new_empty!(
3908 fidl_fuchsia_net_interfaces_admin::AddressParameters,
3909 fidl::encoding::DefaultFuchsiaResourceDialect
3910 )
3911 });
3912 fidl::decode!(
3913 fidl_fuchsia_net_interfaces_admin::AddressParameters,
3914 fidl::encoding::DefaultFuchsiaResourceDialect,
3915 val_ref,
3916 decoder,
3917 inner_offset,
3918 inner_depth
3919 )?;
3920 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3921 {
3922 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3923 }
3924 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3925 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3926 }
3927 }
3928
3929 next_offset += envelope_size;
3930 _next_ordinal_to_read += 1;
3931 if next_offset >= end_offset {
3932 return Ok(());
3933 }
3934
3935 while _next_ordinal_to_read < 3 {
3937 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3938 _next_ordinal_to_read += 1;
3939 next_offset += envelope_size;
3940 }
3941
3942 let next_out_of_line = decoder.next_out_of_line();
3943 let handles_before = decoder.remaining_handles();
3944 if let Some((inlined, num_bytes, num_handles)) =
3945 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3946 {
3947 let member_inline_size = <fidl::encoding::Endpoint<
3948 fidl::endpoints::ServerEnd<
3949 fidl_fuchsia_net_interfaces_admin::AddressStateProviderMarker,
3950 >,
3951 > as fidl::encoding::TypeMarker>::inline_size(
3952 decoder.context
3953 );
3954 if inlined != (member_inline_size <= 4) {
3955 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3956 }
3957 let inner_offset;
3958 let mut inner_depth = depth.clone();
3959 if inlined {
3960 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3961 inner_offset = next_offset;
3962 } else {
3963 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3964 inner_depth.increment()?;
3965 }
3966 let val_ref = self.address_state_provider.get_or_insert_with(|| {
3967 fidl::new_empty!(
3968 fidl::encoding::Endpoint<
3969 fidl::endpoints::ServerEnd<
3970 fidl_fuchsia_net_interfaces_admin::AddressStateProviderMarker,
3971 >,
3972 >,
3973 fidl::encoding::DefaultFuchsiaResourceDialect
3974 )
3975 });
3976 fidl::decode!(
3977 fidl::encoding::Endpoint<
3978 fidl::endpoints::ServerEnd<
3979 fidl_fuchsia_net_interfaces_admin::AddressStateProviderMarker,
3980 >,
3981 >,
3982 fidl::encoding::DefaultFuchsiaResourceDialect,
3983 val_ref,
3984 decoder,
3985 inner_offset,
3986 inner_depth
3987 )?;
3988 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3989 {
3990 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3991 }
3992 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3993 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3994 }
3995 }
3996
3997 next_offset += envelope_size;
3998
3999 while next_offset < end_offset {
4001 _next_ordinal_to_read += 1;
4002 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4003 next_offset += envelope_size;
4004 }
4005
4006 Ok(())
4007 }
4008 }
4009
4010 impl ClientWatchConfigurationResponse {
4011 #[inline(always)]
4012 fn max_ordinal_present(&self) -> u64 {
4013 if let Some(_) = self.routers {
4014 return 3;
4015 }
4016 if let Some(_) = self.dns_servers {
4017 return 2;
4018 }
4019 if let Some(_) = self.address {
4020 return 1;
4021 }
4022 0
4023 }
4024 }
4025
4026 impl fidl::encoding::ResourceTypeMarker for ClientWatchConfigurationResponse {
4027 type Borrowed<'a> = &'a mut Self;
4028 fn take_or_borrow<'a>(
4029 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4030 ) -> Self::Borrowed<'a> {
4031 value
4032 }
4033 }
4034
4035 unsafe impl fidl::encoding::TypeMarker for ClientWatchConfigurationResponse {
4036 type Owned = Self;
4037
4038 #[inline(always)]
4039 fn inline_align(_context: fidl::encoding::Context) -> usize {
4040 8
4041 }
4042
4043 #[inline(always)]
4044 fn inline_size(_context: fidl::encoding::Context) -> usize {
4045 16
4046 }
4047 }
4048
4049 unsafe impl
4050 fidl::encoding::Encode<
4051 ClientWatchConfigurationResponse,
4052 fidl::encoding::DefaultFuchsiaResourceDialect,
4053 > for &mut ClientWatchConfigurationResponse
4054 {
4055 unsafe fn encode(
4056 self,
4057 encoder: &mut fidl::encoding::Encoder<
4058 '_,
4059 fidl::encoding::DefaultFuchsiaResourceDialect,
4060 >,
4061 offset: usize,
4062 mut depth: fidl::encoding::Depth,
4063 ) -> fidl::Result<()> {
4064 encoder.debug_check_bounds::<ClientWatchConfigurationResponse>(offset);
4065 let max_ordinal: u64 = self.max_ordinal_present();
4067 encoder.write_num(max_ordinal, offset);
4068 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4069 if max_ordinal == 0 {
4071 return Ok(());
4072 }
4073 depth.increment()?;
4074 let envelope_size = 8;
4075 let bytes_len = max_ordinal as usize * envelope_size;
4076 #[allow(unused_variables)]
4077 let offset = encoder.out_of_line_offset(bytes_len);
4078 let mut _prev_end_offset: usize = 0;
4079 if 1 > max_ordinal {
4080 return Ok(());
4081 }
4082
4083 let cur_offset: usize = (1 - 1) * envelope_size;
4086
4087 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4089
4090 fidl::encoding::encode_in_envelope_optional::<
4095 Address,
4096 fidl::encoding::DefaultFuchsiaResourceDialect,
4097 >(
4098 self.address
4099 .as_mut()
4100 .map(<Address as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
4101 encoder,
4102 offset + cur_offset,
4103 depth,
4104 )?;
4105
4106 _prev_end_offset = cur_offset + envelope_size;
4107 if 2 > max_ordinal {
4108 return Ok(());
4109 }
4110
4111 let cur_offset: usize = (2 - 1) * envelope_size;
4114
4115 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4117
4118 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4123 self.dns_servers.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64> as fidl::encoding::ValueTypeMarker>::borrow),
4124 encoder, offset + cur_offset, depth
4125 )?;
4126
4127 _prev_end_offset = cur_offset + envelope_size;
4128 if 3 > max_ordinal {
4129 return Ok(());
4130 }
4131
4132 let cur_offset: usize = (3 - 1) * envelope_size;
4135
4136 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4138
4139 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4144 self.routers.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64> as fidl::encoding::ValueTypeMarker>::borrow),
4145 encoder, offset + cur_offset, depth
4146 )?;
4147
4148 _prev_end_offset = cur_offset + envelope_size;
4149
4150 Ok(())
4151 }
4152 }
4153
4154 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4155 for ClientWatchConfigurationResponse
4156 {
4157 #[inline(always)]
4158 fn new_empty() -> Self {
4159 Self::default()
4160 }
4161
4162 unsafe fn decode(
4163 &mut self,
4164 decoder: &mut fidl::encoding::Decoder<
4165 '_,
4166 fidl::encoding::DefaultFuchsiaResourceDialect,
4167 >,
4168 offset: usize,
4169 mut depth: fidl::encoding::Depth,
4170 ) -> fidl::Result<()> {
4171 decoder.debug_check_bounds::<Self>(offset);
4172 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4173 None => return Err(fidl::Error::NotNullable),
4174 Some(len) => len,
4175 };
4176 if len == 0 {
4178 return Ok(());
4179 };
4180 depth.increment()?;
4181 let envelope_size = 8;
4182 let bytes_len = len * envelope_size;
4183 let offset = decoder.out_of_line_offset(bytes_len)?;
4184 let mut _next_ordinal_to_read = 0;
4186 let mut next_offset = offset;
4187 let end_offset = offset + bytes_len;
4188 _next_ordinal_to_read += 1;
4189 if next_offset >= end_offset {
4190 return Ok(());
4191 }
4192
4193 while _next_ordinal_to_read < 1 {
4195 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4196 _next_ordinal_to_read += 1;
4197 next_offset += envelope_size;
4198 }
4199
4200 let next_out_of_line = decoder.next_out_of_line();
4201 let handles_before = decoder.remaining_handles();
4202 if let Some((inlined, num_bytes, num_handles)) =
4203 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4204 {
4205 let member_inline_size =
4206 <Address as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4207 if inlined != (member_inline_size <= 4) {
4208 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4209 }
4210 let inner_offset;
4211 let mut inner_depth = depth.clone();
4212 if inlined {
4213 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4214 inner_offset = next_offset;
4215 } else {
4216 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4217 inner_depth.increment()?;
4218 }
4219 let val_ref = self.address.get_or_insert_with(|| {
4220 fidl::new_empty!(Address, fidl::encoding::DefaultFuchsiaResourceDialect)
4221 });
4222 fidl::decode!(
4223 Address,
4224 fidl::encoding::DefaultFuchsiaResourceDialect,
4225 val_ref,
4226 decoder,
4227 inner_offset,
4228 inner_depth
4229 )?;
4230 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4231 {
4232 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4233 }
4234 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4235 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4236 }
4237 }
4238
4239 next_offset += envelope_size;
4240 _next_ordinal_to_read += 1;
4241 if next_offset >= end_offset {
4242 return Ok(());
4243 }
4244
4245 while _next_ordinal_to_read < 2 {
4247 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4248 _next_ordinal_to_read += 1;
4249 next_offset += envelope_size;
4250 }
4251
4252 let next_out_of_line = decoder.next_out_of_line();
4253 let handles_before = decoder.remaining_handles();
4254 if let Some((inlined, num_bytes, num_handles)) =
4255 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4256 {
4257 let member_inline_size = <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4258 if inlined != (member_inline_size <= 4) {
4259 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4260 }
4261 let inner_offset;
4262 let mut inner_depth = depth.clone();
4263 if inlined {
4264 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4265 inner_offset = next_offset;
4266 } else {
4267 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4268 inner_depth.increment()?;
4269 }
4270 let val_ref =
4271 self.dns_servers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect));
4272 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4273 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4274 {
4275 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4276 }
4277 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4278 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4279 }
4280 }
4281
4282 next_offset += envelope_size;
4283 _next_ordinal_to_read += 1;
4284 if next_offset >= end_offset {
4285 return Ok(());
4286 }
4287
4288 while _next_ordinal_to_read < 3 {
4290 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4291 _next_ordinal_to_read += 1;
4292 next_offset += envelope_size;
4293 }
4294
4295 let next_out_of_line = decoder.next_out_of_line();
4296 let handles_before = decoder.remaining_handles();
4297 if let Some((inlined, num_bytes, num_handles)) =
4298 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4299 {
4300 let member_inline_size = <fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4301 if inlined != (member_inline_size <= 4) {
4302 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4303 }
4304 let inner_offset;
4305 let mut inner_depth = depth.clone();
4306 if inlined {
4307 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4308 inner_offset = next_offset;
4309 } else {
4310 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4311 inner_depth.increment()?;
4312 }
4313 let val_ref =
4314 self.routers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect));
4315 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_net::Ipv4Address, 64>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4316 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4317 {
4318 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4319 }
4320 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4321 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4322 }
4323 }
4324
4325 next_offset += envelope_size;
4326
4327 while next_offset < end_offset {
4329 _next_ordinal_to_read += 1;
4330 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4331 next_offset += envelope_size;
4332 }
4333
4334 Ok(())
4335 }
4336 }
4337}