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