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