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