Skip to main content

fidl_fuchsia_hardware_display__common/
fidl_fuchsia_hardware_display__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/// Type of the internal value in [`fuchsia.hardware.display/BufferCollectionId`].
12pub type BufferCollectionIdValue = u64;
13
14/// See [`fuchsia.hardware.display/ClientPriority`].
15pub type ClientPriorityValue = u32;
16
17/// See [`fuchsia.hardware.display.types/ConfigStamp`].
18pub type ConfigStampValue = u64;
19
20/// Type of the internal value in [`fuchsia.hardware.display/EventId`].
21pub type EventIdValue = u64;
22
23/// Type of the internal value in [`ImageId`].
24pub type ImageIdValue = u64;
25
26/// Type of the internal value in [`LayerId`].
27pub type LayerIdValue = u64;
28
29/// Type of the internal value in [`VsyncAckCookie`].
30pub type VsyncAckCookieValue = u64;
31
32pub const IDENTIFIER_MAX_LEN: u32 = 128;
33
34pub const INVALID_CLIENT_PRIORITY_VALUE: u32 = 0;
35
36pub const INVALID_CONFIG_STAMP_VALUE: u64 = 0;
37
38/// Constrains the use of `Coordinator.SetLayerImage2`; see documentation there.
39pub const MAX_WAITING_IMAGES_PER_LAYER: u32 = 10;
40
41/// Statically assigned priority level for the primary client.
42pub const PRIMARY_CLIENT_PRIORITY_VALUE: u32 = 200;
43
44/// Statically assigned priority level for the virtcon client.
45pub const VIRTCON_CLIENT_PRIORITY_VALUE: u32 = 100;
46
47#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
48#[repr(u8)]
49pub enum VirtconMode {
50    /// The Virtcon client owns the displays when there is no Primary client.
51    Fallback = 0,
52    /// The Virtcon client owns the displays even when a Primary client is
53    /// connected.
54    Forced = 1,
55}
56
57impl VirtconMode {
58    #[inline]
59    pub fn from_primitive(prim: u8) -> Option<Self> {
60        match prim {
61            0 => Some(Self::Fallback),
62            1 => Some(Self::Forced),
63            _ => None,
64        }
65    }
66
67    #[inline]
68    pub const fn into_primitive(self) -> u8 {
69        self as u8
70    }
71}
72
73/// Identifies a sysmem BufferCollection owned by a Display Coordinator client.
74///
75/// Values are managed by [`fuchsia.hardware.display/Coordinator`] clients, to
76/// facilitate feed-forward dataflow.
77///
78/// Each value uniquely identifies a [`fuchsia.sysmem/BufferCollection`] (as
79/// well as its token [`fuchsia.sysmem/BufferCollectionToken`]) imported to the
80/// Display Coordinator device within a Coordinator connection. The identifier
81/// of a BufferCollection destroyed via
82/// [`fuchsia.hardware.display/Coordinator.ReleaseBufferCollection`] can be
83/// reused in a subsequent
84/// [`fuchsia.hardware.display/Coordinator.ImportBufferCollection`] call.
85#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
86#[repr(C)]
87pub struct BufferCollectionId {
88    pub value: u64,
89}
90
91impl fidl::Persistable for BufferCollectionId {}
92
93/// Decides which Display Coordinator client owns the displays.
94///
95/// The Display Coordinator has at most one connected client at each priority
96/// level. The client with the highest priority level owns the displays. Higher
97/// numerical values represent higher priorities.
98///
99/// [`fuchsia.hardware.display/INVALID_CLIENT_PRIORITY_VALUE`] is reserved as a
100/// null value placeholder. Clients may not ask for this priority level when
101/// connecting to the Coordinator.
102#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
103#[repr(C)]
104pub struct ClientPriority {
105    pub value: u32,
106}
107
108impl fidl::Persistable for ClientPriority {}
109
110/// Identifies a display configuration committed to the Coordinator.
111///
112/// This is a type-safe wrapper for a
113/// [`fuchsia.hardware.display/ConfigStampValue`], which is a raw numeric value.
114///
115/// Values are unique within a Display Coordinator client connection.
116///
117/// Clients create new values when they call
118/// [`fuchsia.hardware.display/Coordinator.CommitConfig`]. The values are used
119/// by the Display Coordinator to identify configurations in
120/// [`fuchsia.hardware.display/CoordinatorListener.OnVsync`] calls.
121///
122/// Clients must create strictly increasing (unique, strictly monotonic) values
123/// within the lifetime of a [`fuchsia.display/Coordinator`] connection.
124///
125/// [`fuchsia.hardware.display/INVALID_CONFIG_STAMP_VALUE`] represents an
126/// invalid value.
127#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
128#[repr(C)]
129pub struct ConfigStamp {
130    pub value: u64,
131}
132
133impl fidl::Persistable for ConfigStamp {}
134
135#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
136#[repr(C)]
137pub struct CoordinatorAcknowledgeVsyncRequest {
138    /// The cookie received in the most recent `OnVsync` message.
139    ///
140    /// Must not be zero. Zero cookies do not require acknowledgement.
141    ///
142    /// Each cookie must be acknowledged exactly once. Cookies must
143    /// be acknowledged in the order of their receipt.
144    pub cookie: u64,
145}
146
147impl fidl::Persistable for CoordinatorAcknowledgeVsyncRequest {}
148
149#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
150pub struct CoordinatorCheckConfigResponse {
151    pub res: fidl_fuchsia_hardware_display_types__common::ConfigResult,
152}
153
154impl fidl::Persistable for CoordinatorCheckConfigResponse {}
155
156#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
157#[repr(C)]
158pub struct CoordinatorCreateLayerRequest {
159    pub layer_id: LayerId,
160}
161
162impl fidl::Persistable for CoordinatorCreateLayerRequest {}
163
164#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
165#[repr(C)]
166pub struct CoordinatorDestroyLayerRequest {
167    pub layer_id: LayerId,
168}
169
170impl fidl::Persistable for CoordinatorDestroyLayerRequest {}
171
172#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
173#[repr(C)]
174pub struct CoordinatorGetLatestCommittedConfigStampResponse {
175    pub stamp: ConfigStamp,
176}
177
178impl fidl::Persistable for CoordinatorGetLatestCommittedConfigStampResponse {}
179
180#[derive(Clone, Debug, PartialEq)]
181pub struct CoordinatorImportImageRequest {
182    /// Must be compatible with the arguments passed to
183    /// [`Coordinator.SetBufferCollectionConstraints`] on the
184    /// `buffer_collection_id`.
185    pub image_metadata: fidl_fuchsia_hardware_display_types__common::ImageMetadata,
186    /// Identifies a previously imported BufferCollection.
187    ///
188    /// The ID must be assigned to an imported BufferCollection, via a
189    /// successful [`Coordinator.ImportBufferCollection`] call.
190    pub buffer_collection_id: BufferCollectionId,
191    /// Must be a valid index in the imported BufferCollection.
192    pub buffer_index: u32,
193    pub image_id: ImageId,
194}
195
196impl fidl::Persistable for CoordinatorImportImageRequest {}
197
198#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
199pub struct CoordinatorListenerOnClientOwnershipChangeRequest {
200    pub has_ownership: bool,
201}
202
203impl fidl::Persistable for CoordinatorListenerOnClientOwnershipChangeRequest {}
204
205#[derive(Clone, Debug, PartialEq)]
206pub struct CoordinatorListenerOnDisplaysChangedRequest {
207    pub added: Vec<Info>,
208    pub removed: Vec<fidl_fuchsia_hardware_display_types__common::DisplayId>,
209}
210
211impl fidl::Persistable for CoordinatorListenerOnDisplaysChangedRequest {}
212
213#[derive(Clone, Debug, PartialEq)]
214pub struct CoordinatorListenerOnVsyncRequest {
215    /// The display associated with the VSync event.
216    pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
217    /// The time when the VSync occurred.
218    ///
219    /// The accurrancy of this timestamp depends on the display hardware.
220    pub timestamp: fidl::MonotonicInstant,
221    /// Identifies the configuration that was displayed by the hardware.
222    ///
223    /// Guaranteed to be a valid value.
224    ///
225    /// If a configuration contains images that are still waiting to be
226    /// ready, that configuration will not be submitted to the hardware,
227    /// and that configuration's stamp will not be reported here.
228    pub displayed_config_stamp: ConfigStamp,
229    /// Used to acknowledge the receipt of VSync events.
230    ///
231    /// A value of zero means no acknowledgement is required by the
232    /// client.
233    ///
234    /// Each non-zero cookie must be acknowledged immediately, via a call to
235    /// [`Coordinator.AcknowledgeVsync`]. Cookies must be acknowledged even
236    /// if the client does not change the display's configuration.
237    pub cookie: VsyncAckCookie,
238}
239
240impl fidl::Persistable for CoordinatorListenerOnVsyncRequest {}
241
242#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
243#[repr(C)]
244pub struct CoordinatorReleaseBufferCollectionRequest {
245    pub buffer_collection_id: BufferCollectionId,
246}
247
248impl fidl::Persistable for CoordinatorReleaseBufferCollectionRequest {}
249
250#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
251#[repr(C)]
252pub struct CoordinatorReleaseEventRequest {
253    pub id: EventId,
254}
255
256impl fidl::Persistable for CoordinatorReleaseEventRequest {}
257
258#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
259#[repr(C)]
260pub struct CoordinatorReleaseImageRequest {
261    pub image_id: ImageId,
262}
263
264impl fidl::Persistable for CoordinatorReleaseImageRequest {}
265
266#[derive(Clone, Debug, PartialEq)]
267pub struct CoordinatorSetBufferCollectionConstraintsRequest {
268    pub buffer_collection_id: BufferCollectionId,
269    pub buffer_usage: fidl_fuchsia_hardware_display_types__common::ImageBufferUsage,
270}
271
272impl fidl::Persistable for CoordinatorSetBufferCollectionConstraintsRequest {}
273
274#[derive(Clone, Debug, PartialEq)]
275pub struct CoordinatorSetDisplayColorConversionRequest {
276    /// The display whose color coefficients are set.
277    ///
278    /// The call is ignored if the display ID does not belong to a display
279    /// known by the Coordinator. This can happen if a client issues a call
280    /// to [`Coordinator.SetDisplayColorConversion`] before it receives a
281    /// notification that the display was removed.
282    pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
283    pub preoffsets: [f32; 3],
284    pub coefficients: [f32; 9],
285    pub postoffsets: [f32; 3],
286}
287
288impl fidl::Persistable for CoordinatorSetDisplayColorConversionRequest {}
289
290#[derive(Clone, Debug, PartialEq)]
291pub struct CoordinatorSetDisplayLayersRequest {
292    /// The display that will show the result of compositing the layers.
293    ///
294    /// The call is ignored if the display ID does not belong to a display
295    /// known by the Coordinator. This can happen if a client issues a call
296    /// to [`Coordinator.SetDisplayLayers`] before it receives a
297    /// notification that the display was removed.
298    pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
299    pub layer_ids: Vec<LayerId>,
300}
301
302impl fidl::Persistable for CoordinatorSetDisplayLayersRequest {}
303
304#[derive(Clone, Debug, PartialEq)]
305pub struct CoordinatorSetDisplayModeRequest {
306    /// The display whose mode is changed.
307    ///
308    /// The call is ignored if the display ID does not belong to a display
309    /// known by the Coordinator. This can happen if a client issues a call
310    /// to [`Coordinator.SetDisplayMode`] before it receives a notification
311    /// that the display was removed.
312    pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
313    /// The new mode for the display.
314    ///
315    /// Must be one of the [`Info.modes`] entries for the display.
316    pub mode: fidl_fuchsia_hardware_display_types__common::Mode,
317}
318
319impl fidl::Persistable for CoordinatorSetDisplayModeRequest {}
320
321#[derive(Clone, Debug, PartialEq)]
322pub struct CoordinatorSetDisplayPowerModeRequest {
323    pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
324    /// The target power mode of the display hardware.
325    ///
326    /// Once `power_mode` is set to `OFF`, the hardware will not generate
327    /// new VSync events. However, the client should be prepared to handle
328    /// VSync events generated before the
329    /// [`Coordinator.SetDisplayPowerMode`] call reaches the hardware.
330    ///
331    /// Calls that impact draft configurations, such as
332    /// [`Coordinator.SetDisplayLayers`], still work while `power_mode` is
333    /// set to `OFF`.
334    ///
335    /// `CommitConfig` also works while the `power_mode` is
336    /// set to `OFF`. When the display is powered back on, the display will
337    /// show the latest committed configuration.
338    ///
339    /// Newly added displays has `ON` power mode.
340    pub power_mode: fidl_fuchsia_hardware_display_types__common::PowerMode,
341}
342
343impl fidl::Persistable for CoordinatorSetDisplayPowerModeRequest {}
344
345#[derive(Clone, Debug, PartialEq)]
346pub struct CoordinatorSetLayerColorConfigRequest {
347    pub layer_id: LayerId,
348    pub color: fidl_fuchsia_hardware_display_types__common::Color,
349    /// The display region occupied by the color fill layer.
350    ///
351    /// The rectangle uses the Vulkan coordinate space. The origin is at the
352    /// display's top-left corner. The X axis points to the right, and the Y
353    /// axis points downwards.
354    ///
355    /// A valid layer definition requires a valid non-empty display
356    /// destination rectangle that is entirely contained within the display.
357    pub display_destination: fidl_fuchsia_math__common::RectU,
358}
359
360impl fidl::Persistable for CoordinatorSetLayerColorConfigRequest {}
361
362#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
363#[repr(C)]
364pub struct CoordinatorSetLayerImage2Request {
365    pub layer_id: LayerId,
366    pub image_id: ImageId,
367    pub wait_event_id: EventId,
368}
369
370impl fidl::Persistable for CoordinatorSetLayerImage2Request {}
371
372#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
373pub struct CoordinatorSetLayerPrimaryAlphaRequest {
374    pub layer_id: LayerId,
375    pub mode: fidl_fuchsia_hardware_display_types__common::AlphaMode,
376    pub val: f32,
377}
378
379impl fidl::Persistable for CoordinatorSetLayerPrimaryAlphaRequest {}
380
381#[derive(Clone, Debug, PartialEq)]
382pub struct CoordinatorSetLayerPrimaryConfigRequest {
383    pub layer_id: LayerId,
384    pub image_metadata: fidl_fuchsia_hardware_display_types__common::ImageMetadata,
385}
386
387impl fidl::Persistable for CoordinatorSetLayerPrimaryConfigRequest {}
388
389#[derive(Clone, Debug, PartialEq)]
390pub struct CoordinatorSetLayerPrimaryPositionRequest {
391    pub layer_id: LayerId,
392    /// Applied to the input image pixels specified by `image_source`.
393    ///
394    /// `display_destination` must account for image dimensions changes
395    /// caused by rotations. For example, rotating a 600x300 pixel image by
396    /// 90 degrees would specify 300x600 pixel dimensions in
397    /// `display_destination`.
398    pub image_source_transformation:
399        fidl_fuchsia_hardware_display_types__common::CoordinateTransformation,
400    /// The associated image region whose pixels are drawn by the layer.
401    ///
402    /// The rectangle uses the Vulkan coordinate space. The origin is at the
403    /// image's top-left corner. The X axis points to the right, and the Y
404    /// axis points downwards.
405    ///
406    /// A valid layer definition requires a valid non-empty image source
407    /// rectangle that is entirely contained within the image.
408    ///
409    /// Hardware image cropping is requested implicitly, when the source
410    /// region's dimensions differ from the image's dimensions. Some display
411    /// hardware may not support cropping.
412    pub image_source: fidl_fuchsia_math__common::RectU,
413    /// The display image (composited output) region occupied by the layer.
414    ///
415    /// The rectangle uses the Vulkan coordinate space. The origin is at the
416    /// display's top-left corner. The X axis points to the right, and the Y
417    /// axis points downwards.
418    ///
419    /// A valid layer definition requires a valid non-empty display
420    /// destination rectangle that is entirely contained within the display.
421    ///
422    /// Hardware image scaling is requested implicitly, when the output
423    /// region's dimensions differ from the dimensions of `image_source`.
424    /// Some display hardware may not support scaling. All display hardware
425    /// has limitations in scaling support.
426    pub display_destination: fidl_fuchsia_math__common::RectU,
427}
428
429impl fidl::Persistable for CoordinatorSetLayerPrimaryPositionRequest {}
430
431#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
432#[repr(C)]
433pub struct CoordinatorSetMinimumRgbRequest {
434    pub minimum_rgb: u8,
435}
436
437impl fidl::Persistable for CoordinatorSetMinimumRgbRequest {}
438
439#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
440pub struct CoordinatorSetVirtconModeRequest {
441    pub mode: VirtconMode,
442}
443
444impl fidl::Persistable for CoordinatorSetVirtconModeRequest {}
445
446#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
447#[repr(C)]
448pub struct CoordinatorStartCaptureRequest {
449    pub signal_event_id: EventId,
450    pub image_id: ImageId,
451}
452
453impl fidl::Persistable for CoordinatorStartCaptureRequest {}
454
455#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
456pub struct CoordinatorIsCaptureSupportedResponse {
457    pub supported: bool,
458}
459
460impl fidl::Persistable for CoordinatorIsCaptureSupportedResponse {}
461
462/// Identifies a Zircon event shared between the Display Coordinator and a
463/// client.
464///
465/// [`fuchsia.hardware.display.types/INVALID_DISP_ID`] represents an invalid
466/// value.
467///
468/// Values are managed by [`fuchsia.hardware.display/Coordinator`] clients, to
469/// facilitate feed-forward dataflow.
470///
471/// Valid values uniquely identify Zircon events imported to the Coordinator
472/// within a display Coordinator connection.
473#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
474#[repr(C)]
475pub struct EventId {
476    pub value: u64,
477}
478
479impl fidl::Persistable for EventId {}
480
481/// Unique identifier for an image registered with the display coordinator.
482///
483/// [`fuchsia.hardware.display.types/INVALID_DISP_ID`] represents an invalid
484/// value.
485///
486/// Values are managed by [`fuchsia.hardware.display/Coordinator`] clients, to
487/// facilitate feed-forward dataflow.
488///
489/// Valid values uniquely identify "live" images within a Display Coordinator
490/// connection. The identifier of an image destroyed via
491/// [`fuchsia.hardware.display/Coordinator.ReleaseImage`] can be reused in a
492/// subsequent [`fuchsia.hardware.display/Coordinator.ImportImage`] call.
493///
494/// An image is a memory buffer whose bytes have a fixed interpretation as an
495/// array of pixels. Memory buffers are managed by sysmem, and are accessed by
496/// the display stack using a [`fuchsia.sysmem/BufferCollection`]. The buffer's
497/// interpretation is described by an
498/// [`fuchsia.hardware.display.types/ImageConfig`].
499#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
500#[repr(C)]
501pub struct ImageId {
502    pub value: u64,
503}
504
505impl fidl::Persistable for ImageId {}
506
507/// Description for a display device attached to the system.
508///
509/// Display devices include external monitors and internal panels.
510#[derive(Clone, Debug, PartialEq)]
511pub struct Info {
512    /// Uniquely identifies the display in a Controller connection.
513    ///
514    /// See [`fuchsia.hardware.display.types/DisplayId`].
515    pub id: fidl_fuchsia_hardware_display_types__common::DisplayId,
516    /// Operational modes supported by the described display device.
517    ///
518    /// The first entry is the device's preferred mode.
519    pub modes: Vec<fidl_fuchsia_hardware_display_types__common::Mode>,
520    /// Pixel formats that can be directly displayed on the attached display.
521    ///
522    /// This field will be revised to better reflect the subtleties around
523    /// modern display hardware, such as multiple layer types, and around
524    /// pixel format modifiers, such as tiling and framebuffer compression
525    /// formats. See https://fxbug.dev/42072347 and https://fxbug.dev/42076907.
526    ///
527    /// The formats listed here reflect support from both the display engine
528    /// hardware and the display device. This means some of the formats may be
529    /// subject to conversion inside the display engine hardware.
530    ///
531    /// The first entry in the list is the display's preferred format. This
532    /// format is likely to be supported for transferring data between the
533    /// display engine and the display hardware, and not require any conversion
534    /// inside the display engine.
535    ///
536    /// Format conversion inside the display engine is likely to be
537    /// significantly more power-efficient than a GPU render stage or software
538    /// conversion. So, using any format in this list is better than using the
539    /// GPU to convert to the preferred format.
540    pub pixel_format: Vec<fidl_fuchsia_images2__common::PixelFormat>,
541    /// Part of a display device identifier that persists across boot cycles.
542    ///
543    /// If the `manufacturer_name`, `monitor_name` and `monitor_serial` fields
544    /// are all non-empty, they  make up an identifier that is likely to be
545    /// unique to the attached device, and is highly unlikely to change across
546    /// boot cycles. Software that needs to identify displays (for example, to
547    /// honor display-specific preferences) should use this triplet.
548    pub manufacturer_name: String,
549    /// Part of a display device identifier that persists across boot cycles.
550    ///
551    /// See `manufacturer_name` for details.
552    pub monitor_name: String,
553    /// Part of a display device identifier that persists across boot cycles.
554    ///
555    /// See `manufacturer_name` for details.
556    pub monitor_serial: String,
557    /// Physical horizontal size of the displayed image area, in millimeters.
558    ///
559    /// If `using_fallback_size` is true, the value is a best guess from the
560    /// driver. Otherwise, the value here is reported by the display device.
561    pub horizontal_size_mm: u32,
562    /// Physical vertical size of the displayed image area, in millimeters.
563    ///
564    /// See `horizontal_size_mm` for more details.
565    pub vertical_size_mm: u32,
566    /// True if the driver does not have the display's physical sizing info.
567    pub using_fallback_size: bool,
568    /// The maximum number of layers that the display engine can composite
569    /// onto this display.
570    pub max_layer_count: u32,
571}
572
573impl fidl::Persistable for Info {}
574
575/// Identifies a layer resource owned by a Display Coordinator client.
576///
577/// [`fuchsia.hardware.display.types/INVALID_DISP_ID`] represents an invalid
578/// value.
579///
580/// Values are managed by [`fuchsia.hardware.display/Coordinator`] clients, to
581/// facilitate feed-forward dataflow.
582///
583/// Valid values uniquely identify "live" layers within a Display Coordinator
584/// connection. The identifier of a layer destroyed via
585/// [`fuchsia.hardware.display/Coordinator.DestroyLayer`] can be reused in a
586/// subsequent [`fuchsia.hardware.display/Coordinator.CreateLayer`] call.
587#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
588#[repr(C)]
589pub struct LayerId {
590    pub value: u64,
591}
592
593impl fidl::Persistable for LayerId {}
594
595/// Identifies a unique identifier ("cookie") of a Vertical Synchronization
596/// (Vsync) signal.
597///
598/// [`fuchsia.hardware.display.types/INVALID_DISP_ID`] represents an invalid
599/// value.
600#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
601#[repr(C)]
602pub struct VsyncAckCookie {
603    pub value: u64,
604}
605
606impl fidl::Persistable for VsyncAckCookie {}
607
608pub mod coordinator_ordinals {
609    pub const IMPORT_IMAGE: u64 = 0x3a8636eb9656b4f4;
610    pub const RELEASE_IMAGE: u64 = 0x477192230517504;
611    pub const IMPORT_EVENT: u64 = 0x2864e5dc59390543;
612    pub const RELEASE_EVENT: u64 = 0x32508c2101606b87;
613    pub const CREATE_LAYER: u64 = 0x2137cfd788a3496b;
614    pub const DESTROY_LAYER: u64 = 0x386e12d092bea2f8;
615    pub const SET_DISPLAY_MODE: u64 = 0xbde3c59ee9c1777;
616    pub const SET_DISPLAY_COLOR_CONVERSION: u64 = 0x2f18186a987d51aa;
617    pub const SET_DISPLAY_LAYERS: u64 = 0x190e0f6f93be1d89;
618    pub const SET_LAYER_PRIMARY_CONFIG: u64 = 0x68d89ebd518b45b9;
619    pub const SET_LAYER_PRIMARY_POSITION: u64 = 0x27b192b5a43851e2;
620    pub const SET_LAYER_PRIMARY_ALPHA: u64 = 0x104cf2b18b27296d;
621    pub const SET_LAYER_COLOR_CONFIG: u64 = 0x2fa91e9a2a01875f;
622    pub const SET_LAYER_IMAGE2: u64 = 0x53c6376dfc13a971;
623    pub const CHECK_CONFIG: u64 = 0x2bcfb4eb16878158;
624    pub const DISCARD_CONFIG: u64 = 0x1673399e9231dedf;
625    pub const GET_LATEST_COMMITTED_CONFIG_STAMP: u64 = 0x2a441f2c81af5d66;
626    pub const COMMIT_CONFIG: u64 = 0x4489cbd2fcfbaeaf;
627    pub const ACKNOWLEDGE_VSYNC: u64 = 0x25e921d26107d6ef;
628    pub const SET_VIRTCON_MODE: u64 = 0x4fe0721526068f00;
629    pub const IMPORT_BUFFER_COLLECTION: u64 = 0x30d06f510e7f4601;
630    pub const RELEASE_BUFFER_COLLECTION: u64 = 0x1c7dd5f8b0690be0;
631    pub const SET_BUFFER_COLLECTION_CONSTRAINTS: u64 = 0x509a4ee9af6035df;
632    pub const IS_CAPTURE_SUPPORTED: u64 = 0x4ca407277277971b;
633    pub const START_CAPTURE: u64 = 0x35cb38f19d96a8db;
634    pub const SET_MINIMUM_RGB: u64 = 0x1b49251437038b0b;
635    pub const SET_DISPLAY_POWER_MODE: u64 = 0xf4672f055072c92;
636}
637
638pub mod coordinator_listener_ordinals {
639    pub const ON_DISPLAYS_CHANGED: u64 = 0x248fbe90c338a94f;
640    pub const ON_VSYNC: u64 = 0x249e9b8da7a7ac47;
641    pub const ON_CLIENT_OWNERSHIP_CHANGE: u64 = 0x1acd2ae683153d5e;
642}
643
644pub mod provider_ordinals {
645    pub const OPEN_COORDINATOR: u64 = 0x1bd6070372d03df0;
646}
647
648mod internal {
649    use super::*;
650    unsafe impl fidl::encoding::TypeMarker for VirtconMode {
651        type Owned = Self;
652
653        #[inline(always)]
654        fn inline_align(_context: fidl::encoding::Context) -> usize {
655            std::mem::align_of::<u8>()
656        }
657
658        #[inline(always)]
659        fn inline_size(_context: fidl::encoding::Context) -> usize {
660            std::mem::size_of::<u8>()
661        }
662
663        #[inline(always)]
664        fn encode_is_copy() -> bool {
665            true
666        }
667
668        #[inline(always)]
669        fn decode_is_copy() -> bool {
670            false
671        }
672    }
673
674    impl fidl::encoding::ValueTypeMarker for VirtconMode {
675        type Borrowed<'a> = Self;
676        #[inline(always)]
677        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
678            *value
679        }
680    }
681
682    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for VirtconMode {
683        #[inline]
684        unsafe fn encode(
685            self,
686            encoder: &mut fidl::encoding::Encoder<'_, D>,
687            offset: usize,
688            _depth: fidl::encoding::Depth,
689        ) -> fidl::Result<()> {
690            encoder.debug_check_bounds::<Self>(offset);
691            encoder.write_num(self.into_primitive(), offset);
692            Ok(())
693        }
694    }
695
696    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VirtconMode {
697        #[inline(always)]
698        fn new_empty() -> Self {
699            Self::Fallback
700        }
701
702        #[inline]
703        unsafe fn decode(
704            &mut self,
705            decoder: &mut fidl::encoding::Decoder<'_, D>,
706            offset: usize,
707            _depth: fidl::encoding::Depth,
708        ) -> fidl::Result<()> {
709            decoder.debug_check_bounds::<Self>(offset);
710            let prim = decoder.read_num::<u8>(offset);
711
712            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
713            Ok(())
714        }
715    }
716
717    impl fidl::encoding::ValueTypeMarker for BufferCollectionId {
718        type Borrowed<'a> = &'a Self;
719        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
720            value
721        }
722    }
723
724    unsafe impl fidl::encoding::TypeMarker for BufferCollectionId {
725        type Owned = Self;
726
727        #[inline(always)]
728        fn inline_align(_context: fidl::encoding::Context) -> usize {
729            8
730        }
731
732        #[inline(always)]
733        fn inline_size(_context: fidl::encoding::Context) -> usize {
734            8
735        }
736        #[inline(always)]
737        fn encode_is_copy() -> bool {
738            true
739        }
740
741        #[inline(always)]
742        fn decode_is_copy() -> bool {
743            true
744        }
745    }
746
747    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BufferCollectionId, D>
748        for &BufferCollectionId
749    {
750        #[inline]
751        unsafe fn encode(
752            self,
753            encoder: &mut fidl::encoding::Encoder<'_, D>,
754            offset: usize,
755            _depth: fidl::encoding::Depth,
756        ) -> fidl::Result<()> {
757            encoder.debug_check_bounds::<BufferCollectionId>(offset);
758            unsafe {
759                // Copy the object into the buffer.
760                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
761                (buf_ptr as *mut BufferCollectionId)
762                    .write_unaligned((self as *const BufferCollectionId).read());
763                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
764                // done second because the memcpy will write garbage to these bytes.
765            }
766            Ok(())
767        }
768    }
769    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
770        fidl::encoding::Encode<BufferCollectionId, D> for (T0,)
771    {
772        #[inline]
773        unsafe fn encode(
774            self,
775            encoder: &mut fidl::encoding::Encoder<'_, D>,
776            offset: usize,
777            depth: fidl::encoding::Depth,
778        ) -> fidl::Result<()> {
779            encoder.debug_check_bounds::<BufferCollectionId>(offset);
780            // Zero out padding regions. There's no need to apply masks
781            // because the unmasked parts will be overwritten by fields.
782            // Write the fields.
783            self.0.encode(encoder, offset + 0, depth)?;
784            Ok(())
785        }
786    }
787
788    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BufferCollectionId {
789        #[inline(always)]
790        fn new_empty() -> Self {
791            Self { value: fidl::new_empty!(u64, D) }
792        }
793
794        #[inline]
795        unsafe fn decode(
796            &mut self,
797            decoder: &mut fidl::encoding::Decoder<'_, D>,
798            offset: usize,
799            _depth: fidl::encoding::Depth,
800        ) -> fidl::Result<()> {
801            decoder.debug_check_bounds::<Self>(offset);
802            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
803            // Verify that padding bytes are zero.
804            // Copy from the buffer into the object.
805            unsafe {
806                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
807            }
808            Ok(())
809        }
810    }
811
812    impl fidl::encoding::ValueTypeMarker for ClientPriority {
813        type Borrowed<'a> = &'a Self;
814        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
815            value
816        }
817    }
818
819    unsafe impl fidl::encoding::TypeMarker for ClientPriority {
820        type Owned = Self;
821
822        #[inline(always)]
823        fn inline_align(_context: fidl::encoding::Context) -> usize {
824            4
825        }
826
827        #[inline(always)]
828        fn inline_size(_context: fidl::encoding::Context) -> usize {
829            4
830        }
831        #[inline(always)]
832        fn encode_is_copy() -> bool {
833            true
834        }
835
836        #[inline(always)]
837        fn decode_is_copy() -> bool {
838            true
839        }
840    }
841
842    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ClientPriority, D>
843        for &ClientPriority
844    {
845        #[inline]
846        unsafe fn encode(
847            self,
848            encoder: &mut fidl::encoding::Encoder<'_, D>,
849            offset: usize,
850            _depth: fidl::encoding::Depth,
851        ) -> fidl::Result<()> {
852            encoder.debug_check_bounds::<ClientPriority>(offset);
853            unsafe {
854                // Copy the object into the buffer.
855                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
856                (buf_ptr as *mut ClientPriority)
857                    .write_unaligned((self as *const ClientPriority).read());
858                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
859                // done second because the memcpy will write garbage to these bytes.
860            }
861            Ok(())
862        }
863    }
864    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
865        fidl::encoding::Encode<ClientPriority, D> for (T0,)
866    {
867        #[inline]
868        unsafe fn encode(
869            self,
870            encoder: &mut fidl::encoding::Encoder<'_, D>,
871            offset: usize,
872            depth: fidl::encoding::Depth,
873        ) -> fidl::Result<()> {
874            encoder.debug_check_bounds::<ClientPriority>(offset);
875            // Zero out padding regions. There's no need to apply masks
876            // because the unmasked parts will be overwritten by fields.
877            // Write the fields.
878            self.0.encode(encoder, offset + 0, depth)?;
879            Ok(())
880        }
881    }
882
883    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ClientPriority {
884        #[inline(always)]
885        fn new_empty() -> Self {
886            Self { value: fidl::new_empty!(u32, D) }
887        }
888
889        #[inline]
890        unsafe fn decode(
891            &mut self,
892            decoder: &mut fidl::encoding::Decoder<'_, D>,
893            offset: usize,
894            _depth: fidl::encoding::Depth,
895        ) -> fidl::Result<()> {
896            decoder.debug_check_bounds::<Self>(offset);
897            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
898            // Verify that padding bytes are zero.
899            // Copy from the buffer into the object.
900            unsafe {
901                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
902            }
903            Ok(())
904        }
905    }
906
907    impl fidl::encoding::ValueTypeMarker for ConfigStamp {
908        type Borrowed<'a> = &'a Self;
909        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
910            value
911        }
912    }
913
914    unsafe impl fidl::encoding::TypeMarker for ConfigStamp {
915        type Owned = Self;
916
917        #[inline(always)]
918        fn inline_align(_context: fidl::encoding::Context) -> usize {
919            8
920        }
921
922        #[inline(always)]
923        fn inline_size(_context: fidl::encoding::Context) -> usize {
924            8
925        }
926        #[inline(always)]
927        fn encode_is_copy() -> bool {
928            true
929        }
930
931        #[inline(always)]
932        fn decode_is_copy() -> bool {
933            true
934        }
935    }
936
937    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ConfigStamp, D>
938        for &ConfigStamp
939    {
940        #[inline]
941        unsafe fn encode(
942            self,
943            encoder: &mut fidl::encoding::Encoder<'_, D>,
944            offset: usize,
945            _depth: fidl::encoding::Depth,
946        ) -> fidl::Result<()> {
947            encoder.debug_check_bounds::<ConfigStamp>(offset);
948            unsafe {
949                // Copy the object into the buffer.
950                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
951                (buf_ptr as *mut ConfigStamp).write_unaligned((self as *const ConfigStamp).read());
952                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
953                // done second because the memcpy will write garbage to these bytes.
954            }
955            Ok(())
956        }
957    }
958    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
959        fidl::encoding::Encode<ConfigStamp, D> for (T0,)
960    {
961        #[inline]
962        unsafe fn encode(
963            self,
964            encoder: &mut fidl::encoding::Encoder<'_, D>,
965            offset: usize,
966            depth: fidl::encoding::Depth,
967        ) -> fidl::Result<()> {
968            encoder.debug_check_bounds::<ConfigStamp>(offset);
969            // Zero out padding regions. There's no need to apply masks
970            // because the unmasked parts will be overwritten by fields.
971            // Write the fields.
972            self.0.encode(encoder, offset + 0, depth)?;
973            Ok(())
974        }
975    }
976
977    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigStamp {
978        #[inline(always)]
979        fn new_empty() -> Self {
980            Self { value: fidl::new_empty!(u64, D) }
981        }
982
983        #[inline]
984        unsafe fn decode(
985            &mut self,
986            decoder: &mut fidl::encoding::Decoder<'_, D>,
987            offset: usize,
988            _depth: fidl::encoding::Depth,
989        ) -> fidl::Result<()> {
990            decoder.debug_check_bounds::<Self>(offset);
991            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
992            // Verify that padding bytes are zero.
993            // Copy from the buffer into the object.
994            unsafe {
995                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
996            }
997            Ok(())
998        }
999    }
1000
1001    impl fidl::encoding::ValueTypeMarker for CoordinatorAcknowledgeVsyncRequest {
1002        type Borrowed<'a> = &'a Self;
1003        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1004            value
1005        }
1006    }
1007
1008    unsafe impl fidl::encoding::TypeMarker for CoordinatorAcknowledgeVsyncRequest {
1009        type Owned = Self;
1010
1011        #[inline(always)]
1012        fn inline_align(_context: fidl::encoding::Context) -> usize {
1013            8
1014        }
1015
1016        #[inline(always)]
1017        fn inline_size(_context: fidl::encoding::Context) -> usize {
1018            8
1019        }
1020        #[inline(always)]
1021        fn encode_is_copy() -> bool {
1022            true
1023        }
1024
1025        #[inline(always)]
1026        fn decode_is_copy() -> bool {
1027            true
1028        }
1029    }
1030
1031    unsafe impl<D: fidl::encoding::ResourceDialect>
1032        fidl::encoding::Encode<CoordinatorAcknowledgeVsyncRequest, D>
1033        for &CoordinatorAcknowledgeVsyncRequest
1034    {
1035        #[inline]
1036        unsafe fn encode(
1037            self,
1038            encoder: &mut fidl::encoding::Encoder<'_, D>,
1039            offset: usize,
1040            _depth: fidl::encoding::Depth,
1041        ) -> fidl::Result<()> {
1042            encoder.debug_check_bounds::<CoordinatorAcknowledgeVsyncRequest>(offset);
1043            unsafe {
1044                // Copy the object into the buffer.
1045                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1046                (buf_ptr as *mut CoordinatorAcknowledgeVsyncRequest)
1047                    .write_unaligned((self as *const CoordinatorAcknowledgeVsyncRequest).read());
1048                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1049                // done second because the memcpy will write garbage to these bytes.
1050            }
1051            Ok(())
1052        }
1053    }
1054    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
1055        fidl::encoding::Encode<CoordinatorAcknowledgeVsyncRequest, D> for (T0,)
1056    {
1057        #[inline]
1058        unsafe fn encode(
1059            self,
1060            encoder: &mut fidl::encoding::Encoder<'_, D>,
1061            offset: usize,
1062            depth: fidl::encoding::Depth,
1063        ) -> fidl::Result<()> {
1064            encoder.debug_check_bounds::<CoordinatorAcknowledgeVsyncRequest>(offset);
1065            // Zero out padding regions. There's no need to apply masks
1066            // because the unmasked parts will be overwritten by fields.
1067            // Write the fields.
1068            self.0.encode(encoder, offset + 0, depth)?;
1069            Ok(())
1070        }
1071    }
1072
1073    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1074        for CoordinatorAcknowledgeVsyncRequest
1075    {
1076        #[inline(always)]
1077        fn new_empty() -> Self {
1078            Self { cookie: fidl::new_empty!(u64, D) }
1079        }
1080
1081        #[inline]
1082        unsafe fn decode(
1083            &mut self,
1084            decoder: &mut fidl::encoding::Decoder<'_, D>,
1085            offset: usize,
1086            _depth: fidl::encoding::Depth,
1087        ) -> fidl::Result<()> {
1088            decoder.debug_check_bounds::<Self>(offset);
1089            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1090            // Verify that padding bytes are zero.
1091            // Copy from the buffer into the object.
1092            unsafe {
1093                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1094            }
1095            Ok(())
1096        }
1097    }
1098
1099    impl fidl::encoding::ValueTypeMarker for CoordinatorCheckConfigResponse {
1100        type Borrowed<'a> = &'a Self;
1101        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1102            value
1103        }
1104    }
1105
1106    unsafe impl fidl::encoding::TypeMarker for CoordinatorCheckConfigResponse {
1107        type Owned = Self;
1108
1109        #[inline(always)]
1110        fn inline_align(_context: fidl::encoding::Context) -> usize {
1111            4
1112        }
1113
1114        #[inline(always)]
1115        fn inline_size(_context: fidl::encoding::Context) -> usize {
1116            4
1117        }
1118    }
1119
1120    unsafe impl<D: fidl::encoding::ResourceDialect>
1121        fidl::encoding::Encode<CoordinatorCheckConfigResponse, D>
1122        for &CoordinatorCheckConfigResponse
1123    {
1124        #[inline]
1125        unsafe fn encode(
1126            self,
1127            encoder: &mut fidl::encoding::Encoder<'_, D>,
1128            offset: usize,
1129            _depth: fidl::encoding::Depth,
1130        ) -> fidl::Result<()> {
1131            encoder.debug_check_bounds::<CoordinatorCheckConfigResponse>(offset);
1132            // Delegate to tuple encoding.
1133            fidl::encoding::Encode::<CoordinatorCheckConfigResponse, D>::encode(
1134                (
1135                    <fidl_fuchsia_hardware_display_types__common::ConfigResult as fidl::encoding::ValueTypeMarker>::borrow(&self.res),
1136                ),
1137                encoder, offset, _depth
1138            )
1139        }
1140    }
1141    unsafe impl<
1142        D: fidl::encoding::ResourceDialect,
1143        T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::ConfigResult, D>,
1144    > fidl::encoding::Encode<CoordinatorCheckConfigResponse, D> for (T0,)
1145    {
1146        #[inline]
1147        unsafe fn encode(
1148            self,
1149            encoder: &mut fidl::encoding::Encoder<'_, D>,
1150            offset: usize,
1151            depth: fidl::encoding::Depth,
1152        ) -> fidl::Result<()> {
1153            encoder.debug_check_bounds::<CoordinatorCheckConfigResponse>(offset);
1154            // Zero out padding regions. There's no need to apply masks
1155            // because the unmasked parts will be overwritten by fields.
1156            // Write the fields.
1157            self.0.encode(encoder, offset + 0, depth)?;
1158            Ok(())
1159        }
1160    }
1161
1162    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1163        for CoordinatorCheckConfigResponse
1164    {
1165        #[inline(always)]
1166        fn new_empty() -> Self {
1167            Self {
1168                res: fidl::new_empty!(fidl_fuchsia_hardware_display_types__common::ConfigResult, D),
1169            }
1170        }
1171
1172        #[inline]
1173        unsafe fn decode(
1174            &mut self,
1175            decoder: &mut fidl::encoding::Decoder<'_, D>,
1176            offset: usize,
1177            _depth: fidl::encoding::Depth,
1178        ) -> fidl::Result<()> {
1179            decoder.debug_check_bounds::<Self>(offset);
1180            // Verify that padding bytes are zero.
1181            fidl::decode!(
1182                fidl_fuchsia_hardware_display_types__common::ConfigResult,
1183                D,
1184                &mut self.res,
1185                decoder,
1186                offset + 0,
1187                _depth
1188            )?;
1189            Ok(())
1190        }
1191    }
1192
1193    impl fidl::encoding::ValueTypeMarker for CoordinatorCreateLayerRequest {
1194        type Borrowed<'a> = &'a Self;
1195        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1196            value
1197        }
1198    }
1199
1200    unsafe impl fidl::encoding::TypeMarker for CoordinatorCreateLayerRequest {
1201        type Owned = Self;
1202
1203        #[inline(always)]
1204        fn inline_align(_context: fidl::encoding::Context) -> usize {
1205            8
1206        }
1207
1208        #[inline(always)]
1209        fn inline_size(_context: fidl::encoding::Context) -> usize {
1210            8
1211        }
1212        #[inline(always)]
1213        fn encode_is_copy() -> bool {
1214            true
1215        }
1216
1217        #[inline(always)]
1218        fn decode_is_copy() -> bool {
1219            true
1220        }
1221    }
1222
1223    unsafe impl<D: fidl::encoding::ResourceDialect>
1224        fidl::encoding::Encode<CoordinatorCreateLayerRequest, D>
1225        for &CoordinatorCreateLayerRequest
1226    {
1227        #[inline]
1228        unsafe fn encode(
1229            self,
1230            encoder: &mut fidl::encoding::Encoder<'_, D>,
1231            offset: usize,
1232            _depth: fidl::encoding::Depth,
1233        ) -> fidl::Result<()> {
1234            encoder.debug_check_bounds::<CoordinatorCreateLayerRequest>(offset);
1235            unsafe {
1236                // Copy the object into the buffer.
1237                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1238                (buf_ptr as *mut CoordinatorCreateLayerRequest)
1239                    .write_unaligned((self as *const CoordinatorCreateLayerRequest).read());
1240                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1241                // done second because the memcpy will write garbage to these bytes.
1242            }
1243            Ok(())
1244        }
1245    }
1246    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LayerId, D>>
1247        fidl::encoding::Encode<CoordinatorCreateLayerRequest, D> for (T0,)
1248    {
1249        #[inline]
1250        unsafe fn encode(
1251            self,
1252            encoder: &mut fidl::encoding::Encoder<'_, D>,
1253            offset: usize,
1254            depth: fidl::encoding::Depth,
1255        ) -> fidl::Result<()> {
1256            encoder.debug_check_bounds::<CoordinatorCreateLayerRequest>(offset);
1257            // Zero out padding regions. There's no need to apply masks
1258            // because the unmasked parts will be overwritten by fields.
1259            // Write the fields.
1260            self.0.encode(encoder, offset + 0, depth)?;
1261            Ok(())
1262        }
1263    }
1264
1265    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1266        for CoordinatorCreateLayerRequest
1267    {
1268        #[inline(always)]
1269        fn new_empty() -> Self {
1270            Self { layer_id: fidl::new_empty!(LayerId, D) }
1271        }
1272
1273        #[inline]
1274        unsafe fn decode(
1275            &mut self,
1276            decoder: &mut fidl::encoding::Decoder<'_, D>,
1277            offset: usize,
1278            _depth: fidl::encoding::Depth,
1279        ) -> fidl::Result<()> {
1280            decoder.debug_check_bounds::<Self>(offset);
1281            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1282            // Verify that padding bytes are zero.
1283            // Copy from the buffer into the object.
1284            unsafe {
1285                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1286            }
1287            Ok(())
1288        }
1289    }
1290
1291    impl fidl::encoding::ValueTypeMarker for CoordinatorDestroyLayerRequest {
1292        type Borrowed<'a> = &'a Self;
1293        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1294            value
1295        }
1296    }
1297
1298    unsafe impl fidl::encoding::TypeMarker for CoordinatorDestroyLayerRequest {
1299        type Owned = Self;
1300
1301        #[inline(always)]
1302        fn inline_align(_context: fidl::encoding::Context) -> usize {
1303            8
1304        }
1305
1306        #[inline(always)]
1307        fn inline_size(_context: fidl::encoding::Context) -> usize {
1308            8
1309        }
1310        #[inline(always)]
1311        fn encode_is_copy() -> bool {
1312            true
1313        }
1314
1315        #[inline(always)]
1316        fn decode_is_copy() -> bool {
1317            true
1318        }
1319    }
1320
1321    unsafe impl<D: fidl::encoding::ResourceDialect>
1322        fidl::encoding::Encode<CoordinatorDestroyLayerRequest, D>
1323        for &CoordinatorDestroyLayerRequest
1324    {
1325        #[inline]
1326        unsafe fn encode(
1327            self,
1328            encoder: &mut fidl::encoding::Encoder<'_, D>,
1329            offset: usize,
1330            _depth: fidl::encoding::Depth,
1331        ) -> fidl::Result<()> {
1332            encoder.debug_check_bounds::<CoordinatorDestroyLayerRequest>(offset);
1333            unsafe {
1334                // Copy the object into the buffer.
1335                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1336                (buf_ptr as *mut CoordinatorDestroyLayerRequest)
1337                    .write_unaligned((self as *const CoordinatorDestroyLayerRequest).read());
1338                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1339                // done second because the memcpy will write garbage to these bytes.
1340            }
1341            Ok(())
1342        }
1343    }
1344    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LayerId, D>>
1345        fidl::encoding::Encode<CoordinatorDestroyLayerRequest, D> for (T0,)
1346    {
1347        #[inline]
1348        unsafe fn encode(
1349            self,
1350            encoder: &mut fidl::encoding::Encoder<'_, D>,
1351            offset: usize,
1352            depth: fidl::encoding::Depth,
1353        ) -> fidl::Result<()> {
1354            encoder.debug_check_bounds::<CoordinatorDestroyLayerRequest>(offset);
1355            // Zero out padding regions. There's no need to apply masks
1356            // because the unmasked parts will be overwritten by fields.
1357            // Write the fields.
1358            self.0.encode(encoder, offset + 0, depth)?;
1359            Ok(())
1360        }
1361    }
1362
1363    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1364        for CoordinatorDestroyLayerRequest
1365    {
1366        #[inline(always)]
1367        fn new_empty() -> Self {
1368            Self { layer_id: fidl::new_empty!(LayerId, D) }
1369        }
1370
1371        #[inline]
1372        unsafe fn decode(
1373            &mut self,
1374            decoder: &mut fidl::encoding::Decoder<'_, D>,
1375            offset: usize,
1376            _depth: fidl::encoding::Depth,
1377        ) -> fidl::Result<()> {
1378            decoder.debug_check_bounds::<Self>(offset);
1379            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1380            // Verify that padding bytes are zero.
1381            // Copy from the buffer into the object.
1382            unsafe {
1383                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1384            }
1385            Ok(())
1386        }
1387    }
1388
1389    impl fidl::encoding::ValueTypeMarker for CoordinatorGetLatestCommittedConfigStampResponse {
1390        type Borrowed<'a> = &'a Self;
1391        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1392            value
1393        }
1394    }
1395
1396    unsafe impl fidl::encoding::TypeMarker for CoordinatorGetLatestCommittedConfigStampResponse {
1397        type Owned = Self;
1398
1399        #[inline(always)]
1400        fn inline_align(_context: fidl::encoding::Context) -> usize {
1401            8
1402        }
1403
1404        #[inline(always)]
1405        fn inline_size(_context: fidl::encoding::Context) -> usize {
1406            8
1407        }
1408        #[inline(always)]
1409        fn encode_is_copy() -> bool {
1410            true
1411        }
1412
1413        #[inline(always)]
1414        fn decode_is_copy() -> bool {
1415            true
1416        }
1417    }
1418
1419    unsafe impl<D: fidl::encoding::ResourceDialect>
1420        fidl::encoding::Encode<CoordinatorGetLatestCommittedConfigStampResponse, D>
1421        for &CoordinatorGetLatestCommittedConfigStampResponse
1422    {
1423        #[inline]
1424        unsafe fn encode(
1425            self,
1426            encoder: &mut fidl::encoding::Encoder<'_, D>,
1427            offset: usize,
1428            _depth: fidl::encoding::Depth,
1429        ) -> fidl::Result<()> {
1430            encoder.debug_check_bounds::<CoordinatorGetLatestCommittedConfigStampResponse>(offset);
1431            unsafe {
1432                // Copy the object into the buffer.
1433                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1434                (buf_ptr as *mut CoordinatorGetLatestCommittedConfigStampResponse).write_unaligned(
1435                    (self as *const CoordinatorGetLatestCommittedConfigStampResponse).read(),
1436                );
1437                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1438                // done second because the memcpy will write garbage to these bytes.
1439            }
1440            Ok(())
1441        }
1442    }
1443    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ConfigStamp, D>>
1444        fidl::encoding::Encode<CoordinatorGetLatestCommittedConfigStampResponse, D> for (T0,)
1445    {
1446        #[inline]
1447        unsafe fn encode(
1448            self,
1449            encoder: &mut fidl::encoding::Encoder<'_, D>,
1450            offset: usize,
1451            depth: fidl::encoding::Depth,
1452        ) -> fidl::Result<()> {
1453            encoder.debug_check_bounds::<CoordinatorGetLatestCommittedConfigStampResponse>(offset);
1454            // Zero out padding regions. There's no need to apply masks
1455            // because the unmasked parts will be overwritten by fields.
1456            // Write the fields.
1457            self.0.encode(encoder, offset + 0, depth)?;
1458            Ok(())
1459        }
1460    }
1461
1462    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1463        for CoordinatorGetLatestCommittedConfigStampResponse
1464    {
1465        #[inline(always)]
1466        fn new_empty() -> Self {
1467            Self { stamp: fidl::new_empty!(ConfigStamp, D) }
1468        }
1469
1470        #[inline]
1471        unsafe fn decode(
1472            &mut self,
1473            decoder: &mut fidl::encoding::Decoder<'_, D>,
1474            offset: usize,
1475            _depth: fidl::encoding::Depth,
1476        ) -> fidl::Result<()> {
1477            decoder.debug_check_bounds::<Self>(offset);
1478            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1479            // Verify that padding bytes are zero.
1480            // Copy from the buffer into the object.
1481            unsafe {
1482                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1483            }
1484            Ok(())
1485        }
1486    }
1487
1488    impl fidl::encoding::ValueTypeMarker for CoordinatorImportImageRequest {
1489        type Borrowed<'a> = &'a Self;
1490        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1491            value
1492        }
1493    }
1494
1495    unsafe impl fidl::encoding::TypeMarker for CoordinatorImportImageRequest {
1496        type Owned = Self;
1497
1498        #[inline(always)]
1499        fn inline_align(_context: fidl::encoding::Context) -> usize {
1500            8
1501        }
1502
1503        #[inline(always)]
1504        fn inline_size(_context: fidl::encoding::Context) -> usize {
1505            40
1506        }
1507    }
1508
1509    unsafe impl<D: fidl::encoding::ResourceDialect>
1510        fidl::encoding::Encode<CoordinatorImportImageRequest, D>
1511        for &CoordinatorImportImageRequest
1512    {
1513        #[inline]
1514        unsafe fn encode(
1515            self,
1516            encoder: &mut fidl::encoding::Encoder<'_, D>,
1517            offset: usize,
1518            _depth: fidl::encoding::Depth,
1519        ) -> fidl::Result<()> {
1520            encoder.debug_check_bounds::<CoordinatorImportImageRequest>(offset);
1521            // Delegate to tuple encoding.
1522            fidl::encoding::Encode::<CoordinatorImportImageRequest, D>::encode(
1523                (
1524                    <fidl_fuchsia_hardware_display_types__common::ImageMetadata as fidl::encoding::ValueTypeMarker>::borrow(&self.image_metadata),
1525                    <BufferCollectionId as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_collection_id),
1526                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_index),
1527                    <ImageId as fidl::encoding::ValueTypeMarker>::borrow(&self.image_id),
1528                ),
1529                encoder, offset, _depth
1530            )
1531        }
1532    }
1533    unsafe impl<
1534        D: fidl::encoding::ResourceDialect,
1535        T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::ImageMetadata, D>,
1536        T1: fidl::encoding::Encode<BufferCollectionId, D>,
1537        T2: fidl::encoding::Encode<u32, D>,
1538        T3: fidl::encoding::Encode<ImageId, D>,
1539    > fidl::encoding::Encode<CoordinatorImportImageRequest, D> for (T0, T1, T2, T3)
1540    {
1541        #[inline]
1542        unsafe fn encode(
1543            self,
1544            encoder: &mut fidl::encoding::Encoder<'_, D>,
1545            offset: usize,
1546            depth: fidl::encoding::Depth,
1547        ) -> fidl::Result<()> {
1548            encoder.debug_check_bounds::<CoordinatorImportImageRequest>(offset);
1549            // Zero out padding regions. There's no need to apply masks
1550            // because the unmasked parts will be overwritten by fields.
1551            unsafe {
1552                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
1553                (ptr as *mut u64).write_unaligned(0);
1554            }
1555            unsafe {
1556                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
1557                (ptr as *mut u64).write_unaligned(0);
1558            }
1559            // Write the fields.
1560            self.0.encode(encoder, offset + 0, depth)?;
1561            self.1.encode(encoder, offset + 16, depth)?;
1562            self.2.encode(encoder, offset + 24, depth)?;
1563            self.3.encode(encoder, offset + 32, depth)?;
1564            Ok(())
1565        }
1566    }
1567
1568    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1569        for CoordinatorImportImageRequest
1570    {
1571        #[inline(always)]
1572        fn new_empty() -> Self {
1573            Self {
1574                image_metadata: fidl::new_empty!(
1575                    fidl_fuchsia_hardware_display_types__common::ImageMetadata,
1576                    D
1577                ),
1578                buffer_collection_id: fidl::new_empty!(BufferCollectionId, D),
1579                buffer_index: fidl::new_empty!(u32, D),
1580                image_id: fidl::new_empty!(ImageId, D),
1581            }
1582        }
1583
1584        #[inline]
1585        unsafe fn decode(
1586            &mut self,
1587            decoder: &mut fidl::encoding::Decoder<'_, D>,
1588            offset: usize,
1589            _depth: fidl::encoding::Depth,
1590        ) -> fidl::Result<()> {
1591            decoder.debug_check_bounds::<Self>(offset);
1592            // Verify that padding bytes are zero.
1593            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
1594            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1595            let mask = 0xffffffff00000000u64;
1596            let maskedval = padval & mask;
1597            if maskedval != 0 {
1598                return Err(fidl::Error::NonZeroPadding {
1599                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
1600                });
1601            }
1602            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
1603            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1604            let mask = 0xffffffff00000000u64;
1605            let maskedval = padval & mask;
1606            if maskedval != 0 {
1607                return Err(fidl::Error::NonZeroPadding {
1608                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
1609                });
1610            }
1611            fidl::decode!(
1612                fidl_fuchsia_hardware_display_types__common::ImageMetadata,
1613                D,
1614                &mut self.image_metadata,
1615                decoder,
1616                offset + 0,
1617                _depth
1618            )?;
1619            fidl::decode!(
1620                BufferCollectionId,
1621                D,
1622                &mut self.buffer_collection_id,
1623                decoder,
1624                offset + 16,
1625                _depth
1626            )?;
1627            fidl::decode!(u32, D, &mut self.buffer_index, decoder, offset + 24, _depth)?;
1628            fidl::decode!(ImageId, D, &mut self.image_id, decoder, offset + 32, _depth)?;
1629            Ok(())
1630        }
1631    }
1632
1633    impl fidl::encoding::ValueTypeMarker for CoordinatorListenerOnClientOwnershipChangeRequest {
1634        type Borrowed<'a> = &'a Self;
1635        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1636            value
1637        }
1638    }
1639
1640    unsafe impl fidl::encoding::TypeMarker for CoordinatorListenerOnClientOwnershipChangeRequest {
1641        type Owned = Self;
1642
1643        #[inline(always)]
1644        fn inline_align(_context: fidl::encoding::Context) -> usize {
1645            1
1646        }
1647
1648        #[inline(always)]
1649        fn inline_size(_context: fidl::encoding::Context) -> usize {
1650            1
1651        }
1652    }
1653
1654    unsafe impl<D: fidl::encoding::ResourceDialect>
1655        fidl::encoding::Encode<CoordinatorListenerOnClientOwnershipChangeRequest, D>
1656        for &CoordinatorListenerOnClientOwnershipChangeRequest
1657    {
1658        #[inline]
1659        unsafe fn encode(
1660            self,
1661            encoder: &mut fidl::encoding::Encoder<'_, D>,
1662            offset: usize,
1663            _depth: fidl::encoding::Depth,
1664        ) -> fidl::Result<()> {
1665            encoder.debug_check_bounds::<CoordinatorListenerOnClientOwnershipChangeRequest>(offset);
1666            // Delegate to tuple encoding.
1667            fidl::encoding::Encode::<CoordinatorListenerOnClientOwnershipChangeRequest, D>::encode(
1668                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.has_ownership),),
1669                encoder,
1670                offset,
1671                _depth,
1672            )
1673        }
1674    }
1675    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
1676        fidl::encoding::Encode<CoordinatorListenerOnClientOwnershipChangeRequest, D> for (T0,)
1677    {
1678        #[inline]
1679        unsafe fn encode(
1680            self,
1681            encoder: &mut fidl::encoding::Encoder<'_, D>,
1682            offset: usize,
1683            depth: fidl::encoding::Depth,
1684        ) -> fidl::Result<()> {
1685            encoder.debug_check_bounds::<CoordinatorListenerOnClientOwnershipChangeRequest>(offset);
1686            // Zero out padding regions. There's no need to apply masks
1687            // because the unmasked parts will be overwritten by fields.
1688            // Write the fields.
1689            self.0.encode(encoder, offset + 0, depth)?;
1690            Ok(())
1691        }
1692    }
1693
1694    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1695        for CoordinatorListenerOnClientOwnershipChangeRequest
1696    {
1697        #[inline(always)]
1698        fn new_empty() -> Self {
1699            Self { has_ownership: fidl::new_empty!(bool, D) }
1700        }
1701
1702        #[inline]
1703        unsafe fn decode(
1704            &mut self,
1705            decoder: &mut fidl::encoding::Decoder<'_, D>,
1706            offset: usize,
1707            _depth: fidl::encoding::Depth,
1708        ) -> fidl::Result<()> {
1709            decoder.debug_check_bounds::<Self>(offset);
1710            // Verify that padding bytes are zero.
1711            fidl::decode!(bool, D, &mut self.has_ownership, decoder, offset + 0, _depth)?;
1712            Ok(())
1713        }
1714    }
1715
1716    impl fidl::encoding::ValueTypeMarker for CoordinatorListenerOnDisplaysChangedRequest {
1717        type Borrowed<'a> = &'a Self;
1718        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1719            value
1720        }
1721    }
1722
1723    unsafe impl fidl::encoding::TypeMarker for CoordinatorListenerOnDisplaysChangedRequest {
1724        type Owned = Self;
1725
1726        #[inline(always)]
1727        fn inline_align(_context: fidl::encoding::Context) -> usize {
1728            8
1729        }
1730
1731        #[inline(always)]
1732        fn inline_size(_context: fidl::encoding::Context) -> usize {
1733            32
1734        }
1735    }
1736
1737    unsafe impl<D: fidl::encoding::ResourceDialect>
1738        fidl::encoding::Encode<CoordinatorListenerOnDisplaysChangedRequest, D>
1739        for &CoordinatorListenerOnDisplaysChangedRequest
1740    {
1741        #[inline]
1742        unsafe fn encode(
1743            self,
1744            encoder: &mut fidl::encoding::Encoder<'_, D>,
1745            offset: usize,
1746            _depth: fidl::encoding::Depth,
1747        ) -> fidl::Result<()> {
1748            encoder.debug_check_bounds::<CoordinatorListenerOnDisplaysChangedRequest>(offset);
1749            // Delegate to tuple encoding.
1750            fidl::encoding::Encode::<CoordinatorListenerOnDisplaysChangedRequest, D>::encode(
1751                (
1752                    <fidl::encoding::UnboundedVector<Info> as fidl::encoding::ValueTypeMarker>::borrow(&self.added),
1753                    <fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types__common::DisplayId> as fidl::encoding::ValueTypeMarker>::borrow(&self.removed),
1754                ),
1755                encoder, offset, _depth
1756            )
1757        }
1758    }
1759    unsafe impl<
1760        D: fidl::encoding::ResourceDialect,
1761        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Info>, D>,
1762        T1: fidl::encoding::Encode<
1763                fidl::encoding::UnboundedVector<
1764                    fidl_fuchsia_hardware_display_types__common::DisplayId,
1765                >,
1766                D,
1767            >,
1768    > fidl::encoding::Encode<CoordinatorListenerOnDisplaysChangedRequest, D> for (T0, T1)
1769    {
1770        #[inline]
1771        unsafe fn encode(
1772            self,
1773            encoder: &mut fidl::encoding::Encoder<'_, D>,
1774            offset: usize,
1775            depth: fidl::encoding::Depth,
1776        ) -> fidl::Result<()> {
1777            encoder.debug_check_bounds::<CoordinatorListenerOnDisplaysChangedRequest>(offset);
1778            // Zero out padding regions. There's no need to apply masks
1779            // because the unmasked parts will be overwritten by fields.
1780            // Write the fields.
1781            self.0.encode(encoder, offset + 0, depth)?;
1782            self.1.encode(encoder, offset + 16, depth)?;
1783            Ok(())
1784        }
1785    }
1786
1787    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1788        for CoordinatorListenerOnDisplaysChangedRequest
1789    {
1790        #[inline(always)]
1791        fn new_empty() -> Self {
1792            Self {
1793                added: fidl::new_empty!(fidl::encoding::UnboundedVector<Info>, D),
1794                removed: fidl::new_empty!(
1795                    fidl::encoding::UnboundedVector<
1796                        fidl_fuchsia_hardware_display_types__common::DisplayId,
1797                    >,
1798                    D
1799                ),
1800            }
1801        }
1802
1803        #[inline]
1804        unsafe fn decode(
1805            &mut self,
1806            decoder: &mut fidl::encoding::Decoder<'_, D>,
1807            offset: usize,
1808            _depth: fidl::encoding::Depth,
1809        ) -> fidl::Result<()> {
1810            decoder.debug_check_bounds::<Self>(offset);
1811            // Verify that padding bytes are zero.
1812            fidl::decode!(
1813                fidl::encoding::UnboundedVector<Info>,
1814                D,
1815                &mut self.added,
1816                decoder,
1817                offset + 0,
1818                _depth
1819            )?;
1820            fidl::decode!(
1821                fidl::encoding::UnboundedVector<
1822                    fidl_fuchsia_hardware_display_types__common::DisplayId,
1823                >,
1824                D,
1825                &mut self.removed,
1826                decoder,
1827                offset + 16,
1828                _depth
1829            )?;
1830            Ok(())
1831        }
1832    }
1833
1834    impl fidl::encoding::ValueTypeMarker for CoordinatorListenerOnVsyncRequest {
1835        type Borrowed<'a> = &'a Self;
1836        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1837            value
1838        }
1839    }
1840
1841    unsafe impl fidl::encoding::TypeMarker for CoordinatorListenerOnVsyncRequest {
1842        type Owned = Self;
1843
1844        #[inline(always)]
1845        fn inline_align(_context: fidl::encoding::Context) -> usize {
1846            8
1847        }
1848
1849        #[inline(always)]
1850        fn inline_size(_context: fidl::encoding::Context) -> usize {
1851            32
1852        }
1853    }
1854
1855    unsafe impl<D: fidl::encoding::ResourceDialect>
1856        fidl::encoding::Encode<CoordinatorListenerOnVsyncRequest, D>
1857        for &CoordinatorListenerOnVsyncRequest
1858    {
1859        #[inline]
1860        unsafe fn encode(
1861            self,
1862            encoder: &mut fidl::encoding::Encoder<'_, D>,
1863            offset: usize,
1864            _depth: fidl::encoding::Depth,
1865        ) -> fidl::Result<()> {
1866            encoder.debug_check_bounds::<CoordinatorListenerOnVsyncRequest>(offset);
1867            // Delegate to tuple encoding.
1868            fidl::encoding::Encode::<CoordinatorListenerOnVsyncRequest, D>::encode(
1869                (
1870                    <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
1871                    <fidl::MonotonicInstant as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp),
1872                    <ConfigStamp as fidl::encoding::ValueTypeMarker>::borrow(&self.displayed_config_stamp),
1873                    <VsyncAckCookie as fidl::encoding::ValueTypeMarker>::borrow(&self.cookie),
1874                ),
1875                encoder, offset, _depth
1876            )
1877        }
1878    }
1879    unsafe impl<
1880        D: fidl::encoding::ResourceDialect,
1881        T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
1882        T1: fidl::encoding::Encode<fidl::MonotonicInstant, D>,
1883        T2: fidl::encoding::Encode<ConfigStamp, D>,
1884        T3: fidl::encoding::Encode<VsyncAckCookie, D>,
1885    > fidl::encoding::Encode<CoordinatorListenerOnVsyncRequest, D> for (T0, T1, T2, T3)
1886    {
1887        #[inline]
1888        unsafe fn encode(
1889            self,
1890            encoder: &mut fidl::encoding::Encoder<'_, D>,
1891            offset: usize,
1892            depth: fidl::encoding::Depth,
1893        ) -> fidl::Result<()> {
1894            encoder.debug_check_bounds::<CoordinatorListenerOnVsyncRequest>(offset);
1895            // Zero out padding regions. There's no need to apply masks
1896            // because the unmasked parts will be overwritten by fields.
1897            // Write the fields.
1898            self.0.encode(encoder, offset + 0, depth)?;
1899            self.1.encode(encoder, offset + 8, depth)?;
1900            self.2.encode(encoder, offset + 16, depth)?;
1901            self.3.encode(encoder, offset + 24, depth)?;
1902            Ok(())
1903        }
1904    }
1905
1906    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1907        for CoordinatorListenerOnVsyncRequest
1908    {
1909        #[inline(always)]
1910        fn new_empty() -> Self {
1911            Self {
1912                display_id: fidl::new_empty!(
1913                    fidl_fuchsia_hardware_display_types__common::DisplayId,
1914                    D
1915                ),
1916                timestamp: fidl::new_empty!(fidl::MonotonicInstant, D),
1917                displayed_config_stamp: fidl::new_empty!(ConfigStamp, D),
1918                cookie: fidl::new_empty!(VsyncAckCookie, D),
1919            }
1920        }
1921
1922        #[inline]
1923        unsafe fn decode(
1924            &mut self,
1925            decoder: &mut fidl::encoding::Decoder<'_, D>,
1926            offset: usize,
1927            _depth: fidl::encoding::Depth,
1928        ) -> fidl::Result<()> {
1929            decoder.debug_check_bounds::<Self>(offset);
1930            // Verify that padding bytes are zero.
1931            fidl::decode!(
1932                fidl_fuchsia_hardware_display_types__common::DisplayId,
1933                D,
1934                &mut self.display_id,
1935                decoder,
1936                offset + 0,
1937                _depth
1938            )?;
1939            fidl::decode!(
1940                fidl::MonotonicInstant,
1941                D,
1942                &mut self.timestamp,
1943                decoder,
1944                offset + 8,
1945                _depth
1946            )?;
1947            fidl::decode!(
1948                ConfigStamp,
1949                D,
1950                &mut self.displayed_config_stamp,
1951                decoder,
1952                offset + 16,
1953                _depth
1954            )?;
1955            fidl::decode!(VsyncAckCookie, D, &mut self.cookie, decoder, offset + 24, _depth)?;
1956            Ok(())
1957        }
1958    }
1959
1960    impl fidl::encoding::ValueTypeMarker for CoordinatorReleaseBufferCollectionRequest {
1961        type Borrowed<'a> = &'a Self;
1962        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1963            value
1964        }
1965    }
1966
1967    unsafe impl fidl::encoding::TypeMarker for CoordinatorReleaseBufferCollectionRequest {
1968        type Owned = Self;
1969
1970        #[inline(always)]
1971        fn inline_align(_context: fidl::encoding::Context) -> usize {
1972            8
1973        }
1974
1975        #[inline(always)]
1976        fn inline_size(_context: fidl::encoding::Context) -> usize {
1977            8
1978        }
1979        #[inline(always)]
1980        fn encode_is_copy() -> bool {
1981            true
1982        }
1983
1984        #[inline(always)]
1985        fn decode_is_copy() -> bool {
1986            true
1987        }
1988    }
1989
1990    unsafe impl<D: fidl::encoding::ResourceDialect>
1991        fidl::encoding::Encode<CoordinatorReleaseBufferCollectionRequest, D>
1992        for &CoordinatorReleaseBufferCollectionRequest
1993    {
1994        #[inline]
1995        unsafe fn encode(
1996            self,
1997            encoder: &mut fidl::encoding::Encoder<'_, D>,
1998            offset: usize,
1999            _depth: fidl::encoding::Depth,
2000        ) -> fidl::Result<()> {
2001            encoder.debug_check_bounds::<CoordinatorReleaseBufferCollectionRequest>(offset);
2002            unsafe {
2003                // Copy the object into the buffer.
2004                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2005                (buf_ptr as *mut CoordinatorReleaseBufferCollectionRequest).write_unaligned(
2006                    (self as *const CoordinatorReleaseBufferCollectionRequest).read(),
2007                );
2008                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2009                // done second because the memcpy will write garbage to these bytes.
2010            }
2011            Ok(())
2012        }
2013    }
2014    unsafe impl<
2015        D: fidl::encoding::ResourceDialect,
2016        T0: fidl::encoding::Encode<BufferCollectionId, D>,
2017    > fidl::encoding::Encode<CoordinatorReleaseBufferCollectionRequest, D> for (T0,)
2018    {
2019        #[inline]
2020        unsafe fn encode(
2021            self,
2022            encoder: &mut fidl::encoding::Encoder<'_, D>,
2023            offset: usize,
2024            depth: fidl::encoding::Depth,
2025        ) -> fidl::Result<()> {
2026            encoder.debug_check_bounds::<CoordinatorReleaseBufferCollectionRequest>(offset);
2027            // Zero out padding regions. There's no need to apply masks
2028            // because the unmasked parts will be overwritten by fields.
2029            // Write the fields.
2030            self.0.encode(encoder, offset + 0, depth)?;
2031            Ok(())
2032        }
2033    }
2034
2035    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2036        for CoordinatorReleaseBufferCollectionRequest
2037    {
2038        #[inline(always)]
2039        fn new_empty() -> Self {
2040            Self { buffer_collection_id: fidl::new_empty!(BufferCollectionId, D) }
2041        }
2042
2043        #[inline]
2044        unsafe fn decode(
2045            &mut self,
2046            decoder: &mut fidl::encoding::Decoder<'_, D>,
2047            offset: usize,
2048            _depth: fidl::encoding::Depth,
2049        ) -> fidl::Result<()> {
2050            decoder.debug_check_bounds::<Self>(offset);
2051            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2052            // Verify that padding bytes are zero.
2053            // Copy from the buffer into the object.
2054            unsafe {
2055                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2056            }
2057            Ok(())
2058        }
2059    }
2060
2061    impl fidl::encoding::ValueTypeMarker for CoordinatorReleaseEventRequest {
2062        type Borrowed<'a> = &'a Self;
2063        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2064            value
2065        }
2066    }
2067
2068    unsafe impl fidl::encoding::TypeMarker for CoordinatorReleaseEventRequest {
2069        type Owned = Self;
2070
2071        #[inline(always)]
2072        fn inline_align(_context: fidl::encoding::Context) -> usize {
2073            8
2074        }
2075
2076        #[inline(always)]
2077        fn inline_size(_context: fidl::encoding::Context) -> usize {
2078            8
2079        }
2080        #[inline(always)]
2081        fn encode_is_copy() -> bool {
2082            true
2083        }
2084
2085        #[inline(always)]
2086        fn decode_is_copy() -> bool {
2087            true
2088        }
2089    }
2090
2091    unsafe impl<D: fidl::encoding::ResourceDialect>
2092        fidl::encoding::Encode<CoordinatorReleaseEventRequest, D>
2093        for &CoordinatorReleaseEventRequest
2094    {
2095        #[inline]
2096        unsafe fn encode(
2097            self,
2098            encoder: &mut fidl::encoding::Encoder<'_, D>,
2099            offset: usize,
2100            _depth: fidl::encoding::Depth,
2101        ) -> fidl::Result<()> {
2102            encoder.debug_check_bounds::<CoordinatorReleaseEventRequest>(offset);
2103            unsafe {
2104                // Copy the object into the buffer.
2105                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2106                (buf_ptr as *mut CoordinatorReleaseEventRequest)
2107                    .write_unaligned((self as *const CoordinatorReleaseEventRequest).read());
2108                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2109                // done second because the memcpy will write garbage to these bytes.
2110            }
2111            Ok(())
2112        }
2113    }
2114    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<EventId, D>>
2115        fidl::encoding::Encode<CoordinatorReleaseEventRequest, D> for (T0,)
2116    {
2117        #[inline]
2118        unsafe fn encode(
2119            self,
2120            encoder: &mut fidl::encoding::Encoder<'_, D>,
2121            offset: usize,
2122            depth: fidl::encoding::Depth,
2123        ) -> fidl::Result<()> {
2124            encoder.debug_check_bounds::<CoordinatorReleaseEventRequest>(offset);
2125            // Zero out padding regions. There's no need to apply masks
2126            // because the unmasked parts will be overwritten by fields.
2127            // Write the fields.
2128            self.0.encode(encoder, offset + 0, depth)?;
2129            Ok(())
2130        }
2131    }
2132
2133    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2134        for CoordinatorReleaseEventRequest
2135    {
2136        #[inline(always)]
2137        fn new_empty() -> Self {
2138            Self { id: fidl::new_empty!(EventId, D) }
2139        }
2140
2141        #[inline]
2142        unsafe fn decode(
2143            &mut self,
2144            decoder: &mut fidl::encoding::Decoder<'_, D>,
2145            offset: usize,
2146            _depth: fidl::encoding::Depth,
2147        ) -> fidl::Result<()> {
2148            decoder.debug_check_bounds::<Self>(offset);
2149            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2150            // Verify that padding bytes are zero.
2151            // Copy from the buffer into the object.
2152            unsafe {
2153                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2154            }
2155            Ok(())
2156        }
2157    }
2158
2159    impl fidl::encoding::ValueTypeMarker for CoordinatorReleaseImageRequest {
2160        type Borrowed<'a> = &'a Self;
2161        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2162            value
2163        }
2164    }
2165
2166    unsafe impl fidl::encoding::TypeMarker for CoordinatorReleaseImageRequest {
2167        type Owned = Self;
2168
2169        #[inline(always)]
2170        fn inline_align(_context: fidl::encoding::Context) -> usize {
2171            8
2172        }
2173
2174        #[inline(always)]
2175        fn inline_size(_context: fidl::encoding::Context) -> usize {
2176            8
2177        }
2178        #[inline(always)]
2179        fn encode_is_copy() -> bool {
2180            true
2181        }
2182
2183        #[inline(always)]
2184        fn decode_is_copy() -> bool {
2185            true
2186        }
2187    }
2188
2189    unsafe impl<D: fidl::encoding::ResourceDialect>
2190        fidl::encoding::Encode<CoordinatorReleaseImageRequest, D>
2191        for &CoordinatorReleaseImageRequest
2192    {
2193        #[inline]
2194        unsafe fn encode(
2195            self,
2196            encoder: &mut fidl::encoding::Encoder<'_, D>,
2197            offset: usize,
2198            _depth: fidl::encoding::Depth,
2199        ) -> fidl::Result<()> {
2200            encoder.debug_check_bounds::<CoordinatorReleaseImageRequest>(offset);
2201            unsafe {
2202                // Copy the object into the buffer.
2203                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2204                (buf_ptr as *mut CoordinatorReleaseImageRequest)
2205                    .write_unaligned((self as *const CoordinatorReleaseImageRequest).read());
2206                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2207                // done second because the memcpy will write garbage to these bytes.
2208            }
2209            Ok(())
2210        }
2211    }
2212    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ImageId, D>>
2213        fidl::encoding::Encode<CoordinatorReleaseImageRequest, D> for (T0,)
2214    {
2215        #[inline]
2216        unsafe fn encode(
2217            self,
2218            encoder: &mut fidl::encoding::Encoder<'_, D>,
2219            offset: usize,
2220            depth: fidl::encoding::Depth,
2221        ) -> fidl::Result<()> {
2222            encoder.debug_check_bounds::<CoordinatorReleaseImageRequest>(offset);
2223            // Zero out padding regions. There's no need to apply masks
2224            // because the unmasked parts will be overwritten by fields.
2225            // Write the fields.
2226            self.0.encode(encoder, offset + 0, depth)?;
2227            Ok(())
2228        }
2229    }
2230
2231    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2232        for CoordinatorReleaseImageRequest
2233    {
2234        #[inline(always)]
2235        fn new_empty() -> Self {
2236            Self { image_id: fidl::new_empty!(ImageId, D) }
2237        }
2238
2239        #[inline]
2240        unsafe fn decode(
2241            &mut self,
2242            decoder: &mut fidl::encoding::Decoder<'_, D>,
2243            offset: usize,
2244            _depth: fidl::encoding::Depth,
2245        ) -> fidl::Result<()> {
2246            decoder.debug_check_bounds::<Self>(offset);
2247            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2248            // Verify that padding bytes are zero.
2249            // Copy from the buffer into the object.
2250            unsafe {
2251                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2252            }
2253            Ok(())
2254        }
2255    }
2256
2257    impl fidl::encoding::ValueTypeMarker for CoordinatorSetBufferCollectionConstraintsRequest {
2258        type Borrowed<'a> = &'a Self;
2259        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2260            value
2261        }
2262    }
2263
2264    unsafe impl fidl::encoding::TypeMarker for CoordinatorSetBufferCollectionConstraintsRequest {
2265        type Owned = Self;
2266
2267        #[inline(always)]
2268        fn inline_align(_context: fidl::encoding::Context) -> usize {
2269            8
2270        }
2271
2272        #[inline(always)]
2273        fn inline_size(_context: fidl::encoding::Context) -> usize {
2274            16
2275        }
2276    }
2277
2278    unsafe impl<D: fidl::encoding::ResourceDialect>
2279        fidl::encoding::Encode<CoordinatorSetBufferCollectionConstraintsRequest, D>
2280        for &CoordinatorSetBufferCollectionConstraintsRequest
2281    {
2282        #[inline]
2283        unsafe fn encode(
2284            self,
2285            encoder: &mut fidl::encoding::Encoder<'_, D>,
2286            offset: usize,
2287            _depth: fidl::encoding::Depth,
2288        ) -> fidl::Result<()> {
2289            encoder.debug_check_bounds::<CoordinatorSetBufferCollectionConstraintsRequest>(offset);
2290            // Delegate to tuple encoding.
2291            fidl::encoding::Encode::<CoordinatorSetBufferCollectionConstraintsRequest, D>::encode(
2292                (
2293                    <BufferCollectionId as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_collection_id),
2294                    <fidl_fuchsia_hardware_display_types__common::ImageBufferUsage as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_usage),
2295                ),
2296                encoder, offset, _depth
2297            )
2298        }
2299    }
2300    unsafe impl<
2301        D: fidl::encoding::ResourceDialect,
2302        T0: fidl::encoding::Encode<BufferCollectionId, D>,
2303        T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::ImageBufferUsage, D>,
2304    > fidl::encoding::Encode<CoordinatorSetBufferCollectionConstraintsRequest, D> for (T0, T1)
2305    {
2306        #[inline]
2307        unsafe fn encode(
2308            self,
2309            encoder: &mut fidl::encoding::Encoder<'_, D>,
2310            offset: usize,
2311            depth: fidl::encoding::Depth,
2312        ) -> fidl::Result<()> {
2313            encoder.debug_check_bounds::<CoordinatorSetBufferCollectionConstraintsRequest>(offset);
2314            // Zero out padding regions. There's no need to apply masks
2315            // because the unmasked parts will be overwritten by fields.
2316            unsafe {
2317                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2318                (ptr as *mut u64).write_unaligned(0);
2319            }
2320            // Write the fields.
2321            self.0.encode(encoder, offset + 0, depth)?;
2322            self.1.encode(encoder, offset + 8, depth)?;
2323            Ok(())
2324        }
2325    }
2326
2327    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2328        for CoordinatorSetBufferCollectionConstraintsRequest
2329    {
2330        #[inline(always)]
2331        fn new_empty() -> Self {
2332            Self {
2333                buffer_collection_id: fidl::new_empty!(BufferCollectionId, D),
2334                buffer_usage: fidl::new_empty!(
2335                    fidl_fuchsia_hardware_display_types__common::ImageBufferUsage,
2336                    D
2337                ),
2338            }
2339        }
2340
2341        #[inline]
2342        unsafe fn decode(
2343            &mut self,
2344            decoder: &mut fidl::encoding::Decoder<'_, D>,
2345            offset: usize,
2346            _depth: fidl::encoding::Depth,
2347        ) -> fidl::Result<()> {
2348            decoder.debug_check_bounds::<Self>(offset);
2349            // Verify that padding bytes are zero.
2350            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2351            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2352            let mask = 0xffffffff00000000u64;
2353            let maskedval = padval & mask;
2354            if maskedval != 0 {
2355                return Err(fidl::Error::NonZeroPadding {
2356                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2357                });
2358            }
2359            fidl::decode!(
2360                BufferCollectionId,
2361                D,
2362                &mut self.buffer_collection_id,
2363                decoder,
2364                offset + 0,
2365                _depth
2366            )?;
2367            fidl::decode!(
2368                fidl_fuchsia_hardware_display_types__common::ImageBufferUsage,
2369                D,
2370                &mut self.buffer_usage,
2371                decoder,
2372                offset + 8,
2373                _depth
2374            )?;
2375            Ok(())
2376        }
2377    }
2378
2379    impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayColorConversionRequest {
2380        type Borrowed<'a> = &'a Self;
2381        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2382            value
2383        }
2384    }
2385
2386    unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayColorConversionRequest {
2387        type Owned = Self;
2388
2389        #[inline(always)]
2390        fn inline_align(_context: fidl::encoding::Context) -> usize {
2391            8
2392        }
2393
2394        #[inline(always)]
2395        fn inline_size(_context: fidl::encoding::Context) -> usize {
2396            72
2397        }
2398    }
2399
2400    unsafe impl<D: fidl::encoding::ResourceDialect>
2401        fidl::encoding::Encode<CoordinatorSetDisplayColorConversionRequest, D>
2402        for &CoordinatorSetDisplayColorConversionRequest
2403    {
2404        #[inline]
2405        unsafe fn encode(
2406            self,
2407            encoder: &mut fidl::encoding::Encoder<'_, D>,
2408            offset: usize,
2409            _depth: fidl::encoding::Depth,
2410        ) -> fidl::Result<()> {
2411            encoder.debug_check_bounds::<CoordinatorSetDisplayColorConversionRequest>(offset);
2412            // Delegate to tuple encoding.
2413            fidl::encoding::Encode::<CoordinatorSetDisplayColorConversionRequest, D>::encode(
2414                (
2415                    <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
2416                    <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(&self.preoffsets),
2417                    <fidl::encoding::Array<f32, 9> as fidl::encoding::ValueTypeMarker>::borrow(&self.coefficients),
2418                    <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(&self.postoffsets),
2419                ),
2420                encoder, offset, _depth
2421            )
2422        }
2423    }
2424    unsafe impl<
2425        D: fidl::encoding::ResourceDialect,
2426        T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
2427        T1: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
2428        T2: fidl::encoding::Encode<fidl::encoding::Array<f32, 9>, D>,
2429        T3: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
2430    > fidl::encoding::Encode<CoordinatorSetDisplayColorConversionRequest, D> for (T0, T1, T2, T3)
2431    {
2432        #[inline]
2433        unsafe fn encode(
2434            self,
2435            encoder: &mut fidl::encoding::Encoder<'_, D>,
2436            offset: usize,
2437            depth: fidl::encoding::Depth,
2438        ) -> fidl::Result<()> {
2439            encoder.debug_check_bounds::<CoordinatorSetDisplayColorConversionRequest>(offset);
2440            // Zero out padding regions. There's no need to apply masks
2441            // because the unmasked parts will be overwritten by fields.
2442            unsafe {
2443                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(64);
2444                (ptr as *mut u64).write_unaligned(0);
2445            }
2446            // Write the fields.
2447            self.0.encode(encoder, offset + 0, depth)?;
2448            self.1.encode(encoder, offset + 8, depth)?;
2449            self.2.encode(encoder, offset + 20, depth)?;
2450            self.3.encode(encoder, offset + 56, depth)?;
2451            Ok(())
2452        }
2453    }
2454
2455    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2456        for CoordinatorSetDisplayColorConversionRequest
2457    {
2458        #[inline(always)]
2459        fn new_empty() -> Self {
2460            Self {
2461                display_id: fidl::new_empty!(
2462                    fidl_fuchsia_hardware_display_types__common::DisplayId,
2463                    D
2464                ),
2465                preoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
2466                coefficients: fidl::new_empty!(fidl::encoding::Array<f32, 9>, D),
2467                postoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
2468            }
2469        }
2470
2471        #[inline]
2472        unsafe fn decode(
2473            &mut self,
2474            decoder: &mut fidl::encoding::Decoder<'_, D>,
2475            offset: usize,
2476            _depth: fidl::encoding::Depth,
2477        ) -> fidl::Result<()> {
2478            decoder.debug_check_bounds::<Self>(offset);
2479            // Verify that padding bytes are zero.
2480            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(64) };
2481            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2482            let mask = 0xffffffff00000000u64;
2483            let maskedval = padval & mask;
2484            if maskedval != 0 {
2485                return Err(fidl::Error::NonZeroPadding {
2486                    padding_start: offset + 64 + ((mask as u64).trailing_zeros() / 8) as usize,
2487                });
2488            }
2489            fidl::decode!(
2490                fidl_fuchsia_hardware_display_types__common::DisplayId,
2491                D,
2492                &mut self.display_id,
2493                decoder,
2494                offset + 0,
2495                _depth
2496            )?;
2497            fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.preoffsets, decoder, offset + 8, _depth)?;
2498            fidl::decode!(fidl::encoding::Array<f32, 9>, D, &mut self.coefficients, decoder, offset + 20, _depth)?;
2499            fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.postoffsets, decoder, offset + 56, _depth)?;
2500            Ok(())
2501        }
2502    }
2503
2504    impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayLayersRequest {
2505        type Borrowed<'a> = &'a Self;
2506        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2507            value
2508        }
2509    }
2510
2511    unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayLayersRequest {
2512        type Owned = Self;
2513
2514        #[inline(always)]
2515        fn inline_align(_context: fidl::encoding::Context) -> usize {
2516            8
2517        }
2518
2519        #[inline(always)]
2520        fn inline_size(_context: fidl::encoding::Context) -> usize {
2521            24
2522        }
2523    }
2524
2525    unsafe impl<D: fidl::encoding::ResourceDialect>
2526        fidl::encoding::Encode<CoordinatorSetDisplayLayersRequest, D>
2527        for &CoordinatorSetDisplayLayersRequest
2528    {
2529        #[inline]
2530        unsafe fn encode(
2531            self,
2532            encoder: &mut fidl::encoding::Encoder<'_, D>,
2533            offset: usize,
2534            _depth: fidl::encoding::Depth,
2535        ) -> fidl::Result<()> {
2536            encoder.debug_check_bounds::<CoordinatorSetDisplayLayersRequest>(offset);
2537            // Delegate to tuple encoding.
2538            fidl::encoding::Encode::<CoordinatorSetDisplayLayersRequest, D>::encode(
2539                (
2540                    <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
2541                    <fidl::encoding::UnboundedVector<LayerId> as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_ids),
2542                ),
2543                encoder, offset, _depth
2544            )
2545        }
2546    }
2547    unsafe impl<
2548        D: fidl::encoding::ResourceDialect,
2549        T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
2550        T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<LayerId>, D>,
2551    > fidl::encoding::Encode<CoordinatorSetDisplayLayersRequest, D> for (T0, T1)
2552    {
2553        #[inline]
2554        unsafe fn encode(
2555            self,
2556            encoder: &mut fidl::encoding::Encoder<'_, D>,
2557            offset: usize,
2558            depth: fidl::encoding::Depth,
2559        ) -> fidl::Result<()> {
2560            encoder.debug_check_bounds::<CoordinatorSetDisplayLayersRequest>(offset);
2561            // Zero out padding regions. There's no need to apply masks
2562            // because the unmasked parts will be overwritten by fields.
2563            // Write the fields.
2564            self.0.encode(encoder, offset + 0, depth)?;
2565            self.1.encode(encoder, offset + 8, depth)?;
2566            Ok(())
2567        }
2568    }
2569
2570    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2571        for CoordinatorSetDisplayLayersRequest
2572    {
2573        #[inline(always)]
2574        fn new_empty() -> Self {
2575            Self {
2576                display_id: fidl::new_empty!(
2577                    fidl_fuchsia_hardware_display_types__common::DisplayId,
2578                    D
2579                ),
2580                layer_ids: fidl::new_empty!(fidl::encoding::UnboundedVector<LayerId>, D),
2581            }
2582        }
2583
2584        #[inline]
2585        unsafe fn decode(
2586            &mut self,
2587            decoder: &mut fidl::encoding::Decoder<'_, D>,
2588            offset: usize,
2589            _depth: fidl::encoding::Depth,
2590        ) -> fidl::Result<()> {
2591            decoder.debug_check_bounds::<Self>(offset);
2592            // Verify that padding bytes are zero.
2593            fidl::decode!(
2594                fidl_fuchsia_hardware_display_types__common::DisplayId,
2595                D,
2596                &mut self.display_id,
2597                decoder,
2598                offset + 0,
2599                _depth
2600            )?;
2601            fidl::decode!(
2602                fidl::encoding::UnboundedVector<LayerId>,
2603                D,
2604                &mut self.layer_ids,
2605                decoder,
2606                offset + 8,
2607                _depth
2608            )?;
2609            Ok(())
2610        }
2611    }
2612
2613    impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayModeRequest {
2614        type Borrowed<'a> = &'a Self;
2615        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2616            value
2617        }
2618    }
2619
2620    unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayModeRequest {
2621        type Owned = Self;
2622
2623        #[inline(always)]
2624        fn inline_align(_context: fidl::encoding::Context) -> usize {
2625            8
2626        }
2627
2628        #[inline(always)]
2629        fn inline_size(_context: fidl::encoding::Context) -> usize {
2630            24
2631        }
2632    }
2633
2634    unsafe impl<D: fidl::encoding::ResourceDialect>
2635        fidl::encoding::Encode<CoordinatorSetDisplayModeRequest, D>
2636        for &CoordinatorSetDisplayModeRequest
2637    {
2638        #[inline]
2639        unsafe fn encode(
2640            self,
2641            encoder: &mut fidl::encoding::Encoder<'_, D>,
2642            offset: usize,
2643            _depth: fidl::encoding::Depth,
2644        ) -> fidl::Result<()> {
2645            encoder.debug_check_bounds::<CoordinatorSetDisplayModeRequest>(offset);
2646            // Delegate to tuple encoding.
2647            fidl::encoding::Encode::<CoordinatorSetDisplayModeRequest, D>::encode(
2648                (
2649                    <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
2650                    <fidl_fuchsia_hardware_display_types__common::Mode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
2651                ),
2652                encoder, offset, _depth
2653            )
2654        }
2655    }
2656    unsafe impl<
2657        D: fidl::encoding::ResourceDialect,
2658        T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
2659        T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::Mode, D>,
2660    > fidl::encoding::Encode<CoordinatorSetDisplayModeRequest, D> for (T0, T1)
2661    {
2662        #[inline]
2663        unsafe fn encode(
2664            self,
2665            encoder: &mut fidl::encoding::Encoder<'_, D>,
2666            offset: usize,
2667            depth: fidl::encoding::Depth,
2668        ) -> fidl::Result<()> {
2669            encoder.debug_check_bounds::<CoordinatorSetDisplayModeRequest>(offset);
2670            // Zero out padding regions. There's no need to apply masks
2671            // because the unmasked parts will be overwritten by fields.
2672            // Write the fields.
2673            self.0.encode(encoder, offset + 0, depth)?;
2674            self.1.encode(encoder, offset + 8, depth)?;
2675            Ok(())
2676        }
2677    }
2678
2679    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2680        for CoordinatorSetDisplayModeRequest
2681    {
2682        #[inline(always)]
2683        fn new_empty() -> Self {
2684            Self {
2685                display_id: fidl::new_empty!(
2686                    fidl_fuchsia_hardware_display_types__common::DisplayId,
2687                    D
2688                ),
2689                mode: fidl::new_empty!(fidl_fuchsia_hardware_display_types__common::Mode, D),
2690            }
2691        }
2692
2693        #[inline]
2694        unsafe fn decode(
2695            &mut self,
2696            decoder: &mut fidl::encoding::Decoder<'_, D>,
2697            offset: usize,
2698            _depth: fidl::encoding::Depth,
2699        ) -> fidl::Result<()> {
2700            decoder.debug_check_bounds::<Self>(offset);
2701            // Verify that padding bytes are zero.
2702            fidl::decode!(
2703                fidl_fuchsia_hardware_display_types__common::DisplayId,
2704                D,
2705                &mut self.display_id,
2706                decoder,
2707                offset + 0,
2708                _depth
2709            )?;
2710            fidl::decode!(
2711                fidl_fuchsia_hardware_display_types__common::Mode,
2712                D,
2713                &mut self.mode,
2714                decoder,
2715                offset + 8,
2716                _depth
2717            )?;
2718            Ok(())
2719        }
2720    }
2721
2722    impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayPowerModeRequest {
2723        type Borrowed<'a> = &'a Self;
2724        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2725            value
2726        }
2727    }
2728
2729    unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayPowerModeRequest {
2730        type Owned = Self;
2731
2732        #[inline(always)]
2733        fn inline_align(_context: fidl::encoding::Context) -> usize {
2734            8
2735        }
2736
2737        #[inline(always)]
2738        fn inline_size(_context: fidl::encoding::Context) -> usize {
2739            16
2740        }
2741    }
2742
2743    unsafe impl<D: fidl::encoding::ResourceDialect>
2744        fidl::encoding::Encode<CoordinatorSetDisplayPowerModeRequest, D>
2745        for &CoordinatorSetDisplayPowerModeRequest
2746    {
2747        #[inline]
2748        unsafe fn encode(
2749            self,
2750            encoder: &mut fidl::encoding::Encoder<'_, D>,
2751            offset: usize,
2752            _depth: fidl::encoding::Depth,
2753        ) -> fidl::Result<()> {
2754            encoder.debug_check_bounds::<CoordinatorSetDisplayPowerModeRequest>(offset);
2755            // Delegate to tuple encoding.
2756            fidl::encoding::Encode::<CoordinatorSetDisplayPowerModeRequest, D>::encode(
2757                (
2758                    <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
2759                    <fidl_fuchsia_hardware_display_types__common::PowerMode as fidl::encoding::ValueTypeMarker>::borrow(&self.power_mode),
2760                ),
2761                encoder, offset, _depth
2762            )
2763        }
2764    }
2765    unsafe impl<
2766        D: fidl::encoding::ResourceDialect,
2767        T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
2768        T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::PowerMode, D>,
2769    > fidl::encoding::Encode<CoordinatorSetDisplayPowerModeRequest, D> for (T0, T1)
2770    {
2771        #[inline]
2772        unsafe fn encode(
2773            self,
2774            encoder: &mut fidl::encoding::Encoder<'_, D>,
2775            offset: usize,
2776            depth: fidl::encoding::Depth,
2777        ) -> fidl::Result<()> {
2778            encoder.debug_check_bounds::<CoordinatorSetDisplayPowerModeRequest>(offset);
2779            // Zero out padding regions. There's no need to apply masks
2780            // because the unmasked parts will be overwritten by fields.
2781            unsafe {
2782                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2783                (ptr as *mut u64).write_unaligned(0);
2784            }
2785            // Write the fields.
2786            self.0.encode(encoder, offset + 0, depth)?;
2787            self.1.encode(encoder, offset + 8, depth)?;
2788            Ok(())
2789        }
2790    }
2791
2792    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2793        for CoordinatorSetDisplayPowerModeRequest
2794    {
2795        #[inline(always)]
2796        fn new_empty() -> Self {
2797            Self {
2798                display_id: fidl::new_empty!(
2799                    fidl_fuchsia_hardware_display_types__common::DisplayId,
2800                    D
2801                ),
2802                power_mode: fidl::new_empty!(
2803                    fidl_fuchsia_hardware_display_types__common::PowerMode,
2804                    D
2805                ),
2806            }
2807        }
2808
2809        #[inline]
2810        unsafe fn decode(
2811            &mut self,
2812            decoder: &mut fidl::encoding::Decoder<'_, D>,
2813            offset: usize,
2814            _depth: fidl::encoding::Depth,
2815        ) -> fidl::Result<()> {
2816            decoder.debug_check_bounds::<Self>(offset);
2817            // Verify that padding bytes are zero.
2818            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2819            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2820            let mask = 0xffffffff00000000u64;
2821            let maskedval = padval & mask;
2822            if maskedval != 0 {
2823                return Err(fidl::Error::NonZeroPadding {
2824                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2825                });
2826            }
2827            fidl::decode!(
2828                fidl_fuchsia_hardware_display_types__common::DisplayId,
2829                D,
2830                &mut self.display_id,
2831                decoder,
2832                offset + 0,
2833                _depth
2834            )?;
2835            fidl::decode!(
2836                fidl_fuchsia_hardware_display_types__common::PowerMode,
2837                D,
2838                &mut self.power_mode,
2839                decoder,
2840                offset + 8,
2841                _depth
2842            )?;
2843            Ok(())
2844        }
2845    }
2846
2847    impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerColorConfigRequest {
2848        type Borrowed<'a> = &'a Self;
2849        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2850            value
2851        }
2852    }
2853
2854    unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerColorConfigRequest {
2855        type Owned = Self;
2856
2857        #[inline(always)]
2858        fn inline_align(_context: fidl::encoding::Context) -> usize {
2859            8
2860        }
2861
2862        #[inline(always)]
2863        fn inline_size(_context: fidl::encoding::Context) -> usize {
2864            40
2865        }
2866    }
2867
2868    unsafe impl<D: fidl::encoding::ResourceDialect>
2869        fidl::encoding::Encode<CoordinatorSetLayerColorConfigRequest, D>
2870        for &CoordinatorSetLayerColorConfigRequest
2871    {
2872        #[inline]
2873        unsafe fn encode(
2874            self,
2875            encoder: &mut fidl::encoding::Encoder<'_, D>,
2876            offset: usize,
2877            _depth: fidl::encoding::Depth,
2878        ) -> fidl::Result<()> {
2879            encoder.debug_check_bounds::<CoordinatorSetLayerColorConfigRequest>(offset);
2880            // Delegate to tuple encoding.
2881            fidl::encoding::Encode::<CoordinatorSetLayerColorConfigRequest, D>::encode(
2882                (
2883                    <LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
2884                    <fidl_fuchsia_hardware_display_types__common::Color as fidl::encoding::ValueTypeMarker>::borrow(&self.color),
2885                    <fidl_fuchsia_math__common::RectU as fidl::encoding::ValueTypeMarker>::borrow(&self.display_destination),
2886                ),
2887                encoder, offset, _depth
2888            )
2889        }
2890    }
2891    unsafe impl<
2892        D: fidl::encoding::ResourceDialect,
2893        T0: fidl::encoding::Encode<LayerId, D>,
2894        T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::Color, D>,
2895        T2: fidl::encoding::Encode<fidl_fuchsia_math__common::RectU, D>,
2896    > fidl::encoding::Encode<CoordinatorSetLayerColorConfigRequest, D> for (T0, T1, T2)
2897    {
2898        #[inline]
2899        unsafe fn encode(
2900            self,
2901            encoder: &mut fidl::encoding::Encoder<'_, D>,
2902            offset: usize,
2903            depth: fidl::encoding::Depth,
2904        ) -> fidl::Result<()> {
2905            encoder.debug_check_bounds::<CoordinatorSetLayerColorConfigRequest>(offset);
2906            // Zero out padding regions. There's no need to apply masks
2907            // because the unmasked parts will be overwritten by fields.
2908            unsafe {
2909                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
2910                (ptr as *mut u64).write_unaligned(0);
2911            }
2912            // Write the fields.
2913            self.0.encode(encoder, offset + 0, depth)?;
2914            self.1.encode(encoder, offset + 8, depth)?;
2915            self.2.encode(encoder, offset + 20, depth)?;
2916            Ok(())
2917        }
2918    }
2919
2920    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2921        for CoordinatorSetLayerColorConfigRequest
2922    {
2923        #[inline(always)]
2924        fn new_empty() -> Self {
2925            Self {
2926                layer_id: fidl::new_empty!(LayerId, D),
2927                color: fidl::new_empty!(fidl_fuchsia_hardware_display_types__common::Color, D),
2928                display_destination: fidl::new_empty!(fidl_fuchsia_math__common::RectU, D),
2929            }
2930        }
2931
2932        #[inline]
2933        unsafe fn decode(
2934            &mut self,
2935            decoder: &mut fidl::encoding::Decoder<'_, D>,
2936            offset: usize,
2937            _depth: fidl::encoding::Depth,
2938        ) -> fidl::Result<()> {
2939            decoder.debug_check_bounds::<Self>(offset);
2940            // Verify that padding bytes are zero.
2941            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
2942            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2943            let mask = 0xffffffff00000000u64;
2944            let maskedval = padval & mask;
2945            if maskedval != 0 {
2946                return Err(fidl::Error::NonZeroPadding {
2947                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
2948                });
2949            }
2950            fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
2951            fidl::decode!(
2952                fidl_fuchsia_hardware_display_types__common::Color,
2953                D,
2954                &mut self.color,
2955                decoder,
2956                offset + 8,
2957                _depth
2958            )?;
2959            fidl::decode!(
2960                fidl_fuchsia_math__common::RectU,
2961                D,
2962                &mut self.display_destination,
2963                decoder,
2964                offset + 20,
2965                _depth
2966            )?;
2967            Ok(())
2968        }
2969    }
2970
2971    impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerImage2Request {
2972        type Borrowed<'a> = &'a Self;
2973        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2974            value
2975        }
2976    }
2977
2978    unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerImage2Request {
2979        type Owned = Self;
2980
2981        #[inline(always)]
2982        fn inline_align(_context: fidl::encoding::Context) -> usize {
2983            8
2984        }
2985
2986        #[inline(always)]
2987        fn inline_size(_context: fidl::encoding::Context) -> usize {
2988            24
2989        }
2990        #[inline(always)]
2991        fn encode_is_copy() -> bool {
2992            true
2993        }
2994
2995        #[inline(always)]
2996        fn decode_is_copy() -> bool {
2997            true
2998        }
2999    }
3000
3001    unsafe impl<D: fidl::encoding::ResourceDialect>
3002        fidl::encoding::Encode<CoordinatorSetLayerImage2Request, D>
3003        for &CoordinatorSetLayerImage2Request
3004    {
3005        #[inline]
3006        unsafe fn encode(
3007            self,
3008            encoder: &mut fidl::encoding::Encoder<'_, D>,
3009            offset: usize,
3010            _depth: fidl::encoding::Depth,
3011        ) -> fidl::Result<()> {
3012            encoder.debug_check_bounds::<CoordinatorSetLayerImage2Request>(offset);
3013            unsafe {
3014                // Copy the object into the buffer.
3015                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3016                (buf_ptr as *mut CoordinatorSetLayerImage2Request)
3017                    .write_unaligned((self as *const CoordinatorSetLayerImage2Request).read());
3018                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3019                // done second because the memcpy will write garbage to these bytes.
3020            }
3021            Ok(())
3022        }
3023    }
3024    unsafe impl<
3025        D: fidl::encoding::ResourceDialect,
3026        T0: fidl::encoding::Encode<LayerId, D>,
3027        T1: fidl::encoding::Encode<ImageId, D>,
3028        T2: fidl::encoding::Encode<EventId, D>,
3029    > fidl::encoding::Encode<CoordinatorSetLayerImage2Request, D> for (T0, T1, T2)
3030    {
3031        #[inline]
3032        unsafe fn encode(
3033            self,
3034            encoder: &mut fidl::encoding::Encoder<'_, D>,
3035            offset: usize,
3036            depth: fidl::encoding::Depth,
3037        ) -> fidl::Result<()> {
3038            encoder.debug_check_bounds::<CoordinatorSetLayerImage2Request>(offset);
3039            // Zero out padding regions. There's no need to apply masks
3040            // because the unmasked parts will be overwritten by fields.
3041            // Write the fields.
3042            self.0.encode(encoder, offset + 0, depth)?;
3043            self.1.encode(encoder, offset + 8, depth)?;
3044            self.2.encode(encoder, offset + 16, depth)?;
3045            Ok(())
3046        }
3047    }
3048
3049    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3050        for CoordinatorSetLayerImage2Request
3051    {
3052        #[inline(always)]
3053        fn new_empty() -> Self {
3054            Self {
3055                layer_id: fidl::new_empty!(LayerId, D),
3056                image_id: fidl::new_empty!(ImageId, D),
3057                wait_event_id: fidl::new_empty!(EventId, D),
3058            }
3059        }
3060
3061        #[inline]
3062        unsafe fn decode(
3063            &mut self,
3064            decoder: &mut fidl::encoding::Decoder<'_, D>,
3065            offset: usize,
3066            _depth: fidl::encoding::Depth,
3067        ) -> fidl::Result<()> {
3068            decoder.debug_check_bounds::<Self>(offset);
3069            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3070            // Verify that padding bytes are zero.
3071            // Copy from the buffer into the object.
3072            unsafe {
3073                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
3074            }
3075            Ok(())
3076        }
3077    }
3078
3079    impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerPrimaryAlphaRequest {
3080        type Borrowed<'a> = &'a Self;
3081        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3082            value
3083        }
3084    }
3085
3086    unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerPrimaryAlphaRequest {
3087        type Owned = Self;
3088
3089        #[inline(always)]
3090        fn inline_align(_context: fidl::encoding::Context) -> usize {
3091            8
3092        }
3093
3094        #[inline(always)]
3095        fn inline_size(_context: fidl::encoding::Context) -> usize {
3096            16
3097        }
3098    }
3099
3100    unsafe impl<D: fidl::encoding::ResourceDialect>
3101        fidl::encoding::Encode<CoordinatorSetLayerPrimaryAlphaRequest, D>
3102        for &CoordinatorSetLayerPrimaryAlphaRequest
3103    {
3104        #[inline]
3105        unsafe fn encode(
3106            self,
3107            encoder: &mut fidl::encoding::Encoder<'_, D>,
3108            offset: usize,
3109            _depth: fidl::encoding::Depth,
3110        ) -> fidl::Result<()> {
3111            encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryAlphaRequest>(offset);
3112            // Delegate to tuple encoding.
3113            fidl::encoding::Encode::<CoordinatorSetLayerPrimaryAlphaRequest, D>::encode(
3114                (
3115                    <LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
3116                    <fidl_fuchsia_hardware_display_types__common::AlphaMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
3117                    <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.val),
3118                ),
3119                encoder, offset, _depth
3120            )
3121        }
3122    }
3123    unsafe impl<
3124        D: fidl::encoding::ResourceDialect,
3125        T0: fidl::encoding::Encode<LayerId, D>,
3126        T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::AlphaMode, D>,
3127        T2: fidl::encoding::Encode<f32, D>,
3128    > fidl::encoding::Encode<CoordinatorSetLayerPrimaryAlphaRequest, D> for (T0, T1, T2)
3129    {
3130        #[inline]
3131        unsafe fn encode(
3132            self,
3133            encoder: &mut fidl::encoding::Encoder<'_, D>,
3134            offset: usize,
3135            depth: fidl::encoding::Depth,
3136        ) -> fidl::Result<()> {
3137            encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryAlphaRequest>(offset);
3138            // Zero out padding regions. There's no need to apply masks
3139            // because the unmasked parts will be overwritten by fields.
3140            unsafe {
3141                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3142                (ptr as *mut u64).write_unaligned(0);
3143            }
3144            // Write the fields.
3145            self.0.encode(encoder, offset + 0, depth)?;
3146            self.1.encode(encoder, offset + 8, depth)?;
3147            self.2.encode(encoder, offset + 12, depth)?;
3148            Ok(())
3149        }
3150    }
3151
3152    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3153        for CoordinatorSetLayerPrimaryAlphaRequest
3154    {
3155        #[inline(always)]
3156        fn new_empty() -> Self {
3157            Self {
3158                layer_id: fidl::new_empty!(LayerId, D),
3159                mode: fidl::new_empty!(fidl_fuchsia_hardware_display_types__common::AlphaMode, D),
3160                val: fidl::new_empty!(f32, D),
3161            }
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            // Verify that padding bytes are zero.
3173            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3174            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3175            let mask = 0xffffff00u64;
3176            let maskedval = padval & mask;
3177            if maskedval != 0 {
3178                return Err(fidl::Error::NonZeroPadding {
3179                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3180                });
3181            }
3182            fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
3183            fidl::decode!(
3184                fidl_fuchsia_hardware_display_types__common::AlphaMode,
3185                D,
3186                &mut self.mode,
3187                decoder,
3188                offset + 8,
3189                _depth
3190            )?;
3191            fidl::decode!(f32, D, &mut self.val, decoder, offset + 12, _depth)?;
3192            Ok(())
3193        }
3194    }
3195
3196    impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerPrimaryConfigRequest {
3197        type Borrowed<'a> = &'a Self;
3198        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3199            value
3200        }
3201    }
3202
3203    unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerPrimaryConfigRequest {
3204        type Owned = Self;
3205
3206        #[inline(always)]
3207        fn inline_align(_context: fidl::encoding::Context) -> usize {
3208            8
3209        }
3210
3211        #[inline(always)]
3212        fn inline_size(_context: fidl::encoding::Context) -> usize {
3213            24
3214        }
3215    }
3216
3217    unsafe impl<D: fidl::encoding::ResourceDialect>
3218        fidl::encoding::Encode<CoordinatorSetLayerPrimaryConfigRequest, D>
3219        for &CoordinatorSetLayerPrimaryConfigRequest
3220    {
3221        #[inline]
3222        unsafe fn encode(
3223            self,
3224            encoder: &mut fidl::encoding::Encoder<'_, D>,
3225            offset: usize,
3226            _depth: fidl::encoding::Depth,
3227        ) -> fidl::Result<()> {
3228            encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryConfigRequest>(offset);
3229            // Delegate to tuple encoding.
3230            fidl::encoding::Encode::<CoordinatorSetLayerPrimaryConfigRequest, D>::encode(
3231                (
3232                    <LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
3233                    <fidl_fuchsia_hardware_display_types__common::ImageMetadata as fidl::encoding::ValueTypeMarker>::borrow(&self.image_metadata),
3234                ),
3235                encoder, offset, _depth
3236            )
3237        }
3238    }
3239    unsafe impl<
3240        D: fidl::encoding::ResourceDialect,
3241        T0: fidl::encoding::Encode<LayerId, D>,
3242        T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::ImageMetadata, D>,
3243    > fidl::encoding::Encode<CoordinatorSetLayerPrimaryConfigRequest, D> for (T0, T1)
3244    {
3245        #[inline]
3246        unsafe fn encode(
3247            self,
3248            encoder: &mut fidl::encoding::Encoder<'_, D>,
3249            offset: usize,
3250            depth: fidl::encoding::Depth,
3251        ) -> fidl::Result<()> {
3252            encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryConfigRequest>(offset);
3253            // Zero out padding regions. There's no need to apply masks
3254            // because the unmasked parts will be overwritten by fields.
3255            unsafe {
3256                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3257                (ptr as *mut u64).write_unaligned(0);
3258            }
3259            // Write the fields.
3260            self.0.encode(encoder, offset + 0, depth)?;
3261            self.1.encode(encoder, offset + 8, depth)?;
3262            Ok(())
3263        }
3264    }
3265
3266    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3267        for CoordinatorSetLayerPrimaryConfigRequest
3268    {
3269        #[inline(always)]
3270        fn new_empty() -> Self {
3271            Self {
3272                layer_id: fidl::new_empty!(LayerId, D),
3273                image_metadata: fidl::new_empty!(
3274                    fidl_fuchsia_hardware_display_types__common::ImageMetadata,
3275                    D
3276                ),
3277            }
3278        }
3279
3280        #[inline]
3281        unsafe fn decode(
3282            &mut self,
3283            decoder: &mut fidl::encoding::Decoder<'_, D>,
3284            offset: usize,
3285            _depth: fidl::encoding::Depth,
3286        ) -> fidl::Result<()> {
3287            decoder.debug_check_bounds::<Self>(offset);
3288            // Verify that padding bytes are zero.
3289            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3290            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3291            let mask = 0xffffffff00000000u64;
3292            let maskedval = padval & mask;
3293            if maskedval != 0 {
3294                return Err(fidl::Error::NonZeroPadding {
3295                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3296                });
3297            }
3298            fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
3299            fidl::decode!(
3300                fidl_fuchsia_hardware_display_types__common::ImageMetadata,
3301                D,
3302                &mut self.image_metadata,
3303                decoder,
3304                offset + 8,
3305                _depth
3306            )?;
3307            Ok(())
3308        }
3309    }
3310
3311    impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerPrimaryPositionRequest {
3312        type Borrowed<'a> = &'a Self;
3313        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3314            value
3315        }
3316    }
3317
3318    unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerPrimaryPositionRequest {
3319        type Owned = Self;
3320
3321        #[inline(always)]
3322        fn inline_align(_context: fidl::encoding::Context) -> usize {
3323            8
3324        }
3325
3326        #[inline(always)]
3327        fn inline_size(_context: fidl::encoding::Context) -> usize {
3328            48
3329        }
3330    }
3331
3332    unsafe impl<D: fidl::encoding::ResourceDialect>
3333        fidl::encoding::Encode<CoordinatorSetLayerPrimaryPositionRequest, D>
3334        for &CoordinatorSetLayerPrimaryPositionRequest
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::<CoordinatorSetLayerPrimaryPositionRequest>(offset);
3344            // Delegate to tuple encoding.
3345            fidl::encoding::Encode::<CoordinatorSetLayerPrimaryPositionRequest, D>::encode(
3346                (
3347                    <LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
3348                    <fidl_fuchsia_hardware_display_types__common::CoordinateTransformation as fidl::encoding::ValueTypeMarker>::borrow(&self.image_source_transformation),
3349                    <fidl_fuchsia_math__common::RectU as fidl::encoding::ValueTypeMarker>::borrow(&self.image_source),
3350                    <fidl_fuchsia_math__common::RectU as fidl::encoding::ValueTypeMarker>::borrow(&self.display_destination),
3351                ),
3352                encoder, offset, _depth
3353            )
3354        }
3355    }
3356    unsafe impl<
3357        D: fidl::encoding::ResourceDialect,
3358        T0: fidl::encoding::Encode<LayerId, D>,
3359        T1: fidl::encoding::Encode<
3360                fidl_fuchsia_hardware_display_types__common::CoordinateTransformation,
3361                D,
3362            >,
3363        T2: fidl::encoding::Encode<fidl_fuchsia_math__common::RectU, D>,
3364        T3: fidl::encoding::Encode<fidl_fuchsia_math__common::RectU, D>,
3365    > fidl::encoding::Encode<CoordinatorSetLayerPrimaryPositionRequest, D> for (T0, T1, T2, T3)
3366    {
3367        #[inline]
3368        unsafe fn encode(
3369            self,
3370            encoder: &mut fidl::encoding::Encoder<'_, D>,
3371            offset: usize,
3372            depth: fidl::encoding::Depth,
3373        ) -> fidl::Result<()> {
3374            encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryPositionRequest>(offset);
3375            // Zero out padding regions. There's no need to apply masks
3376            // because the unmasked parts will be overwritten by fields.
3377            unsafe {
3378                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3379                (ptr as *mut u64).write_unaligned(0);
3380            }
3381            unsafe {
3382                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
3383                (ptr as *mut u64).write_unaligned(0);
3384            }
3385            // Write the fields.
3386            self.0.encode(encoder, offset + 0, depth)?;
3387            self.1.encode(encoder, offset + 8, depth)?;
3388            self.2.encode(encoder, offset + 12, depth)?;
3389            self.3.encode(encoder, offset + 28, depth)?;
3390            Ok(())
3391        }
3392    }
3393
3394    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3395        for CoordinatorSetLayerPrimaryPositionRequest
3396    {
3397        #[inline(always)]
3398        fn new_empty() -> Self {
3399            Self {
3400                layer_id: fidl::new_empty!(LayerId, D),
3401                image_source_transformation: fidl::new_empty!(
3402                    fidl_fuchsia_hardware_display_types__common::CoordinateTransformation,
3403                    D
3404                ),
3405                image_source: fidl::new_empty!(fidl_fuchsia_math__common::RectU, D),
3406                display_destination: fidl::new_empty!(fidl_fuchsia_math__common::RectU, D),
3407            }
3408        }
3409
3410        #[inline]
3411        unsafe fn decode(
3412            &mut self,
3413            decoder: &mut fidl::encoding::Decoder<'_, D>,
3414            offset: usize,
3415            _depth: fidl::encoding::Depth,
3416        ) -> fidl::Result<()> {
3417            decoder.debug_check_bounds::<Self>(offset);
3418            // Verify that padding bytes are zero.
3419            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3420            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3421            let mask = 0xffffff00u64;
3422            let maskedval = padval & mask;
3423            if maskedval != 0 {
3424                return Err(fidl::Error::NonZeroPadding {
3425                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3426                });
3427            }
3428            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
3429            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3430            let mask = 0xffffffff00000000u64;
3431            let maskedval = padval & mask;
3432            if maskedval != 0 {
3433                return Err(fidl::Error::NonZeroPadding {
3434                    padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
3435                });
3436            }
3437            fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
3438            fidl::decode!(
3439                fidl_fuchsia_hardware_display_types__common::CoordinateTransformation,
3440                D,
3441                &mut self.image_source_transformation,
3442                decoder,
3443                offset + 8,
3444                _depth
3445            )?;
3446            fidl::decode!(
3447                fidl_fuchsia_math__common::RectU,
3448                D,
3449                &mut self.image_source,
3450                decoder,
3451                offset + 12,
3452                _depth
3453            )?;
3454            fidl::decode!(
3455                fidl_fuchsia_math__common::RectU,
3456                D,
3457                &mut self.display_destination,
3458                decoder,
3459                offset + 28,
3460                _depth
3461            )?;
3462            Ok(())
3463        }
3464    }
3465
3466    impl fidl::encoding::ValueTypeMarker for CoordinatorSetMinimumRgbRequest {
3467        type Borrowed<'a> = &'a Self;
3468        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3469            value
3470        }
3471    }
3472
3473    unsafe impl fidl::encoding::TypeMarker for CoordinatorSetMinimumRgbRequest {
3474        type Owned = Self;
3475
3476        #[inline(always)]
3477        fn inline_align(_context: fidl::encoding::Context) -> usize {
3478            1
3479        }
3480
3481        #[inline(always)]
3482        fn inline_size(_context: fidl::encoding::Context) -> usize {
3483            1
3484        }
3485        #[inline(always)]
3486        fn encode_is_copy() -> bool {
3487            true
3488        }
3489
3490        #[inline(always)]
3491        fn decode_is_copy() -> bool {
3492            true
3493        }
3494    }
3495
3496    unsafe impl<D: fidl::encoding::ResourceDialect>
3497        fidl::encoding::Encode<CoordinatorSetMinimumRgbRequest, D>
3498        for &CoordinatorSetMinimumRgbRequest
3499    {
3500        #[inline]
3501        unsafe fn encode(
3502            self,
3503            encoder: &mut fidl::encoding::Encoder<'_, D>,
3504            offset: usize,
3505            _depth: fidl::encoding::Depth,
3506        ) -> fidl::Result<()> {
3507            encoder.debug_check_bounds::<CoordinatorSetMinimumRgbRequest>(offset);
3508            unsafe {
3509                // Copy the object into the buffer.
3510                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3511                (buf_ptr as *mut CoordinatorSetMinimumRgbRequest)
3512                    .write_unaligned((self as *const CoordinatorSetMinimumRgbRequest).read());
3513                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3514                // done second because the memcpy will write garbage to these bytes.
3515            }
3516            Ok(())
3517        }
3518    }
3519    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
3520        fidl::encoding::Encode<CoordinatorSetMinimumRgbRequest, D> for (T0,)
3521    {
3522        #[inline]
3523        unsafe fn encode(
3524            self,
3525            encoder: &mut fidl::encoding::Encoder<'_, D>,
3526            offset: usize,
3527            depth: fidl::encoding::Depth,
3528        ) -> fidl::Result<()> {
3529            encoder.debug_check_bounds::<CoordinatorSetMinimumRgbRequest>(offset);
3530            // Zero out padding regions. There's no need to apply masks
3531            // because the unmasked parts will be overwritten by fields.
3532            // Write the fields.
3533            self.0.encode(encoder, offset + 0, depth)?;
3534            Ok(())
3535        }
3536    }
3537
3538    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3539        for CoordinatorSetMinimumRgbRequest
3540    {
3541        #[inline(always)]
3542        fn new_empty() -> Self {
3543            Self { minimum_rgb: fidl::new_empty!(u8, D) }
3544        }
3545
3546        #[inline]
3547        unsafe fn decode(
3548            &mut self,
3549            decoder: &mut fidl::encoding::Decoder<'_, D>,
3550            offset: usize,
3551            _depth: fidl::encoding::Depth,
3552        ) -> fidl::Result<()> {
3553            decoder.debug_check_bounds::<Self>(offset);
3554            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3555            // Verify that padding bytes are zero.
3556            // Copy from the buffer into the object.
3557            unsafe {
3558                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
3559            }
3560            Ok(())
3561        }
3562    }
3563
3564    impl fidl::encoding::ValueTypeMarker for CoordinatorSetVirtconModeRequest {
3565        type Borrowed<'a> = &'a Self;
3566        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3567            value
3568        }
3569    }
3570
3571    unsafe impl fidl::encoding::TypeMarker for CoordinatorSetVirtconModeRequest {
3572        type Owned = Self;
3573
3574        #[inline(always)]
3575        fn inline_align(_context: fidl::encoding::Context) -> usize {
3576            1
3577        }
3578
3579        #[inline(always)]
3580        fn inline_size(_context: fidl::encoding::Context) -> usize {
3581            1
3582        }
3583    }
3584
3585    unsafe impl<D: fidl::encoding::ResourceDialect>
3586        fidl::encoding::Encode<CoordinatorSetVirtconModeRequest, D>
3587        for &CoordinatorSetVirtconModeRequest
3588    {
3589        #[inline]
3590        unsafe fn encode(
3591            self,
3592            encoder: &mut fidl::encoding::Encoder<'_, D>,
3593            offset: usize,
3594            _depth: fidl::encoding::Depth,
3595        ) -> fidl::Result<()> {
3596            encoder.debug_check_bounds::<CoordinatorSetVirtconModeRequest>(offset);
3597            // Delegate to tuple encoding.
3598            fidl::encoding::Encode::<CoordinatorSetVirtconModeRequest, D>::encode(
3599                (<VirtconMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),),
3600                encoder,
3601                offset,
3602                _depth,
3603            )
3604        }
3605    }
3606    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<VirtconMode, D>>
3607        fidl::encoding::Encode<CoordinatorSetVirtconModeRequest, D> for (T0,)
3608    {
3609        #[inline]
3610        unsafe fn encode(
3611            self,
3612            encoder: &mut fidl::encoding::Encoder<'_, D>,
3613            offset: usize,
3614            depth: fidl::encoding::Depth,
3615        ) -> fidl::Result<()> {
3616            encoder.debug_check_bounds::<CoordinatorSetVirtconModeRequest>(offset);
3617            // Zero out padding regions. There's no need to apply masks
3618            // because the unmasked parts will be overwritten by fields.
3619            // Write the fields.
3620            self.0.encode(encoder, offset + 0, depth)?;
3621            Ok(())
3622        }
3623    }
3624
3625    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3626        for CoordinatorSetVirtconModeRequest
3627    {
3628        #[inline(always)]
3629        fn new_empty() -> Self {
3630            Self { mode: fidl::new_empty!(VirtconMode, D) }
3631        }
3632
3633        #[inline]
3634        unsafe fn decode(
3635            &mut self,
3636            decoder: &mut fidl::encoding::Decoder<'_, D>,
3637            offset: usize,
3638            _depth: fidl::encoding::Depth,
3639        ) -> fidl::Result<()> {
3640            decoder.debug_check_bounds::<Self>(offset);
3641            // Verify that padding bytes are zero.
3642            fidl::decode!(VirtconMode, D, &mut self.mode, decoder, offset + 0, _depth)?;
3643            Ok(())
3644        }
3645    }
3646
3647    impl fidl::encoding::ValueTypeMarker for CoordinatorStartCaptureRequest {
3648        type Borrowed<'a> = &'a Self;
3649        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3650            value
3651        }
3652    }
3653
3654    unsafe impl fidl::encoding::TypeMarker for CoordinatorStartCaptureRequest {
3655        type Owned = Self;
3656
3657        #[inline(always)]
3658        fn inline_align(_context: fidl::encoding::Context) -> usize {
3659            8
3660        }
3661
3662        #[inline(always)]
3663        fn inline_size(_context: fidl::encoding::Context) -> usize {
3664            16
3665        }
3666        #[inline(always)]
3667        fn encode_is_copy() -> bool {
3668            true
3669        }
3670
3671        #[inline(always)]
3672        fn decode_is_copy() -> bool {
3673            true
3674        }
3675    }
3676
3677    unsafe impl<D: fidl::encoding::ResourceDialect>
3678        fidl::encoding::Encode<CoordinatorStartCaptureRequest, D>
3679        for &CoordinatorStartCaptureRequest
3680    {
3681        #[inline]
3682        unsafe fn encode(
3683            self,
3684            encoder: &mut fidl::encoding::Encoder<'_, D>,
3685            offset: usize,
3686            _depth: fidl::encoding::Depth,
3687        ) -> fidl::Result<()> {
3688            encoder.debug_check_bounds::<CoordinatorStartCaptureRequest>(offset);
3689            unsafe {
3690                // Copy the object into the buffer.
3691                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3692                (buf_ptr as *mut CoordinatorStartCaptureRequest)
3693                    .write_unaligned((self as *const CoordinatorStartCaptureRequest).read());
3694                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3695                // done second because the memcpy will write garbage to these bytes.
3696            }
3697            Ok(())
3698        }
3699    }
3700    unsafe impl<
3701        D: fidl::encoding::ResourceDialect,
3702        T0: fidl::encoding::Encode<EventId, D>,
3703        T1: fidl::encoding::Encode<ImageId, D>,
3704    > fidl::encoding::Encode<CoordinatorStartCaptureRequest, D> for (T0, T1)
3705    {
3706        #[inline]
3707        unsafe fn encode(
3708            self,
3709            encoder: &mut fidl::encoding::Encoder<'_, D>,
3710            offset: usize,
3711            depth: fidl::encoding::Depth,
3712        ) -> fidl::Result<()> {
3713            encoder.debug_check_bounds::<CoordinatorStartCaptureRequest>(offset);
3714            // Zero out padding regions. There's no need to apply masks
3715            // because the unmasked parts will be overwritten by fields.
3716            // Write the fields.
3717            self.0.encode(encoder, offset + 0, depth)?;
3718            self.1.encode(encoder, offset + 8, depth)?;
3719            Ok(())
3720        }
3721    }
3722
3723    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3724        for CoordinatorStartCaptureRequest
3725    {
3726        #[inline(always)]
3727        fn new_empty() -> Self {
3728            Self {
3729                signal_event_id: fidl::new_empty!(EventId, D),
3730                image_id: fidl::new_empty!(ImageId, D),
3731            }
3732        }
3733
3734        #[inline]
3735        unsafe fn decode(
3736            &mut self,
3737            decoder: &mut fidl::encoding::Decoder<'_, D>,
3738            offset: usize,
3739            _depth: fidl::encoding::Depth,
3740        ) -> fidl::Result<()> {
3741            decoder.debug_check_bounds::<Self>(offset);
3742            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3743            // Verify that padding bytes are zero.
3744            // Copy from the buffer into the object.
3745            unsafe {
3746                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
3747            }
3748            Ok(())
3749        }
3750    }
3751
3752    impl fidl::encoding::ValueTypeMarker for CoordinatorIsCaptureSupportedResponse {
3753        type Borrowed<'a> = &'a Self;
3754        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3755            value
3756        }
3757    }
3758
3759    unsafe impl fidl::encoding::TypeMarker for CoordinatorIsCaptureSupportedResponse {
3760        type Owned = Self;
3761
3762        #[inline(always)]
3763        fn inline_align(_context: fidl::encoding::Context) -> usize {
3764            1
3765        }
3766
3767        #[inline(always)]
3768        fn inline_size(_context: fidl::encoding::Context) -> usize {
3769            1
3770        }
3771    }
3772
3773    unsafe impl<D: fidl::encoding::ResourceDialect>
3774        fidl::encoding::Encode<CoordinatorIsCaptureSupportedResponse, D>
3775        for &CoordinatorIsCaptureSupportedResponse
3776    {
3777        #[inline]
3778        unsafe fn encode(
3779            self,
3780            encoder: &mut fidl::encoding::Encoder<'_, D>,
3781            offset: usize,
3782            _depth: fidl::encoding::Depth,
3783        ) -> fidl::Result<()> {
3784            encoder.debug_check_bounds::<CoordinatorIsCaptureSupportedResponse>(offset);
3785            // Delegate to tuple encoding.
3786            fidl::encoding::Encode::<CoordinatorIsCaptureSupportedResponse, D>::encode(
3787                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
3788                encoder,
3789                offset,
3790                _depth,
3791            )
3792        }
3793    }
3794    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3795        fidl::encoding::Encode<CoordinatorIsCaptureSupportedResponse, D> for (T0,)
3796    {
3797        #[inline]
3798        unsafe fn encode(
3799            self,
3800            encoder: &mut fidl::encoding::Encoder<'_, D>,
3801            offset: usize,
3802            depth: fidl::encoding::Depth,
3803        ) -> fidl::Result<()> {
3804            encoder.debug_check_bounds::<CoordinatorIsCaptureSupportedResponse>(offset);
3805            // Zero out padding regions. There's no need to apply masks
3806            // because the unmasked parts will be overwritten by fields.
3807            // Write the fields.
3808            self.0.encode(encoder, offset + 0, depth)?;
3809            Ok(())
3810        }
3811    }
3812
3813    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3814        for CoordinatorIsCaptureSupportedResponse
3815    {
3816        #[inline(always)]
3817        fn new_empty() -> Self {
3818            Self { supported: fidl::new_empty!(bool, D) }
3819        }
3820
3821        #[inline]
3822        unsafe fn decode(
3823            &mut self,
3824            decoder: &mut fidl::encoding::Decoder<'_, D>,
3825            offset: usize,
3826            _depth: fidl::encoding::Depth,
3827        ) -> fidl::Result<()> {
3828            decoder.debug_check_bounds::<Self>(offset);
3829            // Verify that padding bytes are zero.
3830            fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
3831            Ok(())
3832        }
3833    }
3834
3835    impl fidl::encoding::ValueTypeMarker for EventId {
3836        type Borrowed<'a> = &'a Self;
3837        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3838            value
3839        }
3840    }
3841
3842    unsafe impl fidl::encoding::TypeMarker for EventId {
3843        type Owned = Self;
3844
3845        #[inline(always)]
3846        fn inline_align(_context: fidl::encoding::Context) -> usize {
3847            8
3848        }
3849
3850        #[inline(always)]
3851        fn inline_size(_context: fidl::encoding::Context) -> usize {
3852            8
3853        }
3854        #[inline(always)]
3855        fn encode_is_copy() -> bool {
3856            true
3857        }
3858
3859        #[inline(always)]
3860        fn decode_is_copy() -> bool {
3861            true
3862        }
3863    }
3864
3865    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EventId, D> for &EventId {
3866        #[inline]
3867        unsafe fn encode(
3868            self,
3869            encoder: &mut fidl::encoding::Encoder<'_, D>,
3870            offset: usize,
3871            _depth: fidl::encoding::Depth,
3872        ) -> fidl::Result<()> {
3873            encoder.debug_check_bounds::<EventId>(offset);
3874            unsafe {
3875                // Copy the object into the buffer.
3876                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3877                (buf_ptr as *mut EventId).write_unaligned((self as *const EventId).read());
3878                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3879                // done second because the memcpy will write garbage to these bytes.
3880            }
3881            Ok(())
3882        }
3883    }
3884    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
3885        fidl::encoding::Encode<EventId, D> for (T0,)
3886    {
3887        #[inline]
3888        unsafe fn encode(
3889            self,
3890            encoder: &mut fidl::encoding::Encoder<'_, D>,
3891            offset: usize,
3892            depth: fidl::encoding::Depth,
3893        ) -> fidl::Result<()> {
3894            encoder.debug_check_bounds::<EventId>(offset);
3895            // Zero out padding regions. There's no need to apply masks
3896            // because the unmasked parts will be overwritten by fields.
3897            // Write the fields.
3898            self.0.encode(encoder, offset + 0, depth)?;
3899            Ok(())
3900        }
3901    }
3902
3903    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EventId {
3904        #[inline(always)]
3905        fn new_empty() -> Self {
3906            Self { value: fidl::new_empty!(u64, D) }
3907        }
3908
3909        #[inline]
3910        unsafe fn decode(
3911            &mut self,
3912            decoder: &mut fidl::encoding::Decoder<'_, D>,
3913            offset: usize,
3914            _depth: fidl::encoding::Depth,
3915        ) -> fidl::Result<()> {
3916            decoder.debug_check_bounds::<Self>(offset);
3917            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3918            // Verify that padding bytes are zero.
3919            // Copy from the buffer into the object.
3920            unsafe {
3921                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3922            }
3923            Ok(())
3924        }
3925    }
3926
3927    impl fidl::encoding::ValueTypeMarker for ImageId {
3928        type Borrowed<'a> = &'a Self;
3929        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3930            value
3931        }
3932    }
3933
3934    unsafe impl fidl::encoding::TypeMarker for ImageId {
3935        type Owned = Self;
3936
3937        #[inline(always)]
3938        fn inline_align(_context: fidl::encoding::Context) -> usize {
3939            8
3940        }
3941
3942        #[inline(always)]
3943        fn inline_size(_context: fidl::encoding::Context) -> usize {
3944            8
3945        }
3946        #[inline(always)]
3947        fn encode_is_copy() -> bool {
3948            true
3949        }
3950
3951        #[inline(always)]
3952        fn decode_is_copy() -> bool {
3953            true
3954        }
3955    }
3956
3957    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageId, D> for &ImageId {
3958        #[inline]
3959        unsafe fn encode(
3960            self,
3961            encoder: &mut fidl::encoding::Encoder<'_, D>,
3962            offset: usize,
3963            _depth: fidl::encoding::Depth,
3964        ) -> fidl::Result<()> {
3965            encoder.debug_check_bounds::<ImageId>(offset);
3966            unsafe {
3967                // Copy the object into the buffer.
3968                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3969                (buf_ptr as *mut ImageId).write_unaligned((self as *const ImageId).read());
3970                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3971                // done second because the memcpy will write garbage to these bytes.
3972            }
3973            Ok(())
3974        }
3975    }
3976    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
3977        fidl::encoding::Encode<ImageId, D> for (T0,)
3978    {
3979        #[inline]
3980        unsafe fn encode(
3981            self,
3982            encoder: &mut fidl::encoding::Encoder<'_, D>,
3983            offset: usize,
3984            depth: fidl::encoding::Depth,
3985        ) -> fidl::Result<()> {
3986            encoder.debug_check_bounds::<ImageId>(offset);
3987            // Zero out padding regions. There's no need to apply masks
3988            // because the unmasked parts will be overwritten by fields.
3989            // Write the fields.
3990            self.0.encode(encoder, offset + 0, depth)?;
3991            Ok(())
3992        }
3993    }
3994
3995    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageId {
3996        #[inline(always)]
3997        fn new_empty() -> Self {
3998            Self { value: fidl::new_empty!(u64, D) }
3999        }
4000
4001        #[inline]
4002        unsafe fn decode(
4003            &mut self,
4004            decoder: &mut fidl::encoding::Decoder<'_, D>,
4005            offset: usize,
4006            _depth: fidl::encoding::Depth,
4007        ) -> fidl::Result<()> {
4008            decoder.debug_check_bounds::<Self>(offset);
4009            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4010            // Verify that padding bytes are zero.
4011            // Copy from the buffer into the object.
4012            unsafe {
4013                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4014            }
4015            Ok(())
4016        }
4017    }
4018
4019    impl fidl::encoding::ValueTypeMarker for Info {
4020        type Borrowed<'a> = &'a Self;
4021        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4022            value
4023        }
4024    }
4025
4026    unsafe impl fidl::encoding::TypeMarker for Info {
4027        type Owned = Self;
4028
4029        #[inline(always)]
4030        fn inline_align(_context: fidl::encoding::Context) -> usize {
4031            8
4032        }
4033
4034        #[inline(always)]
4035        fn inline_size(_context: fidl::encoding::Context) -> usize {
4036            104
4037        }
4038    }
4039
4040    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Info, D> for &Info {
4041        #[inline]
4042        unsafe fn encode(
4043            self,
4044            encoder: &mut fidl::encoding::Encoder<'_, D>,
4045            offset: usize,
4046            _depth: fidl::encoding::Depth,
4047        ) -> fidl::Result<()> {
4048            encoder.debug_check_bounds::<Info>(offset);
4049            // Delegate to tuple encoding.
4050            fidl::encoding::Encode::<Info, D>::encode(
4051                (
4052                    <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
4053                    <fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types__common::Mode> as fidl::encoding::ValueTypeMarker>::borrow(&self.modes),
4054                    <fidl::encoding::UnboundedVector<fidl_fuchsia_images2__common::PixelFormat> as fidl::encoding::ValueTypeMarker>::borrow(&self.pixel_format),
4055                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.manufacturer_name),
4056                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.monitor_name),
4057                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.monitor_serial),
4058                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.horizontal_size_mm),
4059                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.vertical_size_mm),
4060                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.using_fallback_size),
4061                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.max_layer_count),
4062                ),
4063                encoder, offset, _depth
4064            )
4065        }
4066    }
4067    unsafe impl<
4068        D: fidl::encoding::ResourceDialect,
4069        T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
4070        T1: fidl::encoding::Encode<
4071                fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types__common::Mode>,
4072                D,
4073            >,
4074        T2: fidl::encoding::Encode<
4075                fidl::encoding::UnboundedVector<fidl_fuchsia_images2__common::PixelFormat>,
4076                D,
4077            >,
4078        T3: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
4079        T4: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
4080        T5: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
4081        T6: fidl::encoding::Encode<u32, D>,
4082        T7: fidl::encoding::Encode<u32, D>,
4083        T8: fidl::encoding::Encode<bool, D>,
4084        T9: fidl::encoding::Encode<u32, D>,
4085    > fidl::encoding::Encode<Info, D> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
4086    {
4087        #[inline]
4088        unsafe fn encode(
4089            self,
4090            encoder: &mut fidl::encoding::Encoder<'_, D>,
4091            offset: usize,
4092            depth: fidl::encoding::Depth,
4093        ) -> fidl::Result<()> {
4094            encoder.debug_check_bounds::<Info>(offset);
4095            // Zero out padding regions. There's no need to apply masks
4096            // because the unmasked parts will be overwritten by fields.
4097            unsafe {
4098                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(96);
4099                (ptr as *mut u64).write_unaligned(0);
4100            }
4101            // Write the fields.
4102            self.0.encode(encoder, offset + 0, depth)?;
4103            self.1.encode(encoder, offset + 8, depth)?;
4104            self.2.encode(encoder, offset + 24, depth)?;
4105            self.3.encode(encoder, offset + 40, depth)?;
4106            self.4.encode(encoder, offset + 56, depth)?;
4107            self.5.encode(encoder, offset + 72, depth)?;
4108            self.6.encode(encoder, offset + 88, depth)?;
4109            self.7.encode(encoder, offset + 92, depth)?;
4110            self.8.encode(encoder, offset + 96, depth)?;
4111            self.9.encode(encoder, offset + 100, depth)?;
4112            Ok(())
4113        }
4114    }
4115
4116    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Info {
4117        #[inline(always)]
4118        fn new_empty() -> Self {
4119            Self {
4120                id: fidl::new_empty!(fidl_fuchsia_hardware_display_types__common::DisplayId, D),
4121                modes: fidl::new_empty!(
4122                    fidl::encoding::UnboundedVector<
4123                        fidl_fuchsia_hardware_display_types__common::Mode,
4124                    >,
4125                    D
4126                ),
4127                pixel_format: fidl::new_empty!(
4128                    fidl::encoding::UnboundedVector<fidl_fuchsia_images2__common::PixelFormat>,
4129                    D
4130                ),
4131                manufacturer_name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
4132                monitor_name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
4133                monitor_serial: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
4134                horizontal_size_mm: fidl::new_empty!(u32, D),
4135                vertical_size_mm: fidl::new_empty!(u32, D),
4136                using_fallback_size: fidl::new_empty!(bool, D),
4137                max_layer_count: fidl::new_empty!(u32, D),
4138            }
4139        }
4140
4141        #[inline]
4142        unsafe fn decode(
4143            &mut self,
4144            decoder: &mut fidl::encoding::Decoder<'_, D>,
4145            offset: usize,
4146            _depth: fidl::encoding::Depth,
4147        ) -> fidl::Result<()> {
4148            decoder.debug_check_bounds::<Self>(offset);
4149            // Verify that padding bytes are zero.
4150            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(96) };
4151            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4152            let mask = 0xffffff00u64;
4153            let maskedval = padval & mask;
4154            if maskedval != 0 {
4155                return Err(fidl::Error::NonZeroPadding {
4156                    padding_start: offset + 96 + ((mask as u64).trailing_zeros() / 8) as usize,
4157                });
4158            }
4159            fidl::decode!(
4160                fidl_fuchsia_hardware_display_types__common::DisplayId,
4161                D,
4162                &mut self.id,
4163                decoder,
4164                offset + 0,
4165                _depth
4166            )?;
4167            fidl::decode!(
4168                fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types__common::Mode>,
4169                D,
4170                &mut self.modes,
4171                decoder,
4172                offset + 8,
4173                _depth
4174            )?;
4175            fidl::decode!(
4176                fidl::encoding::UnboundedVector<fidl_fuchsia_images2__common::PixelFormat>,
4177                D,
4178                &mut self.pixel_format,
4179                decoder,
4180                offset + 24,
4181                _depth
4182            )?;
4183            fidl::decode!(
4184                fidl::encoding::BoundedString<128>,
4185                D,
4186                &mut self.manufacturer_name,
4187                decoder,
4188                offset + 40,
4189                _depth
4190            )?;
4191            fidl::decode!(
4192                fidl::encoding::BoundedString<128>,
4193                D,
4194                &mut self.monitor_name,
4195                decoder,
4196                offset + 56,
4197                _depth
4198            )?;
4199            fidl::decode!(
4200                fidl::encoding::BoundedString<128>,
4201                D,
4202                &mut self.monitor_serial,
4203                decoder,
4204                offset + 72,
4205                _depth
4206            )?;
4207            fidl::decode!(u32, D, &mut self.horizontal_size_mm, decoder, offset + 88, _depth)?;
4208            fidl::decode!(u32, D, &mut self.vertical_size_mm, decoder, offset + 92, _depth)?;
4209            fidl::decode!(bool, D, &mut self.using_fallback_size, decoder, offset + 96, _depth)?;
4210            fidl::decode!(u32, D, &mut self.max_layer_count, decoder, offset + 100, _depth)?;
4211            Ok(())
4212        }
4213    }
4214
4215    impl fidl::encoding::ValueTypeMarker for LayerId {
4216        type Borrowed<'a> = &'a Self;
4217        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4218            value
4219        }
4220    }
4221
4222    unsafe impl fidl::encoding::TypeMarker for LayerId {
4223        type Owned = Self;
4224
4225        #[inline(always)]
4226        fn inline_align(_context: fidl::encoding::Context) -> usize {
4227            8
4228        }
4229
4230        #[inline(always)]
4231        fn inline_size(_context: fidl::encoding::Context) -> usize {
4232            8
4233        }
4234        #[inline(always)]
4235        fn encode_is_copy() -> bool {
4236            true
4237        }
4238
4239        #[inline(always)]
4240        fn decode_is_copy() -> bool {
4241            true
4242        }
4243    }
4244
4245    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayerId, D> for &LayerId {
4246        #[inline]
4247        unsafe fn encode(
4248            self,
4249            encoder: &mut fidl::encoding::Encoder<'_, D>,
4250            offset: usize,
4251            _depth: fidl::encoding::Depth,
4252        ) -> fidl::Result<()> {
4253            encoder.debug_check_bounds::<LayerId>(offset);
4254            unsafe {
4255                // Copy the object into the buffer.
4256                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4257                (buf_ptr as *mut LayerId).write_unaligned((self as *const LayerId).read());
4258                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4259                // done second because the memcpy will write garbage to these bytes.
4260            }
4261            Ok(())
4262        }
4263    }
4264    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4265        fidl::encoding::Encode<LayerId, D> for (T0,)
4266    {
4267        #[inline]
4268        unsafe fn encode(
4269            self,
4270            encoder: &mut fidl::encoding::Encoder<'_, D>,
4271            offset: usize,
4272            depth: fidl::encoding::Depth,
4273        ) -> fidl::Result<()> {
4274            encoder.debug_check_bounds::<LayerId>(offset);
4275            // Zero out padding regions. There's no need to apply masks
4276            // because the unmasked parts will be overwritten by fields.
4277            // Write the fields.
4278            self.0.encode(encoder, offset + 0, depth)?;
4279            Ok(())
4280        }
4281    }
4282
4283    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayerId {
4284        #[inline(always)]
4285        fn new_empty() -> Self {
4286            Self { value: fidl::new_empty!(u64, D) }
4287        }
4288
4289        #[inline]
4290        unsafe fn decode(
4291            &mut self,
4292            decoder: &mut fidl::encoding::Decoder<'_, D>,
4293            offset: usize,
4294            _depth: fidl::encoding::Depth,
4295        ) -> fidl::Result<()> {
4296            decoder.debug_check_bounds::<Self>(offset);
4297            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4298            // Verify that padding bytes are zero.
4299            // Copy from the buffer into the object.
4300            unsafe {
4301                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4302            }
4303            Ok(())
4304        }
4305    }
4306
4307    impl fidl::encoding::ValueTypeMarker for VsyncAckCookie {
4308        type Borrowed<'a> = &'a Self;
4309        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4310            value
4311        }
4312    }
4313
4314    unsafe impl fidl::encoding::TypeMarker for VsyncAckCookie {
4315        type Owned = Self;
4316
4317        #[inline(always)]
4318        fn inline_align(_context: fidl::encoding::Context) -> usize {
4319            8
4320        }
4321
4322        #[inline(always)]
4323        fn inline_size(_context: fidl::encoding::Context) -> usize {
4324            8
4325        }
4326        #[inline(always)]
4327        fn encode_is_copy() -> bool {
4328            true
4329        }
4330
4331        #[inline(always)]
4332        fn decode_is_copy() -> bool {
4333            true
4334        }
4335    }
4336
4337    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VsyncAckCookie, D>
4338        for &VsyncAckCookie
4339    {
4340        #[inline]
4341        unsafe fn encode(
4342            self,
4343            encoder: &mut fidl::encoding::Encoder<'_, D>,
4344            offset: usize,
4345            _depth: fidl::encoding::Depth,
4346        ) -> fidl::Result<()> {
4347            encoder.debug_check_bounds::<VsyncAckCookie>(offset);
4348            unsafe {
4349                // Copy the object into the buffer.
4350                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4351                (buf_ptr as *mut VsyncAckCookie)
4352                    .write_unaligned((self as *const VsyncAckCookie).read());
4353                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4354                // done second because the memcpy will write garbage to these bytes.
4355            }
4356            Ok(())
4357        }
4358    }
4359    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4360        fidl::encoding::Encode<VsyncAckCookie, D> for (T0,)
4361    {
4362        #[inline]
4363        unsafe fn encode(
4364            self,
4365            encoder: &mut fidl::encoding::Encoder<'_, D>,
4366            offset: usize,
4367            depth: fidl::encoding::Depth,
4368        ) -> fidl::Result<()> {
4369            encoder.debug_check_bounds::<VsyncAckCookie>(offset);
4370            // Zero out padding regions. There's no need to apply masks
4371            // because the unmasked parts will be overwritten by fields.
4372            // Write the fields.
4373            self.0.encode(encoder, offset + 0, depth)?;
4374            Ok(())
4375        }
4376    }
4377
4378    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VsyncAckCookie {
4379        #[inline(always)]
4380        fn new_empty() -> Self {
4381            Self { value: fidl::new_empty!(u64, D) }
4382        }
4383
4384        #[inline]
4385        unsafe fn decode(
4386            &mut self,
4387            decoder: &mut fidl::encoding::Decoder<'_, D>,
4388            offset: usize,
4389            _depth: fidl::encoding::Depth,
4390        ) -> fidl::Result<()> {
4391            decoder.debug_check_bounds::<Self>(offset);
4392            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4393            // Verify that padding bytes are zero.
4394            // Copy from the buffer into the object.
4395            unsafe {
4396                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4397            }
4398            Ok(())
4399        }
4400    }
4401}