Skip to main content

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_common::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
26/// A maximum of 32 layers per stack is enough for the expected usage of these APIs.
27pub const MAX_STACK_LAYERS: i32 = 32;
28
29bitflags! {
30    /// Bitset which supports all permutations of flips and rotations.  Flips (if any) are performed
31    /// first, followed by rotation (if any).
32    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
33    pub struct FlipThenRotate: u8 {
34        /// Flip the image horizontally (across the Y-axis).
35        const FLIP_H = 1;
36        /// Flip the image vertically (across the X-axis).
37        const FLIP_V = 2;
38        /// Rotate the image 90 degrees clockwise.
39        const ROTATE_90 = 4;
40    }
41}
42
43impl FlipThenRotate {}
44
45bitflags! {
46    /// The possible usages for a registered buffer collection. Can be a combination of options.
47    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
48    pub struct RegisterBufferCollectionUsages: u16 {
49        /// The specified buffer collection can be used for Flatland and GFX image creation.
50        ///
51        /// See [`fuchsia.ui.composition/Flatland.CreateImage`] for more.
52        const DEFAULT = 1;
53        /// The specified buffer collection can be used for screenshotting purposes.
54        const SCREENSHOT = 2;
55    }
56}
57
58impl RegisterBufferCollectionUsages {
59    #[inline(always)]
60    pub fn from_bits_allow_unknown(bits: u16) -> Self {
61        Self::from_bits_retain(bits)
62    }
63
64    #[inline(always)]
65    pub fn has_unknown_bits(&self) -> bool {
66        self.get_unknown_bits() != 0
67    }
68
69    #[inline(always)]
70    pub fn get_unknown_bits(&self) -> u16 {
71        self.bits() & !Self::all().bits()
72    }
73}
74
75/// The set of possible blending functions to choose from when determining how an image should
76/// be composited on top of other images.
77#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
78#[repr(u32)]
79pub enum BlendMode {
80    /// Indicates that the source pixels replace the destination pixels. In other words,
81    /// the source pixels are treated as opaque, regardless of what alpha values are set.
82    Src = 1,
83    /// The source pixels are drawn over the destination pixels. The final pixel color
84    /// that is displayed is calculated as: C_src + (1.0 - alpha_src) * C_dst).
85    SrcOver = 2,
86}
87
88impl BlendMode {
89    #[inline]
90    pub fn from_primitive(prim: u32) -> Option<Self> {
91        match prim {
92            1 => Some(Self::Src),
93            2 => Some(Self::SrcOver),
94            _ => None,
95        }
96    }
97
98    #[inline]
99    pub const fn into_primitive(self) -> u32 {
100        self as u32
101    }
102}
103
104/// The set of possible blending functions to choose from when determining how an image should
105/// be composited on top of other images.
106#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
107pub enum BlendMode2 {
108    /// Indicates that the source pixels replace the destination pixels: source pixel
109    /// values, including alpha, are written into the output as-is, without blending
110    /// against the destination. A source pixel with partial or zero alpha is stamped
111    /// into the output with that alpha intact; it is not treated as opaque.
112    /// (This describes the blend function itself; a layer's `opacity` can demote this
113    /// mode. See [`LayerProperties.blend_mode`].)
114    Replace,
115    /// The source pixels are drawn over the destination pixels. The final pixel color
116    /// that is displayed is calculated as: C_src + (1.0 - alpha_src) * C_dst.
117    PremultipliedAlpha,
118    /// The source pixels are drawn over the destination pixels. The final pixel color that is
119    /// displayed is calculated as: alpha_src * C_src + (1.0 - alpha_src) * C_dst.
120    StraightAlpha,
121    #[doc(hidden)]
122    __SourceBreaking { unknown_ordinal: u32 },
123}
124
125/// Pattern that matches an unknown `BlendMode2` member.
126#[macro_export]
127macro_rules! BlendMode2Unknown {
128    () => {
129        _
130    };
131}
132
133impl BlendMode2 {
134    #[inline]
135    pub fn from_primitive(prim: u32) -> Option<Self> {
136        match prim {
137            1 => Some(Self::Replace),
138            2 => Some(Self::PremultipliedAlpha),
139            3 => Some(Self::StraightAlpha),
140            _ => None,
141        }
142    }
143
144    #[inline]
145    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
146        match prim {
147            1 => Self::Replace,
148            2 => Self::PremultipliedAlpha,
149            3 => Self::StraightAlpha,
150            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
151        }
152    }
153
154    #[inline]
155    pub fn unknown() -> Self {
156        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
157    }
158
159    #[inline]
160    pub const fn into_primitive(self) -> u32 {
161        match self {
162            Self::Replace => 1,
163            Self::PremultipliedAlpha => 2,
164            Self::StraightAlpha => 3,
165            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
166        }
167    }
168
169    #[inline]
170    pub fn is_unknown(&self) -> bool {
171        match self {
172            Self::__SourceBreaking { unknown_ordinal: _ } => true,
173            _ => false,
174        }
175    }
176}
177
178#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
179#[repr(u32)]
180pub enum ChildViewStatus {
181    /// The underlying Flatland session has connected its View, called [`Present`], and the
182    /// acquisition fences of the [`Present`] call have all be reached, indicating that it has some
183    /// content ready to be displayed, and NOT that the child content has actually been shown on the
184    /// screen (a common use case is for the parent to wait for the child content to be ready before
185    /// attaching the child to the global scene graph).
186    ContentHasPresented = 1,
187}
188
189impl ChildViewStatus {
190    #[inline]
191    pub fn from_primitive(prim: u32) -> Option<Self> {
192        match prim {
193            1 => Some(Self::ContentHasPresented),
194            _ => None,
195        }
196    }
197
198    #[inline]
199    pub const fn into_primitive(self) -> u32 {
200        self as u32
201    }
202}
203
204/// Selects what a Layer composites: an image, a solid color, or nothing at all.
205///
206/// `INVISIBLE` is the freshly-created state. An `INVISIBLE` layer keeps its place in any
207/// `LayerStack` which references it, but contributes nothing to the frame. Because layer
208/// properties are sticky (see [`LayerProperties`]), passing through `INVISIBLE` and back
209/// loses nothing.
210#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
211#[repr(u32)]
212pub enum CompositionMode {
213    Invisible = 1,
214    Image = 2,
215    SolidColor = 3,
216}
217
218impl CompositionMode {
219    #[inline]
220    pub fn from_primitive(prim: u32) -> Option<Self> {
221        match prim {
222            1 => Some(Self::Invisible),
223            2 => Some(Self::Image),
224            3 => Some(Self::SolidColor),
225            _ => None,
226        }
227    }
228
229    #[inline]
230    pub const fn into_primitive(self) -> u32 {
231        self as u32
232    }
233}
234
235/// The set of error codes returned in [`OnError`]. Any error causes the Flatland channel to be
236/// closed.
237#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
238#[repr(u32)]
239pub enum FlatlandError {
240    /// Indicates that the parameters used in the function calls are invalid.
241    BadOperation = 1,
242    /// Indicates that `additional_present_credits` field was not properly processed and the client
243    /// queued more [`Present`]s than allowed.
244    NoPresentsRemaining = 2,
245    /// Indicates that the client has overwritten hanging gets in the protocols returned.
246    BadHangingGet = 3,
247}
248
249impl FlatlandError {
250    #[inline]
251    pub fn from_primitive(prim: u32) -> Option<Self> {
252        match prim {
253            1 => Some(Self::BadOperation),
254            2 => Some(Self::NoPresentsRemaining),
255            3 => Some(Self::BadHangingGet),
256            _ => None,
257        }
258    }
259
260    #[inline]
261    pub const fn into_primitive(self) -> u32 {
262        self as u32
263    }
264}
265
266/// An error that can occur when using [`fuchsia.ui.composition/FlatlandFactory.CreateFlatland`].
267#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
268pub enum FlatlandFactoryError {
269    /// Client provided an invalid configuration, so no Flatland session could be created.
270    InvalidArgs,
271    /// The server was unable to establish the Flatland session for an unspecified reason
272    /// that is not the client's fault.
273    Internal,
274    #[doc(hidden)]
275    __SourceBreaking { unknown_ordinal: u32 },
276}
277
278/// Pattern that matches an unknown `FlatlandFactoryError` member.
279#[macro_export]
280macro_rules! FlatlandFactoryErrorUnknown {
281    () => {
282        _
283    };
284}
285
286impl FlatlandFactoryError {
287    #[inline]
288    pub fn from_primitive(prim: u32) -> Option<Self> {
289        match prim {
290            1 => Some(Self::InvalidArgs),
291            2 => Some(Self::Internal),
292            _ => None,
293        }
294    }
295
296    #[inline]
297    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
298        match prim {
299            1 => Self::InvalidArgs,
300            2 => Self::Internal,
301            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
302        }
303    }
304
305    #[inline]
306    pub fn unknown() -> Self {
307        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
308    }
309
310    #[inline]
311    pub const fn into_primitive(self) -> u32 {
312        match self {
313            Self::InvalidArgs => 1,
314            Self::Internal => 2,
315            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
316        }
317    }
318
319    #[inline]
320    pub fn is_unknown(&self) -> bool {
321        match self {
322            Self::__SourceBreaking { unknown_ordinal: _ } => true,
323            _ => false,
324        }
325    }
326}
327
328/// The kind of hit test interaction expected for a hit region.
329#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
330pub enum HitTestInteraction {
331    /// The natural default behavior is for a hit region to interact with both regular hit testing
332    /// and accessibility hit testing.
333    Default,
334    /// Some use cases require that a hit region to interact with regular hit testing, but not
335    /// interact with accessibility hit testing. Here, "semantics" refers to accessibility's
336    /// semantic tree data, which describes UI elements in a View.
337    SemanticallyInvisible,
338    #[doc(hidden)]
339    __SourceBreaking { unknown_ordinal: u8 },
340}
341
342/// Pattern that matches an unknown `HitTestInteraction` member.
343#[macro_export]
344macro_rules! HitTestInteractionUnknown {
345    () => {
346        _
347    };
348}
349
350impl HitTestInteraction {
351    #[inline]
352    pub fn from_primitive(prim: u8) -> Option<Self> {
353        match prim {
354            0 => Some(Self::Default),
355            1 => Some(Self::SemanticallyInvisible),
356            _ => None,
357        }
358    }
359
360    #[inline]
361    pub fn from_primitive_allow_unknown(prim: u8) -> Self {
362        match prim {
363            0 => Self::Default,
364            1 => Self::SemanticallyInvisible,
365            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
366        }
367    }
368
369    #[inline]
370    pub fn unknown() -> Self {
371        Self::__SourceBreaking { unknown_ordinal: 0xff }
372    }
373
374    #[inline]
375    pub const fn into_primitive(self) -> u8 {
376        match self {
377            Self::Default => 0,
378            Self::SemanticallyInvisible => 1,
379            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
380        }
381    }
382
383    #[inline]
384    pub fn is_unknown(&self) -> bool {
385        match self {
386            Self::__SourceBreaking { unknown_ordinal: _ } => true,
387            _ => false,
388        }
389    }
390}
391
392/// The set of possible image flip functions to choose from when determining how the image texture
393/// should be displayed.
394#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
395#[repr(u32)]
396pub enum ImageFlip {
397    None = 0,
398    /// Let V be the vertical axis of reflection, positioned at width/2. Then each pixel's x
399    /// coordinate is reflected across V. The y coordinates remain constant. For instance:
400    /// |1234|                |4321|
401    /// |abcd|  would become  |dcba|
402    LeftRight = 1,
403    /// Let H be the horizontal axis of reflection, positioned at height/2. Then each pixel's y
404    /// coordinate is reflected across H. The x coordinates remain constant. For instance:
405    /// |1234|                |abcd|
406    /// |abcd|  would become  |1234|
407    UpDown = 2,
408}
409
410impl ImageFlip {
411    #[inline]
412    pub fn from_primitive(prim: u32) -> Option<Self> {
413        match prim {
414            0 => Some(Self::None),
415            1 => Some(Self::LeftRight),
416            2 => Some(Self::UpDown),
417            _ => None,
418        }
419    }
420
421    #[inline]
422    pub const fn into_primitive(self) -> u32 {
423        self as u32
424    }
425}
426
427/// In Flatland, the +X axis is to the right and +Y axis is down. There is no notion of a Z axis.
428/// Due to the lack of a Z axis, there is no mathematical notion of "handedness" (either right or
429/// left) with respect to rotation. Thus, we define a counter-clockwise rotation in the same way
430/// as if a skeuomorphic clock were to be displayed on the screen, with the hands of said clock
431/// moving in a CCW motion from the POV of the observer.
432#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
433#[repr(u32)]
434pub enum Orientation {
435    Ccw0Degrees = 1,
436    Ccw90Degrees = 2,
437    Ccw180Degrees = 3,
438    Ccw270Degrees = 4,
439}
440
441impl Orientation {
442    #[inline]
443    pub fn from_primitive(prim: u32) -> Option<Self> {
444        match prim {
445            1 => Some(Self::Ccw0Degrees),
446            2 => Some(Self::Ccw90Degrees),
447            3 => Some(Self::Ccw180Degrees),
448            4 => Some(Self::Ccw270Degrees),
449            _ => None,
450        }
451    }
452
453    #[inline]
454    pub const fn into_primitive(self) -> u32 {
455        self as u32
456    }
457}
458
459/// ParentViewportWatchers will be informed when they are actively attached to a output display
460/// (either directly, or through a chain of parent Viewports) and when they are not. Until they are
461/// connected to a display, some pieces of information (such as pixel scale) may be unavailable.
462#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
463#[repr(u32)]
464pub enum ParentViewportStatus {
465    ConnectedToDisplay = 1,
466    DisconnectedFromDisplay = 2,
467}
468
469impl ParentViewportStatus {
470    #[inline]
471    pub fn from_primitive(prim: u32) -> Option<Self> {
472        match prim {
473            1 => Some(Self::ConnectedToDisplay),
474            2 => Some(Self::DisconnectedFromDisplay),
475            _ => None,
476        }
477    }
478
479    #[inline]
480    pub const fn into_primitive(self) -> u32 {
481        self as u32
482    }
483}
484
485/// The set of error codes returned by Allocator::RegisterBufferCollection().
486#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
487#[repr(u32)]
488pub enum RegisterBufferCollectionError {
489    BadOperation = 1,
490}
491
492impl RegisterBufferCollectionError {
493    #[inline]
494    pub fn from_primitive(prim: u32) -> Option<Self> {
495        match prim {
496            1 => Some(Self::BadOperation),
497            _ => None,
498        }
499    }
500
501    #[inline]
502    pub const fn into_primitive(self) -> u32 {
503        self as u32
504    }
505}
506
507/// The possible usages for registered buffer collection.
508#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
509#[repr(u32)]
510pub enum RegisterBufferCollectionUsage {
511    /// DEFAULT means that the specified buffer collection will be used for
512    /// Flatland and gfx image creation.
513    ///
514    /// See [`fuchsia.ui.composition/Flatland.CreateImage`] for more.
515    Default = 0,
516    /// SCREENSHOT means that the specified buffer collection will be used for
517    /// screenshotting purposes.
518    Screenshot = 1,
519}
520
521impl RegisterBufferCollectionUsage {
522    #[inline]
523    pub fn from_primitive(prim: u32) -> Option<Self> {
524        match prim {
525            0 => Some(Self::Default),
526            1 => Some(Self::Screenshot),
527            _ => None,
528        }
529    }
530
531    #[inline]
532    pub const fn into_primitive(self) -> u32 {
533        self as u32
534    }
535}
536
537/// The rotation to be applied to the image.
538///
539/// If a given display is rotated, say, 270 degrees according to its
540/// `display_info` config file, then applying the equal and opposite rotation,
541/// [`CW_270_DEGREES`], should cancel the display rotation leading to a
542/// correctly rendered screenshot.
543///
544/// Clients should allocate an image according to the final dimensions they
545/// ultimately want to use, i.e. after rotation. These would be identical
546/// to the `width` and `height` values found in the `display_info` config file.
547#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
548#[repr(u32)]
549pub enum Rotation {
550    Cw0Degrees = 0,
551    Cw90Degrees = 1,
552    Cw180Degrees = 2,
553    Cw270Degrees = 3,
554}
555
556impl Rotation {
557    #[inline]
558    pub fn from_primitive(prim: u32) -> Option<Self> {
559        match prim {
560            0 => Some(Self::Cw0Degrees),
561            1 => Some(Self::Cw90Degrees),
562            2 => Some(Self::Cw180Degrees),
563            3 => Some(Self::Cw270Degrees),
564            _ => None,
565        }
566    }
567
568    #[inline]
569    pub const fn into_primitive(self) -> u32 {
570        self as u32
571    }
572}
573
574/// The possible errors from the ScreenCapture protocol.
575#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
576pub enum ScreenCaptureError {
577    /// One or more required arguments are missing in the table argument.
578    MissingArgs,
579    /// One or more of the arguments was not valid.
580    InvalidArgs,
581    /// A general error occurred during the method call.
582    BadOperation,
583    /// Error that is returned if [`GetNextFrame`] is called when all of the VMOs in the
584    /// BufferCollection have been rendered to. [`ReleaseFrame`] must be called before a
585    /// successful call to GetNextFrame can be made.
586    BufferFull,
587    #[doc(hidden)]
588    __SourceBreaking { unknown_ordinal: u32 },
589}
590
591/// Pattern that matches an unknown `ScreenCaptureError` member.
592#[macro_export]
593macro_rules! ScreenCaptureErrorUnknown {
594    () => {
595        _
596    };
597}
598
599impl ScreenCaptureError {
600    #[inline]
601    pub fn from_primitive(prim: u32) -> Option<Self> {
602        match prim {
603            1 => Some(Self::MissingArgs),
604            2 => Some(Self::InvalidArgs),
605            3 => Some(Self::BadOperation),
606            4 => Some(Self::BufferFull),
607            _ => None,
608        }
609    }
610
611    #[inline]
612    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
613        match prim {
614            1 => Self::MissingArgs,
615            2 => Self::InvalidArgs,
616            3 => Self::BadOperation,
617            4 => Self::BufferFull,
618            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
619        }
620    }
621
622    #[inline]
623    pub fn unknown() -> Self {
624        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
625    }
626
627    #[inline]
628    pub const fn into_primitive(self) -> u32 {
629        match self {
630            Self::MissingArgs => 1,
631            Self::InvalidArgs => 2,
632            Self::BadOperation => 3,
633            Self::BufferFull => 4,
634            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
635        }
636    }
637
638    #[inline]
639    pub fn is_unknown(&self) -> bool {
640        match self {
641            Self::__SourceBreaking { unknown_ordinal: _ } => true,
642            _ => false,
643        }
644    }
645}
646
647/// The different formats of Screenshot that can be requested.
648#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
649pub enum ScreenshotFormat {
650    /// The default format, requesting a tightly packed pixel data with 32 bit BGRA pixels.
651    BgraRaw,
652    /// Requests tightly packed pixel data with 32 bit RGBA pixels.
653    RgbaRaw,
654    /// Requests tightly packed pixel data which is compressed into PNG format.
655    Png,
656    #[doc(hidden)]
657    __SourceBreaking { unknown_ordinal: u8 },
658}
659
660/// Pattern that matches an unknown `ScreenshotFormat` member.
661#[macro_export]
662macro_rules! ScreenshotFormatUnknown {
663    () => {
664        _
665    };
666}
667
668impl ScreenshotFormat {
669    #[inline]
670    pub fn from_primitive(prim: u8) -> Option<Self> {
671        match prim {
672            0 => Some(Self::BgraRaw),
673            2 => Some(Self::RgbaRaw),
674            1 => Some(Self::Png),
675            _ => None,
676        }
677    }
678
679    #[inline]
680    pub fn from_primitive_allow_unknown(prim: u8) -> Self {
681        match prim {
682            0 => Self::BgraRaw,
683            2 => Self::RgbaRaw,
684            1 => Self::Png,
685            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
686        }
687    }
688
689    #[inline]
690    pub fn unknown() -> Self {
691        Self::__SourceBreaking { unknown_ordinal: 0xff }
692    }
693
694    #[inline]
695    pub const fn into_primitive(self) -> u8 {
696        match self {
697            Self::BgraRaw => 0,
698            Self::RgbaRaw => 2,
699            Self::Png => 1,
700            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
701        }
702    }
703
704    #[inline]
705    pub fn is_unknown(&self) -> bool {
706        match self {
707            Self::__SourceBreaking { unknown_ordinal: _ } => true,
708            _ => false,
709        }
710    }
711}
712
713/// An error that can occur when using the [TrustedFlatlandFactory].
714#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
715pub enum TrustedFlatlandFactoryError {
716    /// A general error occurred during the method call. This may happen if the configuration
717    /// is invalid or if the system is unable to create a new Flatland session.
718    BadOperation,
719    #[doc(hidden)]
720    __SourceBreaking { unknown_ordinal: u32 },
721}
722
723/// Pattern that matches an unknown `TrustedFlatlandFactoryError` member.
724#[macro_export]
725macro_rules! TrustedFlatlandFactoryErrorUnknown {
726    () => {
727        _
728    };
729}
730
731impl TrustedFlatlandFactoryError {
732    #[inline]
733    pub fn from_primitive(prim: u32) -> Option<Self> {
734        match prim {
735            1 => Some(Self::BadOperation),
736            _ => None,
737        }
738    }
739
740    #[inline]
741    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
742        match prim {
743            1 => Self::BadOperation,
744            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
745        }
746    }
747
748    #[inline]
749    pub fn unknown() -> Self {
750        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
751    }
752
753    #[inline]
754    pub const fn into_primitive(self) -> u32 {
755        match self {
756            Self::BadOperation => 1,
757            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
758        }
759    }
760
761    #[inline]
762    pub fn is_unknown(&self) -> bool {
763        match self {
764            Self::__SourceBreaking { unknown_ordinal: _ } => true,
765            _ => false,
766        }
767    }
768}
769
770#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
771pub struct ChildViewWatcherGetStatusResponse {
772    pub status: ChildViewStatus,
773}
774
775impl fidl::Persistable for ChildViewWatcherGetStatusResponse {}
776
777/// Represents a color with alpha channel.
778/// Values are unorm (i.e. the valid range is [0,1]), and are in linear color
779/// space. They are not gamma-corrected nor premultiplied.
780#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
781pub struct ColorRgba {
782    pub red: f32,
783    pub green: f32,
784    pub blue: f32,
785    pub alpha: f32,
786}
787
788impl fidl::Persistable for ColorRgba {}
789
790/// A user-defined identifier for a particular piece of Content. See Content creation functions
791/// (e.g. [`CreateViewport`], [`CreateImage`]) for more information.
792#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
793#[repr(C)]
794pub struct ContentId {
795    pub value: u64,
796}
797
798impl fidl::Persistable for ContentId {}
799
800#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
801#[repr(C)]
802pub struct Flatland2CreateLayerRequest {
803    pub layer_id: LayerId,
804}
805
806impl fidl::Persistable for Flatland2CreateLayerRequest {}
807
808#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
809#[repr(C)]
810pub struct Flatland2CreateLayerStackRequest {
811    pub stack_id: LayerStackId,
812}
813
814impl fidl::Persistable for Flatland2CreateLayerStackRequest {}
815
816#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
817#[repr(C)]
818pub struct Flatland2ReleaseImage2Request {
819    pub image_id: ImageId,
820}
821
822impl fidl::Persistable for Flatland2ReleaseImage2Request {}
823
824#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
825#[repr(C)]
826pub struct Flatland2ReleaseLayerRequest {
827    pub layer_id: LayerId,
828}
829
830impl fidl::Persistable for Flatland2ReleaseLayerRequest {}
831
832#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
833#[repr(C)]
834pub struct Flatland2ReleaseLayerStackRequest {
835    pub stack_id: LayerStackId,
836}
837
838impl fidl::Persistable for Flatland2ReleaseLayerStackRequest {}
839
840#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
841#[repr(C)]
842pub struct Flatland2ReleaseViewport2Request {
843    pub viewport_id: ViewportId,
844}
845
846impl fidl::Persistable for Flatland2ReleaseViewport2Request {}
847
848#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
849#[repr(C)]
850pub struct Flatland2ResetLayerRequest {
851    pub layer_id: LayerId,
852}
853
854impl fidl::Persistable for Flatland2ResetLayerRequest {}
855
856#[derive(Clone, Debug, PartialEq)]
857pub struct Flatland2SetLayerPropertiesRequest {
858    pub layer_id: LayerId,
859    pub properties: LayerProperties,
860}
861
862impl fidl::Persistable for Flatland2SetLayerPropertiesRequest {}
863
864#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
865pub struct Flatland2SetStackLayersRequest {
866    pub stack_id: LayerStackId,
867    pub layers: Vec<LayerId>,
868}
869
870impl fidl::Persistable for Flatland2SetStackLayersRequest {}
871
872#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
873pub struct Flatland2SetTransformContentRequest {
874    pub transform_id: TransformId,
875    pub content: Option<Box<TransformContent>>,
876}
877
878impl fidl::Persistable for Flatland2SetTransformContentRequest {}
879
880#[derive(Clone, Debug, PartialEq)]
881pub struct Flatland2SetViewportProperties2Request {
882    pub viewport_id: ViewportId,
883    pub properties: ViewportProperties,
884}
885
886impl fidl::Persistable for Flatland2SetViewportProperties2Request {}
887
888#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
889#[repr(C)]
890pub struct FlatlandAddChildRequest {
891    pub parent_transform_id: TransformId,
892    pub child_transform_id: TransformId,
893}
894
895impl fidl::Persistable for FlatlandAddChildRequest {}
896
897#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
898#[repr(C)]
899pub struct FlatlandCreateTransformRequest {
900    pub transform_id: TransformId,
901}
902
903impl fidl::Persistable for FlatlandCreateTransformRequest {}
904
905#[derive(Clone, Debug, PartialEq)]
906pub struct FlatlandDisplaySetDevicePixelRatioRequest {
907    pub device_pixel_ratio: fidl_fuchsia_math_common::VecF,
908}
909
910impl fidl::Persistable for FlatlandDisplaySetDevicePixelRatioRequest {}
911
912#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
913pub struct FlatlandOnErrorRequest {
914    pub error: FlatlandError,
915}
916
917impl fidl::Persistable for FlatlandOnErrorRequest {}
918
919#[derive(Clone, Debug, PartialEq)]
920pub struct FlatlandOnFramePresentedRequest {
921    pub frame_presented_info: fidl_fuchsia_scenic_scheduling_common::FramePresentedInfo,
922}
923
924impl fidl::Persistable for FlatlandOnFramePresentedRequest {}
925
926#[derive(Clone, Debug, PartialEq)]
927pub struct FlatlandOnNextFrameBeginRequest {
928    pub values: OnNextFrameBeginValues,
929}
930
931impl fidl::Persistable for FlatlandOnNextFrameBeginRequest {}
932
933#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
934#[repr(C)]
935pub struct FlatlandReleaseFilledRectRequest {
936    pub rect_id: ContentId,
937}
938
939impl fidl::Persistable for FlatlandReleaseFilledRectRequest {}
940
941#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
942#[repr(C)]
943pub struct FlatlandReleaseImageRequest {
944    pub image_id: ContentId,
945}
946
947impl fidl::Persistable for FlatlandReleaseImageRequest {}
948
949#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
950#[repr(C)]
951pub struct FlatlandReleaseTransformRequest {
952    pub transform_id: TransformId,
953}
954
955impl fidl::Persistable for FlatlandReleaseTransformRequest {}
956
957#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
958#[repr(C)]
959pub struct FlatlandReleaseViewportRequest {
960    pub viewport_id: ContentId,
961}
962
963impl fidl::Persistable for FlatlandReleaseViewportRequest {}
964
965#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
966#[repr(C)]
967pub struct FlatlandRemoveChildRequest {
968    pub parent_transform_id: TransformId,
969    pub child_transform_id: TransformId,
970}
971
972impl fidl::Persistable for FlatlandRemoveChildRequest {}
973
974#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
975pub struct FlatlandReplaceChildrenRequest {
976    pub parent_transform_id: TransformId,
977    pub new_child_transform_ids: Vec<TransformId>,
978}
979
980impl fidl::Persistable for FlatlandReplaceChildrenRequest {}
981
982#[derive(Clone, Debug, PartialEq)]
983pub struct FlatlandSetClipBoundaryRequest {
984    pub transform_id: TransformId,
985    pub rect: Option<Box<fidl_fuchsia_math_common::Rect>>,
986}
987
988impl fidl::Persistable for FlatlandSetClipBoundaryRequest {}
989
990#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
991#[repr(C)]
992pub struct FlatlandSetContentRequest {
993    pub transform_id: TransformId,
994    pub content_id: ContentId,
995}
996
997impl fidl::Persistable for FlatlandSetContentRequest {}
998
999#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1000pub struct FlatlandSetDebugNameRequest {
1001    pub name: String,
1002}
1003
1004impl fidl::Persistable for FlatlandSetDebugNameRequest {}
1005
1006#[derive(Clone, Debug, PartialEq)]
1007pub struct FlatlandSetHitRegionsRequest {
1008    pub transform_id: TransformId,
1009    /// Each region's [`HitRegion.region.width`] and [`HitRegion.region.height`] field must be a
1010    /// non-negative value.
1011    pub regions: Vec<HitRegion>,
1012}
1013
1014impl fidl::Persistable for FlatlandSetHitRegionsRequest {}
1015
1016#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1017pub struct FlatlandSetImageBlendModeRequest {
1018    pub image_id: ContentId,
1019    pub blend_mode: BlendMode2,
1020}
1021
1022impl fidl::Persistable for FlatlandSetImageBlendModeRequest {}
1023
1024#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1025pub struct FlatlandSetImageBlendingFunctionRequest {
1026    pub image_id: ContentId,
1027    pub blend_mode: BlendMode,
1028}
1029
1030impl fidl::Persistable for FlatlandSetImageBlendingFunctionRequest {}
1031
1032#[derive(Clone, Debug, PartialEq)]
1033pub struct FlatlandSetImageDestinationSizeRequest {
1034    pub image_id: ContentId,
1035    pub size: fidl_fuchsia_math_common::SizeU,
1036}
1037
1038impl fidl::Persistable for FlatlandSetImageDestinationSizeRequest {}
1039
1040#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1041pub struct FlatlandSetImageFlipRequest {
1042    pub image_id: ContentId,
1043    pub flip: ImageFlip,
1044}
1045
1046impl fidl::Persistable for FlatlandSetImageFlipRequest {}
1047
1048#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1049pub struct FlatlandSetImageOpacityRequest {
1050    pub image_id: ContentId,
1051    pub val: f32,
1052}
1053
1054impl fidl::Persistable for FlatlandSetImageOpacityRequest {}
1055
1056#[derive(Clone, Debug, PartialEq)]
1057pub struct FlatlandSetImageSampleRegionRequest {
1058    pub image_id: ContentId,
1059    pub rect: fidl_fuchsia_math_common::RectF,
1060}
1061
1062impl fidl::Persistable for FlatlandSetImageSampleRegionRequest {}
1063
1064#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1065pub struct FlatlandSetInfiniteHitRegionRequest {
1066    pub transform_id: TransformId,
1067    pub hit_test: HitTestInteraction,
1068}
1069
1070impl fidl::Persistable for FlatlandSetInfiniteHitRegionRequest {}
1071
1072#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1073pub struct FlatlandSetOpacityRequest {
1074    pub transform_id: TransformId,
1075    pub value: f32,
1076}
1077
1078impl fidl::Persistable for FlatlandSetOpacityRequest {}
1079
1080#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1081pub struct FlatlandSetOrientationRequest {
1082    pub transform_id: TransformId,
1083    pub orientation: Orientation,
1084}
1085
1086impl fidl::Persistable for FlatlandSetOrientationRequest {}
1087
1088#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1089#[repr(C)]
1090pub struct FlatlandSetRootTransformRequest {
1091    pub transform_id: TransformId,
1092}
1093
1094impl fidl::Persistable for FlatlandSetRootTransformRequest {}
1095
1096#[derive(Clone, Debug, PartialEq)]
1097pub struct FlatlandSetScaleRequest {
1098    pub transform_id: TransformId,
1099    pub scale: fidl_fuchsia_math_common::VecF,
1100}
1101
1102impl fidl::Persistable for FlatlandSetScaleRequest {}
1103
1104#[derive(Clone, Debug, PartialEq)]
1105pub struct FlatlandSetTranslationRequest {
1106    pub transform_id: TransformId,
1107    pub translation: fidl_fuchsia_math_common::Vec_,
1108}
1109
1110impl fidl::Persistable for FlatlandSetTranslationRequest {}
1111
1112#[derive(Clone, Debug, PartialEq)]
1113pub struct FlatlandSetViewportPropertiesRequest {
1114    pub viewport_id: ContentId,
1115    pub properties: ViewportProperties,
1116}
1117
1118impl fidl::Persistable for FlatlandSetViewportPropertiesRequest {}
1119
1120/// An interactive area of a View, placed in the coordinate space of a specific Transform.
1121#[derive(Clone, Debug, PartialEq)]
1122pub struct HitRegion {
1123    /// The position and size of this hit region, in the coordinate space of the Transform that owns
1124    /// this hit region.
1125    pub region: fidl_fuchsia_math_common::RectF,
1126    /// The interaction behavior specified for this hit region.
1127    /// To specify "no interaction at all", remove this hit region from the owning Transform.
1128    pub hit_test: HitTestInteraction,
1129}
1130
1131impl fidl::Persistable for HitRegion {}
1132
1133/// A user-defined identifier for a particular image created with [`Flatland.CreateImage2`].
1134///
1135/// Zero is never a valid `ImageId`; the shared identifier rules documented on
1136/// [`LayerId`] also apply.
1137#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1138#[repr(C)]
1139pub struct ImageId {
1140    pub value: u64,
1141}
1142
1143impl fidl::Persistable for ImageId {}
1144
1145/// **Zero identifiers**: zero is never a valid identifier, for any of these types; each
1146/// `Create*` method rejects it. Unlike the classic API (where, e.g., [`Flatland.SetContent`]
1147/// accepts id 0 to clear a Transform's content), Flatland2 never uses a zero id to express
1148/// clearing; where clearing is possible, it is expressed by omitting an optional field
1149/// (see [`Flatland.SetTransformContent`]).
1150///
1151/// A user-defined identifier for a particular layer. See [`Flatland.CreateLayer`] and
1152/// [`Flatland.ReleaseLayer`] for more information.
1153#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1154#[repr(C)]
1155pub struct LayerId {
1156    pub value: u64,
1157}
1158
1159impl fidl::Persistable for LayerId {}
1160
1161/// A user-defined identifier for a particular layer stack created with [`Flatland.CreateLayerStack`].
1162///
1163/// Zero is never a valid `LayerStackId`; the shared identifier rules documented on
1164/// [`LayerId`] also apply.
1165#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1166#[repr(C)]
1167pub struct LayerStackId {
1168    pub value: u64,
1169}
1170
1171impl fidl::Persistable for LayerStackId {}
1172
1173#[derive(Clone, Debug, PartialEq)]
1174pub struct ParentViewportWatcherGetLayoutResponse {
1175    pub info: LayoutInfo,
1176}
1177
1178impl fidl::Persistable for ParentViewportWatcherGetLayoutResponse {}
1179
1180#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1181pub struct ParentViewportWatcherGetStatusResponse {
1182    pub status: ParentViewportStatus,
1183}
1184
1185impl fidl::Persistable for ParentViewportWatcherGetStatusResponse {}
1186
1187#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1188#[repr(C)]
1189pub struct ScreenCaptureReleaseFrameRequest {
1190    pub buffer_id: u32,
1191}
1192
1193impl fidl::Persistable for ScreenCaptureReleaseFrameRequest {}
1194
1195/// A user-defined identifier for a particular transform. See [`CreateTransform`] and
1196/// [`ReleaseTransform`] for more information.
1197#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1198#[repr(C)]
1199pub struct TransformId {
1200    pub value: u64,
1201}
1202
1203impl fidl::Persistable for TransformId {}
1204
1205#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1206#[repr(C)]
1207pub struct TrustedFlatlandReleaseImageImmediately2Request {
1208    pub image_id: ImageId,
1209}
1210
1211impl fidl::Persistable for TrustedFlatlandReleaseImageImmediately2Request {}
1212
1213#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1214#[repr(C)]
1215pub struct TrustedFlatlandReleaseImageImmediatelyRequest {
1216    pub image_id: ContentId,
1217}
1218
1219impl fidl::Persistable for TrustedFlatlandReleaseImageImmediatelyRequest {}
1220
1221/// A user-defined identifier for a particular viewport created with [`Flatland.CreateViewport2`].
1222///
1223/// Zero is never a valid `ViewportId`; the shared identifier rules documented on
1224/// [`LayerId`] also apply.
1225#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1226#[repr(C)]
1227pub struct ViewportId {
1228    pub value: u64,
1229}
1230
1231impl fidl::Persistable for ViewportId {}
1232
1233/// Configuration parameters for instantiating a regular Flatland session.
1234#[derive(Clone, Debug, Default, PartialEq)]
1235pub struct FlatlandConfig {
1236    /// If true, opts the session into the Flatland2 API surface and layer data model.
1237    /// Defaults to false.
1238    pub use_flatland2: Option<bool>,
1239    #[doc(hidden)]
1240    pub __source_breaking: fidl::marker::SourceBreaking,
1241}
1242
1243impl fidl::Persistable for FlatlandConfig {}
1244
1245/// The properties of an Image as defined by the client. These properties determine how an Image
1246/// uses the backing BufferCollection. See [`CreateImage`] for more information.
1247#[derive(Clone, Debug, Default, PartialEq)]
1248pub struct ImageProperties {
1249    /// The size of the Image in pixels.
1250    pub size: Option<fidl_fuchsia_math_common::SizeU>,
1251    #[doc(hidden)]
1252    pub __source_breaking: fidl::marker::SourceBreaking,
1253}
1254
1255impl fidl::Persistable for ImageProperties {}
1256
1257/// Stateful properties associated with a Layer.
1258///
1259/// All fields are sticky: [`SetLayerProperties`] merges the provided table into the
1260/// layer's stored properties, and stored values persist across [`SetLayerImage`] calls
1261/// and across composition mode changes. Fields not used by the current composition mode
1262/// keep their values, and take effect again when a mode that uses them is re-entered.
1263/// Nothing is cleared implicitly; [`ResetLayer`] is the only operation that forgets
1264/// stored properties.
1265///
1266/// **Hints (Safety and Performance Semantics)**:
1267/// Hints (such as [`hint_damage_rects`] and [`hint_visible_rects`]) are optional
1268/// optimization details provided by the client.
1269/// * **Ignorable by Design**: The implementation is free to ignore these hints. If ignored,
1270///   rendering remains fully correct, though possibly less optimal.
1271/// * **Correct Hints**: Yield the identical visual result but may improve performance (e.g.,
1272///   by allowing composition shortcuts or partial updates).
1273/// * **Incorrect Hints**: May result in rendering artifacts, stale regions, or incorrect
1274///   pixels on the display, as the implementation might optimize based on false assumptions.
1275#[derive(Clone, Debug, Default, PartialEq)]
1276pub struct LayerProperties {
1277    /// The rectangle where the layer content will be displayed in its local coordinate space.
1278    ///
1279    /// For image layers, visual properties are applied in the following order:
1280    /// 1. **Sample**: The region specified by `sample_rect` is extracted from the image.
1281    /// 2. **Transform**: The sampled region is flipped and rotated as specified by `transform`.
1282    /// 3. **Scale/Fit**: Transformed content is implicitly scaled to fit the `display_rect`.
1283    ///
1284    /// Hardware image scaling is requested implicitly when the dimensions of the transformed
1285    /// `sample_rect` differ from the extent of the `display_rect`. Not all display hardware supports
1286    /// scaling, or may have limitations.
1287    ///
1288    /// The dimensions of `display_rect` must account for image dimension changes caused by rotations
1289    /// to avoid implicit scaling or distortion. For example, rotating a 600x300 pixel region
1290    /// by 90 degrees would require specifying 300x600 dimensions here to maintain the aspect ratio.
1291    ///
1292    /// **Note**: This rectangle is specified in the local space of the LayerStack (or the Transform
1293    /// the LayerStack is attached to). Any scaling applied by parent transforms in the Flatland scene
1294    /// graph will further affect the final size on the physical display.
1295    ///
1296    /// Default: (0,0,0,0). The layer will not be visible until a rectangle with non-zero
1297    /// width and height is set.
1298    pub display_rect: Option<fidl_fuchsia_math_common::RectU>,
1299    /// The opacity of the layer, in the range [0..1].
1300    ///
1301    /// Multiplies with opacity inherited from `Transform`s above the layer's `LayerStack`
1302    /// (see [`fuchsia.ui.composition/Flatland.SetOpacity`]) to give the layer's *effective
1303    /// opacity*. The layer renders as if its content's own alpha (image pixels' alpha, or
1304    /// `color.alpha` for a solid-color layer) were scaled by the effective opacity; since
1305    /// this requires blending, a `REPLACE` layer with effective opacity below 1.0 renders
1306    /// as `PREMULTIPLIED_ALPHA` (see [`blend_mode`]). A layer with effective opacity 0.0
1307    /// is invisible.
1308    ///
1309    /// Default: 1.0 (the content's own alpha applies unmodified).
1310    pub opacity: Option<f32>,
1311    /// The blend mode used to composite the layer over the content beneath it.
1312    ///
1313    /// `REPLACE` is honored only while the layer's effective opacity is 1.0 (see [`opacity`]);
1314    /// at lower effective opacity the layer renders as `PREMULTIPLIED_ALPHA`, so that opacity
1315    /// always fades the layer. To write exact sub-unity alpha values into the output (e.g.
1316    /// punching a hole for an underlay), author them in the content itself (the image's own
1317    /// pixels, or `color.alpha` for a solid-color layer) and leave `opacity` at 1.0.
1318    ///
1319    /// `STRAIGHT_ALPHA` names a content *encoding*, and is meaningful for image
1320    /// content. A solid-color layer's encoding is fixed by the API (`color` is straight
1321    /// RGBA regardless of `blend_mode`), so for solid-color content `STRAIGHT_ALPHA` is
1322    /// accepted and composites identically to `PREMULTIPLIED_ALPHA`.
1323    ///
1324    /// Default: `BlendMode2.REPLACE`.
1325    pub blend_mode: Option<BlendMode2>,
1326    /// The color to fill the layer with, as straight (non-premultiplied) RGBA regardless
1327    /// of `blend_mode`. The compositor performs any conversion needed for rendering.
1328    ///
1329    /// Default: opaque white (1.0, 1.0, 1.0, 1.0).
1330    pub color: Option<ColorRgba>,
1331    /// Describes the region inside the image to sample from, in unnormalized coordinates
1332    /// (rect width/height match image width/height).
1333    ///
1334    /// Default: (0,0,0,0), which is interpreted as the entire image region.  A client can
1335    /// reset to the full image by setting this field to (0,0,0,0).
1336    ///
1337    /// Must lie within the bounds of the bound image. This is checked during
1338    /// [`fuchsia.ui.composition/Flatland.Present`], and only for layers whose
1339    /// `composition_mode` is `IMAGE`, so the order of calls within a batch does not
1340    /// matter: a rect and an image of matching size may be set in either order, and a
1341    /// rect set while no image is bound (or while another mode is in effect) is stored
1342    /// without complaint. A violation at `Present` closes the connection with
1343    /// `BAD_OPERATION`.
1344    pub sample_rect: Option<fidl_fuchsia_math_common::RectF>,
1345    /// Specifies image transform.
1346    ///
1347    /// Default: No transformation (identity).
1348    pub transform: Option<FlipThenRotate>,
1349    /// A hint describing the region of the source image that has changed since the last frame.
1350    /// Specified in the coordinate space of the source image (buffer).
1351    ///
1352    /// Default: Empty vector (interpreted as the entire sample rect being damaged).
1353    ///
1354    /// Refer to [`LayerProperties`] for the general safety and performance semantics of hints.
1355    pub hint_damage_rects: Option<Vec<fidl_fuchsia_math_common::RectU>>,
1356    /// A hint describing the visible region of the layer on the screen.
1357    /// Specified in the local coordinate space of the Layer (matching `display_rect`).
1358    ///
1359    /// Default: Empty vector (interpreted as the entire `display_rect` being visible).
1360    ///
1361    /// Refer to [`LayerProperties`] for the general safety and performance semantics of hints.
1362    pub hint_visible_rects: Option<Vec<fidl_fuchsia_math_common::RectU>>,
1363    /// Selects which of the property groups above is in effect; see [`CompositionMode`].
1364    ///
1365    /// Default: `CompositionMode.INVISIBLE`.
1366    pub composition_mode: Option<CompositionMode>,
1367    #[doc(hidden)]
1368    pub __source_breaking: fidl::marker::SourceBreaking,
1369}
1370
1371impl fidl::Persistable for LayerProperties {}
1372
1373/// The return type of [`GetLayout`]. This table contains most of the information necessary
1374/// for a client to decide how to layout their content in a Flatland session. This data may be
1375/// provided to the client before the command that creates the View is presented, so that the
1376/// client may lay out content properly before their first call to [`Present`].
1377#[derive(Clone, Debug, Default, PartialEq)]
1378pub struct LayoutInfo {
1379    /// The layout size of a View in logical pixels, defined by the parent's call to
1380    /// [`SetViewportProperties`].
1381    ///
1382    /// The logical size also serves as the clip boundary of the View. Anything outside the clip
1383    /// boundary will not be rendered. Hence, the View's Root Transform has a useful coordinate
1384    /// space of (0, 0) to (logical_size.width, logical_size.height).
1385    ///
1386    /// Clients should re-layout their content when this value changes.
1387    pub logical_size: Option<fidl_fuchsia_math_common::SizeU>,
1388    /// The ratio of display's physical pixels to device independent pixels. Each logical pixel of a
1389    /// View is displayed on-screen by one or more physical pixels, as determined by this scale.
1390    /// Clients should not necessarily re-layout their content when this value changes, but
1391    /// accommodate by reallocating their Image buffers to avoid sampling artifacts. The HiDPI-aware
1392    /// client should allocate buffers that are sized (`logical_size`*`device_pixel_ratio`).
1393    pub device_pixel_ratio: Option<fidl_fuchsia_math_common::VecF>,
1394    /// The offsets between the edges and the visible rectangle of the View. The clients can assume
1395    /// that the boundary region between the inset and the View edge is occluded, and should adjust
1396    /// content layout to avoid this region. This inset is described in the view's logical
1397    /// coordinate system. The HiDPI-aware clients should scale this by `device_pixel_ratio`.
1398    pub inset: Option<fidl_fuchsia_math_common::Inset>,
1399    #[doc(hidden)]
1400    pub __source_breaking: fidl::marker::SourceBreaking,
1401}
1402
1403impl fidl::Persistable for LayoutInfo {}
1404
1405/// Fields that a client needs in order to produce its next frame, returned in
1406/// [`OnNextFrameBegin`]. Each field is guaranteed to be  set and contain valid information.
1407#[derive(Clone, Debug, Default, PartialEq)]
1408pub struct OnNextFrameBeginValues {
1409    /// The number of *additional* [`Present`] calls allowed to the client so that they
1410    /// can call [`Present`] further times. This is a delta in the present
1411    /// credit budget, not the absolute number of present credits.
1412    pub additional_present_credits: Option<u32>,
1413    /// Information about future presentation and latch times that a client may aim for
1414    /// precise scheduling behavior.
1415    pub future_presentation_infos:
1416        Option<Vec<fidl_fuchsia_scenic_scheduling_common::PresentationInfo>>,
1417    #[doc(hidden)]
1418    pub __source_breaking: fidl::marker::SourceBreaking,
1419}
1420
1421impl fidl::Persistable for OnNextFrameBeginValues {}
1422
1423/// The properties of a Viewport as defined by the parent. This data, along with the set of attached
1424/// Transforms, will be used to compute the LayoutInfo for the View of the Viewport.
1425/// `ViewportProperties` must have `logical_size` set at least once. This is the initial size that
1426/// will drive the layout of the child.
1427#[derive(Clone, Debug, Default, PartialEq)]
1428pub struct ViewportProperties {
1429    /// The size of the Viewport in logical pixels. This maps directly to the logical_size field in
1430    /// LayoutInfo. The valid logical_size must have positive X and Y components.
1431    pub logical_size: Option<fidl_fuchsia_math_common::SizeU>,
1432    /// The offsets between the edges and the visible rectangle of the Viewport. This maps directly
1433    /// to the `inset` field in LayoutInfo. The valid inset must have all components greater than or
1434    /// equal to 0.
1435    pub inset: Option<fidl_fuchsia_math_common::Inset>,
1436    #[doc(hidden)]
1437    pub __source_breaking: fidl::marker::SourceBreaking,
1438}
1439
1440impl fidl::Persistable for ViewportProperties {}
1441
1442/// Content that can be attached to a Transform when Flatland2 is enabled.
1443///
1444/// This union defines the types of content that can be attached to a Transform
1445/// using [`Flatland.SetTransformContent`].
1446#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1447pub enum TransformContent {
1448    LayerStack(LayerStackId),
1449    Viewport(ViewportId),
1450}
1451
1452impl TransformContent {
1453    #[inline]
1454    pub fn ordinal(&self) -> u64 {
1455        match *self {
1456            Self::LayerStack(_) => 1,
1457            Self::Viewport(_) => 2,
1458        }
1459    }
1460}
1461
1462impl fidl::Persistable for TransformContent {}
1463
1464pub mod allocator_ordinals {
1465    pub const REGISTER_BUFFER_COLLECTION: u64 = 0x494b7ea578d1061e;
1466}
1467
1468pub mod child_view_watcher_ordinals {
1469    pub const GET_STATUS: u64 = 0x1d622075f4fc8243;
1470    pub const GET_VIEW_REF: u64 = 0x3b2f3ca31e8908b4;
1471}
1472
1473pub mod flatland_ordinals {
1474    pub const RELEASE_IMAGE_IMMEDIATELY: u64 = 0x245e1ac080772c8;
1475    pub const RELEASE_IMAGE_IMMEDIATELY2: u64 = 0x6d6a73d150589146;
1476    pub const CREATE_LAYER: u64 = 0x60837bb0ce59f8a9;
1477    pub const RELEASE_LAYER: u64 = 0x60118a842b6f0756;
1478    pub const SET_LAYER_IMAGE: u64 = 0x262302d9782d252c;
1479    pub const SET_LAYER_PROPERTIES: u64 = 0x282d0e902aae8bb0;
1480    pub const RESET_LAYER: u64 = 0x17bf541bf216ab2b;
1481    pub const CREATE_LAYER_STACK: u64 = 0x70debe3cd7371aa6;
1482    pub const RELEASE_LAYER_STACK: u64 = 0x3ad3151aece3b1bb;
1483    pub const SET_STACK_LAYERS: u64 = 0x1e0bff0f5cca065a;
1484    pub const CREATE_IMAGE2: u64 = 0x677fa7b23aaca46;
1485    pub const RELEASE_IMAGE2: u64 = 0x7d0a041ed51aca06;
1486    pub const CREATE_VIEWPORT2: u64 = 0x1b646776764f1128;
1487    pub const RELEASE_VIEWPORT2: u64 = 0x18ef77414c7a9ae3;
1488    pub const SET_VIEWPORT_PROPERTIES2: u64 = 0x95f2ec3b9e4beea;
1489    pub const SET_TRANSFORM_CONTENT: u64 = 0x17e33f64f55e4ea9;
1490    pub const PRESENT: u64 = 0x50acc2aa1f0acec7;
1491    pub const ON_NEXT_FRAME_BEGIN: u64 = 0x10f69a5cdeece84a;
1492    pub const ON_FRAME_PRESENTED: u64 = 0x56e43e1a5f30216d;
1493    pub const ON_ERROR: u64 = 0x1ebf39e90cd8b8d;
1494    pub const CREATE_VIEW: u64 = 0x504686eb25864780;
1495    pub const CREATE_VIEW2: u64 = 0x340a3a40c2fdbd5e;
1496    pub const CREATE_TRANSFORM: u64 = 0x5e042a4d3de3efb0;
1497    pub const SET_TRANSLATION: u64 = 0x7863398291fba346;
1498    pub const SET_ORIENTATION: u64 = 0x4915310bc4928edc;
1499    pub const SET_SCALE: u64 = 0x1ea1766fd8996bb4;
1500    pub const SET_OPACITY: u64 = 0x3775fc2c00b432fa;
1501    pub const SET_CLIP_BOUNDARY: u64 = 0x6507843df12222d2;
1502    pub const ADD_CHILD: u64 = 0x67a8abd2f19b1a74;
1503    pub const REMOVE_CHILD: u64 = 0x41d6cd90b298b67a;
1504    pub const REPLACE_CHILDREN: u64 = 0x5b6d86cbbff81316;
1505    pub const SET_ROOT_TRANSFORM: u64 = 0x6e80ca5bcc566cd8;
1506    pub const SET_HIT_REGIONS: u64 = 0x31c9d17b07c37ce4;
1507    pub const SET_INFINITE_HIT_REGION: u64 = 0x26d81af852d29562;
1508    pub const CREATE_VIEWPORT: u64 = 0x2485fbcab7f943c;
1509    pub const CREATE_IMAGE: u64 = 0x26fae823c4ebedad;
1510    pub const SET_IMAGE_SAMPLE_REGION: u64 = 0x8039391d715eb28;
1511    pub const SET_IMAGE_DESTINATION_SIZE: u64 = 0x766cf99a2ec58446;
1512    pub const SET_IMAGE_BLENDING_FUNCTION: u64 = 0x10f5da1356275b7b;
1513    pub const SET_IMAGE_BLEND_MODE: u64 = 0x5b1667f130c3de67;
1514    pub const SET_IMAGE_OPACITY: u64 = 0x2da9e4ef4c2cff6f;
1515    pub const SET_IMAGE_FLIP: u64 = 0x21b20f2c14aae6bc;
1516    pub const CREATE_FILLED_RECT: u64 = 0x5e62355abc1c4c5d;
1517    pub const SET_SOLID_FILL: u64 = 0x32d6ef41e182dfa5;
1518    pub const RELEASE_FILLED_RECT: u64 = 0x7392cabe45618f9b;
1519    pub const SET_CONTENT: u64 = 0x4ed2cfc0ce130862;
1520    pub const SET_VIEWPORT_PROPERTIES: u64 = 0x66ab67e9608ddb9f;
1521    pub const RELEASE_TRANSFORM: u64 = 0xab9328419451c22;
1522    pub const RELEASE_VIEW: u64 = 0x5b35aab9baffecae;
1523    pub const RELEASE_VIEWPORT: u64 = 0xbad474aeb5293f9;
1524    pub const RELEASE_IMAGE: u64 = 0xb884ffdbc72c111;
1525    pub const CLEAR: u64 = 0x4ec8817c02828c3e;
1526    pub const SET_DEBUG_NAME: u64 = 0x46a8b397e68a8888;
1527}
1528
1529pub mod flatland2_ordinals {
1530    pub const CREATE_LAYER: u64 = 0x60837bb0ce59f8a9;
1531    pub const RELEASE_LAYER: u64 = 0x60118a842b6f0756;
1532    pub const SET_LAYER_IMAGE: u64 = 0x262302d9782d252c;
1533    pub const SET_LAYER_PROPERTIES: u64 = 0x282d0e902aae8bb0;
1534    pub const RESET_LAYER: u64 = 0x17bf541bf216ab2b;
1535    pub const CREATE_LAYER_STACK: u64 = 0x70debe3cd7371aa6;
1536    pub const RELEASE_LAYER_STACK: u64 = 0x3ad3151aece3b1bb;
1537    pub const SET_STACK_LAYERS: u64 = 0x1e0bff0f5cca065a;
1538    pub const CREATE_IMAGE2: u64 = 0x677fa7b23aaca46;
1539    pub const RELEASE_IMAGE2: u64 = 0x7d0a041ed51aca06;
1540    pub const CREATE_VIEWPORT2: u64 = 0x1b646776764f1128;
1541    pub const RELEASE_VIEWPORT2: u64 = 0x18ef77414c7a9ae3;
1542    pub const SET_VIEWPORT_PROPERTIES2: u64 = 0x95f2ec3b9e4beea;
1543    pub const SET_TRANSFORM_CONTENT: u64 = 0x17e33f64f55e4ea9;
1544}
1545
1546pub mod flatland_display_ordinals {
1547    pub const SET_CONTENT: u64 = 0x6748193a39918298;
1548    pub const SET_DEVICE_PIXEL_RATIO: u64 = 0x392c3e70cc0a81a4;
1549}
1550
1551pub mod flatland_factory_ordinals {
1552    pub const CREATE_FLATLAND: u64 = 0x5de80d9d7239b37e;
1553}
1554
1555pub mod parent_viewport_watcher_ordinals {
1556    pub const GET_LAYOUT: u64 = 0x3cbe5d9638e032;
1557    pub const GET_STATUS: u64 = 0x7caa022f050d9ea6;
1558}
1559
1560pub mod screen_capture_ordinals {
1561    pub const CONFIGURE: u64 = 0x3b6e5af1d294afd9;
1562    pub const GET_NEXT_FRAME: u64 = 0x552c1580aab8c4a7;
1563    pub const RELEASE_FRAME: u64 = 0x46704dce24e35950;
1564}
1565
1566pub mod screenshot_ordinals {
1567    pub const TAKE: u64 = 0x51341396e9fd2fd0;
1568    pub const TAKE_FILE: u64 = 0x470aeea0a4d32903;
1569}
1570
1571pub mod trusted_flatland_ordinals {
1572    pub const RELEASE_IMAGE_IMMEDIATELY: u64 = 0x245e1ac080772c8;
1573    pub const RELEASE_IMAGE_IMMEDIATELY2: u64 = 0x6d6a73d150589146;
1574}
1575
1576pub mod trusted_flatland_factory_ordinals {
1577    pub const CREATE_FLATLAND: u64 = 0x48e89c53f00561dc;
1578}
1579
1580mod internal {
1581    use super::*;
1582    unsafe impl fidl::encoding::TypeMarker for FlipThenRotate {
1583        type Owned = Self;
1584
1585        #[inline(always)]
1586        fn inline_align(_context: fidl::encoding::Context) -> usize {
1587            1
1588        }
1589
1590        #[inline(always)]
1591        fn inline_size(_context: fidl::encoding::Context) -> usize {
1592            1
1593        }
1594    }
1595
1596    impl fidl::encoding::ValueTypeMarker for FlipThenRotate {
1597        type Borrowed<'a> = Self;
1598        #[inline(always)]
1599        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1600            *value
1601        }
1602    }
1603
1604    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FlipThenRotate {
1605        #[inline]
1606        unsafe fn encode(
1607            self,
1608            encoder: &mut fidl::encoding::Encoder<'_, D>,
1609            offset: usize,
1610            _depth: fidl::encoding::Depth,
1611        ) -> fidl::Result<()> {
1612            encoder.debug_check_bounds::<Self>(offset);
1613            if self.bits() & Self::all().bits() != self.bits() {
1614                return Err(fidl::Error::InvalidBitsValue);
1615            }
1616            encoder.write_num(self.bits(), offset);
1617            Ok(())
1618        }
1619    }
1620
1621    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FlipThenRotate {
1622        #[inline(always)]
1623        fn new_empty() -> Self {
1624            Self::empty()
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::<u8>(offset);
1636            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1637            Ok(())
1638        }
1639    }
1640    unsafe impl fidl::encoding::TypeMarker for RegisterBufferCollectionUsages {
1641        type Owned = Self;
1642
1643        #[inline(always)]
1644        fn inline_align(_context: fidl::encoding::Context) -> usize {
1645            2
1646        }
1647
1648        #[inline(always)]
1649        fn inline_size(_context: fidl::encoding::Context) -> usize {
1650            2
1651        }
1652    }
1653
1654    impl fidl::encoding::ValueTypeMarker for RegisterBufferCollectionUsages {
1655        type Borrowed<'a> = Self;
1656        #[inline(always)]
1657        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1658            *value
1659        }
1660    }
1661
1662    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1663        for RegisterBufferCollectionUsages
1664    {
1665        #[inline]
1666        unsafe fn encode(
1667            self,
1668            encoder: &mut fidl::encoding::Encoder<'_, D>,
1669            offset: usize,
1670            _depth: fidl::encoding::Depth,
1671        ) -> fidl::Result<()> {
1672            encoder.debug_check_bounds::<Self>(offset);
1673            encoder.write_num(self.bits(), offset);
1674            Ok(())
1675        }
1676    }
1677
1678    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1679        for RegisterBufferCollectionUsages
1680    {
1681        #[inline(always)]
1682        fn new_empty() -> Self {
1683            Self::empty()
1684        }
1685
1686        #[inline]
1687        unsafe fn decode(
1688            &mut self,
1689            decoder: &mut fidl::encoding::Decoder<'_, D>,
1690            offset: usize,
1691            _depth: fidl::encoding::Depth,
1692        ) -> fidl::Result<()> {
1693            decoder.debug_check_bounds::<Self>(offset);
1694            let prim = decoder.read_num::<u16>(offset);
1695            *self = Self::from_bits_allow_unknown(prim);
1696            Ok(())
1697        }
1698    }
1699    unsafe impl fidl::encoding::TypeMarker for BlendMode {
1700        type Owned = Self;
1701
1702        #[inline(always)]
1703        fn inline_align(_context: fidl::encoding::Context) -> usize {
1704            std::mem::align_of::<u32>()
1705        }
1706
1707        #[inline(always)]
1708        fn inline_size(_context: fidl::encoding::Context) -> usize {
1709            std::mem::size_of::<u32>()
1710        }
1711
1712        #[inline(always)]
1713        fn encode_is_copy() -> bool {
1714            true
1715        }
1716
1717        #[inline(always)]
1718        fn decode_is_copy() -> bool {
1719            false
1720        }
1721    }
1722
1723    impl fidl::encoding::ValueTypeMarker for BlendMode {
1724        type Borrowed<'a> = Self;
1725        #[inline(always)]
1726        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1727            *value
1728        }
1729    }
1730
1731    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for BlendMode {
1732        #[inline]
1733        unsafe fn encode(
1734            self,
1735            encoder: &mut fidl::encoding::Encoder<'_, D>,
1736            offset: usize,
1737            _depth: fidl::encoding::Depth,
1738        ) -> fidl::Result<()> {
1739            encoder.debug_check_bounds::<Self>(offset);
1740            encoder.write_num(self.into_primitive(), offset);
1741            Ok(())
1742        }
1743    }
1744
1745    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlendMode {
1746        #[inline(always)]
1747        fn new_empty() -> Self {
1748            Self::Src
1749        }
1750
1751        #[inline]
1752        unsafe fn decode(
1753            &mut self,
1754            decoder: &mut fidl::encoding::Decoder<'_, D>,
1755            offset: usize,
1756            _depth: fidl::encoding::Depth,
1757        ) -> fidl::Result<()> {
1758            decoder.debug_check_bounds::<Self>(offset);
1759            let prim = decoder.read_num::<u32>(offset);
1760
1761            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1762            Ok(())
1763        }
1764    }
1765    unsafe impl fidl::encoding::TypeMarker for BlendMode2 {
1766        type Owned = Self;
1767
1768        #[inline(always)]
1769        fn inline_align(_context: fidl::encoding::Context) -> usize {
1770            std::mem::align_of::<u32>()
1771        }
1772
1773        #[inline(always)]
1774        fn inline_size(_context: fidl::encoding::Context) -> usize {
1775            std::mem::size_of::<u32>()
1776        }
1777
1778        #[inline(always)]
1779        fn encode_is_copy() -> bool {
1780            false
1781        }
1782
1783        #[inline(always)]
1784        fn decode_is_copy() -> bool {
1785            false
1786        }
1787    }
1788
1789    impl fidl::encoding::ValueTypeMarker for BlendMode2 {
1790        type Borrowed<'a> = Self;
1791        #[inline(always)]
1792        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1793            *value
1794        }
1795    }
1796
1797    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for BlendMode2 {
1798        #[inline]
1799        unsafe fn encode(
1800            self,
1801            encoder: &mut fidl::encoding::Encoder<'_, D>,
1802            offset: usize,
1803            _depth: fidl::encoding::Depth,
1804        ) -> fidl::Result<()> {
1805            encoder.debug_check_bounds::<Self>(offset);
1806            encoder.write_num(self.into_primitive(), offset);
1807            Ok(())
1808        }
1809    }
1810
1811    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BlendMode2 {
1812        #[inline(always)]
1813        fn new_empty() -> Self {
1814            Self::unknown()
1815        }
1816
1817        #[inline]
1818        unsafe fn decode(
1819            &mut self,
1820            decoder: &mut fidl::encoding::Decoder<'_, D>,
1821            offset: usize,
1822            _depth: fidl::encoding::Depth,
1823        ) -> fidl::Result<()> {
1824            decoder.debug_check_bounds::<Self>(offset);
1825            let prim = decoder.read_num::<u32>(offset);
1826
1827            *self = Self::from_primitive_allow_unknown(prim);
1828            Ok(())
1829        }
1830    }
1831    unsafe impl fidl::encoding::TypeMarker for ChildViewStatus {
1832        type Owned = Self;
1833
1834        #[inline(always)]
1835        fn inline_align(_context: fidl::encoding::Context) -> usize {
1836            std::mem::align_of::<u32>()
1837        }
1838
1839        #[inline(always)]
1840        fn inline_size(_context: fidl::encoding::Context) -> usize {
1841            std::mem::size_of::<u32>()
1842        }
1843
1844        #[inline(always)]
1845        fn encode_is_copy() -> bool {
1846            true
1847        }
1848
1849        #[inline(always)]
1850        fn decode_is_copy() -> bool {
1851            false
1852        }
1853    }
1854
1855    impl fidl::encoding::ValueTypeMarker for ChildViewStatus {
1856        type Borrowed<'a> = Self;
1857        #[inline(always)]
1858        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1859            *value
1860        }
1861    }
1862
1863    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1864        for ChildViewStatus
1865    {
1866        #[inline]
1867        unsafe fn encode(
1868            self,
1869            encoder: &mut fidl::encoding::Encoder<'_, D>,
1870            offset: usize,
1871            _depth: fidl::encoding::Depth,
1872        ) -> fidl::Result<()> {
1873            encoder.debug_check_bounds::<Self>(offset);
1874            encoder.write_num(self.into_primitive(), offset);
1875            Ok(())
1876        }
1877    }
1878
1879    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChildViewStatus {
1880        #[inline(always)]
1881        fn new_empty() -> Self {
1882            Self::ContentHasPresented
1883        }
1884
1885        #[inline]
1886        unsafe fn decode(
1887            &mut self,
1888            decoder: &mut fidl::encoding::Decoder<'_, D>,
1889            offset: usize,
1890            _depth: fidl::encoding::Depth,
1891        ) -> fidl::Result<()> {
1892            decoder.debug_check_bounds::<Self>(offset);
1893            let prim = decoder.read_num::<u32>(offset);
1894
1895            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1896            Ok(())
1897        }
1898    }
1899    unsafe impl fidl::encoding::TypeMarker for CompositionMode {
1900        type Owned = Self;
1901
1902        #[inline(always)]
1903        fn inline_align(_context: fidl::encoding::Context) -> usize {
1904            std::mem::align_of::<u32>()
1905        }
1906
1907        #[inline(always)]
1908        fn inline_size(_context: fidl::encoding::Context) -> usize {
1909            std::mem::size_of::<u32>()
1910        }
1911
1912        #[inline(always)]
1913        fn encode_is_copy() -> bool {
1914            true
1915        }
1916
1917        #[inline(always)]
1918        fn decode_is_copy() -> bool {
1919            false
1920        }
1921    }
1922
1923    impl fidl::encoding::ValueTypeMarker for CompositionMode {
1924        type Borrowed<'a> = Self;
1925        #[inline(always)]
1926        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1927            *value
1928        }
1929    }
1930
1931    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1932        for CompositionMode
1933    {
1934        #[inline]
1935        unsafe fn encode(
1936            self,
1937            encoder: &mut fidl::encoding::Encoder<'_, D>,
1938            offset: usize,
1939            _depth: fidl::encoding::Depth,
1940        ) -> fidl::Result<()> {
1941            encoder.debug_check_bounds::<Self>(offset);
1942            encoder.write_num(self.into_primitive(), offset);
1943            Ok(())
1944        }
1945    }
1946
1947    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CompositionMode {
1948        #[inline(always)]
1949        fn new_empty() -> Self {
1950            Self::Invisible
1951        }
1952
1953        #[inline]
1954        unsafe fn decode(
1955            &mut self,
1956            decoder: &mut fidl::encoding::Decoder<'_, D>,
1957            offset: usize,
1958            _depth: fidl::encoding::Depth,
1959        ) -> fidl::Result<()> {
1960            decoder.debug_check_bounds::<Self>(offset);
1961            let prim = decoder.read_num::<u32>(offset);
1962
1963            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1964            Ok(())
1965        }
1966    }
1967    unsafe impl fidl::encoding::TypeMarker for FlatlandError {
1968        type Owned = Self;
1969
1970        #[inline(always)]
1971        fn inline_align(_context: fidl::encoding::Context) -> usize {
1972            std::mem::align_of::<u32>()
1973        }
1974
1975        #[inline(always)]
1976        fn inline_size(_context: fidl::encoding::Context) -> usize {
1977            std::mem::size_of::<u32>()
1978        }
1979
1980        #[inline(always)]
1981        fn encode_is_copy() -> bool {
1982            true
1983        }
1984
1985        #[inline(always)]
1986        fn decode_is_copy() -> bool {
1987            false
1988        }
1989    }
1990
1991    impl fidl::encoding::ValueTypeMarker for FlatlandError {
1992        type Borrowed<'a> = Self;
1993        #[inline(always)]
1994        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1995            *value
1996        }
1997    }
1998
1999    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FlatlandError {
2000        #[inline]
2001        unsafe fn encode(
2002            self,
2003            encoder: &mut fidl::encoding::Encoder<'_, D>,
2004            offset: usize,
2005            _depth: fidl::encoding::Depth,
2006        ) -> fidl::Result<()> {
2007            encoder.debug_check_bounds::<Self>(offset);
2008            encoder.write_num(self.into_primitive(), offset);
2009            Ok(())
2010        }
2011    }
2012
2013    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FlatlandError {
2014        #[inline(always)]
2015        fn new_empty() -> Self {
2016            Self::BadOperation
2017        }
2018
2019        #[inline]
2020        unsafe fn decode(
2021            &mut self,
2022            decoder: &mut fidl::encoding::Decoder<'_, D>,
2023            offset: usize,
2024            _depth: fidl::encoding::Depth,
2025        ) -> fidl::Result<()> {
2026            decoder.debug_check_bounds::<Self>(offset);
2027            let prim = decoder.read_num::<u32>(offset);
2028
2029            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2030            Ok(())
2031        }
2032    }
2033    unsafe impl fidl::encoding::TypeMarker for FlatlandFactoryError {
2034        type Owned = Self;
2035
2036        #[inline(always)]
2037        fn inline_align(_context: fidl::encoding::Context) -> usize {
2038            std::mem::align_of::<u32>()
2039        }
2040
2041        #[inline(always)]
2042        fn inline_size(_context: fidl::encoding::Context) -> usize {
2043            std::mem::size_of::<u32>()
2044        }
2045
2046        #[inline(always)]
2047        fn encode_is_copy() -> bool {
2048            false
2049        }
2050
2051        #[inline(always)]
2052        fn decode_is_copy() -> bool {
2053            false
2054        }
2055    }
2056
2057    impl fidl::encoding::ValueTypeMarker for FlatlandFactoryError {
2058        type Borrowed<'a> = Self;
2059        #[inline(always)]
2060        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2061            *value
2062        }
2063    }
2064
2065    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2066        for FlatlandFactoryError
2067    {
2068        #[inline]
2069        unsafe fn encode(
2070            self,
2071            encoder: &mut fidl::encoding::Encoder<'_, D>,
2072            offset: usize,
2073            _depth: fidl::encoding::Depth,
2074        ) -> fidl::Result<()> {
2075            encoder.debug_check_bounds::<Self>(offset);
2076            encoder.write_num(self.into_primitive(), offset);
2077            Ok(())
2078        }
2079    }
2080
2081    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FlatlandFactoryError {
2082        #[inline(always)]
2083        fn new_empty() -> Self {
2084            Self::unknown()
2085        }
2086
2087        #[inline]
2088        unsafe fn decode(
2089            &mut self,
2090            decoder: &mut fidl::encoding::Decoder<'_, D>,
2091            offset: usize,
2092            _depth: fidl::encoding::Depth,
2093        ) -> fidl::Result<()> {
2094            decoder.debug_check_bounds::<Self>(offset);
2095            let prim = decoder.read_num::<u32>(offset);
2096
2097            *self = Self::from_primitive_allow_unknown(prim);
2098            Ok(())
2099        }
2100    }
2101    unsafe impl fidl::encoding::TypeMarker for HitTestInteraction {
2102        type Owned = Self;
2103
2104        #[inline(always)]
2105        fn inline_align(_context: fidl::encoding::Context) -> usize {
2106            std::mem::align_of::<u8>()
2107        }
2108
2109        #[inline(always)]
2110        fn inline_size(_context: fidl::encoding::Context) -> usize {
2111            std::mem::size_of::<u8>()
2112        }
2113
2114        #[inline(always)]
2115        fn encode_is_copy() -> bool {
2116            false
2117        }
2118
2119        #[inline(always)]
2120        fn decode_is_copy() -> bool {
2121            false
2122        }
2123    }
2124
2125    impl fidl::encoding::ValueTypeMarker for HitTestInteraction {
2126        type Borrowed<'a> = Self;
2127        #[inline(always)]
2128        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2129            *value
2130        }
2131    }
2132
2133    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2134        for HitTestInteraction
2135    {
2136        #[inline]
2137        unsafe fn encode(
2138            self,
2139            encoder: &mut fidl::encoding::Encoder<'_, D>,
2140            offset: usize,
2141            _depth: fidl::encoding::Depth,
2142        ) -> fidl::Result<()> {
2143            encoder.debug_check_bounds::<Self>(offset);
2144            encoder.write_num(self.into_primitive(), offset);
2145            Ok(())
2146        }
2147    }
2148
2149    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HitTestInteraction {
2150        #[inline(always)]
2151        fn new_empty() -> Self {
2152            Self::unknown()
2153        }
2154
2155        #[inline]
2156        unsafe fn decode(
2157            &mut self,
2158            decoder: &mut fidl::encoding::Decoder<'_, D>,
2159            offset: usize,
2160            _depth: fidl::encoding::Depth,
2161        ) -> fidl::Result<()> {
2162            decoder.debug_check_bounds::<Self>(offset);
2163            let prim = decoder.read_num::<u8>(offset);
2164
2165            *self = Self::from_primitive_allow_unknown(prim);
2166            Ok(())
2167        }
2168    }
2169    unsafe impl fidl::encoding::TypeMarker for ImageFlip {
2170        type Owned = Self;
2171
2172        #[inline(always)]
2173        fn inline_align(_context: fidl::encoding::Context) -> usize {
2174            std::mem::align_of::<u32>()
2175        }
2176
2177        #[inline(always)]
2178        fn inline_size(_context: fidl::encoding::Context) -> usize {
2179            std::mem::size_of::<u32>()
2180        }
2181
2182        #[inline(always)]
2183        fn encode_is_copy() -> bool {
2184            true
2185        }
2186
2187        #[inline(always)]
2188        fn decode_is_copy() -> bool {
2189            false
2190        }
2191    }
2192
2193    impl fidl::encoding::ValueTypeMarker for ImageFlip {
2194        type Borrowed<'a> = Self;
2195        #[inline(always)]
2196        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2197            *value
2198        }
2199    }
2200
2201    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ImageFlip {
2202        #[inline]
2203        unsafe fn encode(
2204            self,
2205            encoder: &mut fidl::encoding::Encoder<'_, D>,
2206            offset: usize,
2207            _depth: fidl::encoding::Depth,
2208        ) -> fidl::Result<()> {
2209            encoder.debug_check_bounds::<Self>(offset);
2210            encoder.write_num(self.into_primitive(), offset);
2211            Ok(())
2212        }
2213    }
2214
2215    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageFlip {
2216        #[inline(always)]
2217        fn new_empty() -> Self {
2218            Self::None
2219        }
2220
2221        #[inline]
2222        unsafe fn decode(
2223            &mut self,
2224            decoder: &mut fidl::encoding::Decoder<'_, D>,
2225            offset: usize,
2226            _depth: fidl::encoding::Depth,
2227        ) -> fidl::Result<()> {
2228            decoder.debug_check_bounds::<Self>(offset);
2229            let prim = decoder.read_num::<u32>(offset);
2230
2231            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2232            Ok(())
2233        }
2234    }
2235    unsafe impl fidl::encoding::TypeMarker for Orientation {
2236        type Owned = Self;
2237
2238        #[inline(always)]
2239        fn inline_align(_context: fidl::encoding::Context) -> usize {
2240            std::mem::align_of::<u32>()
2241        }
2242
2243        #[inline(always)]
2244        fn inline_size(_context: fidl::encoding::Context) -> usize {
2245            std::mem::size_of::<u32>()
2246        }
2247
2248        #[inline(always)]
2249        fn encode_is_copy() -> bool {
2250            true
2251        }
2252
2253        #[inline(always)]
2254        fn decode_is_copy() -> bool {
2255            false
2256        }
2257    }
2258
2259    impl fidl::encoding::ValueTypeMarker for Orientation {
2260        type Borrowed<'a> = Self;
2261        #[inline(always)]
2262        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2263            *value
2264        }
2265    }
2266
2267    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Orientation {
2268        #[inline]
2269        unsafe fn encode(
2270            self,
2271            encoder: &mut fidl::encoding::Encoder<'_, D>,
2272            offset: usize,
2273            _depth: fidl::encoding::Depth,
2274        ) -> fidl::Result<()> {
2275            encoder.debug_check_bounds::<Self>(offset);
2276            encoder.write_num(self.into_primitive(), offset);
2277            Ok(())
2278        }
2279    }
2280
2281    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Orientation {
2282        #[inline(always)]
2283        fn new_empty() -> Self {
2284            Self::Ccw0Degrees
2285        }
2286
2287        #[inline]
2288        unsafe fn decode(
2289            &mut self,
2290            decoder: &mut fidl::encoding::Decoder<'_, D>,
2291            offset: usize,
2292            _depth: fidl::encoding::Depth,
2293        ) -> fidl::Result<()> {
2294            decoder.debug_check_bounds::<Self>(offset);
2295            let prim = decoder.read_num::<u32>(offset);
2296
2297            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2298            Ok(())
2299        }
2300    }
2301    unsafe impl fidl::encoding::TypeMarker for ParentViewportStatus {
2302        type Owned = Self;
2303
2304        #[inline(always)]
2305        fn inline_align(_context: fidl::encoding::Context) -> usize {
2306            std::mem::align_of::<u32>()
2307        }
2308
2309        #[inline(always)]
2310        fn inline_size(_context: fidl::encoding::Context) -> usize {
2311            std::mem::size_of::<u32>()
2312        }
2313
2314        #[inline(always)]
2315        fn encode_is_copy() -> bool {
2316            true
2317        }
2318
2319        #[inline(always)]
2320        fn decode_is_copy() -> bool {
2321            false
2322        }
2323    }
2324
2325    impl fidl::encoding::ValueTypeMarker for ParentViewportStatus {
2326        type Borrowed<'a> = Self;
2327        #[inline(always)]
2328        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2329            *value
2330        }
2331    }
2332
2333    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2334        for ParentViewportStatus
2335    {
2336        #[inline]
2337        unsafe fn encode(
2338            self,
2339            encoder: &mut fidl::encoding::Encoder<'_, D>,
2340            offset: usize,
2341            _depth: fidl::encoding::Depth,
2342        ) -> fidl::Result<()> {
2343            encoder.debug_check_bounds::<Self>(offset);
2344            encoder.write_num(self.into_primitive(), offset);
2345            Ok(())
2346        }
2347    }
2348
2349    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ParentViewportStatus {
2350        #[inline(always)]
2351        fn new_empty() -> Self {
2352            Self::ConnectedToDisplay
2353        }
2354
2355        #[inline]
2356        unsafe fn decode(
2357            &mut self,
2358            decoder: &mut fidl::encoding::Decoder<'_, D>,
2359            offset: usize,
2360            _depth: fidl::encoding::Depth,
2361        ) -> fidl::Result<()> {
2362            decoder.debug_check_bounds::<Self>(offset);
2363            let prim = decoder.read_num::<u32>(offset);
2364
2365            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2366            Ok(())
2367        }
2368    }
2369    unsafe impl fidl::encoding::TypeMarker for RegisterBufferCollectionError {
2370        type Owned = Self;
2371
2372        #[inline(always)]
2373        fn inline_align(_context: fidl::encoding::Context) -> usize {
2374            std::mem::align_of::<u32>()
2375        }
2376
2377        #[inline(always)]
2378        fn inline_size(_context: fidl::encoding::Context) -> usize {
2379            std::mem::size_of::<u32>()
2380        }
2381
2382        #[inline(always)]
2383        fn encode_is_copy() -> bool {
2384            true
2385        }
2386
2387        #[inline(always)]
2388        fn decode_is_copy() -> bool {
2389            false
2390        }
2391    }
2392
2393    impl fidl::encoding::ValueTypeMarker for RegisterBufferCollectionError {
2394        type Borrowed<'a> = Self;
2395        #[inline(always)]
2396        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2397            *value
2398        }
2399    }
2400
2401    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2402        for RegisterBufferCollectionError
2403    {
2404        #[inline]
2405        unsafe fn encode(
2406            self,
2407            encoder: &mut fidl::encoding::Encoder<'_, D>,
2408            offset: usize,
2409            _depth: fidl::encoding::Depth,
2410        ) -> fidl::Result<()> {
2411            encoder.debug_check_bounds::<Self>(offset);
2412            encoder.write_num(self.into_primitive(), offset);
2413            Ok(())
2414        }
2415    }
2416
2417    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2418        for RegisterBufferCollectionError
2419    {
2420        #[inline(always)]
2421        fn new_empty() -> Self {
2422            Self::BadOperation
2423        }
2424
2425        #[inline]
2426        unsafe fn decode(
2427            &mut self,
2428            decoder: &mut fidl::encoding::Decoder<'_, D>,
2429            offset: usize,
2430            _depth: fidl::encoding::Depth,
2431        ) -> fidl::Result<()> {
2432            decoder.debug_check_bounds::<Self>(offset);
2433            let prim = decoder.read_num::<u32>(offset);
2434
2435            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2436            Ok(())
2437        }
2438    }
2439    unsafe impl fidl::encoding::TypeMarker for RegisterBufferCollectionUsage {
2440        type Owned = Self;
2441
2442        #[inline(always)]
2443        fn inline_align(_context: fidl::encoding::Context) -> usize {
2444            std::mem::align_of::<u32>()
2445        }
2446
2447        #[inline(always)]
2448        fn inline_size(_context: fidl::encoding::Context) -> usize {
2449            std::mem::size_of::<u32>()
2450        }
2451
2452        #[inline(always)]
2453        fn encode_is_copy() -> bool {
2454            true
2455        }
2456
2457        #[inline(always)]
2458        fn decode_is_copy() -> bool {
2459            false
2460        }
2461    }
2462
2463    impl fidl::encoding::ValueTypeMarker for RegisterBufferCollectionUsage {
2464        type Borrowed<'a> = Self;
2465        #[inline(always)]
2466        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2467            *value
2468        }
2469    }
2470
2471    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2472        for RegisterBufferCollectionUsage
2473    {
2474        #[inline]
2475        unsafe fn encode(
2476            self,
2477            encoder: &mut fidl::encoding::Encoder<'_, D>,
2478            offset: usize,
2479            _depth: fidl::encoding::Depth,
2480        ) -> fidl::Result<()> {
2481            encoder.debug_check_bounds::<Self>(offset);
2482            encoder.write_num(self.into_primitive(), offset);
2483            Ok(())
2484        }
2485    }
2486
2487    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2488        for RegisterBufferCollectionUsage
2489    {
2490        #[inline(always)]
2491        fn new_empty() -> Self {
2492            Self::Default
2493        }
2494
2495        #[inline]
2496        unsafe fn decode(
2497            &mut self,
2498            decoder: &mut fidl::encoding::Decoder<'_, D>,
2499            offset: usize,
2500            _depth: fidl::encoding::Depth,
2501        ) -> fidl::Result<()> {
2502            decoder.debug_check_bounds::<Self>(offset);
2503            let prim = decoder.read_num::<u32>(offset);
2504
2505            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2506            Ok(())
2507        }
2508    }
2509    unsafe impl fidl::encoding::TypeMarker for Rotation {
2510        type Owned = Self;
2511
2512        #[inline(always)]
2513        fn inline_align(_context: fidl::encoding::Context) -> usize {
2514            std::mem::align_of::<u32>()
2515        }
2516
2517        #[inline(always)]
2518        fn inline_size(_context: fidl::encoding::Context) -> usize {
2519            std::mem::size_of::<u32>()
2520        }
2521
2522        #[inline(always)]
2523        fn encode_is_copy() -> bool {
2524            true
2525        }
2526
2527        #[inline(always)]
2528        fn decode_is_copy() -> bool {
2529            false
2530        }
2531    }
2532
2533    impl fidl::encoding::ValueTypeMarker for Rotation {
2534        type Borrowed<'a> = Self;
2535        #[inline(always)]
2536        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2537            *value
2538        }
2539    }
2540
2541    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Rotation {
2542        #[inline]
2543        unsafe fn encode(
2544            self,
2545            encoder: &mut fidl::encoding::Encoder<'_, D>,
2546            offset: usize,
2547            _depth: fidl::encoding::Depth,
2548        ) -> fidl::Result<()> {
2549            encoder.debug_check_bounds::<Self>(offset);
2550            encoder.write_num(self.into_primitive(), offset);
2551            Ok(())
2552        }
2553    }
2554
2555    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Rotation {
2556        #[inline(always)]
2557        fn new_empty() -> Self {
2558            Self::Cw0Degrees
2559        }
2560
2561        #[inline]
2562        unsafe fn decode(
2563            &mut self,
2564            decoder: &mut fidl::encoding::Decoder<'_, D>,
2565            offset: usize,
2566            _depth: fidl::encoding::Depth,
2567        ) -> fidl::Result<()> {
2568            decoder.debug_check_bounds::<Self>(offset);
2569            let prim = decoder.read_num::<u32>(offset);
2570
2571            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2572            Ok(())
2573        }
2574    }
2575    unsafe impl fidl::encoding::TypeMarker for ScreenCaptureError {
2576        type Owned = Self;
2577
2578        #[inline(always)]
2579        fn inline_align(_context: fidl::encoding::Context) -> usize {
2580            std::mem::align_of::<u32>()
2581        }
2582
2583        #[inline(always)]
2584        fn inline_size(_context: fidl::encoding::Context) -> usize {
2585            std::mem::size_of::<u32>()
2586        }
2587
2588        #[inline(always)]
2589        fn encode_is_copy() -> bool {
2590            false
2591        }
2592
2593        #[inline(always)]
2594        fn decode_is_copy() -> bool {
2595            false
2596        }
2597    }
2598
2599    impl fidl::encoding::ValueTypeMarker for ScreenCaptureError {
2600        type Borrowed<'a> = Self;
2601        #[inline(always)]
2602        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2603            *value
2604        }
2605    }
2606
2607    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2608        for ScreenCaptureError
2609    {
2610        #[inline]
2611        unsafe fn encode(
2612            self,
2613            encoder: &mut fidl::encoding::Encoder<'_, D>,
2614            offset: usize,
2615            _depth: fidl::encoding::Depth,
2616        ) -> fidl::Result<()> {
2617            encoder.debug_check_bounds::<Self>(offset);
2618            encoder.write_num(self.into_primitive(), offset);
2619            Ok(())
2620        }
2621    }
2622
2623    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScreenCaptureError {
2624        #[inline(always)]
2625        fn new_empty() -> Self {
2626            Self::unknown()
2627        }
2628
2629        #[inline]
2630        unsafe fn decode(
2631            &mut self,
2632            decoder: &mut fidl::encoding::Decoder<'_, D>,
2633            offset: usize,
2634            _depth: fidl::encoding::Depth,
2635        ) -> fidl::Result<()> {
2636            decoder.debug_check_bounds::<Self>(offset);
2637            let prim = decoder.read_num::<u32>(offset);
2638
2639            *self = Self::from_primitive_allow_unknown(prim);
2640            Ok(())
2641        }
2642    }
2643    unsafe impl fidl::encoding::TypeMarker for ScreenshotFormat {
2644        type Owned = Self;
2645
2646        #[inline(always)]
2647        fn inline_align(_context: fidl::encoding::Context) -> usize {
2648            std::mem::align_of::<u8>()
2649        }
2650
2651        #[inline(always)]
2652        fn inline_size(_context: fidl::encoding::Context) -> usize {
2653            std::mem::size_of::<u8>()
2654        }
2655
2656        #[inline(always)]
2657        fn encode_is_copy() -> bool {
2658            false
2659        }
2660
2661        #[inline(always)]
2662        fn decode_is_copy() -> bool {
2663            false
2664        }
2665    }
2666
2667    impl fidl::encoding::ValueTypeMarker for ScreenshotFormat {
2668        type Borrowed<'a> = Self;
2669        #[inline(always)]
2670        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2671            *value
2672        }
2673    }
2674
2675    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2676        for ScreenshotFormat
2677    {
2678        #[inline]
2679        unsafe fn encode(
2680            self,
2681            encoder: &mut fidl::encoding::Encoder<'_, D>,
2682            offset: usize,
2683            _depth: fidl::encoding::Depth,
2684        ) -> fidl::Result<()> {
2685            encoder.debug_check_bounds::<Self>(offset);
2686            encoder.write_num(self.into_primitive(), offset);
2687            Ok(())
2688        }
2689    }
2690
2691    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScreenshotFormat {
2692        #[inline(always)]
2693        fn new_empty() -> Self {
2694            Self::unknown()
2695        }
2696
2697        #[inline]
2698        unsafe fn decode(
2699            &mut self,
2700            decoder: &mut fidl::encoding::Decoder<'_, D>,
2701            offset: usize,
2702            _depth: fidl::encoding::Depth,
2703        ) -> fidl::Result<()> {
2704            decoder.debug_check_bounds::<Self>(offset);
2705            let prim = decoder.read_num::<u8>(offset);
2706
2707            *self = Self::from_primitive_allow_unknown(prim);
2708            Ok(())
2709        }
2710    }
2711    unsafe impl fidl::encoding::TypeMarker for TrustedFlatlandFactoryError {
2712        type Owned = Self;
2713
2714        #[inline(always)]
2715        fn inline_align(_context: fidl::encoding::Context) -> usize {
2716            std::mem::align_of::<u32>()
2717        }
2718
2719        #[inline(always)]
2720        fn inline_size(_context: fidl::encoding::Context) -> usize {
2721            std::mem::size_of::<u32>()
2722        }
2723
2724        #[inline(always)]
2725        fn encode_is_copy() -> bool {
2726            false
2727        }
2728
2729        #[inline(always)]
2730        fn decode_is_copy() -> bool {
2731            false
2732        }
2733    }
2734
2735    impl fidl::encoding::ValueTypeMarker for TrustedFlatlandFactoryError {
2736        type Borrowed<'a> = Self;
2737        #[inline(always)]
2738        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2739            *value
2740        }
2741    }
2742
2743    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2744        for TrustedFlatlandFactoryError
2745    {
2746        #[inline]
2747        unsafe fn encode(
2748            self,
2749            encoder: &mut fidl::encoding::Encoder<'_, D>,
2750            offset: usize,
2751            _depth: fidl::encoding::Depth,
2752        ) -> fidl::Result<()> {
2753            encoder.debug_check_bounds::<Self>(offset);
2754            encoder.write_num(self.into_primitive(), offset);
2755            Ok(())
2756        }
2757    }
2758
2759    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2760        for TrustedFlatlandFactoryError
2761    {
2762        #[inline(always)]
2763        fn new_empty() -> Self {
2764            Self::unknown()
2765        }
2766
2767        #[inline]
2768        unsafe fn decode(
2769            &mut self,
2770            decoder: &mut fidl::encoding::Decoder<'_, D>,
2771            offset: usize,
2772            _depth: fidl::encoding::Depth,
2773        ) -> fidl::Result<()> {
2774            decoder.debug_check_bounds::<Self>(offset);
2775            let prim = decoder.read_num::<u32>(offset);
2776
2777            *self = Self::from_primitive_allow_unknown(prim);
2778            Ok(())
2779        }
2780    }
2781
2782    impl fidl::encoding::ValueTypeMarker for ChildViewWatcherGetStatusResponse {
2783        type Borrowed<'a> = &'a Self;
2784        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2785            value
2786        }
2787    }
2788
2789    unsafe impl fidl::encoding::TypeMarker for ChildViewWatcherGetStatusResponse {
2790        type Owned = Self;
2791
2792        #[inline(always)]
2793        fn inline_align(_context: fidl::encoding::Context) -> usize {
2794            4
2795        }
2796
2797        #[inline(always)]
2798        fn inline_size(_context: fidl::encoding::Context) -> usize {
2799            4
2800        }
2801    }
2802
2803    unsafe impl<D: fidl::encoding::ResourceDialect>
2804        fidl::encoding::Encode<ChildViewWatcherGetStatusResponse, D>
2805        for &ChildViewWatcherGetStatusResponse
2806    {
2807        #[inline]
2808        unsafe fn encode(
2809            self,
2810            encoder: &mut fidl::encoding::Encoder<'_, D>,
2811            offset: usize,
2812            _depth: fidl::encoding::Depth,
2813        ) -> fidl::Result<()> {
2814            encoder.debug_check_bounds::<ChildViewWatcherGetStatusResponse>(offset);
2815            // Delegate to tuple encoding.
2816            fidl::encoding::Encode::<ChildViewWatcherGetStatusResponse, D>::encode(
2817                (<ChildViewStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
2818                encoder,
2819                offset,
2820                _depth,
2821            )
2822        }
2823    }
2824    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ChildViewStatus, D>>
2825        fidl::encoding::Encode<ChildViewWatcherGetStatusResponse, D> for (T0,)
2826    {
2827        #[inline]
2828        unsafe fn encode(
2829            self,
2830            encoder: &mut fidl::encoding::Encoder<'_, D>,
2831            offset: usize,
2832            depth: fidl::encoding::Depth,
2833        ) -> fidl::Result<()> {
2834            encoder.debug_check_bounds::<ChildViewWatcherGetStatusResponse>(offset);
2835            // Zero out padding regions. There's no need to apply masks
2836            // because the unmasked parts will be overwritten by fields.
2837            // Write the fields.
2838            self.0.encode(encoder, offset + 0, depth)?;
2839            Ok(())
2840        }
2841    }
2842
2843    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2844        for ChildViewWatcherGetStatusResponse
2845    {
2846        #[inline(always)]
2847        fn new_empty() -> Self {
2848            Self { status: fidl::new_empty!(ChildViewStatus, D) }
2849        }
2850
2851        #[inline]
2852        unsafe fn decode(
2853            &mut self,
2854            decoder: &mut fidl::encoding::Decoder<'_, D>,
2855            offset: usize,
2856            _depth: fidl::encoding::Depth,
2857        ) -> fidl::Result<()> {
2858            decoder.debug_check_bounds::<Self>(offset);
2859            // Verify that padding bytes are zero.
2860            fidl::decode!(ChildViewStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
2861            Ok(())
2862        }
2863    }
2864
2865    impl fidl::encoding::ValueTypeMarker for ColorRgba {
2866        type Borrowed<'a> = &'a Self;
2867        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2868            value
2869        }
2870    }
2871
2872    unsafe impl fidl::encoding::TypeMarker for ColorRgba {
2873        type Owned = Self;
2874
2875        #[inline(always)]
2876        fn inline_align(_context: fidl::encoding::Context) -> usize {
2877            4
2878        }
2879
2880        #[inline(always)]
2881        fn inline_size(_context: fidl::encoding::Context) -> usize {
2882            16
2883        }
2884    }
2885
2886    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ColorRgba, D>
2887        for &ColorRgba
2888    {
2889        #[inline]
2890        unsafe fn encode(
2891            self,
2892            encoder: &mut fidl::encoding::Encoder<'_, D>,
2893            offset: usize,
2894            _depth: fidl::encoding::Depth,
2895        ) -> fidl::Result<()> {
2896            encoder.debug_check_bounds::<ColorRgba>(offset);
2897            // Delegate to tuple encoding.
2898            fidl::encoding::Encode::<ColorRgba, D>::encode(
2899                (
2900                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.red),
2901                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.green),
2902                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.blue),
2903                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.alpha),
2904                ),
2905                encoder,
2906                offset,
2907                _depth,
2908            )
2909        }
2910    }
2911    unsafe impl<
2912        D: fidl::encoding::ResourceDialect,
2913        T0: fidl::encoding::Encode<f32, D>,
2914        T1: fidl::encoding::Encode<f32, D>,
2915        T2: fidl::encoding::Encode<f32, D>,
2916        T3: fidl::encoding::Encode<f32, D>,
2917    > fidl::encoding::Encode<ColorRgba, D> for (T0, T1, T2, T3)
2918    {
2919        #[inline]
2920        unsafe fn encode(
2921            self,
2922            encoder: &mut fidl::encoding::Encoder<'_, D>,
2923            offset: usize,
2924            depth: fidl::encoding::Depth,
2925        ) -> fidl::Result<()> {
2926            encoder.debug_check_bounds::<ColorRgba>(offset);
2927            // Zero out padding regions. There's no need to apply masks
2928            // because the unmasked parts will be overwritten by fields.
2929            // Write the fields.
2930            self.0.encode(encoder, offset + 0, depth)?;
2931            self.1.encode(encoder, offset + 4, depth)?;
2932            self.2.encode(encoder, offset + 8, depth)?;
2933            self.3.encode(encoder, offset + 12, depth)?;
2934            Ok(())
2935        }
2936    }
2937
2938    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorRgba {
2939        #[inline(always)]
2940        fn new_empty() -> Self {
2941            Self {
2942                red: fidl::new_empty!(f32, D),
2943                green: fidl::new_empty!(f32, D),
2944                blue: fidl::new_empty!(f32, D),
2945                alpha: fidl::new_empty!(f32, D),
2946            }
2947        }
2948
2949        #[inline]
2950        unsafe fn decode(
2951            &mut self,
2952            decoder: &mut fidl::encoding::Decoder<'_, D>,
2953            offset: usize,
2954            _depth: fidl::encoding::Depth,
2955        ) -> fidl::Result<()> {
2956            decoder.debug_check_bounds::<Self>(offset);
2957            // Verify that padding bytes are zero.
2958            fidl::decode!(f32, D, &mut self.red, decoder, offset + 0, _depth)?;
2959            fidl::decode!(f32, D, &mut self.green, decoder, offset + 4, _depth)?;
2960            fidl::decode!(f32, D, &mut self.blue, decoder, offset + 8, _depth)?;
2961            fidl::decode!(f32, D, &mut self.alpha, decoder, offset + 12, _depth)?;
2962            Ok(())
2963        }
2964    }
2965
2966    impl fidl::encoding::ValueTypeMarker for ContentId {
2967        type Borrowed<'a> = &'a Self;
2968        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2969            value
2970        }
2971    }
2972
2973    unsafe impl fidl::encoding::TypeMarker for ContentId {
2974        type Owned = Self;
2975
2976        #[inline(always)]
2977        fn inline_align(_context: fidl::encoding::Context) -> usize {
2978            8
2979        }
2980
2981        #[inline(always)]
2982        fn inline_size(_context: fidl::encoding::Context) -> usize {
2983            8
2984        }
2985        #[inline(always)]
2986        fn encode_is_copy() -> bool {
2987            true
2988        }
2989
2990        #[inline(always)]
2991        fn decode_is_copy() -> bool {
2992            true
2993        }
2994    }
2995
2996    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ContentId, D>
2997        for &ContentId
2998    {
2999        #[inline]
3000        unsafe fn encode(
3001            self,
3002            encoder: &mut fidl::encoding::Encoder<'_, D>,
3003            offset: usize,
3004            _depth: fidl::encoding::Depth,
3005        ) -> fidl::Result<()> {
3006            encoder.debug_check_bounds::<ContentId>(offset);
3007            unsafe {
3008                // Copy the object into the buffer.
3009                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3010                (buf_ptr as *mut ContentId).write_unaligned((self as *const ContentId).read());
3011                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3012                // done second because the memcpy will write garbage to these bytes.
3013            }
3014            Ok(())
3015        }
3016    }
3017    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
3018        fidl::encoding::Encode<ContentId, D> for (T0,)
3019    {
3020        #[inline]
3021        unsafe fn encode(
3022            self,
3023            encoder: &mut fidl::encoding::Encoder<'_, D>,
3024            offset: usize,
3025            depth: fidl::encoding::Depth,
3026        ) -> fidl::Result<()> {
3027            encoder.debug_check_bounds::<ContentId>(offset);
3028            // Zero out padding regions. There's no need to apply masks
3029            // because the unmasked parts will be overwritten by fields.
3030            // Write the fields.
3031            self.0.encode(encoder, offset + 0, depth)?;
3032            Ok(())
3033        }
3034    }
3035
3036    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ContentId {
3037        #[inline(always)]
3038        fn new_empty() -> Self {
3039            Self { value: fidl::new_empty!(u64, D) }
3040        }
3041
3042        #[inline]
3043        unsafe fn decode(
3044            &mut self,
3045            decoder: &mut fidl::encoding::Decoder<'_, D>,
3046            offset: usize,
3047            _depth: fidl::encoding::Depth,
3048        ) -> fidl::Result<()> {
3049            decoder.debug_check_bounds::<Self>(offset);
3050            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3051            // Verify that padding bytes are zero.
3052            // Copy from the buffer into the object.
3053            unsafe {
3054                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3055            }
3056            Ok(())
3057        }
3058    }
3059
3060    impl fidl::encoding::ValueTypeMarker for Flatland2CreateLayerRequest {
3061        type Borrowed<'a> = &'a Self;
3062        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3063            value
3064        }
3065    }
3066
3067    unsafe impl fidl::encoding::TypeMarker for Flatland2CreateLayerRequest {
3068        type Owned = Self;
3069
3070        #[inline(always)]
3071        fn inline_align(_context: fidl::encoding::Context) -> usize {
3072            8
3073        }
3074
3075        #[inline(always)]
3076        fn inline_size(_context: fidl::encoding::Context) -> usize {
3077            8
3078        }
3079        #[inline(always)]
3080        fn encode_is_copy() -> bool {
3081            true
3082        }
3083
3084        #[inline(always)]
3085        fn decode_is_copy() -> bool {
3086            true
3087        }
3088    }
3089
3090    unsafe impl<D: fidl::encoding::ResourceDialect>
3091        fidl::encoding::Encode<Flatland2CreateLayerRequest, D> for &Flatland2CreateLayerRequest
3092    {
3093        #[inline]
3094        unsafe fn encode(
3095            self,
3096            encoder: &mut fidl::encoding::Encoder<'_, D>,
3097            offset: usize,
3098            _depth: fidl::encoding::Depth,
3099        ) -> fidl::Result<()> {
3100            encoder.debug_check_bounds::<Flatland2CreateLayerRequest>(offset);
3101            unsafe {
3102                // Copy the object into the buffer.
3103                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3104                (buf_ptr as *mut Flatland2CreateLayerRequest)
3105                    .write_unaligned((self as *const Flatland2CreateLayerRequest).read());
3106                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3107                // done second because the memcpy will write garbage to these bytes.
3108            }
3109            Ok(())
3110        }
3111    }
3112    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LayerId, D>>
3113        fidl::encoding::Encode<Flatland2CreateLayerRequest, D> for (T0,)
3114    {
3115        #[inline]
3116        unsafe fn encode(
3117            self,
3118            encoder: &mut fidl::encoding::Encoder<'_, D>,
3119            offset: usize,
3120            depth: fidl::encoding::Depth,
3121        ) -> fidl::Result<()> {
3122            encoder.debug_check_bounds::<Flatland2CreateLayerRequest>(offset);
3123            // Zero out padding regions. There's no need to apply masks
3124            // because the unmasked parts will be overwritten by fields.
3125            // Write the fields.
3126            self.0.encode(encoder, offset + 0, depth)?;
3127            Ok(())
3128        }
3129    }
3130
3131    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3132        for Flatland2CreateLayerRequest
3133    {
3134        #[inline(always)]
3135        fn new_empty() -> Self {
3136            Self { layer_id: fidl::new_empty!(LayerId, D) }
3137        }
3138
3139        #[inline]
3140        unsafe fn decode(
3141            &mut self,
3142            decoder: &mut fidl::encoding::Decoder<'_, D>,
3143            offset: usize,
3144            _depth: fidl::encoding::Depth,
3145        ) -> fidl::Result<()> {
3146            decoder.debug_check_bounds::<Self>(offset);
3147            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3148            // Verify that padding bytes are zero.
3149            // Copy from the buffer into the object.
3150            unsafe {
3151                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3152            }
3153            Ok(())
3154        }
3155    }
3156
3157    impl fidl::encoding::ValueTypeMarker for Flatland2CreateLayerStackRequest {
3158        type Borrowed<'a> = &'a Self;
3159        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3160            value
3161        }
3162    }
3163
3164    unsafe impl fidl::encoding::TypeMarker for Flatland2CreateLayerStackRequest {
3165        type Owned = Self;
3166
3167        #[inline(always)]
3168        fn inline_align(_context: fidl::encoding::Context) -> usize {
3169            8
3170        }
3171
3172        #[inline(always)]
3173        fn inline_size(_context: fidl::encoding::Context) -> usize {
3174            8
3175        }
3176        #[inline(always)]
3177        fn encode_is_copy() -> bool {
3178            true
3179        }
3180
3181        #[inline(always)]
3182        fn decode_is_copy() -> bool {
3183            true
3184        }
3185    }
3186
3187    unsafe impl<D: fidl::encoding::ResourceDialect>
3188        fidl::encoding::Encode<Flatland2CreateLayerStackRequest, D>
3189        for &Flatland2CreateLayerStackRequest
3190    {
3191        #[inline]
3192        unsafe fn encode(
3193            self,
3194            encoder: &mut fidl::encoding::Encoder<'_, D>,
3195            offset: usize,
3196            _depth: fidl::encoding::Depth,
3197        ) -> fidl::Result<()> {
3198            encoder.debug_check_bounds::<Flatland2CreateLayerStackRequest>(offset);
3199            unsafe {
3200                // Copy the object into the buffer.
3201                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3202                (buf_ptr as *mut Flatland2CreateLayerStackRequest)
3203                    .write_unaligned((self as *const Flatland2CreateLayerStackRequest).read());
3204                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3205                // done second because the memcpy will write garbage to these bytes.
3206            }
3207            Ok(())
3208        }
3209    }
3210    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LayerStackId, D>>
3211        fidl::encoding::Encode<Flatland2CreateLayerStackRequest, D> for (T0,)
3212    {
3213        #[inline]
3214        unsafe fn encode(
3215            self,
3216            encoder: &mut fidl::encoding::Encoder<'_, D>,
3217            offset: usize,
3218            depth: fidl::encoding::Depth,
3219        ) -> fidl::Result<()> {
3220            encoder.debug_check_bounds::<Flatland2CreateLayerStackRequest>(offset);
3221            // Zero out padding regions. There's no need to apply masks
3222            // because the unmasked parts will be overwritten by fields.
3223            // Write the fields.
3224            self.0.encode(encoder, offset + 0, depth)?;
3225            Ok(())
3226        }
3227    }
3228
3229    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3230        for Flatland2CreateLayerStackRequest
3231    {
3232        #[inline(always)]
3233        fn new_empty() -> Self {
3234            Self { stack_id: fidl::new_empty!(LayerStackId, D) }
3235        }
3236
3237        #[inline]
3238        unsafe fn decode(
3239            &mut self,
3240            decoder: &mut fidl::encoding::Decoder<'_, D>,
3241            offset: usize,
3242            _depth: fidl::encoding::Depth,
3243        ) -> fidl::Result<()> {
3244            decoder.debug_check_bounds::<Self>(offset);
3245            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3246            // Verify that padding bytes are zero.
3247            // Copy from the buffer into the object.
3248            unsafe {
3249                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3250            }
3251            Ok(())
3252        }
3253    }
3254
3255    impl fidl::encoding::ValueTypeMarker for Flatland2ReleaseImage2Request {
3256        type Borrowed<'a> = &'a Self;
3257        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3258            value
3259        }
3260    }
3261
3262    unsafe impl fidl::encoding::TypeMarker for Flatland2ReleaseImage2Request {
3263        type Owned = Self;
3264
3265        #[inline(always)]
3266        fn inline_align(_context: fidl::encoding::Context) -> usize {
3267            8
3268        }
3269
3270        #[inline(always)]
3271        fn inline_size(_context: fidl::encoding::Context) -> usize {
3272            8
3273        }
3274        #[inline(always)]
3275        fn encode_is_copy() -> bool {
3276            true
3277        }
3278
3279        #[inline(always)]
3280        fn decode_is_copy() -> bool {
3281            true
3282        }
3283    }
3284
3285    unsafe impl<D: fidl::encoding::ResourceDialect>
3286        fidl::encoding::Encode<Flatland2ReleaseImage2Request, D>
3287        for &Flatland2ReleaseImage2Request
3288    {
3289        #[inline]
3290        unsafe fn encode(
3291            self,
3292            encoder: &mut fidl::encoding::Encoder<'_, D>,
3293            offset: usize,
3294            _depth: fidl::encoding::Depth,
3295        ) -> fidl::Result<()> {
3296            encoder.debug_check_bounds::<Flatland2ReleaseImage2Request>(offset);
3297            unsafe {
3298                // Copy the object into the buffer.
3299                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3300                (buf_ptr as *mut Flatland2ReleaseImage2Request)
3301                    .write_unaligned((self as *const Flatland2ReleaseImage2Request).read());
3302                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3303                // done second because the memcpy will write garbage to these bytes.
3304            }
3305            Ok(())
3306        }
3307    }
3308    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ImageId, D>>
3309        fidl::encoding::Encode<Flatland2ReleaseImage2Request, D> for (T0,)
3310    {
3311        #[inline]
3312        unsafe fn encode(
3313            self,
3314            encoder: &mut fidl::encoding::Encoder<'_, D>,
3315            offset: usize,
3316            depth: fidl::encoding::Depth,
3317        ) -> fidl::Result<()> {
3318            encoder.debug_check_bounds::<Flatland2ReleaseImage2Request>(offset);
3319            // Zero out padding regions. There's no need to apply masks
3320            // because the unmasked parts will be overwritten by fields.
3321            // Write the fields.
3322            self.0.encode(encoder, offset + 0, depth)?;
3323            Ok(())
3324        }
3325    }
3326
3327    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3328        for Flatland2ReleaseImage2Request
3329    {
3330        #[inline(always)]
3331        fn new_empty() -> Self {
3332            Self { image_id: fidl::new_empty!(ImageId, D) }
3333        }
3334
3335        #[inline]
3336        unsafe fn decode(
3337            &mut self,
3338            decoder: &mut fidl::encoding::Decoder<'_, D>,
3339            offset: usize,
3340            _depth: fidl::encoding::Depth,
3341        ) -> fidl::Result<()> {
3342            decoder.debug_check_bounds::<Self>(offset);
3343            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3344            // Verify that padding bytes are zero.
3345            // Copy from the buffer into the object.
3346            unsafe {
3347                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3348            }
3349            Ok(())
3350        }
3351    }
3352
3353    impl fidl::encoding::ValueTypeMarker for Flatland2ReleaseLayerRequest {
3354        type Borrowed<'a> = &'a Self;
3355        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3356            value
3357        }
3358    }
3359
3360    unsafe impl fidl::encoding::TypeMarker for Flatland2ReleaseLayerRequest {
3361        type Owned = Self;
3362
3363        #[inline(always)]
3364        fn inline_align(_context: fidl::encoding::Context) -> usize {
3365            8
3366        }
3367
3368        #[inline(always)]
3369        fn inline_size(_context: fidl::encoding::Context) -> usize {
3370            8
3371        }
3372        #[inline(always)]
3373        fn encode_is_copy() -> bool {
3374            true
3375        }
3376
3377        #[inline(always)]
3378        fn decode_is_copy() -> bool {
3379            true
3380        }
3381    }
3382
3383    unsafe impl<D: fidl::encoding::ResourceDialect>
3384        fidl::encoding::Encode<Flatland2ReleaseLayerRequest, D> for &Flatland2ReleaseLayerRequest
3385    {
3386        #[inline]
3387        unsafe fn encode(
3388            self,
3389            encoder: &mut fidl::encoding::Encoder<'_, D>,
3390            offset: usize,
3391            _depth: fidl::encoding::Depth,
3392        ) -> fidl::Result<()> {
3393            encoder.debug_check_bounds::<Flatland2ReleaseLayerRequest>(offset);
3394            unsafe {
3395                // Copy the object into the buffer.
3396                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3397                (buf_ptr as *mut Flatland2ReleaseLayerRequest)
3398                    .write_unaligned((self as *const Flatland2ReleaseLayerRequest).read());
3399                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3400                // done second because the memcpy will write garbage to these bytes.
3401            }
3402            Ok(())
3403        }
3404    }
3405    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LayerId, D>>
3406        fidl::encoding::Encode<Flatland2ReleaseLayerRequest, D> for (T0,)
3407    {
3408        #[inline]
3409        unsafe fn encode(
3410            self,
3411            encoder: &mut fidl::encoding::Encoder<'_, D>,
3412            offset: usize,
3413            depth: fidl::encoding::Depth,
3414        ) -> fidl::Result<()> {
3415            encoder.debug_check_bounds::<Flatland2ReleaseLayerRequest>(offset);
3416            // Zero out padding regions. There's no need to apply masks
3417            // because the unmasked parts will be overwritten by fields.
3418            // Write the fields.
3419            self.0.encode(encoder, offset + 0, depth)?;
3420            Ok(())
3421        }
3422    }
3423
3424    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3425        for Flatland2ReleaseLayerRequest
3426    {
3427        #[inline(always)]
3428        fn new_empty() -> Self {
3429            Self { layer_id: fidl::new_empty!(LayerId, D) }
3430        }
3431
3432        #[inline]
3433        unsafe fn decode(
3434            &mut self,
3435            decoder: &mut fidl::encoding::Decoder<'_, D>,
3436            offset: usize,
3437            _depth: fidl::encoding::Depth,
3438        ) -> fidl::Result<()> {
3439            decoder.debug_check_bounds::<Self>(offset);
3440            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3441            // Verify that padding bytes are zero.
3442            // Copy from the buffer into the object.
3443            unsafe {
3444                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3445            }
3446            Ok(())
3447        }
3448    }
3449
3450    impl fidl::encoding::ValueTypeMarker for Flatland2ReleaseLayerStackRequest {
3451        type Borrowed<'a> = &'a Self;
3452        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3453            value
3454        }
3455    }
3456
3457    unsafe impl fidl::encoding::TypeMarker for Flatland2ReleaseLayerStackRequest {
3458        type Owned = Self;
3459
3460        #[inline(always)]
3461        fn inline_align(_context: fidl::encoding::Context) -> usize {
3462            8
3463        }
3464
3465        #[inline(always)]
3466        fn inline_size(_context: fidl::encoding::Context) -> usize {
3467            8
3468        }
3469        #[inline(always)]
3470        fn encode_is_copy() -> bool {
3471            true
3472        }
3473
3474        #[inline(always)]
3475        fn decode_is_copy() -> bool {
3476            true
3477        }
3478    }
3479
3480    unsafe impl<D: fidl::encoding::ResourceDialect>
3481        fidl::encoding::Encode<Flatland2ReleaseLayerStackRequest, D>
3482        for &Flatland2ReleaseLayerStackRequest
3483    {
3484        #[inline]
3485        unsafe fn encode(
3486            self,
3487            encoder: &mut fidl::encoding::Encoder<'_, D>,
3488            offset: usize,
3489            _depth: fidl::encoding::Depth,
3490        ) -> fidl::Result<()> {
3491            encoder.debug_check_bounds::<Flatland2ReleaseLayerStackRequest>(offset);
3492            unsafe {
3493                // Copy the object into the buffer.
3494                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3495                (buf_ptr as *mut Flatland2ReleaseLayerStackRequest)
3496                    .write_unaligned((self as *const Flatland2ReleaseLayerStackRequest).read());
3497                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3498                // done second because the memcpy will write garbage to these bytes.
3499            }
3500            Ok(())
3501        }
3502    }
3503    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LayerStackId, D>>
3504        fidl::encoding::Encode<Flatland2ReleaseLayerStackRequest, D> for (T0,)
3505    {
3506        #[inline]
3507        unsafe fn encode(
3508            self,
3509            encoder: &mut fidl::encoding::Encoder<'_, D>,
3510            offset: usize,
3511            depth: fidl::encoding::Depth,
3512        ) -> fidl::Result<()> {
3513            encoder.debug_check_bounds::<Flatland2ReleaseLayerStackRequest>(offset);
3514            // Zero out padding regions. There's no need to apply masks
3515            // because the unmasked parts will be overwritten by fields.
3516            // Write the fields.
3517            self.0.encode(encoder, offset + 0, depth)?;
3518            Ok(())
3519        }
3520    }
3521
3522    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3523        for Flatland2ReleaseLayerStackRequest
3524    {
3525        #[inline(always)]
3526        fn new_empty() -> Self {
3527            Self { stack_id: fidl::new_empty!(LayerStackId, D) }
3528        }
3529
3530        #[inline]
3531        unsafe fn decode(
3532            &mut self,
3533            decoder: &mut fidl::encoding::Decoder<'_, D>,
3534            offset: usize,
3535            _depth: fidl::encoding::Depth,
3536        ) -> fidl::Result<()> {
3537            decoder.debug_check_bounds::<Self>(offset);
3538            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3539            // Verify that padding bytes are zero.
3540            // Copy from the buffer into the object.
3541            unsafe {
3542                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3543            }
3544            Ok(())
3545        }
3546    }
3547
3548    impl fidl::encoding::ValueTypeMarker for Flatland2ReleaseViewport2Request {
3549        type Borrowed<'a> = &'a Self;
3550        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3551            value
3552        }
3553    }
3554
3555    unsafe impl fidl::encoding::TypeMarker for Flatland2ReleaseViewport2Request {
3556        type Owned = Self;
3557
3558        #[inline(always)]
3559        fn inline_align(_context: fidl::encoding::Context) -> usize {
3560            8
3561        }
3562
3563        #[inline(always)]
3564        fn inline_size(_context: fidl::encoding::Context) -> usize {
3565            8
3566        }
3567        #[inline(always)]
3568        fn encode_is_copy() -> bool {
3569            true
3570        }
3571
3572        #[inline(always)]
3573        fn decode_is_copy() -> bool {
3574            true
3575        }
3576    }
3577
3578    unsafe impl<D: fidl::encoding::ResourceDialect>
3579        fidl::encoding::Encode<Flatland2ReleaseViewport2Request, D>
3580        for &Flatland2ReleaseViewport2Request
3581    {
3582        #[inline]
3583        unsafe fn encode(
3584            self,
3585            encoder: &mut fidl::encoding::Encoder<'_, D>,
3586            offset: usize,
3587            _depth: fidl::encoding::Depth,
3588        ) -> fidl::Result<()> {
3589            encoder.debug_check_bounds::<Flatland2ReleaseViewport2Request>(offset);
3590            unsafe {
3591                // Copy the object into the buffer.
3592                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3593                (buf_ptr as *mut Flatland2ReleaseViewport2Request)
3594                    .write_unaligned((self as *const Flatland2ReleaseViewport2Request).read());
3595                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3596                // done second because the memcpy will write garbage to these bytes.
3597            }
3598            Ok(())
3599        }
3600    }
3601    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ViewportId, D>>
3602        fidl::encoding::Encode<Flatland2ReleaseViewport2Request, D> for (T0,)
3603    {
3604        #[inline]
3605        unsafe fn encode(
3606            self,
3607            encoder: &mut fidl::encoding::Encoder<'_, D>,
3608            offset: usize,
3609            depth: fidl::encoding::Depth,
3610        ) -> fidl::Result<()> {
3611            encoder.debug_check_bounds::<Flatland2ReleaseViewport2Request>(offset);
3612            // Zero out padding regions. There's no need to apply masks
3613            // because the unmasked parts will be overwritten by fields.
3614            // Write the fields.
3615            self.0.encode(encoder, offset + 0, depth)?;
3616            Ok(())
3617        }
3618    }
3619
3620    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3621        for Flatland2ReleaseViewport2Request
3622    {
3623        #[inline(always)]
3624        fn new_empty() -> Self {
3625            Self { viewport_id: fidl::new_empty!(ViewportId, D) }
3626        }
3627
3628        #[inline]
3629        unsafe fn decode(
3630            &mut self,
3631            decoder: &mut fidl::encoding::Decoder<'_, D>,
3632            offset: usize,
3633            _depth: fidl::encoding::Depth,
3634        ) -> fidl::Result<()> {
3635            decoder.debug_check_bounds::<Self>(offset);
3636            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3637            // Verify that padding bytes are zero.
3638            // Copy from the buffer into the object.
3639            unsafe {
3640                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3641            }
3642            Ok(())
3643        }
3644    }
3645
3646    impl fidl::encoding::ValueTypeMarker for Flatland2ResetLayerRequest {
3647        type Borrowed<'a> = &'a Self;
3648        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3649            value
3650        }
3651    }
3652
3653    unsafe impl fidl::encoding::TypeMarker for Flatland2ResetLayerRequest {
3654        type Owned = Self;
3655
3656        #[inline(always)]
3657        fn inline_align(_context: fidl::encoding::Context) -> usize {
3658            8
3659        }
3660
3661        #[inline(always)]
3662        fn inline_size(_context: fidl::encoding::Context) -> usize {
3663            8
3664        }
3665        #[inline(always)]
3666        fn encode_is_copy() -> bool {
3667            true
3668        }
3669
3670        #[inline(always)]
3671        fn decode_is_copy() -> bool {
3672            true
3673        }
3674    }
3675
3676    unsafe impl<D: fidl::encoding::ResourceDialect>
3677        fidl::encoding::Encode<Flatland2ResetLayerRequest, D> for &Flatland2ResetLayerRequest
3678    {
3679        #[inline]
3680        unsafe fn encode(
3681            self,
3682            encoder: &mut fidl::encoding::Encoder<'_, D>,
3683            offset: usize,
3684            _depth: fidl::encoding::Depth,
3685        ) -> fidl::Result<()> {
3686            encoder.debug_check_bounds::<Flatland2ResetLayerRequest>(offset);
3687            unsafe {
3688                // Copy the object into the buffer.
3689                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3690                (buf_ptr as *mut Flatland2ResetLayerRequest)
3691                    .write_unaligned((self as *const Flatland2ResetLayerRequest).read());
3692                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3693                // done second because the memcpy will write garbage to these bytes.
3694            }
3695            Ok(())
3696        }
3697    }
3698    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LayerId, D>>
3699        fidl::encoding::Encode<Flatland2ResetLayerRequest, D> for (T0,)
3700    {
3701        #[inline]
3702        unsafe fn encode(
3703            self,
3704            encoder: &mut fidl::encoding::Encoder<'_, D>,
3705            offset: usize,
3706            depth: fidl::encoding::Depth,
3707        ) -> fidl::Result<()> {
3708            encoder.debug_check_bounds::<Flatland2ResetLayerRequest>(offset);
3709            // Zero out padding regions. There's no need to apply masks
3710            // because the unmasked parts will be overwritten by fields.
3711            // Write the fields.
3712            self.0.encode(encoder, offset + 0, depth)?;
3713            Ok(())
3714        }
3715    }
3716
3717    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3718        for Flatland2ResetLayerRequest
3719    {
3720        #[inline(always)]
3721        fn new_empty() -> Self {
3722            Self { layer_id: fidl::new_empty!(LayerId, D) }
3723        }
3724
3725        #[inline]
3726        unsafe fn decode(
3727            &mut self,
3728            decoder: &mut fidl::encoding::Decoder<'_, D>,
3729            offset: usize,
3730            _depth: fidl::encoding::Depth,
3731        ) -> fidl::Result<()> {
3732            decoder.debug_check_bounds::<Self>(offset);
3733            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3734            // Verify that padding bytes are zero.
3735            // Copy from the buffer into the object.
3736            unsafe {
3737                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3738            }
3739            Ok(())
3740        }
3741    }
3742
3743    impl fidl::encoding::ValueTypeMarker for Flatland2SetLayerPropertiesRequest {
3744        type Borrowed<'a> = &'a Self;
3745        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3746            value
3747        }
3748    }
3749
3750    unsafe impl fidl::encoding::TypeMarker for Flatland2SetLayerPropertiesRequest {
3751        type Owned = Self;
3752
3753        #[inline(always)]
3754        fn inline_align(_context: fidl::encoding::Context) -> usize {
3755            8
3756        }
3757
3758        #[inline(always)]
3759        fn inline_size(_context: fidl::encoding::Context) -> usize {
3760            24
3761        }
3762    }
3763
3764    unsafe impl<D: fidl::encoding::ResourceDialect>
3765        fidl::encoding::Encode<Flatland2SetLayerPropertiesRequest, D>
3766        for &Flatland2SetLayerPropertiesRequest
3767    {
3768        #[inline]
3769        unsafe fn encode(
3770            self,
3771            encoder: &mut fidl::encoding::Encoder<'_, D>,
3772            offset: usize,
3773            _depth: fidl::encoding::Depth,
3774        ) -> fidl::Result<()> {
3775            encoder.debug_check_bounds::<Flatland2SetLayerPropertiesRequest>(offset);
3776            // Delegate to tuple encoding.
3777            fidl::encoding::Encode::<Flatland2SetLayerPropertiesRequest, D>::encode(
3778                (
3779                    <LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
3780                    <LayerProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
3781                ),
3782                encoder,
3783                offset,
3784                _depth,
3785            )
3786        }
3787    }
3788    unsafe impl<
3789        D: fidl::encoding::ResourceDialect,
3790        T0: fidl::encoding::Encode<LayerId, D>,
3791        T1: fidl::encoding::Encode<LayerProperties, D>,
3792    > fidl::encoding::Encode<Flatland2SetLayerPropertiesRequest, D> for (T0, T1)
3793    {
3794        #[inline]
3795        unsafe fn encode(
3796            self,
3797            encoder: &mut fidl::encoding::Encoder<'_, D>,
3798            offset: usize,
3799            depth: fidl::encoding::Depth,
3800        ) -> fidl::Result<()> {
3801            encoder.debug_check_bounds::<Flatland2SetLayerPropertiesRequest>(offset);
3802            // Zero out padding regions. There's no need to apply masks
3803            // because the unmasked parts will be overwritten by fields.
3804            // Write the fields.
3805            self.0.encode(encoder, offset + 0, depth)?;
3806            self.1.encode(encoder, offset + 8, depth)?;
3807            Ok(())
3808        }
3809    }
3810
3811    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3812        for Flatland2SetLayerPropertiesRequest
3813    {
3814        #[inline(always)]
3815        fn new_empty() -> Self {
3816            Self {
3817                layer_id: fidl::new_empty!(LayerId, D),
3818                properties: fidl::new_empty!(LayerProperties, D),
3819            }
3820        }
3821
3822        #[inline]
3823        unsafe fn decode(
3824            &mut self,
3825            decoder: &mut fidl::encoding::Decoder<'_, D>,
3826            offset: usize,
3827            _depth: fidl::encoding::Depth,
3828        ) -> fidl::Result<()> {
3829            decoder.debug_check_bounds::<Self>(offset);
3830            // Verify that padding bytes are zero.
3831            fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
3832            fidl::decode!(LayerProperties, D, &mut self.properties, decoder, offset + 8, _depth)?;
3833            Ok(())
3834        }
3835    }
3836
3837    impl fidl::encoding::ValueTypeMarker for Flatland2SetStackLayersRequest {
3838        type Borrowed<'a> = &'a Self;
3839        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3840            value
3841        }
3842    }
3843
3844    unsafe impl fidl::encoding::TypeMarker for Flatland2SetStackLayersRequest {
3845        type Owned = Self;
3846
3847        #[inline(always)]
3848        fn inline_align(_context: fidl::encoding::Context) -> usize {
3849            8
3850        }
3851
3852        #[inline(always)]
3853        fn inline_size(_context: fidl::encoding::Context) -> usize {
3854            24
3855        }
3856    }
3857
3858    unsafe impl<D: fidl::encoding::ResourceDialect>
3859        fidl::encoding::Encode<Flatland2SetStackLayersRequest, D>
3860        for &Flatland2SetStackLayersRequest
3861    {
3862        #[inline]
3863        unsafe fn encode(
3864            self,
3865            encoder: &mut fidl::encoding::Encoder<'_, D>,
3866            offset: usize,
3867            _depth: fidl::encoding::Depth,
3868        ) -> fidl::Result<()> {
3869            encoder.debug_check_bounds::<Flatland2SetStackLayersRequest>(offset);
3870            // Delegate to tuple encoding.
3871            fidl::encoding::Encode::<Flatland2SetStackLayersRequest, D>::encode(
3872                (
3873                    <LayerStackId as fidl::encoding::ValueTypeMarker>::borrow(&self.stack_id),
3874                    <fidl::encoding::Vector<LayerId, 32> as fidl::encoding::ValueTypeMarker>::borrow(&self.layers),
3875                ),
3876                encoder, offset, _depth
3877            )
3878        }
3879    }
3880    unsafe impl<
3881        D: fidl::encoding::ResourceDialect,
3882        T0: fidl::encoding::Encode<LayerStackId, D>,
3883        T1: fidl::encoding::Encode<fidl::encoding::Vector<LayerId, 32>, D>,
3884    > fidl::encoding::Encode<Flatland2SetStackLayersRequest, D> for (T0, T1)
3885    {
3886        #[inline]
3887        unsafe fn encode(
3888            self,
3889            encoder: &mut fidl::encoding::Encoder<'_, D>,
3890            offset: usize,
3891            depth: fidl::encoding::Depth,
3892        ) -> fidl::Result<()> {
3893            encoder.debug_check_bounds::<Flatland2SetStackLayersRequest>(offset);
3894            // Zero out padding regions. There's no need to apply masks
3895            // because the unmasked parts will be overwritten by fields.
3896            // Write the fields.
3897            self.0.encode(encoder, offset + 0, depth)?;
3898            self.1.encode(encoder, offset + 8, depth)?;
3899            Ok(())
3900        }
3901    }
3902
3903    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3904        for Flatland2SetStackLayersRequest
3905    {
3906        #[inline(always)]
3907        fn new_empty() -> Self {
3908            Self {
3909                stack_id: fidl::new_empty!(LayerStackId, D),
3910                layers: fidl::new_empty!(fidl::encoding::Vector<LayerId, 32>, D),
3911            }
3912        }
3913
3914        #[inline]
3915        unsafe fn decode(
3916            &mut self,
3917            decoder: &mut fidl::encoding::Decoder<'_, D>,
3918            offset: usize,
3919            _depth: fidl::encoding::Depth,
3920        ) -> fidl::Result<()> {
3921            decoder.debug_check_bounds::<Self>(offset);
3922            // Verify that padding bytes are zero.
3923            fidl::decode!(LayerStackId, D, &mut self.stack_id, decoder, offset + 0, _depth)?;
3924            fidl::decode!(fidl::encoding::Vector<LayerId, 32>, D, &mut self.layers, decoder, offset + 8, _depth)?;
3925            Ok(())
3926        }
3927    }
3928
3929    impl fidl::encoding::ValueTypeMarker for Flatland2SetTransformContentRequest {
3930        type Borrowed<'a> = &'a Self;
3931        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3932            value
3933        }
3934    }
3935
3936    unsafe impl fidl::encoding::TypeMarker for Flatland2SetTransformContentRequest {
3937        type Owned = Self;
3938
3939        #[inline(always)]
3940        fn inline_align(_context: fidl::encoding::Context) -> usize {
3941            8
3942        }
3943
3944        #[inline(always)]
3945        fn inline_size(_context: fidl::encoding::Context) -> usize {
3946            24
3947        }
3948    }
3949
3950    unsafe impl<D: fidl::encoding::ResourceDialect>
3951        fidl::encoding::Encode<Flatland2SetTransformContentRequest, D>
3952        for &Flatland2SetTransformContentRequest
3953    {
3954        #[inline]
3955        unsafe fn encode(
3956            self,
3957            encoder: &mut fidl::encoding::Encoder<'_, D>,
3958            offset: usize,
3959            _depth: fidl::encoding::Depth,
3960        ) -> fidl::Result<()> {
3961            encoder.debug_check_bounds::<Flatland2SetTransformContentRequest>(offset);
3962            // Delegate to tuple encoding.
3963            fidl::encoding::Encode::<Flatland2SetTransformContentRequest, D>::encode(
3964                (
3965                    <TransformId as fidl::encoding::ValueTypeMarker>::borrow(&self.transform_id),
3966                    <fidl::encoding::OptionalUnion<TransformContent> as fidl::encoding::ValueTypeMarker>::borrow(&self.content),
3967                ),
3968                encoder, offset, _depth
3969            )
3970        }
3971    }
3972    unsafe impl<
3973        D: fidl::encoding::ResourceDialect,
3974        T0: fidl::encoding::Encode<TransformId, D>,
3975        T1: fidl::encoding::Encode<fidl::encoding::OptionalUnion<TransformContent>, D>,
3976    > fidl::encoding::Encode<Flatland2SetTransformContentRequest, D> for (T0, T1)
3977    {
3978        #[inline]
3979        unsafe fn encode(
3980            self,
3981            encoder: &mut fidl::encoding::Encoder<'_, D>,
3982            offset: usize,
3983            depth: fidl::encoding::Depth,
3984        ) -> fidl::Result<()> {
3985            encoder.debug_check_bounds::<Flatland2SetTransformContentRequest>(offset);
3986            // Zero out padding regions. There's no need to apply masks
3987            // because the unmasked parts will be overwritten by fields.
3988            // Write the fields.
3989            self.0.encode(encoder, offset + 0, depth)?;
3990            self.1.encode(encoder, offset + 8, depth)?;
3991            Ok(())
3992        }
3993    }
3994
3995    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3996        for Flatland2SetTransformContentRequest
3997    {
3998        #[inline(always)]
3999        fn new_empty() -> Self {
4000            Self {
4001                transform_id: fidl::new_empty!(TransformId, D),
4002                content: fidl::new_empty!(fidl::encoding::OptionalUnion<TransformContent>, D),
4003            }
4004        }
4005
4006        #[inline]
4007        unsafe fn decode(
4008            &mut self,
4009            decoder: &mut fidl::encoding::Decoder<'_, D>,
4010            offset: usize,
4011            _depth: fidl::encoding::Depth,
4012        ) -> fidl::Result<()> {
4013            decoder.debug_check_bounds::<Self>(offset);
4014            // Verify that padding bytes are zero.
4015            fidl::decode!(TransformId, D, &mut self.transform_id, decoder, offset + 0, _depth)?;
4016            fidl::decode!(
4017                fidl::encoding::OptionalUnion<TransformContent>,
4018                D,
4019                &mut self.content,
4020                decoder,
4021                offset + 8,
4022                _depth
4023            )?;
4024            Ok(())
4025        }
4026    }
4027
4028    impl fidl::encoding::ValueTypeMarker for Flatland2SetViewportProperties2Request {
4029        type Borrowed<'a> = &'a Self;
4030        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4031            value
4032        }
4033    }
4034
4035    unsafe impl fidl::encoding::TypeMarker for Flatland2SetViewportProperties2Request {
4036        type Owned = Self;
4037
4038        #[inline(always)]
4039        fn inline_align(_context: fidl::encoding::Context) -> usize {
4040            8
4041        }
4042
4043        #[inline(always)]
4044        fn inline_size(_context: fidl::encoding::Context) -> usize {
4045            24
4046        }
4047    }
4048
4049    unsafe impl<D: fidl::encoding::ResourceDialect>
4050        fidl::encoding::Encode<Flatland2SetViewportProperties2Request, D>
4051        for &Flatland2SetViewportProperties2Request
4052    {
4053        #[inline]
4054        unsafe fn encode(
4055            self,
4056            encoder: &mut fidl::encoding::Encoder<'_, D>,
4057            offset: usize,
4058            _depth: fidl::encoding::Depth,
4059        ) -> fidl::Result<()> {
4060            encoder.debug_check_bounds::<Flatland2SetViewportProperties2Request>(offset);
4061            // Delegate to tuple encoding.
4062            fidl::encoding::Encode::<Flatland2SetViewportProperties2Request, D>::encode(
4063                (
4064                    <ViewportId as fidl::encoding::ValueTypeMarker>::borrow(&self.viewport_id),
4065                    <ViewportProperties as fidl::encoding::ValueTypeMarker>::borrow(
4066                        &self.properties,
4067                    ),
4068                ),
4069                encoder,
4070                offset,
4071                _depth,
4072            )
4073        }
4074    }
4075    unsafe impl<
4076        D: fidl::encoding::ResourceDialect,
4077        T0: fidl::encoding::Encode<ViewportId, D>,
4078        T1: fidl::encoding::Encode<ViewportProperties, D>,
4079    > fidl::encoding::Encode<Flatland2SetViewportProperties2Request, D> for (T0, T1)
4080    {
4081        #[inline]
4082        unsafe fn encode(
4083            self,
4084            encoder: &mut fidl::encoding::Encoder<'_, D>,
4085            offset: usize,
4086            depth: fidl::encoding::Depth,
4087        ) -> fidl::Result<()> {
4088            encoder.debug_check_bounds::<Flatland2SetViewportProperties2Request>(offset);
4089            // Zero out padding regions. There's no need to apply masks
4090            // because the unmasked parts will be overwritten by fields.
4091            // Write the fields.
4092            self.0.encode(encoder, offset + 0, depth)?;
4093            self.1.encode(encoder, offset + 8, depth)?;
4094            Ok(())
4095        }
4096    }
4097
4098    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4099        for Flatland2SetViewportProperties2Request
4100    {
4101        #[inline(always)]
4102        fn new_empty() -> Self {
4103            Self {
4104                viewport_id: fidl::new_empty!(ViewportId, D),
4105                properties: fidl::new_empty!(ViewportProperties, D),
4106            }
4107        }
4108
4109        #[inline]
4110        unsafe fn decode(
4111            &mut self,
4112            decoder: &mut fidl::encoding::Decoder<'_, D>,
4113            offset: usize,
4114            _depth: fidl::encoding::Depth,
4115        ) -> fidl::Result<()> {
4116            decoder.debug_check_bounds::<Self>(offset);
4117            // Verify that padding bytes are zero.
4118            fidl::decode!(ViewportId, D, &mut self.viewport_id, decoder, offset + 0, _depth)?;
4119            fidl::decode!(
4120                ViewportProperties,
4121                D,
4122                &mut self.properties,
4123                decoder,
4124                offset + 8,
4125                _depth
4126            )?;
4127            Ok(())
4128        }
4129    }
4130
4131    impl fidl::encoding::ValueTypeMarker for FlatlandAddChildRequest {
4132        type Borrowed<'a> = &'a Self;
4133        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4134            value
4135        }
4136    }
4137
4138    unsafe impl fidl::encoding::TypeMarker for FlatlandAddChildRequest {
4139        type Owned = Self;
4140
4141        #[inline(always)]
4142        fn inline_align(_context: fidl::encoding::Context) -> usize {
4143            8
4144        }
4145
4146        #[inline(always)]
4147        fn inline_size(_context: fidl::encoding::Context) -> usize {
4148            16
4149        }
4150        #[inline(always)]
4151        fn encode_is_copy() -> bool {
4152            true
4153        }
4154
4155        #[inline(always)]
4156        fn decode_is_copy() -> bool {
4157            true
4158        }
4159    }
4160
4161    unsafe impl<D: fidl::encoding::ResourceDialect>
4162        fidl::encoding::Encode<FlatlandAddChildRequest, D> for &FlatlandAddChildRequest
4163    {
4164        #[inline]
4165        unsafe fn encode(
4166            self,
4167            encoder: &mut fidl::encoding::Encoder<'_, D>,
4168            offset: usize,
4169            _depth: fidl::encoding::Depth,
4170        ) -> fidl::Result<()> {
4171            encoder.debug_check_bounds::<FlatlandAddChildRequest>(offset);
4172            unsafe {
4173                // Copy the object into the buffer.
4174                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4175                (buf_ptr as *mut FlatlandAddChildRequest)
4176                    .write_unaligned((self as *const FlatlandAddChildRequest).read());
4177                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4178                // done second because the memcpy will write garbage to these bytes.
4179            }
4180            Ok(())
4181        }
4182    }
4183    unsafe impl<
4184        D: fidl::encoding::ResourceDialect,
4185        T0: fidl::encoding::Encode<TransformId, D>,
4186        T1: fidl::encoding::Encode<TransformId, D>,
4187    > fidl::encoding::Encode<FlatlandAddChildRequest, D> for (T0, T1)
4188    {
4189        #[inline]
4190        unsafe fn encode(
4191            self,
4192            encoder: &mut fidl::encoding::Encoder<'_, D>,
4193            offset: usize,
4194            depth: fidl::encoding::Depth,
4195        ) -> fidl::Result<()> {
4196            encoder.debug_check_bounds::<FlatlandAddChildRequest>(offset);
4197            // Zero out padding regions. There's no need to apply masks
4198            // because the unmasked parts will be overwritten by fields.
4199            // Write the fields.
4200            self.0.encode(encoder, offset + 0, depth)?;
4201            self.1.encode(encoder, offset + 8, depth)?;
4202            Ok(())
4203        }
4204    }
4205
4206    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4207        for FlatlandAddChildRequest
4208    {
4209        #[inline(always)]
4210        fn new_empty() -> Self {
4211            Self {
4212                parent_transform_id: fidl::new_empty!(TransformId, D),
4213                child_transform_id: fidl::new_empty!(TransformId, D),
4214            }
4215        }
4216
4217        #[inline]
4218        unsafe fn decode(
4219            &mut self,
4220            decoder: &mut fidl::encoding::Decoder<'_, D>,
4221            offset: usize,
4222            _depth: fidl::encoding::Depth,
4223        ) -> fidl::Result<()> {
4224            decoder.debug_check_bounds::<Self>(offset);
4225            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4226            // Verify that padding bytes are zero.
4227            // Copy from the buffer into the object.
4228            unsafe {
4229                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
4230            }
4231            Ok(())
4232        }
4233    }
4234
4235    impl fidl::encoding::ValueTypeMarker for FlatlandCreateTransformRequest {
4236        type Borrowed<'a> = &'a Self;
4237        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4238            value
4239        }
4240    }
4241
4242    unsafe impl fidl::encoding::TypeMarker for FlatlandCreateTransformRequest {
4243        type Owned = Self;
4244
4245        #[inline(always)]
4246        fn inline_align(_context: fidl::encoding::Context) -> usize {
4247            8
4248        }
4249
4250        #[inline(always)]
4251        fn inline_size(_context: fidl::encoding::Context) -> usize {
4252            8
4253        }
4254        #[inline(always)]
4255        fn encode_is_copy() -> bool {
4256            true
4257        }
4258
4259        #[inline(always)]
4260        fn decode_is_copy() -> bool {
4261            true
4262        }
4263    }
4264
4265    unsafe impl<D: fidl::encoding::ResourceDialect>
4266        fidl::encoding::Encode<FlatlandCreateTransformRequest, D>
4267        for &FlatlandCreateTransformRequest
4268    {
4269        #[inline]
4270        unsafe fn encode(
4271            self,
4272            encoder: &mut fidl::encoding::Encoder<'_, D>,
4273            offset: usize,
4274            _depth: fidl::encoding::Depth,
4275        ) -> fidl::Result<()> {
4276            encoder.debug_check_bounds::<FlatlandCreateTransformRequest>(offset);
4277            unsafe {
4278                // Copy the object into the buffer.
4279                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4280                (buf_ptr as *mut FlatlandCreateTransformRequest)
4281                    .write_unaligned((self as *const FlatlandCreateTransformRequest).read());
4282                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4283                // done second because the memcpy will write garbage to these bytes.
4284            }
4285            Ok(())
4286        }
4287    }
4288    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TransformId, D>>
4289        fidl::encoding::Encode<FlatlandCreateTransformRequest, D> for (T0,)
4290    {
4291        #[inline]
4292        unsafe fn encode(
4293            self,
4294            encoder: &mut fidl::encoding::Encoder<'_, D>,
4295            offset: usize,
4296            depth: fidl::encoding::Depth,
4297        ) -> fidl::Result<()> {
4298            encoder.debug_check_bounds::<FlatlandCreateTransformRequest>(offset);
4299            // Zero out padding regions. There's no need to apply masks
4300            // because the unmasked parts will be overwritten by fields.
4301            // Write the fields.
4302            self.0.encode(encoder, offset + 0, depth)?;
4303            Ok(())
4304        }
4305    }
4306
4307    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4308        for FlatlandCreateTransformRequest
4309    {
4310        #[inline(always)]
4311        fn new_empty() -> Self {
4312            Self { transform_id: fidl::new_empty!(TransformId, D) }
4313        }
4314
4315        #[inline]
4316        unsafe fn decode(
4317            &mut self,
4318            decoder: &mut fidl::encoding::Decoder<'_, D>,
4319            offset: usize,
4320            _depth: fidl::encoding::Depth,
4321        ) -> fidl::Result<()> {
4322            decoder.debug_check_bounds::<Self>(offset);
4323            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4324            // Verify that padding bytes are zero.
4325            // Copy from the buffer into the object.
4326            unsafe {
4327                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4328            }
4329            Ok(())
4330        }
4331    }
4332
4333    impl fidl::encoding::ValueTypeMarker for FlatlandDisplaySetDevicePixelRatioRequest {
4334        type Borrowed<'a> = &'a Self;
4335        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4336            value
4337        }
4338    }
4339
4340    unsafe impl fidl::encoding::TypeMarker for FlatlandDisplaySetDevicePixelRatioRequest {
4341        type Owned = Self;
4342
4343        #[inline(always)]
4344        fn inline_align(_context: fidl::encoding::Context) -> usize {
4345            4
4346        }
4347
4348        #[inline(always)]
4349        fn inline_size(_context: fidl::encoding::Context) -> usize {
4350            8
4351        }
4352    }
4353
4354    unsafe impl<D: fidl::encoding::ResourceDialect>
4355        fidl::encoding::Encode<FlatlandDisplaySetDevicePixelRatioRequest, D>
4356        for &FlatlandDisplaySetDevicePixelRatioRequest
4357    {
4358        #[inline]
4359        unsafe fn encode(
4360            self,
4361            encoder: &mut fidl::encoding::Encoder<'_, D>,
4362            offset: usize,
4363            _depth: fidl::encoding::Depth,
4364        ) -> fidl::Result<()> {
4365            encoder.debug_check_bounds::<FlatlandDisplaySetDevicePixelRatioRequest>(offset);
4366            // Delegate to tuple encoding.
4367            fidl::encoding::Encode::<FlatlandDisplaySetDevicePixelRatioRequest, D>::encode(
4368                (<fidl_fuchsia_math_common::VecF as fidl::encoding::ValueTypeMarker>::borrow(
4369                    &self.device_pixel_ratio,
4370                ),),
4371                encoder,
4372                offset,
4373                _depth,
4374            )
4375        }
4376    }
4377    unsafe impl<
4378        D: fidl::encoding::ResourceDialect,
4379        T0: fidl::encoding::Encode<fidl_fuchsia_math_common::VecF, D>,
4380    > fidl::encoding::Encode<FlatlandDisplaySetDevicePixelRatioRequest, D> for (T0,)
4381    {
4382        #[inline]
4383        unsafe fn encode(
4384            self,
4385            encoder: &mut fidl::encoding::Encoder<'_, D>,
4386            offset: usize,
4387            depth: fidl::encoding::Depth,
4388        ) -> fidl::Result<()> {
4389            encoder.debug_check_bounds::<FlatlandDisplaySetDevicePixelRatioRequest>(offset);
4390            // Zero out padding regions. There's no need to apply masks
4391            // because the unmasked parts will be overwritten by fields.
4392            // Write the fields.
4393            self.0.encode(encoder, offset + 0, depth)?;
4394            Ok(())
4395        }
4396    }
4397
4398    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4399        for FlatlandDisplaySetDevicePixelRatioRequest
4400    {
4401        #[inline(always)]
4402        fn new_empty() -> Self {
4403            Self { device_pixel_ratio: fidl::new_empty!(fidl_fuchsia_math_common::VecF, D) }
4404        }
4405
4406        #[inline]
4407        unsafe fn decode(
4408            &mut self,
4409            decoder: &mut fidl::encoding::Decoder<'_, D>,
4410            offset: usize,
4411            _depth: fidl::encoding::Depth,
4412        ) -> fidl::Result<()> {
4413            decoder.debug_check_bounds::<Self>(offset);
4414            // Verify that padding bytes are zero.
4415            fidl::decode!(
4416                fidl_fuchsia_math_common::VecF,
4417                D,
4418                &mut self.device_pixel_ratio,
4419                decoder,
4420                offset + 0,
4421                _depth
4422            )?;
4423            Ok(())
4424        }
4425    }
4426
4427    impl fidl::encoding::ValueTypeMarker for FlatlandOnErrorRequest {
4428        type Borrowed<'a> = &'a Self;
4429        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4430            value
4431        }
4432    }
4433
4434    unsafe impl fidl::encoding::TypeMarker for FlatlandOnErrorRequest {
4435        type Owned = Self;
4436
4437        #[inline(always)]
4438        fn inline_align(_context: fidl::encoding::Context) -> usize {
4439            4
4440        }
4441
4442        #[inline(always)]
4443        fn inline_size(_context: fidl::encoding::Context) -> usize {
4444            4
4445        }
4446    }
4447
4448    unsafe impl<D: fidl::encoding::ResourceDialect>
4449        fidl::encoding::Encode<FlatlandOnErrorRequest, D> for &FlatlandOnErrorRequest
4450    {
4451        #[inline]
4452        unsafe fn encode(
4453            self,
4454            encoder: &mut fidl::encoding::Encoder<'_, D>,
4455            offset: usize,
4456            _depth: fidl::encoding::Depth,
4457        ) -> fidl::Result<()> {
4458            encoder.debug_check_bounds::<FlatlandOnErrorRequest>(offset);
4459            // Delegate to tuple encoding.
4460            fidl::encoding::Encode::<FlatlandOnErrorRequest, D>::encode(
4461                (<FlatlandError as fidl::encoding::ValueTypeMarker>::borrow(&self.error),),
4462                encoder,
4463                offset,
4464                _depth,
4465            )
4466        }
4467    }
4468    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<FlatlandError, D>>
4469        fidl::encoding::Encode<FlatlandOnErrorRequest, D> for (T0,)
4470    {
4471        #[inline]
4472        unsafe fn encode(
4473            self,
4474            encoder: &mut fidl::encoding::Encoder<'_, D>,
4475            offset: usize,
4476            depth: fidl::encoding::Depth,
4477        ) -> fidl::Result<()> {
4478            encoder.debug_check_bounds::<FlatlandOnErrorRequest>(offset);
4479            // Zero out padding regions. There's no need to apply masks
4480            // because the unmasked parts will be overwritten by fields.
4481            // Write the fields.
4482            self.0.encode(encoder, offset + 0, depth)?;
4483            Ok(())
4484        }
4485    }
4486
4487    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4488        for FlatlandOnErrorRequest
4489    {
4490        #[inline(always)]
4491        fn new_empty() -> Self {
4492            Self { error: fidl::new_empty!(FlatlandError, D) }
4493        }
4494
4495        #[inline]
4496        unsafe fn decode(
4497            &mut self,
4498            decoder: &mut fidl::encoding::Decoder<'_, D>,
4499            offset: usize,
4500            _depth: fidl::encoding::Depth,
4501        ) -> fidl::Result<()> {
4502            decoder.debug_check_bounds::<Self>(offset);
4503            // Verify that padding bytes are zero.
4504            fidl::decode!(FlatlandError, D, &mut self.error, decoder, offset + 0, _depth)?;
4505            Ok(())
4506        }
4507    }
4508
4509    impl fidl::encoding::ValueTypeMarker for FlatlandOnFramePresentedRequest {
4510        type Borrowed<'a> = &'a Self;
4511        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4512            value
4513        }
4514    }
4515
4516    unsafe impl fidl::encoding::TypeMarker for FlatlandOnFramePresentedRequest {
4517        type Owned = Self;
4518
4519        #[inline(always)]
4520        fn inline_align(_context: fidl::encoding::Context) -> usize {
4521            8
4522        }
4523
4524        #[inline(always)]
4525        fn inline_size(_context: fidl::encoding::Context) -> usize {
4526            32
4527        }
4528    }
4529
4530    unsafe impl<D: fidl::encoding::ResourceDialect>
4531        fidl::encoding::Encode<FlatlandOnFramePresentedRequest, D>
4532        for &FlatlandOnFramePresentedRequest
4533    {
4534        #[inline]
4535        unsafe fn encode(
4536            self,
4537            encoder: &mut fidl::encoding::Encoder<'_, D>,
4538            offset: usize,
4539            _depth: fidl::encoding::Depth,
4540        ) -> fidl::Result<()> {
4541            encoder.debug_check_bounds::<FlatlandOnFramePresentedRequest>(offset);
4542            // Delegate to tuple encoding.
4543            fidl::encoding::Encode::<FlatlandOnFramePresentedRequest, D>::encode(
4544                (
4545                    <fidl_fuchsia_scenic_scheduling_common::FramePresentedInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_presented_info),
4546                ),
4547                encoder, offset, _depth
4548            )
4549        }
4550    }
4551    unsafe impl<
4552        D: fidl::encoding::ResourceDialect,
4553        T0: fidl::encoding::Encode<fidl_fuchsia_scenic_scheduling_common::FramePresentedInfo, D>,
4554    > fidl::encoding::Encode<FlatlandOnFramePresentedRequest, D> for (T0,)
4555    {
4556        #[inline]
4557        unsafe fn encode(
4558            self,
4559            encoder: &mut fidl::encoding::Encoder<'_, D>,
4560            offset: usize,
4561            depth: fidl::encoding::Depth,
4562        ) -> fidl::Result<()> {
4563            encoder.debug_check_bounds::<FlatlandOnFramePresentedRequest>(offset);
4564            // Zero out padding regions. There's no need to apply masks
4565            // because the unmasked parts will be overwritten by fields.
4566            // Write the fields.
4567            self.0.encode(encoder, offset + 0, depth)?;
4568            Ok(())
4569        }
4570    }
4571
4572    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4573        for FlatlandOnFramePresentedRequest
4574    {
4575        #[inline(always)]
4576        fn new_empty() -> Self {
4577            Self {
4578                frame_presented_info: fidl::new_empty!(
4579                    fidl_fuchsia_scenic_scheduling_common::FramePresentedInfo,
4580                    D
4581                ),
4582            }
4583        }
4584
4585        #[inline]
4586        unsafe fn decode(
4587            &mut self,
4588            decoder: &mut fidl::encoding::Decoder<'_, D>,
4589            offset: usize,
4590            _depth: fidl::encoding::Depth,
4591        ) -> fidl::Result<()> {
4592            decoder.debug_check_bounds::<Self>(offset);
4593            // Verify that padding bytes are zero.
4594            fidl::decode!(
4595                fidl_fuchsia_scenic_scheduling_common::FramePresentedInfo,
4596                D,
4597                &mut self.frame_presented_info,
4598                decoder,
4599                offset + 0,
4600                _depth
4601            )?;
4602            Ok(())
4603        }
4604    }
4605
4606    impl fidl::encoding::ValueTypeMarker for FlatlandOnNextFrameBeginRequest {
4607        type Borrowed<'a> = &'a Self;
4608        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4609            value
4610        }
4611    }
4612
4613    unsafe impl fidl::encoding::TypeMarker for FlatlandOnNextFrameBeginRequest {
4614        type Owned = Self;
4615
4616        #[inline(always)]
4617        fn inline_align(_context: fidl::encoding::Context) -> usize {
4618            8
4619        }
4620
4621        #[inline(always)]
4622        fn inline_size(_context: fidl::encoding::Context) -> usize {
4623            16
4624        }
4625    }
4626
4627    unsafe impl<D: fidl::encoding::ResourceDialect>
4628        fidl::encoding::Encode<FlatlandOnNextFrameBeginRequest, D>
4629        for &FlatlandOnNextFrameBeginRequest
4630    {
4631        #[inline]
4632        unsafe fn encode(
4633            self,
4634            encoder: &mut fidl::encoding::Encoder<'_, D>,
4635            offset: usize,
4636            _depth: fidl::encoding::Depth,
4637        ) -> fidl::Result<()> {
4638            encoder.debug_check_bounds::<FlatlandOnNextFrameBeginRequest>(offset);
4639            // Delegate to tuple encoding.
4640            fidl::encoding::Encode::<FlatlandOnNextFrameBeginRequest, D>::encode(
4641                (<OnNextFrameBeginValues as fidl::encoding::ValueTypeMarker>::borrow(&self.values),),
4642                encoder,
4643                offset,
4644                _depth,
4645            )
4646        }
4647    }
4648    unsafe impl<
4649        D: fidl::encoding::ResourceDialect,
4650        T0: fidl::encoding::Encode<OnNextFrameBeginValues, D>,
4651    > fidl::encoding::Encode<FlatlandOnNextFrameBeginRequest, D> for (T0,)
4652    {
4653        #[inline]
4654        unsafe fn encode(
4655            self,
4656            encoder: &mut fidl::encoding::Encoder<'_, D>,
4657            offset: usize,
4658            depth: fidl::encoding::Depth,
4659        ) -> fidl::Result<()> {
4660            encoder.debug_check_bounds::<FlatlandOnNextFrameBeginRequest>(offset);
4661            // Zero out padding regions. There's no need to apply masks
4662            // because the unmasked parts will be overwritten by fields.
4663            // Write the fields.
4664            self.0.encode(encoder, offset + 0, depth)?;
4665            Ok(())
4666        }
4667    }
4668
4669    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4670        for FlatlandOnNextFrameBeginRequest
4671    {
4672        #[inline(always)]
4673        fn new_empty() -> Self {
4674            Self { values: fidl::new_empty!(OnNextFrameBeginValues, D) }
4675        }
4676
4677        #[inline]
4678        unsafe fn decode(
4679            &mut self,
4680            decoder: &mut fidl::encoding::Decoder<'_, D>,
4681            offset: usize,
4682            _depth: fidl::encoding::Depth,
4683        ) -> fidl::Result<()> {
4684            decoder.debug_check_bounds::<Self>(offset);
4685            // Verify that padding bytes are zero.
4686            fidl::decode!(
4687                OnNextFrameBeginValues,
4688                D,
4689                &mut self.values,
4690                decoder,
4691                offset + 0,
4692                _depth
4693            )?;
4694            Ok(())
4695        }
4696    }
4697
4698    impl fidl::encoding::ValueTypeMarker for FlatlandReleaseFilledRectRequest {
4699        type Borrowed<'a> = &'a Self;
4700        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4701            value
4702        }
4703    }
4704
4705    unsafe impl fidl::encoding::TypeMarker for FlatlandReleaseFilledRectRequest {
4706        type Owned = Self;
4707
4708        #[inline(always)]
4709        fn inline_align(_context: fidl::encoding::Context) -> usize {
4710            8
4711        }
4712
4713        #[inline(always)]
4714        fn inline_size(_context: fidl::encoding::Context) -> usize {
4715            8
4716        }
4717        #[inline(always)]
4718        fn encode_is_copy() -> bool {
4719            true
4720        }
4721
4722        #[inline(always)]
4723        fn decode_is_copy() -> bool {
4724            true
4725        }
4726    }
4727
4728    unsafe impl<D: fidl::encoding::ResourceDialect>
4729        fidl::encoding::Encode<FlatlandReleaseFilledRectRequest, D>
4730        for &FlatlandReleaseFilledRectRequest
4731    {
4732        #[inline]
4733        unsafe fn encode(
4734            self,
4735            encoder: &mut fidl::encoding::Encoder<'_, D>,
4736            offset: usize,
4737            _depth: fidl::encoding::Depth,
4738        ) -> fidl::Result<()> {
4739            encoder.debug_check_bounds::<FlatlandReleaseFilledRectRequest>(offset);
4740            unsafe {
4741                // Copy the object into the buffer.
4742                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4743                (buf_ptr as *mut FlatlandReleaseFilledRectRequest)
4744                    .write_unaligned((self as *const FlatlandReleaseFilledRectRequest).read());
4745                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4746                // done second because the memcpy will write garbage to these bytes.
4747            }
4748            Ok(())
4749        }
4750    }
4751    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ContentId, D>>
4752        fidl::encoding::Encode<FlatlandReleaseFilledRectRequest, D> for (T0,)
4753    {
4754        #[inline]
4755        unsafe fn encode(
4756            self,
4757            encoder: &mut fidl::encoding::Encoder<'_, D>,
4758            offset: usize,
4759            depth: fidl::encoding::Depth,
4760        ) -> fidl::Result<()> {
4761            encoder.debug_check_bounds::<FlatlandReleaseFilledRectRequest>(offset);
4762            // Zero out padding regions. There's no need to apply masks
4763            // because the unmasked parts will be overwritten by fields.
4764            // Write the fields.
4765            self.0.encode(encoder, offset + 0, depth)?;
4766            Ok(())
4767        }
4768    }
4769
4770    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4771        for FlatlandReleaseFilledRectRequest
4772    {
4773        #[inline(always)]
4774        fn new_empty() -> Self {
4775            Self { rect_id: fidl::new_empty!(ContentId, D) }
4776        }
4777
4778        #[inline]
4779        unsafe fn decode(
4780            &mut self,
4781            decoder: &mut fidl::encoding::Decoder<'_, D>,
4782            offset: usize,
4783            _depth: fidl::encoding::Depth,
4784        ) -> fidl::Result<()> {
4785            decoder.debug_check_bounds::<Self>(offset);
4786            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4787            // Verify that padding bytes are zero.
4788            // Copy from the buffer into the object.
4789            unsafe {
4790                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4791            }
4792            Ok(())
4793        }
4794    }
4795
4796    impl fidl::encoding::ValueTypeMarker for FlatlandReleaseImageRequest {
4797        type Borrowed<'a> = &'a Self;
4798        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4799            value
4800        }
4801    }
4802
4803    unsafe impl fidl::encoding::TypeMarker for FlatlandReleaseImageRequest {
4804        type Owned = Self;
4805
4806        #[inline(always)]
4807        fn inline_align(_context: fidl::encoding::Context) -> usize {
4808            8
4809        }
4810
4811        #[inline(always)]
4812        fn inline_size(_context: fidl::encoding::Context) -> usize {
4813            8
4814        }
4815        #[inline(always)]
4816        fn encode_is_copy() -> bool {
4817            true
4818        }
4819
4820        #[inline(always)]
4821        fn decode_is_copy() -> bool {
4822            true
4823        }
4824    }
4825
4826    unsafe impl<D: fidl::encoding::ResourceDialect>
4827        fidl::encoding::Encode<FlatlandReleaseImageRequest, D> for &FlatlandReleaseImageRequest
4828    {
4829        #[inline]
4830        unsafe fn encode(
4831            self,
4832            encoder: &mut fidl::encoding::Encoder<'_, D>,
4833            offset: usize,
4834            _depth: fidl::encoding::Depth,
4835        ) -> fidl::Result<()> {
4836            encoder.debug_check_bounds::<FlatlandReleaseImageRequest>(offset);
4837            unsafe {
4838                // Copy the object into the buffer.
4839                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4840                (buf_ptr as *mut FlatlandReleaseImageRequest)
4841                    .write_unaligned((self as *const FlatlandReleaseImageRequest).read());
4842                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4843                // done second because the memcpy will write garbage to these bytes.
4844            }
4845            Ok(())
4846        }
4847    }
4848    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ContentId, D>>
4849        fidl::encoding::Encode<FlatlandReleaseImageRequest, D> for (T0,)
4850    {
4851        #[inline]
4852        unsafe fn encode(
4853            self,
4854            encoder: &mut fidl::encoding::Encoder<'_, D>,
4855            offset: usize,
4856            depth: fidl::encoding::Depth,
4857        ) -> fidl::Result<()> {
4858            encoder.debug_check_bounds::<FlatlandReleaseImageRequest>(offset);
4859            // Zero out padding regions. There's no need to apply masks
4860            // because the unmasked parts will be overwritten by fields.
4861            // Write the fields.
4862            self.0.encode(encoder, offset + 0, depth)?;
4863            Ok(())
4864        }
4865    }
4866
4867    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4868        for FlatlandReleaseImageRequest
4869    {
4870        #[inline(always)]
4871        fn new_empty() -> Self {
4872            Self { image_id: fidl::new_empty!(ContentId, D) }
4873        }
4874
4875        #[inline]
4876        unsafe fn decode(
4877            &mut self,
4878            decoder: &mut fidl::encoding::Decoder<'_, D>,
4879            offset: usize,
4880            _depth: fidl::encoding::Depth,
4881        ) -> fidl::Result<()> {
4882            decoder.debug_check_bounds::<Self>(offset);
4883            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4884            // Verify that padding bytes are zero.
4885            // Copy from the buffer into the object.
4886            unsafe {
4887                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4888            }
4889            Ok(())
4890        }
4891    }
4892
4893    impl fidl::encoding::ValueTypeMarker for FlatlandReleaseTransformRequest {
4894        type Borrowed<'a> = &'a Self;
4895        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4896            value
4897        }
4898    }
4899
4900    unsafe impl fidl::encoding::TypeMarker for FlatlandReleaseTransformRequest {
4901        type Owned = Self;
4902
4903        #[inline(always)]
4904        fn inline_align(_context: fidl::encoding::Context) -> usize {
4905            8
4906        }
4907
4908        #[inline(always)]
4909        fn inline_size(_context: fidl::encoding::Context) -> usize {
4910            8
4911        }
4912        #[inline(always)]
4913        fn encode_is_copy() -> bool {
4914            true
4915        }
4916
4917        #[inline(always)]
4918        fn decode_is_copy() -> bool {
4919            true
4920        }
4921    }
4922
4923    unsafe impl<D: fidl::encoding::ResourceDialect>
4924        fidl::encoding::Encode<FlatlandReleaseTransformRequest, D>
4925        for &FlatlandReleaseTransformRequest
4926    {
4927        #[inline]
4928        unsafe fn encode(
4929            self,
4930            encoder: &mut fidl::encoding::Encoder<'_, D>,
4931            offset: usize,
4932            _depth: fidl::encoding::Depth,
4933        ) -> fidl::Result<()> {
4934            encoder.debug_check_bounds::<FlatlandReleaseTransformRequest>(offset);
4935            unsafe {
4936                // Copy the object into the buffer.
4937                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4938                (buf_ptr as *mut FlatlandReleaseTransformRequest)
4939                    .write_unaligned((self as *const FlatlandReleaseTransformRequest).read());
4940                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4941                // done second because the memcpy will write garbage to these bytes.
4942            }
4943            Ok(())
4944        }
4945    }
4946    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TransformId, D>>
4947        fidl::encoding::Encode<FlatlandReleaseTransformRequest, D> for (T0,)
4948    {
4949        #[inline]
4950        unsafe fn encode(
4951            self,
4952            encoder: &mut fidl::encoding::Encoder<'_, D>,
4953            offset: usize,
4954            depth: fidl::encoding::Depth,
4955        ) -> fidl::Result<()> {
4956            encoder.debug_check_bounds::<FlatlandReleaseTransformRequest>(offset);
4957            // Zero out padding regions. There's no need to apply masks
4958            // because the unmasked parts will be overwritten by fields.
4959            // Write the fields.
4960            self.0.encode(encoder, offset + 0, depth)?;
4961            Ok(())
4962        }
4963    }
4964
4965    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4966        for FlatlandReleaseTransformRequest
4967    {
4968        #[inline(always)]
4969        fn new_empty() -> Self {
4970            Self { transform_id: fidl::new_empty!(TransformId, D) }
4971        }
4972
4973        #[inline]
4974        unsafe fn decode(
4975            &mut self,
4976            decoder: &mut fidl::encoding::Decoder<'_, D>,
4977            offset: usize,
4978            _depth: fidl::encoding::Depth,
4979        ) -> fidl::Result<()> {
4980            decoder.debug_check_bounds::<Self>(offset);
4981            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4982            // Verify that padding bytes are zero.
4983            // Copy from the buffer into the object.
4984            unsafe {
4985                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4986            }
4987            Ok(())
4988        }
4989    }
4990
4991    impl fidl::encoding::ValueTypeMarker for FlatlandReleaseViewportRequest {
4992        type Borrowed<'a> = &'a Self;
4993        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4994            value
4995        }
4996    }
4997
4998    unsafe impl fidl::encoding::TypeMarker for FlatlandReleaseViewportRequest {
4999        type Owned = Self;
5000
5001        #[inline(always)]
5002        fn inline_align(_context: fidl::encoding::Context) -> usize {
5003            8
5004        }
5005
5006        #[inline(always)]
5007        fn inline_size(_context: fidl::encoding::Context) -> usize {
5008            8
5009        }
5010        #[inline(always)]
5011        fn encode_is_copy() -> bool {
5012            true
5013        }
5014
5015        #[inline(always)]
5016        fn decode_is_copy() -> bool {
5017            true
5018        }
5019    }
5020
5021    unsafe impl<D: fidl::encoding::ResourceDialect>
5022        fidl::encoding::Encode<FlatlandReleaseViewportRequest, D>
5023        for &FlatlandReleaseViewportRequest
5024    {
5025        #[inline]
5026        unsafe fn encode(
5027            self,
5028            encoder: &mut fidl::encoding::Encoder<'_, D>,
5029            offset: usize,
5030            _depth: fidl::encoding::Depth,
5031        ) -> fidl::Result<()> {
5032            encoder.debug_check_bounds::<FlatlandReleaseViewportRequest>(offset);
5033            unsafe {
5034                // Copy the object into the buffer.
5035                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5036                (buf_ptr as *mut FlatlandReleaseViewportRequest)
5037                    .write_unaligned((self as *const FlatlandReleaseViewportRequest).read());
5038                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5039                // done second because the memcpy will write garbage to these bytes.
5040            }
5041            Ok(())
5042        }
5043    }
5044    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ContentId, D>>
5045        fidl::encoding::Encode<FlatlandReleaseViewportRequest, D> for (T0,)
5046    {
5047        #[inline]
5048        unsafe fn encode(
5049            self,
5050            encoder: &mut fidl::encoding::Encoder<'_, D>,
5051            offset: usize,
5052            depth: fidl::encoding::Depth,
5053        ) -> fidl::Result<()> {
5054            encoder.debug_check_bounds::<FlatlandReleaseViewportRequest>(offset);
5055            // Zero out padding regions. There's no need to apply masks
5056            // because the unmasked parts will be overwritten by fields.
5057            // Write the fields.
5058            self.0.encode(encoder, offset + 0, depth)?;
5059            Ok(())
5060        }
5061    }
5062
5063    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5064        for FlatlandReleaseViewportRequest
5065    {
5066        #[inline(always)]
5067        fn new_empty() -> Self {
5068            Self { viewport_id: fidl::new_empty!(ContentId, D) }
5069        }
5070
5071        #[inline]
5072        unsafe fn decode(
5073            &mut self,
5074            decoder: &mut fidl::encoding::Decoder<'_, D>,
5075            offset: usize,
5076            _depth: fidl::encoding::Depth,
5077        ) -> fidl::Result<()> {
5078            decoder.debug_check_bounds::<Self>(offset);
5079            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5080            // Verify that padding bytes are zero.
5081            // Copy from the buffer into the object.
5082            unsafe {
5083                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
5084            }
5085            Ok(())
5086        }
5087    }
5088
5089    impl fidl::encoding::ValueTypeMarker for FlatlandRemoveChildRequest {
5090        type Borrowed<'a> = &'a Self;
5091        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5092            value
5093        }
5094    }
5095
5096    unsafe impl fidl::encoding::TypeMarker for FlatlandRemoveChildRequest {
5097        type Owned = Self;
5098
5099        #[inline(always)]
5100        fn inline_align(_context: fidl::encoding::Context) -> usize {
5101            8
5102        }
5103
5104        #[inline(always)]
5105        fn inline_size(_context: fidl::encoding::Context) -> usize {
5106            16
5107        }
5108        #[inline(always)]
5109        fn encode_is_copy() -> bool {
5110            true
5111        }
5112
5113        #[inline(always)]
5114        fn decode_is_copy() -> bool {
5115            true
5116        }
5117    }
5118
5119    unsafe impl<D: fidl::encoding::ResourceDialect>
5120        fidl::encoding::Encode<FlatlandRemoveChildRequest, D> for &FlatlandRemoveChildRequest
5121    {
5122        #[inline]
5123        unsafe fn encode(
5124            self,
5125            encoder: &mut fidl::encoding::Encoder<'_, D>,
5126            offset: usize,
5127            _depth: fidl::encoding::Depth,
5128        ) -> fidl::Result<()> {
5129            encoder.debug_check_bounds::<FlatlandRemoveChildRequest>(offset);
5130            unsafe {
5131                // Copy the object into the buffer.
5132                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5133                (buf_ptr as *mut FlatlandRemoveChildRequest)
5134                    .write_unaligned((self as *const FlatlandRemoveChildRequest).read());
5135                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5136                // done second because the memcpy will write garbage to these bytes.
5137            }
5138            Ok(())
5139        }
5140    }
5141    unsafe impl<
5142        D: fidl::encoding::ResourceDialect,
5143        T0: fidl::encoding::Encode<TransformId, D>,
5144        T1: fidl::encoding::Encode<TransformId, D>,
5145    > fidl::encoding::Encode<FlatlandRemoveChildRequest, D> for (T0, T1)
5146    {
5147        #[inline]
5148        unsafe fn encode(
5149            self,
5150            encoder: &mut fidl::encoding::Encoder<'_, D>,
5151            offset: usize,
5152            depth: fidl::encoding::Depth,
5153        ) -> fidl::Result<()> {
5154            encoder.debug_check_bounds::<FlatlandRemoveChildRequest>(offset);
5155            // Zero out padding regions. There's no need to apply masks
5156            // because the unmasked parts will be overwritten by fields.
5157            // Write the fields.
5158            self.0.encode(encoder, offset + 0, depth)?;
5159            self.1.encode(encoder, offset + 8, depth)?;
5160            Ok(())
5161        }
5162    }
5163
5164    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5165        for FlatlandRemoveChildRequest
5166    {
5167        #[inline(always)]
5168        fn new_empty() -> Self {
5169            Self {
5170                parent_transform_id: fidl::new_empty!(TransformId, D),
5171                child_transform_id: fidl::new_empty!(TransformId, D),
5172            }
5173        }
5174
5175        #[inline]
5176        unsafe fn decode(
5177            &mut self,
5178            decoder: &mut fidl::encoding::Decoder<'_, D>,
5179            offset: usize,
5180            _depth: fidl::encoding::Depth,
5181        ) -> fidl::Result<()> {
5182            decoder.debug_check_bounds::<Self>(offset);
5183            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5184            // Verify that padding bytes are zero.
5185            // Copy from the buffer into the object.
5186            unsafe {
5187                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
5188            }
5189            Ok(())
5190        }
5191    }
5192
5193    impl fidl::encoding::ValueTypeMarker for FlatlandReplaceChildrenRequest {
5194        type Borrowed<'a> = &'a Self;
5195        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5196            value
5197        }
5198    }
5199
5200    unsafe impl fidl::encoding::TypeMarker for FlatlandReplaceChildrenRequest {
5201        type Owned = Self;
5202
5203        #[inline(always)]
5204        fn inline_align(_context: fidl::encoding::Context) -> usize {
5205            8
5206        }
5207
5208        #[inline(always)]
5209        fn inline_size(_context: fidl::encoding::Context) -> usize {
5210            24
5211        }
5212    }
5213
5214    unsafe impl<D: fidl::encoding::ResourceDialect>
5215        fidl::encoding::Encode<FlatlandReplaceChildrenRequest, D>
5216        for &FlatlandReplaceChildrenRequest
5217    {
5218        #[inline]
5219        unsafe fn encode(
5220            self,
5221            encoder: &mut fidl::encoding::Encoder<'_, D>,
5222            offset: usize,
5223            _depth: fidl::encoding::Depth,
5224        ) -> fidl::Result<()> {
5225            encoder.debug_check_bounds::<FlatlandReplaceChildrenRequest>(offset);
5226            // Delegate to tuple encoding.
5227            fidl::encoding::Encode::<FlatlandReplaceChildrenRequest, D>::encode(
5228                (
5229                    <TransformId as fidl::encoding::ValueTypeMarker>::borrow(&self.parent_transform_id),
5230                    <fidl::encoding::Vector<TransformId, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.new_child_transform_ids),
5231                ),
5232                encoder, offset, _depth
5233            )
5234        }
5235    }
5236    unsafe impl<
5237        D: fidl::encoding::ResourceDialect,
5238        T0: fidl::encoding::Encode<TransformId, D>,
5239        T1: fidl::encoding::Encode<fidl::encoding::Vector<TransformId, 64>, D>,
5240    > fidl::encoding::Encode<FlatlandReplaceChildrenRequest, D> for (T0, T1)
5241    {
5242        #[inline]
5243        unsafe fn encode(
5244            self,
5245            encoder: &mut fidl::encoding::Encoder<'_, D>,
5246            offset: usize,
5247            depth: fidl::encoding::Depth,
5248        ) -> fidl::Result<()> {
5249            encoder.debug_check_bounds::<FlatlandReplaceChildrenRequest>(offset);
5250            // Zero out padding regions. There's no need to apply masks
5251            // because the unmasked parts will be overwritten by fields.
5252            // Write the fields.
5253            self.0.encode(encoder, offset + 0, depth)?;
5254            self.1.encode(encoder, offset + 8, depth)?;
5255            Ok(())
5256        }
5257    }
5258
5259    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5260        for FlatlandReplaceChildrenRequest
5261    {
5262        #[inline(always)]
5263        fn new_empty() -> Self {
5264            Self {
5265                parent_transform_id: fidl::new_empty!(TransformId, D),
5266                new_child_transform_ids: fidl::new_empty!(fidl::encoding::Vector<TransformId, 64>, D),
5267            }
5268        }
5269
5270        #[inline]
5271        unsafe fn decode(
5272            &mut self,
5273            decoder: &mut fidl::encoding::Decoder<'_, D>,
5274            offset: usize,
5275            _depth: fidl::encoding::Depth,
5276        ) -> fidl::Result<()> {
5277            decoder.debug_check_bounds::<Self>(offset);
5278            // Verify that padding bytes are zero.
5279            fidl::decode!(
5280                TransformId,
5281                D,
5282                &mut self.parent_transform_id,
5283                decoder,
5284                offset + 0,
5285                _depth
5286            )?;
5287            fidl::decode!(fidl::encoding::Vector<TransformId, 64>, D, &mut self.new_child_transform_ids, decoder, offset + 8, _depth)?;
5288            Ok(())
5289        }
5290    }
5291
5292    impl fidl::encoding::ValueTypeMarker for FlatlandSetClipBoundaryRequest {
5293        type Borrowed<'a> = &'a Self;
5294        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5295            value
5296        }
5297    }
5298
5299    unsafe impl fidl::encoding::TypeMarker for FlatlandSetClipBoundaryRequest {
5300        type Owned = Self;
5301
5302        #[inline(always)]
5303        fn inline_align(_context: fidl::encoding::Context) -> usize {
5304            8
5305        }
5306
5307        #[inline(always)]
5308        fn inline_size(_context: fidl::encoding::Context) -> usize {
5309            16
5310        }
5311    }
5312
5313    unsafe impl<D: fidl::encoding::ResourceDialect>
5314        fidl::encoding::Encode<FlatlandSetClipBoundaryRequest, D>
5315        for &FlatlandSetClipBoundaryRequest
5316    {
5317        #[inline]
5318        unsafe fn encode(
5319            self,
5320            encoder: &mut fidl::encoding::Encoder<'_, D>,
5321            offset: usize,
5322            _depth: fidl::encoding::Depth,
5323        ) -> fidl::Result<()> {
5324            encoder.debug_check_bounds::<FlatlandSetClipBoundaryRequest>(offset);
5325            // Delegate to tuple encoding.
5326            fidl::encoding::Encode::<FlatlandSetClipBoundaryRequest, D>::encode(
5327                (
5328                    <TransformId as fidl::encoding::ValueTypeMarker>::borrow(&self.transform_id),
5329                    <fidl::encoding::Boxed<fidl_fuchsia_math_common::Rect> as fidl::encoding::ValueTypeMarker>::borrow(&self.rect),
5330                ),
5331                encoder, offset, _depth
5332            )
5333        }
5334    }
5335    unsafe impl<
5336        D: fidl::encoding::ResourceDialect,
5337        T0: fidl::encoding::Encode<TransformId, D>,
5338        T1: fidl::encoding::Encode<fidl::encoding::Boxed<fidl_fuchsia_math_common::Rect>, D>,
5339    > fidl::encoding::Encode<FlatlandSetClipBoundaryRequest, D> for (T0, T1)
5340    {
5341        #[inline]
5342        unsafe fn encode(
5343            self,
5344            encoder: &mut fidl::encoding::Encoder<'_, D>,
5345            offset: usize,
5346            depth: fidl::encoding::Depth,
5347        ) -> fidl::Result<()> {
5348            encoder.debug_check_bounds::<FlatlandSetClipBoundaryRequest>(offset);
5349            // Zero out padding regions. There's no need to apply masks
5350            // because the unmasked parts will be overwritten by fields.
5351            // Write the fields.
5352            self.0.encode(encoder, offset + 0, depth)?;
5353            self.1.encode(encoder, offset + 8, depth)?;
5354            Ok(())
5355        }
5356    }
5357
5358    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5359        for FlatlandSetClipBoundaryRequest
5360    {
5361        #[inline(always)]
5362        fn new_empty() -> Self {
5363            Self {
5364                transform_id: fidl::new_empty!(TransformId, D),
5365                rect: fidl::new_empty!(fidl::encoding::Boxed<fidl_fuchsia_math_common::Rect>, D),
5366            }
5367        }
5368
5369        #[inline]
5370        unsafe fn decode(
5371            &mut self,
5372            decoder: &mut fidl::encoding::Decoder<'_, D>,
5373            offset: usize,
5374            _depth: fidl::encoding::Depth,
5375        ) -> fidl::Result<()> {
5376            decoder.debug_check_bounds::<Self>(offset);
5377            // Verify that padding bytes are zero.
5378            fidl::decode!(TransformId, D, &mut self.transform_id, decoder, offset + 0, _depth)?;
5379            fidl::decode!(
5380                fidl::encoding::Boxed<fidl_fuchsia_math_common::Rect>,
5381                D,
5382                &mut self.rect,
5383                decoder,
5384                offset + 8,
5385                _depth
5386            )?;
5387            Ok(())
5388        }
5389    }
5390
5391    impl fidl::encoding::ValueTypeMarker for FlatlandSetContentRequest {
5392        type Borrowed<'a> = &'a Self;
5393        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5394            value
5395        }
5396    }
5397
5398    unsafe impl fidl::encoding::TypeMarker for FlatlandSetContentRequest {
5399        type Owned = Self;
5400
5401        #[inline(always)]
5402        fn inline_align(_context: fidl::encoding::Context) -> usize {
5403            8
5404        }
5405
5406        #[inline(always)]
5407        fn inline_size(_context: fidl::encoding::Context) -> usize {
5408            16
5409        }
5410        #[inline(always)]
5411        fn encode_is_copy() -> bool {
5412            true
5413        }
5414
5415        #[inline(always)]
5416        fn decode_is_copy() -> bool {
5417            true
5418        }
5419    }
5420
5421    unsafe impl<D: fidl::encoding::ResourceDialect>
5422        fidl::encoding::Encode<FlatlandSetContentRequest, D> for &FlatlandSetContentRequest
5423    {
5424        #[inline]
5425        unsafe fn encode(
5426            self,
5427            encoder: &mut fidl::encoding::Encoder<'_, D>,
5428            offset: usize,
5429            _depth: fidl::encoding::Depth,
5430        ) -> fidl::Result<()> {
5431            encoder.debug_check_bounds::<FlatlandSetContentRequest>(offset);
5432            unsafe {
5433                // Copy the object into the buffer.
5434                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5435                (buf_ptr as *mut FlatlandSetContentRequest)
5436                    .write_unaligned((self as *const FlatlandSetContentRequest).read());
5437                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5438                // done second because the memcpy will write garbage to these bytes.
5439            }
5440            Ok(())
5441        }
5442    }
5443    unsafe impl<
5444        D: fidl::encoding::ResourceDialect,
5445        T0: fidl::encoding::Encode<TransformId, D>,
5446        T1: fidl::encoding::Encode<ContentId, D>,
5447    > fidl::encoding::Encode<FlatlandSetContentRequest, D> for (T0, T1)
5448    {
5449        #[inline]
5450        unsafe fn encode(
5451            self,
5452            encoder: &mut fidl::encoding::Encoder<'_, D>,
5453            offset: usize,
5454            depth: fidl::encoding::Depth,
5455        ) -> fidl::Result<()> {
5456            encoder.debug_check_bounds::<FlatlandSetContentRequest>(offset);
5457            // Zero out padding regions. There's no need to apply masks
5458            // because the unmasked parts will be overwritten by fields.
5459            // Write the fields.
5460            self.0.encode(encoder, offset + 0, depth)?;
5461            self.1.encode(encoder, offset + 8, depth)?;
5462            Ok(())
5463        }
5464    }
5465
5466    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5467        for FlatlandSetContentRequest
5468    {
5469        #[inline(always)]
5470        fn new_empty() -> Self {
5471            Self {
5472                transform_id: fidl::new_empty!(TransformId, D),
5473                content_id: fidl::new_empty!(ContentId, D),
5474            }
5475        }
5476
5477        #[inline]
5478        unsafe fn decode(
5479            &mut self,
5480            decoder: &mut fidl::encoding::Decoder<'_, D>,
5481            offset: usize,
5482            _depth: fidl::encoding::Depth,
5483        ) -> fidl::Result<()> {
5484            decoder.debug_check_bounds::<Self>(offset);
5485            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5486            // Verify that padding bytes are zero.
5487            // Copy from the buffer into the object.
5488            unsafe {
5489                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
5490            }
5491            Ok(())
5492        }
5493    }
5494
5495    impl fidl::encoding::ValueTypeMarker for FlatlandSetDebugNameRequest {
5496        type Borrowed<'a> = &'a Self;
5497        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5498            value
5499        }
5500    }
5501
5502    unsafe impl fidl::encoding::TypeMarker for FlatlandSetDebugNameRequest {
5503        type Owned = Self;
5504
5505        #[inline(always)]
5506        fn inline_align(_context: fidl::encoding::Context) -> usize {
5507            8
5508        }
5509
5510        #[inline(always)]
5511        fn inline_size(_context: fidl::encoding::Context) -> usize {
5512            16
5513        }
5514    }
5515
5516    unsafe impl<D: fidl::encoding::ResourceDialect>
5517        fidl::encoding::Encode<FlatlandSetDebugNameRequest, D> for &FlatlandSetDebugNameRequest
5518    {
5519        #[inline]
5520        unsafe fn encode(
5521            self,
5522            encoder: &mut fidl::encoding::Encoder<'_, D>,
5523            offset: usize,
5524            _depth: fidl::encoding::Depth,
5525        ) -> fidl::Result<()> {
5526            encoder.debug_check_bounds::<FlatlandSetDebugNameRequest>(offset);
5527            // Delegate to tuple encoding.
5528            fidl::encoding::Encode::<FlatlandSetDebugNameRequest, D>::encode(
5529                (<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
5530                    &self.name,
5531                ),),
5532                encoder,
5533                offset,
5534                _depth,
5535            )
5536        }
5537    }
5538    unsafe impl<
5539        D: fidl::encoding::ResourceDialect,
5540        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
5541    > fidl::encoding::Encode<FlatlandSetDebugNameRequest, D> for (T0,)
5542    {
5543        #[inline]
5544        unsafe fn encode(
5545            self,
5546            encoder: &mut fidl::encoding::Encoder<'_, D>,
5547            offset: usize,
5548            depth: fidl::encoding::Depth,
5549        ) -> fidl::Result<()> {
5550            encoder.debug_check_bounds::<FlatlandSetDebugNameRequest>(offset);
5551            // Zero out padding regions. There's no need to apply masks
5552            // because the unmasked parts will be overwritten by fields.
5553            // Write the fields.
5554            self.0.encode(encoder, offset + 0, depth)?;
5555            Ok(())
5556        }
5557    }
5558
5559    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5560        for FlatlandSetDebugNameRequest
5561    {
5562        #[inline(always)]
5563        fn new_empty() -> Self {
5564            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<64>, D) }
5565        }
5566
5567        #[inline]
5568        unsafe fn decode(
5569            &mut self,
5570            decoder: &mut fidl::encoding::Decoder<'_, D>,
5571            offset: usize,
5572            _depth: fidl::encoding::Depth,
5573        ) -> fidl::Result<()> {
5574            decoder.debug_check_bounds::<Self>(offset);
5575            // Verify that padding bytes are zero.
5576            fidl::decode!(
5577                fidl::encoding::BoundedString<64>,
5578                D,
5579                &mut self.name,
5580                decoder,
5581                offset + 0,
5582                _depth
5583            )?;
5584            Ok(())
5585        }
5586    }
5587
5588    impl fidl::encoding::ValueTypeMarker for FlatlandSetHitRegionsRequest {
5589        type Borrowed<'a> = &'a Self;
5590        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5591            value
5592        }
5593    }
5594
5595    unsafe impl fidl::encoding::TypeMarker for FlatlandSetHitRegionsRequest {
5596        type Owned = Self;
5597
5598        #[inline(always)]
5599        fn inline_align(_context: fidl::encoding::Context) -> usize {
5600            8
5601        }
5602
5603        #[inline(always)]
5604        fn inline_size(_context: fidl::encoding::Context) -> usize {
5605            24
5606        }
5607    }
5608
5609    unsafe impl<D: fidl::encoding::ResourceDialect>
5610        fidl::encoding::Encode<FlatlandSetHitRegionsRequest, D> for &FlatlandSetHitRegionsRequest
5611    {
5612        #[inline]
5613        unsafe fn encode(
5614            self,
5615            encoder: &mut fidl::encoding::Encoder<'_, D>,
5616            offset: usize,
5617            _depth: fidl::encoding::Depth,
5618        ) -> fidl::Result<()> {
5619            encoder.debug_check_bounds::<FlatlandSetHitRegionsRequest>(offset);
5620            // Delegate to tuple encoding.
5621            fidl::encoding::Encode::<FlatlandSetHitRegionsRequest, D>::encode(
5622                (
5623                    <TransformId as fidl::encoding::ValueTypeMarker>::borrow(&self.transform_id),
5624                    <fidl::encoding::Vector<HitRegion, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.regions),
5625                ),
5626                encoder, offset, _depth
5627            )
5628        }
5629    }
5630    unsafe impl<
5631        D: fidl::encoding::ResourceDialect,
5632        T0: fidl::encoding::Encode<TransformId, D>,
5633        T1: fidl::encoding::Encode<fidl::encoding::Vector<HitRegion, 64>, D>,
5634    > fidl::encoding::Encode<FlatlandSetHitRegionsRequest, D> for (T0, T1)
5635    {
5636        #[inline]
5637        unsafe fn encode(
5638            self,
5639            encoder: &mut fidl::encoding::Encoder<'_, D>,
5640            offset: usize,
5641            depth: fidl::encoding::Depth,
5642        ) -> fidl::Result<()> {
5643            encoder.debug_check_bounds::<FlatlandSetHitRegionsRequest>(offset);
5644            // Zero out padding regions. There's no need to apply masks
5645            // because the unmasked parts will be overwritten by fields.
5646            // Write the fields.
5647            self.0.encode(encoder, offset + 0, depth)?;
5648            self.1.encode(encoder, offset + 8, depth)?;
5649            Ok(())
5650        }
5651    }
5652
5653    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5654        for FlatlandSetHitRegionsRequest
5655    {
5656        #[inline(always)]
5657        fn new_empty() -> Self {
5658            Self {
5659                transform_id: fidl::new_empty!(TransformId, D),
5660                regions: fidl::new_empty!(fidl::encoding::Vector<HitRegion, 64>, D),
5661            }
5662        }
5663
5664        #[inline]
5665        unsafe fn decode(
5666            &mut self,
5667            decoder: &mut fidl::encoding::Decoder<'_, D>,
5668            offset: usize,
5669            _depth: fidl::encoding::Depth,
5670        ) -> fidl::Result<()> {
5671            decoder.debug_check_bounds::<Self>(offset);
5672            // Verify that padding bytes are zero.
5673            fidl::decode!(TransformId, D, &mut self.transform_id, decoder, offset + 0, _depth)?;
5674            fidl::decode!(fidl::encoding::Vector<HitRegion, 64>, D, &mut self.regions, decoder, offset + 8, _depth)?;
5675            Ok(())
5676        }
5677    }
5678
5679    impl fidl::encoding::ValueTypeMarker for FlatlandSetImageBlendModeRequest {
5680        type Borrowed<'a> = &'a Self;
5681        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5682            value
5683        }
5684    }
5685
5686    unsafe impl fidl::encoding::TypeMarker for FlatlandSetImageBlendModeRequest {
5687        type Owned = Self;
5688
5689        #[inline(always)]
5690        fn inline_align(_context: fidl::encoding::Context) -> usize {
5691            8
5692        }
5693
5694        #[inline(always)]
5695        fn inline_size(_context: fidl::encoding::Context) -> usize {
5696            16
5697        }
5698    }
5699
5700    unsafe impl<D: fidl::encoding::ResourceDialect>
5701        fidl::encoding::Encode<FlatlandSetImageBlendModeRequest, D>
5702        for &FlatlandSetImageBlendModeRequest
5703    {
5704        #[inline]
5705        unsafe fn encode(
5706            self,
5707            encoder: &mut fidl::encoding::Encoder<'_, D>,
5708            offset: usize,
5709            _depth: fidl::encoding::Depth,
5710        ) -> fidl::Result<()> {
5711            encoder.debug_check_bounds::<FlatlandSetImageBlendModeRequest>(offset);
5712            // Delegate to tuple encoding.
5713            fidl::encoding::Encode::<FlatlandSetImageBlendModeRequest, D>::encode(
5714                (
5715                    <ContentId as fidl::encoding::ValueTypeMarker>::borrow(&self.image_id),
5716                    <BlendMode2 as fidl::encoding::ValueTypeMarker>::borrow(&self.blend_mode),
5717                ),
5718                encoder,
5719                offset,
5720                _depth,
5721            )
5722        }
5723    }
5724    unsafe impl<
5725        D: fidl::encoding::ResourceDialect,
5726        T0: fidl::encoding::Encode<ContentId, D>,
5727        T1: fidl::encoding::Encode<BlendMode2, D>,
5728    > fidl::encoding::Encode<FlatlandSetImageBlendModeRequest, D> for (T0, T1)
5729    {
5730        #[inline]
5731        unsafe fn encode(
5732            self,
5733            encoder: &mut fidl::encoding::Encoder<'_, D>,
5734            offset: usize,
5735            depth: fidl::encoding::Depth,
5736        ) -> fidl::Result<()> {
5737            encoder.debug_check_bounds::<FlatlandSetImageBlendModeRequest>(offset);
5738            // Zero out padding regions. There's no need to apply masks
5739            // because the unmasked parts will be overwritten by fields.
5740            unsafe {
5741                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
5742                (ptr as *mut u64).write_unaligned(0);
5743            }
5744            // Write the fields.
5745            self.0.encode(encoder, offset + 0, depth)?;
5746            self.1.encode(encoder, offset + 8, depth)?;
5747            Ok(())
5748        }
5749    }
5750
5751    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5752        for FlatlandSetImageBlendModeRequest
5753    {
5754        #[inline(always)]
5755        fn new_empty() -> Self {
5756            Self {
5757                image_id: fidl::new_empty!(ContentId, D),
5758                blend_mode: fidl::new_empty!(BlendMode2, D),
5759            }
5760        }
5761
5762        #[inline]
5763        unsafe fn decode(
5764            &mut self,
5765            decoder: &mut fidl::encoding::Decoder<'_, D>,
5766            offset: usize,
5767            _depth: fidl::encoding::Depth,
5768        ) -> fidl::Result<()> {
5769            decoder.debug_check_bounds::<Self>(offset);
5770            // Verify that padding bytes are zero.
5771            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
5772            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5773            let mask = 0xffffffff00000000u64;
5774            let maskedval = padval & mask;
5775            if maskedval != 0 {
5776                return Err(fidl::Error::NonZeroPadding {
5777                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
5778                });
5779            }
5780            fidl::decode!(ContentId, D, &mut self.image_id, decoder, offset + 0, _depth)?;
5781            fidl::decode!(BlendMode2, D, &mut self.blend_mode, decoder, offset + 8, _depth)?;
5782            Ok(())
5783        }
5784    }
5785
5786    impl fidl::encoding::ValueTypeMarker for FlatlandSetImageBlendingFunctionRequest {
5787        type Borrowed<'a> = &'a Self;
5788        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5789            value
5790        }
5791    }
5792
5793    unsafe impl fidl::encoding::TypeMarker for FlatlandSetImageBlendingFunctionRequest {
5794        type Owned = Self;
5795
5796        #[inline(always)]
5797        fn inline_align(_context: fidl::encoding::Context) -> usize {
5798            8
5799        }
5800
5801        #[inline(always)]
5802        fn inline_size(_context: fidl::encoding::Context) -> usize {
5803            16
5804        }
5805    }
5806
5807    unsafe impl<D: fidl::encoding::ResourceDialect>
5808        fidl::encoding::Encode<FlatlandSetImageBlendingFunctionRequest, D>
5809        for &FlatlandSetImageBlendingFunctionRequest
5810    {
5811        #[inline]
5812        unsafe fn encode(
5813            self,
5814            encoder: &mut fidl::encoding::Encoder<'_, D>,
5815            offset: usize,
5816            _depth: fidl::encoding::Depth,
5817        ) -> fidl::Result<()> {
5818            encoder.debug_check_bounds::<FlatlandSetImageBlendingFunctionRequest>(offset);
5819            // Delegate to tuple encoding.
5820            fidl::encoding::Encode::<FlatlandSetImageBlendingFunctionRequest, D>::encode(
5821                (
5822                    <ContentId as fidl::encoding::ValueTypeMarker>::borrow(&self.image_id),
5823                    <BlendMode as fidl::encoding::ValueTypeMarker>::borrow(&self.blend_mode),
5824                ),
5825                encoder,
5826                offset,
5827                _depth,
5828            )
5829        }
5830    }
5831    unsafe impl<
5832        D: fidl::encoding::ResourceDialect,
5833        T0: fidl::encoding::Encode<ContentId, D>,
5834        T1: fidl::encoding::Encode<BlendMode, D>,
5835    > fidl::encoding::Encode<FlatlandSetImageBlendingFunctionRequest, D> for (T0, T1)
5836    {
5837        #[inline]
5838        unsafe fn encode(
5839            self,
5840            encoder: &mut fidl::encoding::Encoder<'_, D>,
5841            offset: usize,
5842            depth: fidl::encoding::Depth,
5843        ) -> fidl::Result<()> {
5844            encoder.debug_check_bounds::<FlatlandSetImageBlendingFunctionRequest>(offset);
5845            // Zero out padding regions. There's no need to apply masks
5846            // because the unmasked parts will be overwritten by fields.
5847            unsafe {
5848                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
5849                (ptr as *mut u64).write_unaligned(0);
5850            }
5851            // Write the fields.
5852            self.0.encode(encoder, offset + 0, depth)?;
5853            self.1.encode(encoder, offset + 8, depth)?;
5854            Ok(())
5855        }
5856    }
5857
5858    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5859        for FlatlandSetImageBlendingFunctionRequest
5860    {
5861        #[inline(always)]
5862        fn new_empty() -> Self {
5863            Self {
5864                image_id: fidl::new_empty!(ContentId, D),
5865                blend_mode: fidl::new_empty!(BlendMode, D),
5866            }
5867        }
5868
5869        #[inline]
5870        unsafe fn decode(
5871            &mut self,
5872            decoder: &mut fidl::encoding::Decoder<'_, D>,
5873            offset: usize,
5874            _depth: fidl::encoding::Depth,
5875        ) -> fidl::Result<()> {
5876            decoder.debug_check_bounds::<Self>(offset);
5877            // Verify that padding bytes are zero.
5878            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
5879            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5880            let mask = 0xffffffff00000000u64;
5881            let maskedval = padval & mask;
5882            if maskedval != 0 {
5883                return Err(fidl::Error::NonZeroPadding {
5884                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
5885                });
5886            }
5887            fidl::decode!(ContentId, D, &mut self.image_id, decoder, offset + 0, _depth)?;
5888            fidl::decode!(BlendMode, D, &mut self.blend_mode, decoder, offset + 8, _depth)?;
5889            Ok(())
5890        }
5891    }
5892
5893    impl fidl::encoding::ValueTypeMarker for FlatlandSetImageDestinationSizeRequest {
5894        type Borrowed<'a> = &'a Self;
5895        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5896            value
5897        }
5898    }
5899
5900    unsafe impl fidl::encoding::TypeMarker for FlatlandSetImageDestinationSizeRequest {
5901        type Owned = Self;
5902
5903        #[inline(always)]
5904        fn inline_align(_context: fidl::encoding::Context) -> usize {
5905            8
5906        }
5907
5908        #[inline(always)]
5909        fn inline_size(_context: fidl::encoding::Context) -> usize {
5910            16
5911        }
5912    }
5913
5914    unsafe impl<D: fidl::encoding::ResourceDialect>
5915        fidl::encoding::Encode<FlatlandSetImageDestinationSizeRequest, D>
5916        for &FlatlandSetImageDestinationSizeRequest
5917    {
5918        #[inline]
5919        unsafe fn encode(
5920            self,
5921            encoder: &mut fidl::encoding::Encoder<'_, D>,
5922            offset: usize,
5923            _depth: fidl::encoding::Depth,
5924        ) -> fidl::Result<()> {
5925            encoder.debug_check_bounds::<FlatlandSetImageDestinationSizeRequest>(offset);
5926            // Delegate to tuple encoding.
5927            fidl::encoding::Encode::<FlatlandSetImageDestinationSizeRequest, D>::encode(
5928                (
5929                    <ContentId as fidl::encoding::ValueTypeMarker>::borrow(&self.image_id),
5930                    <fidl_fuchsia_math_common::SizeU as fidl::encoding::ValueTypeMarker>::borrow(
5931                        &self.size,
5932                    ),
5933                ),
5934                encoder,
5935                offset,
5936                _depth,
5937            )
5938        }
5939    }
5940    unsafe impl<
5941        D: fidl::encoding::ResourceDialect,
5942        T0: fidl::encoding::Encode<ContentId, D>,
5943        T1: fidl::encoding::Encode<fidl_fuchsia_math_common::SizeU, D>,
5944    > fidl::encoding::Encode<FlatlandSetImageDestinationSizeRequest, D> for (T0, T1)
5945    {
5946        #[inline]
5947        unsafe fn encode(
5948            self,
5949            encoder: &mut fidl::encoding::Encoder<'_, D>,
5950            offset: usize,
5951            depth: fidl::encoding::Depth,
5952        ) -> fidl::Result<()> {
5953            encoder.debug_check_bounds::<FlatlandSetImageDestinationSizeRequest>(offset);
5954            // Zero out padding regions. There's no need to apply masks
5955            // because the unmasked parts will be overwritten by fields.
5956            // Write the fields.
5957            self.0.encode(encoder, offset + 0, depth)?;
5958            self.1.encode(encoder, offset + 8, depth)?;
5959            Ok(())
5960        }
5961    }
5962
5963    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5964        for FlatlandSetImageDestinationSizeRequest
5965    {
5966        #[inline(always)]
5967        fn new_empty() -> Self {
5968            Self {
5969                image_id: fidl::new_empty!(ContentId, D),
5970                size: fidl::new_empty!(fidl_fuchsia_math_common::SizeU, D),
5971            }
5972        }
5973
5974        #[inline]
5975        unsafe fn decode(
5976            &mut self,
5977            decoder: &mut fidl::encoding::Decoder<'_, D>,
5978            offset: usize,
5979            _depth: fidl::encoding::Depth,
5980        ) -> fidl::Result<()> {
5981            decoder.debug_check_bounds::<Self>(offset);
5982            // Verify that padding bytes are zero.
5983            fidl::decode!(ContentId, D, &mut self.image_id, decoder, offset + 0, _depth)?;
5984            fidl::decode!(
5985                fidl_fuchsia_math_common::SizeU,
5986                D,
5987                &mut self.size,
5988                decoder,
5989                offset + 8,
5990                _depth
5991            )?;
5992            Ok(())
5993        }
5994    }
5995
5996    impl fidl::encoding::ValueTypeMarker for FlatlandSetImageFlipRequest {
5997        type Borrowed<'a> = &'a Self;
5998        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5999            value
6000        }
6001    }
6002
6003    unsafe impl fidl::encoding::TypeMarker for FlatlandSetImageFlipRequest {
6004        type Owned = Self;
6005
6006        #[inline(always)]
6007        fn inline_align(_context: fidl::encoding::Context) -> usize {
6008            8
6009        }
6010
6011        #[inline(always)]
6012        fn inline_size(_context: fidl::encoding::Context) -> usize {
6013            16
6014        }
6015    }
6016
6017    unsafe impl<D: fidl::encoding::ResourceDialect>
6018        fidl::encoding::Encode<FlatlandSetImageFlipRequest, D> for &FlatlandSetImageFlipRequest
6019    {
6020        #[inline]
6021        unsafe fn encode(
6022            self,
6023            encoder: &mut fidl::encoding::Encoder<'_, D>,
6024            offset: usize,
6025            _depth: fidl::encoding::Depth,
6026        ) -> fidl::Result<()> {
6027            encoder.debug_check_bounds::<FlatlandSetImageFlipRequest>(offset);
6028            // Delegate to tuple encoding.
6029            fidl::encoding::Encode::<FlatlandSetImageFlipRequest, D>::encode(
6030                (
6031                    <ContentId as fidl::encoding::ValueTypeMarker>::borrow(&self.image_id),
6032                    <ImageFlip as fidl::encoding::ValueTypeMarker>::borrow(&self.flip),
6033                ),
6034                encoder,
6035                offset,
6036                _depth,
6037            )
6038        }
6039    }
6040    unsafe impl<
6041        D: fidl::encoding::ResourceDialect,
6042        T0: fidl::encoding::Encode<ContentId, D>,
6043        T1: fidl::encoding::Encode<ImageFlip, D>,
6044    > fidl::encoding::Encode<FlatlandSetImageFlipRequest, D> for (T0, T1)
6045    {
6046        #[inline]
6047        unsafe fn encode(
6048            self,
6049            encoder: &mut fidl::encoding::Encoder<'_, D>,
6050            offset: usize,
6051            depth: fidl::encoding::Depth,
6052        ) -> fidl::Result<()> {
6053            encoder.debug_check_bounds::<FlatlandSetImageFlipRequest>(offset);
6054            // Zero out padding regions. There's no need to apply masks
6055            // because the unmasked parts will be overwritten by fields.
6056            unsafe {
6057                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
6058                (ptr as *mut u64).write_unaligned(0);
6059            }
6060            // Write the fields.
6061            self.0.encode(encoder, offset + 0, depth)?;
6062            self.1.encode(encoder, offset + 8, depth)?;
6063            Ok(())
6064        }
6065    }
6066
6067    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6068        for FlatlandSetImageFlipRequest
6069    {
6070        #[inline(always)]
6071        fn new_empty() -> Self {
6072            Self { image_id: fidl::new_empty!(ContentId, D), flip: fidl::new_empty!(ImageFlip, D) }
6073        }
6074
6075        #[inline]
6076        unsafe fn decode(
6077            &mut self,
6078            decoder: &mut fidl::encoding::Decoder<'_, D>,
6079            offset: usize,
6080            _depth: fidl::encoding::Depth,
6081        ) -> fidl::Result<()> {
6082            decoder.debug_check_bounds::<Self>(offset);
6083            // Verify that padding bytes are zero.
6084            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
6085            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6086            let mask = 0xffffffff00000000u64;
6087            let maskedval = padval & mask;
6088            if maskedval != 0 {
6089                return Err(fidl::Error::NonZeroPadding {
6090                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
6091                });
6092            }
6093            fidl::decode!(ContentId, D, &mut self.image_id, decoder, offset + 0, _depth)?;
6094            fidl::decode!(ImageFlip, D, &mut self.flip, decoder, offset + 8, _depth)?;
6095            Ok(())
6096        }
6097    }
6098
6099    impl fidl::encoding::ValueTypeMarker for FlatlandSetImageOpacityRequest {
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 FlatlandSetImageOpacityRequest {
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>
6121        fidl::encoding::Encode<FlatlandSetImageOpacityRequest, D>
6122        for &FlatlandSetImageOpacityRequest
6123    {
6124        #[inline]
6125        unsafe fn encode(
6126            self,
6127            encoder: &mut fidl::encoding::Encoder<'_, D>,
6128            offset: usize,
6129            _depth: fidl::encoding::Depth,
6130        ) -> fidl::Result<()> {
6131            encoder.debug_check_bounds::<FlatlandSetImageOpacityRequest>(offset);
6132            // Delegate to tuple encoding.
6133            fidl::encoding::Encode::<FlatlandSetImageOpacityRequest, D>::encode(
6134                (
6135                    <ContentId as fidl::encoding::ValueTypeMarker>::borrow(&self.image_id),
6136                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.val),
6137                ),
6138                encoder,
6139                offset,
6140                _depth,
6141            )
6142        }
6143    }
6144    unsafe impl<
6145        D: fidl::encoding::ResourceDialect,
6146        T0: fidl::encoding::Encode<ContentId, D>,
6147        T1: fidl::encoding::Encode<f32, D>,
6148    > fidl::encoding::Encode<FlatlandSetImageOpacityRequest, D> for (T0, T1)
6149    {
6150        #[inline]
6151        unsafe fn encode(
6152            self,
6153            encoder: &mut fidl::encoding::Encoder<'_, D>,
6154            offset: usize,
6155            depth: fidl::encoding::Depth,
6156        ) -> fidl::Result<()> {
6157            encoder.debug_check_bounds::<FlatlandSetImageOpacityRequest>(offset);
6158            // Zero out padding regions. There's no need to apply masks
6159            // because the unmasked parts will be overwritten by fields.
6160            unsafe {
6161                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
6162                (ptr as *mut u64).write_unaligned(0);
6163            }
6164            // Write the fields.
6165            self.0.encode(encoder, offset + 0, depth)?;
6166            self.1.encode(encoder, offset + 8, depth)?;
6167            Ok(())
6168        }
6169    }
6170
6171    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6172        for FlatlandSetImageOpacityRequest
6173    {
6174        #[inline(always)]
6175        fn new_empty() -> Self {
6176            Self { image_id: fidl::new_empty!(ContentId, D), val: fidl::new_empty!(f32, D) }
6177        }
6178
6179        #[inline]
6180        unsafe fn decode(
6181            &mut self,
6182            decoder: &mut fidl::encoding::Decoder<'_, D>,
6183            offset: usize,
6184            _depth: fidl::encoding::Depth,
6185        ) -> fidl::Result<()> {
6186            decoder.debug_check_bounds::<Self>(offset);
6187            // Verify that padding bytes are zero.
6188            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
6189            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6190            let mask = 0xffffffff00000000u64;
6191            let maskedval = padval & mask;
6192            if maskedval != 0 {
6193                return Err(fidl::Error::NonZeroPadding {
6194                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
6195                });
6196            }
6197            fidl::decode!(ContentId, D, &mut self.image_id, decoder, offset + 0, _depth)?;
6198            fidl::decode!(f32, D, &mut self.val, decoder, offset + 8, _depth)?;
6199            Ok(())
6200        }
6201    }
6202
6203    impl fidl::encoding::ValueTypeMarker for FlatlandSetImageSampleRegionRequest {
6204        type Borrowed<'a> = &'a Self;
6205        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6206            value
6207        }
6208    }
6209
6210    unsafe impl fidl::encoding::TypeMarker for FlatlandSetImageSampleRegionRequest {
6211        type Owned = Self;
6212
6213        #[inline(always)]
6214        fn inline_align(_context: fidl::encoding::Context) -> usize {
6215            8
6216        }
6217
6218        #[inline(always)]
6219        fn inline_size(_context: fidl::encoding::Context) -> usize {
6220            24
6221        }
6222    }
6223
6224    unsafe impl<D: fidl::encoding::ResourceDialect>
6225        fidl::encoding::Encode<FlatlandSetImageSampleRegionRequest, D>
6226        for &FlatlandSetImageSampleRegionRequest
6227    {
6228        #[inline]
6229        unsafe fn encode(
6230            self,
6231            encoder: &mut fidl::encoding::Encoder<'_, D>,
6232            offset: usize,
6233            _depth: fidl::encoding::Depth,
6234        ) -> fidl::Result<()> {
6235            encoder.debug_check_bounds::<FlatlandSetImageSampleRegionRequest>(offset);
6236            // Delegate to tuple encoding.
6237            fidl::encoding::Encode::<FlatlandSetImageSampleRegionRequest, D>::encode(
6238                (
6239                    <ContentId as fidl::encoding::ValueTypeMarker>::borrow(&self.image_id),
6240                    <fidl_fuchsia_math_common::RectF as fidl::encoding::ValueTypeMarker>::borrow(
6241                        &self.rect,
6242                    ),
6243                ),
6244                encoder,
6245                offset,
6246                _depth,
6247            )
6248        }
6249    }
6250    unsafe impl<
6251        D: fidl::encoding::ResourceDialect,
6252        T0: fidl::encoding::Encode<ContentId, D>,
6253        T1: fidl::encoding::Encode<fidl_fuchsia_math_common::RectF, D>,
6254    > fidl::encoding::Encode<FlatlandSetImageSampleRegionRequest, D> for (T0, T1)
6255    {
6256        #[inline]
6257        unsafe fn encode(
6258            self,
6259            encoder: &mut fidl::encoding::Encoder<'_, D>,
6260            offset: usize,
6261            depth: fidl::encoding::Depth,
6262        ) -> fidl::Result<()> {
6263            encoder.debug_check_bounds::<FlatlandSetImageSampleRegionRequest>(offset);
6264            // Zero out padding regions. There's no need to apply masks
6265            // because the unmasked parts will be overwritten by fields.
6266            // Write the fields.
6267            self.0.encode(encoder, offset + 0, depth)?;
6268            self.1.encode(encoder, offset + 8, depth)?;
6269            Ok(())
6270        }
6271    }
6272
6273    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6274        for FlatlandSetImageSampleRegionRequest
6275    {
6276        #[inline(always)]
6277        fn new_empty() -> Self {
6278            Self {
6279                image_id: fidl::new_empty!(ContentId, D),
6280                rect: fidl::new_empty!(fidl_fuchsia_math_common::RectF, D),
6281            }
6282        }
6283
6284        #[inline]
6285        unsafe fn decode(
6286            &mut self,
6287            decoder: &mut fidl::encoding::Decoder<'_, D>,
6288            offset: usize,
6289            _depth: fidl::encoding::Depth,
6290        ) -> fidl::Result<()> {
6291            decoder.debug_check_bounds::<Self>(offset);
6292            // Verify that padding bytes are zero.
6293            fidl::decode!(ContentId, D, &mut self.image_id, decoder, offset + 0, _depth)?;
6294            fidl::decode!(
6295                fidl_fuchsia_math_common::RectF,
6296                D,
6297                &mut self.rect,
6298                decoder,
6299                offset + 8,
6300                _depth
6301            )?;
6302            Ok(())
6303        }
6304    }
6305
6306    impl fidl::encoding::ValueTypeMarker for FlatlandSetInfiniteHitRegionRequest {
6307        type Borrowed<'a> = &'a Self;
6308        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6309            value
6310        }
6311    }
6312
6313    unsafe impl fidl::encoding::TypeMarker for FlatlandSetInfiniteHitRegionRequest {
6314        type Owned = Self;
6315
6316        #[inline(always)]
6317        fn inline_align(_context: fidl::encoding::Context) -> usize {
6318            8
6319        }
6320
6321        #[inline(always)]
6322        fn inline_size(_context: fidl::encoding::Context) -> usize {
6323            16
6324        }
6325    }
6326
6327    unsafe impl<D: fidl::encoding::ResourceDialect>
6328        fidl::encoding::Encode<FlatlandSetInfiniteHitRegionRequest, D>
6329        for &FlatlandSetInfiniteHitRegionRequest
6330    {
6331        #[inline]
6332        unsafe fn encode(
6333            self,
6334            encoder: &mut fidl::encoding::Encoder<'_, D>,
6335            offset: usize,
6336            _depth: fidl::encoding::Depth,
6337        ) -> fidl::Result<()> {
6338            encoder.debug_check_bounds::<FlatlandSetInfiniteHitRegionRequest>(offset);
6339            // Delegate to tuple encoding.
6340            fidl::encoding::Encode::<FlatlandSetInfiniteHitRegionRequest, D>::encode(
6341                (
6342                    <TransformId as fidl::encoding::ValueTypeMarker>::borrow(&self.transform_id),
6343                    <HitTestInteraction as fidl::encoding::ValueTypeMarker>::borrow(&self.hit_test),
6344                ),
6345                encoder,
6346                offset,
6347                _depth,
6348            )
6349        }
6350    }
6351    unsafe impl<
6352        D: fidl::encoding::ResourceDialect,
6353        T0: fidl::encoding::Encode<TransformId, D>,
6354        T1: fidl::encoding::Encode<HitTestInteraction, D>,
6355    > fidl::encoding::Encode<FlatlandSetInfiniteHitRegionRequest, D> for (T0, T1)
6356    {
6357        #[inline]
6358        unsafe fn encode(
6359            self,
6360            encoder: &mut fidl::encoding::Encoder<'_, D>,
6361            offset: usize,
6362            depth: fidl::encoding::Depth,
6363        ) -> fidl::Result<()> {
6364            encoder.debug_check_bounds::<FlatlandSetInfiniteHitRegionRequest>(offset);
6365            // Zero out padding regions. There's no need to apply masks
6366            // because the unmasked parts will be overwritten by fields.
6367            unsafe {
6368                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
6369                (ptr as *mut u64).write_unaligned(0);
6370            }
6371            // Write the fields.
6372            self.0.encode(encoder, offset + 0, depth)?;
6373            self.1.encode(encoder, offset + 8, depth)?;
6374            Ok(())
6375        }
6376    }
6377
6378    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6379        for FlatlandSetInfiniteHitRegionRequest
6380    {
6381        #[inline(always)]
6382        fn new_empty() -> Self {
6383            Self {
6384                transform_id: fidl::new_empty!(TransformId, D),
6385                hit_test: fidl::new_empty!(HitTestInteraction, D),
6386            }
6387        }
6388
6389        #[inline]
6390        unsafe fn decode(
6391            &mut self,
6392            decoder: &mut fidl::encoding::Decoder<'_, D>,
6393            offset: usize,
6394            _depth: fidl::encoding::Depth,
6395        ) -> fidl::Result<()> {
6396            decoder.debug_check_bounds::<Self>(offset);
6397            // Verify that padding bytes are zero.
6398            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
6399            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6400            let mask = 0xffffffffffffff00u64;
6401            let maskedval = padval & mask;
6402            if maskedval != 0 {
6403                return Err(fidl::Error::NonZeroPadding {
6404                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
6405                });
6406            }
6407            fidl::decode!(TransformId, D, &mut self.transform_id, decoder, offset + 0, _depth)?;
6408            fidl::decode!(HitTestInteraction, D, &mut self.hit_test, decoder, offset + 8, _depth)?;
6409            Ok(())
6410        }
6411    }
6412
6413    impl fidl::encoding::ValueTypeMarker for FlatlandSetOpacityRequest {
6414        type Borrowed<'a> = &'a Self;
6415        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6416            value
6417        }
6418    }
6419
6420    unsafe impl fidl::encoding::TypeMarker for FlatlandSetOpacityRequest {
6421        type Owned = Self;
6422
6423        #[inline(always)]
6424        fn inline_align(_context: fidl::encoding::Context) -> usize {
6425            8
6426        }
6427
6428        #[inline(always)]
6429        fn inline_size(_context: fidl::encoding::Context) -> usize {
6430            16
6431        }
6432    }
6433
6434    unsafe impl<D: fidl::encoding::ResourceDialect>
6435        fidl::encoding::Encode<FlatlandSetOpacityRequest, D> for &FlatlandSetOpacityRequest
6436    {
6437        #[inline]
6438        unsafe fn encode(
6439            self,
6440            encoder: &mut fidl::encoding::Encoder<'_, D>,
6441            offset: usize,
6442            _depth: fidl::encoding::Depth,
6443        ) -> fidl::Result<()> {
6444            encoder.debug_check_bounds::<FlatlandSetOpacityRequest>(offset);
6445            // Delegate to tuple encoding.
6446            fidl::encoding::Encode::<FlatlandSetOpacityRequest, D>::encode(
6447                (
6448                    <TransformId as fidl::encoding::ValueTypeMarker>::borrow(&self.transform_id),
6449                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
6450                ),
6451                encoder,
6452                offset,
6453                _depth,
6454            )
6455        }
6456    }
6457    unsafe impl<
6458        D: fidl::encoding::ResourceDialect,
6459        T0: fidl::encoding::Encode<TransformId, D>,
6460        T1: fidl::encoding::Encode<f32, D>,
6461    > fidl::encoding::Encode<FlatlandSetOpacityRequest, D> for (T0, T1)
6462    {
6463        #[inline]
6464        unsafe fn encode(
6465            self,
6466            encoder: &mut fidl::encoding::Encoder<'_, D>,
6467            offset: usize,
6468            depth: fidl::encoding::Depth,
6469        ) -> fidl::Result<()> {
6470            encoder.debug_check_bounds::<FlatlandSetOpacityRequest>(offset);
6471            // Zero out padding regions. There's no need to apply masks
6472            // because the unmasked parts will be overwritten by fields.
6473            unsafe {
6474                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
6475                (ptr as *mut u64).write_unaligned(0);
6476            }
6477            // Write the fields.
6478            self.0.encode(encoder, offset + 0, depth)?;
6479            self.1.encode(encoder, offset + 8, depth)?;
6480            Ok(())
6481        }
6482    }
6483
6484    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6485        for FlatlandSetOpacityRequest
6486    {
6487        #[inline(always)]
6488        fn new_empty() -> Self {
6489            Self { transform_id: fidl::new_empty!(TransformId, D), value: fidl::new_empty!(f32, D) }
6490        }
6491
6492        #[inline]
6493        unsafe fn decode(
6494            &mut self,
6495            decoder: &mut fidl::encoding::Decoder<'_, D>,
6496            offset: usize,
6497            _depth: fidl::encoding::Depth,
6498        ) -> fidl::Result<()> {
6499            decoder.debug_check_bounds::<Self>(offset);
6500            // Verify that padding bytes are zero.
6501            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
6502            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6503            let mask = 0xffffffff00000000u64;
6504            let maskedval = padval & mask;
6505            if maskedval != 0 {
6506                return Err(fidl::Error::NonZeroPadding {
6507                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
6508                });
6509            }
6510            fidl::decode!(TransformId, D, &mut self.transform_id, decoder, offset + 0, _depth)?;
6511            fidl::decode!(f32, D, &mut self.value, decoder, offset + 8, _depth)?;
6512            Ok(())
6513        }
6514    }
6515
6516    impl fidl::encoding::ValueTypeMarker for FlatlandSetOrientationRequest {
6517        type Borrowed<'a> = &'a Self;
6518        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6519            value
6520        }
6521    }
6522
6523    unsafe impl fidl::encoding::TypeMarker for FlatlandSetOrientationRequest {
6524        type Owned = Self;
6525
6526        #[inline(always)]
6527        fn inline_align(_context: fidl::encoding::Context) -> usize {
6528            8
6529        }
6530
6531        #[inline(always)]
6532        fn inline_size(_context: fidl::encoding::Context) -> usize {
6533            16
6534        }
6535    }
6536
6537    unsafe impl<D: fidl::encoding::ResourceDialect>
6538        fidl::encoding::Encode<FlatlandSetOrientationRequest, D>
6539        for &FlatlandSetOrientationRequest
6540    {
6541        #[inline]
6542        unsafe fn encode(
6543            self,
6544            encoder: &mut fidl::encoding::Encoder<'_, D>,
6545            offset: usize,
6546            _depth: fidl::encoding::Depth,
6547        ) -> fidl::Result<()> {
6548            encoder.debug_check_bounds::<FlatlandSetOrientationRequest>(offset);
6549            // Delegate to tuple encoding.
6550            fidl::encoding::Encode::<FlatlandSetOrientationRequest, D>::encode(
6551                (
6552                    <TransformId as fidl::encoding::ValueTypeMarker>::borrow(&self.transform_id),
6553                    <Orientation as fidl::encoding::ValueTypeMarker>::borrow(&self.orientation),
6554                ),
6555                encoder,
6556                offset,
6557                _depth,
6558            )
6559        }
6560    }
6561    unsafe impl<
6562        D: fidl::encoding::ResourceDialect,
6563        T0: fidl::encoding::Encode<TransformId, D>,
6564        T1: fidl::encoding::Encode<Orientation, D>,
6565    > fidl::encoding::Encode<FlatlandSetOrientationRequest, D> for (T0, T1)
6566    {
6567        #[inline]
6568        unsafe fn encode(
6569            self,
6570            encoder: &mut fidl::encoding::Encoder<'_, D>,
6571            offset: usize,
6572            depth: fidl::encoding::Depth,
6573        ) -> fidl::Result<()> {
6574            encoder.debug_check_bounds::<FlatlandSetOrientationRequest>(offset);
6575            // Zero out padding regions. There's no need to apply masks
6576            // because the unmasked parts will be overwritten by fields.
6577            unsafe {
6578                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
6579                (ptr as *mut u64).write_unaligned(0);
6580            }
6581            // Write the fields.
6582            self.0.encode(encoder, offset + 0, depth)?;
6583            self.1.encode(encoder, offset + 8, depth)?;
6584            Ok(())
6585        }
6586    }
6587
6588    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6589        for FlatlandSetOrientationRequest
6590    {
6591        #[inline(always)]
6592        fn new_empty() -> Self {
6593            Self {
6594                transform_id: fidl::new_empty!(TransformId, D),
6595                orientation: fidl::new_empty!(Orientation, D),
6596            }
6597        }
6598
6599        #[inline]
6600        unsafe fn decode(
6601            &mut self,
6602            decoder: &mut fidl::encoding::Decoder<'_, D>,
6603            offset: usize,
6604            _depth: fidl::encoding::Depth,
6605        ) -> fidl::Result<()> {
6606            decoder.debug_check_bounds::<Self>(offset);
6607            // Verify that padding bytes are zero.
6608            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
6609            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6610            let mask = 0xffffffff00000000u64;
6611            let maskedval = padval & mask;
6612            if maskedval != 0 {
6613                return Err(fidl::Error::NonZeroPadding {
6614                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
6615                });
6616            }
6617            fidl::decode!(TransformId, D, &mut self.transform_id, decoder, offset + 0, _depth)?;
6618            fidl::decode!(Orientation, D, &mut self.orientation, decoder, offset + 8, _depth)?;
6619            Ok(())
6620        }
6621    }
6622
6623    impl fidl::encoding::ValueTypeMarker for FlatlandSetRootTransformRequest {
6624        type Borrowed<'a> = &'a Self;
6625        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6626            value
6627        }
6628    }
6629
6630    unsafe impl fidl::encoding::TypeMarker for FlatlandSetRootTransformRequest {
6631        type Owned = Self;
6632
6633        #[inline(always)]
6634        fn inline_align(_context: fidl::encoding::Context) -> usize {
6635            8
6636        }
6637
6638        #[inline(always)]
6639        fn inline_size(_context: fidl::encoding::Context) -> usize {
6640            8
6641        }
6642        #[inline(always)]
6643        fn encode_is_copy() -> bool {
6644            true
6645        }
6646
6647        #[inline(always)]
6648        fn decode_is_copy() -> bool {
6649            true
6650        }
6651    }
6652
6653    unsafe impl<D: fidl::encoding::ResourceDialect>
6654        fidl::encoding::Encode<FlatlandSetRootTransformRequest, D>
6655        for &FlatlandSetRootTransformRequest
6656    {
6657        #[inline]
6658        unsafe fn encode(
6659            self,
6660            encoder: &mut fidl::encoding::Encoder<'_, D>,
6661            offset: usize,
6662            _depth: fidl::encoding::Depth,
6663        ) -> fidl::Result<()> {
6664            encoder.debug_check_bounds::<FlatlandSetRootTransformRequest>(offset);
6665            unsafe {
6666                // Copy the object into the buffer.
6667                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6668                (buf_ptr as *mut FlatlandSetRootTransformRequest)
6669                    .write_unaligned((self as *const FlatlandSetRootTransformRequest).read());
6670                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6671                // done second because the memcpy will write garbage to these bytes.
6672            }
6673            Ok(())
6674        }
6675    }
6676    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TransformId, D>>
6677        fidl::encoding::Encode<FlatlandSetRootTransformRequest, D> for (T0,)
6678    {
6679        #[inline]
6680        unsafe fn encode(
6681            self,
6682            encoder: &mut fidl::encoding::Encoder<'_, D>,
6683            offset: usize,
6684            depth: fidl::encoding::Depth,
6685        ) -> fidl::Result<()> {
6686            encoder.debug_check_bounds::<FlatlandSetRootTransformRequest>(offset);
6687            // Zero out padding regions. There's no need to apply masks
6688            // because the unmasked parts will be overwritten by fields.
6689            // Write the fields.
6690            self.0.encode(encoder, offset + 0, depth)?;
6691            Ok(())
6692        }
6693    }
6694
6695    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6696        for FlatlandSetRootTransformRequest
6697    {
6698        #[inline(always)]
6699        fn new_empty() -> Self {
6700            Self { transform_id: fidl::new_empty!(TransformId, D) }
6701        }
6702
6703        #[inline]
6704        unsafe fn decode(
6705            &mut self,
6706            decoder: &mut fidl::encoding::Decoder<'_, D>,
6707            offset: usize,
6708            _depth: fidl::encoding::Depth,
6709        ) -> fidl::Result<()> {
6710            decoder.debug_check_bounds::<Self>(offset);
6711            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6712            // Verify that padding bytes are zero.
6713            // Copy from the buffer into the object.
6714            unsafe {
6715                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
6716            }
6717            Ok(())
6718        }
6719    }
6720
6721    impl fidl::encoding::ValueTypeMarker for FlatlandSetScaleRequest {
6722        type Borrowed<'a> = &'a Self;
6723        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6724            value
6725        }
6726    }
6727
6728    unsafe impl fidl::encoding::TypeMarker for FlatlandSetScaleRequest {
6729        type Owned = Self;
6730
6731        #[inline(always)]
6732        fn inline_align(_context: fidl::encoding::Context) -> usize {
6733            8
6734        }
6735
6736        #[inline(always)]
6737        fn inline_size(_context: fidl::encoding::Context) -> usize {
6738            16
6739        }
6740    }
6741
6742    unsafe impl<D: fidl::encoding::ResourceDialect>
6743        fidl::encoding::Encode<FlatlandSetScaleRequest, D> for &FlatlandSetScaleRequest
6744    {
6745        #[inline]
6746        unsafe fn encode(
6747            self,
6748            encoder: &mut fidl::encoding::Encoder<'_, D>,
6749            offset: usize,
6750            _depth: fidl::encoding::Depth,
6751        ) -> fidl::Result<()> {
6752            encoder.debug_check_bounds::<FlatlandSetScaleRequest>(offset);
6753            // Delegate to tuple encoding.
6754            fidl::encoding::Encode::<FlatlandSetScaleRequest, D>::encode(
6755                (
6756                    <TransformId as fidl::encoding::ValueTypeMarker>::borrow(&self.transform_id),
6757                    <fidl_fuchsia_math_common::VecF as fidl::encoding::ValueTypeMarker>::borrow(
6758                        &self.scale,
6759                    ),
6760                ),
6761                encoder,
6762                offset,
6763                _depth,
6764            )
6765        }
6766    }
6767    unsafe impl<
6768        D: fidl::encoding::ResourceDialect,
6769        T0: fidl::encoding::Encode<TransformId, D>,
6770        T1: fidl::encoding::Encode<fidl_fuchsia_math_common::VecF, D>,
6771    > fidl::encoding::Encode<FlatlandSetScaleRequest, D> for (T0, T1)
6772    {
6773        #[inline]
6774        unsafe fn encode(
6775            self,
6776            encoder: &mut fidl::encoding::Encoder<'_, D>,
6777            offset: usize,
6778            depth: fidl::encoding::Depth,
6779        ) -> fidl::Result<()> {
6780            encoder.debug_check_bounds::<FlatlandSetScaleRequest>(offset);
6781            // Zero out padding regions. There's no need to apply masks
6782            // because the unmasked parts will be overwritten by fields.
6783            // Write the fields.
6784            self.0.encode(encoder, offset + 0, depth)?;
6785            self.1.encode(encoder, offset + 8, depth)?;
6786            Ok(())
6787        }
6788    }
6789
6790    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6791        for FlatlandSetScaleRequest
6792    {
6793        #[inline(always)]
6794        fn new_empty() -> Self {
6795            Self {
6796                transform_id: fidl::new_empty!(TransformId, D),
6797                scale: fidl::new_empty!(fidl_fuchsia_math_common::VecF, D),
6798            }
6799        }
6800
6801        #[inline]
6802        unsafe fn decode(
6803            &mut self,
6804            decoder: &mut fidl::encoding::Decoder<'_, D>,
6805            offset: usize,
6806            _depth: fidl::encoding::Depth,
6807        ) -> fidl::Result<()> {
6808            decoder.debug_check_bounds::<Self>(offset);
6809            // Verify that padding bytes are zero.
6810            fidl::decode!(TransformId, D, &mut self.transform_id, decoder, offset + 0, _depth)?;
6811            fidl::decode!(
6812                fidl_fuchsia_math_common::VecF,
6813                D,
6814                &mut self.scale,
6815                decoder,
6816                offset + 8,
6817                _depth
6818            )?;
6819            Ok(())
6820        }
6821    }
6822
6823    impl fidl::encoding::ValueTypeMarker for FlatlandSetTranslationRequest {
6824        type Borrowed<'a> = &'a Self;
6825        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6826            value
6827        }
6828    }
6829
6830    unsafe impl fidl::encoding::TypeMarker for FlatlandSetTranslationRequest {
6831        type Owned = Self;
6832
6833        #[inline(always)]
6834        fn inline_align(_context: fidl::encoding::Context) -> usize {
6835            8
6836        }
6837
6838        #[inline(always)]
6839        fn inline_size(_context: fidl::encoding::Context) -> usize {
6840            16
6841        }
6842    }
6843
6844    unsafe impl<D: fidl::encoding::ResourceDialect>
6845        fidl::encoding::Encode<FlatlandSetTranslationRequest, D>
6846        for &FlatlandSetTranslationRequest
6847    {
6848        #[inline]
6849        unsafe fn encode(
6850            self,
6851            encoder: &mut fidl::encoding::Encoder<'_, D>,
6852            offset: usize,
6853            _depth: fidl::encoding::Depth,
6854        ) -> fidl::Result<()> {
6855            encoder.debug_check_bounds::<FlatlandSetTranslationRequest>(offset);
6856            // Delegate to tuple encoding.
6857            fidl::encoding::Encode::<FlatlandSetTranslationRequest, D>::encode(
6858                (
6859                    <TransformId as fidl::encoding::ValueTypeMarker>::borrow(&self.transform_id),
6860                    <fidl_fuchsia_math_common::Vec_ as fidl::encoding::ValueTypeMarker>::borrow(
6861                        &self.translation,
6862                    ),
6863                ),
6864                encoder,
6865                offset,
6866                _depth,
6867            )
6868        }
6869    }
6870    unsafe impl<
6871        D: fidl::encoding::ResourceDialect,
6872        T0: fidl::encoding::Encode<TransformId, D>,
6873        T1: fidl::encoding::Encode<fidl_fuchsia_math_common::Vec_, D>,
6874    > fidl::encoding::Encode<FlatlandSetTranslationRequest, D> for (T0, T1)
6875    {
6876        #[inline]
6877        unsafe fn encode(
6878            self,
6879            encoder: &mut fidl::encoding::Encoder<'_, D>,
6880            offset: usize,
6881            depth: fidl::encoding::Depth,
6882        ) -> fidl::Result<()> {
6883            encoder.debug_check_bounds::<FlatlandSetTranslationRequest>(offset);
6884            // Zero out padding regions. There's no need to apply masks
6885            // because the unmasked parts will be overwritten by fields.
6886            // Write the fields.
6887            self.0.encode(encoder, offset + 0, depth)?;
6888            self.1.encode(encoder, offset + 8, depth)?;
6889            Ok(())
6890        }
6891    }
6892
6893    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6894        for FlatlandSetTranslationRequest
6895    {
6896        #[inline(always)]
6897        fn new_empty() -> Self {
6898            Self {
6899                transform_id: fidl::new_empty!(TransformId, D),
6900                translation: fidl::new_empty!(fidl_fuchsia_math_common::Vec_, D),
6901            }
6902        }
6903
6904        #[inline]
6905        unsafe fn decode(
6906            &mut self,
6907            decoder: &mut fidl::encoding::Decoder<'_, D>,
6908            offset: usize,
6909            _depth: fidl::encoding::Depth,
6910        ) -> fidl::Result<()> {
6911            decoder.debug_check_bounds::<Self>(offset);
6912            // Verify that padding bytes are zero.
6913            fidl::decode!(TransformId, D, &mut self.transform_id, decoder, offset + 0, _depth)?;
6914            fidl::decode!(
6915                fidl_fuchsia_math_common::Vec_,
6916                D,
6917                &mut self.translation,
6918                decoder,
6919                offset + 8,
6920                _depth
6921            )?;
6922            Ok(())
6923        }
6924    }
6925
6926    impl fidl::encoding::ValueTypeMarker for FlatlandSetViewportPropertiesRequest {
6927        type Borrowed<'a> = &'a Self;
6928        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6929            value
6930        }
6931    }
6932
6933    unsafe impl fidl::encoding::TypeMarker for FlatlandSetViewportPropertiesRequest {
6934        type Owned = Self;
6935
6936        #[inline(always)]
6937        fn inline_align(_context: fidl::encoding::Context) -> usize {
6938            8
6939        }
6940
6941        #[inline(always)]
6942        fn inline_size(_context: fidl::encoding::Context) -> usize {
6943            24
6944        }
6945    }
6946
6947    unsafe impl<D: fidl::encoding::ResourceDialect>
6948        fidl::encoding::Encode<FlatlandSetViewportPropertiesRequest, D>
6949        for &FlatlandSetViewportPropertiesRequest
6950    {
6951        #[inline]
6952        unsafe fn encode(
6953            self,
6954            encoder: &mut fidl::encoding::Encoder<'_, D>,
6955            offset: usize,
6956            _depth: fidl::encoding::Depth,
6957        ) -> fidl::Result<()> {
6958            encoder.debug_check_bounds::<FlatlandSetViewportPropertiesRequest>(offset);
6959            // Delegate to tuple encoding.
6960            fidl::encoding::Encode::<FlatlandSetViewportPropertiesRequest, D>::encode(
6961                (
6962                    <ContentId as fidl::encoding::ValueTypeMarker>::borrow(&self.viewport_id),
6963                    <ViewportProperties as fidl::encoding::ValueTypeMarker>::borrow(
6964                        &self.properties,
6965                    ),
6966                ),
6967                encoder,
6968                offset,
6969                _depth,
6970            )
6971        }
6972    }
6973    unsafe impl<
6974        D: fidl::encoding::ResourceDialect,
6975        T0: fidl::encoding::Encode<ContentId, D>,
6976        T1: fidl::encoding::Encode<ViewportProperties, D>,
6977    > fidl::encoding::Encode<FlatlandSetViewportPropertiesRequest, D> for (T0, T1)
6978    {
6979        #[inline]
6980        unsafe fn encode(
6981            self,
6982            encoder: &mut fidl::encoding::Encoder<'_, D>,
6983            offset: usize,
6984            depth: fidl::encoding::Depth,
6985        ) -> fidl::Result<()> {
6986            encoder.debug_check_bounds::<FlatlandSetViewportPropertiesRequest>(offset);
6987            // Zero out padding regions. There's no need to apply masks
6988            // because the unmasked parts will be overwritten by fields.
6989            // Write the fields.
6990            self.0.encode(encoder, offset + 0, depth)?;
6991            self.1.encode(encoder, offset + 8, depth)?;
6992            Ok(())
6993        }
6994    }
6995
6996    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6997        for FlatlandSetViewportPropertiesRequest
6998    {
6999        #[inline(always)]
7000        fn new_empty() -> Self {
7001            Self {
7002                viewport_id: fidl::new_empty!(ContentId, D),
7003                properties: fidl::new_empty!(ViewportProperties, D),
7004            }
7005        }
7006
7007        #[inline]
7008        unsafe fn decode(
7009            &mut self,
7010            decoder: &mut fidl::encoding::Decoder<'_, D>,
7011            offset: usize,
7012            _depth: fidl::encoding::Depth,
7013        ) -> fidl::Result<()> {
7014            decoder.debug_check_bounds::<Self>(offset);
7015            // Verify that padding bytes are zero.
7016            fidl::decode!(ContentId, D, &mut self.viewport_id, decoder, offset + 0, _depth)?;
7017            fidl::decode!(
7018                ViewportProperties,
7019                D,
7020                &mut self.properties,
7021                decoder,
7022                offset + 8,
7023                _depth
7024            )?;
7025            Ok(())
7026        }
7027    }
7028
7029    impl fidl::encoding::ValueTypeMarker for HitRegion {
7030        type Borrowed<'a> = &'a Self;
7031        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7032            value
7033        }
7034    }
7035
7036    unsafe impl fidl::encoding::TypeMarker for HitRegion {
7037        type Owned = Self;
7038
7039        #[inline(always)]
7040        fn inline_align(_context: fidl::encoding::Context) -> usize {
7041            4
7042        }
7043
7044        #[inline(always)]
7045        fn inline_size(_context: fidl::encoding::Context) -> usize {
7046            20
7047        }
7048    }
7049
7050    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HitRegion, D>
7051        for &HitRegion
7052    {
7053        #[inline]
7054        unsafe fn encode(
7055            self,
7056            encoder: &mut fidl::encoding::Encoder<'_, D>,
7057            offset: usize,
7058            _depth: fidl::encoding::Depth,
7059        ) -> fidl::Result<()> {
7060            encoder.debug_check_bounds::<HitRegion>(offset);
7061            // Delegate to tuple encoding.
7062            fidl::encoding::Encode::<HitRegion, D>::encode(
7063                (
7064                    <fidl_fuchsia_math_common::RectF as fidl::encoding::ValueTypeMarker>::borrow(
7065                        &self.region,
7066                    ),
7067                    <HitTestInteraction as fidl::encoding::ValueTypeMarker>::borrow(&self.hit_test),
7068                ),
7069                encoder,
7070                offset,
7071                _depth,
7072            )
7073        }
7074    }
7075    unsafe impl<
7076        D: fidl::encoding::ResourceDialect,
7077        T0: fidl::encoding::Encode<fidl_fuchsia_math_common::RectF, D>,
7078        T1: fidl::encoding::Encode<HitTestInteraction, D>,
7079    > fidl::encoding::Encode<HitRegion, D> for (T0, T1)
7080    {
7081        #[inline]
7082        unsafe fn encode(
7083            self,
7084            encoder: &mut fidl::encoding::Encoder<'_, D>,
7085            offset: usize,
7086            depth: fidl::encoding::Depth,
7087        ) -> fidl::Result<()> {
7088            encoder.debug_check_bounds::<HitRegion>(offset);
7089            // Zero out padding regions. There's no need to apply masks
7090            // because the unmasked parts will be overwritten by fields.
7091            unsafe {
7092                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7093                (ptr as *mut u32).write_unaligned(0);
7094            }
7095            // Write the fields.
7096            self.0.encode(encoder, offset + 0, depth)?;
7097            self.1.encode(encoder, offset + 16, depth)?;
7098            Ok(())
7099        }
7100    }
7101
7102    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HitRegion {
7103        #[inline(always)]
7104        fn new_empty() -> Self {
7105            Self {
7106                region: fidl::new_empty!(fidl_fuchsia_math_common::RectF, D),
7107                hit_test: fidl::new_empty!(HitTestInteraction, D),
7108            }
7109        }
7110
7111        #[inline]
7112        unsafe fn decode(
7113            &mut self,
7114            decoder: &mut fidl::encoding::Decoder<'_, D>,
7115            offset: usize,
7116            _depth: fidl::encoding::Depth,
7117        ) -> fidl::Result<()> {
7118            decoder.debug_check_bounds::<Self>(offset);
7119            // Verify that padding bytes are zero.
7120            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7121            let padval = unsafe { (ptr as *const u32).read_unaligned() };
7122            let mask = 0xffffff00u32;
7123            let maskedval = padval & mask;
7124            if maskedval != 0 {
7125                return Err(fidl::Error::NonZeroPadding {
7126                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7127                });
7128            }
7129            fidl::decode!(
7130                fidl_fuchsia_math_common::RectF,
7131                D,
7132                &mut self.region,
7133                decoder,
7134                offset + 0,
7135                _depth
7136            )?;
7137            fidl::decode!(HitTestInteraction, D, &mut self.hit_test, decoder, offset + 16, _depth)?;
7138            Ok(())
7139        }
7140    }
7141
7142    impl fidl::encoding::ValueTypeMarker for ImageId {
7143        type Borrowed<'a> = &'a Self;
7144        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7145            value
7146        }
7147    }
7148
7149    unsafe impl fidl::encoding::TypeMarker for ImageId {
7150        type Owned = Self;
7151
7152        #[inline(always)]
7153        fn inline_align(_context: fidl::encoding::Context) -> usize {
7154            8
7155        }
7156
7157        #[inline(always)]
7158        fn inline_size(_context: fidl::encoding::Context) -> usize {
7159            8
7160        }
7161        #[inline(always)]
7162        fn encode_is_copy() -> bool {
7163            true
7164        }
7165
7166        #[inline(always)]
7167        fn decode_is_copy() -> bool {
7168            true
7169        }
7170    }
7171
7172    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageId, D> for &ImageId {
7173        #[inline]
7174        unsafe fn encode(
7175            self,
7176            encoder: &mut fidl::encoding::Encoder<'_, D>,
7177            offset: usize,
7178            _depth: fidl::encoding::Depth,
7179        ) -> fidl::Result<()> {
7180            encoder.debug_check_bounds::<ImageId>(offset);
7181            unsafe {
7182                // Copy the object into the buffer.
7183                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7184                (buf_ptr as *mut ImageId).write_unaligned((self as *const ImageId).read());
7185                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7186                // done second because the memcpy will write garbage to these bytes.
7187            }
7188            Ok(())
7189        }
7190    }
7191    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
7192        fidl::encoding::Encode<ImageId, D> for (T0,)
7193    {
7194        #[inline]
7195        unsafe fn encode(
7196            self,
7197            encoder: &mut fidl::encoding::Encoder<'_, D>,
7198            offset: usize,
7199            depth: fidl::encoding::Depth,
7200        ) -> fidl::Result<()> {
7201            encoder.debug_check_bounds::<ImageId>(offset);
7202            // Zero out padding regions. There's no need to apply masks
7203            // because the unmasked parts will be overwritten by fields.
7204            // Write the fields.
7205            self.0.encode(encoder, offset + 0, depth)?;
7206            Ok(())
7207        }
7208    }
7209
7210    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageId {
7211        #[inline(always)]
7212        fn new_empty() -> Self {
7213            Self { value: fidl::new_empty!(u64, D) }
7214        }
7215
7216        #[inline]
7217        unsafe fn decode(
7218            &mut self,
7219            decoder: &mut fidl::encoding::Decoder<'_, D>,
7220            offset: usize,
7221            _depth: fidl::encoding::Depth,
7222        ) -> fidl::Result<()> {
7223            decoder.debug_check_bounds::<Self>(offset);
7224            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7225            // Verify that padding bytes are zero.
7226            // Copy from the buffer into the object.
7227            unsafe {
7228                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7229            }
7230            Ok(())
7231        }
7232    }
7233
7234    impl fidl::encoding::ValueTypeMarker for LayerId {
7235        type Borrowed<'a> = &'a Self;
7236        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7237            value
7238        }
7239    }
7240
7241    unsafe impl fidl::encoding::TypeMarker for LayerId {
7242        type Owned = Self;
7243
7244        #[inline(always)]
7245        fn inline_align(_context: fidl::encoding::Context) -> usize {
7246            8
7247        }
7248
7249        #[inline(always)]
7250        fn inline_size(_context: fidl::encoding::Context) -> usize {
7251            8
7252        }
7253        #[inline(always)]
7254        fn encode_is_copy() -> bool {
7255            true
7256        }
7257
7258        #[inline(always)]
7259        fn decode_is_copy() -> bool {
7260            true
7261        }
7262    }
7263
7264    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayerId, D> for &LayerId {
7265        #[inline]
7266        unsafe fn encode(
7267            self,
7268            encoder: &mut fidl::encoding::Encoder<'_, D>,
7269            offset: usize,
7270            _depth: fidl::encoding::Depth,
7271        ) -> fidl::Result<()> {
7272            encoder.debug_check_bounds::<LayerId>(offset);
7273            unsafe {
7274                // Copy the object into the buffer.
7275                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7276                (buf_ptr as *mut LayerId).write_unaligned((self as *const LayerId).read());
7277                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7278                // done second because the memcpy will write garbage to these bytes.
7279            }
7280            Ok(())
7281        }
7282    }
7283    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
7284        fidl::encoding::Encode<LayerId, D> for (T0,)
7285    {
7286        #[inline]
7287        unsafe fn encode(
7288            self,
7289            encoder: &mut fidl::encoding::Encoder<'_, D>,
7290            offset: usize,
7291            depth: fidl::encoding::Depth,
7292        ) -> fidl::Result<()> {
7293            encoder.debug_check_bounds::<LayerId>(offset);
7294            // Zero out padding regions. There's no need to apply masks
7295            // because the unmasked parts will be overwritten by fields.
7296            // Write the fields.
7297            self.0.encode(encoder, offset + 0, depth)?;
7298            Ok(())
7299        }
7300    }
7301
7302    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayerId {
7303        #[inline(always)]
7304        fn new_empty() -> Self {
7305            Self { value: fidl::new_empty!(u64, D) }
7306        }
7307
7308        #[inline]
7309        unsafe fn decode(
7310            &mut self,
7311            decoder: &mut fidl::encoding::Decoder<'_, D>,
7312            offset: usize,
7313            _depth: fidl::encoding::Depth,
7314        ) -> fidl::Result<()> {
7315            decoder.debug_check_bounds::<Self>(offset);
7316            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7317            // Verify that padding bytes are zero.
7318            // Copy from the buffer into the object.
7319            unsafe {
7320                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7321            }
7322            Ok(())
7323        }
7324    }
7325
7326    impl fidl::encoding::ValueTypeMarker for LayerStackId {
7327        type Borrowed<'a> = &'a Self;
7328        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7329            value
7330        }
7331    }
7332
7333    unsafe impl fidl::encoding::TypeMarker for LayerStackId {
7334        type Owned = Self;
7335
7336        #[inline(always)]
7337        fn inline_align(_context: fidl::encoding::Context) -> usize {
7338            8
7339        }
7340
7341        #[inline(always)]
7342        fn inline_size(_context: fidl::encoding::Context) -> usize {
7343            8
7344        }
7345        #[inline(always)]
7346        fn encode_is_copy() -> bool {
7347            true
7348        }
7349
7350        #[inline(always)]
7351        fn decode_is_copy() -> bool {
7352            true
7353        }
7354    }
7355
7356    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayerStackId, D>
7357        for &LayerStackId
7358    {
7359        #[inline]
7360        unsafe fn encode(
7361            self,
7362            encoder: &mut fidl::encoding::Encoder<'_, D>,
7363            offset: usize,
7364            _depth: fidl::encoding::Depth,
7365        ) -> fidl::Result<()> {
7366            encoder.debug_check_bounds::<LayerStackId>(offset);
7367            unsafe {
7368                // Copy the object into the buffer.
7369                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7370                (buf_ptr as *mut LayerStackId)
7371                    .write_unaligned((self as *const LayerStackId).read());
7372                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7373                // done second because the memcpy will write garbage to these bytes.
7374            }
7375            Ok(())
7376        }
7377    }
7378    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
7379        fidl::encoding::Encode<LayerStackId, D> for (T0,)
7380    {
7381        #[inline]
7382        unsafe fn encode(
7383            self,
7384            encoder: &mut fidl::encoding::Encoder<'_, D>,
7385            offset: usize,
7386            depth: fidl::encoding::Depth,
7387        ) -> fidl::Result<()> {
7388            encoder.debug_check_bounds::<LayerStackId>(offset);
7389            // Zero out padding regions. There's no need to apply masks
7390            // because the unmasked parts will be overwritten by fields.
7391            // Write the fields.
7392            self.0.encode(encoder, offset + 0, depth)?;
7393            Ok(())
7394        }
7395    }
7396
7397    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayerStackId {
7398        #[inline(always)]
7399        fn new_empty() -> Self {
7400            Self { value: fidl::new_empty!(u64, D) }
7401        }
7402
7403        #[inline]
7404        unsafe fn decode(
7405            &mut self,
7406            decoder: &mut fidl::encoding::Decoder<'_, D>,
7407            offset: usize,
7408            _depth: fidl::encoding::Depth,
7409        ) -> fidl::Result<()> {
7410            decoder.debug_check_bounds::<Self>(offset);
7411            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7412            // Verify that padding bytes are zero.
7413            // Copy from the buffer into the object.
7414            unsafe {
7415                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7416            }
7417            Ok(())
7418        }
7419    }
7420
7421    impl fidl::encoding::ValueTypeMarker for ParentViewportWatcherGetLayoutResponse {
7422        type Borrowed<'a> = &'a Self;
7423        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7424            value
7425        }
7426    }
7427
7428    unsafe impl fidl::encoding::TypeMarker for ParentViewportWatcherGetLayoutResponse {
7429        type Owned = Self;
7430
7431        #[inline(always)]
7432        fn inline_align(_context: fidl::encoding::Context) -> usize {
7433            8
7434        }
7435
7436        #[inline(always)]
7437        fn inline_size(_context: fidl::encoding::Context) -> usize {
7438            16
7439        }
7440    }
7441
7442    unsafe impl<D: fidl::encoding::ResourceDialect>
7443        fidl::encoding::Encode<ParentViewportWatcherGetLayoutResponse, D>
7444        for &ParentViewportWatcherGetLayoutResponse
7445    {
7446        #[inline]
7447        unsafe fn encode(
7448            self,
7449            encoder: &mut fidl::encoding::Encoder<'_, D>,
7450            offset: usize,
7451            _depth: fidl::encoding::Depth,
7452        ) -> fidl::Result<()> {
7453            encoder.debug_check_bounds::<ParentViewportWatcherGetLayoutResponse>(offset);
7454            // Delegate to tuple encoding.
7455            fidl::encoding::Encode::<ParentViewportWatcherGetLayoutResponse, D>::encode(
7456                (<LayoutInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),),
7457                encoder,
7458                offset,
7459                _depth,
7460            )
7461        }
7462    }
7463    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LayoutInfo, D>>
7464        fidl::encoding::Encode<ParentViewportWatcherGetLayoutResponse, D> for (T0,)
7465    {
7466        #[inline]
7467        unsafe fn encode(
7468            self,
7469            encoder: &mut fidl::encoding::Encoder<'_, D>,
7470            offset: usize,
7471            depth: fidl::encoding::Depth,
7472        ) -> fidl::Result<()> {
7473            encoder.debug_check_bounds::<ParentViewportWatcherGetLayoutResponse>(offset);
7474            // Zero out padding regions. There's no need to apply masks
7475            // because the unmasked parts will be overwritten by fields.
7476            // Write the fields.
7477            self.0.encode(encoder, offset + 0, depth)?;
7478            Ok(())
7479        }
7480    }
7481
7482    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7483        for ParentViewportWatcherGetLayoutResponse
7484    {
7485        #[inline(always)]
7486        fn new_empty() -> Self {
7487            Self { info: fidl::new_empty!(LayoutInfo, D) }
7488        }
7489
7490        #[inline]
7491        unsafe fn decode(
7492            &mut self,
7493            decoder: &mut fidl::encoding::Decoder<'_, D>,
7494            offset: usize,
7495            _depth: fidl::encoding::Depth,
7496        ) -> fidl::Result<()> {
7497            decoder.debug_check_bounds::<Self>(offset);
7498            // Verify that padding bytes are zero.
7499            fidl::decode!(LayoutInfo, D, &mut self.info, decoder, offset + 0, _depth)?;
7500            Ok(())
7501        }
7502    }
7503
7504    impl fidl::encoding::ValueTypeMarker for ParentViewportWatcherGetStatusResponse {
7505        type Borrowed<'a> = &'a Self;
7506        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7507            value
7508        }
7509    }
7510
7511    unsafe impl fidl::encoding::TypeMarker for ParentViewportWatcherGetStatusResponse {
7512        type Owned = Self;
7513
7514        #[inline(always)]
7515        fn inline_align(_context: fidl::encoding::Context) -> usize {
7516            4
7517        }
7518
7519        #[inline(always)]
7520        fn inline_size(_context: fidl::encoding::Context) -> usize {
7521            4
7522        }
7523    }
7524
7525    unsafe impl<D: fidl::encoding::ResourceDialect>
7526        fidl::encoding::Encode<ParentViewportWatcherGetStatusResponse, D>
7527        for &ParentViewportWatcherGetStatusResponse
7528    {
7529        #[inline]
7530        unsafe fn encode(
7531            self,
7532            encoder: &mut fidl::encoding::Encoder<'_, D>,
7533            offset: usize,
7534            _depth: fidl::encoding::Depth,
7535        ) -> fidl::Result<()> {
7536            encoder.debug_check_bounds::<ParentViewportWatcherGetStatusResponse>(offset);
7537            // Delegate to tuple encoding.
7538            fidl::encoding::Encode::<ParentViewportWatcherGetStatusResponse, D>::encode(
7539                (<ParentViewportStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
7540                encoder,
7541                offset,
7542                _depth,
7543            )
7544        }
7545    }
7546    unsafe impl<
7547        D: fidl::encoding::ResourceDialect,
7548        T0: fidl::encoding::Encode<ParentViewportStatus, D>,
7549    > fidl::encoding::Encode<ParentViewportWatcherGetStatusResponse, D> for (T0,)
7550    {
7551        #[inline]
7552        unsafe fn encode(
7553            self,
7554            encoder: &mut fidl::encoding::Encoder<'_, D>,
7555            offset: usize,
7556            depth: fidl::encoding::Depth,
7557        ) -> fidl::Result<()> {
7558            encoder.debug_check_bounds::<ParentViewportWatcherGetStatusResponse>(offset);
7559            // Zero out padding regions. There's no need to apply masks
7560            // because the unmasked parts will be overwritten by fields.
7561            // Write the fields.
7562            self.0.encode(encoder, offset + 0, depth)?;
7563            Ok(())
7564        }
7565    }
7566
7567    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7568        for ParentViewportWatcherGetStatusResponse
7569    {
7570        #[inline(always)]
7571        fn new_empty() -> Self {
7572            Self { status: fidl::new_empty!(ParentViewportStatus, D) }
7573        }
7574
7575        #[inline]
7576        unsafe fn decode(
7577            &mut self,
7578            decoder: &mut fidl::encoding::Decoder<'_, D>,
7579            offset: usize,
7580            _depth: fidl::encoding::Depth,
7581        ) -> fidl::Result<()> {
7582            decoder.debug_check_bounds::<Self>(offset);
7583            // Verify that padding bytes are zero.
7584            fidl::decode!(ParentViewportStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
7585            Ok(())
7586        }
7587    }
7588
7589    impl fidl::encoding::ValueTypeMarker for ScreenCaptureReleaseFrameRequest {
7590        type Borrowed<'a> = &'a Self;
7591        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7592            value
7593        }
7594    }
7595
7596    unsafe impl fidl::encoding::TypeMarker for ScreenCaptureReleaseFrameRequest {
7597        type Owned = Self;
7598
7599        #[inline(always)]
7600        fn inline_align(_context: fidl::encoding::Context) -> usize {
7601            4
7602        }
7603
7604        #[inline(always)]
7605        fn inline_size(_context: fidl::encoding::Context) -> usize {
7606            4
7607        }
7608        #[inline(always)]
7609        fn encode_is_copy() -> bool {
7610            true
7611        }
7612
7613        #[inline(always)]
7614        fn decode_is_copy() -> bool {
7615            true
7616        }
7617    }
7618
7619    unsafe impl<D: fidl::encoding::ResourceDialect>
7620        fidl::encoding::Encode<ScreenCaptureReleaseFrameRequest, D>
7621        for &ScreenCaptureReleaseFrameRequest
7622    {
7623        #[inline]
7624        unsafe fn encode(
7625            self,
7626            encoder: &mut fidl::encoding::Encoder<'_, D>,
7627            offset: usize,
7628            _depth: fidl::encoding::Depth,
7629        ) -> fidl::Result<()> {
7630            encoder.debug_check_bounds::<ScreenCaptureReleaseFrameRequest>(offset);
7631            unsafe {
7632                // Copy the object into the buffer.
7633                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7634                (buf_ptr as *mut ScreenCaptureReleaseFrameRequest)
7635                    .write_unaligned((self as *const ScreenCaptureReleaseFrameRequest).read());
7636                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7637                // done second because the memcpy will write garbage to these bytes.
7638            }
7639            Ok(())
7640        }
7641    }
7642    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
7643        fidl::encoding::Encode<ScreenCaptureReleaseFrameRequest, D> for (T0,)
7644    {
7645        #[inline]
7646        unsafe fn encode(
7647            self,
7648            encoder: &mut fidl::encoding::Encoder<'_, D>,
7649            offset: usize,
7650            depth: fidl::encoding::Depth,
7651        ) -> fidl::Result<()> {
7652            encoder.debug_check_bounds::<ScreenCaptureReleaseFrameRequest>(offset);
7653            // Zero out padding regions. There's no need to apply masks
7654            // because the unmasked parts will be overwritten by fields.
7655            // Write the fields.
7656            self.0.encode(encoder, offset + 0, depth)?;
7657            Ok(())
7658        }
7659    }
7660
7661    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7662        for ScreenCaptureReleaseFrameRequest
7663    {
7664        #[inline(always)]
7665        fn new_empty() -> Self {
7666            Self { buffer_id: fidl::new_empty!(u32, D) }
7667        }
7668
7669        #[inline]
7670        unsafe fn decode(
7671            &mut self,
7672            decoder: &mut fidl::encoding::Decoder<'_, D>,
7673            offset: usize,
7674            _depth: fidl::encoding::Depth,
7675        ) -> fidl::Result<()> {
7676            decoder.debug_check_bounds::<Self>(offset);
7677            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7678            // Verify that padding bytes are zero.
7679            // Copy from the buffer into the object.
7680            unsafe {
7681                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
7682            }
7683            Ok(())
7684        }
7685    }
7686
7687    impl fidl::encoding::ValueTypeMarker for TransformId {
7688        type Borrowed<'a> = &'a Self;
7689        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7690            value
7691        }
7692    }
7693
7694    unsafe impl fidl::encoding::TypeMarker for TransformId {
7695        type Owned = Self;
7696
7697        #[inline(always)]
7698        fn inline_align(_context: fidl::encoding::Context) -> usize {
7699            8
7700        }
7701
7702        #[inline(always)]
7703        fn inline_size(_context: fidl::encoding::Context) -> usize {
7704            8
7705        }
7706        #[inline(always)]
7707        fn encode_is_copy() -> bool {
7708            true
7709        }
7710
7711        #[inline(always)]
7712        fn decode_is_copy() -> bool {
7713            true
7714        }
7715    }
7716
7717    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TransformId, D>
7718        for &TransformId
7719    {
7720        #[inline]
7721        unsafe fn encode(
7722            self,
7723            encoder: &mut fidl::encoding::Encoder<'_, D>,
7724            offset: usize,
7725            _depth: fidl::encoding::Depth,
7726        ) -> fidl::Result<()> {
7727            encoder.debug_check_bounds::<TransformId>(offset);
7728            unsafe {
7729                // Copy the object into the buffer.
7730                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7731                (buf_ptr as *mut TransformId).write_unaligned((self as *const TransformId).read());
7732                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7733                // done second because the memcpy will write garbage to these bytes.
7734            }
7735            Ok(())
7736        }
7737    }
7738    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
7739        fidl::encoding::Encode<TransformId, D> for (T0,)
7740    {
7741        #[inline]
7742        unsafe fn encode(
7743            self,
7744            encoder: &mut fidl::encoding::Encoder<'_, D>,
7745            offset: usize,
7746            depth: fidl::encoding::Depth,
7747        ) -> fidl::Result<()> {
7748            encoder.debug_check_bounds::<TransformId>(offset);
7749            // Zero out padding regions. There's no need to apply masks
7750            // because the unmasked parts will be overwritten by fields.
7751            // Write the fields.
7752            self.0.encode(encoder, offset + 0, depth)?;
7753            Ok(())
7754        }
7755    }
7756
7757    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TransformId {
7758        #[inline(always)]
7759        fn new_empty() -> Self {
7760            Self { value: fidl::new_empty!(u64, D) }
7761        }
7762
7763        #[inline]
7764        unsafe fn decode(
7765            &mut self,
7766            decoder: &mut fidl::encoding::Decoder<'_, D>,
7767            offset: usize,
7768            _depth: fidl::encoding::Depth,
7769        ) -> fidl::Result<()> {
7770            decoder.debug_check_bounds::<Self>(offset);
7771            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7772            // Verify that padding bytes are zero.
7773            // Copy from the buffer into the object.
7774            unsafe {
7775                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7776            }
7777            Ok(())
7778        }
7779    }
7780
7781    impl fidl::encoding::ValueTypeMarker for TrustedFlatlandReleaseImageImmediately2Request {
7782        type Borrowed<'a> = &'a Self;
7783        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7784            value
7785        }
7786    }
7787
7788    unsafe impl fidl::encoding::TypeMarker for TrustedFlatlandReleaseImageImmediately2Request {
7789        type Owned = Self;
7790
7791        #[inline(always)]
7792        fn inline_align(_context: fidl::encoding::Context) -> usize {
7793            8
7794        }
7795
7796        #[inline(always)]
7797        fn inline_size(_context: fidl::encoding::Context) -> usize {
7798            8
7799        }
7800        #[inline(always)]
7801        fn encode_is_copy() -> bool {
7802            true
7803        }
7804
7805        #[inline(always)]
7806        fn decode_is_copy() -> bool {
7807            true
7808        }
7809    }
7810
7811    unsafe impl<D: fidl::encoding::ResourceDialect>
7812        fidl::encoding::Encode<TrustedFlatlandReleaseImageImmediately2Request, D>
7813        for &TrustedFlatlandReleaseImageImmediately2Request
7814    {
7815        #[inline]
7816        unsafe fn encode(
7817            self,
7818            encoder: &mut fidl::encoding::Encoder<'_, D>,
7819            offset: usize,
7820            _depth: fidl::encoding::Depth,
7821        ) -> fidl::Result<()> {
7822            encoder.debug_check_bounds::<TrustedFlatlandReleaseImageImmediately2Request>(offset);
7823            unsafe {
7824                // Copy the object into the buffer.
7825                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7826                (buf_ptr as *mut TrustedFlatlandReleaseImageImmediately2Request).write_unaligned(
7827                    (self as *const TrustedFlatlandReleaseImageImmediately2Request).read(),
7828                );
7829                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7830                // done second because the memcpy will write garbage to these bytes.
7831            }
7832            Ok(())
7833        }
7834    }
7835    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ImageId, D>>
7836        fidl::encoding::Encode<TrustedFlatlandReleaseImageImmediately2Request, D> for (T0,)
7837    {
7838        #[inline]
7839        unsafe fn encode(
7840            self,
7841            encoder: &mut fidl::encoding::Encoder<'_, D>,
7842            offset: usize,
7843            depth: fidl::encoding::Depth,
7844        ) -> fidl::Result<()> {
7845            encoder.debug_check_bounds::<TrustedFlatlandReleaseImageImmediately2Request>(offset);
7846            // Zero out padding regions. There's no need to apply masks
7847            // because the unmasked parts will be overwritten by fields.
7848            // Write the fields.
7849            self.0.encode(encoder, offset + 0, depth)?;
7850            Ok(())
7851        }
7852    }
7853
7854    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7855        for TrustedFlatlandReleaseImageImmediately2Request
7856    {
7857        #[inline(always)]
7858        fn new_empty() -> Self {
7859            Self { image_id: fidl::new_empty!(ImageId, D) }
7860        }
7861
7862        #[inline]
7863        unsafe fn decode(
7864            &mut self,
7865            decoder: &mut fidl::encoding::Decoder<'_, D>,
7866            offset: usize,
7867            _depth: fidl::encoding::Depth,
7868        ) -> fidl::Result<()> {
7869            decoder.debug_check_bounds::<Self>(offset);
7870            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7871            // Verify that padding bytes are zero.
7872            // Copy from the buffer into the object.
7873            unsafe {
7874                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7875            }
7876            Ok(())
7877        }
7878    }
7879
7880    impl fidl::encoding::ValueTypeMarker for TrustedFlatlandReleaseImageImmediatelyRequest {
7881        type Borrowed<'a> = &'a Self;
7882        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7883            value
7884        }
7885    }
7886
7887    unsafe impl fidl::encoding::TypeMarker for TrustedFlatlandReleaseImageImmediatelyRequest {
7888        type Owned = Self;
7889
7890        #[inline(always)]
7891        fn inline_align(_context: fidl::encoding::Context) -> usize {
7892            8
7893        }
7894
7895        #[inline(always)]
7896        fn inline_size(_context: fidl::encoding::Context) -> usize {
7897            8
7898        }
7899        #[inline(always)]
7900        fn encode_is_copy() -> bool {
7901            true
7902        }
7903
7904        #[inline(always)]
7905        fn decode_is_copy() -> bool {
7906            true
7907        }
7908    }
7909
7910    unsafe impl<D: fidl::encoding::ResourceDialect>
7911        fidl::encoding::Encode<TrustedFlatlandReleaseImageImmediatelyRequest, D>
7912        for &TrustedFlatlandReleaseImageImmediatelyRequest
7913    {
7914        #[inline]
7915        unsafe fn encode(
7916            self,
7917            encoder: &mut fidl::encoding::Encoder<'_, D>,
7918            offset: usize,
7919            _depth: fidl::encoding::Depth,
7920        ) -> fidl::Result<()> {
7921            encoder.debug_check_bounds::<TrustedFlatlandReleaseImageImmediatelyRequest>(offset);
7922            unsafe {
7923                // Copy the object into the buffer.
7924                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7925                (buf_ptr as *mut TrustedFlatlandReleaseImageImmediatelyRequest).write_unaligned(
7926                    (self as *const TrustedFlatlandReleaseImageImmediatelyRequest).read(),
7927                );
7928                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
7929                // done second because the memcpy will write garbage to these bytes.
7930            }
7931            Ok(())
7932        }
7933    }
7934    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ContentId, D>>
7935        fidl::encoding::Encode<TrustedFlatlandReleaseImageImmediatelyRequest, D> for (T0,)
7936    {
7937        #[inline]
7938        unsafe fn encode(
7939            self,
7940            encoder: &mut fidl::encoding::Encoder<'_, D>,
7941            offset: usize,
7942            depth: fidl::encoding::Depth,
7943        ) -> fidl::Result<()> {
7944            encoder.debug_check_bounds::<TrustedFlatlandReleaseImageImmediatelyRequest>(offset);
7945            // Zero out padding regions. There's no need to apply masks
7946            // because the unmasked parts will be overwritten by fields.
7947            // Write the fields.
7948            self.0.encode(encoder, offset + 0, depth)?;
7949            Ok(())
7950        }
7951    }
7952
7953    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7954        for TrustedFlatlandReleaseImageImmediatelyRequest
7955    {
7956        #[inline(always)]
7957        fn new_empty() -> Self {
7958            Self { image_id: fidl::new_empty!(ContentId, D) }
7959        }
7960
7961        #[inline]
7962        unsafe fn decode(
7963            &mut self,
7964            decoder: &mut fidl::encoding::Decoder<'_, D>,
7965            offset: usize,
7966            _depth: fidl::encoding::Depth,
7967        ) -> fidl::Result<()> {
7968            decoder.debug_check_bounds::<Self>(offset);
7969            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7970            // Verify that padding bytes are zero.
7971            // Copy from the buffer into the object.
7972            unsafe {
7973                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
7974            }
7975            Ok(())
7976        }
7977    }
7978
7979    impl fidl::encoding::ValueTypeMarker for ViewportId {
7980        type Borrowed<'a> = &'a Self;
7981        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7982            value
7983        }
7984    }
7985
7986    unsafe impl fidl::encoding::TypeMarker for ViewportId {
7987        type Owned = Self;
7988
7989        #[inline(always)]
7990        fn inline_align(_context: fidl::encoding::Context) -> usize {
7991            8
7992        }
7993
7994        #[inline(always)]
7995        fn inline_size(_context: fidl::encoding::Context) -> usize {
7996            8
7997        }
7998        #[inline(always)]
7999        fn encode_is_copy() -> bool {
8000            true
8001        }
8002
8003        #[inline(always)]
8004        fn decode_is_copy() -> bool {
8005            true
8006        }
8007    }
8008
8009    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewportId, D>
8010        for &ViewportId
8011    {
8012        #[inline]
8013        unsafe fn encode(
8014            self,
8015            encoder: &mut fidl::encoding::Encoder<'_, D>,
8016            offset: usize,
8017            _depth: fidl::encoding::Depth,
8018        ) -> fidl::Result<()> {
8019            encoder.debug_check_bounds::<ViewportId>(offset);
8020            unsafe {
8021                // Copy the object into the buffer.
8022                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8023                (buf_ptr as *mut ViewportId).write_unaligned((self as *const ViewportId).read());
8024                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
8025                // done second because the memcpy will write garbage to these bytes.
8026            }
8027            Ok(())
8028        }
8029    }
8030    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8031        fidl::encoding::Encode<ViewportId, D> for (T0,)
8032    {
8033        #[inline]
8034        unsafe fn encode(
8035            self,
8036            encoder: &mut fidl::encoding::Encoder<'_, D>,
8037            offset: usize,
8038            depth: fidl::encoding::Depth,
8039        ) -> fidl::Result<()> {
8040            encoder.debug_check_bounds::<ViewportId>(offset);
8041            // Zero out padding regions. There's no need to apply masks
8042            // because the unmasked parts will be overwritten by fields.
8043            // Write the fields.
8044            self.0.encode(encoder, offset + 0, depth)?;
8045            Ok(())
8046        }
8047    }
8048
8049    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewportId {
8050        #[inline(always)]
8051        fn new_empty() -> Self {
8052            Self { value: fidl::new_empty!(u64, D) }
8053        }
8054
8055        #[inline]
8056        unsafe fn decode(
8057            &mut self,
8058            decoder: &mut fidl::encoding::Decoder<'_, D>,
8059            offset: usize,
8060            _depth: fidl::encoding::Depth,
8061        ) -> fidl::Result<()> {
8062            decoder.debug_check_bounds::<Self>(offset);
8063            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8064            // Verify that padding bytes are zero.
8065            // Copy from the buffer into the object.
8066            unsafe {
8067                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8068            }
8069            Ok(())
8070        }
8071    }
8072
8073    impl FlatlandConfig {
8074        #[inline(always)]
8075        fn max_ordinal_present(&self) -> u64 {
8076            if let Some(_) = self.use_flatland2 {
8077                return 1;
8078            }
8079            0
8080        }
8081    }
8082
8083    impl fidl::encoding::ValueTypeMarker for FlatlandConfig {
8084        type Borrowed<'a> = &'a Self;
8085        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8086            value
8087        }
8088    }
8089
8090    unsafe impl fidl::encoding::TypeMarker for FlatlandConfig {
8091        type Owned = Self;
8092
8093        #[inline(always)]
8094        fn inline_align(_context: fidl::encoding::Context) -> usize {
8095            8
8096        }
8097
8098        #[inline(always)]
8099        fn inline_size(_context: fidl::encoding::Context) -> usize {
8100            16
8101        }
8102    }
8103
8104    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FlatlandConfig, D>
8105        for &FlatlandConfig
8106    {
8107        unsafe fn encode(
8108            self,
8109            encoder: &mut fidl::encoding::Encoder<'_, D>,
8110            offset: usize,
8111            mut depth: fidl::encoding::Depth,
8112        ) -> fidl::Result<()> {
8113            encoder.debug_check_bounds::<FlatlandConfig>(offset);
8114            // Vector header
8115            let max_ordinal: u64 = self.max_ordinal_present();
8116            encoder.write_num(max_ordinal, offset);
8117            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8118            // Calling encoder.out_of_line_offset(0) is not allowed.
8119            if max_ordinal == 0 {
8120                return Ok(());
8121            }
8122            depth.increment()?;
8123            let envelope_size = 8;
8124            let bytes_len = max_ordinal as usize * envelope_size;
8125            #[allow(unused_variables)]
8126            let offset = encoder.out_of_line_offset(bytes_len);
8127            let mut _prev_end_offset: usize = 0;
8128            if 1 > max_ordinal {
8129                return Ok(());
8130            }
8131
8132            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8133            // are envelope_size bytes.
8134            let cur_offset: usize = (1 - 1) * envelope_size;
8135
8136            // Zero reserved fields.
8137            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8138
8139            // Safety:
8140            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8141            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8142            //   envelope_size bytes, there is always sufficient room.
8143            fidl::encoding::encode_in_envelope_optional::<bool, D>(
8144                self.use_flatland2.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
8145                encoder,
8146                offset + cur_offset,
8147                depth,
8148            )?;
8149
8150            _prev_end_offset = cur_offset + envelope_size;
8151
8152            Ok(())
8153        }
8154    }
8155
8156    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FlatlandConfig {
8157        #[inline(always)]
8158        fn new_empty() -> Self {
8159            Self::default()
8160        }
8161
8162        unsafe fn decode(
8163            &mut self,
8164            decoder: &mut fidl::encoding::Decoder<'_, D>,
8165            offset: usize,
8166            mut depth: fidl::encoding::Depth,
8167        ) -> fidl::Result<()> {
8168            decoder.debug_check_bounds::<Self>(offset);
8169            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8170                None => return Err(fidl::Error::NotNullable),
8171                Some(len) => len,
8172            };
8173            // Calling decoder.out_of_line_offset(0) is not allowed.
8174            if len == 0 {
8175                return Ok(());
8176            };
8177            depth.increment()?;
8178            let envelope_size = 8;
8179            let bytes_len = len * envelope_size;
8180            let offset = decoder.out_of_line_offset(bytes_len)?;
8181            // Decode the envelope for each type.
8182            let mut _next_ordinal_to_read = 0;
8183            let mut next_offset = offset;
8184            let end_offset = offset + bytes_len;
8185            _next_ordinal_to_read += 1;
8186            if next_offset >= end_offset {
8187                return Ok(());
8188            }
8189
8190            // Decode unknown envelopes for gaps in ordinals.
8191            while _next_ordinal_to_read < 1 {
8192                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8193                _next_ordinal_to_read += 1;
8194                next_offset += envelope_size;
8195            }
8196
8197            let next_out_of_line = decoder.next_out_of_line();
8198            let handles_before = decoder.remaining_handles();
8199            if let Some((inlined, num_bytes, num_handles)) =
8200                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8201            {
8202                let member_inline_size =
8203                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8204                if inlined != (member_inline_size <= 4) {
8205                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8206                }
8207                let inner_offset;
8208                let mut inner_depth = depth.clone();
8209                if inlined {
8210                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8211                    inner_offset = next_offset;
8212                } else {
8213                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8214                    inner_depth.increment()?;
8215                }
8216                let val_ref = self.use_flatland2.get_or_insert_with(|| fidl::new_empty!(bool, D));
8217                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
8218                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8219                {
8220                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8221                }
8222                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8223                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8224                }
8225            }
8226
8227            next_offset += envelope_size;
8228
8229            // Decode the remaining unknown envelopes.
8230            while next_offset < end_offset {
8231                _next_ordinal_to_read += 1;
8232                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8233                next_offset += envelope_size;
8234            }
8235
8236            Ok(())
8237        }
8238    }
8239
8240    impl ImageProperties {
8241        #[inline(always)]
8242        fn max_ordinal_present(&self) -> u64 {
8243            if let Some(_) = self.size {
8244                return 1;
8245            }
8246            0
8247        }
8248    }
8249
8250    impl fidl::encoding::ValueTypeMarker for ImageProperties {
8251        type Borrowed<'a> = &'a Self;
8252        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8253            value
8254        }
8255    }
8256
8257    unsafe impl fidl::encoding::TypeMarker for ImageProperties {
8258        type Owned = Self;
8259
8260        #[inline(always)]
8261        fn inline_align(_context: fidl::encoding::Context) -> usize {
8262            8
8263        }
8264
8265        #[inline(always)]
8266        fn inline_size(_context: fidl::encoding::Context) -> usize {
8267            16
8268        }
8269    }
8270
8271    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageProperties, D>
8272        for &ImageProperties
8273    {
8274        unsafe fn encode(
8275            self,
8276            encoder: &mut fidl::encoding::Encoder<'_, D>,
8277            offset: usize,
8278            mut depth: fidl::encoding::Depth,
8279        ) -> fidl::Result<()> {
8280            encoder.debug_check_bounds::<ImageProperties>(offset);
8281            // Vector header
8282            let max_ordinal: u64 = self.max_ordinal_present();
8283            encoder.write_num(max_ordinal, offset);
8284            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8285            // Calling encoder.out_of_line_offset(0) is not allowed.
8286            if max_ordinal == 0 {
8287                return Ok(());
8288            }
8289            depth.increment()?;
8290            let envelope_size = 8;
8291            let bytes_len = max_ordinal as usize * envelope_size;
8292            #[allow(unused_variables)]
8293            let offset = encoder.out_of_line_offset(bytes_len);
8294            let mut _prev_end_offset: usize = 0;
8295            if 1 > max_ordinal {
8296                return Ok(());
8297            }
8298
8299            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8300            // are envelope_size bytes.
8301            let cur_offset: usize = (1 - 1) * envelope_size;
8302
8303            // Zero reserved fields.
8304            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8305
8306            // Safety:
8307            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8308            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8309            //   envelope_size bytes, there is always sufficient room.
8310            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math_common::SizeU, D>(
8311                self.size.as_ref().map(
8312                    <fidl_fuchsia_math_common::SizeU as fidl::encoding::ValueTypeMarker>::borrow,
8313                ),
8314                encoder,
8315                offset + cur_offset,
8316                depth,
8317            )?;
8318
8319            _prev_end_offset = cur_offset + envelope_size;
8320
8321            Ok(())
8322        }
8323    }
8324
8325    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageProperties {
8326        #[inline(always)]
8327        fn new_empty() -> Self {
8328            Self::default()
8329        }
8330
8331        unsafe fn decode(
8332            &mut self,
8333            decoder: &mut fidl::encoding::Decoder<'_, D>,
8334            offset: usize,
8335            mut depth: fidl::encoding::Depth,
8336        ) -> fidl::Result<()> {
8337            decoder.debug_check_bounds::<Self>(offset);
8338            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8339                None => return Err(fidl::Error::NotNullable),
8340                Some(len) => len,
8341            };
8342            // Calling decoder.out_of_line_offset(0) is not allowed.
8343            if len == 0 {
8344                return Ok(());
8345            };
8346            depth.increment()?;
8347            let envelope_size = 8;
8348            let bytes_len = len * envelope_size;
8349            let offset = decoder.out_of_line_offset(bytes_len)?;
8350            // Decode the envelope for each type.
8351            let mut _next_ordinal_to_read = 0;
8352            let mut next_offset = offset;
8353            let end_offset = offset + bytes_len;
8354            _next_ordinal_to_read += 1;
8355            if next_offset >= end_offset {
8356                return Ok(());
8357            }
8358
8359            // Decode unknown envelopes for gaps in ordinals.
8360            while _next_ordinal_to_read < 1 {
8361                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8362                _next_ordinal_to_read += 1;
8363                next_offset += envelope_size;
8364            }
8365
8366            let next_out_of_line = decoder.next_out_of_line();
8367            let handles_before = decoder.remaining_handles();
8368            if let Some((inlined, num_bytes, num_handles)) =
8369                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8370            {
8371                let member_inline_size =
8372                    <fidl_fuchsia_math_common::SizeU as fidl::encoding::TypeMarker>::inline_size(
8373                        decoder.context,
8374                    );
8375                if inlined != (member_inline_size <= 4) {
8376                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8377                }
8378                let inner_offset;
8379                let mut inner_depth = depth.clone();
8380                if inlined {
8381                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8382                    inner_offset = next_offset;
8383                } else {
8384                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8385                    inner_depth.increment()?;
8386                }
8387                let val_ref = self
8388                    .size
8389                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math_common::SizeU, D));
8390                fidl::decode!(
8391                    fidl_fuchsia_math_common::SizeU,
8392                    D,
8393                    val_ref,
8394                    decoder,
8395                    inner_offset,
8396                    inner_depth
8397                )?;
8398                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8399                {
8400                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8401                }
8402                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8403                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8404                }
8405            }
8406
8407            next_offset += envelope_size;
8408
8409            // Decode the remaining unknown envelopes.
8410            while next_offset < end_offset {
8411                _next_ordinal_to_read += 1;
8412                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8413                next_offset += envelope_size;
8414            }
8415
8416            Ok(())
8417        }
8418    }
8419
8420    impl LayerProperties {
8421        #[inline(always)]
8422        fn max_ordinal_present(&self) -> u64 {
8423            if let Some(_) = self.composition_mode {
8424                return 9;
8425            }
8426            if let Some(_) = self.hint_visible_rects {
8427                return 8;
8428            }
8429            if let Some(_) = self.hint_damage_rects {
8430                return 7;
8431            }
8432            if let Some(_) = self.transform {
8433                return 6;
8434            }
8435            if let Some(_) = self.sample_rect {
8436                return 5;
8437            }
8438            if let Some(_) = self.color {
8439                return 4;
8440            }
8441            if let Some(_) = self.blend_mode {
8442                return 3;
8443            }
8444            if let Some(_) = self.opacity {
8445                return 2;
8446            }
8447            if let Some(_) = self.display_rect {
8448                return 1;
8449            }
8450            0
8451        }
8452    }
8453
8454    impl fidl::encoding::ValueTypeMarker for LayerProperties {
8455        type Borrowed<'a> = &'a Self;
8456        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8457            value
8458        }
8459    }
8460
8461    unsafe impl fidl::encoding::TypeMarker for LayerProperties {
8462        type Owned = Self;
8463
8464        #[inline(always)]
8465        fn inline_align(_context: fidl::encoding::Context) -> usize {
8466            8
8467        }
8468
8469        #[inline(always)]
8470        fn inline_size(_context: fidl::encoding::Context) -> usize {
8471            16
8472        }
8473    }
8474
8475    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayerProperties, D>
8476        for &LayerProperties
8477    {
8478        unsafe fn encode(
8479            self,
8480            encoder: &mut fidl::encoding::Encoder<'_, D>,
8481            offset: usize,
8482            mut depth: fidl::encoding::Depth,
8483        ) -> fidl::Result<()> {
8484            encoder.debug_check_bounds::<LayerProperties>(offset);
8485            // Vector header
8486            let max_ordinal: u64 = self.max_ordinal_present();
8487            encoder.write_num(max_ordinal, offset);
8488            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8489            // Calling encoder.out_of_line_offset(0) is not allowed.
8490            if max_ordinal == 0 {
8491                return Ok(());
8492            }
8493            depth.increment()?;
8494            let envelope_size = 8;
8495            let bytes_len = max_ordinal as usize * envelope_size;
8496            #[allow(unused_variables)]
8497            let offset = encoder.out_of_line_offset(bytes_len);
8498            let mut _prev_end_offset: usize = 0;
8499            if 1 > max_ordinal {
8500                return Ok(());
8501            }
8502
8503            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8504            // are envelope_size bytes.
8505            let cur_offset: usize = (1 - 1) * envelope_size;
8506
8507            // Zero reserved fields.
8508            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8509
8510            // Safety:
8511            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8512            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8513            //   envelope_size bytes, there is always sufficient room.
8514            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math_common::RectU, D>(
8515                self.display_rect.as_ref().map(
8516                    <fidl_fuchsia_math_common::RectU as fidl::encoding::ValueTypeMarker>::borrow,
8517                ),
8518                encoder,
8519                offset + cur_offset,
8520                depth,
8521            )?;
8522
8523            _prev_end_offset = cur_offset + envelope_size;
8524            if 2 > max_ordinal {
8525                return Ok(());
8526            }
8527
8528            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8529            // are envelope_size bytes.
8530            let cur_offset: usize = (2 - 1) * envelope_size;
8531
8532            // Zero reserved fields.
8533            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8534
8535            // Safety:
8536            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8537            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8538            //   envelope_size bytes, there is always sufficient room.
8539            fidl::encoding::encode_in_envelope_optional::<f32, D>(
8540                self.opacity.as_ref().map(<f32 as fidl::encoding::ValueTypeMarker>::borrow),
8541                encoder,
8542                offset + cur_offset,
8543                depth,
8544            )?;
8545
8546            _prev_end_offset = cur_offset + envelope_size;
8547            if 3 > max_ordinal {
8548                return Ok(());
8549            }
8550
8551            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8552            // are envelope_size bytes.
8553            let cur_offset: usize = (3 - 1) * envelope_size;
8554
8555            // Zero reserved fields.
8556            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8557
8558            // Safety:
8559            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8560            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8561            //   envelope_size bytes, there is always sufficient room.
8562            fidl::encoding::encode_in_envelope_optional::<BlendMode2, D>(
8563                self.blend_mode
8564                    .as_ref()
8565                    .map(<BlendMode2 as fidl::encoding::ValueTypeMarker>::borrow),
8566                encoder,
8567                offset + cur_offset,
8568                depth,
8569            )?;
8570
8571            _prev_end_offset = cur_offset + envelope_size;
8572            if 4 > max_ordinal {
8573                return Ok(());
8574            }
8575
8576            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8577            // are envelope_size bytes.
8578            let cur_offset: usize = (4 - 1) * envelope_size;
8579
8580            // Zero reserved fields.
8581            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8582
8583            // Safety:
8584            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8585            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8586            //   envelope_size bytes, there is always sufficient room.
8587            fidl::encoding::encode_in_envelope_optional::<ColorRgba, D>(
8588                self.color.as_ref().map(<ColorRgba as fidl::encoding::ValueTypeMarker>::borrow),
8589                encoder,
8590                offset + cur_offset,
8591                depth,
8592            )?;
8593
8594            _prev_end_offset = cur_offset + envelope_size;
8595            if 5 > max_ordinal {
8596                return Ok(());
8597            }
8598
8599            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8600            // are envelope_size bytes.
8601            let cur_offset: usize = (5 - 1) * envelope_size;
8602
8603            // Zero reserved fields.
8604            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8605
8606            // Safety:
8607            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8608            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8609            //   envelope_size bytes, there is always sufficient room.
8610            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math_common::RectF, D>(
8611                self.sample_rect.as_ref().map(
8612                    <fidl_fuchsia_math_common::RectF as fidl::encoding::ValueTypeMarker>::borrow,
8613                ),
8614                encoder,
8615                offset + cur_offset,
8616                depth,
8617            )?;
8618
8619            _prev_end_offset = cur_offset + envelope_size;
8620            if 6 > max_ordinal {
8621                return Ok(());
8622            }
8623
8624            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8625            // are envelope_size bytes.
8626            let cur_offset: usize = (6 - 1) * envelope_size;
8627
8628            // Zero reserved fields.
8629            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8630
8631            // Safety:
8632            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8633            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8634            //   envelope_size bytes, there is always sufficient room.
8635            fidl::encoding::encode_in_envelope_optional::<FlipThenRotate, D>(
8636                self.transform
8637                    .as_ref()
8638                    .map(<FlipThenRotate as fidl::encoding::ValueTypeMarker>::borrow),
8639                encoder,
8640                offset + cur_offset,
8641                depth,
8642            )?;
8643
8644            _prev_end_offset = cur_offset + envelope_size;
8645            if 7 > max_ordinal {
8646                return Ok(());
8647            }
8648
8649            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8650            // are envelope_size bytes.
8651            let cur_offset: usize = (7 - 1) * envelope_size;
8652
8653            // Zero reserved fields.
8654            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8655
8656            // Safety:
8657            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8658            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8659            //   envelope_size bytes, there is always sufficient room.
8660            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_math_common::RectU>, D>(
8661            self.hint_damage_rects.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_math_common::RectU> as fidl::encoding::ValueTypeMarker>::borrow),
8662            encoder, offset + cur_offset, depth
8663        )?;
8664
8665            _prev_end_offset = cur_offset + envelope_size;
8666            if 8 > max_ordinal {
8667                return Ok(());
8668            }
8669
8670            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8671            // are envelope_size bytes.
8672            let cur_offset: usize = (8 - 1) * envelope_size;
8673
8674            // Zero reserved fields.
8675            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8676
8677            // Safety:
8678            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8679            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8680            //   envelope_size bytes, there is always sufficient room.
8681            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<fidl_fuchsia_math_common::RectU>, D>(
8682            self.hint_visible_rects.as_ref().map(<fidl::encoding::UnboundedVector<fidl_fuchsia_math_common::RectU> as fidl::encoding::ValueTypeMarker>::borrow),
8683            encoder, offset + cur_offset, depth
8684        )?;
8685
8686            _prev_end_offset = cur_offset + envelope_size;
8687            if 9 > max_ordinal {
8688                return Ok(());
8689            }
8690
8691            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8692            // are envelope_size bytes.
8693            let cur_offset: usize = (9 - 1) * envelope_size;
8694
8695            // Zero reserved fields.
8696            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8697
8698            // Safety:
8699            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8700            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8701            //   envelope_size bytes, there is always sufficient room.
8702            fidl::encoding::encode_in_envelope_optional::<CompositionMode, D>(
8703                self.composition_mode
8704                    .as_ref()
8705                    .map(<CompositionMode as fidl::encoding::ValueTypeMarker>::borrow),
8706                encoder,
8707                offset + cur_offset,
8708                depth,
8709            )?;
8710
8711            _prev_end_offset = cur_offset + envelope_size;
8712
8713            Ok(())
8714        }
8715    }
8716
8717    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayerProperties {
8718        #[inline(always)]
8719        fn new_empty() -> Self {
8720            Self::default()
8721        }
8722
8723        unsafe fn decode(
8724            &mut self,
8725            decoder: &mut fidl::encoding::Decoder<'_, D>,
8726            offset: usize,
8727            mut depth: fidl::encoding::Depth,
8728        ) -> fidl::Result<()> {
8729            decoder.debug_check_bounds::<Self>(offset);
8730            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8731                None => return Err(fidl::Error::NotNullable),
8732                Some(len) => len,
8733            };
8734            // Calling decoder.out_of_line_offset(0) is not allowed.
8735            if len == 0 {
8736                return Ok(());
8737            };
8738            depth.increment()?;
8739            let envelope_size = 8;
8740            let bytes_len = len * envelope_size;
8741            let offset = decoder.out_of_line_offset(bytes_len)?;
8742            // Decode the envelope for each type.
8743            let mut _next_ordinal_to_read = 0;
8744            let mut next_offset = offset;
8745            let end_offset = offset + bytes_len;
8746            _next_ordinal_to_read += 1;
8747            if next_offset >= end_offset {
8748                return Ok(());
8749            }
8750
8751            // Decode unknown envelopes for gaps in ordinals.
8752            while _next_ordinal_to_read < 1 {
8753                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8754                _next_ordinal_to_read += 1;
8755                next_offset += envelope_size;
8756            }
8757
8758            let next_out_of_line = decoder.next_out_of_line();
8759            let handles_before = decoder.remaining_handles();
8760            if let Some((inlined, num_bytes, num_handles)) =
8761                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8762            {
8763                let member_inline_size =
8764                    <fidl_fuchsia_math_common::RectU as fidl::encoding::TypeMarker>::inline_size(
8765                        decoder.context,
8766                    );
8767                if inlined != (member_inline_size <= 4) {
8768                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8769                }
8770                let inner_offset;
8771                let mut inner_depth = depth.clone();
8772                if inlined {
8773                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8774                    inner_offset = next_offset;
8775                } else {
8776                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8777                    inner_depth.increment()?;
8778                }
8779                let val_ref = self
8780                    .display_rect
8781                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math_common::RectU, D));
8782                fidl::decode!(
8783                    fidl_fuchsia_math_common::RectU,
8784                    D,
8785                    val_ref,
8786                    decoder,
8787                    inner_offset,
8788                    inner_depth
8789                )?;
8790                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8791                {
8792                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8793                }
8794                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8795                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8796                }
8797            }
8798
8799            next_offset += envelope_size;
8800            _next_ordinal_to_read += 1;
8801            if next_offset >= end_offset {
8802                return Ok(());
8803            }
8804
8805            // Decode unknown envelopes for gaps in ordinals.
8806            while _next_ordinal_to_read < 2 {
8807                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8808                _next_ordinal_to_read += 1;
8809                next_offset += envelope_size;
8810            }
8811
8812            let next_out_of_line = decoder.next_out_of_line();
8813            let handles_before = decoder.remaining_handles();
8814            if let Some((inlined, num_bytes, num_handles)) =
8815                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8816            {
8817                let member_inline_size =
8818                    <f32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8819                if inlined != (member_inline_size <= 4) {
8820                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8821                }
8822                let inner_offset;
8823                let mut inner_depth = depth.clone();
8824                if inlined {
8825                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8826                    inner_offset = next_offset;
8827                } else {
8828                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8829                    inner_depth.increment()?;
8830                }
8831                let val_ref = self.opacity.get_or_insert_with(|| fidl::new_empty!(f32, D));
8832                fidl::decode!(f32, D, val_ref, decoder, inner_offset, inner_depth)?;
8833                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8834                {
8835                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8836                }
8837                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8838                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8839                }
8840            }
8841
8842            next_offset += envelope_size;
8843            _next_ordinal_to_read += 1;
8844            if next_offset >= end_offset {
8845                return Ok(());
8846            }
8847
8848            // Decode unknown envelopes for gaps in ordinals.
8849            while _next_ordinal_to_read < 3 {
8850                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8851                _next_ordinal_to_read += 1;
8852                next_offset += envelope_size;
8853            }
8854
8855            let next_out_of_line = decoder.next_out_of_line();
8856            let handles_before = decoder.remaining_handles();
8857            if let Some((inlined, num_bytes, num_handles)) =
8858                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8859            {
8860                let member_inline_size =
8861                    <BlendMode2 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8862                if inlined != (member_inline_size <= 4) {
8863                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8864                }
8865                let inner_offset;
8866                let mut inner_depth = depth.clone();
8867                if inlined {
8868                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8869                    inner_offset = next_offset;
8870                } else {
8871                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8872                    inner_depth.increment()?;
8873                }
8874                let val_ref =
8875                    self.blend_mode.get_or_insert_with(|| fidl::new_empty!(BlendMode2, D));
8876                fidl::decode!(BlendMode2, D, val_ref, decoder, inner_offset, inner_depth)?;
8877                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8878                {
8879                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8880                }
8881                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8882                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8883                }
8884            }
8885
8886            next_offset += envelope_size;
8887            _next_ordinal_to_read += 1;
8888            if next_offset >= end_offset {
8889                return Ok(());
8890            }
8891
8892            // Decode unknown envelopes for gaps in ordinals.
8893            while _next_ordinal_to_read < 4 {
8894                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8895                _next_ordinal_to_read += 1;
8896                next_offset += envelope_size;
8897            }
8898
8899            let next_out_of_line = decoder.next_out_of_line();
8900            let handles_before = decoder.remaining_handles();
8901            if let Some((inlined, num_bytes, num_handles)) =
8902                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8903            {
8904                let member_inline_size =
8905                    <ColorRgba as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8906                if inlined != (member_inline_size <= 4) {
8907                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8908                }
8909                let inner_offset;
8910                let mut inner_depth = depth.clone();
8911                if inlined {
8912                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8913                    inner_offset = next_offset;
8914                } else {
8915                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8916                    inner_depth.increment()?;
8917                }
8918                let val_ref = self.color.get_or_insert_with(|| fidl::new_empty!(ColorRgba, D));
8919                fidl::decode!(ColorRgba, D, val_ref, decoder, inner_offset, inner_depth)?;
8920                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8921                {
8922                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8923                }
8924                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8925                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8926                }
8927            }
8928
8929            next_offset += envelope_size;
8930            _next_ordinal_to_read += 1;
8931            if next_offset >= end_offset {
8932                return Ok(());
8933            }
8934
8935            // Decode unknown envelopes for gaps in ordinals.
8936            while _next_ordinal_to_read < 5 {
8937                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8938                _next_ordinal_to_read += 1;
8939                next_offset += envelope_size;
8940            }
8941
8942            let next_out_of_line = decoder.next_out_of_line();
8943            let handles_before = decoder.remaining_handles();
8944            if let Some((inlined, num_bytes, num_handles)) =
8945                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8946            {
8947                let member_inline_size =
8948                    <fidl_fuchsia_math_common::RectF as fidl::encoding::TypeMarker>::inline_size(
8949                        decoder.context,
8950                    );
8951                if inlined != (member_inline_size <= 4) {
8952                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8953                }
8954                let inner_offset;
8955                let mut inner_depth = depth.clone();
8956                if inlined {
8957                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8958                    inner_offset = next_offset;
8959                } else {
8960                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8961                    inner_depth.increment()?;
8962                }
8963                let val_ref = self
8964                    .sample_rect
8965                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math_common::RectF, D));
8966                fidl::decode!(
8967                    fidl_fuchsia_math_common::RectF,
8968                    D,
8969                    val_ref,
8970                    decoder,
8971                    inner_offset,
8972                    inner_depth
8973                )?;
8974                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8975                {
8976                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8977                }
8978                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8979                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8980                }
8981            }
8982
8983            next_offset += envelope_size;
8984            _next_ordinal_to_read += 1;
8985            if next_offset >= end_offset {
8986                return Ok(());
8987            }
8988
8989            // Decode unknown envelopes for gaps in ordinals.
8990            while _next_ordinal_to_read < 6 {
8991                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8992                _next_ordinal_to_read += 1;
8993                next_offset += envelope_size;
8994            }
8995
8996            let next_out_of_line = decoder.next_out_of_line();
8997            let handles_before = decoder.remaining_handles();
8998            if let Some((inlined, num_bytes, num_handles)) =
8999                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9000            {
9001                let member_inline_size =
9002                    <FlipThenRotate as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9003                if inlined != (member_inline_size <= 4) {
9004                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9005                }
9006                let inner_offset;
9007                let mut inner_depth = depth.clone();
9008                if inlined {
9009                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9010                    inner_offset = next_offset;
9011                } else {
9012                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9013                    inner_depth.increment()?;
9014                }
9015                let val_ref =
9016                    self.transform.get_or_insert_with(|| fidl::new_empty!(FlipThenRotate, D));
9017                fidl::decode!(FlipThenRotate, D, val_ref, decoder, inner_offset, inner_depth)?;
9018                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9019                {
9020                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9021                }
9022                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9023                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9024                }
9025            }
9026
9027            next_offset += envelope_size;
9028            _next_ordinal_to_read += 1;
9029            if next_offset >= end_offset {
9030                return Ok(());
9031            }
9032
9033            // Decode unknown envelopes for gaps in ordinals.
9034            while _next_ordinal_to_read < 7 {
9035                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9036                _next_ordinal_to_read += 1;
9037                next_offset += envelope_size;
9038            }
9039
9040            let next_out_of_line = decoder.next_out_of_line();
9041            let handles_before = decoder.remaining_handles();
9042            if let Some((inlined, num_bytes, num_handles)) =
9043                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9044            {
9045                let member_inline_size = <fidl::encoding::UnboundedVector<
9046                    fidl_fuchsia_math_common::RectU,
9047                > as fidl::encoding::TypeMarker>::inline_size(
9048                    decoder.context
9049                );
9050                if inlined != (member_inline_size <= 4) {
9051                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9052                }
9053                let inner_offset;
9054                let mut inner_depth = depth.clone();
9055                if inlined {
9056                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9057                    inner_offset = next_offset;
9058                } else {
9059                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9060                    inner_depth.increment()?;
9061                }
9062                let val_ref = self.hint_damage_rects.get_or_insert_with(|| {
9063                    fidl::new_empty!(
9064                        fidl::encoding::UnboundedVector<fidl_fuchsia_math_common::RectU>,
9065                        D
9066                    )
9067                });
9068                fidl::decode!(
9069                    fidl::encoding::UnboundedVector<fidl_fuchsia_math_common::RectU>,
9070                    D,
9071                    val_ref,
9072                    decoder,
9073                    inner_offset,
9074                    inner_depth
9075                )?;
9076                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9077                {
9078                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9079                }
9080                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9081                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9082                }
9083            }
9084
9085            next_offset += envelope_size;
9086            _next_ordinal_to_read += 1;
9087            if next_offset >= end_offset {
9088                return Ok(());
9089            }
9090
9091            // Decode unknown envelopes for gaps in ordinals.
9092            while _next_ordinal_to_read < 8 {
9093                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9094                _next_ordinal_to_read += 1;
9095                next_offset += envelope_size;
9096            }
9097
9098            let next_out_of_line = decoder.next_out_of_line();
9099            let handles_before = decoder.remaining_handles();
9100            if let Some((inlined, num_bytes, num_handles)) =
9101                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9102            {
9103                let member_inline_size = <fidl::encoding::UnboundedVector<
9104                    fidl_fuchsia_math_common::RectU,
9105                > as fidl::encoding::TypeMarker>::inline_size(
9106                    decoder.context
9107                );
9108                if inlined != (member_inline_size <= 4) {
9109                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9110                }
9111                let inner_offset;
9112                let mut inner_depth = depth.clone();
9113                if inlined {
9114                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9115                    inner_offset = next_offset;
9116                } else {
9117                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9118                    inner_depth.increment()?;
9119                }
9120                let val_ref = self.hint_visible_rects.get_or_insert_with(|| {
9121                    fidl::new_empty!(
9122                        fidl::encoding::UnboundedVector<fidl_fuchsia_math_common::RectU>,
9123                        D
9124                    )
9125                });
9126                fidl::decode!(
9127                    fidl::encoding::UnboundedVector<fidl_fuchsia_math_common::RectU>,
9128                    D,
9129                    val_ref,
9130                    decoder,
9131                    inner_offset,
9132                    inner_depth
9133                )?;
9134                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9135                {
9136                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9137                }
9138                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9139                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9140                }
9141            }
9142
9143            next_offset += envelope_size;
9144            _next_ordinal_to_read += 1;
9145            if next_offset >= end_offset {
9146                return Ok(());
9147            }
9148
9149            // Decode unknown envelopes for gaps in ordinals.
9150            while _next_ordinal_to_read < 9 {
9151                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9152                _next_ordinal_to_read += 1;
9153                next_offset += envelope_size;
9154            }
9155
9156            let next_out_of_line = decoder.next_out_of_line();
9157            let handles_before = decoder.remaining_handles();
9158            if let Some((inlined, num_bytes, num_handles)) =
9159                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9160            {
9161                let member_inline_size =
9162                    <CompositionMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9163                if inlined != (member_inline_size <= 4) {
9164                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9165                }
9166                let inner_offset;
9167                let mut inner_depth = depth.clone();
9168                if inlined {
9169                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9170                    inner_offset = next_offset;
9171                } else {
9172                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9173                    inner_depth.increment()?;
9174                }
9175                let val_ref = self
9176                    .composition_mode
9177                    .get_or_insert_with(|| fidl::new_empty!(CompositionMode, D));
9178                fidl::decode!(CompositionMode, D, val_ref, decoder, inner_offset, inner_depth)?;
9179                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9180                {
9181                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9182                }
9183                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9184                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9185                }
9186            }
9187
9188            next_offset += envelope_size;
9189
9190            // Decode the remaining unknown envelopes.
9191            while next_offset < end_offset {
9192                _next_ordinal_to_read += 1;
9193                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9194                next_offset += envelope_size;
9195            }
9196
9197            Ok(())
9198        }
9199    }
9200
9201    impl LayoutInfo {
9202        #[inline(always)]
9203        fn max_ordinal_present(&self) -> u64 {
9204            if let Some(_) = self.inset {
9205                return 4;
9206            }
9207            if let Some(_) = self.device_pixel_ratio {
9208                return 3;
9209            }
9210            if let Some(_) = self.logical_size {
9211                return 1;
9212            }
9213            0
9214        }
9215    }
9216
9217    impl fidl::encoding::ValueTypeMarker for LayoutInfo {
9218        type Borrowed<'a> = &'a Self;
9219        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9220            value
9221        }
9222    }
9223
9224    unsafe impl fidl::encoding::TypeMarker for LayoutInfo {
9225        type Owned = Self;
9226
9227        #[inline(always)]
9228        fn inline_align(_context: fidl::encoding::Context) -> usize {
9229            8
9230        }
9231
9232        #[inline(always)]
9233        fn inline_size(_context: fidl::encoding::Context) -> usize {
9234            16
9235        }
9236    }
9237
9238    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayoutInfo, D>
9239        for &LayoutInfo
9240    {
9241        unsafe fn encode(
9242            self,
9243            encoder: &mut fidl::encoding::Encoder<'_, D>,
9244            offset: usize,
9245            mut depth: fidl::encoding::Depth,
9246        ) -> fidl::Result<()> {
9247            encoder.debug_check_bounds::<LayoutInfo>(offset);
9248            // Vector header
9249            let max_ordinal: u64 = self.max_ordinal_present();
9250            encoder.write_num(max_ordinal, offset);
9251            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9252            // Calling encoder.out_of_line_offset(0) is not allowed.
9253            if max_ordinal == 0 {
9254                return Ok(());
9255            }
9256            depth.increment()?;
9257            let envelope_size = 8;
9258            let bytes_len = max_ordinal as usize * envelope_size;
9259            #[allow(unused_variables)]
9260            let offset = encoder.out_of_line_offset(bytes_len);
9261            let mut _prev_end_offset: usize = 0;
9262            if 1 > max_ordinal {
9263                return Ok(());
9264            }
9265
9266            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9267            // are envelope_size bytes.
9268            let cur_offset: usize = (1 - 1) * envelope_size;
9269
9270            // Zero reserved fields.
9271            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9272
9273            // Safety:
9274            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9275            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9276            //   envelope_size bytes, there is always sufficient room.
9277            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math_common::SizeU, D>(
9278                self.logical_size.as_ref().map(
9279                    <fidl_fuchsia_math_common::SizeU as fidl::encoding::ValueTypeMarker>::borrow,
9280                ),
9281                encoder,
9282                offset + cur_offset,
9283                depth,
9284            )?;
9285
9286            _prev_end_offset = cur_offset + envelope_size;
9287            if 3 > max_ordinal {
9288                return Ok(());
9289            }
9290
9291            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9292            // are envelope_size bytes.
9293            let cur_offset: usize = (3 - 1) * envelope_size;
9294
9295            // Zero reserved fields.
9296            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9297
9298            // Safety:
9299            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9300            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9301            //   envelope_size bytes, there is always sufficient room.
9302            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math_common::VecF, D>(
9303                self.device_pixel_ratio.as_ref().map(
9304                    <fidl_fuchsia_math_common::VecF as fidl::encoding::ValueTypeMarker>::borrow,
9305                ),
9306                encoder,
9307                offset + cur_offset,
9308                depth,
9309            )?;
9310
9311            _prev_end_offset = cur_offset + envelope_size;
9312            if 4 > max_ordinal {
9313                return Ok(());
9314            }
9315
9316            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9317            // are envelope_size bytes.
9318            let cur_offset: usize = (4 - 1) * envelope_size;
9319
9320            // Zero reserved fields.
9321            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9322
9323            // Safety:
9324            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9325            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9326            //   envelope_size bytes, there is always sufficient room.
9327            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math_common::Inset, D>(
9328                self.inset.as_ref().map(
9329                    <fidl_fuchsia_math_common::Inset as fidl::encoding::ValueTypeMarker>::borrow,
9330                ),
9331                encoder,
9332                offset + cur_offset,
9333                depth,
9334            )?;
9335
9336            _prev_end_offset = cur_offset + envelope_size;
9337
9338            Ok(())
9339        }
9340    }
9341
9342    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayoutInfo {
9343        #[inline(always)]
9344        fn new_empty() -> Self {
9345            Self::default()
9346        }
9347
9348        unsafe fn decode(
9349            &mut self,
9350            decoder: &mut fidl::encoding::Decoder<'_, D>,
9351            offset: usize,
9352            mut depth: fidl::encoding::Depth,
9353        ) -> fidl::Result<()> {
9354            decoder.debug_check_bounds::<Self>(offset);
9355            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9356                None => return Err(fidl::Error::NotNullable),
9357                Some(len) => len,
9358            };
9359            // Calling decoder.out_of_line_offset(0) is not allowed.
9360            if len == 0 {
9361                return Ok(());
9362            };
9363            depth.increment()?;
9364            let envelope_size = 8;
9365            let bytes_len = len * envelope_size;
9366            let offset = decoder.out_of_line_offset(bytes_len)?;
9367            // Decode the envelope for each type.
9368            let mut _next_ordinal_to_read = 0;
9369            let mut next_offset = offset;
9370            let end_offset = offset + bytes_len;
9371            _next_ordinal_to_read += 1;
9372            if next_offset >= end_offset {
9373                return Ok(());
9374            }
9375
9376            // Decode unknown envelopes for gaps in ordinals.
9377            while _next_ordinal_to_read < 1 {
9378                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9379                _next_ordinal_to_read += 1;
9380                next_offset += envelope_size;
9381            }
9382
9383            let next_out_of_line = decoder.next_out_of_line();
9384            let handles_before = decoder.remaining_handles();
9385            if let Some((inlined, num_bytes, num_handles)) =
9386                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9387            {
9388                let member_inline_size =
9389                    <fidl_fuchsia_math_common::SizeU as fidl::encoding::TypeMarker>::inline_size(
9390                        decoder.context,
9391                    );
9392                if inlined != (member_inline_size <= 4) {
9393                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9394                }
9395                let inner_offset;
9396                let mut inner_depth = depth.clone();
9397                if inlined {
9398                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9399                    inner_offset = next_offset;
9400                } else {
9401                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9402                    inner_depth.increment()?;
9403                }
9404                let val_ref = self
9405                    .logical_size
9406                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math_common::SizeU, D));
9407                fidl::decode!(
9408                    fidl_fuchsia_math_common::SizeU,
9409                    D,
9410                    val_ref,
9411                    decoder,
9412                    inner_offset,
9413                    inner_depth
9414                )?;
9415                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9416                {
9417                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9418                }
9419                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9420                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9421                }
9422            }
9423
9424            next_offset += envelope_size;
9425            _next_ordinal_to_read += 1;
9426            if next_offset >= end_offset {
9427                return Ok(());
9428            }
9429
9430            // Decode unknown envelopes for gaps in ordinals.
9431            while _next_ordinal_to_read < 3 {
9432                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9433                _next_ordinal_to_read += 1;
9434                next_offset += envelope_size;
9435            }
9436
9437            let next_out_of_line = decoder.next_out_of_line();
9438            let handles_before = decoder.remaining_handles();
9439            if let Some((inlined, num_bytes, num_handles)) =
9440                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9441            {
9442                let member_inline_size =
9443                    <fidl_fuchsia_math_common::VecF as fidl::encoding::TypeMarker>::inline_size(
9444                        decoder.context,
9445                    );
9446                if inlined != (member_inline_size <= 4) {
9447                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9448                }
9449                let inner_offset;
9450                let mut inner_depth = depth.clone();
9451                if inlined {
9452                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9453                    inner_offset = next_offset;
9454                } else {
9455                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9456                    inner_depth.increment()?;
9457                }
9458                let val_ref = self
9459                    .device_pixel_ratio
9460                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math_common::VecF, D));
9461                fidl::decode!(
9462                    fidl_fuchsia_math_common::VecF,
9463                    D,
9464                    val_ref,
9465                    decoder,
9466                    inner_offset,
9467                    inner_depth
9468                )?;
9469                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9470                {
9471                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9472                }
9473                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9474                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9475                }
9476            }
9477
9478            next_offset += envelope_size;
9479            _next_ordinal_to_read += 1;
9480            if next_offset >= end_offset {
9481                return Ok(());
9482            }
9483
9484            // Decode unknown envelopes for gaps in ordinals.
9485            while _next_ordinal_to_read < 4 {
9486                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9487                _next_ordinal_to_read += 1;
9488                next_offset += envelope_size;
9489            }
9490
9491            let next_out_of_line = decoder.next_out_of_line();
9492            let handles_before = decoder.remaining_handles();
9493            if let Some((inlined, num_bytes, num_handles)) =
9494                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9495            {
9496                let member_inline_size =
9497                    <fidl_fuchsia_math_common::Inset as fidl::encoding::TypeMarker>::inline_size(
9498                        decoder.context,
9499                    );
9500                if inlined != (member_inline_size <= 4) {
9501                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9502                }
9503                let inner_offset;
9504                let mut inner_depth = depth.clone();
9505                if inlined {
9506                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9507                    inner_offset = next_offset;
9508                } else {
9509                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9510                    inner_depth.increment()?;
9511                }
9512                let val_ref = self
9513                    .inset
9514                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math_common::Inset, D));
9515                fidl::decode!(
9516                    fidl_fuchsia_math_common::Inset,
9517                    D,
9518                    val_ref,
9519                    decoder,
9520                    inner_offset,
9521                    inner_depth
9522                )?;
9523                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9524                {
9525                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9526                }
9527                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9528                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9529                }
9530            }
9531
9532            next_offset += envelope_size;
9533
9534            // Decode the remaining unknown envelopes.
9535            while next_offset < end_offset {
9536                _next_ordinal_to_read += 1;
9537                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9538                next_offset += envelope_size;
9539            }
9540
9541            Ok(())
9542        }
9543    }
9544
9545    impl OnNextFrameBeginValues {
9546        #[inline(always)]
9547        fn max_ordinal_present(&self) -> u64 {
9548            if let Some(_) = self.future_presentation_infos {
9549                return 2;
9550            }
9551            if let Some(_) = self.additional_present_credits {
9552                return 1;
9553            }
9554            0
9555        }
9556    }
9557
9558    impl fidl::encoding::ValueTypeMarker for OnNextFrameBeginValues {
9559        type Borrowed<'a> = &'a Self;
9560        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9561            value
9562        }
9563    }
9564
9565    unsafe impl fidl::encoding::TypeMarker for OnNextFrameBeginValues {
9566        type Owned = Self;
9567
9568        #[inline(always)]
9569        fn inline_align(_context: fidl::encoding::Context) -> usize {
9570            8
9571        }
9572
9573        #[inline(always)]
9574        fn inline_size(_context: fidl::encoding::Context) -> usize {
9575            16
9576        }
9577    }
9578
9579    unsafe impl<D: fidl::encoding::ResourceDialect>
9580        fidl::encoding::Encode<OnNextFrameBeginValues, D> for &OnNextFrameBeginValues
9581    {
9582        unsafe fn encode(
9583            self,
9584            encoder: &mut fidl::encoding::Encoder<'_, D>,
9585            offset: usize,
9586            mut depth: fidl::encoding::Depth,
9587        ) -> fidl::Result<()> {
9588            encoder.debug_check_bounds::<OnNextFrameBeginValues>(offset);
9589            // Vector header
9590            let max_ordinal: u64 = self.max_ordinal_present();
9591            encoder.write_num(max_ordinal, offset);
9592            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9593            // Calling encoder.out_of_line_offset(0) is not allowed.
9594            if max_ordinal == 0 {
9595                return Ok(());
9596            }
9597            depth.increment()?;
9598            let envelope_size = 8;
9599            let bytes_len = max_ordinal as usize * envelope_size;
9600            #[allow(unused_variables)]
9601            let offset = encoder.out_of_line_offset(bytes_len);
9602            let mut _prev_end_offset: usize = 0;
9603            if 1 > max_ordinal {
9604                return Ok(());
9605            }
9606
9607            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9608            // are envelope_size bytes.
9609            let cur_offset: usize = (1 - 1) * envelope_size;
9610
9611            // Zero reserved fields.
9612            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9613
9614            // Safety:
9615            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9616            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9617            //   envelope_size bytes, there is always sufficient room.
9618            fidl::encoding::encode_in_envelope_optional::<u32, D>(
9619                self.additional_present_credits
9620                    .as_ref()
9621                    .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
9622                encoder,
9623                offset + cur_offset,
9624                depth,
9625            )?;
9626
9627            _prev_end_offset = cur_offset + envelope_size;
9628            if 2 > max_ordinal {
9629                return Ok(());
9630            }
9631
9632            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9633            // are envelope_size bytes.
9634            let cur_offset: usize = (2 - 1) * envelope_size;
9635
9636            // Zero reserved fields.
9637            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9638
9639            // Safety:
9640            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9641            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9642            //   envelope_size bytes, there is always sufficient room.
9643            fidl::encoding::encode_in_envelope_optional::<
9644                fidl::encoding::Vector<fidl_fuchsia_scenic_scheduling_common::PresentationInfo, 8>,
9645                D,
9646            >(
9647                self.future_presentation_infos.as_ref().map(
9648                    <fidl::encoding::Vector<
9649                        fidl_fuchsia_scenic_scheduling_common::PresentationInfo,
9650                        8,
9651                    > as fidl::encoding::ValueTypeMarker>::borrow,
9652                ),
9653                encoder,
9654                offset + cur_offset,
9655                depth,
9656            )?;
9657
9658            _prev_end_offset = cur_offset + envelope_size;
9659
9660            Ok(())
9661        }
9662    }
9663
9664    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9665        for OnNextFrameBeginValues
9666    {
9667        #[inline(always)]
9668        fn new_empty() -> Self {
9669            Self::default()
9670        }
9671
9672        unsafe fn decode(
9673            &mut self,
9674            decoder: &mut fidl::encoding::Decoder<'_, D>,
9675            offset: usize,
9676            mut depth: fidl::encoding::Depth,
9677        ) -> fidl::Result<()> {
9678            decoder.debug_check_bounds::<Self>(offset);
9679            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9680                None => return Err(fidl::Error::NotNullable),
9681                Some(len) => len,
9682            };
9683            // Calling decoder.out_of_line_offset(0) is not allowed.
9684            if len == 0 {
9685                return Ok(());
9686            };
9687            depth.increment()?;
9688            let envelope_size = 8;
9689            let bytes_len = len * envelope_size;
9690            let offset = decoder.out_of_line_offset(bytes_len)?;
9691            // Decode the envelope for each type.
9692            let mut _next_ordinal_to_read = 0;
9693            let mut next_offset = offset;
9694            let end_offset = offset + bytes_len;
9695            _next_ordinal_to_read += 1;
9696            if next_offset >= end_offset {
9697                return Ok(());
9698            }
9699
9700            // Decode unknown envelopes for gaps in ordinals.
9701            while _next_ordinal_to_read < 1 {
9702                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9703                _next_ordinal_to_read += 1;
9704                next_offset += envelope_size;
9705            }
9706
9707            let next_out_of_line = decoder.next_out_of_line();
9708            let handles_before = decoder.remaining_handles();
9709            if let Some((inlined, num_bytes, num_handles)) =
9710                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9711            {
9712                let member_inline_size =
9713                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9714                if inlined != (member_inline_size <= 4) {
9715                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9716                }
9717                let inner_offset;
9718                let mut inner_depth = depth.clone();
9719                if inlined {
9720                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9721                    inner_offset = next_offset;
9722                } else {
9723                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9724                    inner_depth.increment()?;
9725                }
9726                let val_ref =
9727                    self.additional_present_credits.get_or_insert_with(|| fidl::new_empty!(u32, D));
9728                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
9729                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9730                {
9731                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9732                }
9733                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9734                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9735                }
9736            }
9737
9738            next_offset += envelope_size;
9739            _next_ordinal_to_read += 1;
9740            if next_offset >= end_offset {
9741                return Ok(());
9742            }
9743
9744            // Decode unknown envelopes for gaps in ordinals.
9745            while _next_ordinal_to_read < 2 {
9746                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9747                _next_ordinal_to_read += 1;
9748                next_offset += envelope_size;
9749            }
9750
9751            let next_out_of_line = decoder.next_out_of_line();
9752            let handles_before = decoder.remaining_handles();
9753            if let Some((inlined, num_bytes, num_handles)) =
9754                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9755            {
9756                let member_inline_size = <fidl::encoding::Vector<
9757                    fidl_fuchsia_scenic_scheduling_common::PresentationInfo,
9758                    8,
9759                > as fidl::encoding::TypeMarker>::inline_size(
9760                    decoder.context
9761                );
9762                if inlined != (member_inline_size <= 4) {
9763                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9764                }
9765                let inner_offset;
9766                let mut inner_depth = depth.clone();
9767                if inlined {
9768                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9769                    inner_offset = next_offset;
9770                } else {
9771                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9772                    inner_depth.increment()?;
9773                }
9774                let val_ref =
9775                self.future_presentation_infos.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_scenic_scheduling_common::PresentationInfo, 8>, D));
9776                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_scenic_scheduling_common::PresentationInfo, 8>, D, val_ref, decoder, inner_offset, inner_depth)?;
9777                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9778                {
9779                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9780                }
9781                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9782                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9783                }
9784            }
9785
9786            next_offset += envelope_size;
9787
9788            // Decode the remaining unknown envelopes.
9789            while next_offset < end_offset {
9790                _next_ordinal_to_read += 1;
9791                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9792                next_offset += envelope_size;
9793            }
9794
9795            Ok(())
9796        }
9797    }
9798
9799    impl ViewportProperties {
9800        #[inline(always)]
9801        fn max_ordinal_present(&self) -> u64 {
9802            if let Some(_) = self.inset {
9803                return 2;
9804            }
9805            if let Some(_) = self.logical_size {
9806                return 1;
9807            }
9808            0
9809        }
9810    }
9811
9812    impl fidl::encoding::ValueTypeMarker for ViewportProperties {
9813        type Borrowed<'a> = &'a Self;
9814        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9815            value
9816        }
9817    }
9818
9819    unsafe impl fidl::encoding::TypeMarker for ViewportProperties {
9820        type Owned = Self;
9821
9822        #[inline(always)]
9823        fn inline_align(_context: fidl::encoding::Context) -> usize {
9824            8
9825        }
9826
9827        #[inline(always)]
9828        fn inline_size(_context: fidl::encoding::Context) -> usize {
9829            16
9830        }
9831    }
9832
9833    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ViewportProperties, D>
9834        for &ViewportProperties
9835    {
9836        unsafe fn encode(
9837            self,
9838            encoder: &mut fidl::encoding::Encoder<'_, D>,
9839            offset: usize,
9840            mut depth: fidl::encoding::Depth,
9841        ) -> fidl::Result<()> {
9842            encoder.debug_check_bounds::<ViewportProperties>(offset);
9843            // Vector header
9844            let max_ordinal: u64 = self.max_ordinal_present();
9845            encoder.write_num(max_ordinal, offset);
9846            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9847            // Calling encoder.out_of_line_offset(0) is not allowed.
9848            if max_ordinal == 0 {
9849                return Ok(());
9850            }
9851            depth.increment()?;
9852            let envelope_size = 8;
9853            let bytes_len = max_ordinal as usize * envelope_size;
9854            #[allow(unused_variables)]
9855            let offset = encoder.out_of_line_offset(bytes_len);
9856            let mut _prev_end_offset: usize = 0;
9857            if 1 > max_ordinal {
9858                return Ok(());
9859            }
9860
9861            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9862            // are envelope_size bytes.
9863            let cur_offset: usize = (1 - 1) * envelope_size;
9864
9865            // Zero reserved fields.
9866            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9867
9868            // Safety:
9869            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9870            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9871            //   envelope_size bytes, there is always sufficient room.
9872            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math_common::SizeU, D>(
9873                self.logical_size.as_ref().map(
9874                    <fidl_fuchsia_math_common::SizeU as fidl::encoding::ValueTypeMarker>::borrow,
9875                ),
9876                encoder,
9877                offset + cur_offset,
9878                depth,
9879            )?;
9880
9881            _prev_end_offset = cur_offset + envelope_size;
9882            if 2 > max_ordinal {
9883                return Ok(());
9884            }
9885
9886            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9887            // are envelope_size bytes.
9888            let cur_offset: usize = (2 - 1) * envelope_size;
9889
9890            // Zero reserved fields.
9891            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9892
9893            // Safety:
9894            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9895            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9896            //   envelope_size bytes, there is always sufficient room.
9897            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math_common::Inset, D>(
9898                self.inset.as_ref().map(
9899                    <fidl_fuchsia_math_common::Inset as fidl::encoding::ValueTypeMarker>::borrow,
9900                ),
9901                encoder,
9902                offset + cur_offset,
9903                depth,
9904            )?;
9905
9906            _prev_end_offset = cur_offset + envelope_size;
9907
9908            Ok(())
9909        }
9910    }
9911
9912    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ViewportProperties {
9913        #[inline(always)]
9914        fn new_empty() -> Self {
9915            Self::default()
9916        }
9917
9918        unsafe fn decode(
9919            &mut self,
9920            decoder: &mut fidl::encoding::Decoder<'_, D>,
9921            offset: usize,
9922            mut depth: fidl::encoding::Depth,
9923        ) -> fidl::Result<()> {
9924            decoder.debug_check_bounds::<Self>(offset);
9925            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9926                None => return Err(fidl::Error::NotNullable),
9927                Some(len) => len,
9928            };
9929            // Calling decoder.out_of_line_offset(0) is not allowed.
9930            if len == 0 {
9931                return Ok(());
9932            };
9933            depth.increment()?;
9934            let envelope_size = 8;
9935            let bytes_len = len * envelope_size;
9936            let offset = decoder.out_of_line_offset(bytes_len)?;
9937            // Decode the envelope for each type.
9938            let mut _next_ordinal_to_read = 0;
9939            let mut next_offset = offset;
9940            let end_offset = offset + bytes_len;
9941            _next_ordinal_to_read += 1;
9942            if next_offset >= end_offset {
9943                return Ok(());
9944            }
9945
9946            // Decode unknown envelopes for gaps in ordinals.
9947            while _next_ordinal_to_read < 1 {
9948                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9949                _next_ordinal_to_read += 1;
9950                next_offset += envelope_size;
9951            }
9952
9953            let next_out_of_line = decoder.next_out_of_line();
9954            let handles_before = decoder.remaining_handles();
9955            if let Some((inlined, num_bytes, num_handles)) =
9956                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9957            {
9958                let member_inline_size =
9959                    <fidl_fuchsia_math_common::SizeU as fidl::encoding::TypeMarker>::inline_size(
9960                        decoder.context,
9961                    );
9962                if inlined != (member_inline_size <= 4) {
9963                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9964                }
9965                let inner_offset;
9966                let mut inner_depth = depth.clone();
9967                if inlined {
9968                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9969                    inner_offset = next_offset;
9970                } else {
9971                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9972                    inner_depth.increment()?;
9973                }
9974                let val_ref = self
9975                    .logical_size
9976                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math_common::SizeU, D));
9977                fidl::decode!(
9978                    fidl_fuchsia_math_common::SizeU,
9979                    D,
9980                    val_ref,
9981                    decoder,
9982                    inner_offset,
9983                    inner_depth
9984                )?;
9985                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9986                {
9987                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9988                }
9989                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9990                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9991                }
9992            }
9993
9994            next_offset += envelope_size;
9995            _next_ordinal_to_read += 1;
9996            if next_offset >= end_offset {
9997                return Ok(());
9998            }
9999
10000            // Decode unknown envelopes for gaps in ordinals.
10001            while _next_ordinal_to_read < 2 {
10002                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10003                _next_ordinal_to_read += 1;
10004                next_offset += envelope_size;
10005            }
10006
10007            let next_out_of_line = decoder.next_out_of_line();
10008            let handles_before = decoder.remaining_handles();
10009            if let Some((inlined, num_bytes, num_handles)) =
10010                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10011            {
10012                let member_inline_size =
10013                    <fidl_fuchsia_math_common::Inset as fidl::encoding::TypeMarker>::inline_size(
10014                        decoder.context,
10015                    );
10016                if inlined != (member_inline_size <= 4) {
10017                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10018                }
10019                let inner_offset;
10020                let mut inner_depth = depth.clone();
10021                if inlined {
10022                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10023                    inner_offset = next_offset;
10024                } else {
10025                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10026                    inner_depth.increment()?;
10027                }
10028                let val_ref = self
10029                    .inset
10030                    .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math_common::Inset, D));
10031                fidl::decode!(
10032                    fidl_fuchsia_math_common::Inset,
10033                    D,
10034                    val_ref,
10035                    decoder,
10036                    inner_offset,
10037                    inner_depth
10038                )?;
10039                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10040                {
10041                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10042                }
10043                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10044                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10045                }
10046            }
10047
10048            next_offset += envelope_size;
10049
10050            // Decode the remaining unknown envelopes.
10051            while next_offset < end_offset {
10052                _next_ordinal_to_read += 1;
10053                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10054                next_offset += envelope_size;
10055            }
10056
10057            Ok(())
10058        }
10059    }
10060
10061    impl fidl::encoding::ValueTypeMarker for TransformContent {
10062        type Borrowed<'a> = &'a Self;
10063        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10064            value
10065        }
10066    }
10067
10068    unsafe impl fidl::encoding::TypeMarker for TransformContent {
10069        type Owned = Self;
10070
10071        #[inline(always)]
10072        fn inline_align(_context: fidl::encoding::Context) -> usize {
10073            8
10074        }
10075
10076        #[inline(always)]
10077        fn inline_size(_context: fidl::encoding::Context) -> usize {
10078            16
10079        }
10080    }
10081
10082    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TransformContent, D>
10083        for &TransformContent
10084    {
10085        #[inline]
10086        unsafe fn encode(
10087            self,
10088            encoder: &mut fidl::encoding::Encoder<'_, D>,
10089            offset: usize,
10090            _depth: fidl::encoding::Depth,
10091        ) -> fidl::Result<()> {
10092            encoder.debug_check_bounds::<TransformContent>(offset);
10093            encoder.write_num::<u64>(self.ordinal(), offset);
10094            match self {
10095                TransformContent::LayerStack(ref val) => {
10096                    fidl::encoding::encode_in_envelope::<LayerStackId, D>(
10097                        <LayerStackId as fidl::encoding::ValueTypeMarker>::borrow(val),
10098                        encoder,
10099                        offset + 8,
10100                        _depth,
10101                    )
10102                }
10103                TransformContent::Viewport(ref val) => {
10104                    fidl::encoding::encode_in_envelope::<ViewportId, D>(
10105                        <ViewportId as fidl::encoding::ValueTypeMarker>::borrow(val),
10106                        encoder,
10107                        offset + 8,
10108                        _depth,
10109                    )
10110                }
10111            }
10112        }
10113    }
10114
10115    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TransformContent {
10116        #[inline(always)]
10117        fn new_empty() -> Self {
10118            Self::LayerStack(fidl::new_empty!(LayerStackId, D))
10119        }
10120
10121        #[inline]
10122        unsafe fn decode(
10123            &mut self,
10124            decoder: &mut fidl::encoding::Decoder<'_, D>,
10125            offset: usize,
10126            mut depth: fidl::encoding::Depth,
10127        ) -> fidl::Result<()> {
10128            decoder.debug_check_bounds::<Self>(offset);
10129            #[allow(unused_variables)]
10130            let next_out_of_line = decoder.next_out_of_line();
10131            let handles_before = decoder.remaining_handles();
10132            let (ordinal, inlined, num_bytes, num_handles) =
10133                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
10134
10135            let member_inline_size = match ordinal {
10136                1 => <LayerStackId as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10137                2 => <ViewportId as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10138                _ => return Err(fidl::Error::UnknownUnionTag),
10139            };
10140
10141            if inlined != (member_inline_size <= 4) {
10142                return Err(fidl::Error::InvalidInlineBitInEnvelope);
10143            }
10144            let _inner_offset;
10145            if inlined {
10146                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
10147                _inner_offset = offset + 8;
10148            } else {
10149                depth.increment()?;
10150                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10151            }
10152            match ordinal {
10153                1 => {
10154                    #[allow(irrefutable_let_patterns)]
10155                    if let TransformContent::LayerStack(_) = self {
10156                        // Do nothing, read the value into the object
10157                    } else {
10158                        // Initialize `self` to the right variant
10159                        *self = TransformContent::LayerStack(fidl::new_empty!(LayerStackId, D));
10160                    }
10161                    #[allow(irrefutable_let_patterns)]
10162                    if let TransformContent::LayerStack(ref mut val) = self {
10163                        fidl::decode!(LayerStackId, D, val, decoder, _inner_offset, depth)?;
10164                    } else {
10165                        unreachable!()
10166                    }
10167                }
10168                2 => {
10169                    #[allow(irrefutable_let_patterns)]
10170                    if let TransformContent::Viewport(_) = self {
10171                        // Do nothing, read the value into the object
10172                    } else {
10173                        // Initialize `self` to the right variant
10174                        *self = TransformContent::Viewport(fidl::new_empty!(ViewportId, D));
10175                    }
10176                    #[allow(irrefutable_let_patterns)]
10177                    if let TransformContent::Viewport(ref mut val) = self {
10178                        fidl::decode!(ViewportId, D, val, decoder, _inner_offset, depth)?;
10179                    } else {
10180                        unreachable!()
10181                    }
10182                }
10183                ordinal => panic!("unexpected ordinal {:?}", ordinal),
10184            }
10185            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
10186                return Err(fidl::Error::InvalidNumBytesInEnvelope);
10187            }
10188            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10189                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10190            }
10191            Ok(())
10192        }
10193    }
10194}