fidl_fuchsia_ui_scenic__common/
fidl_fuchsia_ui_scenic__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const DISPLAY_NOT_OWNED_SIGNAL: u32 = 16777216;
12
13pub const DISPLAY_OWNED_SIGNAL: u32 = 33554432;
14
15#[derive(Clone, Debug, PartialEq)]
16pub struct ScenicGetDisplayInfoResponse {
17    pub info: fidl_fuchsia_ui_gfx__common::DisplayInfo,
18}
19
20impl fidl::Persistable for ScenicGetDisplayInfoResponse {}
21
22#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
23pub struct ScenicUsesFlatlandResponse {
24    pub flatland_enabled: bool,
25}
26
27impl fidl::Persistable for ScenicUsesFlatlandResponse {}
28
29#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
30#[repr(C)]
31pub struct SessionDeregisterBufferCollectionRequest {
32    pub buffer_id: u32,
33}
34
35impl fidl::Persistable for SessionDeregisterBufferCollectionRequest {}
36
37#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
38pub struct SessionListenerOnScenicErrorRequest {
39    pub error: String,
40}
41
42impl fidl::Persistable for SessionListenerOnScenicErrorRequest {}
43
44#[derive(Clone, Debug, PartialEq)]
45pub struct SessionOnFramePresentedRequest {
46    pub frame_presented_info: fidl_fuchsia_scenic_scheduling__common::FramePresentedInfo,
47}
48
49impl fidl::Persistable for SessionOnFramePresentedRequest {}
50
51#[derive(Clone, Debug, PartialEq)]
52pub struct SessionPresent2Response {
53    pub request_presentation_times_info:
54        fidl_fuchsia_scenic_scheduling__common::FuturePresentationTimes,
55}
56
57impl fidl::Persistable for SessionPresent2Response {}
58
59#[derive(Clone, Debug, PartialEq)]
60pub struct SessionPresentResponse {
61    pub presentation_info: fidl_fuchsia_images__common::PresentationInfo,
62}
63
64impl fidl::Persistable for SessionPresentResponse {}
65
66#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
67#[repr(C)]
68pub struct SessionRequestPresentationTimesRequest {
69    pub requested_prediction_span: i64,
70}
71
72impl fidl::Persistable for SessionRequestPresentationTimesRequest {}
73
74#[derive(Clone, Debug, PartialEq)]
75pub struct SessionRequestPresentationTimesResponse {
76    pub request_presentation_times_info:
77        fidl_fuchsia_scenic_scheduling__common::FuturePresentationTimes,
78}
79
80impl fidl::Persistable for SessionRequestPresentationTimesResponse {}
81
82#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
83pub struct SessionSetDebugNameRequest {
84    pub debug_name: String,
85}
86
87impl fidl::Persistable for SessionSetDebugNameRequest {}
88
89pub mod scenic_ordinals {
90    pub const CREATE_SESSION: u64 = 0x2af781f341771a50;
91    pub const CREATE_SESSION2: u64 = 0x11fa60f776121fa5;
92    pub const CREATE_SESSION_T: u64 = 0x369061a897552d4f;
93    pub const GET_DISPLAY_INFO: u64 = 0x3e4cdecbf7cc1797;
94    pub const GET_DISPLAY_OWNERSHIP_EVENT: u64 = 0x54c114c7322b24d6;
95    pub const TAKE_SCREENSHOT: u64 = 0x53f5e06463987df2;
96    pub const USES_FLATLAND: u64 = 0x5f2e5e19463ae706;
97}
98
99pub mod session_ordinals {
100    pub const ENQUEUE: u64 = 0x61e1e8b2cb6b0852;
101    pub const PRESENT: u64 = 0x36967062cdd2c37e;
102    pub const PRESENT2: u64 = 0x5d307d6198d76a65;
103    pub const ON_FRAME_PRESENTED: u64 = 0x26e3bdd1559be16b;
104    pub const REQUEST_PRESENTATION_TIMES: u64 = 0x14a087997bf83904;
105    pub const REGISTER_BUFFER_COLLECTION: u64 = 0x141b0d5768c5ecf8;
106    pub const DEREGISTER_BUFFER_COLLECTION: u64 = 0x34e6c5c26b6cdb1e;
107    pub const SET_DEBUG_NAME: u64 = 0xdb157bf88f57b91;
108}
109
110pub mod session_listener_ordinals {
111    pub const ON_SCENIC_ERROR: u64 = 0x68095b89cb6c45f7;
112    pub const ON_SCENIC_EVENT: u64 = 0x5f66bec36e87b3ea;
113}
114
115pub mod snapshot_ordinals {}
116
117mod internal {
118    use super::*;
119
120    impl fidl::encoding::ValueTypeMarker for ScenicGetDisplayInfoResponse {
121        type Borrowed<'a> = &'a Self;
122        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
123            value
124        }
125    }
126
127    unsafe impl fidl::encoding::TypeMarker for ScenicGetDisplayInfoResponse {
128        type Owned = Self;
129
130        #[inline(always)]
131        fn inline_align(_context: fidl::encoding::Context) -> usize {
132            4
133        }
134
135        #[inline(always)]
136        fn inline_size(_context: fidl::encoding::Context) -> usize {
137            8
138        }
139    }
140
141    unsafe impl<D: fidl::encoding::ResourceDialect>
142        fidl::encoding::Encode<ScenicGetDisplayInfoResponse, D> for &ScenicGetDisplayInfoResponse
143    {
144        #[inline]
145        unsafe fn encode(
146            self,
147            encoder: &mut fidl::encoding::Encoder<'_, D>,
148            offset: usize,
149            _depth: fidl::encoding::Depth,
150        ) -> fidl::Result<()> {
151            encoder.debug_check_bounds::<ScenicGetDisplayInfoResponse>(offset);
152            // Delegate to tuple encoding.
153            fidl::encoding::Encode::<ScenicGetDisplayInfoResponse, D>::encode(
154                (
155                    <fidl_fuchsia_ui_gfx__common::DisplayInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
156                ),
157                encoder, offset, _depth
158            )
159        }
160    }
161    unsafe impl<
162            D: fidl::encoding::ResourceDialect,
163            T0: fidl::encoding::Encode<fidl_fuchsia_ui_gfx__common::DisplayInfo, D>,
164        > fidl::encoding::Encode<ScenicGetDisplayInfoResponse, D> for (T0,)
165    {
166        #[inline]
167        unsafe fn encode(
168            self,
169            encoder: &mut fidl::encoding::Encoder<'_, D>,
170            offset: usize,
171            depth: fidl::encoding::Depth,
172        ) -> fidl::Result<()> {
173            encoder.debug_check_bounds::<ScenicGetDisplayInfoResponse>(offset);
174            // Zero out padding regions. There's no need to apply masks
175            // because the unmasked parts will be overwritten by fields.
176            // Write the fields.
177            self.0.encode(encoder, offset + 0, depth)?;
178            Ok(())
179        }
180    }
181
182    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
183        for ScenicGetDisplayInfoResponse
184    {
185        #[inline(always)]
186        fn new_empty() -> Self {
187            Self { info: fidl::new_empty!(fidl_fuchsia_ui_gfx__common::DisplayInfo, D) }
188        }
189
190        #[inline]
191        unsafe fn decode(
192            &mut self,
193            decoder: &mut fidl::encoding::Decoder<'_, D>,
194            offset: usize,
195            _depth: fidl::encoding::Depth,
196        ) -> fidl::Result<()> {
197            decoder.debug_check_bounds::<Self>(offset);
198            // Verify that padding bytes are zero.
199            fidl::decode!(
200                fidl_fuchsia_ui_gfx__common::DisplayInfo,
201                D,
202                &mut self.info,
203                decoder,
204                offset + 0,
205                _depth
206            )?;
207            Ok(())
208        }
209    }
210
211    impl fidl::encoding::ValueTypeMarker for ScenicUsesFlatlandResponse {
212        type Borrowed<'a> = &'a Self;
213        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
214            value
215        }
216    }
217
218    unsafe impl fidl::encoding::TypeMarker for ScenicUsesFlatlandResponse {
219        type Owned = Self;
220
221        #[inline(always)]
222        fn inline_align(_context: fidl::encoding::Context) -> usize {
223            1
224        }
225
226        #[inline(always)]
227        fn inline_size(_context: fidl::encoding::Context) -> usize {
228            1
229        }
230    }
231
232    unsafe impl<D: fidl::encoding::ResourceDialect>
233        fidl::encoding::Encode<ScenicUsesFlatlandResponse, D> for &ScenicUsesFlatlandResponse
234    {
235        #[inline]
236        unsafe fn encode(
237            self,
238            encoder: &mut fidl::encoding::Encoder<'_, D>,
239            offset: usize,
240            _depth: fidl::encoding::Depth,
241        ) -> fidl::Result<()> {
242            encoder.debug_check_bounds::<ScenicUsesFlatlandResponse>(offset);
243            // Delegate to tuple encoding.
244            fidl::encoding::Encode::<ScenicUsesFlatlandResponse, D>::encode(
245                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.flatland_enabled),),
246                encoder,
247                offset,
248                _depth,
249            )
250        }
251    }
252    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
253        fidl::encoding::Encode<ScenicUsesFlatlandResponse, D> for (T0,)
254    {
255        #[inline]
256        unsafe fn encode(
257            self,
258            encoder: &mut fidl::encoding::Encoder<'_, D>,
259            offset: usize,
260            depth: fidl::encoding::Depth,
261        ) -> fidl::Result<()> {
262            encoder.debug_check_bounds::<ScenicUsesFlatlandResponse>(offset);
263            // Zero out padding regions. There's no need to apply masks
264            // because the unmasked parts will be overwritten by fields.
265            // Write the fields.
266            self.0.encode(encoder, offset + 0, depth)?;
267            Ok(())
268        }
269    }
270
271    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
272        for ScenicUsesFlatlandResponse
273    {
274        #[inline(always)]
275        fn new_empty() -> Self {
276            Self { flatland_enabled: fidl::new_empty!(bool, D) }
277        }
278
279        #[inline]
280        unsafe fn decode(
281            &mut self,
282            decoder: &mut fidl::encoding::Decoder<'_, D>,
283            offset: usize,
284            _depth: fidl::encoding::Depth,
285        ) -> fidl::Result<()> {
286            decoder.debug_check_bounds::<Self>(offset);
287            // Verify that padding bytes are zero.
288            fidl::decode!(bool, D, &mut self.flatland_enabled, decoder, offset + 0, _depth)?;
289            Ok(())
290        }
291    }
292
293    impl fidl::encoding::ValueTypeMarker for SessionDeregisterBufferCollectionRequest {
294        type Borrowed<'a> = &'a Self;
295        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
296            value
297        }
298    }
299
300    unsafe impl fidl::encoding::TypeMarker for SessionDeregisterBufferCollectionRequest {
301        type Owned = Self;
302
303        #[inline(always)]
304        fn inline_align(_context: fidl::encoding::Context) -> usize {
305            4
306        }
307
308        #[inline(always)]
309        fn inline_size(_context: fidl::encoding::Context) -> usize {
310            4
311        }
312        #[inline(always)]
313        fn encode_is_copy() -> bool {
314            true
315        }
316
317        #[inline(always)]
318        fn decode_is_copy() -> bool {
319            true
320        }
321    }
322
323    unsafe impl<D: fidl::encoding::ResourceDialect>
324        fidl::encoding::Encode<SessionDeregisterBufferCollectionRequest, D>
325        for &SessionDeregisterBufferCollectionRequest
326    {
327        #[inline]
328        unsafe fn encode(
329            self,
330            encoder: &mut fidl::encoding::Encoder<'_, D>,
331            offset: usize,
332            _depth: fidl::encoding::Depth,
333        ) -> fidl::Result<()> {
334            encoder.debug_check_bounds::<SessionDeregisterBufferCollectionRequest>(offset);
335            unsafe {
336                // Copy the object into the buffer.
337                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
338                (buf_ptr as *mut SessionDeregisterBufferCollectionRequest).write_unaligned(
339                    (self as *const SessionDeregisterBufferCollectionRequest).read(),
340                );
341                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
342                // done second because the memcpy will write garbage to these bytes.
343            }
344            Ok(())
345        }
346    }
347    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
348        fidl::encoding::Encode<SessionDeregisterBufferCollectionRequest, D> for (T0,)
349    {
350        #[inline]
351        unsafe fn encode(
352            self,
353            encoder: &mut fidl::encoding::Encoder<'_, D>,
354            offset: usize,
355            depth: fidl::encoding::Depth,
356        ) -> fidl::Result<()> {
357            encoder.debug_check_bounds::<SessionDeregisterBufferCollectionRequest>(offset);
358            // Zero out padding regions. There's no need to apply masks
359            // because the unmasked parts will be overwritten by fields.
360            // Write the fields.
361            self.0.encode(encoder, offset + 0, depth)?;
362            Ok(())
363        }
364    }
365
366    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
367        for SessionDeregisterBufferCollectionRequest
368    {
369        #[inline(always)]
370        fn new_empty() -> Self {
371            Self { buffer_id: fidl::new_empty!(u32, D) }
372        }
373
374        #[inline]
375        unsafe fn decode(
376            &mut self,
377            decoder: &mut fidl::encoding::Decoder<'_, D>,
378            offset: usize,
379            _depth: fidl::encoding::Depth,
380        ) -> fidl::Result<()> {
381            decoder.debug_check_bounds::<Self>(offset);
382            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
383            // Verify that padding bytes are zero.
384            // Copy from the buffer into the object.
385            unsafe {
386                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
387            }
388            Ok(())
389        }
390    }
391
392    impl fidl::encoding::ValueTypeMarker for SessionListenerOnScenicErrorRequest {
393        type Borrowed<'a> = &'a Self;
394        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
395            value
396        }
397    }
398
399    unsafe impl fidl::encoding::TypeMarker for SessionListenerOnScenicErrorRequest {
400        type Owned = Self;
401
402        #[inline(always)]
403        fn inline_align(_context: fidl::encoding::Context) -> usize {
404            8
405        }
406
407        #[inline(always)]
408        fn inline_size(_context: fidl::encoding::Context) -> usize {
409            16
410        }
411    }
412
413    unsafe impl<D: fidl::encoding::ResourceDialect>
414        fidl::encoding::Encode<SessionListenerOnScenicErrorRequest, D>
415        for &SessionListenerOnScenicErrorRequest
416    {
417        #[inline]
418        unsafe fn encode(
419            self,
420            encoder: &mut fidl::encoding::Encoder<'_, D>,
421            offset: usize,
422            _depth: fidl::encoding::Depth,
423        ) -> fidl::Result<()> {
424            encoder.debug_check_bounds::<SessionListenerOnScenicErrorRequest>(offset);
425            // Delegate to tuple encoding.
426            fidl::encoding::Encode::<SessionListenerOnScenicErrorRequest, D>::encode(
427                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
428                    &self.error,
429                ),),
430                encoder,
431                offset,
432                _depth,
433            )
434        }
435    }
436    unsafe impl<
437            D: fidl::encoding::ResourceDialect,
438            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
439        > fidl::encoding::Encode<SessionListenerOnScenicErrorRequest, D> for (T0,)
440    {
441        #[inline]
442        unsafe fn encode(
443            self,
444            encoder: &mut fidl::encoding::Encoder<'_, D>,
445            offset: usize,
446            depth: fidl::encoding::Depth,
447        ) -> fidl::Result<()> {
448            encoder.debug_check_bounds::<SessionListenerOnScenicErrorRequest>(offset);
449            // Zero out padding regions. There's no need to apply masks
450            // because the unmasked parts will be overwritten by fields.
451            // Write the fields.
452            self.0.encode(encoder, offset + 0, depth)?;
453            Ok(())
454        }
455    }
456
457    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
458        for SessionListenerOnScenicErrorRequest
459    {
460        #[inline(always)]
461        fn new_empty() -> Self {
462            Self { error: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
463        }
464
465        #[inline]
466        unsafe fn decode(
467            &mut self,
468            decoder: &mut fidl::encoding::Decoder<'_, D>,
469            offset: usize,
470            _depth: fidl::encoding::Depth,
471        ) -> fidl::Result<()> {
472            decoder.debug_check_bounds::<Self>(offset);
473            // Verify that padding bytes are zero.
474            fidl::decode!(
475                fidl::encoding::UnboundedString,
476                D,
477                &mut self.error,
478                decoder,
479                offset + 0,
480                _depth
481            )?;
482            Ok(())
483        }
484    }
485
486    impl fidl::encoding::ValueTypeMarker for SessionOnFramePresentedRequest {
487        type Borrowed<'a> = &'a Self;
488        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
489            value
490        }
491    }
492
493    unsafe impl fidl::encoding::TypeMarker for SessionOnFramePresentedRequest {
494        type Owned = Self;
495
496        #[inline(always)]
497        fn inline_align(_context: fidl::encoding::Context) -> usize {
498            8
499        }
500
501        #[inline(always)]
502        fn inline_size(_context: fidl::encoding::Context) -> usize {
503            32
504        }
505    }
506
507    unsafe impl<D: fidl::encoding::ResourceDialect>
508        fidl::encoding::Encode<SessionOnFramePresentedRequest, D>
509        for &SessionOnFramePresentedRequest
510    {
511        #[inline]
512        unsafe fn encode(
513            self,
514            encoder: &mut fidl::encoding::Encoder<'_, D>,
515            offset: usize,
516            _depth: fidl::encoding::Depth,
517        ) -> fidl::Result<()> {
518            encoder.debug_check_bounds::<SessionOnFramePresentedRequest>(offset);
519            // Delegate to tuple encoding.
520            fidl::encoding::Encode::<SessionOnFramePresentedRequest, D>::encode(
521                (
522                    <fidl_fuchsia_scenic_scheduling__common::FramePresentedInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_presented_info),
523                ),
524                encoder, offset, _depth
525            )
526        }
527    }
528    unsafe impl<
529            D: fidl::encoding::ResourceDialect,
530            T0: fidl::encoding::Encode<fidl_fuchsia_scenic_scheduling__common::FramePresentedInfo, D>,
531        > fidl::encoding::Encode<SessionOnFramePresentedRequest, D> for (T0,)
532    {
533        #[inline]
534        unsafe fn encode(
535            self,
536            encoder: &mut fidl::encoding::Encoder<'_, D>,
537            offset: usize,
538            depth: fidl::encoding::Depth,
539        ) -> fidl::Result<()> {
540            encoder.debug_check_bounds::<SessionOnFramePresentedRequest>(offset);
541            // Zero out padding regions. There's no need to apply masks
542            // because the unmasked parts will be overwritten by fields.
543            // Write the fields.
544            self.0.encode(encoder, offset + 0, depth)?;
545            Ok(())
546        }
547    }
548
549    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
550        for SessionOnFramePresentedRequest
551    {
552        #[inline(always)]
553        fn new_empty() -> Self {
554            Self {
555                frame_presented_info: fidl::new_empty!(
556                    fidl_fuchsia_scenic_scheduling__common::FramePresentedInfo,
557                    D
558                ),
559            }
560        }
561
562        #[inline]
563        unsafe fn decode(
564            &mut self,
565            decoder: &mut fidl::encoding::Decoder<'_, D>,
566            offset: usize,
567            _depth: fidl::encoding::Depth,
568        ) -> fidl::Result<()> {
569            decoder.debug_check_bounds::<Self>(offset);
570            // Verify that padding bytes are zero.
571            fidl::decode!(
572                fidl_fuchsia_scenic_scheduling__common::FramePresentedInfo,
573                D,
574                &mut self.frame_presented_info,
575                decoder,
576                offset + 0,
577                _depth
578            )?;
579            Ok(())
580        }
581    }
582
583    impl fidl::encoding::ValueTypeMarker for SessionPresent2Response {
584        type Borrowed<'a> = &'a Self;
585        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
586            value
587        }
588    }
589
590    unsafe impl fidl::encoding::TypeMarker for SessionPresent2Response {
591        type Owned = Self;
592
593        #[inline(always)]
594        fn inline_align(_context: fidl::encoding::Context) -> usize {
595            8
596        }
597
598        #[inline(always)]
599        fn inline_size(_context: fidl::encoding::Context) -> usize {
600            24
601        }
602    }
603
604    unsafe impl<D: fidl::encoding::ResourceDialect>
605        fidl::encoding::Encode<SessionPresent2Response, D> for &SessionPresent2Response
606    {
607        #[inline]
608        unsafe fn encode(
609            self,
610            encoder: &mut fidl::encoding::Encoder<'_, D>,
611            offset: usize,
612            _depth: fidl::encoding::Depth,
613        ) -> fidl::Result<()> {
614            encoder.debug_check_bounds::<SessionPresent2Response>(offset);
615            // Delegate to tuple encoding.
616            fidl::encoding::Encode::<SessionPresent2Response, D>::encode(
617                (
618                    <fidl_fuchsia_scenic_scheduling__common::FuturePresentationTimes as fidl::encoding::ValueTypeMarker>::borrow(&self.request_presentation_times_info),
619                ),
620                encoder, offset, _depth
621            )
622        }
623    }
624    unsafe impl<
625            D: fidl::encoding::ResourceDialect,
626            T0: fidl::encoding::Encode<
627                fidl_fuchsia_scenic_scheduling__common::FuturePresentationTimes,
628                D,
629            >,
630        > fidl::encoding::Encode<SessionPresent2Response, D> for (T0,)
631    {
632        #[inline]
633        unsafe fn encode(
634            self,
635            encoder: &mut fidl::encoding::Encoder<'_, D>,
636            offset: usize,
637            depth: fidl::encoding::Depth,
638        ) -> fidl::Result<()> {
639            encoder.debug_check_bounds::<SessionPresent2Response>(offset);
640            // Zero out padding regions. There's no need to apply masks
641            // because the unmasked parts will be overwritten by fields.
642            // Write the fields.
643            self.0.encode(encoder, offset + 0, depth)?;
644            Ok(())
645        }
646    }
647
648    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
649        for SessionPresent2Response
650    {
651        #[inline(always)]
652        fn new_empty() -> Self {
653            Self {
654                request_presentation_times_info: fidl::new_empty!(
655                    fidl_fuchsia_scenic_scheduling__common::FuturePresentationTimes,
656                    D
657                ),
658            }
659        }
660
661        #[inline]
662        unsafe fn decode(
663            &mut self,
664            decoder: &mut fidl::encoding::Decoder<'_, D>,
665            offset: usize,
666            _depth: fidl::encoding::Depth,
667        ) -> fidl::Result<()> {
668            decoder.debug_check_bounds::<Self>(offset);
669            // Verify that padding bytes are zero.
670            fidl::decode!(
671                fidl_fuchsia_scenic_scheduling__common::FuturePresentationTimes,
672                D,
673                &mut self.request_presentation_times_info,
674                decoder,
675                offset + 0,
676                _depth
677            )?;
678            Ok(())
679        }
680    }
681
682    impl fidl::encoding::ValueTypeMarker for SessionPresentResponse {
683        type Borrowed<'a> = &'a Self;
684        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
685            value
686        }
687    }
688
689    unsafe impl fidl::encoding::TypeMarker for SessionPresentResponse {
690        type Owned = Self;
691
692        #[inline(always)]
693        fn inline_align(_context: fidl::encoding::Context) -> usize {
694            8
695        }
696
697        #[inline(always)]
698        fn inline_size(_context: fidl::encoding::Context) -> usize {
699            16
700        }
701    }
702
703    unsafe impl<D: fidl::encoding::ResourceDialect>
704        fidl::encoding::Encode<SessionPresentResponse, D> for &SessionPresentResponse
705    {
706        #[inline]
707        unsafe fn encode(
708            self,
709            encoder: &mut fidl::encoding::Encoder<'_, D>,
710            offset: usize,
711            _depth: fidl::encoding::Depth,
712        ) -> fidl::Result<()> {
713            encoder.debug_check_bounds::<SessionPresentResponse>(offset);
714            // Delegate to tuple encoding.
715            fidl::encoding::Encode::<SessionPresentResponse, D>::encode(
716                (
717                    <fidl_fuchsia_images__common::PresentationInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.presentation_info),
718                ),
719                encoder, offset, _depth
720            )
721        }
722    }
723    unsafe impl<
724            D: fidl::encoding::ResourceDialect,
725            T0: fidl::encoding::Encode<fidl_fuchsia_images__common::PresentationInfo, D>,
726        > fidl::encoding::Encode<SessionPresentResponse, D> for (T0,)
727    {
728        #[inline]
729        unsafe fn encode(
730            self,
731            encoder: &mut fidl::encoding::Encoder<'_, D>,
732            offset: usize,
733            depth: fidl::encoding::Depth,
734        ) -> fidl::Result<()> {
735            encoder.debug_check_bounds::<SessionPresentResponse>(offset);
736            // Zero out padding regions. There's no need to apply masks
737            // because the unmasked parts will be overwritten by fields.
738            // Write the fields.
739            self.0.encode(encoder, offset + 0, depth)?;
740            Ok(())
741        }
742    }
743
744    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
745        for SessionPresentResponse
746    {
747        #[inline(always)]
748        fn new_empty() -> Self {
749            Self {
750                presentation_info: fidl::new_empty!(
751                    fidl_fuchsia_images__common::PresentationInfo,
752                    D
753                ),
754            }
755        }
756
757        #[inline]
758        unsafe fn decode(
759            &mut self,
760            decoder: &mut fidl::encoding::Decoder<'_, D>,
761            offset: usize,
762            _depth: fidl::encoding::Depth,
763        ) -> fidl::Result<()> {
764            decoder.debug_check_bounds::<Self>(offset);
765            // Verify that padding bytes are zero.
766            fidl::decode!(
767                fidl_fuchsia_images__common::PresentationInfo,
768                D,
769                &mut self.presentation_info,
770                decoder,
771                offset + 0,
772                _depth
773            )?;
774            Ok(())
775        }
776    }
777
778    impl fidl::encoding::ValueTypeMarker for SessionRequestPresentationTimesRequest {
779        type Borrowed<'a> = &'a Self;
780        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
781            value
782        }
783    }
784
785    unsafe impl fidl::encoding::TypeMarker for SessionRequestPresentationTimesRequest {
786        type Owned = Self;
787
788        #[inline(always)]
789        fn inline_align(_context: fidl::encoding::Context) -> usize {
790            8
791        }
792
793        #[inline(always)]
794        fn inline_size(_context: fidl::encoding::Context) -> usize {
795            8
796        }
797        #[inline(always)]
798        fn encode_is_copy() -> bool {
799            true
800        }
801
802        #[inline(always)]
803        fn decode_is_copy() -> bool {
804            true
805        }
806    }
807
808    unsafe impl<D: fidl::encoding::ResourceDialect>
809        fidl::encoding::Encode<SessionRequestPresentationTimesRequest, D>
810        for &SessionRequestPresentationTimesRequest
811    {
812        #[inline]
813        unsafe fn encode(
814            self,
815            encoder: &mut fidl::encoding::Encoder<'_, D>,
816            offset: usize,
817            _depth: fidl::encoding::Depth,
818        ) -> fidl::Result<()> {
819            encoder.debug_check_bounds::<SessionRequestPresentationTimesRequest>(offset);
820            unsafe {
821                // Copy the object into the buffer.
822                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
823                (buf_ptr as *mut SessionRequestPresentationTimesRequest).write_unaligned(
824                    (self as *const SessionRequestPresentationTimesRequest).read(),
825                );
826                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
827                // done second because the memcpy will write garbage to these bytes.
828            }
829            Ok(())
830        }
831    }
832    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
833        fidl::encoding::Encode<SessionRequestPresentationTimesRequest, D> for (T0,)
834    {
835        #[inline]
836        unsafe fn encode(
837            self,
838            encoder: &mut fidl::encoding::Encoder<'_, D>,
839            offset: usize,
840            depth: fidl::encoding::Depth,
841        ) -> fidl::Result<()> {
842            encoder.debug_check_bounds::<SessionRequestPresentationTimesRequest>(offset);
843            // Zero out padding regions. There's no need to apply masks
844            // because the unmasked parts will be overwritten by fields.
845            // Write the fields.
846            self.0.encode(encoder, offset + 0, depth)?;
847            Ok(())
848        }
849    }
850
851    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
852        for SessionRequestPresentationTimesRequest
853    {
854        #[inline(always)]
855        fn new_empty() -> Self {
856            Self { requested_prediction_span: fidl::new_empty!(i64, D) }
857        }
858
859        #[inline]
860        unsafe fn decode(
861            &mut self,
862            decoder: &mut fidl::encoding::Decoder<'_, D>,
863            offset: usize,
864            _depth: fidl::encoding::Depth,
865        ) -> fidl::Result<()> {
866            decoder.debug_check_bounds::<Self>(offset);
867            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
868            // Verify that padding bytes are zero.
869            // Copy from the buffer into the object.
870            unsafe {
871                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
872            }
873            Ok(())
874        }
875    }
876
877    impl fidl::encoding::ValueTypeMarker for SessionRequestPresentationTimesResponse {
878        type Borrowed<'a> = &'a Self;
879        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
880            value
881        }
882    }
883
884    unsafe impl fidl::encoding::TypeMarker for SessionRequestPresentationTimesResponse {
885        type Owned = Self;
886
887        #[inline(always)]
888        fn inline_align(_context: fidl::encoding::Context) -> usize {
889            8
890        }
891
892        #[inline(always)]
893        fn inline_size(_context: fidl::encoding::Context) -> usize {
894            24
895        }
896    }
897
898    unsafe impl<D: fidl::encoding::ResourceDialect>
899        fidl::encoding::Encode<SessionRequestPresentationTimesResponse, D>
900        for &SessionRequestPresentationTimesResponse
901    {
902        #[inline]
903        unsafe fn encode(
904            self,
905            encoder: &mut fidl::encoding::Encoder<'_, D>,
906            offset: usize,
907            _depth: fidl::encoding::Depth,
908        ) -> fidl::Result<()> {
909            encoder.debug_check_bounds::<SessionRequestPresentationTimesResponse>(offset);
910            // Delegate to tuple encoding.
911            fidl::encoding::Encode::<SessionRequestPresentationTimesResponse, D>::encode(
912                (
913                    <fidl_fuchsia_scenic_scheduling__common::FuturePresentationTimes as fidl::encoding::ValueTypeMarker>::borrow(&self.request_presentation_times_info),
914                ),
915                encoder, offset, _depth
916            )
917        }
918    }
919    unsafe impl<
920            D: fidl::encoding::ResourceDialect,
921            T0: fidl::encoding::Encode<
922                fidl_fuchsia_scenic_scheduling__common::FuturePresentationTimes,
923                D,
924            >,
925        > fidl::encoding::Encode<SessionRequestPresentationTimesResponse, D> for (T0,)
926    {
927        #[inline]
928        unsafe fn encode(
929            self,
930            encoder: &mut fidl::encoding::Encoder<'_, D>,
931            offset: usize,
932            depth: fidl::encoding::Depth,
933        ) -> fidl::Result<()> {
934            encoder.debug_check_bounds::<SessionRequestPresentationTimesResponse>(offset);
935            // Zero out padding regions. There's no need to apply masks
936            // because the unmasked parts will be overwritten by fields.
937            // Write the fields.
938            self.0.encode(encoder, offset + 0, depth)?;
939            Ok(())
940        }
941    }
942
943    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
944        for SessionRequestPresentationTimesResponse
945    {
946        #[inline(always)]
947        fn new_empty() -> Self {
948            Self {
949                request_presentation_times_info: fidl::new_empty!(
950                    fidl_fuchsia_scenic_scheduling__common::FuturePresentationTimes,
951                    D
952                ),
953            }
954        }
955
956        #[inline]
957        unsafe fn decode(
958            &mut self,
959            decoder: &mut fidl::encoding::Decoder<'_, D>,
960            offset: usize,
961            _depth: fidl::encoding::Depth,
962        ) -> fidl::Result<()> {
963            decoder.debug_check_bounds::<Self>(offset);
964            // Verify that padding bytes are zero.
965            fidl::decode!(
966                fidl_fuchsia_scenic_scheduling__common::FuturePresentationTimes,
967                D,
968                &mut self.request_presentation_times_info,
969                decoder,
970                offset + 0,
971                _depth
972            )?;
973            Ok(())
974        }
975    }
976
977    impl fidl::encoding::ValueTypeMarker for SessionSetDebugNameRequest {
978        type Borrowed<'a> = &'a Self;
979        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
980            value
981        }
982    }
983
984    unsafe impl fidl::encoding::TypeMarker for SessionSetDebugNameRequest {
985        type Owned = Self;
986
987        #[inline(always)]
988        fn inline_align(_context: fidl::encoding::Context) -> usize {
989            8
990        }
991
992        #[inline(always)]
993        fn inline_size(_context: fidl::encoding::Context) -> usize {
994            16
995        }
996    }
997
998    unsafe impl<D: fidl::encoding::ResourceDialect>
999        fidl::encoding::Encode<SessionSetDebugNameRequest, D> for &SessionSetDebugNameRequest
1000    {
1001        #[inline]
1002        unsafe fn encode(
1003            self,
1004            encoder: &mut fidl::encoding::Encoder<'_, D>,
1005            offset: usize,
1006            _depth: fidl::encoding::Depth,
1007        ) -> fidl::Result<()> {
1008            encoder.debug_check_bounds::<SessionSetDebugNameRequest>(offset);
1009            // Delegate to tuple encoding.
1010            fidl::encoding::Encode::<SessionSetDebugNameRequest, D>::encode(
1011                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
1012                    &self.debug_name,
1013                ),),
1014                encoder,
1015                offset,
1016                _depth,
1017            )
1018        }
1019    }
1020    unsafe impl<
1021            D: fidl::encoding::ResourceDialect,
1022            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
1023        > fidl::encoding::Encode<SessionSetDebugNameRequest, D> for (T0,)
1024    {
1025        #[inline]
1026        unsafe fn encode(
1027            self,
1028            encoder: &mut fidl::encoding::Encoder<'_, D>,
1029            offset: usize,
1030            depth: fidl::encoding::Depth,
1031        ) -> fidl::Result<()> {
1032            encoder.debug_check_bounds::<SessionSetDebugNameRequest>(offset);
1033            // Zero out padding regions. There's no need to apply masks
1034            // because the unmasked parts will be overwritten by fields.
1035            // Write the fields.
1036            self.0.encode(encoder, offset + 0, depth)?;
1037            Ok(())
1038        }
1039    }
1040
1041    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1042        for SessionSetDebugNameRequest
1043    {
1044        #[inline(always)]
1045        fn new_empty() -> Self {
1046            Self { debug_name: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
1047        }
1048
1049        #[inline]
1050        unsafe fn decode(
1051            &mut self,
1052            decoder: &mut fidl::encoding::Decoder<'_, D>,
1053            offset: usize,
1054            _depth: fidl::encoding::Depth,
1055        ) -> fidl::Result<()> {
1056            decoder.debug_check_bounds::<Self>(offset);
1057            // Verify that padding bytes are zero.
1058            fidl::decode!(
1059                fidl::encoding::UnboundedString,
1060                D,
1061                &mut self.debug_name,
1062                decoder,
1063                offset + 0,
1064                _depth
1065            )?;
1066            Ok(())
1067        }
1068    }
1069}