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