fidl_fuchsia_ui_composition_common/
fidl_fuchsia_ui_composition_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
11/// A user-defined identifier for future presentation info. A maximum of 8
12/// future presentation counts is enough for the current usage of these APIs.
13pub type FuturePresentationInfos = Vec<fidl_fuchsia_scenic_scheduling::PresentationInfo>;
14
15pub const MAX_ACQUIRE_RELEASE_FENCE_COUNT: i32 = 16;
16
17/// A maximum of 64 child transforms is enough for the expected usage of these APIs. Callers may
18/// beyond this limit using [`AddChild`].
19pub const MAX_CHILD_TRANSFORMS: i32 = 64;
20
21/// A maximum of 64 hit regions is enough for the expected usage of these APIs.
22pub const MAX_HIT_REGION_COUNT: i32 = 64;
23
24pub const MAX_PRESENT_ARGS_FENCE_COUNT: i32 = 16;
25
26bitflags! {
27    /// The possible usages for a registered buffer collection. Can be a combination of options.
28    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
29    pub struct RegisterBufferCollectionUsages: u16 {
30        /// The specified buffer collection can be used for Flatland and GFX image creation.
31        ///
32        /// See [`fuchsia.ui.composition/Flatland.CreateImage`] for more.
33        const DEFAULT = 1;
34        /// The specified buffer collection can be used for screenshotting purposes.
35        const SCREENSHOT = 2;
36    }
37}
38
39impl RegisterBufferCollectionUsages {
40    #[inline(always)]
41    pub fn from_bits_allow_unknown(bits: u16) -> Self {
42        Self::from_bits_retain(bits)
43    }
44
45    #[inline(always)]
46    pub fn has_unknown_bits(&self) -> bool {
47        self.get_unknown_bits() != 0
48    }
49
50    #[inline(always)]
51    pub fn get_unknown_bits(&self) -> u16 {
52        self.bits() & !Self::all().bits()
53    }
54}
55
56/// The set of possible blending functions to choose from when determining how an image should
57/// be composited on top of other images.
58#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
59#[repr(u32)]
60pub enum BlendMode {
61    /// Indicates that the source pixels replace the destination pixels. In other words,
62    /// the source pixels are treated as opaque, regardless of what alpha values are set.
63    Src = 1,
64    /// The source pixels are drawn over the destination pixels. The final pixel color
65    /// that is displayed is calculated as: C_src + (1.0 - alpha_src) * C_dst).
66    SrcOver = 2,
67}
68
69impl BlendMode {
70    #[inline]
71    pub fn from_primitive(prim: u32) -> Option<Self> {
72        match prim {
73            1 => Some(Self::Src),
74            2 => Some(Self::SrcOver),
75            _ => None,
76        }
77    }
78
79    #[inline]
80    pub const fn into_primitive(self) -> u32 {
81        self as u32
82    }
83}
84
85#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
86#[repr(u32)]
87pub enum ChildViewStatus {
88    /// The underlying Flatland instance has connected its View, called [`Present`], and the
89    /// acquisition fences of the [`Present`] call have all be reached, indicating that it has some
90    /// content ready to be displayed, and NOT that the child content has actually been shown on the
91    /// screen (a common use case is for the parent to wait for the child content to be ready before
92    /// attaching the child to the global scene graph).
93    ContentHasPresented = 1,
94}
95
96impl ChildViewStatus {
97    #[inline]
98    pub fn from_primitive(prim: u32) -> Option<Self> {
99        match prim {
100            1 => Some(Self::ContentHasPresented),
101            _ => None,
102        }
103    }
104
105    #[inline]
106    pub const fn into_primitive(self) -> u32 {
107        self as u32
108    }
109}
110
111/// The set of error codes returned in [`OnError`]. Everything except NO_ERROR, causes Flatland
112/// channel to be closed.
113#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
114#[repr(u32)]
115pub enum FlatlandError {
116    /// Indicates that the parameters used the function calls are invalid.
117    BadOperation = 1,
118    /// Indicates that `additional_present_credits` field was not properly processed and the client
119    /// queued more [`Present`]s than allowed.
120    NoPresentsRemaining = 2,
121    /// Indicates that the client has overwritten hanging gets in the protocols returned.
122    BadHangingGet = 3,
123}
124
125impl FlatlandError {
126    #[inline]
127    pub fn from_primitive(prim: u32) -> Option<Self> {
128        match prim {
129            1 => Some(Self::BadOperation),
130            2 => Some(Self::NoPresentsRemaining),
131            3 => Some(Self::BadHangingGet),
132            _ => None,
133        }
134    }
135
136    #[inline]
137    pub const fn into_primitive(self) -> u32 {
138        self as u32
139    }
140}
141
142/// The kind of hit test interaction expected for a hit region.
143#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
144pub enum HitTestInteraction {
145    /// The natural default behavior is for a hit region to interact with both regular hit testing
146    /// and accessibility hit testing.
147    Default,
148    /// Some use cases require that a hit region to interact with regular hit testing, but not
149    /// interact with accessibility hit testing. Here, "semantics" refers to accessibility's
150    /// semantic tree data, which describes UI elements in a View.
151    SemanticallyInvisible,
152    #[doc(hidden)]
153    __SourceBreaking { unknown_ordinal: u8 },
154}
155
156/// Pattern that matches an unknown `HitTestInteraction` member.
157#[macro_export]
158macro_rules! HitTestInteractionUnknown {
159    () => {
160        _
161    };
162}
163
164impl HitTestInteraction {
165    #[inline]
166    pub fn from_primitive(prim: u8) -> Option<Self> {
167        match prim {
168            0 => Some(Self::Default),
169            1 => Some(Self::SemanticallyInvisible),
170            _ => None,
171        }
172    }
173
174    #[inline]
175    pub fn from_primitive_allow_unknown(prim: u8) -> Self {
176        match prim {
177            0 => Self::Default,
178            1 => Self::SemanticallyInvisible,
179            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
180        }
181    }
182
183    #[inline]
184    pub fn unknown() -> Self {
185        Self::__SourceBreaking { unknown_ordinal: 0xff }
186    }
187
188    #[inline]
189    pub const fn into_primitive(self) -> u8 {
190        match self {
191            Self::Default => 0,
192            Self::SemanticallyInvisible => 1,
193            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
194        }
195    }
196
197    #[inline]
198    pub fn is_unknown(&self) -> bool {
199        match self {
200            Self::__SourceBreaking { unknown_ordinal: _ } => true,
201            _ => false,
202        }
203    }
204}
205
206/// The set of possible image flip functions to choose from when determining how the image texture
207/// should be displayed.
208#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
209#[repr(u32)]
210pub enum ImageFlip {
211    None = 0,
212    /// Let V be the vertical axis of reflection, positioned at width/2. Then each pixel's x
213    /// coordinate is reflected across V. The y coordinates remain constant. For instance:
214    /// |1234|                |4321|
215    /// |abcd|  would become  |dcba|
216    LeftRight = 1,
217    /// Let H be the horizontal axis of reflection, positioned at height/2. Then each pixel's y
218    /// coordinate is reflected across H. The x coordinates remain constant. For instance:
219    /// |1234|                |abcd|
220    /// |abcd|  would become  |1234|
221    UpDown = 2,
222}
223
224impl ImageFlip {
225    #[inline]
226    pub fn from_primitive(prim: u32) -> Option<Self> {
227        match prim {
228            0 => Some(Self::None),
229            1 => Some(Self::LeftRight),
230            2 => Some(Self::UpDown),
231            _ => None,
232        }
233    }
234
235    #[inline]
236    pub const fn into_primitive(self) -> u32 {
237        self as u32
238    }
239}
240
241/// In Flatland, the +X axis is to the right and +Y axis is down. There is no notion of a Z axis.
242/// Due to the lack of a Z axis, there is no mathematical notion of "handedness" (either right or
243/// left) with respect to rotation. Thus, we define a counter-clockwise rotation in the same way
244/// as if a skeuomorphic clock were to be displayed on the screen, with the hands of said clock
245/// moving in a CCW motion from the POV of the observer.
246#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
247#[repr(u32)]
248pub enum Orientation {
249    Ccw0Degrees = 1,
250    Ccw90Degrees = 2,
251    Ccw180Degrees = 3,
252    Ccw270Degrees = 4,
253}
254
255impl Orientation {
256    #[inline]
257    pub fn from_primitive(prim: u32) -> Option<Self> {
258        match prim {
259            1 => Some(Self::Ccw0Degrees),
260            2 => Some(Self::Ccw90Degrees),
261            3 => Some(Self::Ccw180Degrees),
262            4 => Some(Self::Ccw270Degrees),
263            _ => None,
264        }
265    }
266
267    #[inline]
268    pub const fn into_primitive(self) -> u32 {
269        self as u32
270    }
271}
272
273/// ParentViewportWatchers will be informed when they are actively attached to a output display
274/// (either directly, or through a chain of parent Viewports) and when they are not. Until they are
275/// connected to a display, some pieces of information (such as pixel scale) may be unavailable.
276#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
277#[repr(u32)]
278pub enum ParentViewportStatus {
279    ConnectedToDisplay = 1,
280    DisconnectedFromDisplay = 2,
281}
282
283impl ParentViewportStatus {
284    #[inline]
285    pub fn from_primitive(prim: u32) -> Option<Self> {
286        match prim {
287            1 => Some(Self::ConnectedToDisplay),
288            2 => Some(Self::DisconnectedFromDisplay),
289            _ => None,
290        }
291    }
292
293    #[inline]
294    pub const fn into_primitive(self) -> u32 {
295        self as u32
296    }
297}
298
299/// The set of error codes returned by Allocator::RegisterBufferCollection().
300#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
301#[repr(u32)]
302pub enum RegisterBufferCollectionError {
303    BadOperation = 1,
304}
305
306impl RegisterBufferCollectionError {
307    #[inline]
308    pub fn from_primitive(prim: u32) -> Option<Self> {
309        match prim {
310            1 => Some(Self::BadOperation),
311            _ => None,
312        }
313    }
314
315    #[inline]
316    pub const fn into_primitive(self) -> u32 {
317        self as u32
318    }
319}
320
321/// The possible usages for registered buffer collection.
322#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
323#[repr(u32)]
324pub enum RegisterBufferCollectionUsage {
325    /// DEFAULT means that the specified buffer collection will be used for
326    /// Flatland and gfx image creation.
327    ///
328    /// See [`fuchsia.ui.composition/Flatland.CreateImage`] for more.
329    Default = 0,
330    /// SCREENSHOT means that the specified buffer collection will be used for
331    /// screenshotting purposes.
332    Screenshot = 1,
333}
334
335impl RegisterBufferCollectionUsage {
336    #[inline]
337    pub fn from_primitive(prim: u32) -> Option<Self> {
338        match prim {
339            0 => Some(Self::Default),
340            1 => Some(Self::Screenshot),
341            _ => None,
342        }
343    }
344
345    #[inline]
346    pub const fn into_primitive(self) -> u32 {
347        self as u32
348    }
349}
350
351/// The rotation to be applied to the image.
352///
353/// If a given display is rotated, say, 270 degrees according to its
354/// `display_info` config file, then applying the equal and opposite rotation,
355/// [`CW_270_DEGREES`], should cancel the display rotation leading to a
356/// correctly rendered screenshot.
357///
358/// Clients should allocate an image according to the final dimensions they
359/// ultimately want to use, i.e. after rotation. These would be identical
360/// to the `width` and `height` values found in the `display_info` config file.
361#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
362#[repr(u32)]
363pub enum Rotation {
364    Cw0Degrees = 0,
365    Cw90Degrees = 1,
366    Cw180Degrees = 2,
367    Cw270Degrees = 3,
368}
369
370impl Rotation {
371    #[inline]
372    pub fn from_primitive(prim: u32) -> Option<Self> {
373        match prim {
374            0 => Some(Self::Cw0Degrees),
375            1 => Some(Self::Cw90Degrees),
376            2 => Some(Self::Cw180Degrees),
377            3 => Some(Self::Cw270Degrees),
378            _ => None,
379        }
380    }
381
382    #[inline]
383    pub const fn into_primitive(self) -> u32 {
384        self as u32
385    }
386}
387
388/// The possible errors from the ScreenCapture protocol.
389#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
390pub enum ScreenCaptureError {
391    /// One or more required arguments are missing in the table argument.
392    MissingArgs,
393    /// One or more of the arguments was not valid.
394    InvalidArgs,
395    /// A general error occurred during the method call.
396    BadOperation,
397    /// Error that is returned if [`GetNextFrame`] is called when all of the VMOs in the
398    /// BufferCollection have been rendered to. [`ReleaseFrame`] must be called before a
399    /// successful call to GetNextFrame can be made.
400    BufferFull,
401    #[doc(hidden)]
402    __SourceBreaking { unknown_ordinal: u32 },
403}
404
405/// Pattern that matches an unknown `ScreenCaptureError` member.
406#[macro_export]
407macro_rules! ScreenCaptureErrorUnknown {
408    () => {
409        _
410    };
411}
412
413impl ScreenCaptureError {
414    #[inline]
415    pub fn from_primitive(prim: u32) -> Option<Self> {
416        match prim {
417            1 => Some(Self::MissingArgs),
418            2 => Some(Self::InvalidArgs),
419            3 => Some(Self::BadOperation),
420            4 => Some(Self::BufferFull),
421            _ => None,
422        }
423    }
424
425    #[inline]
426    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
427        match prim {
428            1 => Self::MissingArgs,
429            2 => Self::InvalidArgs,
430            3 => Self::BadOperation,
431            4 => Self::BufferFull,
432            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
433        }
434    }
435
436    #[inline]
437    pub fn unknown() -> Self {
438        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
439    }
440
441    #[inline]
442    pub const fn into_primitive(self) -> u32 {
443        match self {
444            Self::MissingArgs => 1,
445            Self::InvalidArgs => 2,
446            Self::BadOperation => 3,
447            Self::BufferFull => 4,
448            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
449        }
450    }
451
452    #[inline]
453    pub fn is_unknown(&self) -> bool {
454        match self {
455            Self::__SourceBreaking { unknown_ordinal: _ } => true,
456            _ => false,
457        }
458    }
459}
460
461/// The different formats of Screenshot that can be requested.
462#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
463pub enum ScreenshotFormat {
464    /// The default format, requesting a tightly packed pixel data with 32 bit BGRA pixels.
465    BgraRaw,
466    /// Requests tightly packed pixel data with 32 bit RGBA pixels.
467    RgbaRaw,
468    /// Requests tightly packed pixel data which is compressed into PNG format.
469    Png,
470    #[doc(hidden)]
471    __SourceBreaking { unknown_ordinal: u8 },
472}
473
474/// Pattern that matches an unknown `ScreenshotFormat` member.
475#[macro_export]
476macro_rules! ScreenshotFormatUnknown {
477    () => {
478        _
479    };
480}
481
482impl ScreenshotFormat {
483    #[inline]
484    pub fn from_primitive(prim: u8) -> Option<Self> {
485        match prim {
486            0 => Some(Self::BgraRaw),
487            2 => Some(Self::RgbaRaw),
488            1 => Some(Self::Png),
489            _ => None,
490        }
491    }
492
493    #[inline]
494    pub fn from_primitive_allow_unknown(prim: u8) -> Self {
495        match prim {
496            0 => Self::BgraRaw,
497            2 => Self::RgbaRaw,
498            1 => Self::Png,
499            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
500        }
501    }
502
503    #[inline]
504    pub fn unknown() -> Self {
505        Self::__SourceBreaking { unknown_ordinal: 0xff }
506    }
507
508    #[inline]
509    pub const fn into_primitive(self) -> u8 {
510        match self {
511            Self::BgraRaw => 0,
512            Self::RgbaRaw => 2,
513            Self::Png => 1,
514            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
515        }
516    }
517
518    #[inline]
519    pub fn is_unknown(&self) -> bool {
520        match self {
521            Self::__SourceBreaking { unknown_ordinal: _ } => true,
522            _ => false,
523        }
524    }
525}
526
527#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
528pub struct ChildViewWatcherGetStatusResponse {
529    pub status: ChildViewStatus,
530}
531
532impl fidl::Persistable for ChildViewWatcherGetStatusResponse {}
533
534/// Represents a color with alpha channel.
535/// Values are unorm (i.e. the valid range is [0,1]), and are in linear color
536/// space. They are not gamma-corrected nor premultiplied.
537#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
538pub struct ColorRgba {
539    pub red: f32,
540    pub green: f32,
541    pub blue: f32,
542    pub alpha: f32,
543}
544
545impl fidl::Persistable for ColorRgba {}
546
547/// A user-defined identifier for a particular piece of Content. See Content creation functions
548/// (e.g. [`CreateViewport`], [`CreateImage`]) for more information.
549#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
550#[repr(C)]
551pub struct ContentId {
552    pub value: u64,
553}
554
555impl fidl::Persistable for ContentId {}
556
557#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
558#[repr(C)]
559pub struct FlatlandAddChildRequest {
560    pub parent_transform_id: TransformId,
561    pub child_transform_id: TransformId,
562}
563
564impl fidl::Persistable for FlatlandAddChildRequest {}
565
566#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
567#[repr(C)]
568pub struct FlatlandCreateTransformRequest {
569    pub transform_id: TransformId,
570}
571
572impl fidl::Persistable for FlatlandCreateTransformRequest {}
573
574#[derive(Clone, Debug, PartialEq)]
575pub struct FlatlandDisplaySetDevicePixelRatioRequest {
576    pub device_pixel_ratio: fidl_fuchsia_math::VecF,
577}
578
579impl fidl::Persistable for FlatlandDisplaySetDevicePixelRatioRequest {}
580
581#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
582pub struct FlatlandOnErrorRequest {
583    pub error: FlatlandError,
584}
585
586impl fidl::Persistable for FlatlandOnErrorRequest {}
587
588#[derive(Clone, Debug, PartialEq)]
589pub struct FlatlandOnFramePresentedRequest {
590    pub frame_presented_info: fidl_fuchsia_scenic_scheduling::FramePresentedInfo,
591}
592
593impl fidl::Persistable for FlatlandOnFramePresentedRequest {}
594
595#[derive(Clone, Debug, PartialEq)]
596pub struct FlatlandOnNextFrameBeginRequest {
597    pub values: OnNextFrameBeginValues,
598}
599
600impl fidl::Persistable for FlatlandOnNextFrameBeginRequest {}
601
602#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
603#[repr(C)]
604pub struct FlatlandReleaseFilledRectRequest {
605    pub rect_id: ContentId,
606}
607
608impl fidl::Persistable for FlatlandReleaseFilledRectRequest {}
609
610#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
611#[repr(C)]
612pub struct FlatlandReleaseImageRequest {
613    pub image_id: ContentId,
614}
615
616impl fidl::Persistable for FlatlandReleaseImageRequest {}
617
618#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
619#[repr(C)]
620pub struct FlatlandReleaseTransformRequest {
621    pub transform_id: TransformId,
622}
623
624impl fidl::Persistable for FlatlandReleaseTransformRequest {}
625
626#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
627#[repr(C)]
628pub struct FlatlandReleaseViewportRequest {
629    pub viewport_id: ContentId,
630}
631
632impl fidl::Persistable for FlatlandReleaseViewportRequest {}
633
634#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
635#[repr(C)]
636pub struct FlatlandRemoveChildRequest {
637    pub parent_transform_id: TransformId,
638    pub child_transform_id: TransformId,
639}
640
641impl fidl::Persistable for FlatlandRemoveChildRequest {}
642
643#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
644pub struct FlatlandReplaceChildrenRequest {
645    pub parent_transform_id: TransformId,
646    pub new_child_transform_ids: Vec<TransformId>,
647}
648
649impl fidl::Persistable for FlatlandReplaceChildrenRequest {}
650
651#[derive(Clone, Debug, PartialEq)]
652pub struct FlatlandSetClipBoundaryRequest {
653    pub transform_id: TransformId,
654    pub rect: Option<Box<fidl_fuchsia_math::Rect>>,
655}
656
657impl fidl::Persistable for FlatlandSetClipBoundaryRequest {}
658
659#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
660#[repr(C)]
661pub struct FlatlandSetContentRequest {
662    pub transform_id: TransformId,
663    pub content_id: ContentId,
664}
665
666impl fidl::Persistable for FlatlandSetContentRequest {}
667
668#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
669pub struct FlatlandSetDebugNameRequest {
670    pub name: String,
671}
672
673impl fidl::Persistable for FlatlandSetDebugNameRequest {}
674
675#[derive(Clone, Debug, PartialEq)]
676pub struct FlatlandSetHitRegionsRequest {
677    pub transform_id: TransformId,
678    /// Each region's [`HitRegion.region.width`] and [`HitRegion.region.height`] field must be a
679    /// non-negative value.
680    pub regions: Vec<HitRegion>,
681}
682
683impl fidl::Persistable for FlatlandSetHitRegionsRequest {}
684
685#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
686pub struct FlatlandSetImageBlendingFunctionRequest {
687    pub image_id: ContentId,
688    pub blend_mode: BlendMode,
689}
690
691impl fidl::Persistable for FlatlandSetImageBlendingFunctionRequest {}
692
693#[derive(Clone, Debug, PartialEq)]
694pub struct FlatlandSetImageDestinationSizeRequest {
695    pub image_id: ContentId,
696    pub size: fidl_fuchsia_math::SizeU,
697}
698
699impl fidl::Persistable for FlatlandSetImageDestinationSizeRequest {}
700
701#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
702pub struct FlatlandSetImageFlipRequest {
703    pub image_id: ContentId,
704    pub flip: ImageFlip,
705}
706
707impl fidl::Persistable for FlatlandSetImageFlipRequest {}
708
709#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
710pub struct FlatlandSetImageOpacityRequest {
711    pub image_id: ContentId,
712    pub val: f32,
713}
714
715impl fidl::Persistable for FlatlandSetImageOpacityRequest {}
716
717#[derive(Clone, Debug, PartialEq)]
718pub struct FlatlandSetImageSampleRegionRequest {
719    pub image_id: ContentId,
720    pub rect: fidl_fuchsia_math::RectF,
721}
722
723impl fidl::Persistable for FlatlandSetImageSampleRegionRequest {}
724
725#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
726pub struct FlatlandSetInfiniteHitRegionRequest {
727    pub transform_id: TransformId,
728    pub hit_test: HitTestInteraction,
729}
730
731impl fidl::Persistable for FlatlandSetInfiniteHitRegionRequest {}
732
733#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
734pub struct FlatlandSetOpacityRequest {
735    pub transform_id: TransformId,
736    pub value: f32,
737}
738
739impl fidl::Persistable for FlatlandSetOpacityRequest {}
740
741#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
742pub struct FlatlandSetOrientationRequest {
743    pub transform_id: TransformId,
744    pub orientation: Orientation,
745}
746
747impl fidl::Persistable for FlatlandSetOrientationRequest {}
748
749#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
750#[repr(C)]
751pub struct FlatlandSetRootTransformRequest {
752    pub transform_id: TransformId,
753}
754
755impl fidl::Persistable for FlatlandSetRootTransformRequest {}
756
757#[derive(Clone, Debug, PartialEq)]
758pub struct FlatlandSetScaleRequest {
759    pub transform_id: TransformId,
760    pub scale: fidl_fuchsia_math::VecF,
761}
762
763impl fidl::Persistable for FlatlandSetScaleRequest {}
764
765#[derive(Clone, Debug, PartialEq)]
766pub struct FlatlandSetTranslationRequest {
767    pub transform_id: TransformId,
768    pub translation: fidl_fuchsia_math::Vec_,
769}
770
771impl fidl::Persistable for FlatlandSetTranslationRequest {}
772
773#[derive(Clone, Debug, PartialEq)]
774pub struct FlatlandSetViewportPropertiesRequest {
775    pub viewport_id: ContentId,
776    pub properties: ViewportProperties,
777}
778
779impl fidl::Persistable for FlatlandSetViewportPropertiesRequest {}
780
781/// An interactive area of a View, placed in the coordinate space of a specific Transform.
782#[derive(Clone, Debug, PartialEq)]
783pub struct HitRegion {
784    /// The position and size of this hit region, in the coordinate space of the Transform that owns
785    /// this hit region.
786    pub region: fidl_fuchsia_math::RectF,
787    /// The interaction behavior specified for this hit region.
788    /// To specify "no interaction at all", remove this hit region from the owning Transform.
789    pub hit_test: HitTestInteraction,
790}
791
792impl fidl::Persistable for HitRegion {}
793
794#[derive(Clone, Debug, PartialEq)]
795pub struct ParentViewportWatcherGetLayoutResponse {
796    pub info: LayoutInfo,
797}
798
799impl fidl::Persistable for ParentViewportWatcherGetLayoutResponse {}
800
801#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
802pub struct ParentViewportWatcherGetStatusResponse {
803    pub status: ParentViewportStatus,
804}
805
806impl fidl::Persistable for ParentViewportWatcherGetStatusResponse {}
807
808#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
809#[repr(C)]
810pub struct ScreenCaptureReleaseFrameRequest {
811    pub buffer_id: u32,
812}
813
814impl fidl::Persistable for ScreenCaptureReleaseFrameRequest {}
815
816/// A user-defined identifier for a particular transform. See [`CreateTransform`] and
817/// [`ReleaseTransform`] for more information.
818#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
819#[repr(C)]
820pub struct TransformId {
821    pub value: u64,
822}
823
824impl fidl::Persistable for TransformId {}
825
826/// The properties of an Image as defined by the client. These properties determine how an Image
827/// uses the backing BufferCollection. See [`CreateImage`] for more information.
828#[derive(Clone, Debug, Default, PartialEq)]
829pub struct ImageProperties {
830    /// The size of the Image in pixels.
831    pub size: Option<fidl_fuchsia_math::SizeU>,
832    #[doc(hidden)]
833    pub __source_breaking: fidl::marker::SourceBreaking,
834}
835
836impl fidl::Persistable for ImageProperties {}
837
838/// The return type of [`GetLayout`]. This table contains most of the information necessary
839/// for a client to decide how to layout their content in a Flatland instance. This data may be
840/// provided to the client before the command that creates the View is presented, so that the
841/// client may lay out content properly before their first call to [`Present`].
842#[derive(Clone, Debug, Default, PartialEq)]
843pub struct LayoutInfo {
844    /// The layout size of a View in logical pixels, defined by the parent's call to
845    /// [`SetViewportProperties`].
846    ///
847    /// The logical size also serves as the clip boundary of the View. Anything outside the clip
848    /// boundary will not be rendered. Hence, the View's Root Transform has a useful coordinate
849    /// space of (0, 0) to (logical_size.width, logical_size.height).
850    ///
851    /// Clients should re-layout their content when this value changes.
852    pub logical_size: Option<fidl_fuchsia_math::SizeU>,
853    /// The ratio of display's physical pixels to device independent pixels. Each logical pixel of a
854    /// View is displayed on-screen by one or more physical pixels, as determined by this scale.
855    /// Clients should not necessarily re-layout their content when this value changes, but
856    /// accommodate by reallocating their Image buffers to avoid sampling artifacts. The HiDPI-aware
857    /// client should allocate buffers that are sized (`logical_size`*`device_pixel_ratio`).
858    pub device_pixel_ratio: Option<fidl_fuchsia_math::VecF>,
859    /// The offsets between the edges and the visible rectangle of the View. The clients can assume
860    /// that the boundary region between the inset and the View edge is occluded, and should adjust
861    /// content layout to avoid this region. This inset is described in the view's logical
862    /// coordinate system. The HiDPI-aware clients should scale this by `device_pixel_ratio`.
863    pub inset: Option<fidl_fuchsia_math::Inset>,
864    #[doc(hidden)]
865    pub __source_breaking: fidl::marker::SourceBreaking,
866}
867
868impl fidl::Persistable for LayoutInfo {}
869
870/// Fields that a client needs in order to produce its next frame, returned in
871/// [`OnNextFrameBegin`]. Each field is guaranteed to be  set and contain valid information.
872#[derive(Clone, Debug, Default, PartialEq)]
873pub struct OnNextFrameBeginValues {
874    /// The number of *additional* [`Present`] calls allowed to the client so that they
875    /// can call [`Present`] further times. This is a delta in the present
876    /// credit budget, not the absolute number of present credits.
877    pub additional_present_credits: Option<u32>,
878    /// Information about future presentation and latch times that a client may aim for
879    /// precise scheduling behavior.
880    pub future_presentation_infos: Option<Vec<fidl_fuchsia_scenic_scheduling::PresentationInfo>>,
881    #[doc(hidden)]
882    pub __source_breaking: fidl::marker::SourceBreaking,
883}
884
885impl fidl::Persistable for OnNextFrameBeginValues {}
886
887/// The properties of a Viewport as defined by the parent. This data, along with the set of attached
888/// Transforms, will be used to compute the LayoutInfo for the View of the Viewport.
889/// `ViewportProperties` must have `logical_size` set at least once. This is the initial size that
890/// will drive the layout of the child.
891#[derive(Clone, Debug, Default, PartialEq)]
892pub struct ViewportProperties {
893    /// The size of the Viewport in logical pixels. This maps directly to the logical_size field in
894    /// LayoutInfo. The valid logical_size must have positive X and Y components.
895    pub logical_size: Option<fidl_fuchsia_math::SizeU>,
896    /// The offsets between the edges and the visible rectangle of the Viewport. This maps directly
897    /// to the `inset` field in LayoutInfo. The valid inset must have all components greater than or
898    /// equal to 0.
899    pub inset: Option<fidl_fuchsia_math::Inset>,
900    #[doc(hidden)]
901    pub __source_breaking: fidl::marker::SourceBreaking,
902}
903
904impl fidl::Persistable for ViewportProperties {}
905
906mod internal {
907    use super::*;
908    unsafe impl fidl::encoding::TypeMarker for RegisterBufferCollectionUsages {
909        type Owned = Self;
910
911        #[inline(always)]
912        fn inline_align(_context: fidl::encoding::Context) -> usize {
913            2
914        }
915
916        #[inline(always)]
917        fn inline_size(_context: fidl::encoding::Context) -> usize {
918            2
919        }
920    }
921
922    impl fidl::encoding::ValueTypeMarker for RegisterBufferCollectionUsages {
923        type Borrowed<'a> = Self;
924        #[inline(always)]
925        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
926            *value
927        }
928    }
929
930    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
931        for RegisterBufferCollectionUsages
932    {
933        #[inline]
934        unsafe fn encode(
935            self,
936            encoder: &mut fidl::encoding::Encoder<'_, D>,
937            offset: usize,
938            _depth: fidl::encoding::Depth,
939        ) -> fidl::Result<()> {
940            encoder.debug_check_bounds::<Self>(offset);
941            encoder.write_num(self.bits(), offset);
942            Ok(())
943        }
944    }
945
946    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
947        for RegisterBufferCollectionUsages
948    {
949        #[inline(always)]
950        fn new_empty() -> Self {
951            Self::empty()
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            let prim = decoder.read_num::<u16>(offset);
963            *self = Self::from_bits_allow_unknown(prim);
964            Ok(())
965        }
966    }
967    unsafe impl fidl::encoding::TypeMarker for BlendMode {
968        type Owned = Self;
969
970        #[inline(always)]
971        fn inline_align(_context: fidl::encoding::Context) -> usize {
972            std::mem::align_of::<u32>()
973        }
974
975        #[inline(always)]
976        fn inline_size(_context: fidl::encoding::Context) -> usize {
977            std::mem::size_of::<u32>()
978        }
979
980        #[inline(always)]
981        fn encode_is_copy() -> bool {
982            true
983        }
984
985        #[inline(always)]
986        fn decode_is_copy() -> bool {
987            false
988        }
989    }
990
991    impl fidl::encoding::ValueTypeMarker for BlendMode {
992        type Borrowed<'a> = Self;
993        #[inline(always)]
994        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
995            *value
996        }
997    }
998
999    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for BlendMode {
1000        #[inline]
1001        unsafe fn encode(
1002            self,
1003            encoder: &mut fidl::encoding::Encoder<'_, D>,
1004            offset: usize,
1005            _depth: fidl::encoding::Depth,
1006        ) -> fidl::Result<()> {
1007            encoder.debug_check_bounds::<Self>(offset);
1008            encoder.write_num(self.into_primitive(), offset);
1009            Ok(())
1010        }
1011    }
1012
1013    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlendMode {
1014        #[inline(always)]
1015        fn new_empty() -> Self {
1016            Self::Src
1017        }
1018
1019        #[inline]
1020        unsafe fn decode(
1021            &mut self,
1022            decoder: &mut fidl::encoding::Decoder<'_, D>,
1023            offset: usize,
1024            _depth: fidl::encoding::Depth,
1025        ) -> fidl::Result<()> {
1026            decoder.debug_check_bounds::<Self>(offset);
1027            let prim = decoder.read_num::<u32>(offset);
1028
1029            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1030            Ok(())
1031        }
1032    }
1033    unsafe impl fidl::encoding::TypeMarker for ChildViewStatus {
1034        type Owned = Self;
1035
1036        #[inline(always)]
1037        fn inline_align(_context: fidl::encoding::Context) -> usize {
1038            std::mem::align_of::<u32>()
1039        }
1040
1041        #[inline(always)]
1042        fn inline_size(_context: fidl::encoding::Context) -> usize {
1043            std::mem::size_of::<u32>()
1044        }
1045
1046        #[inline(always)]
1047        fn encode_is_copy() -> bool {
1048            true
1049        }
1050
1051        #[inline(always)]
1052        fn decode_is_copy() -> bool {
1053            false
1054        }
1055    }
1056
1057    impl fidl::encoding::ValueTypeMarker for ChildViewStatus {
1058        type Borrowed<'a> = Self;
1059        #[inline(always)]
1060        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1061            *value
1062        }
1063    }
1064
1065    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1066        for ChildViewStatus
1067    {
1068        #[inline]
1069        unsafe fn encode(
1070            self,
1071            encoder: &mut fidl::encoding::Encoder<'_, D>,
1072            offset: usize,
1073            _depth: fidl::encoding::Depth,
1074        ) -> fidl::Result<()> {
1075            encoder.debug_check_bounds::<Self>(offset);
1076            encoder.write_num(self.into_primitive(), offset);
1077            Ok(())
1078        }
1079    }
1080
1081    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChildViewStatus {
1082        #[inline(always)]
1083        fn new_empty() -> Self {
1084            Self::ContentHasPresented
1085        }
1086
1087        #[inline]
1088        unsafe fn decode(
1089            &mut self,
1090            decoder: &mut fidl::encoding::Decoder<'_, D>,
1091            offset: usize,
1092            _depth: fidl::encoding::Depth,
1093        ) -> fidl::Result<()> {
1094            decoder.debug_check_bounds::<Self>(offset);
1095            let prim = decoder.read_num::<u32>(offset);
1096
1097            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1098            Ok(())
1099        }
1100    }
1101    unsafe impl fidl::encoding::TypeMarker for FlatlandError {
1102        type Owned = Self;
1103
1104        #[inline(always)]
1105        fn inline_align(_context: fidl::encoding::Context) -> usize {
1106            std::mem::align_of::<u32>()
1107        }
1108
1109        #[inline(always)]
1110        fn inline_size(_context: fidl::encoding::Context) -> usize {
1111            std::mem::size_of::<u32>()
1112        }
1113
1114        #[inline(always)]
1115        fn encode_is_copy() -> bool {
1116            true
1117        }
1118
1119        #[inline(always)]
1120        fn decode_is_copy() -> bool {
1121            false
1122        }
1123    }
1124
1125    impl fidl::encoding::ValueTypeMarker for FlatlandError {
1126        type Borrowed<'a> = Self;
1127        #[inline(always)]
1128        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1129            *value
1130        }
1131    }
1132
1133    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FlatlandError {
1134        #[inline]
1135        unsafe fn encode(
1136            self,
1137            encoder: &mut fidl::encoding::Encoder<'_, D>,
1138            offset: usize,
1139            _depth: fidl::encoding::Depth,
1140        ) -> fidl::Result<()> {
1141            encoder.debug_check_bounds::<Self>(offset);
1142            encoder.write_num(self.into_primitive(), offset);
1143            Ok(())
1144        }
1145    }
1146
1147    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FlatlandError {
1148        #[inline(always)]
1149        fn new_empty() -> Self {
1150            Self::BadOperation
1151        }
1152
1153        #[inline]
1154        unsafe fn decode(
1155            &mut self,
1156            decoder: &mut fidl::encoding::Decoder<'_, D>,
1157            offset: usize,
1158            _depth: fidl::encoding::Depth,
1159        ) -> fidl::Result<()> {
1160            decoder.debug_check_bounds::<Self>(offset);
1161            let prim = decoder.read_num::<u32>(offset);
1162
1163            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1164            Ok(())
1165        }
1166    }
1167    unsafe impl fidl::encoding::TypeMarker for HitTestInteraction {
1168        type Owned = Self;
1169
1170        #[inline(always)]
1171        fn inline_align(_context: fidl::encoding::Context) -> usize {
1172            std::mem::align_of::<u8>()
1173        }
1174
1175        #[inline(always)]
1176        fn inline_size(_context: fidl::encoding::Context) -> usize {
1177            std::mem::size_of::<u8>()
1178        }
1179
1180        #[inline(always)]
1181        fn encode_is_copy() -> bool {
1182            false
1183        }
1184
1185        #[inline(always)]
1186        fn decode_is_copy() -> bool {
1187            false
1188        }
1189    }
1190
1191    impl fidl::encoding::ValueTypeMarker for HitTestInteraction {
1192        type Borrowed<'a> = Self;
1193        #[inline(always)]
1194        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1195            *value
1196        }
1197    }
1198
1199    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1200        for HitTestInteraction
1201    {
1202        #[inline]
1203        unsafe fn encode(
1204            self,
1205            encoder: &mut fidl::encoding::Encoder<'_, D>,
1206            offset: usize,
1207            _depth: fidl::encoding::Depth,
1208        ) -> fidl::Result<()> {
1209            encoder.debug_check_bounds::<Self>(offset);
1210            encoder.write_num(self.into_primitive(), offset);
1211            Ok(())
1212        }
1213    }
1214
1215    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HitTestInteraction {
1216        #[inline(always)]
1217        fn new_empty() -> Self {
1218            Self::unknown()
1219        }
1220
1221        #[inline]
1222        unsafe fn decode(
1223            &mut self,
1224            decoder: &mut fidl::encoding::Decoder<'_, D>,
1225            offset: usize,
1226            _depth: fidl::encoding::Depth,
1227        ) -> fidl::Result<()> {
1228            decoder.debug_check_bounds::<Self>(offset);
1229            let prim = decoder.read_num::<u8>(offset);
1230
1231            *self = Self::from_primitive_allow_unknown(prim);
1232            Ok(())
1233        }
1234    }
1235    unsafe impl fidl::encoding::TypeMarker for ImageFlip {
1236        type Owned = Self;
1237
1238        #[inline(always)]
1239        fn inline_align(_context: fidl::encoding::Context) -> usize {
1240            std::mem::align_of::<u32>()
1241        }
1242
1243        #[inline(always)]
1244        fn inline_size(_context: fidl::encoding::Context) -> usize {
1245            std::mem::size_of::<u32>()
1246        }
1247
1248        #[inline(always)]
1249        fn encode_is_copy() -> bool {
1250            true
1251        }
1252
1253        #[inline(always)]
1254        fn decode_is_copy() -> bool {
1255            false
1256        }
1257    }
1258
1259    impl fidl::encoding::ValueTypeMarker for ImageFlip {
1260        type Borrowed<'a> = Self;
1261        #[inline(always)]
1262        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1263            *value
1264        }
1265    }
1266
1267    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ImageFlip {
1268        #[inline]
1269        unsafe fn encode(
1270            self,
1271            encoder: &mut fidl::encoding::Encoder<'_, D>,
1272            offset: usize,
1273            _depth: fidl::encoding::Depth,
1274        ) -> fidl::Result<()> {
1275            encoder.debug_check_bounds::<Self>(offset);
1276            encoder.write_num(self.into_primitive(), offset);
1277            Ok(())
1278        }
1279    }
1280
1281    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageFlip {
1282        #[inline(always)]
1283        fn new_empty() -> Self {
1284            Self::None
1285        }
1286
1287        #[inline]
1288        unsafe fn decode(
1289            &mut self,
1290            decoder: &mut fidl::encoding::Decoder<'_, D>,
1291            offset: usize,
1292            _depth: fidl::encoding::Depth,
1293        ) -> fidl::Result<()> {
1294            decoder.debug_check_bounds::<Self>(offset);
1295            let prim = decoder.read_num::<u32>(offset);
1296
1297            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1298            Ok(())
1299        }
1300    }
1301    unsafe impl fidl::encoding::TypeMarker for Orientation {
1302        type Owned = Self;
1303
1304        #[inline(always)]
1305        fn inline_align(_context: fidl::encoding::Context) -> usize {
1306            std::mem::align_of::<u32>()
1307        }
1308
1309        #[inline(always)]
1310        fn inline_size(_context: fidl::encoding::Context) -> usize {
1311            std::mem::size_of::<u32>()
1312        }
1313
1314        #[inline(always)]
1315        fn encode_is_copy() -> bool {
1316            true
1317        }
1318
1319        #[inline(always)]
1320        fn decode_is_copy() -> bool {
1321            false
1322        }
1323    }
1324
1325    impl fidl::encoding::ValueTypeMarker for Orientation {
1326        type Borrowed<'a> = Self;
1327        #[inline(always)]
1328        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1329            *value
1330        }
1331    }
1332
1333    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Orientation {
1334        #[inline]
1335        unsafe fn encode(
1336            self,
1337            encoder: &mut fidl::encoding::Encoder<'_, D>,
1338            offset: usize,
1339            _depth: fidl::encoding::Depth,
1340        ) -> fidl::Result<()> {
1341            encoder.debug_check_bounds::<Self>(offset);
1342            encoder.write_num(self.into_primitive(), offset);
1343            Ok(())
1344        }
1345    }
1346
1347    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Orientation {
1348        #[inline(always)]
1349        fn new_empty() -> Self {
1350            Self::Ccw0Degrees
1351        }
1352
1353        #[inline]
1354        unsafe fn decode(
1355            &mut self,
1356            decoder: &mut fidl::encoding::Decoder<'_, D>,
1357            offset: usize,
1358            _depth: fidl::encoding::Depth,
1359        ) -> fidl::Result<()> {
1360            decoder.debug_check_bounds::<Self>(offset);
1361            let prim = decoder.read_num::<u32>(offset);
1362
1363            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1364            Ok(())
1365        }
1366    }
1367    unsafe impl fidl::encoding::TypeMarker for ParentViewportStatus {
1368        type Owned = Self;
1369
1370        #[inline(always)]
1371        fn inline_align(_context: fidl::encoding::Context) -> usize {
1372            std::mem::align_of::<u32>()
1373        }
1374
1375        #[inline(always)]
1376        fn inline_size(_context: fidl::encoding::Context) -> usize {
1377            std::mem::size_of::<u32>()
1378        }
1379
1380        #[inline(always)]
1381        fn encode_is_copy() -> bool {
1382            true
1383        }
1384
1385        #[inline(always)]
1386        fn decode_is_copy() -> bool {
1387            false
1388        }
1389    }
1390
1391    impl fidl::encoding::ValueTypeMarker for ParentViewportStatus {
1392        type Borrowed<'a> = Self;
1393        #[inline(always)]
1394        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1395            *value
1396        }
1397    }
1398
1399    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1400        for ParentViewportStatus
1401    {
1402        #[inline]
1403        unsafe fn encode(
1404            self,
1405            encoder: &mut fidl::encoding::Encoder<'_, D>,
1406            offset: usize,
1407            _depth: fidl::encoding::Depth,
1408        ) -> fidl::Result<()> {
1409            encoder.debug_check_bounds::<Self>(offset);
1410            encoder.write_num(self.into_primitive(), offset);
1411            Ok(())
1412        }
1413    }
1414
1415    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ParentViewportStatus {
1416        #[inline(always)]
1417        fn new_empty() -> Self {
1418            Self::ConnectedToDisplay
1419        }
1420
1421        #[inline]
1422        unsafe fn decode(
1423            &mut self,
1424            decoder: &mut fidl::encoding::Decoder<'_, D>,
1425            offset: usize,
1426            _depth: fidl::encoding::Depth,
1427        ) -> fidl::Result<()> {
1428            decoder.debug_check_bounds::<Self>(offset);
1429            let prim = decoder.read_num::<u32>(offset);
1430
1431            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1432            Ok(())
1433        }
1434    }
1435    unsafe impl fidl::encoding::TypeMarker for RegisterBufferCollectionError {
1436        type Owned = Self;
1437
1438        #[inline(always)]
1439        fn inline_align(_context: fidl::encoding::Context) -> usize {
1440            std::mem::align_of::<u32>()
1441        }
1442
1443        #[inline(always)]
1444        fn inline_size(_context: fidl::encoding::Context) -> usize {
1445            std::mem::size_of::<u32>()
1446        }
1447
1448        #[inline(always)]
1449        fn encode_is_copy() -> bool {
1450            true
1451        }
1452
1453        #[inline(always)]
1454        fn decode_is_copy() -> bool {
1455            false
1456        }
1457    }
1458
1459    impl fidl::encoding::ValueTypeMarker for RegisterBufferCollectionError {
1460        type Borrowed<'a> = Self;
1461        #[inline(always)]
1462        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1463            *value
1464        }
1465    }
1466
1467    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1468        for RegisterBufferCollectionError
1469    {
1470        #[inline]
1471        unsafe fn encode(
1472            self,
1473            encoder: &mut fidl::encoding::Encoder<'_, D>,
1474            offset: usize,
1475            _depth: fidl::encoding::Depth,
1476        ) -> fidl::Result<()> {
1477            encoder.debug_check_bounds::<Self>(offset);
1478            encoder.write_num(self.into_primitive(), offset);
1479            Ok(())
1480        }
1481    }
1482
1483    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1484        for RegisterBufferCollectionError
1485    {
1486        #[inline(always)]
1487        fn new_empty() -> Self {
1488            Self::BadOperation
1489        }
1490
1491        #[inline]
1492        unsafe fn decode(
1493            &mut self,
1494            decoder: &mut fidl::encoding::Decoder<'_, D>,
1495            offset: usize,
1496            _depth: fidl::encoding::Depth,
1497        ) -> fidl::Result<()> {
1498            decoder.debug_check_bounds::<Self>(offset);
1499            let prim = decoder.read_num::<u32>(offset);
1500
1501            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1502            Ok(())
1503        }
1504    }
1505    unsafe impl fidl::encoding::TypeMarker for RegisterBufferCollectionUsage {
1506        type Owned = Self;
1507
1508        #[inline(always)]
1509        fn inline_align(_context: fidl::encoding::Context) -> usize {
1510            std::mem::align_of::<u32>()
1511        }
1512
1513        #[inline(always)]
1514        fn inline_size(_context: fidl::encoding::Context) -> usize {
1515            std::mem::size_of::<u32>()
1516        }
1517
1518        #[inline(always)]
1519        fn encode_is_copy() -> bool {
1520            true
1521        }
1522
1523        #[inline(always)]
1524        fn decode_is_copy() -> bool {
1525            false
1526        }
1527    }
1528
1529    impl fidl::encoding::ValueTypeMarker for RegisterBufferCollectionUsage {
1530        type Borrowed<'a> = Self;
1531        #[inline(always)]
1532        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1533            *value
1534        }
1535    }
1536
1537    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1538        for RegisterBufferCollectionUsage
1539    {
1540        #[inline]
1541        unsafe fn encode(
1542            self,
1543            encoder: &mut fidl::encoding::Encoder<'_, D>,
1544            offset: usize,
1545            _depth: fidl::encoding::Depth,
1546        ) -> fidl::Result<()> {
1547            encoder.debug_check_bounds::<Self>(offset);
1548            encoder.write_num(self.into_primitive(), offset);
1549            Ok(())
1550        }
1551    }
1552
1553    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1554        for RegisterBufferCollectionUsage
1555    {
1556        #[inline(always)]
1557        fn new_empty() -> Self {
1558            Self::Default
1559        }
1560
1561        #[inline]
1562        unsafe fn decode(
1563            &mut self,
1564            decoder: &mut fidl::encoding::Decoder<'_, D>,
1565            offset: usize,
1566            _depth: fidl::encoding::Depth,
1567        ) -> fidl::Result<()> {
1568            decoder.debug_check_bounds::<Self>(offset);
1569            let prim = decoder.read_num::<u32>(offset);
1570
1571            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1572            Ok(())
1573        }
1574    }
1575    unsafe impl fidl::encoding::TypeMarker for Rotation {
1576        type Owned = Self;
1577
1578        #[inline(always)]
1579        fn inline_align(_context: fidl::encoding::Context) -> usize {
1580            std::mem::align_of::<u32>()
1581        }
1582
1583        #[inline(always)]
1584        fn inline_size(_context: fidl::encoding::Context) -> usize {
1585            std::mem::size_of::<u32>()
1586        }
1587
1588        #[inline(always)]
1589        fn encode_is_copy() -> bool {
1590            true
1591        }
1592
1593        #[inline(always)]
1594        fn decode_is_copy() -> bool {
1595            false
1596        }
1597    }
1598
1599    impl fidl::encoding::ValueTypeMarker for Rotation {
1600        type Borrowed<'a> = Self;
1601        #[inline(always)]
1602        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1603            *value
1604        }
1605    }
1606
1607    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Rotation {
1608        #[inline]
1609        unsafe fn encode(
1610            self,
1611            encoder: &mut fidl::encoding::Encoder<'_, D>,
1612            offset: usize,
1613            _depth: fidl::encoding::Depth,
1614        ) -> fidl::Result<()> {
1615            encoder.debug_check_bounds::<Self>(offset);
1616            encoder.write_num(self.into_primitive(), offset);
1617            Ok(())
1618        }
1619    }
1620
1621    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Rotation {
1622        #[inline(always)]
1623        fn new_empty() -> Self {
1624            Self::Cw0Degrees
1625        }
1626
1627        #[inline]
1628        unsafe fn decode(
1629            &mut self,
1630            decoder: &mut fidl::encoding::Decoder<'_, D>,
1631            offset: usize,
1632            _depth: fidl::encoding::Depth,
1633        ) -> fidl::Result<()> {
1634            decoder.debug_check_bounds::<Self>(offset);
1635            let prim = decoder.read_num::<u32>(offset);
1636
1637            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1638            Ok(())
1639        }
1640    }
1641    unsafe impl fidl::encoding::TypeMarker for ScreenCaptureError {
1642        type Owned = Self;
1643
1644        #[inline(always)]
1645        fn inline_align(_context: fidl::encoding::Context) -> usize {
1646            std::mem::align_of::<u32>()
1647        }
1648
1649        #[inline(always)]
1650        fn inline_size(_context: fidl::encoding::Context) -> usize {
1651            std::mem::size_of::<u32>()
1652        }
1653
1654        #[inline(always)]
1655        fn encode_is_copy() -> bool {
1656            false
1657        }
1658
1659        #[inline(always)]
1660        fn decode_is_copy() -> bool {
1661            false
1662        }
1663    }
1664
1665    impl fidl::encoding::ValueTypeMarker for ScreenCaptureError {
1666        type Borrowed<'a> = Self;
1667        #[inline(always)]
1668        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1669            *value
1670        }
1671    }
1672
1673    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1674        for ScreenCaptureError
1675    {
1676        #[inline]
1677        unsafe fn encode(
1678            self,
1679            encoder: &mut fidl::encoding::Encoder<'_, D>,
1680            offset: usize,
1681            _depth: fidl::encoding::Depth,
1682        ) -> fidl::Result<()> {
1683            encoder.debug_check_bounds::<Self>(offset);
1684            encoder.write_num(self.into_primitive(), offset);
1685            Ok(())
1686        }
1687    }
1688
1689    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScreenCaptureError {
1690        #[inline(always)]
1691        fn new_empty() -> Self {
1692            Self::unknown()
1693        }
1694
1695        #[inline]
1696        unsafe fn decode(
1697            &mut self,
1698            decoder: &mut fidl::encoding::Decoder<'_, D>,
1699            offset: usize,
1700            _depth: fidl::encoding::Depth,
1701        ) -> fidl::Result<()> {
1702            decoder.debug_check_bounds::<Self>(offset);
1703            let prim = decoder.read_num::<u32>(offset);
1704
1705            *self = Self::from_primitive_allow_unknown(prim);
1706            Ok(())
1707        }
1708    }
1709    unsafe impl fidl::encoding::TypeMarker for ScreenshotFormat {
1710        type Owned = Self;
1711
1712        #[inline(always)]
1713        fn inline_align(_context: fidl::encoding::Context) -> usize {
1714            std::mem::align_of::<u8>()
1715        }
1716
1717        #[inline(always)]
1718        fn inline_size(_context: fidl::encoding::Context) -> usize {
1719            std::mem::size_of::<u8>()
1720        }
1721
1722        #[inline(always)]
1723        fn encode_is_copy() -> bool {
1724            false
1725        }
1726
1727        #[inline(always)]
1728        fn decode_is_copy() -> bool {
1729            false
1730        }
1731    }
1732
1733    impl fidl::encoding::ValueTypeMarker for ScreenshotFormat {
1734        type Borrowed<'a> = Self;
1735        #[inline(always)]
1736        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1737            *value
1738        }
1739    }
1740
1741    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1742        for ScreenshotFormat
1743    {
1744        #[inline]
1745        unsafe fn encode(
1746            self,
1747            encoder: &mut fidl::encoding::Encoder<'_, D>,
1748            offset: usize,
1749            _depth: fidl::encoding::Depth,
1750        ) -> fidl::Result<()> {
1751            encoder.debug_check_bounds::<Self>(offset);
1752            encoder.write_num(self.into_primitive(), offset);
1753            Ok(())
1754        }
1755    }
1756
1757    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScreenshotFormat {
1758        #[inline(always)]
1759        fn new_empty() -> Self {
1760            Self::unknown()
1761        }
1762
1763        #[inline]
1764        unsafe fn decode(
1765            &mut self,
1766            decoder: &mut fidl::encoding::Decoder<'_, D>,
1767            offset: usize,
1768            _depth: fidl::encoding::Depth,
1769        ) -> fidl::Result<()> {
1770            decoder.debug_check_bounds::<Self>(offset);
1771            let prim = decoder.read_num::<u8>(offset);
1772
1773            *self = Self::from_primitive_allow_unknown(prim);
1774            Ok(())
1775        }
1776    }
1777
1778    impl fidl::encoding::ValueTypeMarker for ChildViewWatcherGetStatusResponse {
1779        type Borrowed<'a> = &'a Self;
1780        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1781            value
1782        }
1783    }
1784
1785    unsafe impl fidl::encoding::TypeMarker for ChildViewWatcherGetStatusResponse {
1786        type Owned = Self;
1787
1788        #[inline(always)]
1789        fn inline_align(_context: fidl::encoding::Context) -> usize {
1790            4
1791        }
1792
1793        #[inline(always)]
1794        fn inline_size(_context: fidl::encoding::Context) -> usize {
1795            4
1796        }
1797    }
1798
1799    unsafe impl<D: fidl::encoding::ResourceDialect>
1800        fidl::encoding::Encode<ChildViewWatcherGetStatusResponse, D>
1801        for &ChildViewWatcherGetStatusResponse
1802    {
1803        #[inline]
1804        unsafe fn encode(
1805            self,
1806            encoder: &mut fidl::encoding::Encoder<'_, D>,
1807            offset: usize,
1808            _depth: fidl::encoding::Depth,
1809        ) -> fidl::Result<()> {
1810            encoder.debug_check_bounds::<ChildViewWatcherGetStatusResponse>(offset);
1811            // Delegate to tuple encoding.
1812            fidl::encoding::Encode::<ChildViewWatcherGetStatusResponse, D>::encode(
1813                (<ChildViewStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
1814                encoder,
1815                offset,
1816                _depth,
1817            )
1818        }
1819    }
1820    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ChildViewStatus, D>>
1821        fidl::encoding::Encode<ChildViewWatcherGetStatusResponse, D> for (T0,)
1822    {
1823        #[inline]
1824        unsafe fn encode(
1825            self,
1826            encoder: &mut fidl::encoding::Encoder<'_, D>,
1827            offset: usize,
1828            depth: fidl::encoding::Depth,
1829        ) -> fidl::Result<()> {
1830            encoder.debug_check_bounds::<ChildViewWatcherGetStatusResponse>(offset);
1831            // Zero out padding regions. There's no need to apply masks
1832            // because the unmasked parts will be overwritten by fields.
1833            // Write the fields.
1834            self.0.encode(encoder, offset + 0, depth)?;
1835            Ok(())
1836        }
1837    }
1838
1839    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1840        for ChildViewWatcherGetStatusResponse
1841    {
1842        #[inline(always)]
1843        fn new_empty() -> Self {
1844            Self { status: fidl::new_empty!(ChildViewStatus, D) }
1845        }
1846
1847        #[inline]
1848        unsafe fn decode(
1849            &mut self,
1850            decoder: &mut fidl::encoding::Decoder<'_, D>,
1851            offset: usize,
1852            _depth: fidl::encoding::Depth,
1853        ) -> fidl::Result<()> {
1854            decoder.debug_check_bounds::<Self>(offset);
1855            // Verify that padding bytes are zero.
1856            fidl::decode!(ChildViewStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
1857            Ok(())
1858        }
1859    }
1860
1861    impl fidl::encoding::ValueTypeMarker for ColorRgba {
1862        type Borrowed<'a> = &'a Self;
1863        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1864            value
1865        }
1866    }
1867
1868    unsafe impl fidl::encoding::TypeMarker for ColorRgba {
1869        type Owned = Self;
1870
1871        #[inline(always)]
1872        fn inline_align(_context: fidl::encoding::Context) -> usize {
1873            4
1874        }
1875
1876        #[inline(always)]
1877        fn inline_size(_context: fidl::encoding::Context) -> usize {
1878            16
1879        }
1880    }
1881
1882    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgba, D>
1883        for &ColorRgba
1884    {
1885        #[inline]
1886        unsafe fn encode(
1887            self,
1888            encoder: &mut fidl::encoding::Encoder<'_, D>,
1889            offset: usize,
1890            _depth: fidl::encoding::Depth,
1891        ) -> fidl::Result<()> {
1892            encoder.debug_check_bounds::<ColorRgba>(offset);
1893            // Delegate to tuple encoding.
1894            fidl::encoding::Encode::<ColorRgba, D>::encode(
1895                (
1896                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.red),
1897                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.green),
1898                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.blue),
1899                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.alpha),
1900                ),
1901                encoder,
1902                offset,
1903                _depth,
1904            )
1905        }
1906    }
1907    unsafe impl<
1908            D: fidl::encoding::ResourceDialect,
1909            T0: fidl::encoding::Encode<f32, D>,
1910            T1: fidl::encoding::Encode<f32, D>,
1911            T2: fidl::encoding::Encode<f32, D>,
1912            T3: fidl::encoding::Encode<f32, D>,
1913        > fidl::encoding::Encode<ColorRgba, D> for (T0, T1, T2, T3)
1914    {
1915        #[inline]
1916        unsafe fn encode(
1917            self,
1918            encoder: &mut fidl::encoding::Encoder<'_, D>,
1919            offset: usize,
1920            depth: fidl::encoding::Depth,
1921        ) -> fidl::Result<()> {
1922            encoder.debug_check_bounds::<ColorRgba>(offset);
1923            // Zero out padding regions. There's no need to apply masks
1924            // because the unmasked parts will be overwritten by fields.
1925            // Write the fields.
1926            self.0.encode(encoder, offset + 0, depth)?;
1927            self.1.encode(encoder, offset + 4, depth)?;
1928            self.2.encode(encoder, offset + 8, depth)?;
1929            self.3.encode(encoder, offset + 12, depth)?;
1930            Ok(())
1931        }
1932    }
1933
1934    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgba {
1935        #[inline(always)]
1936        fn new_empty() -> Self {
1937            Self {
1938                red: fidl::new_empty!(f32, D),
1939                green: fidl::new_empty!(f32, D),
1940                blue: fidl::new_empty!(f32, D),
1941                alpha: fidl::new_empty!(f32, D),
1942            }
1943        }
1944
1945        #[inline]
1946        unsafe fn decode(
1947            &mut self,
1948            decoder: &mut fidl::encoding::Decoder<'_, D>,
1949            offset: usize,
1950            _depth: fidl::encoding::Depth,
1951        ) -> fidl::Result<()> {
1952            decoder.debug_check_bounds::<Self>(offset);
1953            // Verify that padding bytes are zero.
1954            fidl::decode!(f32, D, &mut self.red, decoder, offset + 0, _depth)?;
1955            fidl::decode!(f32, D, &mut self.green, decoder, offset + 4, _depth)?;
1956            fidl::decode!(f32, D, &mut self.blue, decoder, offset + 8, _depth)?;
1957            fidl::decode!(f32, D, &mut self.alpha, decoder, offset + 12, _depth)?;
1958            Ok(())
1959        }
1960    }
1961
1962    impl fidl::encoding::ValueTypeMarker for ContentId {
1963        type Borrowed<'a> = &'a Self;
1964        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1965            value
1966        }
1967    }
1968
1969    unsafe impl fidl::encoding::TypeMarker for ContentId {
1970        type Owned = Self;
1971
1972        #[inline(always)]
1973        fn inline_align(_context: fidl::encoding::Context) -> usize {
1974            8
1975        }
1976
1977        #[inline(always)]
1978        fn inline_size(_context: fidl::encoding::Context) -> usize {
1979            8
1980        }
1981        #[inline(always)]
1982        fn encode_is_copy() -> bool {
1983            true
1984        }
1985
1986        #[inline(always)]
1987        fn decode_is_copy() -> bool {
1988            true
1989        }
1990    }
1991
1992    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ContentId, D>
1993        for &ContentId
1994    {
1995        #[inline]
1996        unsafe fn encode(
1997            self,
1998            encoder: &mut fidl::encoding::Encoder<'_, D>,
1999            offset: usize,
2000            _depth: fidl::encoding::Depth,
2001        ) -> fidl::Result<()> {
2002            encoder.debug_check_bounds::<ContentId>(offset);
2003            unsafe {
2004                // Copy the object into the buffer.
2005                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2006                (buf_ptr as *mut ContentId).write_unaligned((self as *const ContentId).read());
2007                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2008                // done second because the memcpy will write garbage to these bytes.
2009            }
2010            Ok(())
2011        }
2012    }
2013    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
2014        fidl::encoding::Encode<ContentId, D> for (T0,)
2015    {
2016        #[inline]
2017        unsafe fn encode(
2018            self,
2019            encoder: &mut fidl::encoding::Encoder<'_, D>,
2020            offset: usize,
2021            depth: fidl::encoding::Depth,
2022        ) -> fidl::Result<()> {
2023            encoder.debug_check_bounds::<ContentId>(offset);
2024            // Zero out padding regions. There's no need to apply masks
2025            // because the unmasked parts will be overwritten by fields.
2026            // Write the fields.
2027            self.0.encode(encoder, offset + 0, depth)?;
2028            Ok(())
2029        }
2030    }
2031
2032    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ContentId {
2033        #[inline(always)]
2034        fn new_empty() -> Self {
2035            Self { value: fidl::new_empty!(u64, D) }
2036        }
2037
2038        #[inline]
2039        unsafe fn decode(
2040            &mut self,
2041            decoder: &mut fidl::encoding::Decoder<'_, D>,
2042            offset: usize,
2043            _depth: fidl::encoding::Depth,
2044        ) -> fidl::Result<()> {
2045            decoder.debug_check_bounds::<Self>(offset);
2046            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2047            // Verify that padding bytes are zero.
2048            // Copy from the buffer into the object.
2049            unsafe {
2050                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2051            }
2052            Ok(())
2053        }
2054    }
2055
2056    impl fidl::encoding::ValueTypeMarker for FlatlandAddChildRequest {
2057        type Borrowed<'a> = &'a Self;
2058        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2059            value
2060        }
2061    }
2062
2063    unsafe impl fidl::encoding::TypeMarker for FlatlandAddChildRequest {
2064        type Owned = Self;
2065
2066        #[inline(always)]
2067        fn inline_align(_context: fidl::encoding::Context) -> usize {
2068            8
2069        }
2070
2071        #[inline(always)]
2072        fn inline_size(_context: fidl::encoding::Context) -> usize {
2073            16
2074        }
2075        #[inline(always)]
2076        fn encode_is_copy() -> bool {
2077            true
2078        }
2079
2080        #[inline(always)]
2081        fn decode_is_copy() -> bool {
2082            true
2083        }
2084    }
2085
2086    unsafe impl<D: fidl::encoding::ResourceDialect>
2087        fidl::encoding::Encode<FlatlandAddChildRequest, D> for &FlatlandAddChildRequest
2088    {
2089        #[inline]
2090        unsafe fn encode(
2091            self,
2092            encoder: &mut fidl::encoding::Encoder<'_, D>,
2093            offset: usize,
2094            _depth: fidl::encoding::Depth,
2095        ) -> fidl::Result<()> {
2096            encoder.debug_check_bounds::<FlatlandAddChildRequest>(offset);
2097            unsafe {
2098                // Copy the object into the buffer.
2099                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2100                (buf_ptr as *mut FlatlandAddChildRequest)
2101                    .write_unaligned((self as *const FlatlandAddChildRequest).read());
2102                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2103                // done second because the memcpy will write garbage to these bytes.
2104            }
2105            Ok(())
2106        }
2107    }
2108    unsafe impl<
2109            D: fidl::encoding::ResourceDialect,
2110            T0: fidl::encoding::Encode<TransformId, D>,
2111            T1: fidl::encoding::Encode<TransformId, D>,
2112        > fidl::encoding::Encode<FlatlandAddChildRequest, D> for (T0, T1)
2113    {
2114        #[inline]
2115        unsafe fn encode(
2116            self,
2117            encoder: &mut fidl::encoding::Encoder<'_, D>,
2118            offset: usize,
2119            depth: fidl::encoding::Depth,
2120        ) -> fidl::Result<()> {
2121            encoder.debug_check_bounds::<FlatlandAddChildRequest>(offset);
2122            // Zero out padding regions. There's no need to apply masks
2123            // because the unmasked parts will be overwritten by fields.
2124            // Write the fields.
2125            self.0.encode(encoder, offset + 0, depth)?;
2126            self.1.encode(encoder, offset + 8, depth)?;
2127            Ok(())
2128        }
2129    }
2130
2131    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2132        for FlatlandAddChildRequest
2133    {
2134        #[inline(always)]
2135        fn new_empty() -> Self {
2136            Self {
2137                parent_transform_id: fidl::new_empty!(TransformId, D),
2138                child_transform_id: fidl::new_empty!(TransformId, D),
2139            }
2140        }
2141
2142        #[inline]
2143        unsafe fn decode(
2144            &mut self,
2145            decoder: &mut fidl::encoding::Decoder<'_, D>,
2146            offset: usize,
2147            _depth: fidl::encoding::Depth,
2148        ) -> fidl::Result<()> {
2149            decoder.debug_check_bounds::<Self>(offset);
2150            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2151            // Verify that padding bytes are zero.
2152            // Copy from the buffer into the object.
2153            unsafe {
2154                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2155            }
2156            Ok(())
2157        }
2158    }
2159
2160    impl fidl::encoding::ValueTypeMarker for FlatlandCreateTransformRequest {
2161        type Borrowed<'a> = &'a Self;
2162        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2163            value
2164        }
2165    }
2166
2167    unsafe impl fidl::encoding::TypeMarker for FlatlandCreateTransformRequest {
2168        type Owned = Self;
2169
2170        #[inline(always)]
2171        fn inline_align(_context: fidl::encoding::Context) -> usize {
2172            8
2173        }
2174
2175        #[inline(always)]
2176        fn inline_size(_context: fidl::encoding::Context) -> usize {
2177            8
2178        }
2179        #[inline(always)]
2180        fn encode_is_copy() -> bool {
2181            true
2182        }
2183
2184        #[inline(always)]
2185        fn decode_is_copy() -> bool {
2186            true
2187        }
2188    }
2189
2190    unsafe impl<D: fidl::encoding::ResourceDialect>
2191        fidl::encoding::Encode<FlatlandCreateTransformRequest, D>
2192        for &FlatlandCreateTransformRequest
2193    {
2194        #[inline]
2195        unsafe fn encode(
2196            self,
2197            encoder: &mut fidl::encoding::Encoder<'_, D>,
2198            offset: usize,
2199            _depth: fidl::encoding::Depth,
2200        ) -> fidl::Result<()> {
2201            encoder.debug_check_bounds::<FlatlandCreateTransformRequest>(offset);
2202            unsafe {
2203                // Copy the object into the buffer.
2204                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2205                (buf_ptr as *mut FlatlandCreateTransformRequest)
2206                    .write_unaligned((self as *const FlatlandCreateTransformRequest).read());
2207                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2208                // done second because the memcpy will write garbage to these bytes.
2209            }
2210            Ok(())
2211        }
2212    }
2213    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TransformId, D>>
2214        fidl::encoding::Encode<FlatlandCreateTransformRequest, D> for (T0,)
2215    {
2216        #[inline]
2217        unsafe fn encode(
2218            self,
2219            encoder: &mut fidl::encoding::Encoder<'_, D>,
2220            offset: usize,
2221            depth: fidl::encoding::Depth,
2222        ) -> fidl::Result<()> {
2223            encoder.debug_check_bounds::<FlatlandCreateTransformRequest>(offset);
2224            // Zero out padding regions. There's no need to apply masks
2225            // because the unmasked parts will be overwritten by fields.
2226            // Write the fields.
2227            self.0.encode(encoder, offset + 0, depth)?;
2228            Ok(())
2229        }
2230    }
2231
2232    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2233        for FlatlandCreateTransformRequest
2234    {
2235        #[inline(always)]
2236        fn new_empty() -> Self {
2237            Self { transform_id: fidl::new_empty!(TransformId, D) }
2238        }
2239
2240        #[inline]
2241        unsafe fn decode(
2242            &mut self,
2243            decoder: &mut fidl::encoding::Decoder<'_, D>,
2244            offset: usize,
2245            _depth: fidl::encoding::Depth,
2246        ) -> fidl::Result<()> {
2247            decoder.debug_check_bounds::<Self>(offset);
2248            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2249            // Verify that padding bytes are zero.
2250            // Copy from the buffer into the object.
2251            unsafe {
2252                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2253            }
2254            Ok(())
2255        }
2256    }
2257
2258    impl fidl::encoding::ValueTypeMarker for FlatlandDisplaySetDevicePixelRatioRequest {
2259        type Borrowed<'a> = &'a Self;
2260        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2261            value
2262        }
2263    }
2264
2265    unsafe impl fidl::encoding::TypeMarker for FlatlandDisplaySetDevicePixelRatioRequest {
2266        type Owned = Self;
2267
2268        #[inline(always)]
2269        fn inline_align(_context: fidl::encoding::Context) -> usize {
2270            4
2271        }
2272
2273        #[inline(always)]
2274        fn inline_size(_context: fidl::encoding::Context) -> usize {
2275            8
2276        }
2277    }
2278
2279    unsafe impl<D: fidl::encoding::ResourceDialect>
2280        fidl::encoding::Encode<FlatlandDisplaySetDevicePixelRatioRequest, D>
2281        for &FlatlandDisplaySetDevicePixelRatioRequest
2282    {
2283        #[inline]
2284        unsafe fn encode(
2285            self,
2286            encoder: &mut fidl::encoding::Encoder<'_, D>,
2287            offset: usize,
2288            _depth: fidl::encoding::Depth,
2289        ) -> fidl::Result<()> {
2290            encoder.debug_check_bounds::<FlatlandDisplaySetDevicePixelRatioRequest>(offset);
2291            // Delegate to tuple encoding.
2292            fidl::encoding::Encode::<FlatlandDisplaySetDevicePixelRatioRequest, D>::encode(
2293                (<fidl_fuchsia_math::VecF as fidl::encoding::ValueTypeMarker>::borrow(
2294                    &self.device_pixel_ratio,
2295                ),),
2296                encoder,
2297                offset,
2298                _depth,
2299            )
2300        }
2301    }
2302    unsafe impl<
2303            D: fidl::encoding::ResourceDialect,
2304            T0: fidl::encoding::Encode<fidl_fuchsia_math::VecF, D>,
2305        > fidl::encoding::Encode<FlatlandDisplaySetDevicePixelRatioRequest, D> for (T0,)
2306    {
2307        #[inline]
2308        unsafe fn encode(
2309            self,
2310            encoder: &mut fidl::encoding::Encoder<'_, D>,
2311            offset: usize,
2312            depth: fidl::encoding::Depth,
2313        ) -> fidl::Result<()> {
2314            encoder.debug_check_bounds::<FlatlandDisplaySetDevicePixelRatioRequest>(offset);
2315            // Zero out padding regions. There's no need to apply masks
2316            // because the unmasked parts will be overwritten by fields.
2317            // Write the fields.
2318            self.0.encode(encoder, offset + 0, depth)?;
2319            Ok(())
2320        }
2321    }
2322
2323    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2324        for FlatlandDisplaySetDevicePixelRatioRequest
2325    {
2326        #[inline(always)]
2327        fn new_empty() -> Self {
2328            Self { device_pixel_ratio: fidl::new_empty!(fidl_fuchsia_math::VecF, D) }
2329        }
2330
2331        #[inline]
2332        unsafe fn decode(
2333            &mut self,
2334            decoder: &mut fidl::encoding::Decoder<'_, D>,
2335            offset: usize,
2336            _depth: fidl::encoding::Depth,
2337        ) -> fidl::Result<()> {
2338            decoder.debug_check_bounds::<Self>(offset);
2339            // Verify that padding bytes are zero.
2340            fidl::decode!(
2341                fidl_fuchsia_math::VecF,
2342                D,
2343                &mut self.device_pixel_ratio,
2344                decoder,
2345                offset + 0,
2346                _depth
2347            )?;
2348            Ok(())
2349        }
2350    }
2351
2352    impl fidl::encoding::ValueTypeMarker for FlatlandOnErrorRequest {
2353        type Borrowed<'a> = &'a Self;
2354        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2355            value
2356        }
2357    }
2358
2359    unsafe impl fidl::encoding::TypeMarker for FlatlandOnErrorRequest {
2360        type Owned = Self;
2361
2362        #[inline(always)]
2363        fn inline_align(_context: fidl::encoding::Context) -> usize {
2364            4
2365        }
2366
2367        #[inline(always)]
2368        fn inline_size(_context: fidl::encoding::Context) -> usize {
2369            4
2370        }
2371    }
2372
2373    unsafe impl<D: fidl::encoding::ResourceDialect>
2374        fidl::encoding::Encode<FlatlandOnErrorRequest, D> for &FlatlandOnErrorRequest
2375    {
2376        #[inline]
2377        unsafe fn encode(
2378            self,
2379            encoder: &mut fidl::encoding::Encoder<'_, D>,
2380            offset: usize,
2381            _depth: fidl::encoding::Depth,
2382        ) -> fidl::Result<()> {
2383            encoder.debug_check_bounds::<FlatlandOnErrorRequest>(offset);
2384            // Delegate to tuple encoding.
2385            fidl::encoding::Encode::<FlatlandOnErrorRequest, D>::encode(
2386                (<FlatlandError as fidl::encoding::ValueTypeMarker>::borrow(&self.error),),
2387                encoder,
2388                offset,
2389                _depth,
2390            )
2391        }
2392    }
2393    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<FlatlandError, D>>
2394        fidl::encoding::Encode<FlatlandOnErrorRequest, D> for (T0,)
2395    {
2396        #[inline]
2397        unsafe fn encode(
2398            self,
2399            encoder: &mut fidl::encoding::Encoder<'_, D>,
2400            offset: usize,
2401            depth: fidl::encoding::Depth,
2402        ) -> fidl::Result<()> {
2403            encoder.debug_check_bounds::<FlatlandOnErrorRequest>(offset);
2404            // Zero out padding regions. There's no need to apply masks
2405            // because the unmasked parts will be overwritten by fields.
2406            // Write the fields.
2407            self.0.encode(encoder, offset + 0, depth)?;
2408            Ok(())
2409        }
2410    }
2411
2412    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2413        for FlatlandOnErrorRequest
2414    {
2415        #[inline(always)]
2416        fn new_empty() -> Self {
2417            Self { error: fidl::new_empty!(FlatlandError, D) }
2418        }
2419
2420        #[inline]
2421        unsafe fn decode(
2422            &mut self,
2423            decoder: &mut fidl::encoding::Decoder<'_, D>,
2424            offset: usize,
2425            _depth: fidl::encoding::Depth,
2426        ) -> fidl::Result<()> {
2427            decoder.debug_check_bounds::<Self>(offset);
2428            // Verify that padding bytes are zero.
2429            fidl::decode!(FlatlandError, D, &mut self.error, decoder, offset + 0, _depth)?;
2430            Ok(())
2431        }
2432    }
2433
2434    impl fidl::encoding::ValueTypeMarker for FlatlandOnFramePresentedRequest {
2435        type Borrowed<'a> = &'a Self;
2436        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2437            value
2438        }
2439    }
2440
2441    unsafe impl fidl::encoding::TypeMarker for FlatlandOnFramePresentedRequest {
2442        type Owned = Self;
2443
2444        #[inline(always)]
2445        fn inline_align(_context: fidl::encoding::Context) -> usize {
2446            8
2447        }
2448
2449        #[inline(always)]
2450        fn inline_size(_context: fidl::encoding::Context) -> usize {
2451            32
2452        }
2453    }
2454
2455    unsafe impl<D: fidl::encoding::ResourceDialect>
2456        fidl::encoding::Encode<FlatlandOnFramePresentedRequest, D>
2457        for &FlatlandOnFramePresentedRequest
2458    {
2459        #[inline]
2460        unsafe fn encode(
2461            self,
2462            encoder: &mut fidl::encoding::Encoder<'_, D>,
2463            offset: usize,
2464            _depth: fidl::encoding::Depth,
2465        ) -> fidl::Result<()> {
2466            encoder.debug_check_bounds::<FlatlandOnFramePresentedRequest>(offset);
2467            // Delegate to tuple encoding.
2468            fidl::encoding::Encode::<FlatlandOnFramePresentedRequest, D>::encode(
2469                (
2470                    <fidl_fuchsia_scenic_scheduling::FramePresentedInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_presented_info),
2471                ),
2472                encoder, offset, _depth
2473            )
2474        }
2475    }
2476    unsafe impl<
2477            D: fidl::encoding::ResourceDialect,
2478            T0: fidl::encoding::Encode<fidl_fuchsia_scenic_scheduling::FramePresentedInfo, D>,
2479        > fidl::encoding::Encode<FlatlandOnFramePresentedRequest, D> for (T0,)
2480    {
2481        #[inline]
2482        unsafe fn encode(
2483            self,
2484            encoder: &mut fidl::encoding::Encoder<'_, D>,
2485            offset: usize,
2486            depth: fidl::encoding::Depth,
2487        ) -> fidl::Result<()> {
2488            encoder.debug_check_bounds::<FlatlandOnFramePresentedRequest>(offset);
2489            // Zero out padding regions. There's no need to apply masks
2490            // because the unmasked parts will be overwritten by fields.
2491            // Write the fields.
2492            self.0.encode(encoder, offset + 0, depth)?;
2493            Ok(())
2494        }
2495    }
2496
2497    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2498        for FlatlandOnFramePresentedRequest
2499    {
2500        #[inline(always)]
2501        fn new_empty() -> Self {
2502            Self {
2503                frame_presented_info: fidl::new_empty!(
2504                    fidl_fuchsia_scenic_scheduling::FramePresentedInfo,
2505                    D
2506                ),
2507            }
2508        }
2509
2510        #[inline]
2511        unsafe fn decode(
2512            &mut self,
2513            decoder: &mut fidl::encoding::Decoder<'_, D>,
2514            offset: usize,
2515            _depth: fidl::encoding::Depth,
2516        ) -> fidl::Result<()> {
2517            decoder.debug_check_bounds::<Self>(offset);
2518            // Verify that padding bytes are zero.
2519            fidl::decode!(
2520                fidl_fuchsia_scenic_scheduling::FramePresentedInfo,
2521                D,
2522                &mut self.frame_presented_info,
2523                decoder,
2524                offset + 0,
2525                _depth
2526            )?;
2527            Ok(())
2528        }
2529    }
2530
2531    impl fidl::encoding::ValueTypeMarker for FlatlandOnNextFrameBeginRequest {
2532        type Borrowed<'a> = &'a Self;
2533        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2534            value
2535        }
2536    }
2537
2538    unsafe impl fidl::encoding::TypeMarker for FlatlandOnNextFrameBeginRequest {
2539        type Owned = Self;
2540
2541        #[inline(always)]
2542        fn inline_align(_context: fidl::encoding::Context) -> usize {
2543            8
2544        }
2545
2546        #[inline(always)]
2547        fn inline_size(_context: fidl::encoding::Context) -> usize {
2548            16
2549        }
2550    }
2551
2552    unsafe impl<D: fidl::encoding::ResourceDialect>
2553        fidl::encoding::Encode<FlatlandOnNextFrameBeginRequest, D>
2554        for &FlatlandOnNextFrameBeginRequest
2555    {
2556        #[inline]
2557        unsafe fn encode(
2558            self,
2559            encoder: &mut fidl::encoding::Encoder<'_, D>,
2560            offset: usize,
2561            _depth: fidl::encoding::Depth,
2562        ) -> fidl::Result<()> {
2563            encoder.debug_check_bounds::<FlatlandOnNextFrameBeginRequest>(offset);
2564            // Delegate to tuple encoding.
2565            fidl::encoding::Encode::<FlatlandOnNextFrameBeginRequest, D>::encode(
2566                (<OnNextFrameBeginValues as fidl::encoding::ValueTypeMarker>::borrow(&self.values),),
2567                encoder,
2568                offset,
2569                _depth,
2570            )
2571        }
2572    }
2573    unsafe impl<
2574            D: fidl::encoding::ResourceDialect,
2575            T0: fidl::encoding::Encode<OnNextFrameBeginValues, D>,
2576        > fidl::encoding::Encode<FlatlandOnNextFrameBeginRequest, D> for (T0,)
2577    {
2578        #[inline]
2579        unsafe fn encode(
2580            self,
2581            encoder: &mut fidl::encoding::Encoder<'_, D>,
2582            offset: usize,
2583            depth: fidl::encoding::Depth,
2584        ) -> fidl::Result<()> {
2585            encoder.debug_check_bounds::<FlatlandOnNextFrameBeginRequest>(offset);
2586            // Zero out padding regions. There's no need to apply masks
2587            // because the unmasked parts will be overwritten by fields.
2588            // Write the fields.
2589            self.0.encode(encoder, offset + 0, depth)?;
2590            Ok(())
2591        }
2592    }
2593
2594    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2595        for FlatlandOnNextFrameBeginRequest
2596    {
2597        #[inline(always)]
2598        fn new_empty() -> Self {
2599            Self { values: fidl::new_empty!(OnNextFrameBeginValues, D) }
2600        }
2601
2602        #[inline]
2603        unsafe fn decode(
2604            &mut self,
2605            decoder: &mut fidl::encoding::Decoder<'_, D>,
2606            offset: usize,
2607            _depth: fidl::encoding::Depth,
2608        ) -> fidl::Result<()> {
2609            decoder.debug_check_bounds::<Self>(offset);
2610            // Verify that padding bytes are zero.
2611            fidl::decode!(
2612                OnNextFrameBeginValues,
2613                D,
2614                &mut self.values,
2615                decoder,
2616                offset + 0,
2617                _depth
2618            )?;
2619            Ok(())
2620        }
2621    }
2622
2623    impl fidl::encoding::ValueTypeMarker for FlatlandReleaseFilledRectRequest {
2624        type Borrowed<'a> = &'a Self;
2625        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2626            value
2627        }
2628    }
2629
2630    unsafe impl fidl::encoding::TypeMarker for FlatlandReleaseFilledRectRequest {
2631        type Owned = Self;
2632
2633        #[inline(always)]
2634        fn inline_align(_context: fidl::encoding::Context) -> usize {
2635            8
2636        }
2637
2638        #[inline(always)]
2639        fn inline_size(_context: fidl::encoding::Context) -> usize {
2640            8
2641        }
2642        #[inline(always)]
2643        fn encode_is_copy() -> bool {
2644            true
2645        }
2646
2647        #[inline(always)]
2648        fn decode_is_copy() -> bool {
2649            true
2650        }
2651    }
2652
2653    unsafe impl<D: fidl::encoding::ResourceDialect>
2654        fidl::encoding::Encode<FlatlandReleaseFilledRectRequest, D>
2655        for &FlatlandReleaseFilledRectRequest
2656    {
2657        #[inline]
2658        unsafe fn encode(
2659            self,
2660            encoder: &mut fidl::encoding::Encoder<'_, D>,
2661            offset: usize,
2662            _depth: fidl::encoding::Depth,
2663        ) -> fidl::Result<()> {
2664            encoder.debug_check_bounds::<FlatlandReleaseFilledRectRequest>(offset);
2665            unsafe {
2666                // Copy the object into the buffer.
2667                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2668                (buf_ptr as *mut FlatlandReleaseFilledRectRequest)
2669                    .write_unaligned((self as *const FlatlandReleaseFilledRectRequest).read());
2670                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2671                // done second because the memcpy will write garbage to these bytes.
2672            }
2673            Ok(())
2674        }
2675    }
2676    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ContentId, D>>
2677        fidl::encoding::Encode<FlatlandReleaseFilledRectRequest, D> for (T0,)
2678    {
2679        #[inline]
2680        unsafe fn encode(
2681            self,
2682            encoder: &mut fidl::encoding::Encoder<'_, D>,
2683            offset: usize,
2684            depth: fidl::encoding::Depth,
2685        ) -> fidl::Result<()> {
2686            encoder.debug_check_bounds::<FlatlandReleaseFilledRectRequest>(offset);
2687            // Zero out padding regions. There's no need to apply masks
2688            // because the unmasked parts will be overwritten by fields.
2689            // Write the fields.
2690            self.0.encode(encoder, offset + 0, depth)?;
2691            Ok(())
2692        }
2693    }
2694
2695    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2696        for FlatlandReleaseFilledRectRequest
2697    {
2698        #[inline(always)]
2699        fn new_empty() -> Self {
2700            Self { rect_id: fidl::new_empty!(ContentId, D) }
2701        }
2702
2703        #[inline]
2704        unsafe fn decode(
2705            &mut self,
2706            decoder: &mut fidl::encoding::Decoder<'_, D>,
2707            offset: usize,
2708            _depth: fidl::encoding::Depth,
2709        ) -> fidl::Result<()> {
2710            decoder.debug_check_bounds::<Self>(offset);
2711            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2712            // Verify that padding bytes are zero.
2713            // Copy from the buffer into the object.
2714            unsafe {
2715                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2716            }
2717            Ok(())
2718        }
2719    }
2720
2721    impl fidl::encoding::ValueTypeMarker for FlatlandReleaseImageRequest {
2722        type Borrowed<'a> = &'a Self;
2723        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2724            value
2725        }
2726    }
2727
2728    unsafe impl fidl::encoding::TypeMarker for FlatlandReleaseImageRequest {
2729        type Owned = Self;
2730
2731        #[inline(always)]
2732        fn inline_align(_context: fidl::encoding::Context) -> usize {
2733            8
2734        }
2735
2736        #[inline(always)]
2737        fn inline_size(_context: fidl::encoding::Context) -> usize {
2738            8
2739        }
2740        #[inline(always)]
2741        fn encode_is_copy() -> bool {
2742            true
2743        }
2744
2745        #[inline(always)]
2746        fn decode_is_copy() -> bool {
2747            true
2748        }
2749    }
2750
2751    unsafe impl<D: fidl::encoding::ResourceDialect>
2752        fidl::encoding::Encode<FlatlandReleaseImageRequest, D> for &FlatlandReleaseImageRequest
2753    {
2754        #[inline]
2755        unsafe fn encode(
2756            self,
2757            encoder: &mut fidl::encoding::Encoder<'_, D>,
2758            offset: usize,
2759            _depth: fidl::encoding::Depth,
2760        ) -> fidl::Result<()> {
2761            encoder.debug_check_bounds::<FlatlandReleaseImageRequest>(offset);
2762            unsafe {
2763                // Copy the object into the buffer.
2764                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2765                (buf_ptr as *mut FlatlandReleaseImageRequest)
2766                    .write_unaligned((self as *const FlatlandReleaseImageRequest).read());
2767                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2768                // done second because the memcpy will write garbage to these bytes.
2769            }
2770            Ok(())
2771        }
2772    }
2773    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ContentId, D>>
2774        fidl::encoding::Encode<FlatlandReleaseImageRequest, D> for (T0,)
2775    {
2776        #[inline]
2777        unsafe fn encode(
2778            self,
2779            encoder: &mut fidl::encoding::Encoder<'_, D>,
2780            offset: usize,
2781            depth: fidl::encoding::Depth,
2782        ) -> fidl::Result<()> {
2783            encoder.debug_check_bounds::<FlatlandReleaseImageRequest>(offset);
2784            // Zero out padding regions. There's no need to apply masks
2785            // because the unmasked parts will be overwritten by fields.
2786            // Write the fields.
2787            self.0.encode(encoder, offset + 0, depth)?;
2788            Ok(())
2789        }
2790    }
2791
2792    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2793        for FlatlandReleaseImageRequest
2794    {
2795        #[inline(always)]
2796        fn new_empty() -> Self {
2797            Self { image_id: fidl::new_empty!(ContentId, D) }
2798        }
2799
2800        #[inline]
2801        unsafe fn decode(
2802            &mut self,
2803            decoder: &mut fidl::encoding::Decoder<'_, D>,
2804            offset: usize,
2805            _depth: fidl::encoding::Depth,
2806        ) -> fidl::Result<()> {
2807            decoder.debug_check_bounds::<Self>(offset);
2808            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2809            // Verify that padding bytes are zero.
2810            // Copy from the buffer into the object.
2811            unsafe {
2812                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2813            }
2814            Ok(())
2815        }
2816    }
2817
2818    impl fidl::encoding::ValueTypeMarker for FlatlandReleaseTransformRequest {
2819        type Borrowed<'a> = &'a Self;
2820        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2821            value
2822        }
2823    }
2824
2825    unsafe impl fidl::encoding::TypeMarker for FlatlandReleaseTransformRequest {
2826        type Owned = Self;
2827
2828        #[inline(always)]
2829        fn inline_align(_context: fidl::encoding::Context) -> usize {
2830            8
2831        }
2832
2833        #[inline(always)]
2834        fn inline_size(_context: fidl::encoding::Context) -> usize {
2835            8
2836        }
2837        #[inline(always)]
2838        fn encode_is_copy() -> bool {
2839            true
2840        }
2841
2842        #[inline(always)]
2843        fn decode_is_copy() -> bool {
2844            true
2845        }
2846    }
2847
2848    unsafe impl<D: fidl::encoding::ResourceDialect>
2849        fidl::encoding::Encode<FlatlandReleaseTransformRequest, D>
2850        for &FlatlandReleaseTransformRequest
2851    {
2852        #[inline]
2853        unsafe fn encode(
2854            self,
2855            encoder: &mut fidl::encoding::Encoder<'_, D>,
2856            offset: usize,
2857            _depth: fidl::encoding::Depth,
2858        ) -> fidl::Result<()> {
2859            encoder.debug_check_bounds::<FlatlandReleaseTransformRequest>(offset);
2860            unsafe {
2861                // Copy the object into the buffer.
2862                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2863                (buf_ptr as *mut FlatlandReleaseTransformRequest)
2864                    .write_unaligned((self as *const FlatlandReleaseTransformRequest).read());
2865                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2866                // done second because the memcpy will write garbage to these bytes.
2867            }
2868            Ok(())
2869        }
2870    }
2871    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TransformId, D>>
2872        fidl::encoding::Encode<FlatlandReleaseTransformRequest, D> for (T0,)
2873    {
2874        #[inline]
2875        unsafe fn encode(
2876            self,
2877            encoder: &mut fidl::encoding::Encoder<'_, D>,
2878            offset: usize,
2879            depth: fidl::encoding::Depth,
2880        ) -> fidl::Result<()> {
2881            encoder.debug_check_bounds::<FlatlandReleaseTransformRequest>(offset);
2882            // Zero out padding regions. There's no need to apply masks
2883            // because the unmasked parts will be overwritten by fields.
2884            // Write the fields.
2885            self.0.encode(encoder, offset + 0, depth)?;
2886            Ok(())
2887        }
2888    }
2889
2890    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2891        for FlatlandReleaseTransformRequest
2892    {
2893        #[inline(always)]
2894        fn new_empty() -> Self {
2895            Self { transform_id: fidl::new_empty!(TransformId, D) }
2896        }
2897
2898        #[inline]
2899        unsafe fn decode(
2900            &mut self,
2901            decoder: &mut fidl::encoding::Decoder<'_, D>,
2902            offset: usize,
2903            _depth: fidl::encoding::Depth,
2904        ) -> fidl::Result<()> {
2905            decoder.debug_check_bounds::<Self>(offset);
2906            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2907            // Verify that padding bytes are zero.
2908            // Copy from the buffer into the object.
2909            unsafe {
2910                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2911            }
2912            Ok(())
2913        }
2914    }
2915
2916    impl fidl::encoding::ValueTypeMarker for FlatlandReleaseViewportRequest {
2917        type Borrowed<'a> = &'a Self;
2918        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2919            value
2920        }
2921    }
2922
2923    unsafe impl fidl::encoding::TypeMarker for FlatlandReleaseViewportRequest {
2924        type Owned = Self;
2925
2926        #[inline(always)]
2927        fn inline_align(_context: fidl::encoding::Context) -> usize {
2928            8
2929        }
2930
2931        #[inline(always)]
2932        fn inline_size(_context: fidl::encoding::Context) -> usize {
2933            8
2934        }
2935        #[inline(always)]
2936        fn encode_is_copy() -> bool {
2937            true
2938        }
2939
2940        #[inline(always)]
2941        fn decode_is_copy() -> bool {
2942            true
2943        }
2944    }
2945
2946    unsafe impl<D: fidl::encoding::ResourceDialect>
2947        fidl::encoding::Encode<FlatlandReleaseViewportRequest, D>
2948        for &FlatlandReleaseViewportRequest
2949    {
2950        #[inline]
2951        unsafe fn encode(
2952            self,
2953            encoder: &mut fidl::encoding::Encoder<'_, D>,
2954            offset: usize,
2955            _depth: fidl::encoding::Depth,
2956        ) -> fidl::Result<()> {
2957            encoder.debug_check_bounds::<FlatlandReleaseViewportRequest>(offset);
2958            unsafe {
2959                // Copy the object into the buffer.
2960                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2961                (buf_ptr as *mut FlatlandReleaseViewportRequest)
2962                    .write_unaligned((self as *const FlatlandReleaseViewportRequest).read());
2963                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2964                // done second because the memcpy will write garbage to these bytes.
2965            }
2966            Ok(())
2967        }
2968    }
2969    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ContentId, D>>
2970        fidl::encoding::Encode<FlatlandReleaseViewportRequest, D> for (T0,)
2971    {
2972        #[inline]
2973        unsafe fn encode(
2974            self,
2975            encoder: &mut fidl::encoding::Encoder<'_, D>,
2976            offset: usize,
2977            depth: fidl::encoding::Depth,
2978        ) -> fidl::Result<()> {
2979            encoder.debug_check_bounds::<FlatlandReleaseViewportRequest>(offset);
2980            // Zero out padding regions. There's no need to apply masks
2981            // because the unmasked parts will be overwritten by fields.
2982            // Write the fields.
2983            self.0.encode(encoder, offset + 0, depth)?;
2984            Ok(())
2985        }
2986    }
2987
2988    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2989        for FlatlandReleaseViewportRequest
2990    {
2991        #[inline(always)]
2992        fn new_empty() -> Self {
2993            Self { viewport_id: fidl::new_empty!(ContentId, D) }
2994        }
2995
2996        #[inline]
2997        unsafe fn decode(
2998            &mut self,
2999            decoder: &mut fidl::encoding::Decoder<'_, D>,
3000            offset: usize,
3001            _depth: fidl::encoding::Depth,
3002        ) -> fidl::Result<()> {
3003            decoder.debug_check_bounds::<Self>(offset);
3004            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3005            // Verify that padding bytes are zero.
3006            // Copy from the buffer into the object.
3007            unsafe {
3008                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3009            }
3010            Ok(())
3011        }
3012    }
3013
3014    impl fidl::encoding::ValueTypeMarker for FlatlandRemoveChildRequest {
3015        type Borrowed<'a> = &'a Self;
3016        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3017            value
3018        }
3019    }
3020
3021    unsafe impl fidl::encoding::TypeMarker for FlatlandRemoveChildRequest {
3022        type Owned = Self;
3023
3024        #[inline(always)]
3025        fn inline_align(_context: fidl::encoding::Context) -> usize {
3026            8
3027        }
3028
3029        #[inline(always)]
3030        fn inline_size(_context: fidl::encoding::Context) -> usize {
3031            16
3032        }
3033        #[inline(always)]
3034        fn encode_is_copy() -> bool {
3035            true
3036        }
3037
3038        #[inline(always)]
3039        fn decode_is_copy() -> bool {
3040            true
3041        }
3042    }
3043
3044    unsafe impl<D: fidl::encoding::ResourceDialect>
3045        fidl::encoding::Encode<FlatlandRemoveChildRequest, D> for &FlatlandRemoveChildRequest
3046    {
3047        #[inline]
3048        unsafe fn encode(
3049            self,
3050            encoder: &mut fidl::encoding::Encoder<'_, D>,
3051            offset: usize,
3052            _depth: fidl::encoding::Depth,
3053        ) -> fidl::Result<()> {
3054            encoder.debug_check_bounds::<FlatlandRemoveChildRequest>(offset);
3055            unsafe {
3056                // Copy the object into the buffer.
3057                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3058                (buf_ptr as *mut FlatlandRemoveChildRequest)
3059                    .write_unaligned((self as *const FlatlandRemoveChildRequest).read());
3060                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3061                // done second because the memcpy will write garbage to these bytes.
3062            }
3063            Ok(())
3064        }
3065    }
3066    unsafe impl<
3067            D: fidl::encoding::ResourceDialect,
3068            T0: fidl::encoding::Encode<TransformId, D>,
3069            T1: fidl::encoding::Encode<TransformId, D>,
3070        > fidl::encoding::Encode<FlatlandRemoveChildRequest, D> for (T0, T1)
3071    {
3072        #[inline]
3073        unsafe fn encode(
3074            self,
3075            encoder: &mut fidl::encoding::Encoder<'_, D>,
3076            offset: usize,
3077            depth: fidl::encoding::Depth,
3078        ) -> fidl::Result<()> {
3079            encoder.debug_check_bounds::<FlatlandRemoveChildRequest>(offset);
3080            // Zero out padding regions. There's no need to apply masks
3081            // because the unmasked parts will be overwritten by fields.
3082            // Write the fields.
3083            self.0.encode(encoder, offset + 0, depth)?;
3084            self.1.encode(encoder, offset + 8, depth)?;
3085            Ok(())
3086        }
3087    }
3088
3089    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3090        for FlatlandRemoveChildRequest
3091    {
3092        #[inline(always)]
3093        fn new_empty() -> Self {
3094            Self {
3095                parent_transform_id: fidl::new_empty!(TransformId, D),
3096                child_transform_id: fidl::new_empty!(TransformId, D),
3097            }
3098        }
3099
3100        #[inline]
3101        unsafe fn decode(
3102            &mut self,
3103            decoder: &mut fidl::encoding::Decoder<'_, D>,
3104            offset: usize,
3105            _depth: fidl::encoding::Depth,
3106        ) -> fidl::Result<()> {
3107            decoder.debug_check_bounds::<Self>(offset);
3108            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3109            // Verify that padding bytes are zero.
3110            // Copy from the buffer into the object.
3111            unsafe {
3112                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
3113            }
3114            Ok(())
3115        }
3116    }
3117
3118    impl fidl::encoding::ValueTypeMarker for FlatlandReplaceChildrenRequest {
3119        type Borrowed<'a> = &'a Self;
3120        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3121            value
3122        }
3123    }
3124
3125    unsafe impl fidl::encoding::TypeMarker for FlatlandReplaceChildrenRequest {
3126        type Owned = Self;
3127
3128        #[inline(always)]
3129        fn inline_align(_context: fidl::encoding::Context) -> usize {
3130            8
3131        }
3132
3133        #[inline(always)]
3134        fn inline_size(_context: fidl::encoding::Context) -> usize {
3135            24
3136        }
3137    }
3138
3139    unsafe impl<D: fidl::encoding::ResourceDialect>
3140        fidl::encoding::Encode<FlatlandReplaceChildrenRequest, D>
3141        for &FlatlandReplaceChildrenRequest
3142    {
3143        #[inline]
3144        unsafe fn encode(
3145            self,
3146            encoder: &mut fidl::encoding::Encoder<'_, D>,
3147            offset: usize,
3148            _depth: fidl::encoding::Depth,
3149        ) -> fidl::Result<()> {
3150            encoder.debug_check_bounds::<FlatlandReplaceChildrenRequest>(offset);
3151            // Delegate to tuple encoding.
3152            fidl::encoding::Encode::<FlatlandReplaceChildrenRequest, D>::encode(
3153                (
3154                    <TransformId as fidl::encoding::ValueTypeMarker>::borrow(&self.parent_transform_id),
3155                    <fidl::encoding::Vector<TransformId, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.new_child_transform_ids),
3156                ),
3157                encoder, offset, _depth
3158            )
3159        }
3160    }
3161    unsafe impl<
3162            D: fidl::encoding::ResourceDialect,
3163            T0: fidl::encoding::Encode<TransformId, D>,
3164            T1: fidl::encoding::Encode<fidl::encoding::Vector<TransformId, 64>, D>,
3165        > fidl::encoding::Encode<FlatlandReplaceChildrenRequest, D> for (T0, T1)
3166    {
3167        #[inline]
3168        unsafe fn encode(
3169            self,
3170            encoder: &mut fidl::encoding::Encoder<'_, D>,
3171            offset: usize,
3172            depth: fidl::encoding::Depth,
3173        ) -> fidl::Result<()> {
3174            encoder.debug_check_bounds::<FlatlandReplaceChildrenRequest>(offset);
3175            // Zero out padding regions. There's no need to apply masks
3176            // because the unmasked parts will be overwritten by fields.
3177            // Write the fields.
3178            self.0.encode(encoder, offset + 0, depth)?;
3179            self.1.encode(encoder, offset + 8, depth)?;
3180            Ok(())
3181        }
3182    }
3183
3184    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3185        for FlatlandReplaceChildrenRequest
3186    {
3187        #[inline(always)]
3188        fn new_empty() -> Self {
3189            Self {
3190                parent_transform_id: fidl::new_empty!(TransformId, D),
3191                new_child_transform_ids: fidl::new_empty!(fidl::encoding::Vector<TransformId, 64>, D),
3192            }
3193        }
3194
3195        #[inline]
3196        unsafe fn decode(
3197            &mut self,
3198            decoder: &mut fidl::encoding::Decoder<'_, D>,
3199            offset: usize,
3200            _depth: fidl::encoding::Depth,
3201        ) -> fidl::Result<()> {
3202            decoder.debug_check_bounds::<Self>(offset);
3203            // Verify that padding bytes are zero.
3204            fidl::decode!(
3205                TransformId,
3206                D,
3207                &mut self.parent_transform_id,
3208                decoder,
3209                offset + 0,
3210                _depth
3211            )?;
3212            fidl::decode!(fidl::encoding::Vector<TransformId, 64>, D, &mut self.new_child_transform_ids, decoder, offset + 8, _depth)?;
3213            Ok(())
3214        }
3215    }
3216
3217    impl fidl::encoding::ValueTypeMarker for FlatlandSetClipBoundaryRequest {
3218        type Borrowed<'a> = &'a Self;
3219        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3220            value
3221        }
3222    }
3223
3224    unsafe impl fidl::encoding::TypeMarker for FlatlandSetClipBoundaryRequest {
3225        type Owned = Self;
3226
3227        #[inline(always)]
3228        fn inline_align(_context: fidl::encoding::Context) -> usize {
3229            8
3230        }
3231
3232        #[inline(always)]
3233        fn inline_size(_context: fidl::encoding::Context) -> usize {
3234            16
3235        }
3236    }
3237
3238    unsafe impl<D: fidl::encoding::ResourceDialect>
3239        fidl::encoding::Encode<FlatlandSetClipBoundaryRequest, D>
3240        for &FlatlandSetClipBoundaryRequest
3241    {
3242        #[inline]
3243        unsafe fn encode(
3244            self,
3245            encoder: &mut fidl::encoding::Encoder<'_, D>,
3246            offset: usize,
3247            _depth: fidl::encoding::Depth,
3248        ) -> fidl::Result<()> {
3249            encoder.debug_check_bounds::<FlatlandSetClipBoundaryRequest>(offset);
3250            // Delegate to tuple encoding.
3251            fidl::encoding::Encode::<FlatlandSetClipBoundaryRequest, D>::encode(
3252                (
3253                    <TransformId as fidl::encoding::ValueTypeMarker>::borrow(&self.transform_id),
3254                    <fidl::encoding::Boxed<fidl_fuchsia_math::Rect> as fidl::encoding::ValueTypeMarker>::borrow(&self.rect),
3255                ),
3256                encoder, offset, _depth
3257            )
3258        }
3259    }
3260    unsafe impl<
3261            D: fidl::encoding::ResourceDialect,
3262            T0: fidl::encoding::Encode<TransformId, D>,
3263            T1: fidl::encoding::Encode<fidl::encoding::Boxed<fidl_fuchsia_math::Rect>, D>,
3264        > fidl::encoding::Encode<FlatlandSetClipBoundaryRequest, D> for (T0, T1)
3265    {
3266        #[inline]
3267        unsafe fn encode(
3268            self,
3269            encoder: &mut fidl::encoding::Encoder<'_, D>,
3270            offset: usize,
3271            depth: fidl::encoding::Depth,
3272        ) -> fidl::Result<()> {
3273            encoder.debug_check_bounds::<FlatlandSetClipBoundaryRequest>(offset);
3274            // Zero out padding regions. There's no need to apply masks
3275            // because the unmasked parts will be overwritten by fields.
3276            // Write the fields.
3277            self.0.encode(encoder, offset + 0, depth)?;
3278            self.1.encode(encoder, offset + 8, depth)?;
3279            Ok(())
3280        }
3281    }
3282
3283    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3284        for FlatlandSetClipBoundaryRequest
3285    {
3286        #[inline(always)]
3287        fn new_empty() -> Self {
3288            Self {
3289                transform_id: fidl::new_empty!(TransformId, D),
3290                rect: fidl::new_empty!(fidl::encoding::Boxed<fidl_fuchsia_math::Rect>, D),
3291            }
3292        }
3293
3294        #[inline]
3295        unsafe fn decode(
3296            &mut self,
3297            decoder: &mut fidl::encoding::Decoder<'_, D>,
3298            offset: usize,
3299            _depth: fidl::encoding::Depth,
3300        ) -> fidl::Result<()> {
3301            decoder.debug_check_bounds::<Self>(offset);
3302            // Verify that padding bytes are zero.
3303            fidl::decode!(TransformId, D, &mut self.transform_id, decoder, offset + 0, _depth)?;
3304            fidl::decode!(
3305                fidl::encoding::Boxed<fidl_fuchsia_math::Rect>,
3306                D,
3307                &mut self.rect,
3308                decoder,
3309                offset + 8,
3310                _depth
3311            )?;
3312            Ok(())
3313        }
3314    }
3315
3316    impl fidl::encoding::ValueTypeMarker for FlatlandSetContentRequest {
3317        type Borrowed<'a> = &'a Self;
3318        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3319            value
3320        }
3321    }
3322
3323    unsafe impl fidl::encoding::TypeMarker for FlatlandSetContentRequest {
3324        type Owned = Self;
3325
3326        #[inline(always)]
3327        fn inline_align(_context: fidl::encoding::Context) -> usize {
3328            8
3329        }
3330
3331        #[inline(always)]
3332        fn inline_size(_context: fidl::encoding::Context) -> usize {
3333            16
3334        }
3335        #[inline(always)]
3336        fn encode_is_copy() -> bool {
3337            true
3338        }
3339
3340        #[inline(always)]
3341        fn decode_is_copy() -> bool {
3342            true
3343        }
3344    }
3345
3346    unsafe impl<D: fidl::encoding::ResourceDialect>
3347        fidl::encoding::Encode<FlatlandSetContentRequest, D> for &FlatlandSetContentRequest
3348    {
3349        #[inline]
3350        unsafe fn encode(
3351            self,
3352            encoder: &mut fidl::encoding::Encoder<'_, D>,
3353            offset: usize,
3354            _depth: fidl::encoding::Depth,
3355        ) -> fidl::Result<()> {
3356            encoder.debug_check_bounds::<FlatlandSetContentRequest>(offset);
3357            unsafe {
3358                // Copy the object into the buffer.
3359                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3360                (buf_ptr as *mut FlatlandSetContentRequest)
3361                    .write_unaligned((self as *const FlatlandSetContentRequest).read());
3362                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3363                // done second because the memcpy will write garbage to these bytes.
3364            }
3365            Ok(())
3366        }
3367    }
3368    unsafe impl<
3369            D: fidl::encoding::ResourceDialect,
3370            T0: fidl::encoding::Encode<TransformId, D>,
3371            T1: fidl::encoding::Encode<ContentId, D>,
3372        > fidl::encoding::Encode<FlatlandSetContentRequest, D> for (T0, T1)
3373    {
3374        #[inline]
3375        unsafe fn encode(
3376            self,
3377            encoder: &mut fidl::encoding::Encoder<'_, D>,
3378            offset: usize,
3379            depth: fidl::encoding::Depth,
3380        ) -> fidl::Result<()> {
3381            encoder.debug_check_bounds::<FlatlandSetContentRequest>(offset);
3382            // Zero out padding regions. There's no need to apply masks
3383            // because the unmasked parts will be overwritten by fields.
3384            // Write the fields.
3385            self.0.encode(encoder, offset + 0, depth)?;
3386            self.1.encode(encoder, offset + 8, depth)?;
3387            Ok(())
3388        }
3389    }
3390
3391    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3392        for FlatlandSetContentRequest
3393    {
3394        #[inline(always)]
3395        fn new_empty() -> Self {
3396            Self {
3397                transform_id: fidl::new_empty!(TransformId, D),
3398                content_id: fidl::new_empty!(ContentId, D),
3399            }
3400        }
3401
3402        #[inline]
3403        unsafe fn decode(
3404            &mut self,
3405            decoder: &mut fidl::encoding::Decoder<'_, D>,
3406            offset: usize,
3407            _depth: fidl::encoding::Depth,
3408        ) -> fidl::Result<()> {
3409            decoder.debug_check_bounds::<Self>(offset);
3410            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3411            // Verify that padding bytes are zero.
3412            // Copy from the buffer into the object.
3413            unsafe {
3414                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
3415            }
3416            Ok(())
3417        }
3418    }
3419
3420    impl fidl::encoding::ValueTypeMarker for FlatlandSetDebugNameRequest {
3421        type Borrowed<'a> = &'a Self;
3422        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3423            value
3424        }
3425    }
3426
3427    unsafe impl fidl::encoding::TypeMarker for FlatlandSetDebugNameRequest {
3428        type Owned = Self;
3429
3430        #[inline(always)]
3431        fn inline_align(_context: fidl::encoding::Context) -> usize {
3432            8
3433        }
3434
3435        #[inline(always)]
3436        fn inline_size(_context: fidl::encoding::Context) -> usize {
3437            16
3438        }
3439    }
3440
3441    unsafe impl<D: fidl::encoding::ResourceDialect>
3442        fidl::encoding::Encode<FlatlandSetDebugNameRequest, D> for &FlatlandSetDebugNameRequest
3443    {
3444        #[inline]
3445        unsafe fn encode(
3446            self,
3447            encoder: &mut fidl::encoding::Encoder<'_, D>,
3448            offset: usize,
3449            _depth: fidl::encoding::Depth,
3450        ) -> fidl::Result<()> {
3451            encoder.debug_check_bounds::<FlatlandSetDebugNameRequest>(offset);
3452            // Delegate to tuple encoding.
3453            fidl::encoding::Encode::<FlatlandSetDebugNameRequest, D>::encode(
3454                (<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
3455                    &self.name,
3456                ),),
3457                encoder,
3458                offset,
3459                _depth,
3460            )
3461        }
3462    }
3463    unsafe impl<
3464            D: fidl::encoding::ResourceDialect,
3465            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
3466        > fidl::encoding::Encode<FlatlandSetDebugNameRequest, D> for (T0,)
3467    {
3468        #[inline]
3469        unsafe fn encode(
3470            self,
3471            encoder: &mut fidl::encoding::Encoder<'_, D>,
3472            offset: usize,
3473            depth: fidl::encoding::Depth,
3474        ) -> fidl::Result<()> {
3475            encoder.debug_check_bounds::<FlatlandSetDebugNameRequest>(offset);
3476            // Zero out padding regions. There's no need to apply masks
3477            // because the unmasked parts will be overwritten by fields.
3478            // Write the fields.
3479            self.0.encode(encoder, offset + 0, depth)?;
3480            Ok(())
3481        }
3482    }
3483
3484    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3485        for FlatlandSetDebugNameRequest
3486    {
3487        #[inline(always)]
3488        fn new_empty() -> Self {
3489            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<64>, D) }
3490        }
3491
3492        #[inline]
3493        unsafe fn decode(
3494            &mut self,
3495            decoder: &mut fidl::encoding::Decoder<'_, D>,
3496            offset: usize,
3497            _depth: fidl::encoding::Depth,
3498        ) -> fidl::Result<()> {
3499            decoder.debug_check_bounds::<Self>(offset);
3500            // Verify that padding bytes are zero.
3501            fidl::decode!(
3502                fidl::encoding::BoundedString<64>,
3503                D,
3504                &mut self.name,
3505                decoder,
3506                offset + 0,
3507                _depth
3508            )?;
3509            Ok(())
3510        }
3511    }
3512
3513    impl fidl::encoding::ValueTypeMarker for FlatlandSetHitRegionsRequest {
3514        type Borrowed<'a> = &'a Self;
3515        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3516            value
3517        }
3518    }
3519
3520    unsafe impl fidl::encoding::TypeMarker for FlatlandSetHitRegionsRequest {
3521        type Owned = Self;
3522
3523        #[inline(always)]
3524        fn inline_align(_context: fidl::encoding::Context) -> usize {
3525            8
3526        }
3527
3528        #[inline(always)]
3529        fn inline_size(_context: fidl::encoding::Context) -> usize {
3530            24
3531        }
3532    }
3533
3534    unsafe impl<D: fidl::encoding::ResourceDialect>
3535        fidl::encoding::Encode<FlatlandSetHitRegionsRequest, D> for &FlatlandSetHitRegionsRequest
3536    {
3537        #[inline]
3538        unsafe fn encode(
3539            self,
3540            encoder: &mut fidl::encoding::Encoder<'_, D>,
3541            offset: usize,
3542            _depth: fidl::encoding::Depth,
3543        ) -> fidl::Result<()> {
3544            encoder.debug_check_bounds::<FlatlandSetHitRegionsRequest>(offset);
3545            // Delegate to tuple encoding.
3546            fidl::encoding::Encode::<FlatlandSetHitRegionsRequest, D>::encode(
3547                (
3548                    <TransformId as fidl::encoding::ValueTypeMarker>::borrow(&self.transform_id),
3549                    <fidl::encoding::Vector<HitRegion, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.regions),
3550                ),
3551                encoder, offset, _depth
3552            )
3553        }
3554    }
3555    unsafe impl<
3556            D: fidl::encoding::ResourceDialect,
3557            T0: fidl::encoding::Encode<TransformId, D>,
3558            T1: fidl::encoding::Encode<fidl::encoding::Vector<HitRegion, 64>, D>,
3559        > fidl::encoding::Encode<FlatlandSetHitRegionsRequest, D> for (T0, T1)
3560    {
3561        #[inline]
3562        unsafe fn encode(
3563            self,
3564            encoder: &mut fidl::encoding::Encoder<'_, D>,
3565            offset: usize,
3566            depth: fidl::encoding::Depth,
3567        ) -> fidl::Result<()> {
3568            encoder.debug_check_bounds::<FlatlandSetHitRegionsRequest>(offset);
3569            // Zero out padding regions. There's no need to apply masks
3570            // because the unmasked parts will be overwritten by fields.
3571            // Write the fields.
3572            self.0.encode(encoder, offset + 0, depth)?;
3573            self.1.encode(encoder, offset + 8, depth)?;
3574            Ok(())
3575        }
3576    }
3577
3578    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3579        for FlatlandSetHitRegionsRequest
3580    {
3581        #[inline(always)]
3582        fn new_empty() -> Self {
3583            Self {
3584                transform_id: fidl::new_empty!(TransformId, D),
3585                regions: fidl::new_empty!(fidl::encoding::Vector<HitRegion, 64>, D),
3586            }
3587        }
3588
3589        #[inline]
3590        unsafe fn decode(
3591            &mut self,
3592            decoder: &mut fidl::encoding::Decoder<'_, D>,
3593            offset: usize,
3594            _depth: fidl::encoding::Depth,
3595        ) -> fidl::Result<()> {
3596            decoder.debug_check_bounds::<Self>(offset);
3597            // Verify that padding bytes are zero.
3598            fidl::decode!(TransformId, D, &mut self.transform_id, decoder, offset + 0, _depth)?;
3599            fidl::decode!(fidl::encoding::Vector<HitRegion, 64>, D, &mut self.regions, decoder, offset + 8, _depth)?;
3600            Ok(())
3601        }
3602    }
3603
3604    impl fidl::encoding::ValueTypeMarker for FlatlandSetImageBlendingFunctionRequest {
3605        type Borrowed<'a> = &'a Self;
3606        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3607            value
3608        }
3609    }
3610
3611    unsafe impl fidl::encoding::TypeMarker for FlatlandSetImageBlendingFunctionRequest {
3612        type Owned = Self;
3613
3614        #[inline(always)]
3615        fn inline_align(_context: fidl::encoding::Context) -> usize {
3616            8
3617        }
3618
3619        #[inline(always)]
3620        fn inline_size(_context: fidl::encoding::Context) -> usize {
3621            16
3622        }
3623    }
3624
3625    unsafe impl<D: fidl::encoding::ResourceDialect>
3626        fidl::encoding::Encode<FlatlandSetImageBlendingFunctionRequest, D>
3627        for &FlatlandSetImageBlendingFunctionRequest
3628    {
3629        #[inline]
3630        unsafe fn encode(
3631            self,
3632            encoder: &mut fidl::encoding::Encoder<'_, D>,
3633            offset: usize,
3634            _depth: fidl::encoding::Depth,
3635        ) -> fidl::Result<()> {
3636            encoder.debug_check_bounds::<FlatlandSetImageBlendingFunctionRequest>(offset);
3637            // Delegate to tuple encoding.
3638            fidl::encoding::Encode::<FlatlandSetImageBlendingFunctionRequest, D>::encode(
3639                (
3640                    <ContentId as fidl::encoding::ValueTypeMarker>::borrow(&self.image_id),
3641                    <BlendMode as fidl::encoding::ValueTypeMarker>::borrow(&self.blend_mode),
3642                ),
3643                encoder,
3644                offset,
3645                _depth,
3646            )
3647        }
3648    }
3649    unsafe impl<
3650            D: fidl::encoding::ResourceDialect,
3651            T0: fidl::encoding::Encode<ContentId, D>,
3652            T1: fidl::encoding::Encode<BlendMode, D>,
3653        > fidl::encoding::Encode<FlatlandSetImageBlendingFunctionRequest, D> for (T0, T1)
3654    {
3655        #[inline]
3656        unsafe fn encode(
3657            self,
3658            encoder: &mut fidl::encoding::Encoder<'_, D>,
3659            offset: usize,
3660            depth: fidl::encoding::Depth,
3661        ) -> fidl::Result<()> {
3662            encoder.debug_check_bounds::<FlatlandSetImageBlendingFunctionRequest>(offset);
3663            // Zero out padding regions. There's no need to apply masks
3664            // because the unmasked parts will be overwritten by fields.
3665            unsafe {
3666                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3667                (ptr as *mut u64).write_unaligned(0);
3668            }
3669            // Write the fields.
3670            self.0.encode(encoder, offset + 0, depth)?;
3671            self.1.encode(encoder, offset + 8, depth)?;
3672            Ok(())
3673        }
3674    }
3675
3676    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3677        for FlatlandSetImageBlendingFunctionRequest
3678    {
3679        #[inline(always)]
3680        fn new_empty() -> Self {
3681            Self {
3682                image_id: fidl::new_empty!(ContentId, D),
3683                blend_mode: fidl::new_empty!(BlendMode, D),
3684            }
3685        }
3686
3687        #[inline]
3688        unsafe fn decode(
3689            &mut self,
3690            decoder: &mut fidl::encoding::Decoder<'_, D>,
3691            offset: usize,
3692            _depth: fidl::encoding::Depth,
3693        ) -> fidl::Result<()> {
3694            decoder.debug_check_bounds::<Self>(offset);
3695            // Verify that padding bytes are zero.
3696            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3697            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3698            let mask = 0xffffffff00000000u64;
3699            let maskedval = padval & mask;
3700            if maskedval != 0 {
3701                return Err(fidl::Error::NonZeroPadding {
3702                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3703                });
3704            }
3705            fidl::decode!(ContentId, D, &mut self.image_id, decoder, offset + 0, _depth)?;
3706            fidl::decode!(BlendMode, D, &mut self.blend_mode, decoder, offset + 8, _depth)?;
3707            Ok(())
3708        }
3709    }
3710
3711    impl fidl::encoding::ValueTypeMarker for FlatlandSetImageDestinationSizeRequest {
3712        type Borrowed<'a> = &'a Self;
3713        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3714            value
3715        }
3716    }
3717
3718    unsafe impl fidl::encoding::TypeMarker for FlatlandSetImageDestinationSizeRequest {
3719        type Owned = Self;
3720
3721        #[inline(always)]
3722        fn inline_align(_context: fidl::encoding::Context) -> usize {
3723            8
3724        }
3725
3726        #[inline(always)]
3727        fn inline_size(_context: fidl::encoding::Context) -> usize {
3728            16
3729        }
3730    }
3731
3732    unsafe impl<D: fidl::encoding::ResourceDialect>
3733        fidl::encoding::Encode<FlatlandSetImageDestinationSizeRequest, D>
3734        for &FlatlandSetImageDestinationSizeRequest
3735    {
3736        #[inline]
3737        unsafe fn encode(
3738            self,
3739            encoder: &mut fidl::encoding::Encoder<'_, D>,
3740            offset: usize,
3741            _depth: fidl::encoding::Depth,
3742        ) -> fidl::Result<()> {
3743            encoder.debug_check_bounds::<FlatlandSetImageDestinationSizeRequest>(offset);
3744            // Delegate to tuple encoding.
3745            fidl::encoding::Encode::<FlatlandSetImageDestinationSizeRequest, D>::encode(
3746                (
3747                    <ContentId as fidl::encoding::ValueTypeMarker>::borrow(&self.image_id),
3748                    <fidl_fuchsia_math::SizeU as fidl::encoding::ValueTypeMarker>::borrow(
3749                        &self.size,
3750                    ),
3751                ),
3752                encoder,
3753                offset,
3754                _depth,
3755            )
3756        }
3757    }
3758    unsafe impl<
3759            D: fidl::encoding::ResourceDialect,
3760            T0: fidl::encoding::Encode<ContentId, D>,
3761            T1: fidl::encoding::Encode<fidl_fuchsia_math::SizeU, D>,
3762        > fidl::encoding::Encode<FlatlandSetImageDestinationSizeRequest, D> for (T0, T1)
3763    {
3764        #[inline]
3765        unsafe fn encode(
3766            self,
3767            encoder: &mut fidl::encoding::Encoder<'_, D>,
3768            offset: usize,
3769            depth: fidl::encoding::Depth,
3770        ) -> fidl::Result<()> {
3771            encoder.debug_check_bounds::<FlatlandSetImageDestinationSizeRequest>(offset);
3772            // Zero out padding regions. There's no need to apply masks
3773            // because the unmasked parts will be overwritten by fields.
3774            // Write the fields.
3775            self.0.encode(encoder, offset + 0, depth)?;
3776            self.1.encode(encoder, offset + 8, depth)?;
3777            Ok(())
3778        }
3779    }
3780
3781    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3782        for FlatlandSetImageDestinationSizeRequest
3783    {
3784        #[inline(always)]
3785        fn new_empty() -> Self {
3786            Self {
3787                image_id: fidl::new_empty!(ContentId, D),
3788                size: fidl::new_empty!(fidl_fuchsia_math::SizeU, D),
3789            }
3790        }
3791
3792        #[inline]
3793        unsafe fn decode(
3794            &mut self,
3795            decoder: &mut fidl::encoding::Decoder<'_, D>,
3796            offset: usize,
3797            _depth: fidl::encoding::Depth,
3798        ) -> fidl::Result<()> {
3799            decoder.debug_check_bounds::<Self>(offset);
3800            // Verify that padding bytes are zero.
3801            fidl::decode!(ContentId, D, &mut self.image_id, decoder, offset + 0, _depth)?;
3802            fidl::decode!(
3803                fidl_fuchsia_math::SizeU,
3804                D,
3805                &mut self.size,
3806                decoder,
3807                offset + 8,
3808                _depth
3809            )?;
3810            Ok(())
3811        }
3812    }
3813
3814    impl fidl::encoding::ValueTypeMarker for FlatlandSetImageFlipRequest {
3815        type Borrowed<'a> = &'a Self;
3816        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3817            value
3818        }
3819    }
3820
3821    unsafe impl fidl::encoding::TypeMarker for FlatlandSetImageFlipRequest {
3822        type Owned = Self;
3823
3824        #[inline(always)]
3825        fn inline_align(_context: fidl::encoding::Context) -> usize {
3826            8
3827        }
3828
3829        #[inline(always)]
3830        fn inline_size(_context: fidl::encoding::Context) -> usize {
3831            16
3832        }
3833    }
3834
3835    unsafe impl<D: fidl::encoding::ResourceDialect>
3836        fidl::encoding::Encode<FlatlandSetImageFlipRequest, D> for &FlatlandSetImageFlipRequest
3837    {
3838        #[inline]
3839        unsafe fn encode(
3840            self,
3841            encoder: &mut fidl::encoding::Encoder<'_, D>,
3842            offset: usize,
3843            _depth: fidl::encoding::Depth,
3844        ) -> fidl::Result<()> {
3845            encoder.debug_check_bounds::<FlatlandSetImageFlipRequest>(offset);
3846            // Delegate to tuple encoding.
3847            fidl::encoding::Encode::<FlatlandSetImageFlipRequest, D>::encode(
3848                (
3849                    <ContentId as fidl::encoding::ValueTypeMarker>::borrow(&self.image_id),
3850                    <ImageFlip as fidl::encoding::ValueTypeMarker>::borrow(&self.flip),
3851                ),
3852                encoder,
3853                offset,
3854                _depth,
3855            )
3856        }
3857    }
3858    unsafe impl<
3859            D: fidl::encoding::ResourceDialect,
3860            T0: fidl::encoding::Encode<ContentId, D>,
3861            T1: fidl::encoding::Encode<ImageFlip, D>,
3862        > fidl::encoding::Encode<FlatlandSetImageFlipRequest, D> for (T0, T1)
3863    {
3864        #[inline]
3865        unsafe fn encode(
3866            self,
3867            encoder: &mut fidl::encoding::Encoder<'_, D>,
3868            offset: usize,
3869            depth: fidl::encoding::Depth,
3870        ) -> fidl::Result<()> {
3871            encoder.debug_check_bounds::<FlatlandSetImageFlipRequest>(offset);
3872            // Zero out padding regions. There's no need to apply masks
3873            // because the unmasked parts will be overwritten by fields.
3874            unsafe {
3875                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3876                (ptr as *mut u64).write_unaligned(0);
3877            }
3878            // Write the fields.
3879            self.0.encode(encoder, offset + 0, depth)?;
3880            self.1.encode(encoder, offset + 8, depth)?;
3881            Ok(())
3882        }
3883    }
3884
3885    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3886        for FlatlandSetImageFlipRequest
3887    {
3888        #[inline(always)]
3889        fn new_empty() -> Self {
3890            Self { image_id: fidl::new_empty!(ContentId, D), flip: fidl::new_empty!(ImageFlip, D) }
3891        }
3892
3893        #[inline]
3894        unsafe fn decode(
3895            &mut self,
3896            decoder: &mut fidl::encoding::Decoder<'_, D>,
3897            offset: usize,
3898            _depth: fidl::encoding::Depth,
3899        ) -> fidl::Result<()> {
3900            decoder.debug_check_bounds::<Self>(offset);
3901            // Verify that padding bytes are zero.
3902            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3903            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3904            let mask = 0xffffffff00000000u64;
3905            let maskedval = padval & mask;
3906            if maskedval != 0 {
3907                return Err(fidl::Error::NonZeroPadding {
3908                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3909                });
3910            }
3911            fidl::decode!(ContentId, D, &mut self.image_id, decoder, offset + 0, _depth)?;
3912            fidl::decode!(ImageFlip, D, &mut self.flip, decoder, offset + 8, _depth)?;
3913            Ok(())
3914        }
3915    }
3916
3917    impl fidl::encoding::ValueTypeMarker for FlatlandSetImageOpacityRequest {
3918        type Borrowed<'a> = &'a Self;
3919        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3920            value
3921        }
3922    }
3923
3924    unsafe impl fidl::encoding::TypeMarker for FlatlandSetImageOpacityRequest {
3925        type Owned = Self;
3926
3927        #[inline(always)]
3928        fn inline_align(_context: fidl::encoding::Context) -> usize {
3929            8
3930        }
3931
3932        #[inline(always)]
3933        fn inline_size(_context: fidl::encoding::Context) -> usize {
3934            16
3935        }
3936    }
3937
3938    unsafe impl<D: fidl::encoding::ResourceDialect>
3939        fidl::encoding::Encode<FlatlandSetImageOpacityRequest, D>
3940        for &FlatlandSetImageOpacityRequest
3941    {
3942        #[inline]
3943        unsafe fn encode(
3944            self,
3945            encoder: &mut fidl::encoding::Encoder<'_, D>,
3946            offset: usize,
3947            _depth: fidl::encoding::Depth,
3948        ) -> fidl::Result<()> {
3949            encoder.debug_check_bounds::<FlatlandSetImageOpacityRequest>(offset);
3950            // Delegate to tuple encoding.
3951            fidl::encoding::Encode::<FlatlandSetImageOpacityRequest, D>::encode(
3952                (
3953                    <ContentId as fidl::encoding::ValueTypeMarker>::borrow(&self.image_id),
3954                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.val),
3955                ),
3956                encoder,
3957                offset,
3958                _depth,
3959            )
3960        }
3961    }
3962    unsafe impl<
3963            D: fidl::encoding::ResourceDialect,
3964            T0: fidl::encoding::Encode<ContentId, D>,
3965            T1: fidl::encoding::Encode<f32, D>,
3966        > fidl::encoding::Encode<FlatlandSetImageOpacityRequest, D> for (T0, T1)
3967    {
3968        #[inline]
3969        unsafe fn encode(
3970            self,
3971            encoder: &mut fidl::encoding::Encoder<'_, D>,
3972            offset: usize,
3973            depth: fidl::encoding::Depth,
3974        ) -> fidl::Result<()> {
3975            encoder.debug_check_bounds::<FlatlandSetImageOpacityRequest>(offset);
3976            // Zero out padding regions. There's no need to apply masks
3977            // because the unmasked parts will be overwritten by fields.
3978            unsafe {
3979                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3980                (ptr as *mut u64).write_unaligned(0);
3981            }
3982            // Write the fields.
3983            self.0.encode(encoder, offset + 0, depth)?;
3984            self.1.encode(encoder, offset + 8, depth)?;
3985            Ok(())
3986        }
3987    }
3988
3989    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3990        for FlatlandSetImageOpacityRequest
3991    {
3992        #[inline(always)]
3993        fn new_empty() -> Self {
3994            Self { image_id: fidl::new_empty!(ContentId, D), val: fidl::new_empty!(f32, D) }
3995        }
3996
3997        #[inline]
3998        unsafe fn decode(
3999            &mut self,
4000            decoder: &mut fidl::encoding::Decoder<'_, D>,
4001            offset: usize,
4002            _depth: fidl::encoding::Depth,
4003        ) -> fidl::Result<()> {
4004            decoder.debug_check_bounds::<Self>(offset);
4005            // Verify that padding bytes are zero.
4006            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
4007            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4008            let mask = 0xffffffff00000000u64;
4009            let maskedval = padval & mask;
4010            if maskedval != 0 {
4011                return Err(fidl::Error::NonZeroPadding {
4012                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
4013                });
4014            }
4015            fidl::decode!(ContentId, D, &mut self.image_id, decoder, offset + 0, _depth)?;
4016            fidl::decode!(f32, D, &mut self.val, decoder, offset + 8, _depth)?;
4017            Ok(())
4018        }
4019    }
4020
4021    impl fidl::encoding::ValueTypeMarker for FlatlandSetImageSampleRegionRequest {
4022        type Borrowed<'a> = &'a Self;
4023        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4024            value
4025        }
4026    }
4027
4028    unsafe impl fidl::encoding::TypeMarker for FlatlandSetImageSampleRegionRequest {
4029        type Owned = Self;
4030
4031        #[inline(always)]
4032        fn inline_align(_context: fidl::encoding::Context) -> usize {
4033            8
4034        }
4035
4036        #[inline(always)]
4037        fn inline_size(_context: fidl::encoding::Context) -> usize {
4038            24
4039        }
4040    }
4041
4042    unsafe impl<D: fidl::encoding::ResourceDialect>
4043        fidl::encoding::Encode<FlatlandSetImageSampleRegionRequest, D>
4044        for &FlatlandSetImageSampleRegionRequest
4045    {
4046        #[inline]
4047        unsafe fn encode(
4048            self,
4049            encoder: &mut fidl::encoding::Encoder<'_, D>,
4050            offset: usize,
4051            _depth: fidl::encoding::Depth,
4052        ) -> fidl::Result<()> {
4053            encoder.debug_check_bounds::<FlatlandSetImageSampleRegionRequest>(offset);
4054            // Delegate to tuple encoding.
4055            fidl::encoding::Encode::<FlatlandSetImageSampleRegionRequest, D>::encode(
4056                (
4057                    <ContentId as fidl::encoding::ValueTypeMarker>::borrow(&self.image_id),
4058                    <fidl_fuchsia_math::RectF as fidl::encoding::ValueTypeMarker>::borrow(
4059                        &self.rect,
4060                    ),
4061                ),
4062                encoder,
4063                offset,
4064                _depth,
4065            )
4066        }
4067    }
4068    unsafe impl<
4069            D: fidl::encoding::ResourceDialect,
4070            T0: fidl::encoding::Encode<ContentId, D>,
4071            T1: fidl::encoding::Encode<fidl_fuchsia_math::RectF, D>,
4072        > fidl::encoding::Encode<FlatlandSetImageSampleRegionRequest, D> for (T0, T1)
4073    {
4074        #[inline]
4075        unsafe fn encode(
4076            self,
4077            encoder: &mut fidl::encoding::Encoder<'_, D>,
4078            offset: usize,
4079            depth: fidl::encoding::Depth,
4080        ) -> fidl::Result<()> {
4081            encoder.debug_check_bounds::<FlatlandSetImageSampleRegionRequest>(offset);
4082            // Zero out padding regions. There's no need to apply masks
4083            // because the unmasked parts will be overwritten by fields.
4084            // Write the fields.
4085            self.0.encode(encoder, offset + 0, depth)?;
4086            self.1.encode(encoder, offset + 8, depth)?;
4087            Ok(())
4088        }
4089    }
4090
4091    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4092        for FlatlandSetImageSampleRegionRequest
4093    {
4094        #[inline(always)]
4095        fn new_empty() -> Self {
4096            Self {
4097                image_id: fidl::new_empty!(ContentId, D),
4098                rect: fidl::new_empty!(fidl_fuchsia_math::RectF, D),
4099            }
4100        }
4101
4102        #[inline]
4103        unsafe fn decode(
4104            &mut self,
4105            decoder: &mut fidl::encoding::Decoder<'_, D>,
4106            offset: usize,
4107            _depth: fidl::encoding::Depth,
4108        ) -> fidl::Result<()> {
4109            decoder.debug_check_bounds::<Self>(offset);
4110            // Verify that padding bytes are zero.
4111            fidl::decode!(ContentId, D, &mut self.image_id, decoder, offset + 0, _depth)?;
4112            fidl::decode!(
4113                fidl_fuchsia_math::RectF,
4114                D,
4115                &mut self.rect,
4116                decoder,
4117                offset + 8,
4118                _depth
4119            )?;
4120            Ok(())
4121        }
4122    }
4123
4124    impl fidl::encoding::ValueTypeMarker for FlatlandSetInfiniteHitRegionRequest {
4125        type Borrowed<'a> = &'a Self;
4126        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4127            value
4128        }
4129    }
4130
4131    unsafe impl fidl::encoding::TypeMarker for FlatlandSetInfiniteHitRegionRequest {
4132        type Owned = Self;
4133
4134        #[inline(always)]
4135        fn inline_align(_context: fidl::encoding::Context) -> usize {
4136            8
4137        }
4138
4139        #[inline(always)]
4140        fn inline_size(_context: fidl::encoding::Context) -> usize {
4141            16
4142        }
4143    }
4144
4145    unsafe impl<D: fidl::encoding::ResourceDialect>
4146        fidl::encoding::Encode<FlatlandSetInfiniteHitRegionRequest, D>
4147        for &FlatlandSetInfiniteHitRegionRequest
4148    {
4149        #[inline]
4150        unsafe fn encode(
4151            self,
4152            encoder: &mut fidl::encoding::Encoder<'_, D>,
4153            offset: usize,
4154            _depth: fidl::encoding::Depth,
4155        ) -> fidl::Result<()> {
4156            encoder.debug_check_bounds::<FlatlandSetInfiniteHitRegionRequest>(offset);
4157            // Delegate to tuple encoding.
4158            fidl::encoding::Encode::<FlatlandSetInfiniteHitRegionRequest, D>::encode(
4159                (
4160                    <TransformId as fidl::encoding::ValueTypeMarker>::borrow(&self.transform_id),
4161                    <HitTestInteraction as fidl::encoding::ValueTypeMarker>::borrow(&self.hit_test),
4162                ),
4163                encoder,
4164                offset,
4165                _depth,
4166            )
4167        }
4168    }
4169    unsafe impl<
4170            D: fidl::encoding::ResourceDialect,
4171            T0: fidl::encoding::Encode<TransformId, D>,
4172            T1: fidl::encoding::Encode<HitTestInteraction, D>,
4173        > fidl::encoding::Encode<FlatlandSetInfiniteHitRegionRequest, D> for (T0, T1)
4174    {
4175        #[inline]
4176        unsafe fn encode(
4177            self,
4178            encoder: &mut fidl::encoding::Encoder<'_, D>,
4179            offset: usize,
4180            depth: fidl::encoding::Depth,
4181        ) -> fidl::Result<()> {
4182            encoder.debug_check_bounds::<FlatlandSetInfiniteHitRegionRequest>(offset);
4183            // Zero out padding regions. There's no need to apply masks
4184            // because the unmasked parts will be overwritten by fields.
4185            unsafe {
4186                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
4187                (ptr as *mut u64).write_unaligned(0);
4188            }
4189            // Write the fields.
4190            self.0.encode(encoder, offset + 0, depth)?;
4191            self.1.encode(encoder, offset + 8, depth)?;
4192            Ok(())
4193        }
4194    }
4195
4196    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4197        for FlatlandSetInfiniteHitRegionRequest
4198    {
4199        #[inline(always)]
4200        fn new_empty() -> Self {
4201            Self {
4202                transform_id: fidl::new_empty!(TransformId, D),
4203                hit_test: fidl::new_empty!(HitTestInteraction, D),
4204            }
4205        }
4206
4207        #[inline]
4208        unsafe fn decode(
4209            &mut self,
4210            decoder: &mut fidl::encoding::Decoder<'_, D>,
4211            offset: usize,
4212            _depth: fidl::encoding::Depth,
4213        ) -> fidl::Result<()> {
4214            decoder.debug_check_bounds::<Self>(offset);
4215            // Verify that padding bytes are zero.
4216            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
4217            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4218            let mask = 0xffffffffffffff00u64;
4219            let maskedval = padval & mask;
4220            if maskedval != 0 {
4221                return Err(fidl::Error::NonZeroPadding {
4222                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
4223                });
4224            }
4225            fidl::decode!(TransformId, D, &mut self.transform_id, decoder, offset + 0, _depth)?;
4226            fidl::decode!(HitTestInteraction, D, &mut self.hit_test, decoder, offset + 8, _depth)?;
4227            Ok(())
4228        }
4229    }
4230
4231    impl fidl::encoding::ValueTypeMarker for FlatlandSetOpacityRequest {
4232        type Borrowed<'a> = &'a Self;
4233        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4234            value
4235        }
4236    }
4237
4238    unsafe impl fidl::encoding::TypeMarker for FlatlandSetOpacityRequest {
4239        type Owned = Self;
4240
4241        #[inline(always)]
4242        fn inline_align(_context: fidl::encoding::Context) -> usize {
4243            8
4244        }
4245
4246        #[inline(always)]
4247        fn inline_size(_context: fidl::encoding::Context) -> usize {
4248            16
4249        }
4250    }
4251
4252    unsafe impl<D: fidl::encoding::ResourceDialect>
4253        fidl::encoding::Encode<FlatlandSetOpacityRequest, D> for &FlatlandSetOpacityRequest
4254    {
4255        #[inline]
4256        unsafe fn encode(
4257            self,
4258            encoder: &mut fidl::encoding::Encoder<'_, D>,
4259            offset: usize,
4260            _depth: fidl::encoding::Depth,
4261        ) -> fidl::Result<()> {
4262            encoder.debug_check_bounds::<FlatlandSetOpacityRequest>(offset);
4263            // Delegate to tuple encoding.
4264            fidl::encoding::Encode::<FlatlandSetOpacityRequest, D>::encode(
4265                (
4266                    <TransformId as fidl::encoding::ValueTypeMarker>::borrow(&self.transform_id),
4267                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
4268                ),
4269                encoder,
4270                offset,
4271                _depth,
4272            )
4273        }
4274    }
4275    unsafe impl<
4276            D: fidl::encoding::ResourceDialect,
4277            T0: fidl::encoding::Encode<TransformId, D>,
4278            T1: fidl::encoding::Encode<f32, D>,
4279        > fidl::encoding::Encode<FlatlandSetOpacityRequest, D> for (T0, T1)
4280    {
4281        #[inline]
4282        unsafe fn encode(
4283            self,
4284            encoder: &mut fidl::encoding::Encoder<'_, D>,
4285            offset: usize,
4286            depth: fidl::encoding::Depth,
4287        ) -> fidl::Result<()> {
4288            encoder.debug_check_bounds::<FlatlandSetOpacityRequest>(offset);
4289            // Zero out padding regions. There's no need to apply masks
4290            // because the unmasked parts will be overwritten by fields.
4291            unsafe {
4292                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
4293                (ptr as *mut u64).write_unaligned(0);
4294            }
4295            // Write the fields.
4296            self.0.encode(encoder, offset + 0, depth)?;
4297            self.1.encode(encoder, offset + 8, depth)?;
4298            Ok(())
4299        }
4300    }
4301
4302    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4303        for FlatlandSetOpacityRequest
4304    {
4305        #[inline(always)]
4306        fn new_empty() -> Self {
4307            Self { transform_id: fidl::new_empty!(TransformId, D), value: fidl::new_empty!(f32, D) }
4308        }
4309
4310        #[inline]
4311        unsafe fn decode(
4312            &mut self,
4313            decoder: &mut fidl::encoding::Decoder<'_, D>,
4314            offset: usize,
4315            _depth: fidl::encoding::Depth,
4316        ) -> fidl::Result<()> {
4317            decoder.debug_check_bounds::<Self>(offset);
4318            // Verify that padding bytes are zero.
4319            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
4320            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4321            let mask = 0xffffffff00000000u64;
4322            let maskedval = padval & mask;
4323            if maskedval != 0 {
4324                return Err(fidl::Error::NonZeroPadding {
4325                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
4326                });
4327            }
4328            fidl::decode!(TransformId, D, &mut self.transform_id, decoder, offset + 0, _depth)?;
4329            fidl::decode!(f32, D, &mut self.value, decoder, offset + 8, _depth)?;
4330            Ok(())
4331        }
4332    }
4333
4334    impl fidl::encoding::ValueTypeMarker for FlatlandSetOrientationRequest {
4335        type Borrowed<'a> = &'a Self;
4336        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4337            value
4338        }
4339    }
4340
4341    unsafe impl fidl::encoding::TypeMarker for FlatlandSetOrientationRequest {
4342        type Owned = Self;
4343
4344        #[inline(always)]
4345        fn inline_align(_context: fidl::encoding::Context) -> usize {
4346            8
4347        }
4348
4349        #[inline(always)]
4350        fn inline_size(_context: fidl::encoding::Context) -> usize {
4351            16
4352        }
4353    }
4354
4355    unsafe impl<D: fidl::encoding::ResourceDialect>
4356        fidl::encoding::Encode<FlatlandSetOrientationRequest, D>
4357        for &FlatlandSetOrientationRequest
4358    {
4359        #[inline]
4360        unsafe fn encode(
4361            self,
4362            encoder: &mut fidl::encoding::Encoder<'_, D>,
4363            offset: usize,
4364            _depth: fidl::encoding::Depth,
4365        ) -> fidl::Result<()> {
4366            encoder.debug_check_bounds::<FlatlandSetOrientationRequest>(offset);
4367            // Delegate to tuple encoding.
4368            fidl::encoding::Encode::<FlatlandSetOrientationRequest, D>::encode(
4369                (
4370                    <TransformId as fidl::encoding::ValueTypeMarker>::borrow(&self.transform_id),
4371                    <Orientation as fidl::encoding::ValueTypeMarker>::borrow(&self.orientation),
4372                ),
4373                encoder,
4374                offset,
4375                _depth,
4376            )
4377        }
4378    }
4379    unsafe impl<
4380            D: fidl::encoding::ResourceDialect,
4381            T0: fidl::encoding::Encode<TransformId, D>,
4382            T1: fidl::encoding::Encode<Orientation, D>,
4383        > fidl::encoding::Encode<FlatlandSetOrientationRequest, D> for (T0, T1)
4384    {
4385        #[inline]
4386        unsafe fn encode(
4387            self,
4388            encoder: &mut fidl::encoding::Encoder<'_, D>,
4389            offset: usize,
4390            depth: fidl::encoding::Depth,
4391        ) -> fidl::Result<()> {
4392            encoder.debug_check_bounds::<FlatlandSetOrientationRequest>(offset);
4393            // Zero out padding regions. There's no need to apply masks
4394            // because the unmasked parts will be overwritten by fields.
4395            unsafe {
4396                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
4397                (ptr as *mut u64).write_unaligned(0);
4398            }
4399            // Write the fields.
4400            self.0.encode(encoder, offset + 0, depth)?;
4401            self.1.encode(encoder, offset + 8, depth)?;
4402            Ok(())
4403        }
4404    }
4405
4406    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4407        for FlatlandSetOrientationRequest
4408    {
4409        #[inline(always)]
4410        fn new_empty() -> Self {
4411            Self {
4412                transform_id: fidl::new_empty!(TransformId, D),
4413                orientation: fidl::new_empty!(Orientation, D),
4414            }
4415        }
4416
4417        #[inline]
4418        unsafe fn decode(
4419            &mut self,
4420            decoder: &mut fidl::encoding::Decoder<'_, D>,
4421            offset: usize,
4422            _depth: fidl::encoding::Depth,
4423        ) -> fidl::Result<()> {
4424            decoder.debug_check_bounds::<Self>(offset);
4425            // Verify that padding bytes are zero.
4426            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
4427            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4428            let mask = 0xffffffff00000000u64;
4429            let maskedval = padval & mask;
4430            if maskedval != 0 {
4431                return Err(fidl::Error::NonZeroPadding {
4432                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
4433                });
4434            }
4435            fidl::decode!(TransformId, D, &mut self.transform_id, decoder, offset + 0, _depth)?;
4436            fidl::decode!(Orientation, D, &mut self.orientation, decoder, offset + 8, _depth)?;
4437            Ok(())
4438        }
4439    }
4440
4441    impl fidl::encoding::ValueTypeMarker for FlatlandSetRootTransformRequest {
4442        type Borrowed<'a> = &'a Self;
4443        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4444            value
4445        }
4446    }
4447
4448    unsafe impl fidl::encoding::TypeMarker for FlatlandSetRootTransformRequest {
4449        type Owned = Self;
4450
4451        #[inline(always)]
4452        fn inline_align(_context: fidl::encoding::Context) -> usize {
4453            8
4454        }
4455
4456        #[inline(always)]
4457        fn inline_size(_context: fidl::encoding::Context) -> usize {
4458            8
4459        }
4460        #[inline(always)]
4461        fn encode_is_copy() -> bool {
4462            true
4463        }
4464
4465        #[inline(always)]
4466        fn decode_is_copy() -> bool {
4467            true
4468        }
4469    }
4470
4471    unsafe impl<D: fidl::encoding::ResourceDialect>
4472        fidl::encoding::Encode<FlatlandSetRootTransformRequest, D>
4473        for &FlatlandSetRootTransformRequest
4474    {
4475        #[inline]
4476        unsafe fn encode(
4477            self,
4478            encoder: &mut fidl::encoding::Encoder<'_, D>,
4479            offset: usize,
4480            _depth: fidl::encoding::Depth,
4481        ) -> fidl::Result<()> {
4482            encoder.debug_check_bounds::<FlatlandSetRootTransformRequest>(offset);
4483            unsafe {
4484                // Copy the object into the buffer.
4485                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4486                (buf_ptr as *mut FlatlandSetRootTransformRequest)
4487                    .write_unaligned((self as *const FlatlandSetRootTransformRequest).read());
4488                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4489                // done second because the memcpy will write garbage to these bytes.
4490            }
4491            Ok(())
4492        }
4493    }
4494    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TransformId, D>>
4495        fidl::encoding::Encode<FlatlandSetRootTransformRequest, D> for (T0,)
4496    {
4497        #[inline]
4498        unsafe fn encode(
4499            self,
4500            encoder: &mut fidl::encoding::Encoder<'_, D>,
4501            offset: usize,
4502            depth: fidl::encoding::Depth,
4503        ) -> fidl::Result<()> {
4504            encoder.debug_check_bounds::<FlatlandSetRootTransformRequest>(offset);
4505            // Zero out padding regions. There's no need to apply masks
4506            // because the unmasked parts will be overwritten by fields.
4507            // Write the fields.
4508            self.0.encode(encoder, offset + 0, depth)?;
4509            Ok(())
4510        }
4511    }
4512
4513    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4514        for FlatlandSetRootTransformRequest
4515    {
4516        #[inline(always)]
4517        fn new_empty() -> Self {
4518            Self { transform_id: fidl::new_empty!(TransformId, D) }
4519        }
4520
4521        #[inline]
4522        unsafe fn decode(
4523            &mut self,
4524            decoder: &mut fidl::encoding::Decoder<'_, D>,
4525            offset: usize,
4526            _depth: fidl::encoding::Depth,
4527        ) -> fidl::Result<()> {
4528            decoder.debug_check_bounds::<Self>(offset);
4529            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4530            // Verify that padding bytes are zero.
4531            // Copy from the buffer into the object.
4532            unsafe {
4533                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4534            }
4535            Ok(())
4536        }
4537    }
4538
4539    impl fidl::encoding::ValueTypeMarker for FlatlandSetScaleRequest {
4540        type Borrowed<'a> = &'a Self;
4541        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4542            value
4543        }
4544    }
4545
4546    unsafe impl fidl::encoding::TypeMarker for FlatlandSetScaleRequest {
4547        type Owned = Self;
4548
4549        #[inline(always)]
4550        fn inline_align(_context: fidl::encoding::Context) -> usize {
4551            8
4552        }
4553
4554        #[inline(always)]
4555        fn inline_size(_context: fidl::encoding::Context) -> usize {
4556            16
4557        }
4558    }
4559
4560    unsafe impl<D: fidl::encoding::ResourceDialect>
4561        fidl::encoding::Encode<FlatlandSetScaleRequest, D> for &FlatlandSetScaleRequest
4562    {
4563        #[inline]
4564        unsafe fn encode(
4565            self,
4566            encoder: &mut fidl::encoding::Encoder<'_, D>,
4567            offset: usize,
4568            _depth: fidl::encoding::Depth,
4569        ) -> fidl::Result<()> {
4570            encoder.debug_check_bounds::<FlatlandSetScaleRequest>(offset);
4571            // Delegate to tuple encoding.
4572            fidl::encoding::Encode::<FlatlandSetScaleRequest, D>::encode(
4573                (
4574                    <TransformId as fidl::encoding::ValueTypeMarker>::borrow(&self.transform_id),
4575                    <fidl_fuchsia_math::VecF as fidl::encoding::ValueTypeMarker>::borrow(
4576                        &self.scale,
4577                    ),
4578                ),
4579                encoder,
4580                offset,
4581                _depth,
4582            )
4583        }
4584    }
4585    unsafe impl<
4586            D: fidl::encoding::ResourceDialect,
4587            T0: fidl::encoding::Encode<TransformId, D>,
4588            T1: fidl::encoding::Encode<fidl_fuchsia_math::VecF, D>,
4589        > fidl::encoding::Encode<FlatlandSetScaleRequest, D> for (T0, T1)
4590    {
4591        #[inline]
4592        unsafe fn encode(
4593            self,
4594            encoder: &mut fidl::encoding::Encoder<'_, D>,
4595            offset: usize,
4596            depth: fidl::encoding::Depth,
4597        ) -> fidl::Result<()> {
4598            encoder.debug_check_bounds::<FlatlandSetScaleRequest>(offset);
4599            // Zero out padding regions. There's no need to apply masks
4600            // because the unmasked parts will be overwritten by fields.
4601            // Write the fields.
4602            self.0.encode(encoder, offset + 0, depth)?;
4603            self.1.encode(encoder, offset + 8, depth)?;
4604            Ok(())
4605        }
4606    }
4607
4608    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4609        for FlatlandSetScaleRequest
4610    {
4611        #[inline(always)]
4612        fn new_empty() -> Self {
4613            Self {
4614                transform_id: fidl::new_empty!(TransformId, D),
4615                scale: fidl::new_empty!(fidl_fuchsia_math::VecF, D),
4616            }
4617        }
4618
4619        #[inline]
4620        unsafe fn decode(
4621            &mut self,
4622            decoder: &mut fidl::encoding::Decoder<'_, D>,
4623            offset: usize,
4624            _depth: fidl::encoding::Depth,
4625        ) -> fidl::Result<()> {
4626            decoder.debug_check_bounds::<Self>(offset);
4627            // Verify that padding bytes are zero.
4628            fidl::decode!(TransformId, D, &mut self.transform_id, decoder, offset + 0, _depth)?;
4629            fidl::decode!(
4630                fidl_fuchsia_math::VecF,
4631                D,
4632                &mut self.scale,
4633                decoder,
4634                offset + 8,
4635                _depth
4636            )?;
4637            Ok(())
4638        }
4639    }
4640
4641    impl fidl::encoding::ValueTypeMarker for FlatlandSetTranslationRequest {
4642        type Borrowed<'a> = &'a Self;
4643        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4644            value
4645        }
4646    }
4647
4648    unsafe impl fidl::encoding::TypeMarker for FlatlandSetTranslationRequest {
4649        type Owned = Self;
4650
4651        #[inline(always)]
4652        fn inline_align(_context: fidl::encoding::Context) -> usize {
4653            8
4654        }
4655
4656        #[inline(always)]
4657        fn inline_size(_context: fidl::encoding::Context) -> usize {
4658            16
4659        }
4660    }
4661
4662    unsafe impl<D: fidl::encoding::ResourceDialect>
4663        fidl::encoding::Encode<FlatlandSetTranslationRequest, D>
4664        for &FlatlandSetTranslationRequest
4665    {
4666        #[inline]
4667        unsafe fn encode(
4668            self,
4669            encoder: &mut fidl::encoding::Encoder<'_, D>,
4670            offset: usize,
4671            _depth: fidl::encoding::Depth,
4672        ) -> fidl::Result<()> {
4673            encoder.debug_check_bounds::<FlatlandSetTranslationRequest>(offset);
4674            // Delegate to tuple encoding.
4675            fidl::encoding::Encode::<FlatlandSetTranslationRequest, D>::encode(
4676                (
4677                    <TransformId as fidl::encoding::ValueTypeMarker>::borrow(&self.transform_id),
4678                    <fidl_fuchsia_math::Vec_ as fidl::encoding::ValueTypeMarker>::borrow(
4679                        &self.translation,
4680                    ),
4681                ),
4682                encoder,
4683                offset,
4684                _depth,
4685            )
4686        }
4687    }
4688    unsafe impl<
4689            D: fidl::encoding::ResourceDialect,
4690            T0: fidl::encoding::Encode<TransformId, D>,
4691            T1: fidl::encoding::Encode<fidl_fuchsia_math::Vec_, D>,
4692        > fidl::encoding::Encode<FlatlandSetTranslationRequest, D> for (T0, T1)
4693    {
4694        #[inline]
4695        unsafe fn encode(
4696            self,
4697            encoder: &mut fidl::encoding::Encoder<'_, D>,
4698            offset: usize,
4699            depth: fidl::encoding::Depth,
4700        ) -> fidl::Result<()> {
4701            encoder.debug_check_bounds::<FlatlandSetTranslationRequest>(offset);
4702            // Zero out padding regions. There's no need to apply masks
4703            // because the unmasked parts will be overwritten by fields.
4704            // Write the fields.
4705            self.0.encode(encoder, offset + 0, depth)?;
4706            self.1.encode(encoder, offset + 8, depth)?;
4707            Ok(())
4708        }
4709    }
4710
4711    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4712        for FlatlandSetTranslationRequest
4713    {
4714        #[inline(always)]
4715        fn new_empty() -> Self {
4716            Self {
4717                transform_id: fidl::new_empty!(TransformId, D),
4718                translation: fidl::new_empty!(fidl_fuchsia_math::Vec_, D),
4719            }
4720        }
4721
4722        #[inline]
4723        unsafe fn decode(
4724            &mut self,
4725            decoder: &mut fidl::encoding::Decoder<'_, D>,
4726            offset: usize,
4727            _depth: fidl::encoding::Depth,
4728        ) -> fidl::Result<()> {
4729            decoder.debug_check_bounds::<Self>(offset);
4730            // Verify that padding bytes are zero.
4731            fidl::decode!(TransformId, D, &mut self.transform_id, decoder, offset + 0, _depth)?;
4732            fidl::decode!(
4733                fidl_fuchsia_math::Vec_,
4734                D,
4735                &mut self.translation,
4736                decoder,
4737                offset + 8,
4738                _depth
4739            )?;
4740            Ok(())
4741        }
4742    }
4743
4744    impl fidl::encoding::ValueTypeMarker for FlatlandSetViewportPropertiesRequest {
4745        type Borrowed<'a> = &'a Self;
4746        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4747            value
4748        }
4749    }
4750
4751    unsafe impl fidl::encoding::TypeMarker for FlatlandSetViewportPropertiesRequest {
4752        type Owned = Self;
4753
4754        #[inline(always)]
4755        fn inline_align(_context: fidl::encoding::Context) -> usize {
4756            8
4757        }
4758
4759        #[inline(always)]
4760        fn inline_size(_context: fidl::encoding::Context) -> usize {
4761            24
4762        }
4763    }
4764
4765    unsafe impl<D: fidl::encoding::ResourceDialect>
4766        fidl::encoding::Encode<FlatlandSetViewportPropertiesRequest, D>
4767        for &FlatlandSetViewportPropertiesRequest
4768    {
4769        #[inline]
4770        unsafe fn encode(
4771            self,
4772            encoder: &mut fidl::encoding::Encoder<'_, D>,
4773            offset: usize,
4774            _depth: fidl::encoding::Depth,
4775        ) -> fidl::Result<()> {
4776            encoder.debug_check_bounds::<FlatlandSetViewportPropertiesRequest>(offset);
4777            // Delegate to tuple encoding.
4778            fidl::encoding::Encode::<FlatlandSetViewportPropertiesRequest, D>::encode(
4779                (
4780                    <ContentId as fidl::encoding::ValueTypeMarker>::borrow(&self.viewport_id),
4781                    <ViewportProperties as fidl::encoding::ValueTypeMarker>::borrow(
4782                        &self.properties,
4783                    ),
4784                ),
4785                encoder,
4786                offset,
4787                _depth,
4788            )
4789        }
4790    }
4791    unsafe impl<
4792            D: fidl::encoding::ResourceDialect,
4793            T0: fidl::encoding::Encode<ContentId, D>,
4794            T1: fidl::encoding::Encode<ViewportProperties, D>,
4795        > fidl::encoding::Encode<FlatlandSetViewportPropertiesRequest, D> for (T0, T1)
4796    {
4797        #[inline]
4798        unsafe fn encode(
4799            self,
4800            encoder: &mut fidl::encoding::Encoder<'_, D>,
4801            offset: usize,
4802            depth: fidl::encoding::Depth,
4803        ) -> fidl::Result<()> {
4804            encoder.debug_check_bounds::<FlatlandSetViewportPropertiesRequest>(offset);
4805            // Zero out padding regions. There's no need to apply masks
4806            // because the unmasked parts will be overwritten by fields.
4807            // Write the fields.
4808            self.0.encode(encoder, offset + 0, depth)?;
4809            self.1.encode(encoder, offset + 8, depth)?;
4810            Ok(())
4811        }
4812    }
4813
4814    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4815        for FlatlandSetViewportPropertiesRequest
4816    {
4817        #[inline(always)]
4818        fn new_empty() -> Self {
4819            Self {
4820                viewport_id: fidl::new_empty!(ContentId, D),
4821                properties: fidl::new_empty!(ViewportProperties, D),
4822            }
4823        }
4824
4825        #[inline]
4826        unsafe fn decode(
4827            &mut self,
4828            decoder: &mut fidl::encoding::Decoder<'_, D>,
4829            offset: usize,
4830            _depth: fidl::encoding::Depth,
4831        ) -> fidl::Result<()> {
4832            decoder.debug_check_bounds::<Self>(offset);
4833            // Verify that padding bytes are zero.
4834            fidl::decode!(ContentId, D, &mut self.viewport_id, decoder, offset + 0, _depth)?;
4835            fidl::decode!(
4836                ViewportProperties,
4837                D,
4838                &mut self.properties,
4839                decoder,
4840                offset + 8,
4841                _depth
4842            )?;
4843            Ok(())
4844        }
4845    }
4846
4847    impl fidl::encoding::ValueTypeMarker for HitRegion {
4848        type Borrowed<'a> = &'a Self;
4849        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4850            value
4851        }
4852    }
4853
4854    unsafe impl fidl::encoding::TypeMarker for HitRegion {
4855        type Owned = Self;
4856
4857        #[inline(always)]
4858        fn inline_align(_context: fidl::encoding::Context) -> usize {
4859            4
4860        }
4861
4862        #[inline(always)]
4863        fn inline_size(_context: fidl::encoding::Context) -> usize {
4864            20
4865        }
4866    }
4867
4868    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HitRegion, D>
4869        for &HitRegion
4870    {
4871        #[inline]
4872        unsafe fn encode(
4873            self,
4874            encoder: &mut fidl::encoding::Encoder<'_, D>,
4875            offset: usize,
4876            _depth: fidl::encoding::Depth,
4877        ) -> fidl::Result<()> {
4878            encoder.debug_check_bounds::<HitRegion>(offset);
4879            // Delegate to tuple encoding.
4880            fidl::encoding::Encode::<HitRegion, D>::encode(
4881                (
4882                    <fidl_fuchsia_math::RectF as fidl::encoding::ValueTypeMarker>::borrow(
4883                        &self.region,
4884                    ),
4885                    <HitTestInteraction as fidl::encoding::ValueTypeMarker>::borrow(&self.hit_test),
4886                ),
4887                encoder,
4888                offset,
4889                _depth,
4890            )
4891        }
4892    }
4893    unsafe impl<
4894            D: fidl::encoding::ResourceDialect,
4895            T0: fidl::encoding::Encode<fidl_fuchsia_math::RectF, D>,
4896            T1: fidl::encoding::Encode<HitTestInteraction, D>,
4897        > fidl::encoding::Encode<HitRegion, D> for (T0, T1)
4898    {
4899        #[inline]
4900        unsafe fn encode(
4901            self,
4902            encoder: &mut fidl::encoding::Encoder<'_, D>,
4903            offset: usize,
4904            depth: fidl::encoding::Depth,
4905        ) -> fidl::Result<()> {
4906            encoder.debug_check_bounds::<HitRegion>(offset);
4907            // Zero out padding regions. There's no need to apply masks
4908            // because the unmasked parts will be overwritten by fields.
4909            unsafe {
4910                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
4911                (ptr as *mut u32).write_unaligned(0);
4912            }
4913            // Write the fields.
4914            self.0.encode(encoder, offset + 0, depth)?;
4915            self.1.encode(encoder, offset + 16, depth)?;
4916            Ok(())
4917        }
4918    }
4919
4920    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HitRegion {
4921        #[inline(always)]
4922        fn new_empty() -> Self {
4923            Self {
4924                region: fidl::new_empty!(fidl_fuchsia_math::RectF, D),
4925                hit_test: fidl::new_empty!(HitTestInteraction, D),
4926            }
4927        }
4928
4929        #[inline]
4930        unsafe fn decode(
4931            &mut self,
4932            decoder: &mut fidl::encoding::Decoder<'_, D>,
4933            offset: usize,
4934            _depth: fidl::encoding::Depth,
4935        ) -> fidl::Result<()> {
4936            decoder.debug_check_bounds::<Self>(offset);
4937            // Verify that padding bytes are zero.
4938            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
4939            let padval = unsafe { (ptr as *const u32).read_unaligned() };
4940            let mask = 0xffffff00u32;
4941            let maskedval = padval & mask;
4942            if maskedval != 0 {
4943                return Err(fidl::Error::NonZeroPadding {
4944                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
4945                });
4946            }
4947            fidl::decode!(
4948                fidl_fuchsia_math::RectF,
4949                D,
4950                &mut self.region,
4951                decoder,
4952                offset + 0,
4953                _depth
4954            )?;
4955            fidl::decode!(HitTestInteraction, D, &mut self.hit_test, decoder, offset + 16, _depth)?;
4956            Ok(())
4957        }
4958    }
4959
4960    impl fidl::encoding::ValueTypeMarker for ParentViewportWatcherGetLayoutResponse {
4961        type Borrowed<'a> = &'a Self;
4962        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4963            value
4964        }
4965    }
4966
4967    unsafe impl fidl::encoding::TypeMarker for ParentViewportWatcherGetLayoutResponse {
4968        type Owned = Self;
4969
4970        #[inline(always)]
4971        fn inline_align(_context: fidl::encoding::Context) -> usize {
4972            8
4973        }
4974
4975        #[inline(always)]
4976        fn inline_size(_context: fidl::encoding::Context) -> usize {
4977            16
4978        }
4979    }
4980
4981    unsafe impl<D: fidl::encoding::ResourceDialect>
4982        fidl::encoding::Encode<ParentViewportWatcherGetLayoutResponse, D>
4983        for &ParentViewportWatcherGetLayoutResponse
4984    {
4985        #[inline]
4986        unsafe fn encode(
4987            self,
4988            encoder: &mut fidl::encoding::Encoder<'_, D>,
4989            offset: usize,
4990            _depth: fidl::encoding::Depth,
4991        ) -> fidl::Result<()> {
4992            encoder.debug_check_bounds::<ParentViewportWatcherGetLayoutResponse>(offset);
4993            // Delegate to tuple encoding.
4994            fidl::encoding::Encode::<ParentViewportWatcherGetLayoutResponse, D>::encode(
4995                (<LayoutInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
4996                encoder,
4997                offset,
4998                _depth,
4999            )
5000        }
5001    }
5002    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LayoutInfo, D>>
5003        fidl::encoding::Encode<ParentViewportWatcherGetLayoutResponse, D> for (T0,)
5004    {
5005        #[inline]
5006        unsafe fn encode(
5007            self,
5008            encoder: &mut fidl::encoding::Encoder<'_, D>,
5009            offset: usize,
5010            depth: fidl::encoding::Depth,
5011        ) -> fidl::Result<()> {
5012            encoder.debug_check_bounds::<ParentViewportWatcherGetLayoutResponse>(offset);
5013            // Zero out padding regions. There's no need to apply masks
5014            // because the unmasked parts will be overwritten by fields.
5015            // Write the fields.
5016            self.0.encode(encoder, offset + 0, depth)?;
5017            Ok(())
5018        }
5019    }
5020
5021    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5022        for ParentViewportWatcherGetLayoutResponse
5023    {
5024        #[inline(always)]
5025        fn new_empty() -> Self {
5026            Self { info: fidl::new_empty!(LayoutInfo, D) }
5027        }
5028
5029        #[inline]
5030        unsafe fn decode(
5031            &mut self,
5032            decoder: &mut fidl::encoding::Decoder<'_, D>,
5033            offset: usize,
5034            _depth: fidl::encoding::Depth,
5035        ) -> fidl::Result<()> {
5036            decoder.debug_check_bounds::<Self>(offset);
5037            // Verify that padding bytes are zero.
5038            fidl::decode!(LayoutInfo, D, &mut self.info, decoder, offset + 0, _depth)?;
5039            Ok(())
5040        }
5041    }
5042
5043    impl fidl::encoding::ValueTypeMarker for ParentViewportWatcherGetStatusResponse {
5044        type Borrowed<'a> = &'a Self;
5045        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5046            value
5047        }
5048    }
5049
5050    unsafe impl fidl::encoding::TypeMarker for ParentViewportWatcherGetStatusResponse {
5051        type Owned = Self;
5052
5053        #[inline(always)]
5054        fn inline_align(_context: fidl::encoding::Context) -> usize {
5055            4
5056        }
5057
5058        #[inline(always)]
5059        fn inline_size(_context: fidl::encoding::Context) -> usize {
5060            4
5061        }
5062    }
5063
5064    unsafe impl<D: fidl::encoding::ResourceDialect>
5065        fidl::encoding::Encode<ParentViewportWatcherGetStatusResponse, D>
5066        for &ParentViewportWatcherGetStatusResponse
5067    {
5068        #[inline]
5069        unsafe fn encode(
5070            self,
5071            encoder: &mut fidl::encoding::Encoder<'_, D>,
5072            offset: usize,
5073            _depth: fidl::encoding::Depth,
5074        ) -> fidl::Result<()> {
5075            encoder.debug_check_bounds::<ParentViewportWatcherGetStatusResponse>(offset);
5076            // Delegate to tuple encoding.
5077            fidl::encoding::Encode::<ParentViewportWatcherGetStatusResponse, D>::encode(
5078                (<ParentViewportStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
5079                encoder,
5080                offset,
5081                _depth,
5082            )
5083        }
5084    }
5085    unsafe impl<
5086            D: fidl::encoding::ResourceDialect,
5087            T0: fidl::encoding::Encode<ParentViewportStatus, D>,
5088        > fidl::encoding::Encode<ParentViewportWatcherGetStatusResponse, D> for (T0,)
5089    {
5090        #[inline]
5091        unsafe fn encode(
5092            self,
5093            encoder: &mut fidl::encoding::Encoder<'_, D>,
5094            offset: usize,
5095            depth: fidl::encoding::Depth,
5096        ) -> fidl::Result<()> {
5097            encoder.debug_check_bounds::<ParentViewportWatcherGetStatusResponse>(offset);
5098            // Zero out padding regions. There's no need to apply masks
5099            // because the unmasked parts will be overwritten by fields.
5100            // Write the fields.
5101            self.0.encode(encoder, offset + 0, depth)?;
5102            Ok(())
5103        }
5104    }
5105
5106    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5107        for ParentViewportWatcherGetStatusResponse
5108    {
5109        #[inline(always)]
5110        fn new_empty() -> Self {
5111            Self { status: fidl::new_empty!(ParentViewportStatus, D) }
5112        }
5113
5114        #[inline]
5115        unsafe fn decode(
5116            &mut self,
5117            decoder: &mut fidl::encoding::Decoder<'_, D>,
5118            offset: usize,
5119            _depth: fidl::encoding::Depth,
5120        ) -> fidl::Result<()> {
5121            decoder.debug_check_bounds::<Self>(offset);
5122            // Verify that padding bytes are zero.
5123            fidl::decode!(ParentViewportStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
5124            Ok(())
5125        }
5126    }
5127
5128    impl fidl::encoding::ValueTypeMarker for ScreenCaptureReleaseFrameRequest {
5129        type Borrowed<'a> = &'a Self;
5130        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5131            value
5132        }
5133    }
5134
5135    unsafe impl fidl::encoding::TypeMarker for ScreenCaptureReleaseFrameRequest {
5136        type Owned = Self;
5137
5138        #[inline(always)]
5139        fn inline_align(_context: fidl::encoding::Context) -> usize {
5140            4
5141        }
5142
5143        #[inline(always)]
5144        fn inline_size(_context: fidl::encoding::Context) -> usize {
5145            4
5146        }
5147        #[inline(always)]
5148        fn encode_is_copy() -> bool {
5149            true
5150        }
5151
5152        #[inline(always)]
5153        fn decode_is_copy() -> bool {
5154            true
5155        }
5156    }
5157
5158    unsafe impl<D: fidl::encoding::ResourceDialect>
5159        fidl::encoding::Encode<ScreenCaptureReleaseFrameRequest, D>
5160        for &ScreenCaptureReleaseFrameRequest
5161    {
5162        #[inline]
5163        unsafe fn encode(
5164            self,
5165            encoder: &mut fidl::encoding::Encoder<'_, D>,
5166            offset: usize,
5167            _depth: fidl::encoding::Depth,
5168        ) -> fidl::Result<()> {
5169            encoder.debug_check_bounds::<ScreenCaptureReleaseFrameRequest>(offset);
5170            unsafe {
5171                // Copy the object into the buffer.
5172                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5173                (buf_ptr as *mut ScreenCaptureReleaseFrameRequest)
5174                    .write_unaligned((self as *const ScreenCaptureReleaseFrameRequest).read());
5175                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5176                // done second because the memcpy will write garbage to these bytes.
5177            }
5178            Ok(())
5179        }
5180    }
5181    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5182        fidl::encoding::Encode<ScreenCaptureReleaseFrameRequest, D> for (T0,)
5183    {
5184        #[inline]
5185        unsafe fn encode(
5186            self,
5187            encoder: &mut fidl::encoding::Encoder<'_, D>,
5188            offset: usize,
5189            depth: fidl::encoding::Depth,
5190        ) -> fidl::Result<()> {
5191            encoder.debug_check_bounds::<ScreenCaptureReleaseFrameRequest>(offset);
5192            // Zero out padding regions. There's no need to apply masks
5193            // because the unmasked parts will be overwritten by fields.
5194            // Write the fields.
5195            self.0.encode(encoder, offset + 0, depth)?;
5196            Ok(())
5197        }
5198    }
5199
5200    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5201        for ScreenCaptureReleaseFrameRequest
5202    {
5203        #[inline(always)]
5204        fn new_empty() -> Self {
5205            Self { buffer_id: fidl::new_empty!(u32, D) }
5206        }
5207
5208        #[inline]
5209        unsafe fn decode(
5210            &mut self,
5211            decoder: &mut fidl::encoding::Decoder<'_, D>,
5212            offset: usize,
5213            _depth: fidl::encoding::Depth,
5214        ) -> fidl::Result<()> {
5215            decoder.debug_check_bounds::<Self>(offset);
5216            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5217            // Verify that padding bytes are zero.
5218            // Copy from the buffer into the object.
5219            unsafe {
5220                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5221            }
5222            Ok(())
5223        }
5224    }
5225
5226    impl fidl::encoding::ValueTypeMarker for TransformId {
5227        type Borrowed<'a> = &'a Self;
5228        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5229            value
5230        }
5231    }
5232
5233    unsafe impl fidl::encoding::TypeMarker for TransformId {
5234        type Owned = Self;
5235
5236        #[inline(always)]
5237        fn inline_align(_context: fidl::encoding::Context) -> usize {
5238            8
5239        }
5240
5241        #[inline(always)]
5242        fn inline_size(_context: fidl::encoding::Context) -> usize {
5243            8
5244        }
5245        #[inline(always)]
5246        fn encode_is_copy() -> bool {
5247            true
5248        }
5249
5250        #[inline(always)]
5251        fn decode_is_copy() -> bool {
5252            true
5253        }
5254    }
5255
5256    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TransformId, D>
5257        for &TransformId
5258    {
5259        #[inline]
5260        unsafe fn encode(
5261            self,
5262            encoder: &mut fidl::encoding::Encoder<'_, D>,
5263            offset: usize,
5264            _depth: fidl::encoding::Depth,
5265        ) -> fidl::Result<()> {
5266            encoder.debug_check_bounds::<TransformId>(offset);
5267            unsafe {
5268                // Copy the object into the buffer.
5269                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5270                (buf_ptr as *mut TransformId).write_unaligned((self as *const TransformId).read());
5271                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5272                // done second because the memcpy will write garbage to these bytes.
5273            }
5274            Ok(())
5275        }
5276    }
5277    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
5278        fidl::encoding::Encode<TransformId, D> for (T0,)
5279    {
5280        #[inline]
5281        unsafe fn encode(
5282            self,
5283            encoder: &mut fidl::encoding::Encoder<'_, D>,
5284            offset: usize,
5285            depth: fidl::encoding::Depth,
5286        ) -> fidl::Result<()> {
5287            encoder.debug_check_bounds::<TransformId>(offset);
5288            // Zero out padding regions. There's no need to apply masks
5289            // because the unmasked parts will be overwritten by fields.
5290            // Write the fields.
5291            self.0.encode(encoder, offset + 0, depth)?;
5292            Ok(())
5293        }
5294    }
5295
5296    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TransformId {
5297        #[inline(always)]
5298        fn new_empty() -> Self {
5299            Self { value: fidl::new_empty!(u64, D) }
5300        }
5301
5302        #[inline]
5303        unsafe fn decode(
5304            &mut self,
5305            decoder: &mut fidl::encoding::Decoder<'_, D>,
5306            offset: usize,
5307            _depth: fidl::encoding::Depth,
5308        ) -> fidl::Result<()> {
5309            decoder.debug_check_bounds::<Self>(offset);
5310            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5311            // Verify that padding bytes are zero.
5312            // Copy from the buffer into the object.
5313            unsafe {
5314                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
5315            }
5316            Ok(())
5317        }
5318    }
5319
5320    impl ImageProperties {
5321        #[inline(always)]
5322        fn max_ordinal_present(&self) -> u64 {
5323            if let Some(_) = self.size {
5324                return 1;
5325            }
5326            0
5327        }
5328    }
5329
5330    impl fidl::encoding::ValueTypeMarker for ImageProperties {
5331        type Borrowed<'a> = &'a Self;
5332        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5333            value
5334        }
5335    }
5336
5337    unsafe impl fidl::encoding::TypeMarker for ImageProperties {
5338        type Owned = Self;
5339
5340        #[inline(always)]
5341        fn inline_align(_context: fidl::encoding::Context) -> usize {
5342            8
5343        }
5344
5345        #[inline(always)]
5346        fn inline_size(_context: fidl::encoding::Context) -> usize {
5347            16
5348        }
5349    }
5350
5351    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageProperties, D>
5352        for &ImageProperties
5353    {
5354        unsafe fn encode(
5355            self,
5356            encoder: &mut fidl::encoding::Encoder<'_, D>,
5357            offset: usize,
5358            mut depth: fidl::encoding::Depth,
5359        ) -> fidl::Result<()> {
5360            encoder.debug_check_bounds::<ImageProperties>(offset);
5361            // Vector header
5362            let max_ordinal: u64 = self.max_ordinal_present();
5363            encoder.write_num(max_ordinal, offset);
5364            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5365            // Calling encoder.out_of_line_offset(0) is not allowed.
5366            if max_ordinal == 0 {
5367                return Ok(());
5368            }
5369            depth.increment()?;
5370            let envelope_size = 8;
5371            let bytes_len = max_ordinal as usize * envelope_size;
5372            #[allow(unused_variables)]
5373            let offset = encoder.out_of_line_offset(bytes_len);
5374            let mut _prev_end_offset: usize = 0;
5375            if 1 > max_ordinal {
5376                return Ok(());
5377            }
5378
5379            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5380            // are envelope_size bytes.
5381            let cur_offset: usize = (1 - 1) * envelope_size;
5382
5383            // Zero reserved fields.
5384            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5385
5386            // Safety:
5387            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5388            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5389            //   envelope_size bytes, there is always sufficient room.
5390            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math::SizeU, D>(
5391                self.size
5392                    .as_ref()
5393                    .map(<fidl_fuchsia_math::SizeU as fidl::encoding::ValueTypeMarker>::borrow),
5394                encoder,
5395                offset + cur_offset,
5396                depth,
5397            )?;
5398
5399            _prev_end_offset = cur_offset + envelope_size;
5400
5401            Ok(())
5402        }
5403    }
5404
5405    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageProperties {
5406        #[inline(always)]
5407        fn new_empty() -> Self {
5408            Self::default()
5409        }
5410
5411        unsafe fn decode(
5412            &mut self,
5413            decoder: &mut fidl::encoding::Decoder<'_, D>,
5414            offset: usize,
5415            mut depth: fidl::encoding::Depth,
5416        ) -> fidl::Result<()> {
5417            decoder.debug_check_bounds::<Self>(offset);
5418            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5419                None => return Err(fidl::Error::NotNullable),
5420                Some(len) => len,
5421            };
5422            // Calling decoder.out_of_line_offset(0) is not allowed.
5423            if len == 0 {
5424                return Ok(());
5425            };
5426            depth.increment()?;
5427            let envelope_size = 8;
5428            let bytes_len = len * envelope_size;
5429            let offset = decoder.out_of_line_offset(bytes_len)?;
5430            // Decode the envelope for each type.
5431            let mut _next_ordinal_to_read = 0;
5432            let mut next_offset = offset;
5433            let end_offset = offset + bytes_len;
5434            _next_ordinal_to_read += 1;
5435            if next_offset >= end_offset {
5436                return Ok(());
5437            }
5438
5439            // Decode unknown envelopes for gaps in ordinals.
5440            while _next_ordinal_to_read < 1 {
5441                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5442                _next_ordinal_to_read += 1;
5443                next_offset += envelope_size;
5444            }
5445
5446            let next_out_of_line = decoder.next_out_of_line();
5447            let handles_before = decoder.remaining_handles();
5448            if let Some((inlined, num_bytes, num_handles)) =
5449                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5450            {
5451                let member_inline_size =
5452                    <fidl_fuchsia_math::SizeU as fidl::encoding::TypeMarker>::inline_size(
5453                        decoder.context,
5454                    );
5455                if inlined != (member_inline_size <= 4) {
5456                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5457                }
5458                let inner_offset;
5459                let mut inner_depth = depth.clone();
5460                if inlined {
5461                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5462                    inner_offset = next_offset;
5463                } else {
5464                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5465                    inner_depth.increment()?;
5466                }
5467                let val_ref =
5468                    self.size.get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math::SizeU, D));
5469                fidl::decode!(
5470                    fidl_fuchsia_math::SizeU,
5471                    D,
5472                    val_ref,
5473                    decoder,
5474                    inner_offset,
5475                    inner_depth
5476                )?;
5477                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5478                {
5479                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5480                }
5481                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5482                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5483                }
5484            }
5485
5486            next_offset += envelope_size;
5487
5488            // Decode the remaining unknown envelopes.
5489            while next_offset < end_offset {
5490                _next_ordinal_to_read += 1;
5491                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5492                next_offset += envelope_size;
5493            }
5494
5495            Ok(())
5496        }
5497    }
5498
5499    impl LayoutInfo {
5500        #[inline(always)]
5501        fn max_ordinal_present(&self) -> u64 {
5502            if let Some(_) = self.inset {
5503                return 4;
5504            }
5505            if let Some(_) = self.device_pixel_ratio {
5506                return 3;
5507            }
5508            if let Some(_) = self.logical_size {
5509                return 1;
5510            }
5511            0
5512        }
5513    }
5514
5515    impl fidl::encoding::ValueTypeMarker for LayoutInfo {
5516        type Borrowed<'a> = &'a Self;
5517        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5518            value
5519        }
5520    }
5521
5522    unsafe impl fidl::encoding::TypeMarker for LayoutInfo {
5523        type Owned = Self;
5524
5525        #[inline(always)]
5526        fn inline_align(_context: fidl::encoding::Context) -> usize {
5527            8
5528        }
5529
5530        #[inline(always)]
5531        fn inline_size(_context: fidl::encoding::Context) -> usize {
5532            16
5533        }
5534    }
5535
5536    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayoutInfo, D>
5537        for &LayoutInfo
5538    {
5539        unsafe fn encode(
5540            self,
5541            encoder: &mut fidl::encoding::Encoder<'_, D>,
5542            offset: usize,
5543            mut depth: fidl::encoding::Depth,
5544        ) -> fidl::Result<()> {
5545            encoder.debug_check_bounds::<LayoutInfo>(offset);
5546            // Vector header
5547            let max_ordinal: u64 = self.max_ordinal_present();
5548            encoder.write_num(max_ordinal, offset);
5549            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5550            // Calling encoder.out_of_line_offset(0) is not allowed.
5551            if max_ordinal == 0 {
5552                return Ok(());
5553            }
5554            depth.increment()?;
5555            let envelope_size = 8;
5556            let bytes_len = max_ordinal as usize * envelope_size;
5557            #[allow(unused_variables)]
5558            let offset = encoder.out_of_line_offset(bytes_len);
5559            let mut _prev_end_offset: usize = 0;
5560            if 1 > max_ordinal {
5561                return Ok(());
5562            }
5563
5564            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5565            // are envelope_size bytes.
5566            let cur_offset: usize = (1 - 1) * envelope_size;
5567
5568            // Zero reserved fields.
5569            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5570
5571            // Safety:
5572            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5573            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5574            //   envelope_size bytes, there is always sufficient room.
5575            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math::SizeU, D>(
5576                self.logical_size
5577                    .as_ref()
5578                    .map(<fidl_fuchsia_math::SizeU as fidl::encoding::ValueTypeMarker>::borrow),
5579                encoder,
5580                offset + cur_offset,
5581                depth,
5582            )?;
5583
5584            _prev_end_offset = cur_offset + envelope_size;
5585            if 3 > max_ordinal {
5586                return Ok(());
5587            }
5588
5589            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5590            // are envelope_size bytes.
5591            let cur_offset: usize = (3 - 1) * envelope_size;
5592
5593            // Zero reserved fields.
5594            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5595
5596            // Safety:
5597            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5598            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5599            //   envelope_size bytes, there is always sufficient room.
5600            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math::VecF, D>(
5601                self.device_pixel_ratio
5602                    .as_ref()
5603                    .map(<fidl_fuchsia_math::VecF as fidl::encoding::ValueTypeMarker>::borrow),
5604                encoder,
5605                offset + cur_offset,
5606                depth,
5607            )?;
5608
5609            _prev_end_offset = cur_offset + envelope_size;
5610            if 4 > max_ordinal {
5611                return Ok(());
5612            }
5613
5614            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5615            // are envelope_size bytes.
5616            let cur_offset: usize = (4 - 1) * envelope_size;
5617
5618            // Zero reserved fields.
5619            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5620
5621            // Safety:
5622            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5623            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5624            //   envelope_size bytes, there is always sufficient room.
5625            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math::Inset, D>(
5626                self.inset
5627                    .as_ref()
5628                    .map(<fidl_fuchsia_math::Inset as fidl::encoding::ValueTypeMarker>::borrow),
5629                encoder,
5630                offset + cur_offset,
5631                depth,
5632            )?;
5633
5634            _prev_end_offset = cur_offset + envelope_size;
5635
5636            Ok(())
5637        }
5638    }
5639
5640    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayoutInfo {
5641        #[inline(always)]
5642        fn new_empty() -> Self {
5643            Self::default()
5644        }
5645
5646        unsafe fn decode(
5647            &mut self,
5648            decoder: &mut fidl::encoding::Decoder<'_, D>,
5649            offset: usize,
5650            mut depth: fidl::encoding::Depth,
5651        ) -> fidl::Result<()> {
5652            decoder.debug_check_bounds::<Self>(offset);
5653            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5654                None => return Err(fidl::Error::NotNullable),
5655                Some(len) => len,
5656            };
5657            // Calling decoder.out_of_line_offset(0) is not allowed.
5658            if len == 0 {
5659                return Ok(());
5660            };
5661            depth.increment()?;
5662            let envelope_size = 8;
5663            let bytes_len = len * envelope_size;
5664            let offset = decoder.out_of_line_offset(bytes_len)?;
5665            // Decode the envelope for each type.
5666            let mut _next_ordinal_to_read = 0;
5667            let mut next_offset = offset;
5668            let end_offset = offset + bytes_len;
5669            _next_ordinal_to_read += 1;
5670            if next_offset >= end_offset {
5671                return Ok(());
5672            }
5673
5674            // Decode unknown envelopes for gaps in ordinals.
5675            while _next_ordinal_to_read < 1 {
5676                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5677                _next_ordinal_to_read += 1;
5678                next_offset += envelope_size;
5679            }
5680
5681            let next_out_of_line = decoder.next_out_of_line();
5682            let handles_before = decoder.remaining_handles();
5683            if let Some((inlined, num_bytes, num_handles)) =
5684                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5685            {
5686                let member_inline_size =
5687                    <fidl_fuchsia_math::SizeU as fidl::encoding::TypeMarker>::inline_size(
5688                        decoder.context,
5689                    );
5690                if inlined != (member_inline_size <= 4) {
5691                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5692                }
5693                let inner_offset;
5694                let mut inner_depth = depth.clone();
5695                if inlined {
5696                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5697                    inner_offset = next_offset;
5698                } else {
5699                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5700                    inner_depth.increment()?;
5701                }
5702                let val_ref = self
5703                    .logical_size
5704                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math::SizeU, D));
5705                fidl::decode!(
5706                    fidl_fuchsia_math::SizeU,
5707                    D,
5708                    val_ref,
5709                    decoder,
5710                    inner_offset,
5711                    inner_depth
5712                )?;
5713                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5714                {
5715                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5716                }
5717                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5718                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5719                }
5720            }
5721
5722            next_offset += envelope_size;
5723            _next_ordinal_to_read += 1;
5724            if next_offset >= end_offset {
5725                return Ok(());
5726            }
5727
5728            // Decode unknown envelopes for gaps in ordinals.
5729            while _next_ordinal_to_read < 3 {
5730                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5731                _next_ordinal_to_read += 1;
5732                next_offset += envelope_size;
5733            }
5734
5735            let next_out_of_line = decoder.next_out_of_line();
5736            let handles_before = decoder.remaining_handles();
5737            if let Some((inlined, num_bytes, num_handles)) =
5738                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5739            {
5740                let member_inline_size =
5741                    <fidl_fuchsia_math::VecF as fidl::encoding::TypeMarker>::inline_size(
5742                        decoder.context,
5743                    );
5744                if inlined != (member_inline_size <= 4) {
5745                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5746                }
5747                let inner_offset;
5748                let mut inner_depth = depth.clone();
5749                if inlined {
5750                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5751                    inner_offset = next_offset;
5752                } else {
5753                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5754                    inner_depth.increment()?;
5755                }
5756                let val_ref = self
5757                    .device_pixel_ratio
5758                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math::VecF, D));
5759                fidl::decode!(
5760                    fidl_fuchsia_math::VecF,
5761                    D,
5762                    val_ref,
5763                    decoder,
5764                    inner_offset,
5765                    inner_depth
5766                )?;
5767                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5768                {
5769                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5770                }
5771                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5772                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5773                }
5774            }
5775
5776            next_offset += envelope_size;
5777            _next_ordinal_to_read += 1;
5778            if next_offset >= end_offset {
5779                return Ok(());
5780            }
5781
5782            // Decode unknown envelopes for gaps in ordinals.
5783            while _next_ordinal_to_read < 4 {
5784                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5785                _next_ordinal_to_read += 1;
5786                next_offset += envelope_size;
5787            }
5788
5789            let next_out_of_line = decoder.next_out_of_line();
5790            let handles_before = decoder.remaining_handles();
5791            if let Some((inlined, num_bytes, num_handles)) =
5792                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5793            {
5794                let member_inline_size =
5795                    <fidl_fuchsia_math::Inset as fidl::encoding::TypeMarker>::inline_size(
5796                        decoder.context,
5797                    );
5798                if inlined != (member_inline_size <= 4) {
5799                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5800                }
5801                let inner_offset;
5802                let mut inner_depth = depth.clone();
5803                if inlined {
5804                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5805                    inner_offset = next_offset;
5806                } else {
5807                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5808                    inner_depth.increment()?;
5809                }
5810                let val_ref =
5811                    self.inset.get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math::Inset, D));
5812                fidl::decode!(
5813                    fidl_fuchsia_math::Inset,
5814                    D,
5815                    val_ref,
5816                    decoder,
5817                    inner_offset,
5818                    inner_depth
5819                )?;
5820                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5821                {
5822                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5823                }
5824                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5825                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5826                }
5827            }
5828
5829            next_offset += envelope_size;
5830
5831            // Decode the remaining unknown envelopes.
5832            while next_offset < end_offset {
5833                _next_ordinal_to_read += 1;
5834                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5835                next_offset += envelope_size;
5836            }
5837
5838            Ok(())
5839        }
5840    }
5841
5842    impl OnNextFrameBeginValues {
5843        #[inline(always)]
5844        fn max_ordinal_present(&self) -> u64 {
5845            if let Some(_) = self.future_presentation_infos {
5846                return 2;
5847            }
5848            if let Some(_) = self.additional_present_credits {
5849                return 1;
5850            }
5851            0
5852        }
5853    }
5854
5855    impl fidl::encoding::ValueTypeMarker for OnNextFrameBeginValues {
5856        type Borrowed<'a> = &'a Self;
5857        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5858            value
5859        }
5860    }
5861
5862    unsafe impl fidl::encoding::TypeMarker for OnNextFrameBeginValues {
5863        type Owned = Self;
5864
5865        #[inline(always)]
5866        fn inline_align(_context: fidl::encoding::Context) -> usize {
5867            8
5868        }
5869
5870        #[inline(always)]
5871        fn inline_size(_context: fidl::encoding::Context) -> usize {
5872            16
5873        }
5874    }
5875
5876    unsafe impl<D: fidl::encoding::ResourceDialect>
5877        fidl::encoding::Encode<OnNextFrameBeginValues, D> for &OnNextFrameBeginValues
5878    {
5879        unsafe fn encode(
5880            self,
5881            encoder: &mut fidl::encoding::Encoder<'_, D>,
5882            offset: usize,
5883            mut depth: fidl::encoding::Depth,
5884        ) -> fidl::Result<()> {
5885            encoder.debug_check_bounds::<OnNextFrameBeginValues>(offset);
5886            // Vector header
5887            let max_ordinal: u64 = self.max_ordinal_present();
5888            encoder.write_num(max_ordinal, offset);
5889            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5890            // Calling encoder.out_of_line_offset(0) is not allowed.
5891            if max_ordinal == 0 {
5892                return Ok(());
5893            }
5894            depth.increment()?;
5895            let envelope_size = 8;
5896            let bytes_len = max_ordinal as usize * envelope_size;
5897            #[allow(unused_variables)]
5898            let offset = encoder.out_of_line_offset(bytes_len);
5899            let mut _prev_end_offset: usize = 0;
5900            if 1 > max_ordinal {
5901                return Ok(());
5902            }
5903
5904            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5905            // are envelope_size bytes.
5906            let cur_offset: usize = (1 - 1) * envelope_size;
5907
5908            // Zero reserved fields.
5909            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5910
5911            // Safety:
5912            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5913            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5914            //   envelope_size bytes, there is always sufficient room.
5915            fidl::encoding::encode_in_envelope_optional::<u32, D>(
5916                self.additional_present_credits
5917                    .as_ref()
5918                    .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
5919                encoder,
5920                offset + cur_offset,
5921                depth,
5922            )?;
5923
5924            _prev_end_offset = cur_offset + envelope_size;
5925            if 2 > max_ordinal {
5926                return Ok(());
5927            }
5928
5929            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5930            // are envelope_size bytes.
5931            let cur_offset: usize = (2 - 1) * envelope_size;
5932
5933            // Zero reserved fields.
5934            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5935
5936            // Safety:
5937            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5938            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5939            //   envelope_size bytes, there is always sufficient room.
5940            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_scenic_scheduling::PresentationInfo, 8>, D>(
5941            self.future_presentation_infos.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_scenic_scheduling::PresentationInfo, 8> as fidl::encoding::ValueTypeMarker>::borrow),
5942            encoder, offset + cur_offset, depth
5943        )?;
5944
5945            _prev_end_offset = cur_offset + envelope_size;
5946
5947            Ok(())
5948        }
5949    }
5950
5951    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5952        for OnNextFrameBeginValues
5953    {
5954        #[inline(always)]
5955        fn new_empty() -> Self {
5956            Self::default()
5957        }
5958
5959        unsafe fn decode(
5960            &mut self,
5961            decoder: &mut fidl::encoding::Decoder<'_, D>,
5962            offset: usize,
5963            mut depth: fidl::encoding::Depth,
5964        ) -> fidl::Result<()> {
5965            decoder.debug_check_bounds::<Self>(offset);
5966            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5967                None => return Err(fidl::Error::NotNullable),
5968                Some(len) => len,
5969            };
5970            // Calling decoder.out_of_line_offset(0) is not allowed.
5971            if len == 0 {
5972                return Ok(());
5973            };
5974            depth.increment()?;
5975            let envelope_size = 8;
5976            let bytes_len = len * envelope_size;
5977            let offset = decoder.out_of_line_offset(bytes_len)?;
5978            // Decode the envelope for each type.
5979            let mut _next_ordinal_to_read = 0;
5980            let mut next_offset = offset;
5981            let end_offset = offset + bytes_len;
5982            _next_ordinal_to_read += 1;
5983            if next_offset >= end_offset {
5984                return Ok(());
5985            }
5986
5987            // Decode unknown envelopes for gaps in ordinals.
5988            while _next_ordinal_to_read < 1 {
5989                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5990                _next_ordinal_to_read += 1;
5991                next_offset += envelope_size;
5992            }
5993
5994            let next_out_of_line = decoder.next_out_of_line();
5995            let handles_before = decoder.remaining_handles();
5996            if let Some((inlined, num_bytes, num_handles)) =
5997                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5998            {
5999                let member_inline_size =
6000                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6001                if inlined != (member_inline_size <= 4) {
6002                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6003                }
6004                let inner_offset;
6005                let mut inner_depth = depth.clone();
6006                if inlined {
6007                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6008                    inner_offset = next_offset;
6009                } else {
6010                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6011                    inner_depth.increment()?;
6012                }
6013                let val_ref =
6014                    self.additional_present_credits.get_or_insert_with(|| fidl::new_empty!(u32, D));
6015                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
6016                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6017                {
6018                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6019                }
6020                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6021                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6022                }
6023            }
6024
6025            next_offset += envelope_size;
6026            _next_ordinal_to_read += 1;
6027            if next_offset >= end_offset {
6028                return Ok(());
6029            }
6030
6031            // Decode unknown envelopes for gaps in ordinals.
6032            while _next_ordinal_to_read < 2 {
6033                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6034                _next_ordinal_to_read += 1;
6035                next_offset += envelope_size;
6036            }
6037
6038            let next_out_of_line = decoder.next_out_of_line();
6039            let handles_before = decoder.remaining_handles();
6040            if let Some((inlined, num_bytes, num_handles)) =
6041                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6042            {
6043                let member_inline_size = <fidl::encoding::Vector<
6044                    fidl_fuchsia_scenic_scheduling::PresentationInfo,
6045                    8,
6046                > as fidl::encoding::TypeMarker>::inline_size(
6047                    decoder.context
6048                );
6049                if inlined != (member_inline_size <= 4) {
6050                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6051                }
6052                let inner_offset;
6053                let mut inner_depth = depth.clone();
6054                if inlined {
6055                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6056                    inner_offset = next_offset;
6057                } else {
6058                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6059                    inner_depth.increment()?;
6060                }
6061                let val_ref =
6062                self.future_presentation_infos.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_scenic_scheduling::PresentationInfo, 8>, D));
6063                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_scenic_scheduling::PresentationInfo, 8>, D, val_ref, decoder, inner_offset, inner_depth)?;
6064                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6065                {
6066                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6067                }
6068                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6069                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6070                }
6071            }
6072
6073            next_offset += envelope_size;
6074
6075            // Decode the remaining unknown envelopes.
6076            while next_offset < end_offset {
6077                _next_ordinal_to_read += 1;
6078                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6079                next_offset += envelope_size;
6080            }
6081
6082            Ok(())
6083        }
6084    }
6085
6086    impl ViewportProperties {
6087        #[inline(always)]
6088        fn max_ordinal_present(&self) -> u64 {
6089            if let Some(_) = self.inset {
6090                return 2;
6091            }
6092            if let Some(_) = self.logical_size {
6093                return 1;
6094            }
6095            0
6096        }
6097    }
6098
6099    impl fidl::encoding::ValueTypeMarker for ViewportProperties {
6100        type Borrowed<'a> = &'a Self;
6101        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6102            value
6103        }
6104    }
6105
6106    unsafe impl fidl::encoding::TypeMarker for ViewportProperties {
6107        type Owned = Self;
6108
6109        #[inline(always)]
6110        fn inline_align(_context: fidl::encoding::Context) -> usize {
6111            8
6112        }
6113
6114        #[inline(always)]
6115        fn inline_size(_context: fidl::encoding::Context) -> usize {
6116            16
6117        }
6118    }
6119
6120    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewportProperties, D>
6121        for &ViewportProperties
6122    {
6123        unsafe fn encode(
6124            self,
6125            encoder: &mut fidl::encoding::Encoder<'_, D>,
6126            offset: usize,
6127            mut depth: fidl::encoding::Depth,
6128        ) -> fidl::Result<()> {
6129            encoder.debug_check_bounds::<ViewportProperties>(offset);
6130            // Vector header
6131            let max_ordinal: u64 = self.max_ordinal_present();
6132            encoder.write_num(max_ordinal, offset);
6133            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6134            // Calling encoder.out_of_line_offset(0) is not allowed.
6135            if max_ordinal == 0 {
6136                return Ok(());
6137            }
6138            depth.increment()?;
6139            let envelope_size = 8;
6140            let bytes_len = max_ordinal as usize * envelope_size;
6141            #[allow(unused_variables)]
6142            let offset = encoder.out_of_line_offset(bytes_len);
6143            let mut _prev_end_offset: usize = 0;
6144            if 1 > max_ordinal {
6145                return Ok(());
6146            }
6147
6148            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6149            // are envelope_size bytes.
6150            let cur_offset: usize = (1 - 1) * envelope_size;
6151
6152            // Zero reserved fields.
6153            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6154
6155            // Safety:
6156            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6157            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6158            //   envelope_size bytes, there is always sufficient room.
6159            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math::SizeU, D>(
6160                self.logical_size
6161                    .as_ref()
6162                    .map(<fidl_fuchsia_math::SizeU as fidl::encoding::ValueTypeMarker>::borrow),
6163                encoder,
6164                offset + cur_offset,
6165                depth,
6166            )?;
6167
6168            _prev_end_offset = cur_offset + envelope_size;
6169            if 2 > max_ordinal {
6170                return Ok(());
6171            }
6172
6173            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6174            // are envelope_size bytes.
6175            let cur_offset: usize = (2 - 1) * envelope_size;
6176
6177            // Zero reserved fields.
6178            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6179
6180            // Safety:
6181            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6182            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6183            //   envelope_size bytes, there is always sufficient room.
6184            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math::Inset, D>(
6185                self.inset
6186                    .as_ref()
6187                    .map(<fidl_fuchsia_math::Inset as fidl::encoding::ValueTypeMarker>::borrow),
6188                encoder,
6189                offset + cur_offset,
6190                depth,
6191            )?;
6192
6193            _prev_end_offset = cur_offset + envelope_size;
6194
6195            Ok(())
6196        }
6197    }
6198
6199    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewportProperties {
6200        #[inline(always)]
6201        fn new_empty() -> Self {
6202            Self::default()
6203        }
6204
6205        unsafe fn decode(
6206            &mut self,
6207            decoder: &mut fidl::encoding::Decoder<'_, D>,
6208            offset: usize,
6209            mut depth: fidl::encoding::Depth,
6210        ) -> fidl::Result<()> {
6211            decoder.debug_check_bounds::<Self>(offset);
6212            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6213                None => return Err(fidl::Error::NotNullable),
6214                Some(len) => len,
6215            };
6216            // Calling decoder.out_of_line_offset(0) is not allowed.
6217            if len == 0 {
6218                return Ok(());
6219            };
6220            depth.increment()?;
6221            let envelope_size = 8;
6222            let bytes_len = len * envelope_size;
6223            let offset = decoder.out_of_line_offset(bytes_len)?;
6224            // Decode the envelope for each type.
6225            let mut _next_ordinal_to_read = 0;
6226            let mut next_offset = offset;
6227            let end_offset = offset + bytes_len;
6228            _next_ordinal_to_read += 1;
6229            if next_offset >= end_offset {
6230                return Ok(());
6231            }
6232
6233            // Decode unknown envelopes for gaps in ordinals.
6234            while _next_ordinal_to_read < 1 {
6235                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6236                _next_ordinal_to_read += 1;
6237                next_offset += envelope_size;
6238            }
6239
6240            let next_out_of_line = decoder.next_out_of_line();
6241            let handles_before = decoder.remaining_handles();
6242            if let Some((inlined, num_bytes, num_handles)) =
6243                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6244            {
6245                let member_inline_size =
6246                    <fidl_fuchsia_math::SizeU as fidl::encoding::TypeMarker>::inline_size(
6247                        decoder.context,
6248                    );
6249                if inlined != (member_inline_size <= 4) {
6250                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6251                }
6252                let inner_offset;
6253                let mut inner_depth = depth.clone();
6254                if inlined {
6255                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6256                    inner_offset = next_offset;
6257                } else {
6258                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6259                    inner_depth.increment()?;
6260                }
6261                let val_ref = self
6262                    .logical_size
6263                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math::SizeU, D));
6264                fidl::decode!(
6265                    fidl_fuchsia_math::SizeU,
6266                    D,
6267                    val_ref,
6268                    decoder,
6269                    inner_offset,
6270                    inner_depth
6271                )?;
6272                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6273                {
6274                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6275                }
6276                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6277                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6278                }
6279            }
6280
6281            next_offset += envelope_size;
6282            _next_ordinal_to_read += 1;
6283            if next_offset >= end_offset {
6284                return Ok(());
6285            }
6286
6287            // Decode unknown envelopes for gaps in ordinals.
6288            while _next_ordinal_to_read < 2 {
6289                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6290                _next_ordinal_to_read += 1;
6291                next_offset += envelope_size;
6292            }
6293
6294            let next_out_of_line = decoder.next_out_of_line();
6295            let handles_before = decoder.remaining_handles();
6296            if let Some((inlined, num_bytes, num_handles)) =
6297                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6298            {
6299                let member_inline_size =
6300                    <fidl_fuchsia_math::Inset as fidl::encoding::TypeMarker>::inline_size(
6301                        decoder.context,
6302                    );
6303                if inlined != (member_inline_size <= 4) {
6304                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6305                }
6306                let inner_offset;
6307                let mut inner_depth = depth.clone();
6308                if inlined {
6309                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6310                    inner_offset = next_offset;
6311                } else {
6312                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6313                    inner_depth.increment()?;
6314                }
6315                let val_ref =
6316                    self.inset.get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math::Inset, D));
6317                fidl::decode!(
6318                    fidl_fuchsia_math::Inset,
6319                    D,
6320                    val_ref,
6321                    decoder,
6322                    inner_offset,
6323                    inner_depth
6324                )?;
6325                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6326                {
6327                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6328                }
6329                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6330                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6331                }
6332            }
6333
6334            next_offset += envelope_size;
6335
6336            // Decode the remaining unknown envelopes.
6337            while next_offset < end_offset {
6338                _next_ordinal_to_read += 1;
6339                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6340                next_offset += envelope_size;
6341            }
6342
6343            Ok(())
6344        }
6345    }
6346}