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_scenic__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct ScenicCreateSession2Request {
16 pub session: fidl::endpoints::ServerEnd<SessionMarker>,
17 pub listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
18 pub view_focuser: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>,
19}
20
21impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
22 for ScenicCreateSession2Request
23{
24}
25
26#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
27pub struct ScenicCreateSessionRequest {
28 pub session: fidl::endpoints::ServerEnd<SessionMarker>,
29 pub listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
30}
31
32impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
33 for ScenicCreateSessionRequest
34{
35}
36
37#[derive(Debug, PartialEq)]
38pub struct ScenicCreateSessionTRequest {
39 pub endpoints: SessionEndpoints,
40}
41
42impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
43 for ScenicCreateSessionTRequest
44{
45}
46
47#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
48pub struct ScenicGetDisplayOwnershipEventResponse {
49 pub ownership_event: fidl::Event,
50}
51
52impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
53 for ScenicGetDisplayOwnershipEventResponse
54{
55}
56
57#[derive(Debug, PartialEq)]
58pub struct ScenicTakeScreenshotResponse {
59 pub img_data: ScreenshotData,
60 pub success: bool,
61}
62
63impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
64 for ScenicTakeScreenshotResponse
65{
66}
67
68#[derive(Debug, PartialEq)]
72pub struct ScreenshotData {
73 pub info: fidl_fuchsia_images::ImageInfo,
74 pub data: fidl_fuchsia_mem::Buffer,
75}
76
77impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ScreenshotData {}
78
79#[derive(Debug, PartialEq)]
80pub struct SessionEnqueueRequest {
81 pub cmds: Vec<Command>,
82}
83
84impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SessionEnqueueRequest {}
85
86#[derive(Debug, PartialEq)]
87pub struct SessionListenerOnScenicEventRequest {
88 pub events: Vec<Event>,
89}
90
91impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
92 for SessionListenerOnScenicEventRequest
93{
94}
95
96#[derive(Debug, PartialEq)]
97pub struct SessionPresent2Request {
98 pub args: Present2Args,
99}
100
101impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SessionPresent2Request {}
102
103#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
104pub struct SessionPresentRequest {
105 pub presentation_time: u64,
106 pub acquire_fences: Vec<fidl::Event>,
107 pub release_fences: Vec<fidl::Event>,
108}
109
110impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SessionPresentRequest {}
111
112#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
113pub struct SessionRegisterBufferCollectionRequest {
114 pub buffer_id: u32,
115 pub token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
116}
117
118impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
119 for SessionRegisterBufferCollectionRequest
120{
121}
122
123#[derive(Debug, Default, PartialEq)]
125pub struct Present2Args {
126 pub requested_presentation_time: Option<i64>,
146 pub acquire_fences: Option<Vec<fidl::Event>>,
149 pub release_fences: Option<Vec<fidl::Event>>,
155 pub requested_prediction_span: Option<i64>,
159 #[doc(hidden)]
160 pub __source_breaking: fidl::marker::SourceBreaking,
161}
162
163impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Present2Args {}
164
165#[derive(Debug, Default, PartialEq)]
167pub struct SessionEndpoints {
168 pub session: Option<fidl::endpoints::ServerEnd<SessionMarker>>,
171 pub session_listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
174 pub view_focuser: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>,
177 pub view_ref_focused:
180 Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::ViewRefFocusedMarker>>,
181 pub touch_source:
184 Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>>,
185 pub mouse_source:
188 Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::MouseSourceMarker>>,
189 #[doc(hidden)]
190 pub __source_breaking: fidl::marker::SourceBreaking,
191}
192
193impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for SessionEndpoints {}
194
195#[derive(Debug, PartialEq)]
196pub enum Command {
197 Gfx(fidl_fuchsia_ui_gfx::Command),
198 Views(fidl_fuchsia_ui_views::Command),
199 Input(fidl_fuchsia_ui_input::Command),
200}
201
202impl Command {
203 #[inline]
204 pub fn ordinal(&self) -> u64 {
205 match *self {
206 Self::Gfx(_) => 1,
207 Self::Views(_) => 3,
208 Self::Input(_) => 4,
209 }
210 }
211}
212
213impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Command {}
214
215#[derive(Debug, PartialEq)]
216pub enum Event {
217 Gfx(fidl_fuchsia_ui_gfx::Event),
218 Input(fidl_fuchsia_ui_input::InputEvent),
219 Unhandled(Command),
220}
221
222impl Event {
223 #[inline]
224 pub fn ordinal(&self) -> u64 {
225 match *self {
226 Self::Gfx(_) => 1,
227 Self::Input(_) => 2,
228 Self::Unhandled(_) => 3,
229 }
230 }
231}
232
233impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Event {}
234
235#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
236pub struct ScenicMarker;
237
238impl fidl::endpoints::ProtocolMarker for ScenicMarker {
239 type Proxy = ScenicProxy;
240 type RequestStream = ScenicRequestStream;
241 #[cfg(target_os = "fuchsia")]
242 type SynchronousProxy = ScenicSynchronousProxy;
243
244 const DEBUG_NAME: &'static str = "fuchsia.ui.scenic.Scenic";
245}
246impl fidl::endpoints::DiscoverableProtocolMarker for ScenicMarker {}
247
248pub trait ScenicProxyInterface: Send + Sync {
249 fn r#create_session(
250 &self,
251 session: fidl::endpoints::ServerEnd<SessionMarker>,
252 listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
253 ) -> Result<(), fidl::Error>;
254 fn r#create_session2(
255 &self,
256 session: fidl::endpoints::ServerEnd<SessionMarker>,
257 listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
258 view_focuser: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>,
259 ) -> Result<(), fidl::Error>;
260 type CreateSessionTResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
261 fn r#create_session_t(&self, endpoints: SessionEndpoints) -> Self::CreateSessionTResponseFut;
262 type GetDisplayInfoResponseFut: std::future::Future<Output = Result<fidl_fuchsia_ui_gfx::DisplayInfo, fidl::Error>>
263 + Send;
264 fn r#get_display_info(&self) -> Self::GetDisplayInfoResponseFut;
265 type GetDisplayOwnershipEventResponseFut: std::future::Future<Output = Result<fidl::Event, fidl::Error>>
266 + Send;
267 fn r#get_display_ownership_event(&self) -> Self::GetDisplayOwnershipEventResponseFut;
268 type TakeScreenshotResponseFut: std::future::Future<Output = Result<(ScreenshotData, bool), fidl::Error>>
269 + Send;
270 fn r#take_screenshot(&self) -> Self::TakeScreenshotResponseFut;
271 type UsesFlatlandResponseFut: std::future::Future<Output = Result<bool, fidl::Error>> + Send;
272 fn r#uses_flatland(&self) -> Self::UsesFlatlandResponseFut;
273}
274#[derive(Debug)]
275#[cfg(target_os = "fuchsia")]
276pub struct ScenicSynchronousProxy {
277 client: fidl::client::sync::Client,
278}
279
280#[cfg(target_os = "fuchsia")]
281impl fidl::endpoints::SynchronousProxy for ScenicSynchronousProxy {
282 type Proxy = ScenicProxy;
283 type Protocol = ScenicMarker;
284
285 fn from_channel(inner: fidl::Channel) -> Self {
286 Self::new(inner)
287 }
288
289 fn into_channel(self) -> fidl::Channel {
290 self.client.into_channel()
291 }
292
293 fn as_channel(&self) -> &fidl::Channel {
294 self.client.as_channel()
295 }
296}
297
298#[cfg(target_os = "fuchsia")]
299impl ScenicSynchronousProxy {
300 pub fn new(channel: fidl::Channel) -> Self {
301 let protocol_name = <ScenicMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
302 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
303 }
304
305 pub fn into_channel(self) -> fidl::Channel {
306 self.client.into_channel()
307 }
308
309 pub fn wait_for_event(
312 &self,
313 deadline: zx::MonotonicInstant,
314 ) -> Result<ScenicEvent, fidl::Error> {
315 ScenicEvent::decode(self.client.wait_for_event(deadline)?)
316 }
317
318 pub fn r#create_session(
320 &self,
321 mut session: fidl::endpoints::ServerEnd<SessionMarker>,
322 mut listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
323 ) -> Result<(), fidl::Error> {
324 self.client.send::<ScenicCreateSessionRequest>(
325 (session, listener),
326 0x2af781f341771a50,
327 fidl::encoding::DynamicFlags::empty(),
328 )
329 }
330
331 pub fn r#create_session2(
338 &self,
339 mut session: fidl::endpoints::ServerEnd<SessionMarker>,
340 mut listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
341 mut view_focuser: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>,
342 ) -> Result<(), fidl::Error> {
343 self.client.send::<ScenicCreateSession2Request>(
344 (session, listener, view_focuser),
345 0x11fa60f776121fa5,
346 fidl::encoding::DynamicFlags::empty(),
347 )
348 }
349
350 pub fn r#create_session_t(
361 &self,
362 mut endpoints: SessionEndpoints,
363 ___deadline: zx::MonotonicInstant,
364 ) -> Result<(), fidl::Error> {
365 let _response =
366 self.client.send_query::<ScenicCreateSessionTRequest, fidl::encoding::EmptyPayload>(
367 (&mut endpoints,),
368 0x369061a897552d4f,
369 fidl::encoding::DynamicFlags::empty(),
370 ___deadline,
371 )?;
372 Ok(_response)
373 }
374
375 pub fn r#get_display_info(
377 &self,
378 ___deadline: zx::MonotonicInstant,
379 ) -> Result<fidl_fuchsia_ui_gfx::DisplayInfo, fidl::Error> {
380 let _response =
381 self.client.send_query::<fidl::encoding::EmptyPayload, ScenicGetDisplayInfoResponse>(
382 (),
383 0x3e4cdecbf7cc1797,
384 fidl::encoding::DynamicFlags::empty(),
385 ___deadline,
386 )?;
387 Ok(_response.info)
388 }
389
390 pub fn r#get_display_ownership_event(
393 &self,
394 ___deadline: zx::MonotonicInstant,
395 ) -> Result<fidl::Event, fidl::Error> {
396 let _response = self
397 .client
398 .send_query::<fidl::encoding::EmptyPayload, ScenicGetDisplayOwnershipEventResponse>(
399 (),
400 0x54c114c7322b24d6,
401 fidl::encoding::DynamicFlags::empty(),
402 ___deadline,
403 )?;
404 Ok(_response.ownership_event)
405 }
406
407 pub fn r#take_screenshot(
410 &self,
411 ___deadline: zx::MonotonicInstant,
412 ) -> Result<(ScreenshotData, bool), fidl::Error> {
413 let _response =
414 self.client.send_query::<fidl::encoding::EmptyPayload, ScenicTakeScreenshotResponse>(
415 (),
416 0x53f5e06463987df2,
417 fidl::encoding::DynamicFlags::empty(),
418 ___deadline,
419 )?;
420 Ok((_response.img_data, _response.success))
421 }
422
423 pub fn r#uses_flatland(&self, ___deadline: zx::MonotonicInstant) -> Result<bool, fidl::Error> {
426 let _response =
427 self.client.send_query::<fidl::encoding::EmptyPayload, ScenicUsesFlatlandResponse>(
428 (),
429 0x5f2e5e19463ae706,
430 fidl::encoding::DynamicFlags::empty(),
431 ___deadline,
432 )?;
433 Ok(_response.flatland_enabled)
434 }
435}
436
437#[cfg(target_os = "fuchsia")]
438impl From<ScenicSynchronousProxy> for zx::NullableHandle {
439 fn from(value: ScenicSynchronousProxy) -> Self {
440 value.into_channel().into()
441 }
442}
443
444#[cfg(target_os = "fuchsia")]
445impl From<fidl::Channel> for ScenicSynchronousProxy {
446 fn from(value: fidl::Channel) -> Self {
447 Self::new(value)
448 }
449}
450
451#[cfg(target_os = "fuchsia")]
452impl fidl::endpoints::FromClient for ScenicSynchronousProxy {
453 type Protocol = ScenicMarker;
454
455 fn from_client(value: fidl::endpoints::ClientEnd<ScenicMarker>) -> Self {
456 Self::new(value.into_channel())
457 }
458}
459
460#[derive(Debug, Clone)]
461pub struct ScenicProxy {
462 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
463}
464
465impl fidl::endpoints::Proxy for ScenicProxy {
466 type Protocol = ScenicMarker;
467
468 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
469 Self::new(inner)
470 }
471
472 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
473 self.client.into_channel().map_err(|client| Self { client })
474 }
475
476 fn as_channel(&self) -> &::fidl::AsyncChannel {
477 self.client.as_channel()
478 }
479}
480
481impl ScenicProxy {
482 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
484 let protocol_name = <ScenicMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
485 Self { client: fidl::client::Client::new(channel, protocol_name) }
486 }
487
488 pub fn take_event_stream(&self) -> ScenicEventStream {
494 ScenicEventStream { event_receiver: self.client.take_event_receiver() }
495 }
496
497 pub fn r#create_session(
499 &self,
500 mut session: fidl::endpoints::ServerEnd<SessionMarker>,
501 mut listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
502 ) -> Result<(), fidl::Error> {
503 ScenicProxyInterface::r#create_session(self, session, listener)
504 }
505
506 pub fn r#create_session2(
513 &self,
514 mut session: fidl::endpoints::ServerEnd<SessionMarker>,
515 mut listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
516 mut view_focuser: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>,
517 ) -> Result<(), fidl::Error> {
518 ScenicProxyInterface::r#create_session2(self, session, listener, view_focuser)
519 }
520
521 pub fn r#create_session_t(
532 &self,
533 mut endpoints: SessionEndpoints,
534 ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
535 ScenicProxyInterface::r#create_session_t(self, endpoints)
536 }
537
538 pub fn r#get_display_info(
540 &self,
541 ) -> fidl::client::QueryResponseFut<
542 fidl_fuchsia_ui_gfx::DisplayInfo,
543 fidl::encoding::DefaultFuchsiaResourceDialect,
544 > {
545 ScenicProxyInterface::r#get_display_info(self)
546 }
547
548 pub fn r#get_display_ownership_event(
551 &self,
552 ) -> fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>
553 {
554 ScenicProxyInterface::r#get_display_ownership_event(self)
555 }
556
557 pub fn r#take_screenshot(
560 &self,
561 ) -> fidl::client::QueryResponseFut<
562 (ScreenshotData, bool),
563 fidl::encoding::DefaultFuchsiaResourceDialect,
564 > {
565 ScenicProxyInterface::r#take_screenshot(self)
566 }
567
568 pub fn r#uses_flatland(
571 &self,
572 ) -> fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect> {
573 ScenicProxyInterface::r#uses_flatland(self)
574 }
575}
576
577impl ScenicProxyInterface for ScenicProxy {
578 fn r#create_session(
579 &self,
580 mut session: fidl::endpoints::ServerEnd<SessionMarker>,
581 mut listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
582 ) -> Result<(), fidl::Error> {
583 self.client.send::<ScenicCreateSessionRequest>(
584 (session, listener),
585 0x2af781f341771a50,
586 fidl::encoding::DynamicFlags::empty(),
587 )
588 }
589
590 fn r#create_session2(
591 &self,
592 mut session: fidl::endpoints::ServerEnd<SessionMarker>,
593 mut listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
594 mut view_focuser: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>,
595 ) -> Result<(), fidl::Error> {
596 self.client.send::<ScenicCreateSession2Request>(
597 (session, listener, view_focuser),
598 0x11fa60f776121fa5,
599 fidl::encoding::DynamicFlags::empty(),
600 )
601 }
602
603 type CreateSessionTResponseFut =
604 fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
605 fn r#create_session_t(
606 &self,
607 mut endpoints: SessionEndpoints,
608 ) -> Self::CreateSessionTResponseFut {
609 fn _decode(
610 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
611 ) -> Result<(), fidl::Error> {
612 let _response = fidl::client::decode_transaction_body::<
613 fidl::encoding::EmptyPayload,
614 fidl::encoding::DefaultFuchsiaResourceDialect,
615 0x369061a897552d4f,
616 >(_buf?)?;
617 Ok(_response)
618 }
619 self.client.send_query_and_decode::<ScenicCreateSessionTRequest, ()>(
620 (&mut endpoints,),
621 0x369061a897552d4f,
622 fidl::encoding::DynamicFlags::empty(),
623 _decode,
624 )
625 }
626
627 type GetDisplayInfoResponseFut = fidl::client::QueryResponseFut<
628 fidl_fuchsia_ui_gfx::DisplayInfo,
629 fidl::encoding::DefaultFuchsiaResourceDialect,
630 >;
631 fn r#get_display_info(&self) -> Self::GetDisplayInfoResponseFut {
632 fn _decode(
633 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
634 ) -> Result<fidl_fuchsia_ui_gfx::DisplayInfo, fidl::Error> {
635 let _response = fidl::client::decode_transaction_body::<
636 ScenicGetDisplayInfoResponse,
637 fidl::encoding::DefaultFuchsiaResourceDialect,
638 0x3e4cdecbf7cc1797,
639 >(_buf?)?;
640 Ok(_response.info)
641 }
642 self.client.send_query_and_decode::<
643 fidl::encoding::EmptyPayload,
644 fidl_fuchsia_ui_gfx::DisplayInfo,
645 >(
646 (),
647 0x3e4cdecbf7cc1797,
648 fidl::encoding::DynamicFlags::empty(),
649 _decode,
650 )
651 }
652
653 type GetDisplayOwnershipEventResponseFut =
654 fidl::client::QueryResponseFut<fidl::Event, fidl::encoding::DefaultFuchsiaResourceDialect>;
655 fn r#get_display_ownership_event(&self) -> Self::GetDisplayOwnershipEventResponseFut {
656 fn _decode(
657 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
658 ) -> Result<fidl::Event, fidl::Error> {
659 let _response = fidl::client::decode_transaction_body::<
660 ScenicGetDisplayOwnershipEventResponse,
661 fidl::encoding::DefaultFuchsiaResourceDialect,
662 0x54c114c7322b24d6,
663 >(_buf?)?;
664 Ok(_response.ownership_event)
665 }
666 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, fidl::Event>(
667 (),
668 0x54c114c7322b24d6,
669 fidl::encoding::DynamicFlags::empty(),
670 _decode,
671 )
672 }
673
674 type TakeScreenshotResponseFut = fidl::client::QueryResponseFut<
675 (ScreenshotData, bool),
676 fidl::encoding::DefaultFuchsiaResourceDialect,
677 >;
678 fn r#take_screenshot(&self) -> Self::TakeScreenshotResponseFut {
679 fn _decode(
680 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
681 ) -> Result<(ScreenshotData, bool), fidl::Error> {
682 let _response = fidl::client::decode_transaction_body::<
683 ScenicTakeScreenshotResponse,
684 fidl::encoding::DefaultFuchsiaResourceDialect,
685 0x53f5e06463987df2,
686 >(_buf?)?;
687 Ok((_response.img_data, _response.success))
688 }
689 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, (ScreenshotData, bool)>(
690 (),
691 0x53f5e06463987df2,
692 fidl::encoding::DynamicFlags::empty(),
693 _decode,
694 )
695 }
696
697 type UsesFlatlandResponseFut =
698 fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect>;
699 fn r#uses_flatland(&self) -> Self::UsesFlatlandResponseFut {
700 fn _decode(
701 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
702 ) -> Result<bool, fidl::Error> {
703 let _response = fidl::client::decode_transaction_body::<
704 ScenicUsesFlatlandResponse,
705 fidl::encoding::DefaultFuchsiaResourceDialect,
706 0x5f2e5e19463ae706,
707 >(_buf?)?;
708 Ok(_response.flatland_enabled)
709 }
710 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, bool>(
711 (),
712 0x5f2e5e19463ae706,
713 fidl::encoding::DynamicFlags::empty(),
714 _decode,
715 )
716 }
717}
718
719pub struct ScenicEventStream {
720 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
721}
722
723impl std::marker::Unpin for ScenicEventStream {}
724
725impl futures::stream::FusedStream for ScenicEventStream {
726 fn is_terminated(&self) -> bool {
727 self.event_receiver.is_terminated()
728 }
729}
730
731impl futures::Stream for ScenicEventStream {
732 type Item = Result<ScenicEvent, fidl::Error>;
733
734 fn poll_next(
735 mut self: std::pin::Pin<&mut Self>,
736 cx: &mut std::task::Context<'_>,
737 ) -> std::task::Poll<Option<Self::Item>> {
738 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
739 &mut self.event_receiver,
740 cx
741 )?) {
742 Some(buf) => std::task::Poll::Ready(Some(ScenicEvent::decode(buf))),
743 None => std::task::Poll::Ready(None),
744 }
745 }
746}
747
748#[derive(Debug)]
749pub enum ScenicEvent {}
750
751impl ScenicEvent {
752 fn decode(
754 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
755 ) -> Result<ScenicEvent, fidl::Error> {
756 let (bytes, _handles) = buf.split_mut();
757 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
758 debug_assert_eq!(tx_header.tx_id, 0);
759 match tx_header.ordinal {
760 _ => Err(fidl::Error::UnknownOrdinal {
761 ordinal: tx_header.ordinal,
762 protocol_name: <ScenicMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
763 }),
764 }
765 }
766}
767
768pub struct ScenicRequestStream {
770 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
771 is_terminated: bool,
772}
773
774impl std::marker::Unpin for ScenicRequestStream {}
775
776impl futures::stream::FusedStream for ScenicRequestStream {
777 fn is_terminated(&self) -> bool {
778 self.is_terminated
779 }
780}
781
782impl fidl::endpoints::RequestStream for ScenicRequestStream {
783 type Protocol = ScenicMarker;
784 type ControlHandle = ScenicControlHandle;
785
786 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
787 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
788 }
789
790 fn control_handle(&self) -> Self::ControlHandle {
791 ScenicControlHandle { inner: self.inner.clone() }
792 }
793
794 fn into_inner(
795 self,
796 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
797 {
798 (self.inner, self.is_terminated)
799 }
800
801 fn from_inner(
802 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
803 is_terminated: bool,
804 ) -> Self {
805 Self { inner, is_terminated }
806 }
807}
808
809impl futures::Stream for ScenicRequestStream {
810 type Item = Result<ScenicRequest, fidl::Error>;
811
812 fn poll_next(
813 mut self: std::pin::Pin<&mut Self>,
814 cx: &mut std::task::Context<'_>,
815 ) -> std::task::Poll<Option<Self::Item>> {
816 let this = &mut *self;
817 if this.inner.check_shutdown(cx) {
818 this.is_terminated = true;
819 return std::task::Poll::Ready(None);
820 }
821 if this.is_terminated {
822 panic!("polled ScenicRequestStream after completion");
823 }
824 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
825 |bytes, handles| {
826 match this.inner.channel().read_etc(cx, bytes, handles) {
827 std::task::Poll::Ready(Ok(())) => {}
828 std::task::Poll::Pending => return std::task::Poll::Pending,
829 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
830 this.is_terminated = true;
831 return std::task::Poll::Ready(None);
832 }
833 std::task::Poll::Ready(Err(e)) => {
834 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
835 e.into(),
836 ))));
837 }
838 }
839
840 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
842
843 std::task::Poll::Ready(Some(match header.ordinal {
844 0x2af781f341771a50 => {
845 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
846 let mut req = fidl::new_empty!(
847 ScenicCreateSessionRequest,
848 fidl::encoding::DefaultFuchsiaResourceDialect
849 );
850 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ScenicCreateSessionRequest>(&header, _body_bytes, handles, &mut req)?;
851 let control_handle = ScenicControlHandle { inner: this.inner.clone() };
852 Ok(ScenicRequest::CreateSession {
853 session: req.session,
854 listener: req.listener,
855
856 control_handle,
857 })
858 }
859 0x11fa60f776121fa5 => {
860 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
861 let mut req = fidl::new_empty!(
862 ScenicCreateSession2Request,
863 fidl::encoding::DefaultFuchsiaResourceDialect
864 );
865 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ScenicCreateSession2Request>(&header, _body_bytes, handles, &mut req)?;
866 let control_handle = ScenicControlHandle { inner: this.inner.clone() };
867 Ok(ScenicRequest::CreateSession2 {
868 session: req.session,
869 listener: req.listener,
870 view_focuser: req.view_focuser,
871
872 control_handle,
873 })
874 }
875 0x369061a897552d4f => {
876 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
877 let mut req = fidl::new_empty!(
878 ScenicCreateSessionTRequest,
879 fidl::encoding::DefaultFuchsiaResourceDialect
880 );
881 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ScenicCreateSessionTRequest>(&header, _body_bytes, handles, &mut req)?;
882 let control_handle = ScenicControlHandle { inner: this.inner.clone() };
883 Ok(ScenicRequest::CreateSessionT {
884 endpoints: req.endpoints,
885
886 responder: ScenicCreateSessionTResponder {
887 control_handle: std::mem::ManuallyDrop::new(control_handle),
888 tx_id: header.tx_id,
889 },
890 })
891 }
892 0x3e4cdecbf7cc1797 => {
893 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
894 let mut req = fidl::new_empty!(
895 fidl::encoding::EmptyPayload,
896 fidl::encoding::DefaultFuchsiaResourceDialect
897 );
898 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
899 let control_handle = ScenicControlHandle { inner: this.inner.clone() };
900 Ok(ScenicRequest::GetDisplayInfo {
901 responder: ScenicGetDisplayInfoResponder {
902 control_handle: std::mem::ManuallyDrop::new(control_handle),
903 tx_id: header.tx_id,
904 },
905 })
906 }
907 0x54c114c7322b24d6 => {
908 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
909 let mut req = fidl::new_empty!(
910 fidl::encoding::EmptyPayload,
911 fidl::encoding::DefaultFuchsiaResourceDialect
912 );
913 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
914 let control_handle = ScenicControlHandle { inner: this.inner.clone() };
915 Ok(ScenicRequest::GetDisplayOwnershipEvent {
916 responder: ScenicGetDisplayOwnershipEventResponder {
917 control_handle: std::mem::ManuallyDrop::new(control_handle),
918 tx_id: header.tx_id,
919 },
920 })
921 }
922 0x53f5e06463987df2 => {
923 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
924 let mut req = fidl::new_empty!(
925 fidl::encoding::EmptyPayload,
926 fidl::encoding::DefaultFuchsiaResourceDialect
927 );
928 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
929 let control_handle = ScenicControlHandle { inner: this.inner.clone() };
930 Ok(ScenicRequest::TakeScreenshot {
931 responder: ScenicTakeScreenshotResponder {
932 control_handle: std::mem::ManuallyDrop::new(control_handle),
933 tx_id: header.tx_id,
934 },
935 })
936 }
937 0x5f2e5e19463ae706 => {
938 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
939 let mut req = fidl::new_empty!(
940 fidl::encoding::EmptyPayload,
941 fidl::encoding::DefaultFuchsiaResourceDialect
942 );
943 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
944 let control_handle = ScenicControlHandle { inner: this.inner.clone() };
945 Ok(ScenicRequest::UsesFlatland {
946 responder: ScenicUsesFlatlandResponder {
947 control_handle: std::mem::ManuallyDrop::new(control_handle),
948 tx_id: header.tx_id,
949 },
950 })
951 }
952 _ => Err(fidl::Error::UnknownOrdinal {
953 ordinal: header.ordinal,
954 protocol_name:
955 <ScenicMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
956 }),
957 }))
958 },
959 )
960 }
961}
962
963#[derive(Debug)]
964pub enum ScenicRequest {
965 CreateSession {
967 session: fidl::endpoints::ServerEnd<SessionMarker>,
968 listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
969 control_handle: ScenicControlHandle,
970 },
971 CreateSession2 {
978 session: fidl::endpoints::ServerEnd<SessionMarker>,
979 listener: Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
980 view_focuser: Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>,
981 control_handle: ScenicControlHandle,
982 },
983 CreateSessionT { endpoints: SessionEndpoints, responder: ScenicCreateSessionTResponder },
994 GetDisplayInfo { responder: ScenicGetDisplayInfoResponder },
996 GetDisplayOwnershipEvent { responder: ScenicGetDisplayOwnershipEventResponder },
999 TakeScreenshot { responder: ScenicTakeScreenshotResponder },
1002 UsesFlatland { responder: ScenicUsesFlatlandResponder },
1005}
1006
1007impl ScenicRequest {
1008 #[allow(irrefutable_let_patterns)]
1009 pub fn into_create_session(
1010 self,
1011 ) -> Option<(
1012 fidl::endpoints::ServerEnd<SessionMarker>,
1013 Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
1014 ScenicControlHandle,
1015 )> {
1016 if let ScenicRequest::CreateSession { session, listener, control_handle } = self {
1017 Some((session, listener, control_handle))
1018 } else {
1019 None
1020 }
1021 }
1022
1023 #[allow(irrefutable_let_patterns)]
1024 pub fn into_create_session2(
1025 self,
1026 ) -> Option<(
1027 fidl::endpoints::ServerEnd<SessionMarker>,
1028 Option<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
1029 Option<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>,
1030 ScenicControlHandle,
1031 )> {
1032 if let ScenicRequest::CreateSession2 { session, listener, view_focuser, control_handle } =
1033 self
1034 {
1035 Some((session, listener, view_focuser, control_handle))
1036 } else {
1037 None
1038 }
1039 }
1040
1041 #[allow(irrefutable_let_patterns)]
1042 pub fn into_create_session_t(
1043 self,
1044 ) -> Option<(SessionEndpoints, ScenicCreateSessionTResponder)> {
1045 if let ScenicRequest::CreateSessionT { endpoints, responder } = self {
1046 Some((endpoints, responder))
1047 } else {
1048 None
1049 }
1050 }
1051
1052 #[allow(irrefutable_let_patterns)]
1053 pub fn into_get_display_info(self) -> Option<(ScenicGetDisplayInfoResponder)> {
1054 if let ScenicRequest::GetDisplayInfo { responder } = self {
1055 Some((responder))
1056 } else {
1057 None
1058 }
1059 }
1060
1061 #[allow(irrefutable_let_patterns)]
1062 pub fn into_get_display_ownership_event(
1063 self,
1064 ) -> Option<(ScenicGetDisplayOwnershipEventResponder)> {
1065 if let ScenicRequest::GetDisplayOwnershipEvent { responder } = self {
1066 Some((responder))
1067 } else {
1068 None
1069 }
1070 }
1071
1072 #[allow(irrefutable_let_patterns)]
1073 pub fn into_take_screenshot(self) -> Option<(ScenicTakeScreenshotResponder)> {
1074 if let ScenicRequest::TakeScreenshot { responder } = self {
1075 Some((responder))
1076 } else {
1077 None
1078 }
1079 }
1080
1081 #[allow(irrefutable_let_patterns)]
1082 pub fn into_uses_flatland(self) -> Option<(ScenicUsesFlatlandResponder)> {
1083 if let ScenicRequest::UsesFlatland { responder } = self { Some((responder)) } else { None }
1084 }
1085
1086 pub fn method_name(&self) -> &'static str {
1088 match *self {
1089 ScenicRequest::CreateSession { .. } => "create_session",
1090 ScenicRequest::CreateSession2 { .. } => "create_session2",
1091 ScenicRequest::CreateSessionT { .. } => "create_session_t",
1092 ScenicRequest::GetDisplayInfo { .. } => "get_display_info",
1093 ScenicRequest::GetDisplayOwnershipEvent { .. } => "get_display_ownership_event",
1094 ScenicRequest::TakeScreenshot { .. } => "take_screenshot",
1095 ScenicRequest::UsesFlatland { .. } => "uses_flatland",
1096 }
1097 }
1098}
1099
1100#[derive(Debug, Clone)]
1101pub struct ScenicControlHandle {
1102 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1103}
1104
1105impl fidl::endpoints::ControlHandle for ScenicControlHandle {
1106 fn shutdown(&self) {
1107 self.inner.shutdown()
1108 }
1109
1110 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1111 self.inner.shutdown_with_epitaph(status)
1112 }
1113
1114 fn is_closed(&self) -> bool {
1115 self.inner.channel().is_closed()
1116 }
1117 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1118 self.inner.channel().on_closed()
1119 }
1120
1121 #[cfg(target_os = "fuchsia")]
1122 fn signal_peer(
1123 &self,
1124 clear_mask: zx::Signals,
1125 set_mask: zx::Signals,
1126 ) -> Result<(), zx_status::Status> {
1127 use fidl::Peered;
1128 self.inner.channel().signal_peer(clear_mask, set_mask)
1129 }
1130}
1131
1132impl ScenicControlHandle {}
1133
1134#[must_use = "FIDL methods require a response to be sent"]
1135#[derive(Debug)]
1136pub struct ScenicCreateSessionTResponder {
1137 control_handle: std::mem::ManuallyDrop<ScenicControlHandle>,
1138 tx_id: u32,
1139}
1140
1141impl std::ops::Drop for ScenicCreateSessionTResponder {
1145 fn drop(&mut self) {
1146 self.control_handle.shutdown();
1147 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1149 }
1150}
1151
1152impl fidl::endpoints::Responder for ScenicCreateSessionTResponder {
1153 type ControlHandle = ScenicControlHandle;
1154
1155 fn control_handle(&self) -> &ScenicControlHandle {
1156 &self.control_handle
1157 }
1158
1159 fn drop_without_shutdown(mut self) {
1160 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1162 std::mem::forget(self);
1164 }
1165}
1166
1167impl ScenicCreateSessionTResponder {
1168 pub fn send(self) -> Result<(), fidl::Error> {
1172 let _result = self.send_raw();
1173 if _result.is_err() {
1174 self.control_handle.shutdown();
1175 }
1176 self.drop_without_shutdown();
1177 _result
1178 }
1179
1180 pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1182 let _result = self.send_raw();
1183 self.drop_without_shutdown();
1184 _result
1185 }
1186
1187 fn send_raw(&self) -> Result<(), fidl::Error> {
1188 self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
1189 (),
1190 self.tx_id,
1191 0x369061a897552d4f,
1192 fidl::encoding::DynamicFlags::empty(),
1193 )
1194 }
1195}
1196
1197#[must_use = "FIDL methods require a response to be sent"]
1198#[derive(Debug)]
1199pub struct ScenicGetDisplayInfoResponder {
1200 control_handle: std::mem::ManuallyDrop<ScenicControlHandle>,
1201 tx_id: u32,
1202}
1203
1204impl std::ops::Drop for ScenicGetDisplayInfoResponder {
1208 fn drop(&mut self) {
1209 self.control_handle.shutdown();
1210 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1212 }
1213}
1214
1215impl fidl::endpoints::Responder for ScenicGetDisplayInfoResponder {
1216 type ControlHandle = ScenicControlHandle;
1217
1218 fn control_handle(&self) -> &ScenicControlHandle {
1219 &self.control_handle
1220 }
1221
1222 fn drop_without_shutdown(mut self) {
1223 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1225 std::mem::forget(self);
1227 }
1228}
1229
1230impl ScenicGetDisplayInfoResponder {
1231 pub fn send(self, mut info: &fidl_fuchsia_ui_gfx::DisplayInfo) -> Result<(), fidl::Error> {
1235 let _result = self.send_raw(info);
1236 if _result.is_err() {
1237 self.control_handle.shutdown();
1238 }
1239 self.drop_without_shutdown();
1240 _result
1241 }
1242
1243 pub fn send_no_shutdown_on_err(
1245 self,
1246 mut info: &fidl_fuchsia_ui_gfx::DisplayInfo,
1247 ) -> Result<(), fidl::Error> {
1248 let _result = self.send_raw(info);
1249 self.drop_without_shutdown();
1250 _result
1251 }
1252
1253 fn send_raw(&self, mut info: &fidl_fuchsia_ui_gfx::DisplayInfo) -> Result<(), fidl::Error> {
1254 self.control_handle.inner.send::<ScenicGetDisplayInfoResponse>(
1255 (info,),
1256 self.tx_id,
1257 0x3e4cdecbf7cc1797,
1258 fidl::encoding::DynamicFlags::empty(),
1259 )
1260 }
1261}
1262
1263#[must_use = "FIDL methods require a response to be sent"]
1264#[derive(Debug)]
1265pub struct ScenicGetDisplayOwnershipEventResponder {
1266 control_handle: std::mem::ManuallyDrop<ScenicControlHandle>,
1267 tx_id: u32,
1268}
1269
1270impl std::ops::Drop for ScenicGetDisplayOwnershipEventResponder {
1274 fn drop(&mut self) {
1275 self.control_handle.shutdown();
1276 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1278 }
1279}
1280
1281impl fidl::endpoints::Responder for ScenicGetDisplayOwnershipEventResponder {
1282 type ControlHandle = ScenicControlHandle;
1283
1284 fn control_handle(&self) -> &ScenicControlHandle {
1285 &self.control_handle
1286 }
1287
1288 fn drop_without_shutdown(mut self) {
1289 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1291 std::mem::forget(self);
1293 }
1294}
1295
1296impl ScenicGetDisplayOwnershipEventResponder {
1297 pub fn send(self, mut ownership_event: fidl::Event) -> Result<(), fidl::Error> {
1301 let _result = self.send_raw(ownership_event);
1302 if _result.is_err() {
1303 self.control_handle.shutdown();
1304 }
1305 self.drop_without_shutdown();
1306 _result
1307 }
1308
1309 pub fn send_no_shutdown_on_err(
1311 self,
1312 mut ownership_event: fidl::Event,
1313 ) -> Result<(), fidl::Error> {
1314 let _result = self.send_raw(ownership_event);
1315 self.drop_without_shutdown();
1316 _result
1317 }
1318
1319 fn send_raw(&self, mut ownership_event: fidl::Event) -> Result<(), fidl::Error> {
1320 self.control_handle.inner.send::<ScenicGetDisplayOwnershipEventResponse>(
1321 (ownership_event,),
1322 self.tx_id,
1323 0x54c114c7322b24d6,
1324 fidl::encoding::DynamicFlags::empty(),
1325 )
1326 }
1327}
1328
1329#[must_use = "FIDL methods require a response to be sent"]
1330#[derive(Debug)]
1331pub struct ScenicTakeScreenshotResponder {
1332 control_handle: std::mem::ManuallyDrop<ScenicControlHandle>,
1333 tx_id: u32,
1334}
1335
1336impl std::ops::Drop for ScenicTakeScreenshotResponder {
1340 fn drop(&mut self) {
1341 self.control_handle.shutdown();
1342 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1344 }
1345}
1346
1347impl fidl::endpoints::Responder for ScenicTakeScreenshotResponder {
1348 type ControlHandle = ScenicControlHandle;
1349
1350 fn control_handle(&self) -> &ScenicControlHandle {
1351 &self.control_handle
1352 }
1353
1354 fn drop_without_shutdown(mut self) {
1355 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1357 std::mem::forget(self);
1359 }
1360}
1361
1362impl ScenicTakeScreenshotResponder {
1363 pub fn send(self, mut img_data: ScreenshotData, mut success: bool) -> Result<(), fidl::Error> {
1367 let _result = self.send_raw(img_data, success);
1368 if _result.is_err() {
1369 self.control_handle.shutdown();
1370 }
1371 self.drop_without_shutdown();
1372 _result
1373 }
1374
1375 pub fn send_no_shutdown_on_err(
1377 self,
1378 mut img_data: ScreenshotData,
1379 mut success: bool,
1380 ) -> Result<(), fidl::Error> {
1381 let _result = self.send_raw(img_data, success);
1382 self.drop_without_shutdown();
1383 _result
1384 }
1385
1386 fn send_raw(&self, mut img_data: ScreenshotData, mut success: bool) -> Result<(), fidl::Error> {
1387 self.control_handle.inner.send::<ScenicTakeScreenshotResponse>(
1388 (&mut img_data, success),
1389 self.tx_id,
1390 0x53f5e06463987df2,
1391 fidl::encoding::DynamicFlags::empty(),
1392 )
1393 }
1394}
1395
1396#[must_use = "FIDL methods require a response to be sent"]
1397#[derive(Debug)]
1398pub struct ScenicUsesFlatlandResponder {
1399 control_handle: std::mem::ManuallyDrop<ScenicControlHandle>,
1400 tx_id: u32,
1401}
1402
1403impl std::ops::Drop for ScenicUsesFlatlandResponder {
1407 fn drop(&mut self) {
1408 self.control_handle.shutdown();
1409 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1411 }
1412}
1413
1414impl fidl::endpoints::Responder for ScenicUsesFlatlandResponder {
1415 type ControlHandle = ScenicControlHandle;
1416
1417 fn control_handle(&self) -> &ScenicControlHandle {
1418 &self.control_handle
1419 }
1420
1421 fn drop_without_shutdown(mut self) {
1422 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1424 std::mem::forget(self);
1426 }
1427}
1428
1429impl ScenicUsesFlatlandResponder {
1430 pub fn send(self, mut flatland_enabled: bool) -> Result<(), fidl::Error> {
1434 let _result = self.send_raw(flatland_enabled);
1435 if _result.is_err() {
1436 self.control_handle.shutdown();
1437 }
1438 self.drop_without_shutdown();
1439 _result
1440 }
1441
1442 pub fn send_no_shutdown_on_err(self, mut flatland_enabled: bool) -> Result<(), fidl::Error> {
1444 let _result = self.send_raw(flatland_enabled);
1445 self.drop_without_shutdown();
1446 _result
1447 }
1448
1449 fn send_raw(&self, mut flatland_enabled: bool) -> Result<(), fidl::Error> {
1450 self.control_handle.inner.send::<ScenicUsesFlatlandResponse>(
1451 (flatland_enabled,),
1452 self.tx_id,
1453 0x5f2e5e19463ae706,
1454 fidl::encoding::DynamicFlags::empty(),
1455 )
1456 }
1457}
1458
1459#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1460pub struct SessionMarker;
1461
1462impl fidl::endpoints::ProtocolMarker for SessionMarker {
1463 type Proxy = SessionProxy;
1464 type RequestStream = SessionRequestStream;
1465 #[cfg(target_os = "fuchsia")]
1466 type SynchronousProxy = SessionSynchronousProxy;
1467
1468 const DEBUG_NAME: &'static str = "(anonymous) Session";
1469}
1470
1471pub trait SessionProxyInterface: Send + Sync {
1472 fn r#enqueue(&self, cmds: Vec<Command>) -> Result<(), fidl::Error>;
1473 type PresentResponseFut: std::future::Future<Output = Result<fidl_fuchsia_images::PresentationInfo, fidl::Error>>
1474 + Send;
1475 fn r#present(
1476 &self,
1477 presentation_time: u64,
1478 acquire_fences: Vec<fidl::Event>,
1479 release_fences: Vec<fidl::Event>,
1480 ) -> Self::PresentResponseFut;
1481 type Present2ResponseFut: std::future::Future<
1482 Output = Result<fidl_fuchsia_scenic_scheduling::FuturePresentationTimes, fidl::Error>,
1483 > + Send;
1484 fn r#present2(&self, args: Present2Args) -> Self::Present2ResponseFut;
1485 type RequestPresentationTimesResponseFut: std::future::Future<
1486 Output = Result<fidl_fuchsia_scenic_scheduling::FuturePresentationTimes, fidl::Error>,
1487 > + Send;
1488 fn r#request_presentation_times(
1489 &self,
1490 requested_prediction_span: i64,
1491 ) -> Self::RequestPresentationTimesResponseFut;
1492 fn r#register_buffer_collection(
1493 &self,
1494 buffer_id: u32,
1495 token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
1496 ) -> Result<(), fidl::Error>;
1497 fn r#deregister_buffer_collection(&self, buffer_id: u32) -> Result<(), fidl::Error>;
1498 fn r#set_debug_name(&self, debug_name: &str) -> Result<(), fidl::Error>;
1499}
1500#[derive(Debug)]
1501#[cfg(target_os = "fuchsia")]
1502pub struct SessionSynchronousProxy {
1503 client: fidl::client::sync::Client,
1504}
1505
1506#[cfg(target_os = "fuchsia")]
1507impl fidl::endpoints::SynchronousProxy for SessionSynchronousProxy {
1508 type Proxy = SessionProxy;
1509 type Protocol = SessionMarker;
1510
1511 fn from_channel(inner: fidl::Channel) -> Self {
1512 Self::new(inner)
1513 }
1514
1515 fn into_channel(self) -> fidl::Channel {
1516 self.client.into_channel()
1517 }
1518
1519 fn as_channel(&self) -> &fidl::Channel {
1520 self.client.as_channel()
1521 }
1522}
1523
1524#[cfg(target_os = "fuchsia")]
1525impl SessionSynchronousProxy {
1526 pub fn new(channel: fidl::Channel) -> Self {
1527 let protocol_name = <SessionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1528 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1529 }
1530
1531 pub fn into_channel(self) -> fidl::Channel {
1532 self.client.into_channel()
1533 }
1534
1535 pub fn wait_for_event(
1538 &self,
1539 deadline: zx::MonotonicInstant,
1540 ) -> Result<SessionEvent, fidl::Error> {
1541 SessionEvent::decode(self.client.wait_for_event(deadline)?)
1542 }
1543
1544 pub fn r#enqueue(&self, mut cmds: Vec<Command>) -> Result<(), fidl::Error> {
1545 self.client.send::<SessionEnqueueRequest>(
1546 (cmds.as_mut(),),
1547 0x61e1e8b2cb6b0852,
1548 fidl::encoding::DynamicFlags::empty(),
1549 )
1550 }
1551
1552 pub fn r#present(
1650 &self,
1651 mut presentation_time: u64,
1652 mut acquire_fences: Vec<fidl::Event>,
1653 mut release_fences: Vec<fidl::Event>,
1654 ___deadline: zx::MonotonicInstant,
1655 ) -> Result<fidl_fuchsia_images::PresentationInfo, fidl::Error> {
1656 let _response = self.client.send_query::<SessionPresentRequest, SessionPresentResponse>(
1657 (presentation_time, acquire_fences.as_mut(), release_fences.as_mut()),
1658 0x36967062cdd2c37e,
1659 fidl::encoding::DynamicFlags::empty(),
1660 ___deadline,
1661 )?;
1662 Ok(_response.presentation_info)
1663 }
1664
1665 pub fn r#present2(
1687 &self,
1688 mut args: Present2Args,
1689 ___deadline: zx::MonotonicInstant,
1690 ) -> Result<fidl_fuchsia_scenic_scheduling::FuturePresentationTimes, fidl::Error> {
1691 let _response = self.client.send_query::<SessionPresent2Request, SessionPresent2Response>(
1692 (&mut args,),
1693 0x5d307d6198d76a65,
1694 fidl::encoding::DynamicFlags::empty(),
1695 ___deadline,
1696 )?;
1697 Ok(_response.request_presentation_times_info)
1698 }
1699
1700 pub fn r#request_presentation_times(
1711 &self,
1712 mut requested_prediction_span: i64,
1713 ___deadline: zx::MonotonicInstant,
1714 ) -> Result<fidl_fuchsia_scenic_scheduling::FuturePresentationTimes, fidl::Error> {
1715 let _response = self.client.send_query::<
1716 SessionRequestPresentationTimesRequest,
1717 SessionRequestPresentationTimesResponse,
1718 >(
1719 (requested_prediction_span,),
1720 0x14a087997bf83904,
1721 fidl::encoding::DynamicFlags::empty(),
1722 ___deadline,
1723 )?;
1724 Ok(_response.request_presentation_times_info)
1725 }
1726
1727 pub fn r#register_buffer_collection(
1734 &self,
1735 mut buffer_id: u32,
1736 mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
1737 ) -> Result<(), fidl::Error> {
1738 self.client.send::<SessionRegisterBufferCollectionRequest>(
1739 (buffer_id, token),
1740 0x141b0d5768c5ecf8,
1741 fidl::encoding::DynamicFlags::empty(),
1742 )
1743 }
1744
1745 pub fn r#deregister_buffer_collection(&self, mut buffer_id: u32) -> Result<(), fidl::Error> {
1750 self.client.send::<SessionDeregisterBufferCollectionRequest>(
1751 (buffer_id,),
1752 0x34e6c5c26b6cdb1e,
1753 fidl::encoding::DynamicFlags::empty(),
1754 )
1755 }
1756
1757 pub fn r#set_debug_name(&self, mut debug_name: &str) -> Result<(), fidl::Error> {
1760 self.client.send::<SessionSetDebugNameRequest>(
1761 (debug_name,),
1762 0xdb157bf88f57b91,
1763 fidl::encoding::DynamicFlags::empty(),
1764 )
1765 }
1766}
1767
1768#[cfg(target_os = "fuchsia")]
1769impl From<SessionSynchronousProxy> for zx::NullableHandle {
1770 fn from(value: SessionSynchronousProxy) -> Self {
1771 value.into_channel().into()
1772 }
1773}
1774
1775#[cfg(target_os = "fuchsia")]
1776impl From<fidl::Channel> for SessionSynchronousProxy {
1777 fn from(value: fidl::Channel) -> Self {
1778 Self::new(value)
1779 }
1780}
1781
1782#[cfg(target_os = "fuchsia")]
1783impl fidl::endpoints::FromClient for SessionSynchronousProxy {
1784 type Protocol = SessionMarker;
1785
1786 fn from_client(value: fidl::endpoints::ClientEnd<SessionMarker>) -> Self {
1787 Self::new(value.into_channel())
1788 }
1789}
1790
1791#[derive(Debug, Clone)]
1792pub struct SessionProxy {
1793 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1794}
1795
1796impl fidl::endpoints::Proxy for SessionProxy {
1797 type Protocol = SessionMarker;
1798
1799 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1800 Self::new(inner)
1801 }
1802
1803 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1804 self.client.into_channel().map_err(|client| Self { client })
1805 }
1806
1807 fn as_channel(&self) -> &::fidl::AsyncChannel {
1808 self.client.as_channel()
1809 }
1810}
1811
1812impl SessionProxy {
1813 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1815 let protocol_name = <SessionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1816 Self { client: fidl::client::Client::new(channel, protocol_name) }
1817 }
1818
1819 pub fn take_event_stream(&self) -> SessionEventStream {
1825 SessionEventStream { event_receiver: self.client.take_event_receiver() }
1826 }
1827
1828 pub fn r#enqueue(&self, mut cmds: Vec<Command>) -> Result<(), fidl::Error> {
1829 SessionProxyInterface::r#enqueue(self, cmds)
1830 }
1831
1832 pub fn r#present(
1930 &self,
1931 mut presentation_time: u64,
1932 mut acquire_fences: Vec<fidl::Event>,
1933 mut release_fences: Vec<fidl::Event>,
1934 ) -> fidl::client::QueryResponseFut<
1935 fidl_fuchsia_images::PresentationInfo,
1936 fidl::encoding::DefaultFuchsiaResourceDialect,
1937 > {
1938 SessionProxyInterface::r#present(self, presentation_time, acquire_fences, release_fences)
1939 }
1940
1941 pub fn r#present2(
1963 &self,
1964 mut args: Present2Args,
1965 ) -> fidl::client::QueryResponseFut<
1966 fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
1967 fidl::encoding::DefaultFuchsiaResourceDialect,
1968 > {
1969 SessionProxyInterface::r#present2(self, args)
1970 }
1971
1972 pub fn r#request_presentation_times(
1983 &self,
1984 mut requested_prediction_span: i64,
1985 ) -> fidl::client::QueryResponseFut<
1986 fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
1987 fidl::encoding::DefaultFuchsiaResourceDialect,
1988 > {
1989 SessionProxyInterface::r#request_presentation_times(self, requested_prediction_span)
1990 }
1991
1992 pub fn r#register_buffer_collection(
1999 &self,
2000 mut buffer_id: u32,
2001 mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
2002 ) -> Result<(), fidl::Error> {
2003 SessionProxyInterface::r#register_buffer_collection(self, buffer_id, token)
2004 }
2005
2006 pub fn r#deregister_buffer_collection(&self, mut buffer_id: u32) -> Result<(), fidl::Error> {
2011 SessionProxyInterface::r#deregister_buffer_collection(self, buffer_id)
2012 }
2013
2014 pub fn r#set_debug_name(&self, mut debug_name: &str) -> Result<(), fidl::Error> {
2017 SessionProxyInterface::r#set_debug_name(self, debug_name)
2018 }
2019}
2020
2021impl SessionProxyInterface for SessionProxy {
2022 fn r#enqueue(&self, mut cmds: Vec<Command>) -> Result<(), fidl::Error> {
2023 self.client.send::<SessionEnqueueRequest>(
2024 (cmds.as_mut(),),
2025 0x61e1e8b2cb6b0852,
2026 fidl::encoding::DynamicFlags::empty(),
2027 )
2028 }
2029
2030 type PresentResponseFut = fidl::client::QueryResponseFut<
2031 fidl_fuchsia_images::PresentationInfo,
2032 fidl::encoding::DefaultFuchsiaResourceDialect,
2033 >;
2034 fn r#present(
2035 &self,
2036 mut presentation_time: u64,
2037 mut acquire_fences: Vec<fidl::Event>,
2038 mut release_fences: Vec<fidl::Event>,
2039 ) -> Self::PresentResponseFut {
2040 fn _decode(
2041 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2042 ) -> Result<fidl_fuchsia_images::PresentationInfo, fidl::Error> {
2043 let _response = fidl::client::decode_transaction_body::<
2044 SessionPresentResponse,
2045 fidl::encoding::DefaultFuchsiaResourceDialect,
2046 0x36967062cdd2c37e,
2047 >(_buf?)?;
2048 Ok(_response.presentation_info)
2049 }
2050 self.client
2051 .send_query_and_decode::<SessionPresentRequest, fidl_fuchsia_images::PresentationInfo>(
2052 (presentation_time, acquire_fences.as_mut(), release_fences.as_mut()),
2053 0x36967062cdd2c37e,
2054 fidl::encoding::DynamicFlags::empty(),
2055 _decode,
2056 )
2057 }
2058
2059 type Present2ResponseFut = fidl::client::QueryResponseFut<
2060 fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
2061 fidl::encoding::DefaultFuchsiaResourceDialect,
2062 >;
2063 fn r#present2(&self, mut args: Present2Args) -> Self::Present2ResponseFut {
2064 fn _decode(
2065 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2066 ) -> Result<fidl_fuchsia_scenic_scheduling::FuturePresentationTimes, fidl::Error> {
2067 let _response = fidl::client::decode_transaction_body::<
2068 SessionPresent2Response,
2069 fidl::encoding::DefaultFuchsiaResourceDialect,
2070 0x5d307d6198d76a65,
2071 >(_buf?)?;
2072 Ok(_response.request_presentation_times_info)
2073 }
2074 self.client.send_query_and_decode::<
2075 SessionPresent2Request,
2076 fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
2077 >(
2078 (&mut args,),
2079 0x5d307d6198d76a65,
2080 fidl::encoding::DynamicFlags::empty(),
2081 _decode,
2082 )
2083 }
2084
2085 type RequestPresentationTimesResponseFut = fidl::client::QueryResponseFut<
2086 fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
2087 fidl::encoding::DefaultFuchsiaResourceDialect,
2088 >;
2089 fn r#request_presentation_times(
2090 &self,
2091 mut requested_prediction_span: i64,
2092 ) -> Self::RequestPresentationTimesResponseFut {
2093 fn _decode(
2094 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2095 ) -> Result<fidl_fuchsia_scenic_scheduling::FuturePresentationTimes, fidl::Error> {
2096 let _response = fidl::client::decode_transaction_body::<
2097 SessionRequestPresentationTimesResponse,
2098 fidl::encoding::DefaultFuchsiaResourceDialect,
2099 0x14a087997bf83904,
2100 >(_buf?)?;
2101 Ok(_response.request_presentation_times_info)
2102 }
2103 self.client.send_query_and_decode::<
2104 SessionRequestPresentationTimesRequest,
2105 fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
2106 >(
2107 (requested_prediction_span,),
2108 0x14a087997bf83904,
2109 fidl::encoding::DynamicFlags::empty(),
2110 _decode,
2111 )
2112 }
2113
2114 fn r#register_buffer_collection(
2115 &self,
2116 mut buffer_id: u32,
2117 mut token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
2118 ) -> Result<(), fidl::Error> {
2119 self.client.send::<SessionRegisterBufferCollectionRequest>(
2120 (buffer_id, token),
2121 0x141b0d5768c5ecf8,
2122 fidl::encoding::DynamicFlags::empty(),
2123 )
2124 }
2125
2126 fn r#deregister_buffer_collection(&self, mut buffer_id: u32) -> Result<(), fidl::Error> {
2127 self.client.send::<SessionDeregisterBufferCollectionRequest>(
2128 (buffer_id,),
2129 0x34e6c5c26b6cdb1e,
2130 fidl::encoding::DynamicFlags::empty(),
2131 )
2132 }
2133
2134 fn r#set_debug_name(&self, mut debug_name: &str) -> Result<(), fidl::Error> {
2135 self.client.send::<SessionSetDebugNameRequest>(
2136 (debug_name,),
2137 0xdb157bf88f57b91,
2138 fidl::encoding::DynamicFlags::empty(),
2139 )
2140 }
2141}
2142
2143pub struct SessionEventStream {
2144 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2145}
2146
2147impl std::marker::Unpin for SessionEventStream {}
2148
2149impl futures::stream::FusedStream for SessionEventStream {
2150 fn is_terminated(&self) -> bool {
2151 self.event_receiver.is_terminated()
2152 }
2153}
2154
2155impl futures::Stream for SessionEventStream {
2156 type Item = Result<SessionEvent, fidl::Error>;
2157
2158 fn poll_next(
2159 mut self: std::pin::Pin<&mut Self>,
2160 cx: &mut std::task::Context<'_>,
2161 ) -> std::task::Poll<Option<Self::Item>> {
2162 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2163 &mut self.event_receiver,
2164 cx
2165 )?) {
2166 Some(buf) => std::task::Poll::Ready(Some(SessionEvent::decode(buf))),
2167 None => std::task::Poll::Ready(None),
2168 }
2169 }
2170}
2171
2172#[derive(Debug)]
2173pub enum SessionEvent {
2174 OnFramePresented { frame_presented_info: fidl_fuchsia_scenic_scheduling::FramePresentedInfo },
2175}
2176
2177impl SessionEvent {
2178 #[allow(irrefutable_let_patterns)]
2179 pub fn into_on_frame_presented(
2180 self,
2181 ) -> Option<fidl_fuchsia_scenic_scheduling::FramePresentedInfo> {
2182 if let SessionEvent::OnFramePresented { frame_presented_info } = self {
2183 Some((frame_presented_info))
2184 } else {
2185 None
2186 }
2187 }
2188
2189 fn decode(
2191 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2192 ) -> Result<SessionEvent, fidl::Error> {
2193 let (bytes, _handles) = buf.split_mut();
2194 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2195 debug_assert_eq!(tx_header.tx_id, 0);
2196 match tx_header.ordinal {
2197 0x26e3bdd1559be16b => {
2198 let mut out = fidl::new_empty!(
2199 SessionOnFramePresentedRequest,
2200 fidl::encoding::DefaultFuchsiaResourceDialect
2201 );
2202 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionOnFramePresentedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
2203 Ok((SessionEvent::OnFramePresented {
2204 frame_presented_info: out.frame_presented_info,
2205 }))
2206 }
2207 _ => Err(fidl::Error::UnknownOrdinal {
2208 ordinal: tx_header.ordinal,
2209 protocol_name: <SessionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2210 }),
2211 }
2212 }
2213}
2214
2215pub struct SessionRequestStream {
2217 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2218 is_terminated: bool,
2219}
2220
2221impl std::marker::Unpin for SessionRequestStream {}
2222
2223impl futures::stream::FusedStream for SessionRequestStream {
2224 fn is_terminated(&self) -> bool {
2225 self.is_terminated
2226 }
2227}
2228
2229impl fidl::endpoints::RequestStream for SessionRequestStream {
2230 type Protocol = SessionMarker;
2231 type ControlHandle = SessionControlHandle;
2232
2233 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2234 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2235 }
2236
2237 fn control_handle(&self) -> Self::ControlHandle {
2238 SessionControlHandle { inner: self.inner.clone() }
2239 }
2240
2241 fn into_inner(
2242 self,
2243 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2244 {
2245 (self.inner, self.is_terminated)
2246 }
2247
2248 fn from_inner(
2249 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2250 is_terminated: bool,
2251 ) -> Self {
2252 Self { inner, is_terminated }
2253 }
2254}
2255
2256impl futures::Stream for SessionRequestStream {
2257 type Item = Result<SessionRequest, fidl::Error>;
2258
2259 fn poll_next(
2260 mut self: std::pin::Pin<&mut Self>,
2261 cx: &mut std::task::Context<'_>,
2262 ) -> std::task::Poll<Option<Self::Item>> {
2263 let this = &mut *self;
2264 if this.inner.check_shutdown(cx) {
2265 this.is_terminated = true;
2266 return std::task::Poll::Ready(None);
2267 }
2268 if this.is_terminated {
2269 panic!("polled SessionRequestStream after completion");
2270 }
2271 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2272 |bytes, handles| {
2273 match this.inner.channel().read_etc(cx, bytes, handles) {
2274 std::task::Poll::Ready(Ok(())) => {}
2275 std::task::Poll::Pending => return std::task::Poll::Pending,
2276 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2277 this.is_terminated = true;
2278 return std::task::Poll::Ready(None);
2279 }
2280 std::task::Poll::Ready(Err(e)) => {
2281 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2282 e.into(),
2283 ))));
2284 }
2285 }
2286
2287 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2289
2290 std::task::Poll::Ready(Some(match header.ordinal {
2291 0x61e1e8b2cb6b0852 => {
2292 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2293 let mut req = fidl::new_empty!(
2294 SessionEnqueueRequest,
2295 fidl::encoding::DefaultFuchsiaResourceDialect
2296 );
2297 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionEnqueueRequest>(&header, _body_bytes, handles, &mut req)?;
2298 let control_handle = SessionControlHandle { inner: this.inner.clone() };
2299 Ok(SessionRequest::Enqueue { cmds: req.cmds, control_handle })
2300 }
2301 0x36967062cdd2c37e => {
2302 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2303 let mut req = fidl::new_empty!(
2304 SessionPresentRequest,
2305 fidl::encoding::DefaultFuchsiaResourceDialect
2306 );
2307 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionPresentRequest>(&header, _body_bytes, handles, &mut req)?;
2308 let control_handle = SessionControlHandle { inner: this.inner.clone() };
2309 Ok(SessionRequest::Present {
2310 presentation_time: req.presentation_time,
2311 acquire_fences: req.acquire_fences,
2312 release_fences: req.release_fences,
2313
2314 responder: SessionPresentResponder {
2315 control_handle: std::mem::ManuallyDrop::new(control_handle),
2316 tx_id: header.tx_id,
2317 },
2318 })
2319 }
2320 0x5d307d6198d76a65 => {
2321 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2322 let mut req = fidl::new_empty!(
2323 SessionPresent2Request,
2324 fidl::encoding::DefaultFuchsiaResourceDialect
2325 );
2326 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionPresent2Request>(&header, _body_bytes, handles, &mut req)?;
2327 let control_handle = SessionControlHandle { inner: this.inner.clone() };
2328 Ok(SessionRequest::Present2 {
2329 args: req.args,
2330
2331 responder: SessionPresent2Responder {
2332 control_handle: std::mem::ManuallyDrop::new(control_handle),
2333 tx_id: header.tx_id,
2334 },
2335 })
2336 }
2337 0x14a087997bf83904 => {
2338 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2339 let mut req = fidl::new_empty!(
2340 SessionRequestPresentationTimesRequest,
2341 fidl::encoding::DefaultFuchsiaResourceDialect
2342 );
2343 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionRequestPresentationTimesRequest>(&header, _body_bytes, handles, &mut req)?;
2344 let control_handle = SessionControlHandle { inner: this.inner.clone() };
2345 Ok(SessionRequest::RequestPresentationTimes {
2346 requested_prediction_span: req.requested_prediction_span,
2347
2348 responder: SessionRequestPresentationTimesResponder {
2349 control_handle: std::mem::ManuallyDrop::new(control_handle),
2350 tx_id: header.tx_id,
2351 },
2352 })
2353 }
2354 0x141b0d5768c5ecf8 => {
2355 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2356 let mut req = fidl::new_empty!(
2357 SessionRegisterBufferCollectionRequest,
2358 fidl::encoding::DefaultFuchsiaResourceDialect
2359 );
2360 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionRegisterBufferCollectionRequest>(&header, _body_bytes, handles, &mut req)?;
2361 let control_handle = SessionControlHandle { inner: this.inner.clone() };
2362 Ok(SessionRequest::RegisterBufferCollection {
2363 buffer_id: req.buffer_id,
2364 token: req.token,
2365
2366 control_handle,
2367 })
2368 }
2369 0x34e6c5c26b6cdb1e => {
2370 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2371 let mut req = fidl::new_empty!(
2372 SessionDeregisterBufferCollectionRequest,
2373 fidl::encoding::DefaultFuchsiaResourceDialect
2374 );
2375 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionDeregisterBufferCollectionRequest>(&header, _body_bytes, handles, &mut req)?;
2376 let control_handle = SessionControlHandle { inner: this.inner.clone() };
2377 Ok(SessionRequest::DeregisterBufferCollection {
2378 buffer_id: req.buffer_id,
2379
2380 control_handle,
2381 })
2382 }
2383 0xdb157bf88f57b91 => {
2384 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2385 let mut req = fidl::new_empty!(
2386 SessionSetDebugNameRequest,
2387 fidl::encoding::DefaultFuchsiaResourceDialect
2388 );
2389 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionSetDebugNameRequest>(&header, _body_bytes, handles, &mut req)?;
2390 let control_handle = SessionControlHandle { inner: this.inner.clone() };
2391 Ok(SessionRequest::SetDebugName {
2392 debug_name: req.debug_name,
2393
2394 control_handle,
2395 })
2396 }
2397 _ => Err(fidl::Error::UnknownOrdinal {
2398 ordinal: header.ordinal,
2399 protocol_name:
2400 <SessionMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2401 }),
2402 }))
2403 },
2404 )
2405 }
2406}
2407
2408#[derive(Debug)]
2411pub enum SessionRequest {
2412 Enqueue {
2413 cmds: Vec<Command>,
2414 control_handle: SessionControlHandle,
2415 },
2416 Present {
2514 presentation_time: u64,
2515 acquire_fences: Vec<fidl::Event>,
2516 release_fences: Vec<fidl::Event>,
2517 responder: SessionPresentResponder,
2518 },
2519 Present2 {
2541 args: Present2Args,
2542 responder: SessionPresent2Responder,
2543 },
2544 RequestPresentationTimes {
2555 requested_prediction_span: i64,
2556 responder: SessionRequestPresentationTimesResponder,
2557 },
2558 RegisterBufferCollection {
2565 buffer_id: u32,
2566 token: fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
2567 control_handle: SessionControlHandle,
2568 },
2569 DeregisterBufferCollection {
2574 buffer_id: u32,
2575 control_handle: SessionControlHandle,
2576 },
2577 SetDebugName {
2580 debug_name: String,
2581 control_handle: SessionControlHandle,
2582 },
2583}
2584
2585impl SessionRequest {
2586 #[allow(irrefutable_let_patterns)]
2587 pub fn into_enqueue(self) -> Option<(Vec<Command>, SessionControlHandle)> {
2588 if let SessionRequest::Enqueue { cmds, control_handle } = self {
2589 Some((cmds, control_handle))
2590 } else {
2591 None
2592 }
2593 }
2594
2595 #[allow(irrefutable_let_patterns)]
2596 pub fn into_present(
2597 self,
2598 ) -> Option<(u64, Vec<fidl::Event>, Vec<fidl::Event>, SessionPresentResponder)> {
2599 if let SessionRequest::Present {
2600 presentation_time,
2601 acquire_fences,
2602 release_fences,
2603 responder,
2604 } = self
2605 {
2606 Some((presentation_time, acquire_fences, release_fences, responder))
2607 } else {
2608 None
2609 }
2610 }
2611
2612 #[allow(irrefutable_let_patterns)]
2613 pub fn into_present2(self) -> Option<(Present2Args, SessionPresent2Responder)> {
2614 if let SessionRequest::Present2 { args, responder } = self {
2615 Some((args, responder))
2616 } else {
2617 None
2618 }
2619 }
2620
2621 #[allow(irrefutable_let_patterns)]
2622 pub fn into_request_presentation_times(
2623 self,
2624 ) -> Option<(i64, SessionRequestPresentationTimesResponder)> {
2625 if let SessionRequest::RequestPresentationTimes { requested_prediction_span, responder } =
2626 self
2627 {
2628 Some((requested_prediction_span, responder))
2629 } else {
2630 None
2631 }
2632 }
2633
2634 #[allow(irrefutable_let_patterns)]
2635 pub fn into_register_buffer_collection(
2636 self,
2637 ) -> Option<(
2638 u32,
2639 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
2640 SessionControlHandle,
2641 )> {
2642 if let SessionRequest::RegisterBufferCollection { buffer_id, token, control_handle } = self
2643 {
2644 Some((buffer_id, token, control_handle))
2645 } else {
2646 None
2647 }
2648 }
2649
2650 #[allow(irrefutable_let_patterns)]
2651 pub fn into_deregister_buffer_collection(self) -> Option<(u32, SessionControlHandle)> {
2652 if let SessionRequest::DeregisterBufferCollection { buffer_id, control_handle } = self {
2653 Some((buffer_id, control_handle))
2654 } else {
2655 None
2656 }
2657 }
2658
2659 #[allow(irrefutable_let_patterns)]
2660 pub fn into_set_debug_name(self) -> Option<(String, SessionControlHandle)> {
2661 if let SessionRequest::SetDebugName { debug_name, control_handle } = self {
2662 Some((debug_name, control_handle))
2663 } else {
2664 None
2665 }
2666 }
2667
2668 pub fn method_name(&self) -> &'static str {
2670 match *self {
2671 SessionRequest::Enqueue { .. } => "enqueue",
2672 SessionRequest::Present { .. } => "present",
2673 SessionRequest::Present2 { .. } => "present2",
2674 SessionRequest::RequestPresentationTimes { .. } => "request_presentation_times",
2675 SessionRequest::RegisterBufferCollection { .. } => "register_buffer_collection",
2676 SessionRequest::DeregisterBufferCollection { .. } => "deregister_buffer_collection",
2677 SessionRequest::SetDebugName { .. } => "set_debug_name",
2678 }
2679 }
2680}
2681
2682#[derive(Debug, Clone)]
2683pub struct SessionControlHandle {
2684 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2685}
2686
2687impl fidl::endpoints::ControlHandle for SessionControlHandle {
2688 fn shutdown(&self) {
2689 self.inner.shutdown()
2690 }
2691
2692 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2693 self.inner.shutdown_with_epitaph(status)
2694 }
2695
2696 fn is_closed(&self) -> bool {
2697 self.inner.channel().is_closed()
2698 }
2699 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2700 self.inner.channel().on_closed()
2701 }
2702
2703 #[cfg(target_os = "fuchsia")]
2704 fn signal_peer(
2705 &self,
2706 clear_mask: zx::Signals,
2707 set_mask: zx::Signals,
2708 ) -> Result<(), zx_status::Status> {
2709 use fidl::Peered;
2710 self.inner.channel().signal_peer(clear_mask, set_mask)
2711 }
2712}
2713
2714impl SessionControlHandle {
2715 pub fn send_on_frame_presented(
2716 &self,
2717 mut frame_presented_info: &fidl_fuchsia_scenic_scheduling::FramePresentedInfo,
2718 ) -> Result<(), fidl::Error> {
2719 self.inner.send::<SessionOnFramePresentedRequest>(
2720 (frame_presented_info,),
2721 0,
2722 0x26e3bdd1559be16b,
2723 fidl::encoding::DynamicFlags::empty(),
2724 )
2725 }
2726}
2727
2728#[must_use = "FIDL methods require a response to be sent"]
2729#[derive(Debug)]
2730pub struct SessionPresentResponder {
2731 control_handle: std::mem::ManuallyDrop<SessionControlHandle>,
2732 tx_id: u32,
2733}
2734
2735impl std::ops::Drop for SessionPresentResponder {
2739 fn drop(&mut self) {
2740 self.control_handle.shutdown();
2741 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2743 }
2744}
2745
2746impl fidl::endpoints::Responder for SessionPresentResponder {
2747 type ControlHandle = SessionControlHandle;
2748
2749 fn control_handle(&self) -> &SessionControlHandle {
2750 &self.control_handle
2751 }
2752
2753 fn drop_without_shutdown(mut self) {
2754 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2756 std::mem::forget(self);
2758 }
2759}
2760
2761impl SessionPresentResponder {
2762 pub fn send(
2766 self,
2767 mut presentation_info: &fidl_fuchsia_images::PresentationInfo,
2768 ) -> Result<(), fidl::Error> {
2769 let _result = self.send_raw(presentation_info);
2770 if _result.is_err() {
2771 self.control_handle.shutdown();
2772 }
2773 self.drop_without_shutdown();
2774 _result
2775 }
2776
2777 pub fn send_no_shutdown_on_err(
2779 self,
2780 mut presentation_info: &fidl_fuchsia_images::PresentationInfo,
2781 ) -> Result<(), fidl::Error> {
2782 let _result = self.send_raw(presentation_info);
2783 self.drop_without_shutdown();
2784 _result
2785 }
2786
2787 fn send_raw(
2788 &self,
2789 mut presentation_info: &fidl_fuchsia_images::PresentationInfo,
2790 ) -> Result<(), fidl::Error> {
2791 self.control_handle.inner.send::<SessionPresentResponse>(
2792 (presentation_info,),
2793 self.tx_id,
2794 0x36967062cdd2c37e,
2795 fidl::encoding::DynamicFlags::empty(),
2796 )
2797 }
2798}
2799
2800#[must_use = "FIDL methods require a response to be sent"]
2801#[derive(Debug)]
2802pub struct SessionPresent2Responder {
2803 control_handle: std::mem::ManuallyDrop<SessionControlHandle>,
2804 tx_id: u32,
2805}
2806
2807impl std::ops::Drop for SessionPresent2Responder {
2811 fn drop(&mut self) {
2812 self.control_handle.shutdown();
2813 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2815 }
2816}
2817
2818impl fidl::endpoints::Responder for SessionPresent2Responder {
2819 type ControlHandle = SessionControlHandle;
2820
2821 fn control_handle(&self) -> &SessionControlHandle {
2822 &self.control_handle
2823 }
2824
2825 fn drop_without_shutdown(mut self) {
2826 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2828 std::mem::forget(self);
2830 }
2831}
2832
2833impl SessionPresent2Responder {
2834 pub fn send(
2838 self,
2839 mut request_presentation_times_info: &fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
2840 ) -> Result<(), fidl::Error> {
2841 let _result = self.send_raw(request_presentation_times_info);
2842 if _result.is_err() {
2843 self.control_handle.shutdown();
2844 }
2845 self.drop_without_shutdown();
2846 _result
2847 }
2848
2849 pub fn send_no_shutdown_on_err(
2851 self,
2852 mut request_presentation_times_info: &fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
2853 ) -> Result<(), fidl::Error> {
2854 let _result = self.send_raw(request_presentation_times_info);
2855 self.drop_without_shutdown();
2856 _result
2857 }
2858
2859 fn send_raw(
2860 &self,
2861 mut request_presentation_times_info: &fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
2862 ) -> Result<(), fidl::Error> {
2863 self.control_handle.inner.send::<SessionPresent2Response>(
2864 (request_presentation_times_info,),
2865 self.tx_id,
2866 0x5d307d6198d76a65,
2867 fidl::encoding::DynamicFlags::empty(),
2868 )
2869 }
2870}
2871
2872#[must_use = "FIDL methods require a response to be sent"]
2873#[derive(Debug)]
2874pub struct SessionRequestPresentationTimesResponder {
2875 control_handle: std::mem::ManuallyDrop<SessionControlHandle>,
2876 tx_id: u32,
2877}
2878
2879impl std::ops::Drop for SessionRequestPresentationTimesResponder {
2883 fn drop(&mut self) {
2884 self.control_handle.shutdown();
2885 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2887 }
2888}
2889
2890impl fidl::endpoints::Responder for SessionRequestPresentationTimesResponder {
2891 type ControlHandle = SessionControlHandle;
2892
2893 fn control_handle(&self) -> &SessionControlHandle {
2894 &self.control_handle
2895 }
2896
2897 fn drop_without_shutdown(mut self) {
2898 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2900 std::mem::forget(self);
2902 }
2903}
2904
2905impl SessionRequestPresentationTimesResponder {
2906 pub fn send(
2910 self,
2911 mut request_presentation_times_info: &fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
2912 ) -> Result<(), fidl::Error> {
2913 let _result = self.send_raw(request_presentation_times_info);
2914 if _result.is_err() {
2915 self.control_handle.shutdown();
2916 }
2917 self.drop_without_shutdown();
2918 _result
2919 }
2920
2921 pub fn send_no_shutdown_on_err(
2923 self,
2924 mut request_presentation_times_info: &fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
2925 ) -> Result<(), fidl::Error> {
2926 let _result = self.send_raw(request_presentation_times_info);
2927 self.drop_without_shutdown();
2928 _result
2929 }
2930
2931 fn send_raw(
2932 &self,
2933 mut request_presentation_times_info: &fidl_fuchsia_scenic_scheduling::FuturePresentationTimes,
2934 ) -> Result<(), fidl::Error> {
2935 self.control_handle.inner.send::<SessionRequestPresentationTimesResponse>(
2936 (request_presentation_times_info,),
2937 self.tx_id,
2938 0x14a087997bf83904,
2939 fidl::encoding::DynamicFlags::empty(),
2940 )
2941 }
2942}
2943
2944#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2945pub struct SessionListenerMarker;
2946
2947impl fidl::endpoints::ProtocolMarker for SessionListenerMarker {
2948 type Proxy = SessionListenerProxy;
2949 type RequestStream = SessionListenerRequestStream;
2950 #[cfg(target_os = "fuchsia")]
2951 type SynchronousProxy = SessionListenerSynchronousProxy;
2952
2953 const DEBUG_NAME: &'static str = "(anonymous) SessionListener";
2954}
2955
2956pub trait SessionListenerProxyInterface: Send + Sync {
2957 fn r#on_scenic_error(&self, error: &str) -> Result<(), fidl::Error>;
2958 fn r#on_scenic_event(&self, events: Vec<Event>) -> Result<(), fidl::Error>;
2959}
2960#[derive(Debug)]
2961#[cfg(target_os = "fuchsia")]
2962pub struct SessionListenerSynchronousProxy {
2963 client: fidl::client::sync::Client,
2964}
2965
2966#[cfg(target_os = "fuchsia")]
2967impl fidl::endpoints::SynchronousProxy for SessionListenerSynchronousProxy {
2968 type Proxy = SessionListenerProxy;
2969 type Protocol = SessionListenerMarker;
2970
2971 fn from_channel(inner: fidl::Channel) -> Self {
2972 Self::new(inner)
2973 }
2974
2975 fn into_channel(self) -> fidl::Channel {
2976 self.client.into_channel()
2977 }
2978
2979 fn as_channel(&self) -> &fidl::Channel {
2980 self.client.as_channel()
2981 }
2982}
2983
2984#[cfg(target_os = "fuchsia")]
2985impl SessionListenerSynchronousProxy {
2986 pub fn new(channel: fidl::Channel) -> Self {
2987 let protocol_name = <SessionListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2988 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2989 }
2990
2991 pub fn into_channel(self) -> fidl::Channel {
2992 self.client.into_channel()
2993 }
2994
2995 pub fn wait_for_event(
2998 &self,
2999 deadline: zx::MonotonicInstant,
3000 ) -> Result<SessionListenerEvent, fidl::Error> {
3001 SessionListenerEvent::decode(self.client.wait_for_event(deadline)?)
3002 }
3003
3004 pub fn r#on_scenic_error(&self, mut error: &str) -> Result<(), fidl::Error> {
3006 self.client.send::<SessionListenerOnScenicErrorRequest>(
3007 (error,),
3008 0x68095b89cb6c45f7,
3009 fidl::encoding::DynamicFlags::empty(),
3010 )
3011 }
3012
3013 pub fn r#on_scenic_event(&self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
3016 self.client.send::<SessionListenerOnScenicEventRequest>(
3017 (events.as_mut(),),
3018 0x5f66bec36e87b3ea,
3019 fidl::encoding::DynamicFlags::empty(),
3020 )
3021 }
3022}
3023
3024#[cfg(target_os = "fuchsia")]
3025impl From<SessionListenerSynchronousProxy> for zx::NullableHandle {
3026 fn from(value: SessionListenerSynchronousProxy) -> Self {
3027 value.into_channel().into()
3028 }
3029}
3030
3031#[cfg(target_os = "fuchsia")]
3032impl From<fidl::Channel> for SessionListenerSynchronousProxy {
3033 fn from(value: fidl::Channel) -> Self {
3034 Self::new(value)
3035 }
3036}
3037
3038#[cfg(target_os = "fuchsia")]
3039impl fidl::endpoints::FromClient for SessionListenerSynchronousProxy {
3040 type Protocol = SessionListenerMarker;
3041
3042 fn from_client(value: fidl::endpoints::ClientEnd<SessionListenerMarker>) -> Self {
3043 Self::new(value.into_channel())
3044 }
3045}
3046
3047#[derive(Debug, Clone)]
3048pub struct SessionListenerProxy {
3049 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3050}
3051
3052impl fidl::endpoints::Proxy for SessionListenerProxy {
3053 type Protocol = SessionListenerMarker;
3054
3055 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3056 Self::new(inner)
3057 }
3058
3059 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3060 self.client.into_channel().map_err(|client| Self { client })
3061 }
3062
3063 fn as_channel(&self) -> &::fidl::AsyncChannel {
3064 self.client.as_channel()
3065 }
3066}
3067
3068impl SessionListenerProxy {
3069 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3071 let protocol_name = <SessionListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3072 Self { client: fidl::client::Client::new(channel, protocol_name) }
3073 }
3074
3075 pub fn take_event_stream(&self) -> SessionListenerEventStream {
3081 SessionListenerEventStream { event_receiver: self.client.take_event_receiver() }
3082 }
3083
3084 pub fn r#on_scenic_error(&self, mut error: &str) -> Result<(), fidl::Error> {
3086 SessionListenerProxyInterface::r#on_scenic_error(self, error)
3087 }
3088
3089 pub fn r#on_scenic_event(&self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
3092 SessionListenerProxyInterface::r#on_scenic_event(self, events)
3093 }
3094}
3095
3096impl SessionListenerProxyInterface for SessionListenerProxy {
3097 fn r#on_scenic_error(&self, mut error: &str) -> Result<(), fidl::Error> {
3098 self.client.send::<SessionListenerOnScenicErrorRequest>(
3099 (error,),
3100 0x68095b89cb6c45f7,
3101 fidl::encoding::DynamicFlags::empty(),
3102 )
3103 }
3104
3105 fn r#on_scenic_event(&self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
3106 self.client.send::<SessionListenerOnScenicEventRequest>(
3107 (events.as_mut(),),
3108 0x5f66bec36e87b3ea,
3109 fidl::encoding::DynamicFlags::empty(),
3110 )
3111 }
3112}
3113
3114pub struct SessionListenerEventStream {
3115 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3116}
3117
3118impl std::marker::Unpin for SessionListenerEventStream {}
3119
3120impl futures::stream::FusedStream for SessionListenerEventStream {
3121 fn is_terminated(&self) -> bool {
3122 self.event_receiver.is_terminated()
3123 }
3124}
3125
3126impl futures::Stream for SessionListenerEventStream {
3127 type Item = Result<SessionListenerEvent, fidl::Error>;
3128
3129 fn poll_next(
3130 mut self: std::pin::Pin<&mut Self>,
3131 cx: &mut std::task::Context<'_>,
3132 ) -> std::task::Poll<Option<Self::Item>> {
3133 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3134 &mut self.event_receiver,
3135 cx
3136 )?) {
3137 Some(buf) => std::task::Poll::Ready(Some(SessionListenerEvent::decode(buf))),
3138 None => std::task::Poll::Ready(None),
3139 }
3140 }
3141}
3142
3143#[derive(Debug)]
3144pub enum SessionListenerEvent {}
3145
3146impl SessionListenerEvent {
3147 fn decode(
3149 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3150 ) -> Result<SessionListenerEvent, fidl::Error> {
3151 let (bytes, _handles) = buf.split_mut();
3152 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3153 debug_assert_eq!(tx_header.tx_id, 0);
3154 match tx_header.ordinal {
3155 _ => Err(fidl::Error::UnknownOrdinal {
3156 ordinal: tx_header.ordinal,
3157 protocol_name:
3158 <SessionListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3159 }),
3160 }
3161 }
3162}
3163
3164pub struct SessionListenerRequestStream {
3166 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3167 is_terminated: bool,
3168}
3169
3170impl std::marker::Unpin for SessionListenerRequestStream {}
3171
3172impl futures::stream::FusedStream for SessionListenerRequestStream {
3173 fn is_terminated(&self) -> bool {
3174 self.is_terminated
3175 }
3176}
3177
3178impl fidl::endpoints::RequestStream for SessionListenerRequestStream {
3179 type Protocol = SessionListenerMarker;
3180 type ControlHandle = SessionListenerControlHandle;
3181
3182 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3183 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3184 }
3185
3186 fn control_handle(&self) -> Self::ControlHandle {
3187 SessionListenerControlHandle { inner: self.inner.clone() }
3188 }
3189
3190 fn into_inner(
3191 self,
3192 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3193 {
3194 (self.inner, self.is_terminated)
3195 }
3196
3197 fn from_inner(
3198 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3199 is_terminated: bool,
3200 ) -> Self {
3201 Self { inner, is_terminated }
3202 }
3203}
3204
3205impl futures::Stream for SessionListenerRequestStream {
3206 type Item = Result<SessionListenerRequest, fidl::Error>;
3207
3208 fn poll_next(
3209 mut self: std::pin::Pin<&mut Self>,
3210 cx: &mut std::task::Context<'_>,
3211 ) -> std::task::Poll<Option<Self::Item>> {
3212 let this = &mut *self;
3213 if this.inner.check_shutdown(cx) {
3214 this.is_terminated = true;
3215 return std::task::Poll::Ready(None);
3216 }
3217 if this.is_terminated {
3218 panic!("polled SessionListenerRequestStream after completion");
3219 }
3220 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3221 |bytes, handles| {
3222 match this.inner.channel().read_etc(cx, bytes, handles) {
3223 std::task::Poll::Ready(Ok(())) => {}
3224 std::task::Poll::Pending => return std::task::Poll::Pending,
3225 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3226 this.is_terminated = true;
3227 return std::task::Poll::Ready(None);
3228 }
3229 std::task::Poll::Ready(Err(e)) => {
3230 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3231 e.into(),
3232 ))));
3233 }
3234 }
3235
3236 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3238
3239 std::task::Poll::Ready(Some(match header.ordinal {
3240 0x68095b89cb6c45f7 => {
3241 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3242 let mut req = fidl::new_empty!(
3243 SessionListenerOnScenicErrorRequest,
3244 fidl::encoding::DefaultFuchsiaResourceDialect
3245 );
3246 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionListenerOnScenicErrorRequest>(&header, _body_bytes, handles, &mut req)?;
3247 let control_handle =
3248 SessionListenerControlHandle { inner: this.inner.clone() };
3249 Ok(SessionListenerRequest::OnScenicError {
3250 error: req.error,
3251
3252 control_handle,
3253 })
3254 }
3255 0x5f66bec36e87b3ea => {
3256 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3257 let mut req = fidl::new_empty!(
3258 SessionListenerOnScenicEventRequest,
3259 fidl::encoding::DefaultFuchsiaResourceDialect
3260 );
3261 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<SessionListenerOnScenicEventRequest>(&header, _body_bytes, handles, &mut req)?;
3262 let control_handle =
3263 SessionListenerControlHandle { inner: this.inner.clone() };
3264 Ok(SessionListenerRequest::OnScenicEvent {
3265 events: req.events,
3266
3267 control_handle,
3268 })
3269 }
3270 _ => Err(fidl::Error::UnknownOrdinal {
3271 ordinal: header.ordinal,
3272 protocol_name:
3273 <SessionListenerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3274 }),
3275 }))
3276 },
3277 )
3278 }
3279}
3280
3281#[derive(Debug)]
3283pub enum SessionListenerRequest {
3284 OnScenicError { error: String, control_handle: SessionListenerControlHandle },
3286 OnScenicEvent { events: Vec<Event>, control_handle: SessionListenerControlHandle },
3289}
3290
3291impl SessionListenerRequest {
3292 #[allow(irrefutable_let_patterns)]
3293 pub fn into_on_scenic_error(self) -> Option<(String, SessionListenerControlHandle)> {
3294 if let SessionListenerRequest::OnScenicError { error, control_handle } = self {
3295 Some((error, control_handle))
3296 } else {
3297 None
3298 }
3299 }
3300
3301 #[allow(irrefutable_let_patterns)]
3302 pub fn into_on_scenic_event(self) -> Option<(Vec<Event>, SessionListenerControlHandle)> {
3303 if let SessionListenerRequest::OnScenicEvent { events, control_handle } = self {
3304 Some((events, control_handle))
3305 } else {
3306 None
3307 }
3308 }
3309
3310 pub fn method_name(&self) -> &'static str {
3312 match *self {
3313 SessionListenerRequest::OnScenicError { .. } => "on_scenic_error",
3314 SessionListenerRequest::OnScenicEvent { .. } => "on_scenic_event",
3315 }
3316 }
3317}
3318
3319#[derive(Debug, Clone)]
3320pub struct SessionListenerControlHandle {
3321 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3322}
3323
3324impl fidl::endpoints::ControlHandle for SessionListenerControlHandle {
3325 fn shutdown(&self) {
3326 self.inner.shutdown()
3327 }
3328
3329 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3330 self.inner.shutdown_with_epitaph(status)
3331 }
3332
3333 fn is_closed(&self) -> bool {
3334 self.inner.channel().is_closed()
3335 }
3336 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3337 self.inner.channel().on_closed()
3338 }
3339
3340 #[cfg(target_os = "fuchsia")]
3341 fn signal_peer(
3342 &self,
3343 clear_mask: zx::Signals,
3344 set_mask: zx::Signals,
3345 ) -> Result<(), zx_status::Status> {
3346 use fidl::Peered;
3347 self.inner.channel().signal_peer(clear_mask, set_mask)
3348 }
3349}
3350
3351impl SessionListenerControlHandle {}
3352
3353#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3354pub struct SnapshotMarker;
3355
3356impl fidl::endpoints::ProtocolMarker for SnapshotMarker {
3357 type Proxy = SnapshotProxy;
3358 type RequestStream = SnapshotRequestStream;
3359 #[cfg(target_os = "fuchsia")]
3360 type SynchronousProxy = SnapshotSynchronousProxy;
3361
3362 const DEBUG_NAME: &'static str = "fuchsia.ui.scenic.Snapshot";
3363}
3364impl fidl::endpoints::DiscoverableProtocolMarker for SnapshotMarker {}
3365
3366pub trait SnapshotProxyInterface: Send + Sync {}
3367#[derive(Debug)]
3368#[cfg(target_os = "fuchsia")]
3369pub struct SnapshotSynchronousProxy {
3370 client: fidl::client::sync::Client,
3371}
3372
3373#[cfg(target_os = "fuchsia")]
3374impl fidl::endpoints::SynchronousProxy for SnapshotSynchronousProxy {
3375 type Proxy = SnapshotProxy;
3376 type Protocol = SnapshotMarker;
3377
3378 fn from_channel(inner: fidl::Channel) -> Self {
3379 Self::new(inner)
3380 }
3381
3382 fn into_channel(self) -> fidl::Channel {
3383 self.client.into_channel()
3384 }
3385
3386 fn as_channel(&self) -> &fidl::Channel {
3387 self.client.as_channel()
3388 }
3389}
3390
3391#[cfg(target_os = "fuchsia")]
3392impl SnapshotSynchronousProxy {
3393 pub fn new(channel: fidl::Channel) -> Self {
3394 let protocol_name = <SnapshotMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3395 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3396 }
3397
3398 pub fn into_channel(self) -> fidl::Channel {
3399 self.client.into_channel()
3400 }
3401
3402 pub fn wait_for_event(
3405 &self,
3406 deadline: zx::MonotonicInstant,
3407 ) -> Result<SnapshotEvent, fidl::Error> {
3408 SnapshotEvent::decode(self.client.wait_for_event(deadline)?)
3409 }
3410}
3411
3412#[cfg(target_os = "fuchsia")]
3413impl From<SnapshotSynchronousProxy> for zx::NullableHandle {
3414 fn from(value: SnapshotSynchronousProxy) -> Self {
3415 value.into_channel().into()
3416 }
3417}
3418
3419#[cfg(target_os = "fuchsia")]
3420impl From<fidl::Channel> for SnapshotSynchronousProxy {
3421 fn from(value: fidl::Channel) -> Self {
3422 Self::new(value)
3423 }
3424}
3425
3426#[cfg(target_os = "fuchsia")]
3427impl fidl::endpoints::FromClient for SnapshotSynchronousProxy {
3428 type Protocol = SnapshotMarker;
3429
3430 fn from_client(value: fidl::endpoints::ClientEnd<SnapshotMarker>) -> Self {
3431 Self::new(value.into_channel())
3432 }
3433}
3434
3435#[derive(Debug, Clone)]
3436pub struct SnapshotProxy {
3437 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3438}
3439
3440impl fidl::endpoints::Proxy for SnapshotProxy {
3441 type Protocol = SnapshotMarker;
3442
3443 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3444 Self::new(inner)
3445 }
3446
3447 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3448 self.client.into_channel().map_err(|client| Self { client })
3449 }
3450
3451 fn as_channel(&self) -> &::fidl::AsyncChannel {
3452 self.client.as_channel()
3453 }
3454}
3455
3456impl SnapshotProxy {
3457 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3459 let protocol_name = <SnapshotMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3460 Self { client: fidl::client::Client::new(channel, protocol_name) }
3461 }
3462
3463 pub fn take_event_stream(&self) -> SnapshotEventStream {
3469 SnapshotEventStream { event_receiver: self.client.take_event_receiver() }
3470 }
3471}
3472
3473impl SnapshotProxyInterface for SnapshotProxy {}
3474
3475pub struct SnapshotEventStream {
3476 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3477}
3478
3479impl std::marker::Unpin for SnapshotEventStream {}
3480
3481impl futures::stream::FusedStream for SnapshotEventStream {
3482 fn is_terminated(&self) -> bool {
3483 self.event_receiver.is_terminated()
3484 }
3485}
3486
3487impl futures::Stream for SnapshotEventStream {
3488 type Item = Result<SnapshotEvent, fidl::Error>;
3489
3490 fn poll_next(
3491 mut self: std::pin::Pin<&mut Self>,
3492 cx: &mut std::task::Context<'_>,
3493 ) -> std::task::Poll<Option<Self::Item>> {
3494 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3495 &mut self.event_receiver,
3496 cx
3497 )?) {
3498 Some(buf) => std::task::Poll::Ready(Some(SnapshotEvent::decode(buf))),
3499 None => std::task::Poll::Ready(None),
3500 }
3501 }
3502}
3503
3504#[derive(Debug)]
3505pub enum SnapshotEvent {}
3506
3507impl SnapshotEvent {
3508 fn decode(
3510 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3511 ) -> Result<SnapshotEvent, fidl::Error> {
3512 let (bytes, _handles) = buf.split_mut();
3513 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3514 debug_assert_eq!(tx_header.tx_id, 0);
3515 match tx_header.ordinal {
3516 _ => Err(fidl::Error::UnknownOrdinal {
3517 ordinal: tx_header.ordinal,
3518 protocol_name: <SnapshotMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3519 }),
3520 }
3521 }
3522}
3523
3524pub struct SnapshotRequestStream {
3526 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3527 is_terminated: bool,
3528}
3529
3530impl std::marker::Unpin for SnapshotRequestStream {}
3531
3532impl futures::stream::FusedStream for SnapshotRequestStream {
3533 fn is_terminated(&self) -> bool {
3534 self.is_terminated
3535 }
3536}
3537
3538impl fidl::endpoints::RequestStream for SnapshotRequestStream {
3539 type Protocol = SnapshotMarker;
3540 type ControlHandle = SnapshotControlHandle;
3541
3542 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3543 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3544 }
3545
3546 fn control_handle(&self) -> Self::ControlHandle {
3547 SnapshotControlHandle { inner: self.inner.clone() }
3548 }
3549
3550 fn into_inner(
3551 self,
3552 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3553 {
3554 (self.inner, self.is_terminated)
3555 }
3556
3557 fn from_inner(
3558 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3559 is_terminated: bool,
3560 ) -> Self {
3561 Self { inner, is_terminated }
3562 }
3563}
3564
3565impl futures::Stream for SnapshotRequestStream {
3566 type Item = Result<SnapshotRequest, fidl::Error>;
3567
3568 fn poll_next(
3569 mut self: std::pin::Pin<&mut Self>,
3570 cx: &mut std::task::Context<'_>,
3571 ) -> std::task::Poll<Option<Self::Item>> {
3572 let this = &mut *self;
3573 if this.inner.check_shutdown(cx) {
3574 this.is_terminated = true;
3575 return std::task::Poll::Ready(None);
3576 }
3577 if this.is_terminated {
3578 panic!("polled SnapshotRequestStream after completion");
3579 }
3580 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3581 |bytes, handles| {
3582 match this.inner.channel().read_etc(cx, bytes, handles) {
3583 std::task::Poll::Ready(Ok(())) => {}
3584 std::task::Poll::Pending => return std::task::Poll::Pending,
3585 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3586 this.is_terminated = true;
3587 return std::task::Poll::Ready(None);
3588 }
3589 std::task::Poll::Ready(Err(e)) => {
3590 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3591 e.into(),
3592 ))));
3593 }
3594 }
3595
3596 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3598
3599 std::task::Poll::Ready(Some(match header.ordinal {
3600 _ => Err(fidl::Error::UnknownOrdinal {
3601 ordinal: header.ordinal,
3602 protocol_name:
3603 <SnapshotMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3604 }),
3605 }))
3606 },
3607 )
3608 }
3609}
3610
3611#[derive(Debug)]
3613pub enum SnapshotRequest {}
3614
3615impl SnapshotRequest {
3616 pub fn method_name(&self) -> &'static str {
3618 match *self {}
3619 }
3620}
3621
3622#[derive(Debug, Clone)]
3623pub struct SnapshotControlHandle {
3624 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3625}
3626
3627impl fidl::endpoints::ControlHandle for SnapshotControlHandle {
3628 fn shutdown(&self) {
3629 self.inner.shutdown()
3630 }
3631
3632 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3633 self.inner.shutdown_with_epitaph(status)
3634 }
3635
3636 fn is_closed(&self) -> bool {
3637 self.inner.channel().is_closed()
3638 }
3639 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3640 self.inner.channel().on_closed()
3641 }
3642
3643 #[cfg(target_os = "fuchsia")]
3644 fn signal_peer(
3645 &self,
3646 clear_mask: zx::Signals,
3647 set_mask: zx::Signals,
3648 ) -> Result<(), zx_status::Status> {
3649 use fidl::Peered;
3650 self.inner.channel().signal_peer(clear_mask, set_mask)
3651 }
3652}
3653
3654impl SnapshotControlHandle {}
3655
3656mod internal {
3657 use super::*;
3658
3659 impl fidl::encoding::ResourceTypeMarker for ScenicCreateSession2Request {
3660 type Borrowed<'a> = &'a mut Self;
3661 fn take_or_borrow<'a>(
3662 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3663 ) -> Self::Borrowed<'a> {
3664 value
3665 }
3666 }
3667
3668 unsafe impl fidl::encoding::TypeMarker for ScenicCreateSession2Request {
3669 type Owned = Self;
3670
3671 #[inline(always)]
3672 fn inline_align(_context: fidl::encoding::Context) -> usize {
3673 4
3674 }
3675
3676 #[inline(always)]
3677 fn inline_size(_context: fidl::encoding::Context) -> usize {
3678 12
3679 }
3680 }
3681
3682 unsafe impl
3683 fidl::encoding::Encode<
3684 ScenicCreateSession2Request,
3685 fidl::encoding::DefaultFuchsiaResourceDialect,
3686 > for &mut ScenicCreateSession2Request
3687 {
3688 #[inline]
3689 unsafe fn encode(
3690 self,
3691 encoder: &mut fidl::encoding::Encoder<
3692 '_,
3693 fidl::encoding::DefaultFuchsiaResourceDialect,
3694 >,
3695 offset: usize,
3696 _depth: fidl::encoding::Depth,
3697 ) -> fidl::Result<()> {
3698 encoder.debug_check_bounds::<ScenicCreateSession2Request>(offset);
3699 fidl::encoding::Encode::<ScenicCreateSession2Request, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3701 (
3702 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.session),
3703 <fidl::encoding::Optional<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.listener),
3704 <fidl::encoding::Optional<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.view_focuser),
3705 ),
3706 encoder, offset, _depth
3707 )
3708 }
3709 }
3710 unsafe impl<
3711 T0: fidl::encoding::Encode<
3712 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>,
3713 fidl::encoding::DefaultFuchsiaResourceDialect,
3714 >,
3715 T1: fidl::encoding::Encode<
3716 fidl::encoding::Optional<
3717 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
3718 >,
3719 fidl::encoding::DefaultFuchsiaResourceDialect,
3720 >,
3721 T2: fidl::encoding::Encode<
3722 fidl::encoding::Optional<
3723 fidl::encoding::Endpoint<
3724 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>,
3725 >,
3726 >,
3727 fidl::encoding::DefaultFuchsiaResourceDialect,
3728 >,
3729 >
3730 fidl::encoding::Encode<
3731 ScenicCreateSession2Request,
3732 fidl::encoding::DefaultFuchsiaResourceDialect,
3733 > for (T0, T1, T2)
3734 {
3735 #[inline]
3736 unsafe fn encode(
3737 self,
3738 encoder: &mut fidl::encoding::Encoder<
3739 '_,
3740 fidl::encoding::DefaultFuchsiaResourceDialect,
3741 >,
3742 offset: usize,
3743 depth: fidl::encoding::Depth,
3744 ) -> fidl::Result<()> {
3745 encoder.debug_check_bounds::<ScenicCreateSession2Request>(offset);
3746 self.0.encode(encoder, offset + 0, depth)?;
3750 self.1.encode(encoder, offset + 4, depth)?;
3751 self.2.encode(encoder, offset + 8, depth)?;
3752 Ok(())
3753 }
3754 }
3755
3756 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3757 for ScenicCreateSession2Request
3758 {
3759 #[inline(always)]
3760 fn new_empty() -> Self {
3761 Self {
3762 session: fidl::new_empty!(
3763 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>,
3764 fidl::encoding::DefaultFuchsiaResourceDialect
3765 ),
3766 listener: fidl::new_empty!(
3767 fidl::encoding::Optional<
3768 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
3769 >,
3770 fidl::encoding::DefaultFuchsiaResourceDialect
3771 ),
3772 view_focuser: fidl::new_empty!(
3773 fidl::encoding::Optional<
3774 fidl::encoding::Endpoint<
3775 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>,
3776 >,
3777 >,
3778 fidl::encoding::DefaultFuchsiaResourceDialect
3779 ),
3780 }
3781 }
3782
3783 #[inline]
3784 unsafe fn decode(
3785 &mut self,
3786 decoder: &mut fidl::encoding::Decoder<
3787 '_,
3788 fidl::encoding::DefaultFuchsiaResourceDialect,
3789 >,
3790 offset: usize,
3791 _depth: fidl::encoding::Depth,
3792 ) -> fidl::Result<()> {
3793 decoder.debug_check_bounds::<Self>(offset);
3794 fidl::decode!(
3796 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>,
3797 fidl::encoding::DefaultFuchsiaResourceDialect,
3798 &mut self.session,
3799 decoder,
3800 offset + 0,
3801 _depth
3802 )?;
3803 fidl::decode!(
3804 fidl::encoding::Optional<
3805 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
3806 >,
3807 fidl::encoding::DefaultFuchsiaResourceDialect,
3808 &mut self.listener,
3809 decoder,
3810 offset + 4,
3811 _depth
3812 )?;
3813 fidl::decode!(
3814 fidl::encoding::Optional<
3815 fidl::encoding::Endpoint<
3816 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>,
3817 >,
3818 >,
3819 fidl::encoding::DefaultFuchsiaResourceDialect,
3820 &mut self.view_focuser,
3821 decoder,
3822 offset + 8,
3823 _depth
3824 )?;
3825 Ok(())
3826 }
3827 }
3828
3829 impl fidl::encoding::ResourceTypeMarker for ScenicCreateSessionRequest {
3830 type Borrowed<'a> = &'a mut Self;
3831 fn take_or_borrow<'a>(
3832 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3833 ) -> Self::Borrowed<'a> {
3834 value
3835 }
3836 }
3837
3838 unsafe impl fidl::encoding::TypeMarker for ScenicCreateSessionRequest {
3839 type Owned = Self;
3840
3841 #[inline(always)]
3842 fn inline_align(_context: fidl::encoding::Context) -> usize {
3843 4
3844 }
3845
3846 #[inline(always)]
3847 fn inline_size(_context: fidl::encoding::Context) -> usize {
3848 8
3849 }
3850 }
3851
3852 unsafe impl
3853 fidl::encoding::Encode<
3854 ScenicCreateSessionRequest,
3855 fidl::encoding::DefaultFuchsiaResourceDialect,
3856 > for &mut ScenicCreateSessionRequest
3857 {
3858 #[inline]
3859 unsafe fn encode(
3860 self,
3861 encoder: &mut fidl::encoding::Encoder<
3862 '_,
3863 fidl::encoding::DefaultFuchsiaResourceDialect,
3864 >,
3865 offset: usize,
3866 _depth: fidl::encoding::Depth,
3867 ) -> fidl::Result<()> {
3868 encoder.debug_check_bounds::<ScenicCreateSessionRequest>(offset);
3869 fidl::encoding::Encode::<ScenicCreateSessionRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3871 (
3872 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.session),
3873 <fidl::encoding::Optional<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.listener),
3874 ),
3875 encoder, offset, _depth
3876 )
3877 }
3878 }
3879 unsafe impl<
3880 T0: fidl::encoding::Encode<
3881 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>,
3882 fidl::encoding::DefaultFuchsiaResourceDialect,
3883 >,
3884 T1: fidl::encoding::Encode<
3885 fidl::encoding::Optional<
3886 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
3887 >,
3888 fidl::encoding::DefaultFuchsiaResourceDialect,
3889 >,
3890 >
3891 fidl::encoding::Encode<
3892 ScenicCreateSessionRequest,
3893 fidl::encoding::DefaultFuchsiaResourceDialect,
3894 > for (T0, T1)
3895 {
3896 #[inline]
3897 unsafe fn encode(
3898 self,
3899 encoder: &mut fidl::encoding::Encoder<
3900 '_,
3901 fidl::encoding::DefaultFuchsiaResourceDialect,
3902 >,
3903 offset: usize,
3904 depth: fidl::encoding::Depth,
3905 ) -> fidl::Result<()> {
3906 encoder.debug_check_bounds::<ScenicCreateSessionRequest>(offset);
3907 self.0.encode(encoder, offset + 0, depth)?;
3911 self.1.encode(encoder, offset + 4, depth)?;
3912 Ok(())
3913 }
3914 }
3915
3916 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3917 for ScenicCreateSessionRequest
3918 {
3919 #[inline(always)]
3920 fn new_empty() -> Self {
3921 Self {
3922 session: fidl::new_empty!(
3923 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>,
3924 fidl::encoding::DefaultFuchsiaResourceDialect
3925 ),
3926 listener: fidl::new_empty!(
3927 fidl::encoding::Optional<
3928 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
3929 >,
3930 fidl::encoding::DefaultFuchsiaResourceDialect
3931 ),
3932 }
3933 }
3934
3935 #[inline]
3936 unsafe fn decode(
3937 &mut self,
3938 decoder: &mut fidl::encoding::Decoder<
3939 '_,
3940 fidl::encoding::DefaultFuchsiaResourceDialect,
3941 >,
3942 offset: usize,
3943 _depth: fidl::encoding::Depth,
3944 ) -> fidl::Result<()> {
3945 decoder.debug_check_bounds::<Self>(offset);
3946 fidl::decode!(
3948 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>,
3949 fidl::encoding::DefaultFuchsiaResourceDialect,
3950 &mut self.session,
3951 decoder,
3952 offset + 0,
3953 _depth
3954 )?;
3955 fidl::decode!(
3956 fidl::encoding::Optional<
3957 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
3958 >,
3959 fidl::encoding::DefaultFuchsiaResourceDialect,
3960 &mut self.listener,
3961 decoder,
3962 offset + 4,
3963 _depth
3964 )?;
3965 Ok(())
3966 }
3967 }
3968
3969 impl fidl::encoding::ResourceTypeMarker for ScenicCreateSessionTRequest {
3970 type Borrowed<'a> = &'a mut Self;
3971 fn take_or_borrow<'a>(
3972 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3973 ) -> Self::Borrowed<'a> {
3974 value
3975 }
3976 }
3977
3978 unsafe impl fidl::encoding::TypeMarker for ScenicCreateSessionTRequest {
3979 type Owned = Self;
3980
3981 #[inline(always)]
3982 fn inline_align(_context: fidl::encoding::Context) -> usize {
3983 8
3984 }
3985
3986 #[inline(always)]
3987 fn inline_size(_context: fidl::encoding::Context) -> usize {
3988 16
3989 }
3990 }
3991
3992 unsafe impl
3993 fidl::encoding::Encode<
3994 ScenicCreateSessionTRequest,
3995 fidl::encoding::DefaultFuchsiaResourceDialect,
3996 > for &mut ScenicCreateSessionTRequest
3997 {
3998 #[inline]
3999 unsafe fn encode(
4000 self,
4001 encoder: &mut fidl::encoding::Encoder<
4002 '_,
4003 fidl::encoding::DefaultFuchsiaResourceDialect,
4004 >,
4005 offset: usize,
4006 _depth: fidl::encoding::Depth,
4007 ) -> fidl::Result<()> {
4008 encoder.debug_check_bounds::<ScenicCreateSessionTRequest>(offset);
4009 fidl::encoding::Encode::<
4011 ScenicCreateSessionTRequest,
4012 fidl::encoding::DefaultFuchsiaResourceDialect,
4013 >::encode(
4014 (<SessionEndpoints as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4015 &mut self.endpoints,
4016 ),),
4017 encoder,
4018 offset,
4019 _depth,
4020 )
4021 }
4022 }
4023 unsafe impl<
4024 T0: fidl::encoding::Encode<SessionEndpoints, fidl::encoding::DefaultFuchsiaResourceDialect>,
4025 >
4026 fidl::encoding::Encode<
4027 ScenicCreateSessionTRequest,
4028 fidl::encoding::DefaultFuchsiaResourceDialect,
4029 > for (T0,)
4030 {
4031 #[inline]
4032 unsafe fn encode(
4033 self,
4034 encoder: &mut fidl::encoding::Encoder<
4035 '_,
4036 fidl::encoding::DefaultFuchsiaResourceDialect,
4037 >,
4038 offset: usize,
4039 depth: fidl::encoding::Depth,
4040 ) -> fidl::Result<()> {
4041 encoder.debug_check_bounds::<ScenicCreateSessionTRequest>(offset);
4042 self.0.encode(encoder, offset + 0, depth)?;
4046 Ok(())
4047 }
4048 }
4049
4050 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4051 for ScenicCreateSessionTRequest
4052 {
4053 #[inline(always)]
4054 fn new_empty() -> Self {
4055 Self {
4056 endpoints: fidl::new_empty!(
4057 SessionEndpoints,
4058 fidl::encoding::DefaultFuchsiaResourceDialect
4059 ),
4060 }
4061 }
4062
4063 #[inline]
4064 unsafe fn decode(
4065 &mut self,
4066 decoder: &mut fidl::encoding::Decoder<
4067 '_,
4068 fidl::encoding::DefaultFuchsiaResourceDialect,
4069 >,
4070 offset: usize,
4071 _depth: fidl::encoding::Depth,
4072 ) -> fidl::Result<()> {
4073 decoder.debug_check_bounds::<Self>(offset);
4074 fidl::decode!(
4076 SessionEndpoints,
4077 fidl::encoding::DefaultFuchsiaResourceDialect,
4078 &mut self.endpoints,
4079 decoder,
4080 offset + 0,
4081 _depth
4082 )?;
4083 Ok(())
4084 }
4085 }
4086
4087 impl fidl::encoding::ResourceTypeMarker for ScenicGetDisplayOwnershipEventResponse {
4088 type Borrowed<'a> = &'a mut Self;
4089 fn take_or_borrow<'a>(
4090 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4091 ) -> Self::Borrowed<'a> {
4092 value
4093 }
4094 }
4095
4096 unsafe impl fidl::encoding::TypeMarker for ScenicGetDisplayOwnershipEventResponse {
4097 type Owned = Self;
4098
4099 #[inline(always)]
4100 fn inline_align(_context: fidl::encoding::Context) -> usize {
4101 4
4102 }
4103
4104 #[inline(always)]
4105 fn inline_size(_context: fidl::encoding::Context) -> usize {
4106 4
4107 }
4108 }
4109
4110 unsafe impl
4111 fidl::encoding::Encode<
4112 ScenicGetDisplayOwnershipEventResponse,
4113 fidl::encoding::DefaultFuchsiaResourceDialect,
4114 > for &mut ScenicGetDisplayOwnershipEventResponse
4115 {
4116 #[inline]
4117 unsafe fn encode(
4118 self,
4119 encoder: &mut fidl::encoding::Encoder<
4120 '_,
4121 fidl::encoding::DefaultFuchsiaResourceDialect,
4122 >,
4123 offset: usize,
4124 _depth: fidl::encoding::Depth,
4125 ) -> fidl::Result<()> {
4126 encoder.debug_check_bounds::<ScenicGetDisplayOwnershipEventResponse>(offset);
4127 fidl::encoding::Encode::<
4129 ScenicGetDisplayOwnershipEventResponse,
4130 fidl::encoding::DefaultFuchsiaResourceDialect,
4131 >::encode(
4132 (<fidl::encoding::HandleType<
4133 fidl::Event,
4134 { fidl::ObjectType::EVENT.into_raw() },
4135 2147483648,
4136 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4137 &mut self.ownership_event,
4138 ),),
4139 encoder,
4140 offset,
4141 _depth,
4142 )
4143 }
4144 }
4145 unsafe impl<
4146 T0: fidl::encoding::Encode<
4147 fidl::encoding::HandleType<
4148 fidl::Event,
4149 { fidl::ObjectType::EVENT.into_raw() },
4150 2147483648,
4151 >,
4152 fidl::encoding::DefaultFuchsiaResourceDialect,
4153 >,
4154 >
4155 fidl::encoding::Encode<
4156 ScenicGetDisplayOwnershipEventResponse,
4157 fidl::encoding::DefaultFuchsiaResourceDialect,
4158 > for (T0,)
4159 {
4160 #[inline]
4161 unsafe fn encode(
4162 self,
4163 encoder: &mut fidl::encoding::Encoder<
4164 '_,
4165 fidl::encoding::DefaultFuchsiaResourceDialect,
4166 >,
4167 offset: usize,
4168 depth: fidl::encoding::Depth,
4169 ) -> fidl::Result<()> {
4170 encoder.debug_check_bounds::<ScenicGetDisplayOwnershipEventResponse>(offset);
4171 self.0.encode(encoder, offset + 0, depth)?;
4175 Ok(())
4176 }
4177 }
4178
4179 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4180 for ScenicGetDisplayOwnershipEventResponse
4181 {
4182 #[inline(always)]
4183 fn new_empty() -> Self {
4184 Self {
4185 ownership_event: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
4186 }
4187 }
4188
4189 #[inline]
4190 unsafe fn decode(
4191 &mut self,
4192 decoder: &mut fidl::encoding::Decoder<
4193 '_,
4194 fidl::encoding::DefaultFuchsiaResourceDialect,
4195 >,
4196 offset: usize,
4197 _depth: fidl::encoding::Depth,
4198 ) -> fidl::Result<()> {
4199 decoder.debug_check_bounds::<Self>(offset);
4200 fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.ownership_event, decoder, offset + 0, _depth)?;
4202 Ok(())
4203 }
4204 }
4205
4206 impl fidl::encoding::ResourceTypeMarker for ScenicTakeScreenshotResponse {
4207 type Borrowed<'a> = &'a mut Self;
4208 fn take_or_borrow<'a>(
4209 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4210 ) -> Self::Borrowed<'a> {
4211 value
4212 }
4213 }
4214
4215 unsafe impl fidl::encoding::TypeMarker for ScenicTakeScreenshotResponse {
4216 type Owned = Self;
4217
4218 #[inline(always)]
4219 fn inline_align(_context: fidl::encoding::Context) -> usize {
4220 8
4221 }
4222
4223 #[inline(always)]
4224 fn inline_size(_context: fidl::encoding::Context) -> usize {
4225 56
4226 }
4227 }
4228
4229 unsafe impl
4230 fidl::encoding::Encode<
4231 ScenicTakeScreenshotResponse,
4232 fidl::encoding::DefaultFuchsiaResourceDialect,
4233 > for &mut ScenicTakeScreenshotResponse
4234 {
4235 #[inline]
4236 unsafe fn encode(
4237 self,
4238 encoder: &mut fidl::encoding::Encoder<
4239 '_,
4240 fidl::encoding::DefaultFuchsiaResourceDialect,
4241 >,
4242 offset: usize,
4243 _depth: fidl::encoding::Depth,
4244 ) -> fidl::Result<()> {
4245 encoder.debug_check_bounds::<ScenicTakeScreenshotResponse>(offset);
4246 fidl::encoding::Encode::<
4248 ScenicTakeScreenshotResponse,
4249 fidl::encoding::DefaultFuchsiaResourceDialect,
4250 >::encode(
4251 (
4252 <ScreenshotData as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4253 &mut self.img_data,
4254 ),
4255 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.success),
4256 ),
4257 encoder,
4258 offset,
4259 _depth,
4260 )
4261 }
4262 }
4263 unsafe impl<
4264 T0: fidl::encoding::Encode<ScreenshotData, fidl::encoding::DefaultFuchsiaResourceDialect>,
4265 T1: fidl::encoding::Encode<bool, fidl::encoding::DefaultFuchsiaResourceDialect>,
4266 >
4267 fidl::encoding::Encode<
4268 ScenicTakeScreenshotResponse,
4269 fidl::encoding::DefaultFuchsiaResourceDialect,
4270 > for (T0, T1)
4271 {
4272 #[inline]
4273 unsafe fn encode(
4274 self,
4275 encoder: &mut fidl::encoding::Encoder<
4276 '_,
4277 fidl::encoding::DefaultFuchsiaResourceDialect,
4278 >,
4279 offset: usize,
4280 depth: fidl::encoding::Depth,
4281 ) -> fidl::Result<()> {
4282 encoder.debug_check_bounds::<ScenicTakeScreenshotResponse>(offset);
4283 unsafe {
4286 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
4287 (ptr as *mut u64).write_unaligned(0);
4288 }
4289 self.0.encode(encoder, offset + 0, depth)?;
4291 self.1.encode(encoder, offset + 48, depth)?;
4292 Ok(())
4293 }
4294 }
4295
4296 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4297 for ScenicTakeScreenshotResponse
4298 {
4299 #[inline(always)]
4300 fn new_empty() -> Self {
4301 Self {
4302 img_data: fidl::new_empty!(
4303 ScreenshotData,
4304 fidl::encoding::DefaultFuchsiaResourceDialect
4305 ),
4306 success: fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect),
4307 }
4308 }
4309
4310 #[inline]
4311 unsafe fn decode(
4312 &mut self,
4313 decoder: &mut fidl::encoding::Decoder<
4314 '_,
4315 fidl::encoding::DefaultFuchsiaResourceDialect,
4316 >,
4317 offset: usize,
4318 _depth: fidl::encoding::Depth,
4319 ) -> fidl::Result<()> {
4320 decoder.debug_check_bounds::<Self>(offset);
4321 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
4323 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4324 let mask = 0xffffffffffffff00u64;
4325 let maskedval = padval & mask;
4326 if maskedval != 0 {
4327 return Err(fidl::Error::NonZeroPadding {
4328 padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
4329 });
4330 }
4331 fidl::decode!(
4332 ScreenshotData,
4333 fidl::encoding::DefaultFuchsiaResourceDialect,
4334 &mut self.img_data,
4335 decoder,
4336 offset + 0,
4337 _depth
4338 )?;
4339 fidl::decode!(
4340 bool,
4341 fidl::encoding::DefaultFuchsiaResourceDialect,
4342 &mut self.success,
4343 decoder,
4344 offset + 48,
4345 _depth
4346 )?;
4347 Ok(())
4348 }
4349 }
4350
4351 impl fidl::encoding::ResourceTypeMarker for ScreenshotData {
4352 type Borrowed<'a> = &'a mut Self;
4353 fn take_or_borrow<'a>(
4354 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4355 ) -> Self::Borrowed<'a> {
4356 value
4357 }
4358 }
4359
4360 unsafe impl fidl::encoding::TypeMarker for ScreenshotData {
4361 type Owned = Self;
4362
4363 #[inline(always)]
4364 fn inline_align(_context: fidl::encoding::Context) -> usize {
4365 8
4366 }
4367
4368 #[inline(always)]
4369 fn inline_size(_context: fidl::encoding::Context) -> usize {
4370 48
4371 }
4372 }
4373
4374 unsafe impl
4375 fidl::encoding::Encode<ScreenshotData, fidl::encoding::DefaultFuchsiaResourceDialect>
4376 for &mut ScreenshotData
4377 {
4378 #[inline]
4379 unsafe fn encode(
4380 self,
4381 encoder: &mut fidl::encoding::Encoder<
4382 '_,
4383 fidl::encoding::DefaultFuchsiaResourceDialect,
4384 >,
4385 offset: usize,
4386 _depth: fidl::encoding::Depth,
4387 ) -> fidl::Result<()> {
4388 encoder.debug_check_bounds::<ScreenshotData>(offset);
4389 fidl::encoding::Encode::<ScreenshotData, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4391 (
4392 <fidl_fuchsia_images::ImageInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
4393 <fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.data),
4394 ),
4395 encoder, offset, _depth
4396 )
4397 }
4398 }
4399 unsafe impl<
4400 T0: fidl::encoding::Encode<
4401 fidl_fuchsia_images::ImageInfo,
4402 fidl::encoding::DefaultFuchsiaResourceDialect,
4403 >,
4404 T1: fidl::encoding::Encode<
4405 fidl_fuchsia_mem::Buffer,
4406 fidl::encoding::DefaultFuchsiaResourceDialect,
4407 >,
4408 > fidl::encoding::Encode<ScreenshotData, fidl::encoding::DefaultFuchsiaResourceDialect>
4409 for (T0, T1)
4410 {
4411 #[inline]
4412 unsafe fn encode(
4413 self,
4414 encoder: &mut fidl::encoding::Encoder<
4415 '_,
4416 fidl::encoding::DefaultFuchsiaResourceDialect,
4417 >,
4418 offset: usize,
4419 depth: fidl::encoding::Depth,
4420 ) -> fidl::Result<()> {
4421 encoder.debug_check_bounds::<ScreenshotData>(offset);
4422 self.0.encode(encoder, offset + 0, depth)?;
4426 self.1.encode(encoder, offset + 32, depth)?;
4427 Ok(())
4428 }
4429 }
4430
4431 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4432 for ScreenshotData
4433 {
4434 #[inline(always)]
4435 fn new_empty() -> Self {
4436 Self {
4437 info: fidl::new_empty!(
4438 fidl_fuchsia_images::ImageInfo,
4439 fidl::encoding::DefaultFuchsiaResourceDialect
4440 ),
4441 data: fidl::new_empty!(
4442 fidl_fuchsia_mem::Buffer,
4443 fidl::encoding::DefaultFuchsiaResourceDialect
4444 ),
4445 }
4446 }
4447
4448 #[inline]
4449 unsafe fn decode(
4450 &mut self,
4451 decoder: &mut fidl::encoding::Decoder<
4452 '_,
4453 fidl::encoding::DefaultFuchsiaResourceDialect,
4454 >,
4455 offset: usize,
4456 _depth: fidl::encoding::Depth,
4457 ) -> fidl::Result<()> {
4458 decoder.debug_check_bounds::<Self>(offset);
4459 fidl::decode!(
4461 fidl_fuchsia_images::ImageInfo,
4462 fidl::encoding::DefaultFuchsiaResourceDialect,
4463 &mut self.info,
4464 decoder,
4465 offset + 0,
4466 _depth
4467 )?;
4468 fidl::decode!(
4469 fidl_fuchsia_mem::Buffer,
4470 fidl::encoding::DefaultFuchsiaResourceDialect,
4471 &mut self.data,
4472 decoder,
4473 offset + 32,
4474 _depth
4475 )?;
4476 Ok(())
4477 }
4478 }
4479
4480 impl fidl::encoding::ResourceTypeMarker for SessionEnqueueRequest {
4481 type Borrowed<'a> = &'a mut Self;
4482 fn take_or_borrow<'a>(
4483 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4484 ) -> Self::Borrowed<'a> {
4485 value
4486 }
4487 }
4488
4489 unsafe impl fidl::encoding::TypeMarker for SessionEnqueueRequest {
4490 type Owned = Self;
4491
4492 #[inline(always)]
4493 fn inline_align(_context: fidl::encoding::Context) -> usize {
4494 8
4495 }
4496
4497 #[inline(always)]
4498 fn inline_size(_context: fidl::encoding::Context) -> usize {
4499 16
4500 }
4501 }
4502
4503 unsafe impl
4504 fidl::encoding::Encode<SessionEnqueueRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
4505 for &mut SessionEnqueueRequest
4506 {
4507 #[inline]
4508 unsafe fn encode(
4509 self,
4510 encoder: &mut fidl::encoding::Encoder<
4511 '_,
4512 fidl::encoding::DefaultFuchsiaResourceDialect,
4513 >,
4514 offset: usize,
4515 _depth: fidl::encoding::Depth,
4516 ) -> fidl::Result<()> {
4517 encoder.debug_check_bounds::<SessionEnqueueRequest>(offset);
4518 fidl::encoding::Encode::<SessionEnqueueRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4520 (
4521 <fidl::encoding::UnboundedVector<Command> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.cmds),
4522 ),
4523 encoder, offset, _depth
4524 )
4525 }
4526 }
4527 unsafe impl<
4528 T0: fidl::encoding::Encode<
4529 fidl::encoding::UnboundedVector<Command>,
4530 fidl::encoding::DefaultFuchsiaResourceDialect,
4531 >,
4532 >
4533 fidl::encoding::Encode<SessionEnqueueRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
4534 for (T0,)
4535 {
4536 #[inline]
4537 unsafe fn encode(
4538 self,
4539 encoder: &mut fidl::encoding::Encoder<
4540 '_,
4541 fidl::encoding::DefaultFuchsiaResourceDialect,
4542 >,
4543 offset: usize,
4544 depth: fidl::encoding::Depth,
4545 ) -> fidl::Result<()> {
4546 encoder.debug_check_bounds::<SessionEnqueueRequest>(offset);
4547 self.0.encode(encoder, offset + 0, depth)?;
4551 Ok(())
4552 }
4553 }
4554
4555 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4556 for SessionEnqueueRequest
4557 {
4558 #[inline(always)]
4559 fn new_empty() -> Self {
4560 Self {
4561 cmds: fidl::new_empty!(
4562 fidl::encoding::UnboundedVector<Command>,
4563 fidl::encoding::DefaultFuchsiaResourceDialect
4564 ),
4565 }
4566 }
4567
4568 #[inline]
4569 unsafe fn decode(
4570 &mut self,
4571 decoder: &mut fidl::encoding::Decoder<
4572 '_,
4573 fidl::encoding::DefaultFuchsiaResourceDialect,
4574 >,
4575 offset: usize,
4576 _depth: fidl::encoding::Depth,
4577 ) -> fidl::Result<()> {
4578 decoder.debug_check_bounds::<Self>(offset);
4579 fidl::decode!(
4581 fidl::encoding::UnboundedVector<Command>,
4582 fidl::encoding::DefaultFuchsiaResourceDialect,
4583 &mut self.cmds,
4584 decoder,
4585 offset + 0,
4586 _depth
4587 )?;
4588 Ok(())
4589 }
4590 }
4591
4592 impl fidl::encoding::ResourceTypeMarker for SessionListenerOnScenicEventRequest {
4593 type Borrowed<'a> = &'a mut Self;
4594 fn take_or_borrow<'a>(
4595 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4596 ) -> Self::Borrowed<'a> {
4597 value
4598 }
4599 }
4600
4601 unsafe impl fidl::encoding::TypeMarker for SessionListenerOnScenicEventRequest {
4602 type Owned = Self;
4603
4604 #[inline(always)]
4605 fn inline_align(_context: fidl::encoding::Context) -> usize {
4606 8
4607 }
4608
4609 #[inline(always)]
4610 fn inline_size(_context: fidl::encoding::Context) -> usize {
4611 16
4612 }
4613 }
4614
4615 unsafe impl
4616 fidl::encoding::Encode<
4617 SessionListenerOnScenicEventRequest,
4618 fidl::encoding::DefaultFuchsiaResourceDialect,
4619 > for &mut SessionListenerOnScenicEventRequest
4620 {
4621 #[inline]
4622 unsafe fn encode(
4623 self,
4624 encoder: &mut fidl::encoding::Encoder<
4625 '_,
4626 fidl::encoding::DefaultFuchsiaResourceDialect,
4627 >,
4628 offset: usize,
4629 _depth: fidl::encoding::Depth,
4630 ) -> fidl::Result<()> {
4631 encoder.debug_check_bounds::<SessionListenerOnScenicEventRequest>(offset);
4632 fidl::encoding::Encode::<SessionListenerOnScenicEventRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4634 (
4635 <fidl::encoding::UnboundedVector<Event> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
4636 ),
4637 encoder, offset, _depth
4638 )
4639 }
4640 }
4641 unsafe impl<
4642 T0: fidl::encoding::Encode<
4643 fidl::encoding::UnboundedVector<Event>,
4644 fidl::encoding::DefaultFuchsiaResourceDialect,
4645 >,
4646 >
4647 fidl::encoding::Encode<
4648 SessionListenerOnScenicEventRequest,
4649 fidl::encoding::DefaultFuchsiaResourceDialect,
4650 > for (T0,)
4651 {
4652 #[inline]
4653 unsafe fn encode(
4654 self,
4655 encoder: &mut fidl::encoding::Encoder<
4656 '_,
4657 fidl::encoding::DefaultFuchsiaResourceDialect,
4658 >,
4659 offset: usize,
4660 depth: fidl::encoding::Depth,
4661 ) -> fidl::Result<()> {
4662 encoder.debug_check_bounds::<SessionListenerOnScenicEventRequest>(offset);
4663 self.0.encode(encoder, offset + 0, depth)?;
4667 Ok(())
4668 }
4669 }
4670
4671 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4672 for SessionListenerOnScenicEventRequest
4673 {
4674 #[inline(always)]
4675 fn new_empty() -> Self {
4676 Self {
4677 events: fidl::new_empty!(
4678 fidl::encoding::UnboundedVector<Event>,
4679 fidl::encoding::DefaultFuchsiaResourceDialect
4680 ),
4681 }
4682 }
4683
4684 #[inline]
4685 unsafe fn decode(
4686 &mut self,
4687 decoder: &mut fidl::encoding::Decoder<
4688 '_,
4689 fidl::encoding::DefaultFuchsiaResourceDialect,
4690 >,
4691 offset: usize,
4692 _depth: fidl::encoding::Depth,
4693 ) -> fidl::Result<()> {
4694 decoder.debug_check_bounds::<Self>(offset);
4695 fidl::decode!(
4697 fidl::encoding::UnboundedVector<Event>,
4698 fidl::encoding::DefaultFuchsiaResourceDialect,
4699 &mut self.events,
4700 decoder,
4701 offset + 0,
4702 _depth
4703 )?;
4704 Ok(())
4705 }
4706 }
4707
4708 impl fidl::encoding::ResourceTypeMarker for SessionPresent2Request {
4709 type Borrowed<'a> = &'a mut Self;
4710 fn take_or_borrow<'a>(
4711 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4712 ) -> Self::Borrowed<'a> {
4713 value
4714 }
4715 }
4716
4717 unsafe impl fidl::encoding::TypeMarker for SessionPresent2Request {
4718 type Owned = Self;
4719
4720 #[inline(always)]
4721 fn inline_align(_context: fidl::encoding::Context) -> usize {
4722 8
4723 }
4724
4725 #[inline(always)]
4726 fn inline_size(_context: fidl::encoding::Context) -> usize {
4727 16
4728 }
4729 }
4730
4731 unsafe impl
4732 fidl::encoding::Encode<
4733 SessionPresent2Request,
4734 fidl::encoding::DefaultFuchsiaResourceDialect,
4735 > for &mut SessionPresent2Request
4736 {
4737 #[inline]
4738 unsafe fn encode(
4739 self,
4740 encoder: &mut fidl::encoding::Encoder<
4741 '_,
4742 fidl::encoding::DefaultFuchsiaResourceDialect,
4743 >,
4744 offset: usize,
4745 _depth: fidl::encoding::Depth,
4746 ) -> fidl::Result<()> {
4747 encoder.debug_check_bounds::<SessionPresent2Request>(offset);
4748 fidl::encoding::Encode::<
4750 SessionPresent2Request,
4751 fidl::encoding::DefaultFuchsiaResourceDialect,
4752 >::encode(
4753 (<Present2Args as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4754 &mut self.args,
4755 ),),
4756 encoder,
4757 offset,
4758 _depth,
4759 )
4760 }
4761 }
4762 unsafe impl<
4763 T0: fidl::encoding::Encode<Present2Args, fidl::encoding::DefaultFuchsiaResourceDialect>,
4764 >
4765 fidl::encoding::Encode<
4766 SessionPresent2Request,
4767 fidl::encoding::DefaultFuchsiaResourceDialect,
4768 > for (T0,)
4769 {
4770 #[inline]
4771 unsafe fn encode(
4772 self,
4773 encoder: &mut fidl::encoding::Encoder<
4774 '_,
4775 fidl::encoding::DefaultFuchsiaResourceDialect,
4776 >,
4777 offset: usize,
4778 depth: fidl::encoding::Depth,
4779 ) -> fidl::Result<()> {
4780 encoder.debug_check_bounds::<SessionPresent2Request>(offset);
4781 self.0.encode(encoder, offset + 0, depth)?;
4785 Ok(())
4786 }
4787 }
4788
4789 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4790 for SessionPresent2Request
4791 {
4792 #[inline(always)]
4793 fn new_empty() -> Self {
4794 Self {
4795 args: fidl::new_empty!(Present2Args, fidl::encoding::DefaultFuchsiaResourceDialect),
4796 }
4797 }
4798
4799 #[inline]
4800 unsafe fn decode(
4801 &mut self,
4802 decoder: &mut fidl::encoding::Decoder<
4803 '_,
4804 fidl::encoding::DefaultFuchsiaResourceDialect,
4805 >,
4806 offset: usize,
4807 _depth: fidl::encoding::Depth,
4808 ) -> fidl::Result<()> {
4809 decoder.debug_check_bounds::<Self>(offset);
4810 fidl::decode!(
4812 Present2Args,
4813 fidl::encoding::DefaultFuchsiaResourceDialect,
4814 &mut self.args,
4815 decoder,
4816 offset + 0,
4817 _depth
4818 )?;
4819 Ok(())
4820 }
4821 }
4822
4823 impl fidl::encoding::ResourceTypeMarker for SessionPresentRequest {
4824 type Borrowed<'a> = &'a mut Self;
4825 fn take_or_borrow<'a>(
4826 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4827 ) -> Self::Borrowed<'a> {
4828 value
4829 }
4830 }
4831
4832 unsafe impl fidl::encoding::TypeMarker for SessionPresentRequest {
4833 type Owned = Self;
4834
4835 #[inline(always)]
4836 fn inline_align(_context: fidl::encoding::Context) -> usize {
4837 8
4838 }
4839
4840 #[inline(always)]
4841 fn inline_size(_context: fidl::encoding::Context) -> usize {
4842 40
4843 }
4844 }
4845
4846 unsafe impl
4847 fidl::encoding::Encode<SessionPresentRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
4848 for &mut SessionPresentRequest
4849 {
4850 #[inline]
4851 unsafe fn encode(
4852 self,
4853 encoder: &mut fidl::encoding::Encoder<
4854 '_,
4855 fidl::encoding::DefaultFuchsiaResourceDialect,
4856 >,
4857 offset: usize,
4858 _depth: fidl::encoding::Depth,
4859 ) -> fidl::Result<()> {
4860 encoder.debug_check_bounds::<SessionPresentRequest>(offset);
4861 fidl::encoding::Encode::<
4863 SessionPresentRequest,
4864 fidl::encoding::DefaultFuchsiaResourceDialect,
4865 >::encode(
4866 (
4867 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.presentation_time),
4868 <fidl::encoding::UnboundedVector<
4869 fidl::encoding::HandleType<
4870 fidl::Event,
4871 { fidl::ObjectType::EVENT.into_raw() },
4872 2147483648,
4873 >,
4874 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4875 &mut self.acquire_fences,
4876 ),
4877 <fidl::encoding::UnboundedVector<
4878 fidl::encoding::HandleType<
4879 fidl::Event,
4880 { fidl::ObjectType::EVENT.into_raw() },
4881 2147483648,
4882 >,
4883 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4884 &mut self.release_fences,
4885 ),
4886 ),
4887 encoder,
4888 offset,
4889 _depth,
4890 )
4891 }
4892 }
4893 unsafe impl<
4894 T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
4895 T1: fidl::encoding::Encode<
4896 fidl::encoding::UnboundedVector<
4897 fidl::encoding::HandleType<
4898 fidl::Event,
4899 { fidl::ObjectType::EVENT.into_raw() },
4900 2147483648,
4901 >,
4902 >,
4903 fidl::encoding::DefaultFuchsiaResourceDialect,
4904 >,
4905 T2: fidl::encoding::Encode<
4906 fidl::encoding::UnboundedVector<
4907 fidl::encoding::HandleType<
4908 fidl::Event,
4909 { fidl::ObjectType::EVENT.into_raw() },
4910 2147483648,
4911 >,
4912 >,
4913 fidl::encoding::DefaultFuchsiaResourceDialect,
4914 >,
4915 >
4916 fidl::encoding::Encode<SessionPresentRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
4917 for (T0, T1, T2)
4918 {
4919 #[inline]
4920 unsafe fn encode(
4921 self,
4922 encoder: &mut fidl::encoding::Encoder<
4923 '_,
4924 fidl::encoding::DefaultFuchsiaResourceDialect,
4925 >,
4926 offset: usize,
4927 depth: fidl::encoding::Depth,
4928 ) -> fidl::Result<()> {
4929 encoder.debug_check_bounds::<SessionPresentRequest>(offset);
4930 self.0.encode(encoder, offset + 0, depth)?;
4934 self.1.encode(encoder, offset + 8, depth)?;
4935 self.2.encode(encoder, offset + 24, depth)?;
4936 Ok(())
4937 }
4938 }
4939
4940 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4941 for SessionPresentRequest
4942 {
4943 #[inline(always)]
4944 fn new_empty() -> Self {
4945 Self {
4946 presentation_time: fidl::new_empty!(
4947 u64,
4948 fidl::encoding::DefaultFuchsiaResourceDialect
4949 ),
4950 acquire_fences: fidl::new_empty!(
4951 fidl::encoding::UnboundedVector<
4952 fidl::encoding::HandleType<
4953 fidl::Event,
4954 { fidl::ObjectType::EVENT.into_raw() },
4955 2147483648,
4956 >,
4957 >,
4958 fidl::encoding::DefaultFuchsiaResourceDialect
4959 ),
4960 release_fences: fidl::new_empty!(
4961 fidl::encoding::UnboundedVector<
4962 fidl::encoding::HandleType<
4963 fidl::Event,
4964 { fidl::ObjectType::EVENT.into_raw() },
4965 2147483648,
4966 >,
4967 >,
4968 fidl::encoding::DefaultFuchsiaResourceDialect
4969 ),
4970 }
4971 }
4972
4973 #[inline]
4974 unsafe fn decode(
4975 &mut self,
4976 decoder: &mut fidl::encoding::Decoder<
4977 '_,
4978 fidl::encoding::DefaultFuchsiaResourceDialect,
4979 >,
4980 offset: usize,
4981 _depth: fidl::encoding::Depth,
4982 ) -> fidl::Result<()> {
4983 decoder.debug_check_bounds::<Self>(offset);
4984 fidl::decode!(
4986 u64,
4987 fidl::encoding::DefaultFuchsiaResourceDialect,
4988 &mut self.presentation_time,
4989 decoder,
4990 offset + 0,
4991 _depth
4992 )?;
4993 fidl::decode!(
4994 fidl::encoding::UnboundedVector<
4995 fidl::encoding::HandleType<
4996 fidl::Event,
4997 { fidl::ObjectType::EVENT.into_raw() },
4998 2147483648,
4999 >,
5000 >,
5001 fidl::encoding::DefaultFuchsiaResourceDialect,
5002 &mut self.acquire_fences,
5003 decoder,
5004 offset + 8,
5005 _depth
5006 )?;
5007 fidl::decode!(
5008 fidl::encoding::UnboundedVector<
5009 fidl::encoding::HandleType<
5010 fidl::Event,
5011 { fidl::ObjectType::EVENT.into_raw() },
5012 2147483648,
5013 >,
5014 >,
5015 fidl::encoding::DefaultFuchsiaResourceDialect,
5016 &mut self.release_fences,
5017 decoder,
5018 offset + 24,
5019 _depth
5020 )?;
5021 Ok(())
5022 }
5023 }
5024
5025 impl fidl::encoding::ResourceTypeMarker for SessionRegisterBufferCollectionRequest {
5026 type Borrowed<'a> = &'a mut Self;
5027 fn take_or_borrow<'a>(
5028 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5029 ) -> Self::Borrowed<'a> {
5030 value
5031 }
5032 }
5033
5034 unsafe impl fidl::encoding::TypeMarker for SessionRegisterBufferCollectionRequest {
5035 type Owned = Self;
5036
5037 #[inline(always)]
5038 fn inline_align(_context: fidl::encoding::Context) -> usize {
5039 4
5040 }
5041
5042 #[inline(always)]
5043 fn inline_size(_context: fidl::encoding::Context) -> usize {
5044 8
5045 }
5046 }
5047
5048 unsafe impl
5049 fidl::encoding::Encode<
5050 SessionRegisterBufferCollectionRequest,
5051 fidl::encoding::DefaultFuchsiaResourceDialect,
5052 > for &mut SessionRegisterBufferCollectionRequest
5053 {
5054 #[inline]
5055 unsafe fn encode(
5056 self,
5057 encoder: &mut fidl::encoding::Encoder<
5058 '_,
5059 fidl::encoding::DefaultFuchsiaResourceDialect,
5060 >,
5061 offset: usize,
5062 _depth: fidl::encoding::Depth,
5063 ) -> fidl::Result<()> {
5064 encoder.debug_check_bounds::<SessionRegisterBufferCollectionRequest>(offset);
5065 fidl::encoding::Encode::<
5067 SessionRegisterBufferCollectionRequest,
5068 fidl::encoding::DefaultFuchsiaResourceDialect,
5069 >::encode(
5070 (
5071 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_id),
5072 <fidl::encoding::Endpoint<
5073 fidl::endpoints::ClientEnd<
5074 fidl_fuchsia_sysmem::BufferCollectionTokenMarker,
5075 >,
5076 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
5077 &mut self.token
5078 ),
5079 ),
5080 encoder,
5081 offset,
5082 _depth,
5083 )
5084 }
5085 }
5086 unsafe impl<
5087 T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
5088 T1: fidl::encoding::Encode<
5089 fidl::encoding::Endpoint<
5090 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
5091 >,
5092 fidl::encoding::DefaultFuchsiaResourceDialect,
5093 >,
5094 >
5095 fidl::encoding::Encode<
5096 SessionRegisterBufferCollectionRequest,
5097 fidl::encoding::DefaultFuchsiaResourceDialect,
5098 > for (T0, T1)
5099 {
5100 #[inline]
5101 unsafe fn encode(
5102 self,
5103 encoder: &mut fidl::encoding::Encoder<
5104 '_,
5105 fidl::encoding::DefaultFuchsiaResourceDialect,
5106 >,
5107 offset: usize,
5108 depth: fidl::encoding::Depth,
5109 ) -> fidl::Result<()> {
5110 encoder.debug_check_bounds::<SessionRegisterBufferCollectionRequest>(offset);
5111 self.0.encode(encoder, offset + 0, depth)?;
5115 self.1.encode(encoder, offset + 4, depth)?;
5116 Ok(())
5117 }
5118 }
5119
5120 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5121 for SessionRegisterBufferCollectionRequest
5122 {
5123 #[inline(always)]
5124 fn new_empty() -> Self {
5125 Self {
5126 buffer_id: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
5127 token: fidl::new_empty!(
5128 fidl::encoding::Endpoint<
5129 fidl::endpoints::ClientEnd<
5130 fidl_fuchsia_sysmem::BufferCollectionTokenMarker,
5131 >,
5132 >,
5133 fidl::encoding::DefaultFuchsiaResourceDialect
5134 ),
5135 }
5136 }
5137
5138 #[inline]
5139 unsafe fn decode(
5140 &mut self,
5141 decoder: &mut fidl::encoding::Decoder<
5142 '_,
5143 fidl::encoding::DefaultFuchsiaResourceDialect,
5144 >,
5145 offset: usize,
5146 _depth: fidl::encoding::Depth,
5147 ) -> fidl::Result<()> {
5148 decoder.debug_check_bounds::<Self>(offset);
5149 fidl::decode!(
5151 u32,
5152 fidl::encoding::DefaultFuchsiaResourceDialect,
5153 &mut self.buffer_id,
5154 decoder,
5155 offset + 0,
5156 _depth
5157 )?;
5158 fidl::decode!(
5159 fidl::encoding::Endpoint<
5160 fidl::endpoints::ClientEnd<fidl_fuchsia_sysmem::BufferCollectionTokenMarker>,
5161 >,
5162 fidl::encoding::DefaultFuchsiaResourceDialect,
5163 &mut self.token,
5164 decoder,
5165 offset + 4,
5166 _depth
5167 )?;
5168 Ok(())
5169 }
5170 }
5171
5172 impl Present2Args {
5173 #[inline(always)]
5174 fn max_ordinal_present(&self) -> u64 {
5175 if let Some(_) = self.requested_prediction_span {
5176 return 4;
5177 }
5178 if let Some(_) = self.release_fences {
5179 return 3;
5180 }
5181 if let Some(_) = self.acquire_fences {
5182 return 2;
5183 }
5184 if let Some(_) = self.requested_presentation_time {
5185 return 1;
5186 }
5187 0
5188 }
5189 }
5190
5191 impl fidl::encoding::ResourceTypeMarker for Present2Args {
5192 type Borrowed<'a> = &'a mut Self;
5193 fn take_or_borrow<'a>(
5194 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5195 ) -> Self::Borrowed<'a> {
5196 value
5197 }
5198 }
5199
5200 unsafe impl fidl::encoding::TypeMarker for Present2Args {
5201 type Owned = Self;
5202
5203 #[inline(always)]
5204 fn inline_align(_context: fidl::encoding::Context) -> usize {
5205 8
5206 }
5207
5208 #[inline(always)]
5209 fn inline_size(_context: fidl::encoding::Context) -> usize {
5210 16
5211 }
5212 }
5213
5214 unsafe impl fidl::encoding::Encode<Present2Args, fidl::encoding::DefaultFuchsiaResourceDialect>
5215 for &mut Present2Args
5216 {
5217 unsafe fn encode(
5218 self,
5219 encoder: &mut fidl::encoding::Encoder<
5220 '_,
5221 fidl::encoding::DefaultFuchsiaResourceDialect,
5222 >,
5223 offset: usize,
5224 mut depth: fidl::encoding::Depth,
5225 ) -> fidl::Result<()> {
5226 encoder.debug_check_bounds::<Present2Args>(offset);
5227 let max_ordinal: u64 = self.max_ordinal_present();
5229 encoder.write_num(max_ordinal, offset);
5230 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5231 if max_ordinal == 0 {
5233 return Ok(());
5234 }
5235 depth.increment()?;
5236 let envelope_size = 8;
5237 let bytes_len = max_ordinal as usize * envelope_size;
5238 #[allow(unused_variables)]
5239 let offset = encoder.out_of_line_offset(bytes_len);
5240 let mut _prev_end_offset: usize = 0;
5241 if 1 > max_ordinal {
5242 return Ok(());
5243 }
5244
5245 let cur_offset: usize = (1 - 1) * envelope_size;
5248
5249 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5251
5252 fidl::encoding::encode_in_envelope_optional::<
5257 i64,
5258 fidl::encoding::DefaultFuchsiaResourceDialect,
5259 >(
5260 self.requested_presentation_time
5261 .as_ref()
5262 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
5263 encoder,
5264 offset + cur_offset,
5265 depth,
5266 )?;
5267
5268 _prev_end_offset = cur_offset + envelope_size;
5269 if 2 > max_ordinal {
5270 return Ok(());
5271 }
5272
5273 let cur_offset: usize = (2 - 1) * envelope_size;
5276
5277 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5279
5280 fidl::encoding::encode_in_envelope_optional::<
5285 fidl::encoding::UnboundedVector<
5286 fidl::encoding::HandleType<
5287 fidl::Event,
5288 { fidl::ObjectType::EVENT.into_raw() },
5289 2147483648,
5290 >,
5291 >,
5292 fidl::encoding::DefaultFuchsiaResourceDialect,
5293 >(
5294 self.acquire_fences.as_mut().map(
5295 <fidl::encoding::UnboundedVector<
5296 fidl::encoding::HandleType<
5297 fidl::Event,
5298 { fidl::ObjectType::EVENT.into_raw() },
5299 2147483648,
5300 >,
5301 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
5302 ),
5303 encoder,
5304 offset + cur_offset,
5305 depth,
5306 )?;
5307
5308 _prev_end_offset = cur_offset + envelope_size;
5309 if 3 > max_ordinal {
5310 return Ok(());
5311 }
5312
5313 let cur_offset: usize = (3 - 1) * envelope_size;
5316
5317 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5319
5320 fidl::encoding::encode_in_envelope_optional::<
5325 fidl::encoding::UnboundedVector<
5326 fidl::encoding::HandleType<
5327 fidl::Event,
5328 { fidl::ObjectType::EVENT.into_raw() },
5329 2147483648,
5330 >,
5331 >,
5332 fidl::encoding::DefaultFuchsiaResourceDialect,
5333 >(
5334 self.release_fences.as_mut().map(
5335 <fidl::encoding::UnboundedVector<
5336 fidl::encoding::HandleType<
5337 fidl::Event,
5338 { fidl::ObjectType::EVENT.into_raw() },
5339 2147483648,
5340 >,
5341 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
5342 ),
5343 encoder,
5344 offset + cur_offset,
5345 depth,
5346 )?;
5347
5348 _prev_end_offset = cur_offset + envelope_size;
5349 if 4 > max_ordinal {
5350 return Ok(());
5351 }
5352
5353 let cur_offset: usize = (4 - 1) * envelope_size;
5356
5357 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5359
5360 fidl::encoding::encode_in_envelope_optional::<
5365 i64,
5366 fidl::encoding::DefaultFuchsiaResourceDialect,
5367 >(
5368 self.requested_prediction_span
5369 .as_ref()
5370 .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
5371 encoder,
5372 offset + cur_offset,
5373 depth,
5374 )?;
5375
5376 _prev_end_offset = cur_offset + envelope_size;
5377
5378 Ok(())
5379 }
5380 }
5381
5382 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Present2Args {
5383 #[inline(always)]
5384 fn new_empty() -> Self {
5385 Self::default()
5386 }
5387
5388 unsafe fn decode(
5389 &mut self,
5390 decoder: &mut fidl::encoding::Decoder<
5391 '_,
5392 fidl::encoding::DefaultFuchsiaResourceDialect,
5393 >,
5394 offset: usize,
5395 mut depth: fidl::encoding::Depth,
5396 ) -> fidl::Result<()> {
5397 decoder.debug_check_bounds::<Self>(offset);
5398 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5399 None => return Err(fidl::Error::NotNullable),
5400 Some(len) => len,
5401 };
5402 if len == 0 {
5404 return Ok(());
5405 };
5406 depth.increment()?;
5407 let envelope_size = 8;
5408 let bytes_len = len * envelope_size;
5409 let offset = decoder.out_of_line_offset(bytes_len)?;
5410 let mut _next_ordinal_to_read = 0;
5412 let mut next_offset = offset;
5413 let end_offset = offset + bytes_len;
5414 _next_ordinal_to_read += 1;
5415 if next_offset >= end_offset {
5416 return Ok(());
5417 }
5418
5419 while _next_ordinal_to_read < 1 {
5421 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5422 _next_ordinal_to_read += 1;
5423 next_offset += envelope_size;
5424 }
5425
5426 let next_out_of_line = decoder.next_out_of_line();
5427 let handles_before = decoder.remaining_handles();
5428 if let Some((inlined, num_bytes, num_handles)) =
5429 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5430 {
5431 let member_inline_size =
5432 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5433 if inlined != (member_inline_size <= 4) {
5434 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5435 }
5436 let inner_offset;
5437 let mut inner_depth = depth.clone();
5438 if inlined {
5439 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5440 inner_offset = next_offset;
5441 } else {
5442 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5443 inner_depth.increment()?;
5444 }
5445 let val_ref = self.requested_presentation_time.get_or_insert_with(|| {
5446 fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
5447 });
5448 fidl::decode!(
5449 i64,
5450 fidl::encoding::DefaultFuchsiaResourceDialect,
5451 val_ref,
5452 decoder,
5453 inner_offset,
5454 inner_depth
5455 )?;
5456 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5457 {
5458 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5459 }
5460 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5461 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5462 }
5463 }
5464
5465 next_offset += envelope_size;
5466 _next_ordinal_to_read += 1;
5467 if next_offset >= end_offset {
5468 return Ok(());
5469 }
5470
5471 while _next_ordinal_to_read < 2 {
5473 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5474 _next_ordinal_to_read += 1;
5475 next_offset += envelope_size;
5476 }
5477
5478 let next_out_of_line = decoder.next_out_of_line();
5479 let handles_before = decoder.remaining_handles();
5480 if let Some((inlined, num_bytes, num_handles)) =
5481 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5482 {
5483 let member_inline_size = <fidl::encoding::UnboundedVector<
5484 fidl::encoding::HandleType<
5485 fidl::Event,
5486 { fidl::ObjectType::EVENT.into_raw() },
5487 2147483648,
5488 >,
5489 > as fidl::encoding::TypeMarker>::inline_size(
5490 decoder.context
5491 );
5492 if inlined != (member_inline_size <= 4) {
5493 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5494 }
5495 let inner_offset;
5496 let mut inner_depth = depth.clone();
5497 if inlined {
5498 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5499 inner_offset = next_offset;
5500 } else {
5501 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5502 inner_depth.increment()?;
5503 }
5504 let val_ref = self.acquire_fences.get_or_insert_with(|| {
5505 fidl::new_empty!(
5506 fidl::encoding::UnboundedVector<
5507 fidl::encoding::HandleType<
5508 fidl::Event,
5509 { fidl::ObjectType::EVENT.into_raw() },
5510 2147483648,
5511 >,
5512 >,
5513 fidl::encoding::DefaultFuchsiaResourceDialect
5514 )
5515 });
5516 fidl::decode!(
5517 fidl::encoding::UnboundedVector<
5518 fidl::encoding::HandleType<
5519 fidl::Event,
5520 { fidl::ObjectType::EVENT.into_raw() },
5521 2147483648,
5522 >,
5523 >,
5524 fidl::encoding::DefaultFuchsiaResourceDialect,
5525 val_ref,
5526 decoder,
5527 inner_offset,
5528 inner_depth
5529 )?;
5530 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5531 {
5532 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5533 }
5534 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5535 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5536 }
5537 }
5538
5539 next_offset += envelope_size;
5540 _next_ordinal_to_read += 1;
5541 if next_offset >= end_offset {
5542 return Ok(());
5543 }
5544
5545 while _next_ordinal_to_read < 3 {
5547 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5548 _next_ordinal_to_read += 1;
5549 next_offset += envelope_size;
5550 }
5551
5552 let next_out_of_line = decoder.next_out_of_line();
5553 let handles_before = decoder.remaining_handles();
5554 if let Some((inlined, num_bytes, num_handles)) =
5555 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5556 {
5557 let member_inline_size = <fidl::encoding::UnboundedVector<
5558 fidl::encoding::HandleType<
5559 fidl::Event,
5560 { fidl::ObjectType::EVENT.into_raw() },
5561 2147483648,
5562 >,
5563 > as fidl::encoding::TypeMarker>::inline_size(
5564 decoder.context
5565 );
5566 if inlined != (member_inline_size <= 4) {
5567 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5568 }
5569 let inner_offset;
5570 let mut inner_depth = depth.clone();
5571 if inlined {
5572 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5573 inner_offset = next_offset;
5574 } else {
5575 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5576 inner_depth.increment()?;
5577 }
5578 let val_ref = self.release_fences.get_or_insert_with(|| {
5579 fidl::new_empty!(
5580 fidl::encoding::UnboundedVector<
5581 fidl::encoding::HandleType<
5582 fidl::Event,
5583 { fidl::ObjectType::EVENT.into_raw() },
5584 2147483648,
5585 >,
5586 >,
5587 fidl::encoding::DefaultFuchsiaResourceDialect
5588 )
5589 });
5590 fidl::decode!(
5591 fidl::encoding::UnboundedVector<
5592 fidl::encoding::HandleType<
5593 fidl::Event,
5594 { fidl::ObjectType::EVENT.into_raw() },
5595 2147483648,
5596 >,
5597 >,
5598 fidl::encoding::DefaultFuchsiaResourceDialect,
5599 val_ref,
5600 decoder,
5601 inner_offset,
5602 inner_depth
5603 )?;
5604 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5605 {
5606 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5607 }
5608 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5609 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5610 }
5611 }
5612
5613 next_offset += envelope_size;
5614 _next_ordinal_to_read += 1;
5615 if next_offset >= end_offset {
5616 return Ok(());
5617 }
5618
5619 while _next_ordinal_to_read < 4 {
5621 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5622 _next_ordinal_to_read += 1;
5623 next_offset += envelope_size;
5624 }
5625
5626 let next_out_of_line = decoder.next_out_of_line();
5627 let handles_before = decoder.remaining_handles();
5628 if let Some((inlined, num_bytes, num_handles)) =
5629 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5630 {
5631 let member_inline_size =
5632 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5633 if inlined != (member_inline_size <= 4) {
5634 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5635 }
5636 let inner_offset;
5637 let mut inner_depth = depth.clone();
5638 if inlined {
5639 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5640 inner_offset = next_offset;
5641 } else {
5642 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5643 inner_depth.increment()?;
5644 }
5645 let val_ref = self.requested_prediction_span.get_or_insert_with(|| {
5646 fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect)
5647 });
5648 fidl::decode!(
5649 i64,
5650 fidl::encoding::DefaultFuchsiaResourceDialect,
5651 val_ref,
5652 decoder,
5653 inner_offset,
5654 inner_depth
5655 )?;
5656 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5657 {
5658 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5659 }
5660 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5661 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5662 }
5663 }
5664
5665 next_offset += envelope_size;
5666
5667 while next_offset < end_offset {
5669 _next_ordinal_to_read += 1;
5670 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5671 next_offset += envelope_size;
5672 }
5673
5674 Ok(())
5675 }
5676 }
5677
5678 impl SessionEndpoints {
5679 #[inline(always)]
5680 fn max_ordinal_present(&self) -> u64 {
5681 if let Some(_) = self.mouse_source {
5682 return 6;
5683 }
5684 if let Some(_) = self.touch_source {
5685 return 5;
5686 }
5687 if let Some(_) = self.view_ref_focused {
5688 return 4;
5689 }
5690 if let Some(_) = self.view_focuser {
5691 return 3;
5692 }
5693 if let Some(_) = self.session_listener {
5694 return 2;
5695 }
5696 if let Some(_) = self.session {
5697 return 1;
5698 }
5699 0
5700 }
5701 }
5702
5703 impl fidl::encoding::ResourceTypeMarker for SessionEndpoints {
5704 type Borrowed<'a> = &'a mut Self;
5705 fn take_or_borrow<'a>(
5706 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5707 ) -> Self::Borrowed<'a> {
5708 value
5709 }
5710 }
5711
5712 unsafe impl fidl::encoding::TypeMarker for SessionEndpoints {
5713 type Owned = Self;
5714
5715 #[inline(always)]
5716 fn inline_align(_context: fidl::encoding::Context) -> usize {
5717 8
5718 }
5719
5720 #[inline(always)]
5721 fn inline_size(_context: fidl::encoding::Context) -> usize {
5722 16
5723 }
5724 }
5725
5726 unsafe impl
5727 fidl::encoding::Encode<SessionEndpoints, fidl::encoding::DefaultFuchsiaResourceDialect>
5728 for &mut SessionEndpoints
5729 {
5730 unsafe fn encode(
5731 self,
5732 encoder: &mut fidl::encoding::Encoder<
5733 '_,
5734 fidl::encoding::DefaultFuchsiaResourceDialect,
5735 >,
5736 offset: usize,
5737 mut depth: fidl::encoding::Depth,
5738 ) -> fidl::Result<()> {
5739 encoder.debug_check_bounds::<SessionEndpoints>(offset);
5740 let max_ordinal: u64 = self.max_ordinal_present();
5742 encoder.write_num(max_ordinal, offset);
5743 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5744 if max_ordinal == 0 {
5746 return Ok(());
5747 }
5748 depth.increment()?;
5749 let envelope_size = 8;
5750 let bytes_len = max_ordinal as usize * envelope_size;
5751 #[allow(unused_variables)]
5752 let offset = encoder.out_of_line_offset(bytes_len);
5753 let mut _prev_end_offset: usize = 0;
5754 if 1 > max_ordinal {
5755 return Ok(());
5756 }
5757
5758 let cur_offset: usize = (1 - 1) * envelope_size;
5761
5762 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5764
5765 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
5770 self.session.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
5771 encoder, offset + cur_offset, depth
5772 )?;
5773
5774 _prev_end_offset = cur_offset + envelope_size;
5775 if 2 > max_ordinal {
5776 return Ok(());
5777 }
5778
5779 let cur_offset: usize = (2 - 1) * envelope_size;
5782
5783 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5785
5786 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
5791 self.session_listener.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
5792 encoder, offset + cur_offset, depth
5793 )?;
5794
5795 _prev_end_offset = cur_offset + envelope_size;
5796 if 3 > max_ordinal {
5797 return Ok(());
5798 }
5799
5800 let cur_offset: usize = (3 - 1) * envelope_size;
5803
5804 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5806
5807 fidl::encoding::encode_in_envelope_optional::<
5812 fidl::encoding::Endpoint<
5813 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>,
5814 >,
5815 fidl::encoding::DefaultFuchsiaResourceDialect,
5816 >(
5817 self.view_focuser.as_mut().map(
5818 <fidl::encoding::Endpoint<
5819 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>,
5820 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
5821 ),
5822 encoder,
5823 offset + cur_offset,
5824 depth,
5825 )?;
5826
5827 _prev_end_offset = cur_offset + envelope_size;
5828 if 4 > max_ordinal {
5829 return Ok(());
5830 }
5831
5832 let cur_offset: usize = (4 - 1) * envelope_size;
5835
5836 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5838
5839 fidl::encoding::encode_in_envelope_optional::<
5844 fidl::encoding::Endpoint<
5845 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::ViewRefFocusedMarker>,
5846 >,
5847 fidl::encoding::DefaultFuchsiaResourceDialect,
5848 >(
5849 self.view_ref_focused.as_mut().map(
5850 <fidl::encoding::Endpoint<
5851 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::ViewRefFocusedMarker>,
5852 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
5853 ),
5854 encoder,
5855 offset + cur_offset,
5856 depth,
5857 )?;
5858
5859 _prev_end_offset = cur_offset + envelope_size;
5860 if 5 > max_ordinal {
5861 return Ok(());
5862 }
5863
5864 let cur_offset: usize = (5 - 1) * envelope_size;
5867
5868 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5870
5871 fidl::encoding::encode_in_envelope_optional::<
5876 fidl::encoding::Endpoint<
5877 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
5878 >,
5879 fidl::encoding::DefaultFuchsiaResourceDialect,
5880 >(
5881 self.touch_source.as_mut().map(
5882 <fidl::encoding::Endpoint<
5883 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
5884 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
5885 ),
5886 encoder,
5887 offset + cur_offset,
5888 depth,
5889 )?;
5890
5891 _prev_end_offset = cur_offset + envelope_size;
5892 if 6 > max_ordinal {
5893 return Ok(());
5894 }
5895
5896 let cur_offset: usize = (6 - 1) * envelope_size;
5899
5900 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5902
5903 fidl::encoding::encode_in_envelope_optional::<
5908 fidl::encoding::Endpoint<
5909 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::MouseSourceMarker>,
5910 >,
5911 fidl::encoding::DefaultFuchsiaResourceDialect,
5912 >(
5913 self.mouse_source.as_mut().map(
5914 <fidl::encoding::Endpoint<
5915 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::MouseSourceMarker>,
5916 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
5917 ),
5918 encoder,
5919 offset + cur_offset,
5920 depth,
5921 )?;
5922
5923 _prev_end_offset = cur_offset + envelope_size;
5924
5925 Ok(())
5926 }
5927 }
5928
5929 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5930 for SessionEndpoints
5931 {
5932 #[inline(always)]
5933 fn new_empty() -> Self {
5934 Self::default()
5935 }
5936
5937 unsafe fn decode(
5938 &mut self,
5939 decoder: &mut fidl::encoding::Decoder<
5940 '_,
5941 fidl::encoding::DefaultFuchsiaResourceDialect,
5942 >,
5943 offset: usize,
5944 mut depth: fidl::encoding::Depth,
5945 ) -> fidl::Result<()> {
5946 decoder.debug_check_bounds::<Self>(offset);
5947 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5948 None => return Err(fidl::Error::NotNullable),
5949 Some(len) => len,
5950 };
5951 if len == 0 {
5953 return Ok(());
5954 };
5955 depth.increment()?;
5956 let envelope_size = 8;
5957 let bytes_len = len * envelope_size;
5958 let offset = decoder.out_of_line_offset(bytes_len)?;
5959 let mut _next_ordinal_to_read = 0;
5961 let mut next_offset = offset;
5962 let end_offset = offset + bytes_len;
5963 _next_ordinal_to_read += 1;
5964 if next_offset >= end_offset {
5965 return Ok(());
5966 }
5967
5968 while _next_ordinal_to_read < 1 {
5970 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5971 _next_ordinal_to_read += 1;
5972 next_offset += envelope_size;
5973 }
5974
5975 let next_out_of_line = decoder.next_out_of_line();
5976 let handles_before = decoder.remaining_handles();
5977 if let Some((inlined, num_bytes, num_handles)) =
5978 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5979 {
5980 let member_inline_size = <fidl::encoding::Endpoint<
5981 fidl::endpoints::ServerEnd<SessionMarker>,
5982 > as fidl::encoding::TypeMarker>::inline_size(
5983 decoder.context
5984 );
5985 if inlined != (member_inline_size <= 4) {
5986 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5987 }
5988 let inner_offset;
5989 let mut inner_depth = depth.clone();
5990 if inlined {
5991 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5992 inner_offset = next_offset;
5993 } else {
5994 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5995 inner_depth.increment()?;
5996 }
5997 let val_ref = self.session.get_or_insert_with(|| {
5998 fidl::new_empty!(
5999 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>,
6000 fidl::encoding::DefaultFuchsiaResourceDialect
6001 )
6002 });
6003 fidl::decode!(
6004 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<SessionMarker>>,
6005 fidl::encoding::DefaultFuchsiaResourceDialect,
6006 val_ref,
6007 decoder,
6008 inner_offset,
6009 inner_depth
6010 )?;
6011 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6012 {
6013 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6014 }
6015 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6016 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6017 }
6018 }
6019
6020 next_offset += envelope_size;
6021 _next_ordinal_to_read += 1;
6022 if next_offset >= end_offset {
6023 return Ok(());
6024 }
6025
6026 while _next_ordinal_to_read < 2 {
6028 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6029 _next_ordinal_to_read += 1;
6030 next_offset += envelope_size;
6031 }
6032
6033 let next_out_of_line = decoder.next_out_of_line();
6034 let handles_before = decoder.remaining_handles();
6035 if let Some((inlined, num_bytes, num_handles)) =
6036 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6037 {
6038 let member_inline_size = <fidl::encoding::Endpoint<
6039 fidl::endpoints::ClientEnd<SessionListenerMarker>,
6040 > as fidl::encoding::TypeMarker>::inline_size(
6041 decoder.context
6042 );
6043 if inlined != (member_inline_size <= 4) {
6044 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6045 }
6046 let inner_offset;
6047 let mut inner_depth = depth.clone();
6048 if inlined {
6049 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6050 inner_offset = next_offset;
6051 } else {
6052 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6053 inner_depth.increment()?;
6054 }
6055 let val_ref = self.session_listener.get_or_insert_with(|| {
6056 fidl::new_empty!(
6057 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
6058 fidl::encoding::DefaultFuchsiaResourceDialect
6059 )
6060 });
6061 fidl::decode!(
6062 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<SessionListenerMarker>>,
6063 fidl::encoding::DefaultFuchsiaResourceDialect,
6064 val_ref,
6065 decoder,
6066 inner_offset,
6067 inner_depth
6068 )?;
6069 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6070 {
6071 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6072 }
6073 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6074 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6075 }
6076 }
6077
6078 next_offset += envelope_size;
6079 _next_ordinal_to_read += 1;
6080 if next_offset >= end_offset {
6081 return Ok(());
6082 }
6083
6084 while _next_ordinal_to_read < 3 {
6086 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6087 _next_ordinal_to_read += 1;
6088 next_offset += envelope_size;
6089 }
6090
6091 let next_out_of_line = decoder.next_out_of_line();
6092 let handles_before = decoder.remaining_handles();
6093 if let Some((inlined, num_bytes, num_handles)) =
6094 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6095 {
6096 let member_inline_size = <fidl::encoding::Endpoint<
6097 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>,
6098 > as fidl::encoding::TypeMarker>::inline_size(
6099 decoder.context
6100 );
6101 if inlined != (member_inline_size <= 4) {
6102 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6103 }
6104 let inner_offset;
6105 let mut inner_depth = depth.clone();
6106 if inlined {
6107 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6108 inner_offset = next_offset;
6109 } else {
6110 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6111 inner_depth.increment()?;
6112 }
6113 let val_ref = self.view_focuser.get_or_insert_with(|| {
6114 fidl::new_empty!(
6115 fidl::encoding::Endpoint<
6116 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>,
6117 >,
6118 fidl::encoding::DefaultFuchsiaResourceDialect
6119 )
6120 });
6121 fidl::decode!(
6122 fidl::encoding::Endpoint<
6123 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::FocuserMarker>,
6124 >,
6125 fidl::encoding::DefaultFuchsiaResourceDialect,
6126 val_ref,
6127 decoder,
6128 inner_offset,
6129 inner_depth
6130 )?;
6131 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6132 {
6133 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6134 }
6135 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6136 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6137 }
6138 }
6139
6140 next_offset += envelope_size;
6141 _next_ordinal_to_read += 1;
6142 if next_offset >= end_offset {
6143 return Ok(());
6144 }
6145
6146 while _next_ordinal_to_read < 4 {
6148 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6149 _next_ordinal_to_read += 1;
6150 next_offset += envelope_size;
6151 }
6152
6153 let next_out_of_line = decoder.next_out_of_line();
6154 let handles_before = decoder.remaining_handles();
6155 if let Some((inlined, num_bytes, num_handles)) =
6156 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6157 {
6158 let member_inline_size = <fidl::encoding::Endpoint<
6159 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::ViewRefFocusedMarker>,
6160 > as fidl::encoding::TypeMarker>::inline_size(
6161 decoder.context
6162 );
6163 if inlined != (member_inline_size <= 4) {
6164 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6165 }
6166 let inner_offset;
6167 let mut inner_depth = depth.clone();
6168 if inlined {
6169 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6170 inner_offset = next_offset;
6171 } else {
6172 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6173 inner_depth.increment()?;
6174 }
6175 let val_ref = self.view_ref_focused.get_or_insert_with(|| {
6176 fidl::new_empty!(
6177 fidl::encoding::Endpoint<
6178 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::ViewRefFocusedMarker>,
6179 >,
6180 fidl::encoding::DefaultFuchsiaResourceDialect
6181 )
6182 });
6183 fidl::decode!(
6184 fidl::encoding::Endpoint<
6185 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_views::ViewRefFocusedMarker>,
6186 >,
6187 fidl::encoding::DefaultFuchsiaResourceDialect,
6188 val_ref,
6189 decoder,
6190 inner_offset,
6191 inner_depth
6192 )?;
6193 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6194 {
6195 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6196 }
6197 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6198 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6199 }
6200 }
6201
6202 next_offset += envelope_size;
6203 _next_ordinal_to_read += 1;
6204 if next_offset >= end_offset {
6205 return Ok(());
6206 }
6207
6208 while _next_ordinal_to_read < 5 {
6210 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6211 _next_ordinal_to_read += 1;
6212 next_offset += envelope_size;
6213 }
6214
6215 let next_out_of_line = decoder.next_out_of_line();
6216 let handles_before = decoder.remaining_handles();
6217 if let Some((inlined, num_bytes, num_handles)) =
6218 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6219 {
6220 let member_inline_size = <fidl::encoding::Endpoint<
6221 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
6222 > as fidl::encoding::TypeMarker>::inline_size(
6223 decoder.context
6224 );
6225 if inlined != (member_inline_size <= 4) {
6226 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6227 }
6228 let inner_offset;
6229 let mut inner_depth = depth.clone();
6230 if inlined {
6231 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6232 inner_offset = next_offset;
6233 } else {
6234 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6235 inner_depth.increment()?;
6236 }
6237 let val_ref = self.touch_source.get_or_insert_with(|| {
6238 fidl::new_empty!(
6239 fidl::encoding::Endpoint<
6240 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
6241 >,
6242 fidl::encoding::DefaultFuchsiaResourceDialect
6243 )
6244 });
6245 fidl::decode!(
6246 fidl::encoding::Endpoint<
6247 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::TouchSourceMarker>,
6248 >,
6249 fidl::encoding::DefaultFuchsiaResourceDialect,
6250 val_ref,
6251 decoder,
6252 inner_offset,
6253 inner_depth
6254 )?;
6255 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6256 {
6257 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6258 }
6259 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6260 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6261 }
6262 }
6263
6264 next_offset += envelope_size;
6265 _next_ordinal_to_read += 1;
6266 if next_offset >= end_offset {
6267 return Ok(());
6268 }
6269
6270 while _next_ordinal_to_read < 6 {
6272 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6273 _next_ordinal_to_read += 1;
6274 next_offset += envelope_size;
6275 }
6276
6277 let next_out_of_line = decoder.next_out_of_line();
6278 let handles_before = decoder.remaining_handles();
6279 if let Some((inlined, num_bytes, num_handles)) =
6280 fidl::encoding::decode_envelope_header(decoder, next_offset)?
6281 {
6282 let member_inline_size = <fidl::encoding::Endpoint<
6283 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::MouseSourceMarker>,
6284 > as fidl::encoding::TypeMarker>::inline_size(
6285 decoder.context
6286 );
6287 if inlined != (member_inline_size <= 4) {
6288 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6289 }
6290 let inner_offset;
6291 let mut inner_depth = depth.clone();
6292 if inlined {
6293 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6294 inner_offset = next_offset;
6295 } else {
6296 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6297 inner_depth.increment()?;
6298 }
6299 let val_ref = self.mouse_source.get_or_insert_with(|| {
6300 fidl::new_empty!(
6301 fidl::encoding::Endpoint<
6302 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::MouseSourceMarker>,
6303 >,
6304 fidl::encoding::DefaultFuchsiaResourceDialect
6305 )
6306 });
6307 fidl::decode!(
6308 fidl::encoding::Endpoint<
6309 fidl::endpoints::ServerEnd<fidl_fuchsia_ui_pointer::MouseSourceMarker>,
6310 >,
6311 fidl::encoding::DefaultFuchsiaResourceDialect,
6312 val_ref,
6313 decoder,
6314 inner_offset,
6315 inner_depth
6316 )?;
6317 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6318 {
6319 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6320 }
6321 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6322 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6323 }
6324 }
6325
6326 next_offset += envelope_size;
6327
6328 while next_offset < end_offset {
6330 _next_ordinal_to_read += 1;
6331 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6332 next_offset += envelope_size;
6333 }
6334
6335 Ok(())
6336 }
6337 }
6338
6339 impl fidl::encoding::ResourceTypeMarker for Command {
6340 type Borrowed<'a> = &'a mut Self;
6341 fn take_or_borrow<'a>(
6342 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6343 ) -> Self::Borrowed<'a> {
6344 value
6345 }
6346 }
6347
6348 unsafe impl fidl::encoding::TypeMarker for Command {
6349 type Owned = Self;
6350
6351 #[inline(always)]
6352 fn inline_align(_context: fidl::encoding::Context) -> usize {
6353 8
6354 }
6355
6356 #[inline(always)]
6357 fn inline_size(_context: fidl::encoding::Context) -> usize {
6358 16
6359 }
6360 }
6361
6362 unsafe impl fidl::encoding::Encode<Command, fidl::encoding::DefaultFuchsiaResourceDialect>
6363 for &mut Command
6364 {
6365 #[inline]
6366 unsafe fn encode(
6367 self,
6368 encoder: &mut fidl::encoding::Encoder<
6369 '_,
6370 fidl::encoding::DefaultFuchsiaResourceDialect,
6371 >,
6372 offset: usize,
6373 _depth: fidl::encoding::Depth,
6374 ) -> fidl::Result<()> {
6375 encoder.debug_check_bounds::<Command>(offset);
6376 encoder.write_num::<u64>(self.ordinal(), offset);
6377 match self {
6378 Command::Gfx(ref mut val) => {
6379 fidl::encoding::encode_in_envelope::<fidl_fuchsia_ui_gfx::Command, fidl::encoding::DefaultFuchsiaResourceDialect>(
6380 <fidl_fuchsia_ui_gfx::Command as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
6381 encoder, offset + 8, _depth
6382 )
6383 }
6384 Command::Views(ref val) => {
6385 fidl::encoding::encode_in_envelope::<fidl_fuchsia_ui_views::Command, fidl::encoding::DefaultFuchsiaResourceDialect>(
6386 <fidl_fuchsia_ui_views::Command as fidl::encoding::ValueTypeMarker>::borrow(val),
6387 encoder, offset + 8, _depth
6388 )
6389 }
6390 Command::Input(ref val) => {
6391 fidl::encoding::encode_in_envelope::<fidl_fuchsia_ui_input::Command, fidl::encoding::DefaultFuchsiaResourceDialect>(
6392 <fidl_fuchsia_ui_input::Command as fidl::encoding::ValueTypeMarker>::borrow(val),
6393 encoder, offset + 8, _depth
6394 )
6395 }
6396 }
6397 }
6398 }
6399
6400 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Command {
6401 #[inline(always)]
6402 fn new_empty() -> Self {
6403 Self::Gfx(fidl::new_empty!(
6404 fidl_fuchsia_ui_gfx::Command,
6405 fidl::encoding::DefaultFuchsiaResourceDialect
6406 ))
6407 }
6408
6409 #[inline]
6410 unsafe fn decode(
6411 &mut self,
6412 decoder: &mut fidl::encoding::Decoder<
6413 '_,
6414 fidl::encoding::DefaultFuchsiaResourceDialect,
6415 >,
6416 offset: usize,
6417 mut depth: fidl::encoding::Depth,
6418 ) -> fidl::Result<()> {
6419 decoder.debug_check_bounds::<Self>(offset);
6420 #[allow(unused_variables)]
6421 let next_out_of_line = decoder.next_out_of_line();
6422 let handles_before = decoder.remaining_handles();
6423 let (ordinal, inlined, num_bytes, num_handles) =
6424 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
6425
6426 let member_inline_size = match ordinal {
6427 1 => <fidl_fuchsia_ui_gfx::Command as fidl::encoding::TypeMarker>::inline_size(
6428 decoder.context,
6429 ),
6430 3 => <fidl_fuchsia_ui_views::Command as fidl::encoding::TypeMarker>::inline_size(
6431 decoder.context,
6432 ),
6433 4 => <fidl_fuchsia_ui_input::Command as fidl::encoding::TypeMarker>::inline_size(
6434 decoder.context,
6435 ),
6436 _ => return Err(fidl::Error::UnknownUnionTag),
6437 };
6438
6439 if inlined != (member_inline_size <= 4) {
6440 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6441 }
6442 let _inner_offset;
6443 if inlined {
6444 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
6445 _inner_offset = offset + 8;
6446 } else {
6447 depth.increment()?;
6448 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6449 }
6450 match ordinal {
6451 1 => {
6452 #[allow(irrefutable_let_patterns)]
6453 if let Command::Gfx(_) = self {
6454 } else {
6456 *self = Command::Gfx(fidl::new_empty!(
6458 fidl_fuchsia_ui_gfx::Command,
6459 fidl::encoding::DefaultFuchsiaResourceDialect
6460 ));
6461 }
6462 #[allow(irrefutable_let_patterns)]
6463 if let Command::Gfx(ref mut val) = self {
6464 fidl::decode!(
6465 fidl_fuchsia_ui_gfx::Command,
6466 fidl::encoding::DefaultFuchsiaResourceDialect,
6467 val,
6468 decoder,
6469 _inner_offset,
6470 depth
6471 )?;
6472 } else {
6473 unreachable!()
6474 }
6475 }
6476 3 => {
6477 #[allow(irrefutable_let_patterns)]
6478 if let Command::Views(_) = self {
6479 } else {
6481 *self = Command::Views(fidl::new_empty!(
6483 fidl_fuchsia_ui_views::Command,
6484 fidl::encoding::DefaultFuchsiaResourceDialect
6485 ));
6486 }
6487 #[allow(irrefutable_let_patterns)]
6488 if let Command::Views(ref mut val) = self {
6489 fidl::decode!(
6490 fidl_fuchsia_ui_views::Command,
6491 fidl::encoding::DefaultFuchsiaResourceDialect,
6492 val,
6493 decoder,
6494 _inner_offset,
6495 depth
6496 )?;
6497 } else {
6498 unreachable!()
6499 }
6500 }
6501 4 => {
6502 #[allow(irrefutable_let_patterns)]
6503 if let Command::Input(_) = self {
6504 } else {
6506 *self = Command::Input(fidl::new_empty!(
6508 fidl_fuchsia_ui_input::Command,
6509 fidl::encoding::DefaultFuchsiaResourceDialect
6510 ));
6511 }
6512 #[allow(irrefutable_let_patterns)]
6513 if let Command::Input(ref mut val) = self {
6514 fidl::decode!(
6515 fidl_fuchsia_ui_input::Command,
6516 fidl::encoding::DefaultFuchsiaResourceDialect,
6517 val,
6518 decoder,
6519 _inner_offset,
6520 depth
6521 )?;
6522 } else {
6523 unreachable!()
6524 }
6525 }
6526 ordinal => panic!("unexpected ordinal {:?}", ordinal),
6527 }
6528 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
6529 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6530 }
6531 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6532 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6533 }
6534 Ok(())
6535 }
6536 }
6537
6538 impl fidl::encoding::ResourceTypeMarker for Event {
6539 type Borrowed<'a> = &'a mut Self;
6540 fn take_or_borrow<'a>(
6541 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6542 ) -> Self::Borrowed<'a> {
6543 value
6544 }
6545 }
6546
6547 unsafe impl fidl::encoding::TypeMarker for Event {
6548 type Owned = Self;
6549
6550 #[inline(always)]
6551 fn inline_align(_context: fidl::encoding::Context) -> usize {
6552 8
6553 }
6554
6555 #[inline(always)]
6556 fn inline_size(_context: fidl::encoding::Context) -> usize {
6557 16
6558 }
6559 }
6560
6561 unsafe impl fidl::encoding::Encode<Event, fidl::encoding::DefaultFuchsiaResourceDialect>
6562 for &mut Event
6563 {
6564 #[inline]
6565 unsafe fn encode(
6566 self,
6567 encoder: &mut fidl::encoding::Encoder<
6568 '_,
6569 fidl::encoding::DefaultFuchsiaResourceDialect,
6570 >,
6571 offset: usize,
6572 _depth: fidl::encoding::Depth,
6573 ) -> fidl::Result<()> {
6574 encoder.debug_check_bounds::<Event>(offset);
6575 encoder.write_num::<u64>(self.ordinal(), offset);
6576 match self {
6577 Event::Gfx(ref val) => fidl::encoding::encode_in_envelope::<
6578 fidl_fuchsia_ui_gfx::Event,
6579 fidl::encoding::DefaultFuchsiaResourceDialect,
6580 >(
6581 <fidl_fuchsia_ui_gfx::Event as fidl::encoding::ValueTypeMarker>::borrow(val),
6582 encoder,
6583 offset + 8,
6584 _depth,
6585 ),
6586 Event::Input(ref val) => fidl::encoding::encode_in_envelope::<
6587 fidl_fuchsia_ui_input::InputEvent,
6588 fidl::encoding::DefaultFuchsiaResourceDialect,
6589 >(
6590 <fidl_fuchsia_ui_input::InputEvent as fidl::encoding::ValueTypeMarker>::borrow(
6591 val,
6592 ),
6593 encoder,
6594 offset + 8,
6595 _depth,
6596 ),
6597 Event::Unhandled(ref mut val) => fidl::encoding::encode_in_envelope::<
6598 Command,
6599 fidl::encoding::DefaultFuchsiaResourceDialect,
6600 >(
6601 <Command as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
6602 encoder,
6603 offset + 8,
6604 _depth,
6605 ),
6606 }
6607 }
6608 }
6609
6610 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Event {
6611 #[inline(always)]
6612 fn new_empty() -> Self {
6613 Self::Gfx(fidl::new_empty!(
6614 fidl_fuchsia_ui_gfx::Event,
6615 fidl::encoding::DefaultFuchsiaResourceDialect
6616 ))
6617 }
6618
6619 #[inline]
6620 unsafe fn decode(
6621 &mut self,
6622 decoder: &mut fidl::encoding::Decoder<
6623 '_,
6624 fidl::encoding::DefaultFuchsiaResourceDialect,
6625 >,
6626 offset: usize,
6627 mut depth: fidl::encoding::Depth,
6628 ) -> fidl::Result<()> {
6629 decoder.debug_check_bounds::<Self>(offset);
6630 #[allow(unused_variables)]
6631 let next_out_of_line = decoder.next_out_of_line();
6632 let handles_before = decoder.remaining_handles();
6633 let (ordinal, inlined, num_bytes, num_handles) =
6634 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
6635
6636 let member_inline_size = match ordinal {
6637 1 => <fidl_fuchsia_ui_gfx::Event as fidl::encoding::TypeMarker>::inline_size(
6638 decoder.context,
6639 ),
6640 2 => {
6641 <fidl_fuchsia_ui_input::InputEvent as fidl::encoding::TypeMarker>::inline_size(
6642 decoder.context,
6643 )
6644 }
6645 3 => <Command as fidl::encoding::TypeMarker>::inline_size(decoder.context),
6646 _ => return Err(fidl::Error::UnknownUnionTag),
6647 };
6648
6649 if inlined != (member_inline_size <= 4) {
6650 return Err(fidl::Error::InvalidInlineBitInEnvelope);
6651 }
6652 let _inner_offset;
6653 if inlined {
6654 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
6655 _inner_offset = offset + 8;
6656 } else {
6657 depth.increment()?;
6658 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6659 }
6660 match ordinal {
6661 1 => {
6662 #[allow(irrefutable_let_patterns)]
6663 if let Event::Gfx(_) = self {
6664 } else {
6666 *self = Event::Gfx(fidl::new_empty!(
6668 fidl_fuchsia_ui_gfx::Event,
6669 fidl::encoding::DefaultFuchsiaResourceDialect
6670 ));
6671 }
6672 #[allow(irrefutable_let_patterns)]
6673 if let Event::Gfx(ref mut val) = self {
6674 fidl::decode!(
6675 fidl_fuchsia_ui_gfx::Event,
6676 fidl::encoding::DefaultFuchsiaResourceDialect,
6677 val,
6678 decoder,
6679 _inner_offset,
6680 depth
6681 )?;
6682 } else {
6683 unreachable!()
6684 }
6685 }
6686 2 => {
6687 #[allow(irrefutable_let_patterns)]
6688 if let Event::Input(_) = self {
6689 } else {
6691 *self = Event::Input(fidl::new_empty!(
6693 fidl_fuchsia_ui_input::InputEvent,
6694 fidl::encoding::DefaultFuchsiaResourceDialect
6695 ));
6696 }
6697 #[allow(irrefutable_let_patterns)]
6698 if let Event::Input(ref mut val) = self {
6699 fidl::decode!(
6700 fidl_fuchsia_ui_input::InputEvent,
6701 fidl::encoding::DefaultFuchsiaResourceDialect,
6702 val,
6703 decoder,
6704 _inner_offset,
6705 depth
6706 )?;
6707 } else {
6708 unreachable!()
6709 }
6710 }
6711 3 => {
6712 #[allow(irrefutable_let_patterns)]
6713 if let Event::Unhandled(_) = self {
6714 } else {
6716 *self = Event::Unhandled(fidl::new_empty!(
6718 Command,
6719 fidl::encoding::DefaultFuchsiaResourceDialect
6720 ));
6721 }
6722 #[allow(irrefutable_let_patterns)]
6723 if let Event::Unhandled(ref mut val) = self {
6724 fidl::decode!(
6725 Command,
6726 fidl::encoding::DefaultFuchsiaResourceDialect,
6727 val,
6728 decoder,
6729 _inner_offset,
6730 depth
6731 )?;
6732 } else {
6733 unreachable!()
6734 }
6735 }
6736 ordinal => panic!("unexpected ordinal {:?}", ordinal),
6737 }
6738 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
6739 return Err(fidl::Error::InvalidNumBytesInEnvelope);
6740 }
6741 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6742 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6743 }
6744 Ok(())
6745 }
6746 }
6747}