Skip to main content

fidl_fuchsia_ui_composition__common/
fidl_fuchsia_ui_composition__common.rs

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