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