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_ui_pointerinjector_configuration__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct SetupGetViewRefsResponse {
16 pub context: fidl_fuchsia_ui_views::ViewRef,
17 pub target: fidl_fuchsia_ui_views::ViewRef,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SetupGetViewRefsResponse {}
21
22#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
23pub struct SetupMarker;
24
25impl fidl::endpoints::ProtocolMarker for SetupMarker {
26 type Proxy = SetupProxy;
27 type RequestStream = SetupRequestStream;
28 #[cfg(target_os = "fuchsia")]
29 type SynchronousProxy = SetupSynchronousProxy;
30
31 const DEBUG_NAME: &'static str = "fuchsia.ui.pointerinjector.configuration.Setup";
32}
33impl fidl::endpoints::DiscoverableProtocolMarker for SetupMarker {}
34
35pub trait SetupProxyInterface: Send + Sync {
36 type GetViewRefsResponseFut: std::future::Future<
37 Output = Result<
38 (fidl_fuchsia_ui_views::ViewRef, fidl_fuchsia_ui_views::ViewRef),
39 fidl::Error,
40 >,
41 > + Send;
42 fn r#get_view_refs(&self) -> Self::GetViewRefsResponseFut;
43 type WatchViewportResponseFut: std::future::Future<Output = Result<fidl_fuchsia_ui_pointerinjector::Viewport, fidl::Error>>
44 + Send;
45 fn r#watch_viewport(&self) -> Self::WatchViewportResponseFut;
46}
47#[derive(Debug)]
48#[cfg(target_os = "fuchsia")]
49pub struct SetupSynchronousProxy {
50 client: fidl::client::sync::Client,
51}
52
53#[cfg(target_os = "fuchsia")]
54impl fidl::endpoints::SynchronousProxy for SetupSynchronousProxy {
55 type Proxy = SetupProxy;
56 type Protocol = SetupMarker;
57
58 fn from_channel(inner: fidl::Channel) -> Self {
59 Self::new(inner)
60 }
61
62 fn into_channel(self) -> fidl::Channel {
63 self.client.into_channel()
64 }
65
66 fn as_channel(&self) -> &fidl::Channel {
67 self.client.as_channel()
68 }
69}
70
71#[cfg(target_os = "fuchsia")]
72impl SetupSynchronousProxy {
73 pub fn new(channel: fidl::Channel) -> Self {
74 let protocol_name = <SetupMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
75 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
76 }
77
78 pub fn into_channel(self) -> fidl::Channel {
79 self.client.into_channel()
80 }
81
82 pub fn wait_for_event(
85 &self,
86 deadline: zx::MonotonicInstant,
87 ) -> Result<SetupEvent, fidl::Error> {
88 SetupEvent::decode(self.client.wait_for_event(deadline)?)
89 }
90
91 pub fn r#get_view_refs(
97 &self,
98 ___deadline: zx::MonotonicInstant,
99 ) -> Result<(fidl_fuchsia_ui_views::ViewRef, fidl_fuchsia_ui_views::ViewRef), fidl::Error> {
100 let _response =
101 self.client.send_query::<fidl::encoding::EmptyPayload, SetupGetViewRefsResponse>(
102 (),
103 0x5d7cc6a455bdde6,
104 fidl::encoding::DynamicFlags::empty(),
105 ___deadline,
106 )?;
107 Ok((_response.context, _response.target))
108 }
109
110 pub fn r#watch_viewport(
119 &self,
120 ___deadline: zx::MonotonicInstant,
121 ) -> Result<fidl_fuchsia_ui_pointerinjector::Viewport, fidl::Error> {
122 let _response =
123 self.client.send_query::<fidl::encoding::EmptyPayload, SetupWatchViewportResponse>(
124 (),
125 0x5488bc48af9c943a,
126 fidl::encoding::DynamicFlags::empty(),
127 ___deadline,
128 )?;
129 Ok(_response.viewport)
130 }
131}
132
133#[cfg(target_os = "fuchsia")]
134impl From<SetupSynchronousProxy> for zx::Handle {
135 fn from(value: SetupSynchronousProxy) -> Self {
136 value.into_channel().into()
137 }
138}
139
140#[cfg(target_os = "fuchsia")]
141impl From<fidl::Channel> for SetupSynchronousProxy {
142 fn from(value: fidl::Channel) -> Self {
143 Self::new(value)
144 }
145}
146
147#[cfg(target_os = "fuchsia")]
148impl fidl::endpoints::FromClient for SetupSynchronousProxy {
149 type Protocol = SetupMarker;
150
151 fn from_client(value: fidl::endpoints::ClientEnd<SetupMarker>) -> Self {
152 Self::new(value.into_channel())
153 }
154}
155
156#[derive(Debug, Clone)]
157pub struct SetupProxy {
158 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
159}
160
161impl fidl::endpoints::Proxy for SetupProxy {
162 type Protocol = SetupMarker;
163
164 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
165 Self::new(inner)
166 }
167
168 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
169 self.client.into_channel().map_err(|client| Self { client })
170 }
171
172 fn as_channel(&self) -> &::fidl::AsyncChannel {
173 self.client.as_channel()
174 }
175}
176
177impl SetupProxy {
178 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
180 let protocol_name = <SetupMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
181 Self { client: fidl::client::Client::new(channel, protocol_name) }
182 }
183
184 pub fn take_event_stream(&self) -> SetupEventStream {
190 SetupEventStream { event_receiver: self.client.take_event_receiver() }
191 }
192
193 pub fn r#get_view_refs(
199 &self,
200 ) -> fidl::client::QueryResponseFut<
201 (fidl_fuchsia_ui_views::ViewRef, fidl_fuchsia_ui_views::ViewRef),
202 fidl::encoding::DefaultFuchsiaResourceDialect,
203 > {
204 SetupProxyInterface::r#get_view_refs(self)
205 }
206
207 pub fn r#watch_viewport(
216 &self,
217 ) -> fidl::client::QueryResponseFut<
218 fidl_fuchsia_ui_pointerinjector::Viewport,
219 fidl::encoding::DefaultFuchsiaResourceDialect,
220 > {
221 SetupProxyInterface::r#watch_viewport(self)
222 }
223}
224
225impl SetupProxyInterface for SetupProxy {
226 type GetViewRefsResponseFut = fidl::client::QueryResponseFut<
227 (fidl_fuchsia_ui_views::ViewRef, fidl_fuchsia_ui_views::ViewRef),
228 fidl::encoding::DefaultFuchsiaResourceDialect,
229 >;
230 fn r#get_view_refs(&self) -> Self::GetViewRefsResponseFut {
231 fn _decode(
232 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
233 ) -> Result<(fidl_fuchsia_ui_views::ViewRef, fidl_fuchsia_ui_views::ViewRef), fidl::Error>
234 {
235 let _response = fidl::client::decode_transaction_body::<
236 SetupGetViewRefsResponse,
237 fidl::encoding::DefaultFuchsiaResourceDialect,
238 0x5d7cc6a455bdde6,
239 >(_buf?)?;
240 Ok((_response.context, _response.target))
241 }
242 self.client.send_query_and_decode::<
243 fidl::encoding::EmptyPayload,
244 (fidl_fuchsia_ui_views::ViewRef, fidl_fuchsia_ui_views::ViewRef),
245 >(
246 (),
247 0x5d7cc6a455bdde6,
248 fidl::encoding::DynamicFlags::empty(),
249 _decode,
250 )
251 }
252
253 type WatchViewportResponseFut = fidl::client::QueryResponseFut<
254 fidl_fuchsia_ui_pointerinjector::Viewport,
255 fidl::encoding::DefaultFuchsiaResourceDialect,
256 >;
257 fn r#watch_viewport(&self) -> Self::WatchViewportResponseFut {
258 fn _decode(
259 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
260 ) -> Result<fidl_fuchsia_ui_pointerinjector::Viewport, fidl::Error> {
261 let _response = fidl::client::decode_transaction_body::<
262 SetupWatchViewportResponse,
263 fidl::encoding::DefaultFuchsiaResourceDialect,
264 0x5488bc48af9c943a,
265 >(_buf?)?;
266 Ok(_response.viewport)
267 }
268 self.client.send_query_and_decode::<
269 fidl::encoding::EmptyPayload,
270 fidl_fuchsia_ui_pointerinjector::Viewport,
271 >(
272 (),
273 0x5488bc48af9c943a,
274 fidl::encoding::DynamicFlags::empty(),
275 _decode,
276 )
277 }
278}
279
280pub struct SetupEventStream {
281 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
282}
283
284impl std::marker::Unpin for SetupEventStream {}
285
286impl futures::stream::FusedStream for SetupEventStream {
287 fn is_terminated(&self) -> bool {
288 self.event_receiver.is_terminated()
289 }
290}
291
292impl futures::Stream for SetupEventStream {
293 type Item = Result<SetupEvent, fidl::Error>;
294
295 fn poll_next(
296 mut self: std::pin::Pin<&mut Self>,
297 cx: &mut std::task::Context<'_>,
298 ) -> std::task::Poll<Option<Self::Item>> {
299 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
300 &mut self.event_receiver,
301 cx
302 )?) {
303 Some(buf) => std::task::Poll::Ready(Some(SetupEvent::decode(buf))),
304 None => std::task::Poll::Ready(None),
305 }
306 }
307}
308
309#[derive(Debug)]
310pub enum SetupEvent {}
311
312impl SetupEvent {
313 fn decode(
315 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
316 ) -> Result<SetupEvent, fidl::Error> {
317 let (bytes, _handles) = buf.split_mut();
318 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
319 debug_assert_eq!(tx_header.tx_id, 0);
320 match tx_header.ordinal {
321 _ => Err(fidl::Error::UnknownOrdinal {
322 ordinal: tx_header.ordinal,
323 protocol_name: <SetupMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
324 }),
325 }
326 }
327}
328
329pub struct SetupRequestStream {
331 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
332 is_terminated: bool,
333}
334
335impl std::marker::Unpin for SetupRequestStream {}
336
337impl futures::stream::FusedStream for SetupRequestStream {
338 fn is_terminated(&self) -> bool {
339 self.is_terminated
340 }
341}
342
343impl fidl::endpoints::RequestStream for SetupRequestStream {
344 type Protocol = SetupMarker;
345 type ControlHandle = SetupControlHandle;
346
347 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
348 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
349 }
350
351 fn control_handle(&self) -> Self::ControlHandle {
352 SetupControlHandle { inner: self.inner.clone() }
353 }
354
355 fn into_inner(
356 self,
357 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
358 {
359 (self.inner, self.is_terminated)
360 }
361
362 fn from_inner(
363 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
364 is_terminated: bool,
365 ) -> Self {
366 Self { inner, is_terminated }
367 }
368}
369
370impl futures::Stream for SetupRequestStream {
371 type Item = Result<SetupRequest, fidl::Error>;
372
373 fn poll_next(
374 mut self: std::pin::Pin<&mut Self>,
375 cx: &mut std::task::Context<'_>,
376 ) -> std::task::Poll<Option<Self::Item>> {
377 let this = &mut *self;
378 if this.inner.check_shutdown(cx) {
379 this.is_terminated = true;
380 return std::task::Poll::Ready(None);
381 }
382 if this.is_terminated {
383 panic!("polled SetupRequestStream after completion");
384 }
385 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
386 |bytes, handles| {
387 match this.inner.channel().read_etc(cx, bytes, handles) {
388 std::task::Poll::Ready(Ok(())) => {}
389 std::task::Poll::Pending => return std::task::Poll::Pending,
390 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
391 this.is_terminated = true;
392 return std::task::Poll::Ready(None);
393 }
394 std::task::Poll::Ready(Err(e)) => {
395 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
396 e.into(),
397 ))));
398 }
399 }
400
401 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
403
404 std::task::Poll::Ready(Some(match header.ordinal {
405 0x5d7cc6a455bdde6 => {
406 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
407 let mut req = fidl::new_empty!(
408 fidl::encoding::EmptyPayload,
409 fidl::encoding::DefaultFuchsiaResourceDialect
410 );
411 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
412 let control_handle = SetupControlHandle { inner: this.inner.clone() };
413 Ok(SetupRequest::GetViewRefs {
414 responder: SetupGetViewRefsResponder {
415 control_handle: std::mem::ManuallyDrop::new(control_handle),
416 tx_id: header.tx_id,
417 },
418 })
419 }
420 0x5488bc48af9c943a => {
421 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
422 let mut req = fidl::new_empty!(
423 fidl::encoding::EmptyPayload,
424 fidl::encoding::DefaultFuchsiaResourceDialect
425 );
426 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
427 let control_handle = SetupControlHandle { inner: this.inner.clone() };
428 Ok(SetupRequest::WatchViewport {
429 responder: SetupWatchViewportResponder {
430 control_handle: std::mem::ManuallyDrop::new(control_handle),
431 tx_id: header.tx_id,
432 },
433 })
434 }
435 _ => Err(fidl::Error::UnknownOrdinal {
436 ordinal: header.ordinal,
437 protocol_name: <SetupMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
438 }),
439 }))
440 },
441 )
442 }
443}
444
445#[derive(Debug)]
449pub enum SetupRequest {
450 GetViewRefs { responder: SetupGetViewRefsResponder },
456 WatchViewport { responder: SetupWatchViewportResponder },
465}
466
467impl SetupRequest {
468 #[allow(irrefutable_let_patterns)]
469 pub fn into_get_view_refs(self) -> Option<(SetupGetViewRefsResponder)> {
470 if let SetupRequest::GetViewRefs { responder } = self { Some((responder)) } else { None }
471 }
472
473 #[allow(irrefutable_let_patterns)]
474 pub fn into_watch_viewport(self) -> Option<(SetupWatchViewportResponder)> {
475 if let SetupRequest::WatchViewport { responder } = self { Some((responder)) } else { None }
476 }
477
478 pub fn method_name(&self) -> &'static str {
480 match *self {
481 SetupRequest::GetViewRefs { .. } => "get_view_refs",
482 SetupRequest::WatchViewport { .. } => "watch_viewport",
483 }
484 }
485}
486
487#[derive(Debug, Clone)]
488pub struct SetupControlHandle {
489 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
490}
491
492impl fidl::endpoints::ControlHandle for SetupControlHandle {
493 fn shutdown(&self) {
494 self.inner.shutdown()
495 }
496 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
497 self.inner.shutdown_with_epitaph(status)
498 }
499
500 fn is_closed(&self) -> bool {
501 self.inner.channel().is_closed()
502 }
503 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
504 self.inner.channel().on_closed()
505 }
506
507 #[cfg(target_os = "fuchsia")]
508 fn signal_peer(
509 &self,
510 clear_mask: zx::Signals,
511 set_mask: zx::Signals,
512 ) -> Result<(), zx_status::Status> {
513 use fidl::Peered;
514 self.inner.channel().signal_peer(clear_mask, set_mask)
515 }
516}
517
518impl SetupControlHandle {}
519
520#[must_use = "FIDL methods require a response to be sent"]
521#[derive(Debug)]
522pub struct SetupGetViewRefsResponder {
523 control_handle: std::mem::ManuallyDrop<SetupControlHandle>,
524 tx_id: u32,
525}
526
527impl std::ops::Drop for SetupGetViewRefsResponder {
531 fn drop(&mut self) {
532 self.control_handle.shutdown();
533 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
535 }
536}
537
538impl fidl::endpoints::Responder for SetupGetViewRefsResponder {
539 type ControlHandle = SetupControlHandle;
540
541 fn control_handle(&self) -> &SetupControlHandle {
542 &self.control_handle
543 }
544
545 fn drop_without_shutdown(mut self) {
546 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
548 std::mem::forget(self);
550 }
551}
552
553impl SetupGetViewRefsResponder {
554 pub fn send(
558 self,
559 mut context: fidl_fuchsia_ui_views::ViewRef,
560 mut target: fidl_fuchsia_ui_views::ViewRef,
561 ) -> Result<(), fidl::Error> {
562 let _result = self.send_raw(context, target);
563 if _result.is_err() {
564 self.control_handle.shutdown();
565 }
566 self.drop_without_shutdown();
567 _result
568 }
569
570 pub fn send_no_shutdown_on_err(
572 self,
573 mut context: fidl_fuchsia_ui_views::ViewRef,
574 mut target: fidl_fuchsia_ui_views::ViewRef,
575 ) -> Result<(), fidl::Error> {
576 let _result = self.send_raw(context, target);
577 self.drop_without_shutdown();
578 _result
579 }
580
581 fn send_raw(
582 &self,
583 mut context: fidl_fuchsia_ui_views::ViewRef,
584 mut target: fidl_fuchsia_ui_views::ViewRef,
585 ) -> Result<(), fidl::Error> {
586 self.control_handle.inner.send::<SetupGetViewRefsResponse>(
587 (&mut context, &mut target),
588 self.tx_id,
589 0x5d7cc6a455bdde6,
590 fidl::encoding::DynamicFlags::empty(),
591 )
592 }
593}
594
595#[must_use = "FIDL methods require a response to be sent"]
596#[derive(Debug)]
597pub struct SetupWatchViewportResponder {
598 control_handle: std::mem::ManuallyDrop<SetupControlHandle>,
599 tx_id: u32,
600}
601
602impl std::ops::Drop for SetupWatchViewportResponder {
606 fn drop(&mut self) {
607 self.control_handle.shutdown();
608 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
610 }
611}
612
613impl fidl::endpoints::Responder for SetupWatchViewportResponder {
614 type ControlHandle = SetupControlHandle;
615
616 fn control_handle(&self) -> &SetupControlHandle {
617 &self.control_handle
618 }
619
620 fn drop_without_shutdown(mut self) {
621 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
623 std::mem::forget(self);
625 }
626}
627
628impl SetupWatchViewportResponder {
629 pub fn send(
633 self,
634 mut viewport: &fidl_fuchsia_ui_pointerinjector::Viewport,
635 ) -> Result<(), fidl::Error> {
636 let _result = self.send_raw(viewport);
637 if _result.is_err() {
638 self.control_handle.shutdown();
639 }
640 self.drop_without_shutdown();
641 _result
642 }
643
644 pub fn send_no_shutdown_on_err(
646 self,
647 mut viewport: &fidl_fuchsia_ui_pointerinjector::Viewport,
648 ) -> Result<(), fidl::Error> {
649 let _result = self.send_raw(viewport);
650 self.drop_without_shutdown();
651 _result
652 }
653
654 fn send_raw(
655 &self,
656 mut viewport: &fidl_fuchsia_ui_pointerinjector::Viewport,
657 ) -> Result<(), fidl::Error> {
658 self.control_handle.inner.send::<SetupWatchViewportResponse>(
659 (viewport,),
660 self.tx_id,
661 0x5488bc48af9c943a,
662 fidl::encoding::DynamicFlags::empty(),
663 )
664 }
665}
666
667mod internal {
668 use super::*;
669
670 impl fidl::encoding::ResourceTypeMarker for SetupGetViewRefsResponse {
671 type Borrowed<'a> = &'a mut Self;
672 fn take_or_borrow<'a>(
673 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
674 ) -> Self::Borrowed<'a> {
675 value
676 }
677 }
678
679 unsafe impl fidl::encoding::TypeMarker for SetupGetViewRefsResponse {
680 type Owned = Self;
681
682 #[inline(always)]
683 fn inline_align(_context: fidl::encoding::Context) -> usize {
684 4
685 }
686
687 #[inline(always)]
688 fn inline_size(_context: fidl::encoding::Context) -> usize {
689 8
690 }
691 }
692
693 unsafe impl
694 fidl::encoding::Encode<
695 SetupGetViewRefsResponse,
696 fidl::encoding::DefaultFuchsiaResourceDialect,
697 > for &mut SetupGetViewRefsResponse
698 {
699 #[inline]
700 unsafe fn encode(
701 self,
702 encoder: &mut fidl::encoding::Encoder<
703 '_,
704 fidl::encoding::DefaultFuchsiaResourceDialect,
705 >,
706 offset: usize,
707 _depth: fidl::encoding::Depth,
708 ) -> fidl::Result<()> {
709 encoder.debug_check_bounds::<SetupGetViewRefsResponse>(offset);
710 fidl::encoding::Encode::<SetupGetViewRefsResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
712 (
713 <fidl_fuchsia_ui_views::ViewRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.context),
714 <fidl_fuchsia_ui_views::ViewRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.target),
715 ),
716 encoder, offset, _depth
717 )
718 }
719 }
720 unsafe impl<
721 T0: fidl::encoding::Encode<
722 fidl_fuchsia_ui_views::ViewRef,
723 fidl::encoding::DefaultFuchsiaResourceDialect,
724 >,
725 T1: fidl::encoding::Encode<
726 fidl_fuchsia_ui_views::ViewRef,
727 fidl::encoding::DefaultFuchsiaResourceDialect,
728 >,
729 >
730 fidl::encoding::Encode<
731 SetupGetViewRefsResponse,
732 fidl::encoding::DefaultFuchsiaResourceDialect,
733 > for (T0, T1)
734 {
735 #[inline]
736 unsafe fn encode(
737 self,
738 encoder: &mut fidl::encoding::Encoder<
739 '_,
740 fidl::encoding::DefaultFuchsiaResourceDialect,
741 >,
742 offset: usize,
743 depth: fidl::encoding::Depth,
744 ) -> fidl::Result<()> {
745 encoder.debug_check_bounds::<SetupGetViewRefsResponse>(offset);
746 self.0.encode(encoder, offset + 0, depth)?;
750 self.1.encode(encoder, offset + 4, depth)?;
751 Ok(())
752 }
753 }
754
755 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
756 for SetupGetViewRefsResponse
757 {
758 #[inline(always)]
759 fn new_empty() -> Self {
760 Self {
761 context: fidl::new_empty!(
762 fidl_fuchsia_ui_views::ViewRef,
763 fidl::encoding::DefaultFuchsiaResourceDialect
764 ),
765 target: fidl::new_empty!(
766 fidl_fuchsia_ui_views::ViewRef,
767 fidl::encoding::DefaultFuchsiaResourceDialect
768 ),
769 }
770 }
771
772 #[inline]
773 unsafe fn decode(
774 &mut self,
775 decoder: &mut fidl::encoding::Decoder<
776 '_,
777 fidl::encoding::DefaultFuchsiaResourceDialect,
778 >,
779 offset: usize,
780 _depth: fidl::encoding::Depth,
781 ) -> fidl::Result<()> {
782 decoder.debug_check_bounds::<Self>(offset);
783 fidl::decode!(
785 fidl_fuchsia_ui_views::ViewRef,
786 fidl::encoding::DefaultFuchsiaResourceDialect,
787 &mut self.context,
788 decoder,
789 offset + 0,
790 _depth
791 )?;
792 fidl::decode!(
793 fidl_fuchsia_ui_views::ViewRef,
794 fidl::encoding::DefaultFuchsiaResourceDialect,
795 &mut self.target,
796 decoder,
797 offset + 4,
798 _depth
799 )?;
800 Ok(())
801 }
802 }
803}