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_developer_remotecontrol__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct RemoteControlConnectCapabilityRequest {
16 pub moniker: String,
17 pub capability_set: fidl_fuchsia_sys2::OpenDirType,
18 pub capability_name: String,
19 pub server_channel: fidl::Channel,
20}
21
22impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
23 for RemoteControlConnectCapabilityRequest
24{
25}
26
27#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
28pub struct RemoteControlMarker;
29
30impl fidl::endpoints::ProtocolMarker for RemoteControlMarker {
31 type Proxy = RemoteControlProxy;
32 type RequestStream = RemoteControlRequestStream;
33 #[cfg(target_os = "fuchsia")]
34 type SynchronousProxy = RemoteControlSynchronousProxy;
35
36 const DEBUG_NAME: &'static str = "fuchsia.developer.remotecontrol.RemoteControl";
37}
38impl fidl::endpoints::DiscoverableProtocolMarker for RemoteControlMarker {}
39pub type RemoteControlIdentifyHostResult = Result<IdentifyHostResponse, IdentifyHostError>;
40pub type RemoteControlConnectCapabilityResult = Result<(), ConnectCapabilityError>;
41
42pub trait RemoteControlProxyInterface: Send + Sync {
43 type EchoStringResponseFut: std::future::Future<Output = Result<String, fidl::Error>> + Send;
44 fn r#echo_string(&self, value: &str) -> Self::EchoStringResponseFut;
45 type LogMessageResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
46 fn r#log_message(
47 &self,
48 tag: &str,
49 message: &str,
50 severity: fidl_fuchsia_diagnostics_types::Severity,
51 ) -> Self::LogMessageResponseFut;
52 type IdentifyHostResponseFut: std::future::Future<Output = Result<RemoteControlIdentifyHostResult, fidl::Error>>
53 + Send;
54 fn r#identify_host(&self) -> Self::IdentifyHostResponseFut;
55 type ConnectCapabilityResponseFut: std::future::Future<Output = Result<RemoteControlConnectCapabilityResult, fidl::Error>>
56 + Send;
57 fn r#connect_capability(
58 &self,
59 moniker: &str,
60 capability_set: fidl_fuchsia_sys2::OpenDirType,
61 capability_name: &str,
62 server_channel: fidl::Channel,
63 ) -> Self::ConnectCapabilityResponseFut;
64 type GetTimeResponseFut: std::future::Future<Output = Result<fidl::MonotonicInstant, fidl::Error>>
65 + Send;
66 fn r#get_time(&self) -> Self::GetTimeResponseFut;
67 type GetBootTimeResponseFut: std::future::Future<Output = Result<fidl::BootInstant, fidl::Error>>
68 + Send;
69 fn r#get_boot_time(&self) -> Self::GetBootTimeResponseFut;
70}
71#[derive(Debug)]
72#[cfg(target_os = "fuchsia")]
73pub struct RemoteControlSynchronousProxy {
74 client: fidl::client::sync::Client,
75}
76
77#[cfg(target_os = "fuchsia")]
78impl fidl::endpoints::SynchronousProxy for RemoteControlSynchronousProxy {
79 type Proxy = RemoteControlProxy;
80 type Protocol = RemoteControlMarker;
81
82 fn from_channel(inner: fidl::Channel) -> Self {
83 Self::new(inner)
84 }
85
86 fn into_channel(self) -> fidl::Channel {
87 self.client.into_channel()
88 }
89
90 fn as_channel(&self) -> &fidl::Channel {
91 self.client.as_channel()
92 }
93}
94
95#[cfg(target_os = "fuchsia")]
96impl RemoteControlSynchronousProxy {
97 pub fn new(channel: fidl::Channel) -> Self {
98 let protocol_name = <RemoteControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
99 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
100 }
101
102 pub fn into_channel(self) -> fidl::Channel {
103 self.client.into_channel()
104 }
105
106 pub fn wait_for_event(
109 &self,
110 deadline: zx::MonotonicInstant,
111 ) -> Result<RemoteControlEvent, fidl::Error> {
112 RemoteControlEvent::decode(self.client.wait_for_event(deadline)?)
113 }
114
115 pub fn r#echo_string(
117 &self,
118 mut value: &str,
119 ___deadline: zx::MonotonicInstant,
120 ) -> Result<String, fidl::Error> {
121 let _response = self
122 .client
123 .send_query::<RemoteControlEchoStringRequest, RemoteControlEchoStringResponse>(
124 (value,),
125 0x2bbec7ca8a72e82b,
126 fidl::encoding::DynamicFlags::empty(),
127 ___deadline,
128 )?;
129 Ok(_response.response)
130 }
131
132 pub fn r#log_message(
134 &self,
135 mut tag: &str,
136 mut message: &str,
137 mut severity: fidl_fuchsia_diagnostics_types::Severity,
138 ___deadline: zx::MonotonicInstant,
139 ) -> Result<(), fidl::Error> {
140 let _response = self
141 .client
142 .send_query::<RemoteControlLogMessageRequest, fidl::encoding::EmptyPayload>(
143 (tag, message, severity),
144 0x3da84acd5bbf3926,
145 fidl::encoding::DynamicFlags::empty(),
146 ___deadline,
147 )?;
148 Ok(_response)
149 }
150
151 pub fn r#identify_host(
152 &self,
153 ___deadline: zx::MonotonicInstant,
154 ) -> Result<RemoteControlIdentifyHostResult, fidl::Error> {
155 let _response = self
156 .client
157 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::FlexibleResultType<
158 RemoteControlIdentifyHostResponse,
159 IdentifyHostError,
160 >>(
161 (), 0x6035e1ab368deee1, fidl::encoding::DynamicFlags::FLEXIBLE, ___deadline
162 )?
163 .into_result::<RemoteControlMarker>("identify_host")?;
164 Ok(_response.map(|x| x.response))
165 }
166
167 pub fn r#connect_capability(
170 &self,
171 mut moniker: &str,
172 mut capability_set: fidl_fuchsia_sys2::OpenDirType,
173 mut capability_name: &str,
174 mut server_channel: fidl::Channel,
175 ___deadline: zx::MonotonicInstant,
176 ) -> Result<RemoteControlConnectCapabilityResult, fidl::Error> {
177 let _response = self.client.send_query::<
178 RemoteControlConnectCapabilityRequest,
179 fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, ConnectCapabilityError>,
180 >(
181 (moniker, capability_set, capability_name, server_channel,),
182 0x3ae7a7c874dceceb,
183 fidl::encoding::DynamicFlags::FLEXIBLE,
184 ___deadline,
185 )?
186 .into_result::<RemoteControlMarker>("connect_capability")?;
187 Ok(_response.map(|x| x))
188 }
189
190 pub fn r#get_time(
191 &self,
192 ___deadline: zx::MonotonicInstant,
193 ) -> Result<fidl::MonotonicInstant, fidl::Error> {
194 let _response =
195 self.client.send_query::<fidl::encoding::EmptyPayload, RemoteControlGetTimeResponse>(
196 (),
197 0x3588f31e9067748d,
198 fidl::encoding::DynamicFlags::empty(),
199 ___deadline,
200 )?;
201 Ok(_response.time)
202 }
203
204 pub fn r#get_boot_time(
205 &self,
206 ___deadline: zx::MonotonicInstant,
207 ) -> Result<fidl::BootInstant, fidl::Error> {
208 let _response = self
209 .client
210 .send_query::<fidl::encoding::EmptyPayload, RemoteControlGetBootTimeResponse>(
211 (),
212 0x55706f013cd79ebd,
213 fidl::encoding::DynamicFlags::empty(),
214 ___deadline,
215 )?;
216 Ok(_response.time)
217 }
218}
219
220#[cfg(target_os = "fuchsia")]
221impl From<RemoteControlSynchronousProxy> for zx::NullableHandle {
222 fn from(value: RemoteControlSynchronousProxy) -> Self {
223 value.into_channel().into()
224 }
225}
226
227#[cfg(target_os = "fuchsia")]
228impl From<fidl::Channel> for RemoteControlSynchronousProxy {
229 fn from(value: fidl::Channel) -> Self {
230 Self::new(value)
231 }
232}
233
234#[cfg(target_os = "fuchsia")]
235impl fidl::endpoints::FromClient for RemoteControlSynchronousProxy {
236 type Protocol = RemoteControlMarker;
237
238 fn from_client(value: fidl::endpoints::ClientEnd<RemoteControlMarker>) -> Self {
239 Self::new(value.into_channel())
240 }
241}
242
243#[derive(Debug, Clone)]
244pub struct RemoteControlProxy {
245 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
246}
247
248impl fidl::endpoints::Proxy for RemoteControlProxy {
249 type Protocol = RemoteControlMarker;
250
251 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
252 Self::new(inner)
253 }
254
255 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
256 self.client.into_channel().map_err(|client| Self { client })
257 }
258
259 fn as_channel(&self) -> &::fidl::AsyncChannel {
260 self.client.as_channel()
261 }
262}
263
264impl RemoteControlProxy {
265 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
267 let protocol_name = <RemoteControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
268 Self { client: fidl::client::Client::new(channel, protocol_name) }
269 }
270
271 pub fn take_event_stream(&self) -> RemoteControlEventStream {
277 RemoteControlEventStream { event_receiver: self.client.take_event_receiver() }
278 }
279
280 pub fn r#echo_string(
282 &self,
283 mut value: &str,
284 ) -> fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect> {
285 RemoteControlProxyInterface::r#echo_string(self, value)
286 }
287
288 pub fn r#log_message(
290 &self,
291 mut tag: &str,
292 mut message: &str,
293 mut severity: fidl_fuchsia_diagnostics_types::Severity,
294 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
295 RemoteControlProxyInterface::r#log_message(self, tag, message, severity)
296 }
297
298 pub fn r#identify_host(
299 &self,
300 ) -> fidl::client::QueryResponseFut<
301 RemoteControlIdentifyHostResult,
302 fidl::encoding::DefaultFuchsiaResourceDialect,
303 > {
304 RemoteControlProxyInterface::r#identify_host(self)
305 }
306
307 pub fn r#connect_capability(
310 &self,
311 mut moniker: &str,
312 mut capability_set: fidl_fuchsia_sys2::OpenDirType,
313 mut capability_name: &str,
314 mut server_channel: fidl::Channel,
315 ) -> fidl::client::QueryResponseFut<
316 RemoteControlConnectCapabilityResult,
317 fidl::encoding::DefaultFuchsiaResourceDialect,
318 > {
319 RemoteControlProxyInterface::r#connect_capability(
320 self,
321 moniker,
322 capability_set,
323 capability_name,
324 server_channel,
325 )
326 }
327
328 pub fn r#get_time(
329 &self,
330 ) -> fidl::client::QueryResponseFut<
331 fidl::MonotonicInstant,
332 fidl::encoding::DefaultFuchsiaResourceDialect,
333 > {
334 RemoteControlProxyInterface::r#get_time(self)
335 }
336
337 pub fn r#get_boot_time(
338 &self,
339 ) -> fidl::client::QueryResponseFut<
340 fidl::BootInstant,
341 fidl::encoding::DefaultFuchsiaResourceDialect,
342 > {
343 RemoteControlProxyInterface::r#get_boot_time(self)
344 }
345}
346
347impl RemoteControlProxyInterface for RemoteControlProxy {
348 type EchoStringResponseFut =
349 fidl::client::QueryResponseFut<String, fidl::encoding::DefaultFuchsiaResourceDialect>;
350 fn r#echo_string(&self, mut value: &str) -> Self::EchoStringResponseFut {
351 fn _decode(
352 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
353 ) -> Result<String, fidl::Error> {
354 let _response = fidl::client::decode_transaction_body::<
355 RemoteControlEchoStringResponse,
356 fidl::encoding::DefaultFuchsiaResourceDialect,
357 0x2bbec7ca8a72e82b,
358 >(_buf?)?;
359 Ok(_response.response)
360 }
361 self.client.send_query_and_decode::<RemoteControlEchoStringRequest, String>(
362 (value,),
363 0x2bbec7ca8a72e82b,
364 fidl::encoding::DynamicFlags::empty(),
365 _decode,
366 )
367 }
368
369 type LogMessageResponseFut =
370 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
371 fn r#log_message(
372 &self,
373 mut tag: &str,
374 mut message: &str,
375 mut severity: fidl_fuchsia_diagnostics_types::Severity,
376 ) -> Self::LogMessageResponseFut {
377 fn _decode(
378 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
379 ) -> Result<(), fidl::Error> {
380 let _response = fidl::client::decode_transaction_body::<
381 fidl::encoding::EmptyPayload,
382 fidl::encoding::DefaultFuchsiaResourceDialect,
383 0x3da84acd5bbf3926,
384 >(_buf?)?;
385 Ok(_response)
386 }
387 self.client.send_query_and_decode::<RemoteControlLogMessageRequest, ()>(
388 (tag, message, severity),
389 0x3da84acd5bbf3926,
390 fidl::encoding::DynamicFlags::empty(),
391 _decode,
392 )
393 }
394
395 type IdentifyHostResponseFut = fidl::client::QueryResponseFut<
396 RemoteControlIdentifyHostResult,
397 fidl::encoding::DefaultFuchsiaResourceDialect,
398 >;
399 fn r#identify_host(&self) -> Self::IdentifyHostResponseFut {
400 fn _decode(
401 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
402 ) -> Result<RemoteControlIdentifyHostResult, fidl::Error> {
403 let _response = fidl::client::decode_transaction_body::<
404 fidl::encoding::FlexibleResultType<
405 RemoteControlIdentifyHostResponse,
406 IdentifyHostError,
407 >,
408 fidl::encoding::DefaultFuchsiaResourceDialect,
409 0x6035e1ab368deee1,
410 >(_buf?)?
411 .into_result::<RemoteControlMarker>("identify_host")?;
412 Ok(_response.map(|x| x.response))
413 }
414 self.client
415 .send_query_and_decode::<fidl::encoding::EmptyPayload, RemoteControlIdentifyHostResult>(
416 (),
417 0x6035e1ab368deee1,
418 fidl::encoding::DynamicFlags::FLEXIBLE,
419 _decode,
420 )
421 }
422
423 type ConnectCapabilityResponseFut = fidl::client::QueryResponseFut<
424 RemoteControlConnectCapabilityResult,
425 fidl::encoding::DefaultFuchsiaResourceDialect,
426 >;
427 fn r#connect_capability(
428 &self,
429 mut moniker: &str,
430 mut capability_set: fidl_fuchsia_sys2::OpenDirType,
431 mut capability_name: &str,
432 mut server_channel: fidl::Channel,
433 ) -> Self::ConnectCapabilityResponseFut {
434 fn _decode(
435 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
436 ) -> Result<RemoteControlConnectCapabilityResult, fidl::Error> {
437 let _response = fidl::client::decode_transaction_body::<
438 fidl::encoding::FlexibleResultType<
439 fidl::encoding::EmptyStruct,
440 ConnectCapabilityError,
441 >,
442 fidl::encoding::DefaultFuchsiaResourceDialect,
443 0x3ae7a7c874dceceb,
444 >(_buf?)?
445 .into_result::<RemoteControlMarker>("connect_capability")?;
446 Ok(_response.map(|x| x))
447 }
448 self.client.send_query_and_decode::<
449 RemoteControlConnectCapabilityRequest,
450 RemoteControlConnectCapabilityResult,
451 >(
452 (moniker, capability_set, capability_name, server_channel,),
453 0x3ae7a7c874dceceb,
454 fidl::encoding::DynamicFlags::FLEXIBLE,
455 _decode,
456 )
457 }
458
459 type GetTimeResponseFut = fidl::client::QueryResponseFut<
460 fidl::MonotonicInstant,
461 fidl::encoding::DefaultFuchsiaResourceDialect,
462 >;
463 fn r#get_time(&self) -> Self::GetTimeResponseFut {
464 fn _decode(
465 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
466 ) -> Result<fidl::MonotonicInstant, fidl::Error> {
467 let _response = fidl::client::decode_transaction_body::<
468 RemoteControlGetTimeResponse,
469 fidl::encoding::DefaultFuchsiaResourceDialect,
470 0x3588f31e9067748d,
471 >(_buf?)?;
472 Ok(_response.time)
473 }
474 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::MonotonicInstant>(
475 (),
476 0x3588f31e9067748d,
477 fidl::encoding::DynamicFlags::empty(),
478 _decode,
479 )
480 }
481
482 type GetBootTimeResponseFut = fidl::client::QueryResponseFut<
483 fidl::BootInstant,
484 fidl::encoding::DefaultFuchsiaResourceDialect,
485 >;
486 fn r#get_boot_time(&self) -> Self::GetBootTimeResponseFut {
487 fn _decode(
488 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
489 ) -> Result<fidl::BootInstant, fidl::Error> {
490 let _response = fidl::client::decode_transaction_body::<
491 RemoteControlGetBootTimeResponse,
492 fidl::encoding::DefaultFuchsiaResourceDialect,
493 0x55706f013cd79ebd,
494 >(_buf?)?;
495 Ok(_response.time)
496 }
497 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::BootInstant>(
498 (),
499 0x55706f013cd79ebd,
500 fidl::encoding::DynamicFlags::empty(),
501 _decode,
502 )
503 }
504}
505
506pub struct RemoteControlEventStream {
507 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
508}
509
510impl std::marker::Unpin for RemoteControlEventStream {}
511
512impl futures::stream::FusedStream for RemoteControlEventStream {
513 fn is_terminated(&self) -> bool {
514 self.event_receiver.is_terminated()
515 }
516}
517
518impl futures::Stream for RemoteControlEventStream {
519 type Item = Result<RemoteControlEvent, fidl::Error>;
520
521 fn poll_next(
522 mut self: std::pin::Pin<&mut Self>,
523 cx: &mut std::task::Context<'_>,
524 ) -> std::task::Poll<Option<Self::Item>> {
525 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
526 &mut self.event_receiver,
527 cx
528 )?) {
529 Some(buf) => std::task::Poll::Ready(Some(RemoteControlEvent::decode(buf))),
530 None => std::task::Poll::Ready(None),
531 }
532 }
533}
534
535#[derive(Debug)]
536pub enum RemoteControlEvent {
537 #[non_exhaustive]
538 _UnknownEvent {
539 ordinal: u64,
541 },
542}
543
544impl RemoteControlEvent {
545 fn decode(
547 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
548 ) -> Result<RemoteControlEvent, fidl::Error> {
549 let (bytes, _handles) = buf.split_mut();
550 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
551 debug_assert_eq!(tx_header.tx_id, 0);
552 match tx_header.ordinal {
553 _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
554 Ok(RemoteControlEvent::_UnknownEvent { ordinal: tx_header.ordinal })
555 }
556 _ => Err(fidl::Error::UnknownOrdinal {
557 ordinal: tx_header.ordinal,
558 protocol_name: <RemoteControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
559 }),
560 }
561 }
562}
563
564pub struct RemoteControlRequestStream {
566 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
567 is_terminated: bool,
568}
569
570impl std::marker::Unpin for RemoteControlRequestStream {}
571
572impl futures::stream::FusedStream for RemoteControlRequestStream {
573 fn is_terminated(&self) -> bool {
574 self.is_terminated
575 }
576}
577
578impl fidl::endpoints::RequestStream for RemoteControlRequestStream {
579 type Protocol = RemoteControlMarker;
580 type ControlHandle = RemoteControlControlHandle;
581
582 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
583 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
584 }
585
586 fn control_handle(&self) -> Self::ControlHandle {
587 RemoteControlControlHandle { inner: self.inner.clone() }
588 }
589
590 fn into_inner(
591 self,
592 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
593 {
594 (self.inner, self.is_terminated)
595 }
596
597 fn from_inner(
598 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
599 is_terminated: bool,
600 ) -> Self {
601 Self { inner, is_terminated }
602 }
603}
604
605impl futures::Stream for RemoteControlRequestStream {
606 type Item = Result<RemoteControlRequest, fidl::Error>;
607
608 fn poll_next(
609 mut self: std::pin::Pin<&mut Self>,
610 cx: &mut std::task::Context<'_>,
611 ) -> std::task::Poll<Option<Self::Item>> {
612 let this = &mut *self;
613 if this.inner.check_shutdown(cx) {
614 this.is_terminated = true;
615 return std::task::Poll::Ready(None);
616 }
617 if this.is_terminated {
618 panic!("polled RemoteControlRequestStream after completion");
619 }
620 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
621 |bytes, handles| {
622 match this.inner.channel().read_etc(cx, bytes, handles) {
623 std::task::Poll::Ready(Ok(())) => {}
624 std::task::Poll::Pending => return std::task::Poll::Pending,
625 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
626 this.is_terminated = true;
627 return std::task::Poll::Ready(None);
628 }
629 std::task::Poll::Ready(Err(e)) => {
630 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
631 e.into(),
632 ))));
633 }
634 }
635
636 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
638
639 std::task::Poll::Ready(Some(match header.ordinal {
640 0x2bbec7ca8a72e82b => {
641 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
642 let mut req = fidl::new_empty!(
643 RemoteControlEchoStringRequest,
644 fidl::encoding::DefaultFuchsiaResourceDialect
645 );
646 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RemoteControlEchoStringRequest>(&header, _body_bytes, handles, &mut req)?;
647 let control_handle =
648 RemoteControlControlHandle { inner: this.inner.clone() };
649 Ok(RemoteControlRequest::EchoString {
650 value: req.value,
651
652 responder: RemoteControlEchoStringResponder {
653 control_handle: std::mem::ManuallyDrop::new(control_handle),
654 tx_id: header.tx_id,
655 },
656 })
657 }
658 0x3da84acd5bbf3926 => {
659 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
660 let mut req = fidl::new_empty!(
661 RemoteControlLogMessageRequest,
662 fidl::encoding::DefaultFuchsiaResourceDialect
663 );
664 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RemoteControlLogMessageRequest>(&header, _body_bytes, handles, &mut req)?;
665 let control_handle =
666 RemoteControlControlHandle { inner: this.inner.clone() };
667 Ok(RemoteControlRequest::LogMessage {
668 tag: req.tag,
669 message: req.message,
670 severity: req.severity,
671
672 responder: RemoteControlLogMessageResponder {
673 control_handle: std::mem::ManuallyDrop::new(control_handle),
674 tx_id: header.tx_id,
675 },
676 })
677 }
678 0x6035e1ab368deee1 => {
679 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
680 let mut req = fidl::new_empty!(
681 fidl::encoding::EmptyPayload,
682 fidl::encoding::DefaultFuchsiaResourceDialect
683 );
684 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
685 let control_handle =
686 RemoteControlControlHandle { inner: this.inner.clone() };
687 Ok(RemoteControlRequest::IdentifyHost {
688 responder: RemoteControlIdentifyHostResponder {
689 control_handle: std::mem::ManuallyDrop::new(control_handle),
690 tx_id: header.tx_id,
691 },
692 })
693 }
694 0x3ae7a7c874dceceb => {
695 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
696 let mut req = fidl::new_empty!(
697 RemoteControlConnectCapabilityRequest,
698 fidl::encoding::DefaultFuchsiaResourceDialect
699 );
700 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RemoteControlConnectCapabilityRequest>(&header, _body_bytes, handles, &mut req)?;
701 let control_handle =
702 RemoteControlControlHandle { inner: this.inner.clone() };
703 Ok(RemoteControlRequest::ConnectCapability {
704 moniker: req.moniker,
705 capability_set: req.capability_set,
706 capability_name: req.capability_name,
707 server_channel: req.server_channel,
708
709 responder: RemoteControlConnectCapabilityResponder {
710 control_handle: std::mem::ManuallyDrop::new(control_handle),
711 tx_id: header.tx_id,
712 },
713 })
714 }
715 0x3588f31e9067748d => {
716 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
717 let mut req = fidl::new_empty!(
718 fidl::encoding::EmptyPayload,
719 fidl::encoding::DefaultFuchsiaResourceDialect
720 );
721 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
722 let control_handle =
723 RemoteControlControlHandle { inner: this.inner.clone() };
724 Ok(RemoteControlRequest::GetTime {
725 responder: RemoteControlGetTimeResponder {
726 control_handle: std::mem::ManuallyDrop::new(control_handle),
727 tx_id: header.tx_id,
728 },
729 })
730 }
731 0x55706f013cd79ebd => {
732 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
733 let mut req = fidl::new_empty!(
734 fidl::encoding::EmptyPayload,
735 fidl::encoding::DefaultFuchsiaResourceDialect
736 );
737 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
738 let control_handle =
739 RemoteControlControlHandle { inner: this.inner.clone() };
740 Ok(RemoteControlRequest::GetBootTime {
741 responder: RemoteControlGetBootTimeResponder {
742 control_handle: std::mem::ManuallyDrop::new(control_handle),
743 tx_id: header.tx_id,
744 },
745 })
746 }
747 _ if header.tx_id == 0
748 && header
749 .dynamic_flags()
750 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
751 {
752 Ok(RemoteControlRequest::_UnknownMethod {
753 ordinal: header.ordinal,
754 control_handle: RemoteControlControlHandle {
755 inner: this.inner.clone(),
756 },
757 method_type: fidl::MethodType::OneWay,
758 })
759 }
760 _ if header
761 .dynamic_flags()
762 .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
763 {
764 this.inner.send_framework_err(
765 fidl::encoding::FrameworkErr::UnknownMethod,
766 header.tx_id,
767 header.ordinal,
768 header.dynamic_flags(),
769 (bytes, handles),
770 )?;
771 Ok(RemoteControlRequest::_UnknownMethod {
772 ordinal: header.ordinal,
773 control_handle: RemoteControlControlHandle {
774 inner: this.inner.clone(),
775 },
776 method_type: fidl::MethodType::TwoWay,
777 })
778 }
779 _ => Err(fidl::Error::UnknownOrdinal {
780 ordinal: header.ordinal,
781 protocol_name:
782 <RemoteControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
783 }),
784 }))
785 },
786 )
787 }
788}
789
790#[derive(Debug)]
791pub enum RemoteControlRequest {
792 EchoString {
794 value: String,
795 responder: RemoteControlEchoStringResponder,
796 },
797 LogMessage {
799 tag: String,
800 message: String,
801 severity: fidl_fuchsia_diagnostics_types::Severity,
802 responder: RemoteControlLogMessageResponder,
803 },
804 IdentifyHost {
805 responder: RemoteControlIdentifyHostResponder,
806 },
807 ConnectCapability {
810 moniker: String,
811 capability_set: fidl_fuchsia_sys2::OpenDirType,
812 capability_name: String,
813 server_channel: fidl::Channel,
814 responder: RemoteControlConnectCapabilityResponder,
815 },
816 GetTime {
817 responder: RemoteControlGetTimeResponder,
818 },
819 GetBootTime {
820 responder: RemoteControlGetBootTimeResponder,
821 },
822 #[non_exhaustive]
824 _UnknownMethod {
825 ordinal: u64,
827 control_handle: RemoteControlControlHandle,
828 method_type: fidl::MethodType,
829 },
830}
831
832impl RemoteControlRequest {
833 #[allow(irrefutable_let_patterns)]
834 pub fn into_echo_string(self) -> Option<(String, RemoteControlEchoStringResponder)> {
835 if let RemoteControlRequest::EchoString { value, responder } = self {
836 Some((value, responder))
837 } else {
838 None
839 }
840 }
841
842 #[allow(irrefutable_let_patterns)]
843 pub fn into_log_message(
844 self,
845 ) -> Option<(
846 String,
847 String,
848 fidl_fuchsia_diagnostics_types::Severity,
849 RemoteControlLogMessageResponder,
850 )> {
851 if let RemoteControlRequest::LogMessage { tag, message, severity, responder } = self {
852 Some((tag, message, severity, responder))
853 } else {
854 None
855 }
856 }
857
858 #[allow(irrefutable_let_patterns)]
859 pub fn into_identify_host(self) -> Option<(RemoteControlIdentifyHostResponder)> {
860 if let RemoteControlRequest::IdentifyHost { responder } = self {
861 Some((responder))
862 } else {
863 None
864 }
865 }
866
867 #[allow(irrefutable_let_patterns)]
868 pub fn into_connect_capability(
869 self,
870 ) -> Option<(
871 String,
872 fidl_fuchsia_sys2::OpenDirType,
873 String,
874 fidl::Channel,
875 RemoteControlConnectCapabilityResponder,
876 )> {
877 if let RemoteControlRequest::ConnectCapability {
878 moniker,
879 capability_set,
880 capability_name,
881 server_channel,
882 responder,
883 } = self
884 {
885 Some((moniker, capability_set, capability_name, server_channel, responder))
886 } else {
887 None
888 }
889 }
890
891 #[allow(irrefutable_let_patterns)]
892 pub fn into_get_time(self) -> Option<(RemoteControlGetTimeResponder)> {
893 if let RemoteControlRequest::GetTime { responder } = self {
894 Some((responder))
895 } else {
896 None
897 }
898 }
899
900 #[allow(irrefutable_let_patterns)]
901 pub fn into_get_boot_time(self) -> Option<(RemoteControlGetBootTimeResponder)> {
902 if let RemoteControlRequest::GetBootTime { responder } = self {
903 Some((responder))
904 } else {
905 None
906 }
907 }
908
909 pub fn method_name(&self) -> &'static str {
911 match *self {
912 RemoteControlRequest::EchoString { .. } => "echo_string",
913 RemoteControlRequest::LogMessage { .. } => "log_message",
914 RemoteControlRequest::IdentifyHost { .. } => "identify_host",
915 RemoteControlRequest::ConnectCapability { .. } => "connect_capability",
916 RemoteControlRequest::GetTime { .. } => "get_time",
917 RemoteControlRequest::GetBootTime { .. } => "get_boot_time",
918 RemoteControlRequest::_UnknownMethod {
919 method_type: fidl::MethodType::OneWay, ..
920 } => "unknown one-way method",
921 RemoteControlRequest::_UnknownMethod {
922 method_type: fidl::MethodType::TwoWay, ..
923 } => "unknown two-way method",
924 }
925 }
926}
927
928#[derive(Debug, Clone)]
929pub struct RemoteControlControlHandle {
930 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
931}
932
933impl fidl::endpoints::ControlHandle for RemoteControlControlHandle {
934 fn shutdown(&self) {
935 self.inner.shutdown()
936 }
937
938 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
939 self.inner.shutdown_with_epitaph(status)
940 }
941
942 fn is_closed(&self) -> bool {
943 self.inner.channel().is_closed()
944 }
945 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
946 self.inner.channel().on_closed()
947 }
948
949 #[cfg(target_os = "fuchsia")]
950 fn signal_peer(
951 &self,
952 clear_mask: zx::Signals,
953 set_mask: zx::Signals,
954 ) -> Result<(), zx_status::Status> {
955 use fidl::Peered;
956 self.inner.channel().signal_peer(clear_mask, set_mask)
957 }
958}
959
960impl RemoteControlControlHandle {}
961
962#[must_use = "FIDL methods require a response to be sent"]
963#[derive(Debug)]
964pub struct RemoteControlEchoStringResponder {
965 control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
966 tx_id: u32,
967}
968
969impl std::ops::Drop for RemoteControlEchoStringResponder {
973 fn drop(&mut self) {
974 self.control_handle.shutdown();
975 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
977 }
978}
979
980impl fidl::endpoints::Responder for RemoteControlEchoStringResponder {
981 type ControlHandle = RemoteControlControlHandle;
982
983 fn control_handle(&self) -> &RemoteControlControlHandle {
984 &self.control_handle
985 }
986
987 fn drop_without_shutdown(mut self) {
988 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
990 std::mem::forget(self);
992 }
993}
994
995impl RemoteControlEchoStringResponder {
996 pub fn send(self, mut response: &str) -> Result<(), fidl::Error> {
1000 let _result = self.send_raw(response);
1001 if _result.is_err() {
1002 self.control_handle.shutdown();
1003 }
1004 self.drop_without_shutdown();
1005 _result
1006 }
1007
1008 pub fn send_no_shutdown_on_err(self, mut response: &str) -> Result<(), fidl::Error> {
1010 let _result = self.send_raw(response);
1011 self.drop_without_shutdown();
1012 _result
1013 }
1014
1015 fn send_raw(&self, mut response: &str) -> Result<(), fidl::Error> {
1016 self.control_handle.inner.send::<RemoteControlEchoStringResponse>(
1017 (response,),
1018 self.tx_id,
1019 0x2bbec7ca8a72e82b,
1020 fidl::encoding::DynamicFlags::empty(),
1021 )
1022 }
1023}
1024
1025#[must_use = "FIDL methods require a response to be sent"]
1026#[derive(Debug)]
1027pub struct RemoteControlLogMessageResponder {
1028 control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
1029 tx_id: u32,
1030}
1031
1032impl std::ops::Drop for RemoteControlLogMessageResponder {
1036 fn drop(&mut self) {
1037 self.control_handle.shutdown();
1038 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1040 }
1041}
1042
1043impl fidl::endpoints::Responder for RemoteControlLogMessageResponder {
1044 type ControlHandle = RemoteControlControlHandle;
1045
1046 fn control_handle(&self) -> &RemoteControlControlHandle {
1047 &self.control_handle
1048 }
1049
1050 fn drop_without_shutdown(mut self) {
1051 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1053 std::mem::forget(self);
1055 }
1056}
1057
1058impl RemoteControlLogMessageResponder {
1059 pub fn send(self) -> Result<(), fidl::Error> {
1063 let _result = self.send_raw();
1064 if _result.is_err() {
1065 self.control_handle.shutdown();
1066 }
1067 self.drop_without_shutdown();
1068 _result
1069 }
1070
1071 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1073 let _result = self.send_raw();
1074 self.drop_without_shutdown();
1075 _result
1076 }
1077
1078 fn send_raw(&self) -> Result<(), fidl::Error> {
1079 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1080 (),
1081 self.tx_id,
1082 0x3da84acd5bbf3926,
1083 fidl::encoding::DynamicFlags::empty(),
1084 )
1085 }
1086}
1087
1088#[must_use = "FIDL methods require a response to be sent"]
1089#[derive(Debug)]
1090pub struct RemoteControlIdentifyHostResponder {
1091 control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
1092 tx_id: u32,
1093}
1094
1095impl std::ops::Drop for RemoteControlIdentifyHostResponder {
1099 fn drop(&mut self) {
1100 self.control_handle.shutdown();
1101 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1103 }
1104}
1105
1106impl fidl::endpoints::Responder for RemoteControlIdentifyHostResponder {
1107 type ControlHandle = RemoteControlControlHandle;
1108
1109 fn control_handle(&self) -> &RemoteControlControlHandle {
1110 &self.control_handle
1111 }
1112
1113 fn drop_without_shutdown(mut self) {
1114 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1116 std::mem::forget(self);
1118 }
1119}
1120
1121impl RemoteControlIdentifyHostResponder {
1122 pub fn send(
1126 self,
1127 mut result: Result<&IdentifyHostResponse, IdentifyHostError>,
1128 ) -> Result<(), fidl::Error> {
1129 let _result = self.send_raw(result);
1130 if _result.is_err() {
1131 self.control_handle.shutdown();
1132 }
1133 self.drop_without_shutdown();
1134 _result
1135 }
1136
1137 pub fn send_no_shutdown_on_err(
1139 self,
1140 mut result: Result<&IdentifyHostResponse, IdentifyHostError>,
1141 ) -> Result<(), fidl::Error> {
1142 let _result = self.send_raw(result);
1143 self.drop_without_shutdown();
1144 _result
1145 }
1146
1147 fn send_raw(
1148 &self,
1149 mut result: Result<&IdentifyHostResponse, IdentifyHostError>,
1150 ) -> Result<(), fidl::Error> {
1151 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1152 RemoteControlIdentifyHostResponse,
1153 IdentifyHostError,
1154 >>(
1155 fidl::encoding::FlexibleResult::new(result.map(|response| (response,))),
1156 self.tx_id,
1157 0x6035e1ab368deee1,
1158 fidl::encoding::DynamicFlags::FLEXIBLE,
1159 )
1160 }
1161}
1162
1163#[must_use = "FIDL methods require a response to be sent"]
1164#[derive(Debug)]
1165pub struct RemoteControlConnectCapabilityResponder {
1166 control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
1167 tx_id: u32,
1168}
1169
1170impl std::ops::Drop for RemoteControlConnectCapabilityResponder {
1174 fn drop(&mut self) {
1175 self.control_handle.shutdown();
1176 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1178 }
1179}
1180
1181impl fidl::endpoints::Responder for RemoteControlConnectCapabilityResponder {
1182 type ControlHandle = RemoteControlControlHandle;
1183
1184 fn control_handle(&self) -> &RemoteControlControlHandle {
1185 &self.control_handle
1186 }
1187
1188 fn drop_without_shutdown(mut self) {
1189 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1191 std::mem::forget(self);
1193 }
1194}
1195
1196impl RemoteControlConnectCapabilityResponder {
1197 pub fn send(self, mut result: Result<(), ConnectCapabilityError>) -> Result<(), fidl::Error> {
1201 let _result = self.send_raw(result);
1202 if _result.is_err() {
1203 self.control_handle.shutdown();
1204 }
1205 self.drop_without_shutdown();
1206 _result
1207 }
1208
1209 pub fn send_no_shutdown_on_err(
1211 self,
1212 mut result: Result<(), ConnectCapabilityError>,
1213 ) -> Result<(), fidl::Error> {
1214 let _result = self.send_raw(result);
1215 self.drop_without_shutdown();
1216 _result
1217 }
1218
1219 fn send_raw(&self, mut result: Result<(), ConnectCapabilityError>) -> Result<(), fidl::Error> {
1220 self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1221 fidl::encoding::EmptyStruct,
1222 ConnectCapabilityError,
1223 >>(
1224 fidl::encoding::FlexibleResult::new(result),
1225 self.tx_id,
1226 0x3ae7a7c874dceceb,
1227 fidl::encoding::DynamicFlags::FLEXIBLE,
1228 )
1229 }
1230}
1231
1232#[must_use = "FIDL methods require a response to be sent"]
1233#[derive(Debug)]
1234pub struct RemoteControlGetTimeResponder {
1235 control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
1236 tx_id: u32,
1237}
1238
1239impl std::ops::Drop for RemoteControlGetTimeResponder {
1243 fn drop(&mut self) {
1244 self.control_handle.shutdown();
1245 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1247 }
1248}
1249
1250impl fidl::endpoints::Responder for RemoteControlGetTimeResponder {
1251 type ControlHandle = RemoteControlControlHandle;
1252
1253 fn control_handle(&self) -> &RemoteControlControlHandle {
1254 &self.control_handle
1255 }
1256
1257 fn drop_without_shutdown(mut self) {
1258 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1260 std::mem::forget(self);
1262 }
1263}
1264
1265impl RemoteControlGetTimeResponder {
1266 pub fn send(self, mut time: fidl::MonotonicInstant) -> Result<(), fidl::Error> {
1270 let _result = self.send_raw(time);
1271 if _result.is_err() {
1272 self.control_handle.shutdown();
1273 }
1274 self.drop_without_shutdown();
1275 _result
1276 }
1277
1278 pub fn send_no_shutdown_on_err(
1280 self,
1281 mut time: fidl::MonotonicInstant,
1282 ) -> Result<(), fidl::Error> {
1283 let _result = self.send_raw(time);
1284 self.drop_without_shutdown();
1285 _result
1286 }
1287
1288 fn send_raw(&self, mut time: fidl::MonotonicInstant) -> Result<(), fidl::Error> {
1289 self.control_handle.inner.send::<RemoteControlGetTimeResponse>(
1290 (time,),
1291 self.tx_id,
1292 0x3588f31e9067748d,
1293 fidl::encoding::DynamicFlags::empty(),
1294 )
1295 }
1296}
1297
1298#[must_use = "FIDL methods require a response to be sent"]
1299#[derive(Debug)]
1300pub struct RemoteControlGetBootTimeResponder {
1301 control_handle: std::mem::ManuallyDrop<RemoteControlControlHandle>,
1302 tx_id: u32,
1303}
1304
1305impl std::ops::Drop for RemoteControlGetBootTimeResponder {
1309 fn drop(&mut self) {
1310 self.control_handle.shutdown();
1311 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1313 }
1314}
1315
1316impl fidl::endpoints::Responder for RemoteControlGetBootTimeResponder {
1317 type ControlHandle = RemoteControlControlHandle;
1318
1319 fn control_handle(&self) -> &RemoteControlControlHandle {
1320 &self.control_handle
1321 }
1322
1323 fn drop_without_shutdown(mut self) {
1324 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1326 std::mem::forget(self);
1328 }
1329}
1330
1331impl RemoteControlGetBootTimeResponder {
1332 pub fn send(self, mut time: fidl::BootInstant) -> Result<(), fidl::Error> {
1336 let _result = self.send_raw(time);
1337 if _result.is_err() {
1338 self.control_handle.shutdown();
1339 }
1340 self.drop_without_shutdown();
1341 _result
1342 }
1343
1344 pub fn send_no_shutdown_on_err(self, mut time: fidl::BootInstant) -> Result<(), fidl::Error> {
1346 let _result = self.send_raw(time);
1347 self.drop_without_shutdown();
1348 _result
1349 }
1350
1351 fn send_raw(&self, mut time: fidl::BootInstant) -> Result<(), fidl::Error> {
1352 self.control_handle.inner.send::<RemoteControlGetBootTimeResponse>(
1353 (time,),
1354 self.tx_id,
1355 0x55706f013cd79ebd,
1356 fidl::encoding::DynamicFlags::empty(),
1357 )
1358 }
1359}
1360
1361mod internal {
1362 use super::*;
1363
1364 impl fidl::encoding::ResourceTypeMarker for RemoteControlConnectCapabilityRequest {
1365 type Borrowed<'a> = &'a mut Self;
1366 fn take_or_borrow<'a>(
1367 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1368 ) -> Self::Borrowed<'a> {
1369 value
1370 }
1371 }
1372
1373 unsafe impl fidl::encoding::TypeMarker for RemoteControlConnectCapabilityRequest {
1374 type Owned = Self;
1375
1376 #[inline(always)]
1377 fn inline_align(_context: fidl::encoding::Context) -> usize {
1378 8
1379 }
1380
1381 #[inline(always)]
1382 fn inline_size(_context: fidl::encoding::Context) -> usize {
1383 48
1384 }
1385 }
1386
1387 unsafe impl
1388 fidl::encoding::Encode<
1389 RemoteControlConnectCapabilityRequest,
1390 fidl::encoding::DefaultFuchsiaResourceDialect,
1391 > for &mut RemoteControlConnectCapabilityRequest
1392 {
1393 #[inline]
1394 unsafe fn encode(
1395 self,
1396 encoder: &mut fidl::encoding::Encoder<
1397 '_,
1398 fidl::encoding::DefaultFuchsiaResourceDialect,
1399 >,
1400 offset: usize,
1401 _depth: fidl::encoding::Depth,
1402 ) -> fidl::Result<()> {
1403 encoder.debug_check_bounds::<RemoteControlConnectCapabilityRequest>(offset);
1404 fidl::encoding::Encode::<RemoteControlConnectCapabilityRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1406 (
1407 <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.moniker),
1408 <fidl_fuchsia_sys2::OpenDirType as fidl::encoding::ValueTypeMarker>::borrow(&self.capability_set),
1409 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.capability_name),
1410 <fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.server_channel),
1411 ),
1412 encoder, offset, _depth
1413 )
1414 }
1415 }
1416 unsafe impl<
1417 T0: fidl::encoding::Encode<
1418 fidl::encoding::BoundedString<4096>,
1419 fidl::encoding::DefaultFuchsiaResourceDialect,
1420 >,
1421 T1: fidl::encoding::Encode<
1422 fidl_fuchsia_sys2::OpenDirType,
1423 fidl::encoding::DefaultFuchsiaResourceDialect,
1424 >,
1425 T2: fidl::encoding::Encode<
1426 fidl::encoding::BoundedString<255>,
1427 fidl::encoding::DefaultFuchsiaResourceDialect,
1428 >,
1429 T3: fidl::encoding::Encode<
1430 fidl::encoding::HandleType<
1431 fidl::Channel,
1432 { fidl::ObjectType::CHANNEL.into_raw() },
1433 2147483648,
1434 >,
1435 fidl::encoding::DefaultFuchsiaResourceDialect,
1436 >,
1437 >
1438 fidl::encoding::Encode<
1439 RemoteControlConnectCapabilityRequest,
1440 fidl::encoding::DefaultFuchsiaResourceDialect,
1441 > for (T0, T1, T2, T3)
1442 {
1443 #[inline]
1444 unsafe fn encode(
1445 self,
1446 encoder: &mut fidl::encoding::Encoder<
1447 '_,
1448 fidl::encoding::DefaultFuchsiaResourceDialect,
1449 >,
1450 offset: usize,
1451 depth: fidl::encoding::Depth,
1452 ) -> fidl::Result<()> {
1453 encoder.debug_check_bounds::<RemoteControlConnectCapabilityRequest>(offset);
1454 unsafe {
1457 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
1458 (ptr as *mut u64).write_unaligned(0);
1459 }
1460 unsafe {
1461 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
1462 (ptr as *mut u64).write_unaligned(0);
1463 }
1464 self.0.encode(encoder, offset + 0, depth)?;
1466 self.1.encode(encoder, offset + 16, depth)?;
1467 self.2.encode(encoder, offset + 24, depth)?;
1468 self.3.encode(encoder, offset + 40, depth)?;
1469 Ok(())
1470 }
1471 }
1472
1473 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1474 for RemoteControlConnectCapabilityRequest
1475 {
1476 #[inline(always)]
1477 fn new_empty() -> Self {
1478 Self {
1479 moniker: fidl::new_empty!(
1480 fidl::encoding::BoundedString<4096>,
1481 fidl::encoding::DefaultFuchsiaResourceDialect
1482 ),
1483 capability_set: fidl::new_empty!(
1484 fidl_fuchsia_sys2::OpenDirType,
1485 fidl::encoding::DefaultFuchsiaResourceDialect
1486 ),
1487 capability_name: fidl::new_empty!(
1488 fidl::encoding::BoundedString<255>,
1489 fidl::encoding::DefaultFuchsiaResourceDialect
1490 ),
1491 server_channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
1492 }
1493 }
1494
1495 #[inline]
1496 unsafe fn decode(
1497 &mut self,
1498 decoder: &mut fidl::encoding::Decoder<
1499 '_,
1500 fidl::encoding::DefaultFuchsiaResourceDialect,
1501 >,
1502 offset: usize,
1503 _depth: fidl::encoding::Depth,
1504 ) -> fidl::Result<()> {
1505 decoder.debug_check_bounds::<Self>(offset);
1506 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
1508 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1509 let mask = 0xffffffff00000000u64;
1510 let maskedval = padval & mask;
1511 if maskedval != 0 {
1512 return Err(fidl::Error::NonZeroPadding {
1513 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
1514 });
1515 }
1516 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
1517 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1518 let mask = 0xffffffff00000000u64;
1519 let maskedval = padval & mask;
1520 if maskedval != 0 {
1521 return Err(fidl::Error::NonZeroPadding {
1522 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
1523 });
1524 }
1525 fidl::decode!(
1526 fidl::encoding::BoundedString<4096>,
1527 fidl::encoding::DefaultFuchsiaResourceDialect,
1528 &mut self.moniker,
1529 decoder,
1530 offset + 0,
1531 _depth
1532 )?;
1533 fidl::decode!(
1534 fidl_fuchsia_sys2::OpenDirType,
1535 fidl::encoding::DefaultFuchsiaResourceDialect,
1536 &mut self.capability_set,
1537 decoder,
1538 offset + 16,
1539 _depth
1540 )?;
1541 fidl::decode!(
1542 fidl::encoding::BoundedString<255>,
1543 fidl::encoding::DefaultFuchsiaResourceDialect,
1544 &mut self.capability_name,
1545 decoder,
1546 offset + 24,
1547 _depth
1548 )?;
1549 fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.server_channel, decoder, offset + 40, _depth)?;
1550 Ok(())
1551 }
1552 }
1553}