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