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<fidl_fuchsia_scenic_scheduling__common::FuturePresentationTimes, D>,
627    > fidl::encoding::Encode<SessionPresent2Response, D> for (T0,)
628    {
629        #[inline]
630        unsafe fn encode(
631            self,
632            encoder: &mut fidl::encoding::Encoder<'_, D>,
633            offset: usize,
634            depth: fidl::encoding::Depth,
635        ) -> fidl::Result<()> {
636            encoder.debug_check_bounds::<SessionPresent2Response>(offset);
637            // Zero out padding regions. There's no need to apply masks
638            // because the unmasked parts will be overwritten by fields.
639            // Write the fields.
640            self.0.encode(encoder, offset + 0, depth)?;
641            Ok(())
642        }
643    }
644
645    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
646        for SessionPresent2Response
647    {
648        #[inline(always)]
649        fn new_empty() -> Self {
650            Self {
651                request_presentation_times_info: fidl::new_empty!(
652                    fidl_fuchsia_scenic_scheduling__common::FuturePresentationTimes,
653                    D
654                ),
655            }
656        }
657
658        #[inline]
659        unsafe fn decode(
660            &mut self,
661            decoder: &mut fidl::encoding::Decoder<'_, D>,
662            offset: usize,
663            _depth: fidl::encoding::Depth,
664        ) -> fidl::Result<()> {
665            decoder.debug_check_bounds::<Self>(offset);
666            // Verify that padding bytes are zero.
667            fidl::decode!(
668                fidl_fuchsia_scenic_scheduling__common::FuturePresentationTimes,
669                D,
670                &mut self.request_presentation_times_info,
671                decoder,
672                offset + 0,
673                _depth
674            )?;
675            Ok(())
676        }
677    }
678
679    impl fidl::encoding::ValueTypeMarker for SessionPresentResponse {
680        type Borrowed<'a> = &'a Self;
681        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
682            value
683        }
684    }
685
686    unsafe impl fidl::encoding::TypeMarker for SessionPresentResponse {
687        type Owned = Self;
688
689        #[inline(always)]
690        fn inline_align(_context: fidl::encoding::Context) -> usize {
691            8
692        }
693
694        #[inline(always)]
695        fn inline_size(_context: fidl::encoding::Context) -> usize {
696            16
697        }
698    }
699
700    unsafe impl<D: fidl::encoding::ResourceDialect>
701        fidl::encoding::Encode<SessionPresentResponse, D> for &SessionPresentResponse
702    {
703        #[inline]
704        unsafe fn encode(
705            self,
706            encoder: &mut fidl::encoding::Encoder<'_, D>,
707            offset: usize,
708            _depth: fidl::encoding::Depth,
709        ) -> fidl::Result<()> {
710            encoder.debug_check_bounds::<SessionPresentResponse>(offset);
711            // Delegate to tuple encoding.
712            fidl::encoding::Encode::<SessionPresentResponse, D>::encode(
713                (
714                    <fidl_fuchsia_images__common::PresentationInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.presentation_info),
715                ),
716                encoder, offset, _depth
717            )
718        }
719    }
720    unsafe impl<
721        D: fidl::encoding::ResourceDialect,
722        T0: fidl::encoding::Encode<fidl_fuchsia_images__common::PresentationInfo, D>,
723    > fidl::encoding::Encode<SessionPresentResponse, D> for (T0,)
724    {
725        #[inline]
726        unsafe fn encode(
727            self,
728            encoder: &mut fidl::encoding::Encoder<'_, D>,
729            offset: usize,
730            depth: fidl::encoding::Depth,
731        ) -> fidl::Result<()> {
732            encoder.debug_check_bounds::<SessionPresentResponse>(offset);
733            // Zero out padding regions. There's no need to apply masks
734            // because the unmasked parts will be overwritten by fields.
735            // Write the fields.
736            self.0.encode(encoder, offset + 0, depth)?;
737            Ok(())
738        }
739    }
740
741    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
742        for SessionPresentResponse
743    {
744        #[inline(always)]
745        fn new_empty() -> Self {
746            Self {
747                presentation_info: fidl::new_empty!(
748                    fidl_fuchsia_images__common::PresentationInfo,
749                    D
750                ),
751            }
752        }
753
754        #[inline]
755        unsafe fn decode(
756            &mut self,
757            decoder: &mut fidl::encoding::Decoder<'_, D>,
758            offset: usize,
759            _depth: fidl::encoding::Depth,
760        ) -> fidl::Result<()> {
761            decoder.debug_check_bounds::<Self>(offset);
762            // Verify that padding bytes are zero.
763            fidl::decode!(
764                fidl_fuchsia_images__common::PresentationInfo,
765                D,
766                &mut self.presentation_info,
767                decoder,
768                offset + 0,
769                _depth
770            )?;
771            Ok(())
772        }
773    }
774
775    impl fidl::encoding::ValueTypeMarker for SessionRequestPresentationTimesRequest {
776        type Borrowed<'a> = &'a Self;
777        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
778            value
779        }
780    }
781
782    unsafe impl fidl::encoding::TypeMarker for SessionRequestPresentationTimesRequest {
783        type Owned = Self;
784
785        #[inline(always)]
786        fn inline_align(_context: fidl::encoding::Context) -> usize {
787            8
788        }
789
790        #[inline(always)]
791        fn inline_size(_context: fidl::encoding::Context) -> usize {
792            8
793        }
794        #[inline(always)]
795        fn encode_is_copy() -> bool {
796            true
797        }
798
799        #[inline(always)]
800        fn decode_is_copy() -> bool {
801            true
802        }
803    }
804
805    unsafe impl<D: fidl::encoding::ResourceDialect>
806        fidl::encoding::Encode<SessionRequestPresentationTimesRequest, D>
807        for &SessionRequestPresentationTimesRequest
808    {
809        #[inline]
810        unsafe fn encode(
811            self,
812            encoder: &mut fidl::encoding::Encoder<'_, D>,
813            offset: usize,
814            _depth: fidl::encoding::Depth,
815        ) -> fidl::Result<()> {
816            encoder.debug_check_bounds::<SessionRequestPresentationTimesRequest>(offset);
817            unsafe {
818                // Copy the object into the buffer.
819                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
820                (buf_ptr as *mut SessionRequestPresentationTimesRequest).write_unaligned(
821                    (self as *const SessionRequestPresentationTimesRequest).read(),
822                );
823                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
824                // done second because the memcpy will write garbage to these bytes.
825            }
826            Ok(())
827        }
828    }
829    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
830        fidl::encoding::Encode<SessionRequestPresentationTimesRequest, D> for (T0,)
831    {
832        #[inline]
833        unsafe fn encode(
834            self,
835            encoder: &mut fidl::encoding::Encoder<'_, D>,
836            offset: usize,
837            depth: fidl::encoding::Depth,
838        ) -> fidl::Result<()> {
839            encoder.debug_check_bounds::<SessionRequestPresentationTimesRequest>(offset);
840            // Zero out padding regions. There's no need to apply masks
841            // because the unmasked parts will be overwritten by fields.
842            // Write the fields.
843            self.0.encode(encoder, offset + 0, depth)?;
844            Ok(())
845        }
846    }
847
848    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
849        for SessionRequestPresentationTimesRequest
850    {
851        #[inline(always)]
852        fn new_empty() -> Self {
853            Self { requested_prediction_span: fidl::new_empty!(i64, D) }
854        }
855
856        #[inline]
857        unsafe fn decode(
858            &mut self,
859            decoder: &mut fidl::encoding::Decoder<'_, D>,
860            offset: usize,
861            _depth: fidl::encoding::Depth,
862        ) -> fidl::Result<()> {
863            decoder.debug_check_bounds::<Self>(offset);
864            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
865            // Verify that padding bytes are zero.
866            // Copy from the buffer into the object.
867            unsafe {
868                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
869            }
870            Ok(())
871        }
872    }
873
874    impl fidl::encoding::ValueTypeMarker for SessionRequestPresentationTimesResponse {
875        type Borrowed<'a> = &'a Self;
876        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
877            value
878        }
879    }
880
881    unsafe impl fidl::encoding::TypeMarker for SessionRequestPresentationTimesResponse {
882        type Owned = Self;
883
884        #[inline(always)]
885        fn inline_align(_context: fidl::encoding::Context) -> usize {
886            8
887        }
888
889        #[inline(always)]
890        fn inline_size(_context: fidl::encoding::Context) -> usize {
891            24
892        }
893    }
894
895    unsafe impl<D: fidl::encoding::ResourceDialect>
896        fidl::encoding::Encode<SessionRequestPresentationTimesResponse, D>
897        for &SessionRequestPresentationTimesResponse
898    {
899        #[inline]
900        unsafe fn encode(
901            self,
902            encoder: &mut fidl::encoding::Encoder<'_, D>,
903            offset: usize,
904            _depth: fidl::encoding::Depth,
905        ) -> fidl::Result<()> {
906            encoder.debug_check_bounds::<SessionRequestPresentationTimesResponse>(offset);
907            // Delegate to tuple encoding.
908            fidl::encoding::Encode::<SessionRequestPresentationTimesResponse, D>::encode(
909                (
910                    <fidl_fuchsia_scenic_scheduling__common::FuturePresentationTimes as fidl::encoding::ValueTypeMarker>::borrow(&self.request_presentation_times_info),
911                ),
912                encoder, offset, _depth
913            )
914        }
915    }
916    unsafe impl<
917        D: fidl::encoding::ResourceDialect,
918        T0: fidl::encoding::Encode<fidl_fuchsia_scenic_scheduling__common::FuturePresentationTimes, D>,
919    > fidl::encoding::Encode<SessionRequestPresentationTimesResponse, D> for (T0,)
920    {
921        #[inline]
922        unsafe fn encode(
923            self,
924            encoder: &mut fidl::encoding::Encoder<'_, D>,
925            offset: usize,
926            depth: fidl::encoding::Depth,
927        ) -> fidl::Result<()> {
928            encoder.debug_check_bounds::<SessionRequestPresentationTimesResponse>(offset);
929            // Zero out padding regions. There's no need to apply masks
930            // because the unmasked parts will be overwritten by fields.
931            // Write the fields.
932            self.0.encode(encoder, offset + 0, depth)?;
933            Ok(())
934        }
935    }
936
937    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
938        for SessionRequestPresentationTimesResponse
939    {
940        #[inline(always)]
941        fn new_empty() -> Self {
942            Self {
943                request_presentation_times_info: fidl::new_empty!(
944                    fidl_fuchsia_scenic_scheduling__common::FuturePresentationTimes,
945                    D
946                ),
947            }
948        }
949
950        #[inline]
951        unsafe fn decode(
952            &mut self,
953            decoder: &mut fidl::encoding::Decoder<'_, D>,
954            offset: usize,
955            _depth: fidl::encoding::Depth,
956        ) -> fidl::Result<()> {
957            decoder.debug_check_bounds::<Self>(offset);
958            // Verify that padding bytes are zero.
959            fidl::decode!(
960                fidl_fuchsia_scenic_scheduling__common::FuturePresentationTimes,
961                D,
962                &mut self.request_presentation_times_info,
963                decoder,
964                offset + 0,
965                _depth
966            )?;
967            Ok(())
968        }
969    }
970
971    impl fidl::encoding::ValueTypeMarker for SessionSetDebugNameRequest {
972        type Borrowed<'a> = &'a Self;
973        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
974            value
975        }
976    }
977
978    unsafe impl fidl::encoding::TypeMarker for SessionSetDebugNameRequest {
979        type Owned = Self;
980
981        #[inline(always)]
982        fn inline_align(_context: fidl::encoding::Context) -> usize {
983            8
984        }
985
986        #[inline(always)]
987        fn inline_size(_context: fidl::encoding::Context) -> usize {
988            16
989        }
990    }
991
992    unsafe impl<D: fidl::encoding::ResourceDialect>
993        fidl::encoding::Encode<SessionSetDebugNameRequest, D> for &SessionSetDebugNameRequest
994    {
995        #[inline]
996        unsafe fn encode(
997            self,
998            encoder: &mut fidl::encoding::Encoder<'_, D>,
999            offset: usize,
1000            _depth: fidl::encoding::Depth,
1001        ) -> fidl::Result<()> {
1002            encoder.debug_check_bounds::<SessionSetDebugNameRequest>(offset);
1003            // Delegate to tuple encoding.
1004            fidl::encoding::Encode::<SessionSetDebugNameRequest, D>::encode(
1005                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
1006                    &self.debug_name,
1007                ),),
1008                encoder,
1009                offset,
1010                _depth,
1011            )
1012        }
1013    }
1014    unsafe impl<
1015        D: fidl::encoding::ResourceDialect,
1016        T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
1017    > fidl::encoding::Encode<SessionSetDebugNameRequest, D> for (T0,)
1018    {
1019        #[inline]
1020        unsafe fn encode(
1021            self,
1022            encoder: &mut fidl::encoding::Encoder<'_, D>,
1023            offset: usize,
1024            depth: fidl::encoding::Depth,
1025        ) -> fidl::Result<()> {
1026            encoder.debug_check_bounds::<SessionSetDebugNameRequest>(offset);
1027            // Zero out padding regions. There's no need to apply masks
1028            // because the unmasked parts will be overwritten by fields.
1029            // Write the fields.
1030            self.0.encode(encoder, offset + 0, depth)?;
1031            Ok(())
1032        }
1033    }
1034
1035    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1036        for SessionSetDebugNameRequest
1037    {
1038        #[inline(always)]
1039        fn new_empty() -> Self {
1040            Self { debug_name: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
1041        }
1042
1043        #[inline]
1044        unsafe fn decode(
1045            &mut self,
1046            decoder: &mut fidl::encoding::Decoder<'_, D>,
1047            offset: usize,
1048            _depth: fidl::encoding::Depth,
1049        ) -> fidl::Result<()> {
1050            decoder.debug_check_bounds::<Self>(offset);
1051            // Verify that padding bytes are zero.
1052            fidl::decode!(
1053                fidl::encoding::UnboundedString,
1054                D,
1055                &mut self.debug_name,
1056                decoder,
1057                offset + 0,
1058                _depth
1059            )?;
1060            Ok(())
1061        }
1062    }
1063}