1#![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
11pub type BufferCollectionIdValue = u64;
13
14pub type ConfigStampValue = u64;
16
17pub type EventIdValue = u64;
19
20pub type ImageIdValue = u64;
22
23pub type LayerIdValue = u64;
25
26pub type VsyncAckCookieValue = u64;
28
29pub const IDENTIFIER_MAX_LEN: u32 = 128;
30
31pub const INVALID_CONFIG_STAMP_VALUE: u64 = 0;
32
33pub 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 Fallback = 0,
41 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#[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#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
100#[repr(C)]
101pub struct ConfigStamp {
102 pub value: u64,
103}
104
105impl fidl::Persistable for ConfigStamp {}
106
107#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
108#[repr(C)]
109pub struct CoordinatorAcknowledgeVsyncRequest {
110 pub cookie: u64,
117}
118
119impl fidl::Persistable for CoordinatorAcknowledgeVsyncRequest {}
120
121#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
122pub struct CoordinatorCheckConfigResponse {
123 pub res: fidl_fuchsia_hardware_display_types__common::ConfigResult,
124}
125
126impl fidl::Persistable for CoordinatorCheckConfigResponse {}
127
128#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
129#[repr(C)]
130pub struct CoordinatorDestroyLayerRequest {
131 pub layer_id: LayerId,
132}
133
134impl fidl::Persistable for CoordinatorDestroyLayerRequest {}
135
136#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
137#[repr(C)]
138pub struct CoordinatorGetLatestAppliedConfigStampResponse {
139 pub stamp: ConfigStamp,
140}
141
142impl fidl::Persistable for CoordinatorGetLatestAppliedConfigStampResponse {}
143
144#[derive(Clone, Debug, PartialEq)]
145pub struct CoordinatorImportImageRequest {
146 pub image_metadata: fidl_fuchsia_hardware_display_types__common::ImageMetadata,
150 pub buffer_collection_id: BufferCollectionId,
155 pub buffer_index: u32,
157 pub image_id: ImageId,
158}
159
160impl fidl::Persistable for CoordinatorImportImageRequest {}
161
162#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
163pub struct CoordinatorListenerOnClientOwnershipChangeRequest {
164 pub has_ownership: bool,
165}
166
167impl fidl::Persistable for CoordinatorListenerOnClientOwnershipChangeRequest {}
168
169#[derive(Clone, Debug, PartialEq)]
170pub struct CoordinatorListenerOnDisplaysChangedRequest {
171 pub added: Vec<Info>,
172 pub removed: Vec<fidl_fuchsia_hardware_display_types__common::DisplayId>,
173}
174
175impl fidl::Persistable for CoordinatorListenerOnDisplaysChangedRequest {}
176
177#[derive(Clone, Debug, PartialEq)]
178pub struct CoordinatorListenerOnVsyncRequest {
179 pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
181 pub timestamp: fidl::MonotonicInstant,
185 pub applied_config_stamp: ConfigStamp,
194 pub cookie: VsyncAckCookie,
203}
204
205impl fidl::Persistable for CoordinatorListenerOnVsyncRequest {}
206
207#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
208#[repr(C)]
209pub struct CoordinatorReleaseBufferCollectionRequest {
210 pub buffer_collection_id: BufferCollectionId,
211}
212
213impl fidl::Persistable for CoordinatorReleaseBufferCollectionRequest {}
214
215#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
216#[repr(C)]
217pub struct CoordinatorReleaseEventRequest {
218 pub id: EventId,
219}
220
221impl fidl::Persistable for CoordinatorReleaseEventRequest {}
222
223#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
224#[repr(C)]
225pub struct CoordinatorReleaseImageRequest {
226 pub image_id: ImageId,
227}
228
229impl fidl::Persistable for CoordinatorReleaseImageRequest {}
230
231#[derive(Clone, Debug, PartialEq)]
232pub struct CoordinatorSetBufferCollectionConstraintsRequest {
233 pub buffer_collection_id: BufferCollectionId,
234 pub buffer_usage: fidl_fuchsia_hardware_display_types__common::ImageBufferUsage,
235}
236
237impl fidl::Persistable for CoordinatorSetBufferCollectionConstraintsRequest {}
238
239#[derive(Clone, Debug, PartialEq)]
240pub struct CoordinatorSetDisplayColorConversionRequest {
241 pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
248 pub preoffsets: [f32; 3],
249 pub coefficients: [f32; 9],
250 pub postoffsets: [f32; 3],
251}
252
253impl fidl::Persistable for CoordinatorSetDisplayColorConversionRequest {}
254
255#[derive(Clone, Debug, PartialEq)]
256pub struct CoordinatorSetDisplayLayersRequest {
257 pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
264 pub layer_ids: Vec<LayerId>,
265}
266
267impl fidl::Persistable for CoordinatorSetDisplayLayersRequest {}
268
269#[derive(Clone, Debug, PartialEq)]
270pub struct CoordinatorSetDisplayModeRequest {
271 pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
278 pub mode: fidl_fuchsia_hardware_display_types__common::Mode,
282}
283
284impl fidl::Persistable for CoordinatorSetDisplayModeRequest {}
285
286#[derive(Clone, Debug, PartialEq)]
287pub struct CoordinatorSetDisplayPowerRequest {
288 pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
289 pub power_on: bool,
306}
307
308impl fidl::Persistable for CoordinatorSetDisplayPowerRequest {}
309
310#[derive(Clone, Debug, PartialEq)]
311pub struct CoordinatorSetLayerColorConfigRequest {
312 pub layer_id: LayerId,
313 pub color: fidl_fuchsia_hardware_display_types__common::Color,
314 pub display_destination: fidl_fuchsia_math__common::RectU,
323}
324
325impl fidl::Persistable for CoordinatorSetLayerColorConfigRequest {}
326
327#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
328#[repr(C)]
329pub struct CoordinatorSetLayerImage2Request {
330 pub layer_id: LayerId,
331 pub image_id: ImageId,
332 pub wait_event_id: EventId,
333}
334
335impl fidl::Persistable for CoordinatorSetLayerImage2Request {}
336
337#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
338pub struct CoordinatorSetLayerPrimaryAlphaRequest {
339 pub layer_id: LayerId,
340 pub mode: fidl_fuchsia_hardware_display_types__common::AlphaMode,
341 pub val: f32,
342}
343
344impl fidl::Persistable for CoordinatorSetLayerPrimaryAlphaRequest {}
345
346#[derive(Clone, Debug, PartialEq)]
347pub struct CoordinatorSetLayerPrimaryConfigRequest {
348 pub layer_id: LayerId,
349 pub image_metadata: fidl_fuchsia_hardware_display_types__common::ImageMetadata,
350}
351
352impl fidl::Persistable for CoordinatorSetLayerPrimaryConfigRequest {}
353
354#[derive(Clone, Debug, PartialEq)]
355pub struct CoordinatorSetLayerPrimaryPositionRequest {
356 pub layer_id: LayerId,
357 pub image_source_transformation:
364 fidl_fuchsia_hardware_display_types__common::CoordinateTransformation,
365 pub image_source: fidl_fuchsia_math__common::RectU,
378 pub display_destination: fidl_fuchsia_math__common::RectU,
392}
393
394impl fidl::Persistable for CoordinatorSetLayerPrimaryPositionRequest {}
395
396#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
397#[repr(C)]
398pub struct CoordinatorSetMinimumRgbRequest {
399 pub minimum_rgb: u8,
400}
401
402impl fidl::Persistable for CoordinatorSetMinimumRgbRequest {}
403
404#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
405pub struct CoordinatorSetVirtconModeRequest {
406 pub mode: VirtconMode,
407}
408
409impl fidl::Persistable for CoordinatorSetVirtconModeRequest {}
410
411#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
412pub struct CoordinatorSetVsyncEventDeliveryRequest {
413 pub vsync_delivery_enabled: bool,
415}
416
417impl fidl::Persistable for CoordinatorSetVsyncEventDeliveryRequest {}
418
419#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
420#[repr(C)]
421pub struct CoordinatorStartCaptureRequest {
422 pub signal_event_id: EventId,
423 pub image_id: ImageId,
424}
425
426impl fidl::Persistable for CoordinatorStartCaptureRequest {}
427
428#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
429#[repr(C)]
430pub struct CoordinatorCreateLayerResponse {
431 pub layer_id: LayerId,
432}
433
434impl fidl::Persistable for CoordinatorCreateLayerResponse {}
435
436#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
437pub struct CoordinatorIsCaptureSupportedResponse {
438 pub supported: bool,
439}
440
441impl fidl::Persistable for CoordinatorIsCaptureSupportedResponse {}
442
443#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
455#[repr(C)]
456pub struct EventId {
457 pub value: u64,
458}
459
460impl fidl::Persistable for EventId {}
461
462#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
481#[repr(C)]
482pub struct ImageId {
483 pub value: u64,
484}
485
486impl fidl::Persistable for ImageId {}
487
488#[derive(Clone, Debug, PartialEq)]
492pub struct Info {
493 pub id: fidl_fuchsia_hardware_display_types__common::DisplayId,
497 pub modes: Vec<fidl_fuchsia_hardware_display_types__common::Mode>,
501 pub pixel_format: Vec<fidl_fuchsia_images2__common::PixelFormat>,
522 pub manufacturer_name: String,
530 pub monitor_name: String,
534 pub monitor_serial: String,
538 pub horizontal_size_mm: u32,
543 pub vertical_size_mm: u32,
547 pub using_fallback_size: bool,
549}
550
551impl fidl::Persistable for Info {}
552
553#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
566#[repr(C)]
567pub struct LayerId {
568 pub value: u64,
569}
570
571impl fidl::Persistable for LayerId {}
572
573#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
579#[repr(C)]
580pub struct VsyncAckCookie {
581 pub value: u64,
582}
583
584impl fidl::Persistable for VsyncAckCookie {}
585
586pub mod coordinator_ordinals {
587 pub const IMPORT_IMAGE: u64 = 0x3a8636eb9656b4f4;
588 pub const RELEASE_IMAGE: u64 = 0x477192230517504;
589 pub const IMPORT_EVENT: u64 = 0x2864e5dc59390543;
590 pub const RELEASE_EVENT: u64 = 0x32508c2101606b87;
591 pub const CREATE_LAYER: u64 = 0x2137cfd788a3496b;
592 pub const DESTROY_LAYER: u64 = 0x386e12d092bea2f8;
593 pub const SET_DISPLAY_MODE: u64 = 0xbde3c59ee9c1777;
594 pub const SET_DISPLAY_COLOR_CONVERSION: u64 = 0x2f18186a987d51aa;
595 pub const SET_DISPLAY_LAYERS: u64 = 0x190e0f6f93be1d89;
596 pub const SET_LAYER_PRIMARY_CONFIG: u64 = 0x68d89ebd518b45b9;
597 pub const SET_LAYER_PRIMARY_POSITION: u64 = 0x27b192b5a43851e2;
598 pub const SET_LAYER_PRIMARY_ALPHA: u64 = 0x104cf2b18b27296d;
599 pub const SET_LAYER_COLOR_CONFIG: u64 = 0x2fa91e9a2a01875f;
600 pub const SET_LAYER_IMAGE2: u64 = 0x53c6376dfc13a971;
601 pub const CHECK_CONFIG: u64 = 0x2bcfb4eb16878158;
602 pub const DISCARD_CONFIG: u64 = 0x1673399e9231dedf;
603 pub const GET_LATEST_APPLIED_CONFIG_STAMP: u64 = 0x76a50c0537265f65;
604 pub const APPLY_CONFIG3: u64 = 0x7f0fe0e4f062a67e;
605 pub const SET_VSYNC_EVENT_DELIVERY: u64 = 0x740b91a9ab2ef440;
606 pub const ACKNOWLEDGE_VSYNC: u64 = 0x25e921d26107d6ef;
607 pub const SET_VIRTCON_MODE: u64 = 0x4fe0721526068f00;
608 pub const IMPORT_BUFFER_COLLECTION: u64 = 0x30d06f510e7f4601;
609 pub const RELEASE_BUFFER_COLLECTION: u64 = 0x1c7dd5f8b0690be0;
610 pub const SET_BUFFER_COLLECTION_CONSTRAINTS: u64 = 0x509a4ee9af6035df;
611 pub const IS_CAPTURE_SUPPORTED: u64 = 0x4ca407277277971b;
612 pub const START_CAPTURE: u64 = 0x35cb38f19d96a8db;
613 pub const SET_MINIMUM_RGB: u64 = 0x1b49251437038b0b;
614 pub const SET_DISPLAY_POWER: u64 = 0x10feb62d11d9e92b;
615}
616
617pub mod coordinator_listener_ordinals {
618 pub const ON_DISPLAYS_CHANGED: u64 = 0x248fbe90c338a94f;
619 pub const ON_VSYNC: u64 = 0x249e9b8da7a7ac47;
620 pub const ON_CLIENT_OWNERSHIP_CHANGE: u64 = 0x1acd2ae683153d5e;
621}
622
623pub mod provider_ordinals {
624 pub const OPEN_COORDINATOR_WITH_LISTENER_FOR_VIRTCON: u64 = 0x154ac672633d9ec7;
625 pub const OPEN_COORDINATOR_WITH_LISTENER_FOR_PRIMARY: u64 = 0x635b6087ce4f6bfa;
626}
627
628mod internal {
629 use super::*;
630 unsafe impl fidl::encoding::TypeMarker for VirtconMode {
631 type Owned = Self;
632
633 #[inline(always)]
634 fn inline_align(_context: fidl::encoding::Context) -> usize {
635 std::mem::align_of::<u8>()
636 }
637
638 #[inline(always)]
639 fn inline_size(_context: fidl::encoding::Context) -> usize {
640 std::mem::size_of::<u8>()
641 }
642
643 #[inline(always)]
644 fn encode_is_copy() -> bool {
645 true
646 }
647
648 #[inline(always)]
649 fn decode_is_copy() -> bool {
650 false
651 }
652 }
653
654 impl fidl::encoding::ValueTypeMarker for VirtconMode {
655 type Borrowed<'a> = Self;
656 #[inline(always)]
657 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
658 *value
659 }
660 }
661
662 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for VirtconMode {
663 #[inline]
664 unsafe fn encode(
665 self,
666 encoder: &mut fidl::encoding::Encoder<'_, D>,
667 offset: usize,
668 _depth: fidl::encoding::Depth,
669 ) -> fidl::Result<()> {
670 encoder.debug_check_bounds::<Self>(offset);
671 encoder.write_num(self.into_primitive(), offset);
672 Ok(())
673 }
674 }
675
676 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VirtconMode {
677 #[inline(always)]
678 fn new_empty() -> Self {
679 Self::Fallback
680 }
681
682 #[inline]
683 unsafe fn decode(
684 &mut self,
685 decoder: &mut fidl::encoding::Decoder<'_, D>,
686 offset: usize,
687 _depth: fidl::encoding::Depth,
688 ) -> fidl::Result<()> {
689 decoder.debug_check_bounds::<Self>(offset);
690 let prim = decoder.read_num::<u8>(offset);
691
692 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
693 Ok(())
694 }
695 }
696
697 impl fidl::encoding::ValueTypeMarker for BufferCollectionId {
698 type Borrowed<'a> = &'a Self;
699 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
700 value
701 }
702 }
703
704 unsafe impl fidl::encoding::TypeMarker for BufferCollectionId {
705 type Owned = Self;
706
707 #[inline(always)]
708 fn inline_align(_context: fidl::encoding::Context) -> usize {
709 8
710 }
711
712 #[inline(always)]
713 fn inline_size(_context: fidl::encoding::Context) -> usize {
714 8
715 }
716 #[inline(always)]
717 fn encode_is_copy() -> bool {
718 true
719 }
720
721 #[inline(always)]
722 fn decode_is_copy() -> bool {
723 true
724 }
725 }
726
727 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BufferCollectionId, D>
728 for &BufferCollectionId
729 {
730 #[inline]
731 unsafe fn encode(
732 self,
733 encoder: &mut fidl::encoding::Encoder<'_, D>,
734 offset: usize,
735 _depth: fidl::encoding::Depth,
736 ) -> fidl::Result<()> {
737 encoder.debug_check_bounds::<BufferCollectionId>(offset);
738 unsafe {
739 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
741 (buf_ptr as *mut BufferCollectionId)
742 .write_unaligned((self as *const BufferCollectionId).read());
743 }
746 Ok(())
747 }
748 }
749 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
750 fidl::encoding::Encode<BufferCollectionId, D> for (T0,)
751 {
752 #[inline]
753 unsafe fn encode(
754 self,
755 encoder: &mut fidl::encoding::Encoder<'_, D>,
756 offset: usize,
757 depth: fidl::encoding::Depth,
758 ) -> fidl::Result<()> {
759 encoder.debug_check_bounds::<BufferCollectionId>(offset);
760 self.0.encode(encoder, offset + 0, depth)?;
764 Ok(())
765 }
766 }
767
768 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BufferCollectionId {
769 #[inline(always)]
770 fn new_empty() -> Self {
771 Self { value: fidl::new_empty!(u64, D) }
772 }
773
774 #[inline]
775 unsafe fn decode(
776 &mut self,
777 decoder: &mut fidl::encoding::Decoder<'_, D>,
778 offset: usize,
779 _depth: fidl::encoding::Depth,
780 ) -> fidl::Result<()> {
781 decoder.debug_check_bounds::<Self>(offset);
782 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
783 unsafe {
786 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
787 }
788 Ok(())
789 }
790 }
791
792 impl fidl::encoding::ValueTypeMarker for ConfigStamp {
793 type Borrowed<'a> = &'a Self;
794 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
795 value
796 }
797 }
798
799 unsafe impl fidl::encoding::TypeMarker for ConfigStamp {
800 type Owned = Self;
801
802 #[inline(always)]
803 fn inline_align(_context: fidl::encoding::Context) -> usize {
804 8
805 }
806
807 #[inline(always)]
808 fn inline_size(_context: fidl::encoding::Context) -> usize {
809 8
810 }
811 #[inline(always)]
812 fn encode_is_copy() -> bool {
813 true
814 }
815
816 #[inline(always)]
817 fn decode_is_copy() -> bool {
818 true
819 }
820 }
821
822 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ConfigStamp, D>
823 for &ConfigStamp
824 {
825 #[inline]
826 unsafe fn encode(
827 self,
828 encoder: &mut fidl::encoding::Encoder<'_, D>,
829 offset: usize,
830 _depth: fidl::encoding::Depth,
831 ) -> fidl::Result<()> {
832 encoder.debug_check_bounds::<ConfigStamp>(offset);
833 unsafe {
834 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
836 (buf_ptr as *mut ConfigStamp).write_unaligned((self as *const ConfigStamp).read());
837 }
840 Ok(())
841 }
842 }
843 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
844 fidl::encoding::Encode<ConfigStamp, D> for (T0,)
845 {
846 #[inline]
847 unsafe fn encode(
848 self,
849 encoder: &mut fidl::encoding::Encoder<'_, D>,
850 offset: usize,
851 depth: fidl::encoding::Depth,
852 ) -> fidl::Result<()> {
853 encoder.debug_check_bounds::<ConfigStamp>(offset);
854 self.0.encode(encoder, offset + 0, depth)?;
858 Ok(())
859 }
860 }
861
862 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ConfigStamp {
863 #[inline(always)]
864 fn new_empty() -> Self {
865 Self { value: fidl::new_empty!(u64, D) }
866 }
867
868 #[inline]
869 unsafe fn decode(
870 &mut self,
871 decoder: &mut fidl::encoding::Decoder<'_, D>,
872 offset: usize,
873 _depth: fidl::encoding::Depth,
874 ) -> fidl::Result<()> {
875 decoder.debug_check_bounds::<Self>(offset);
876 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
877 unsafe {
880 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
881 }
882 Ok(())
883 }
884 }
885
886 impl fidl::encoding::ValueTypeMarker for CoordinatorAcknowledgeVsyncRequest {
887 type Borrowed<'a> = &'a Self;
888 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
889 value
890 }
891 }
892
893 unsafe impl fidl::encoding::TypeMarker for CoordinatorAcknowledgeVsyncRequest {
894 type Owned = Self;
895
896 #[inline(always)]
897 fn inline_align(_context: fidl::encoding::Context) -> usize {
898 8
899 }
900
901 #[inline(always)]
902 fn inline_size(_context: fidl::encoding::Context) -> usize {
903 8
904 }
905 #[inline(always)]
906 fn encode_is_copy() -> bool {
907 true
908 }
909
910 #[inline(always)]
911 fn decode_is_copy() -> bool {
912 true
913 }
914 }
915
916 unsafe impl<D: fidl::encoding::ResourceDialect>
917 fidl::encoding::Encode<CoordinatorAcknowledgeVsyncRequest, D>
918 for &CoordinatorAcknowledgeVsyncRequest
919 {
920 #[inline]
921 unsafe fn encode(
922 self,
923 encoder: &mut fidl::encoding::Encoder<'_, D>,
924 offset: usize,
925 _depth: fidl::encoding::Depth,
926 ) -> fidl::Result<()> {
927 encoder.debug_check_bounds::<CoordinatorAcknowledgeVsyncRequest>(offset);
928 unsafe {
929 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
931 (buf_ptr as *mut CoordinatorAcknowledgeVsyncRequest)
932 .write_unaligned((self as *const CoordinatorAcknowledgeVsyncRequest).read());
933 }
936 Ok(())
937 }
938 }
939 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
940 fidl::encoding::Encode<CoordinatorAcknowledgeVsyncRequest, D> for (T0,)
941 {
942 #[inline]
943 unsafe fn encode(
944 self,
945 encoder: &mut fidl::encoding::Encoder<'_, D>,
946 offset: usize,
947 depth: fidl::encoding::Depth,
948 ) -> fidl::Result<()> {
949 encoder.debug_check_bounds::<CoordinatorAcknowledgeVsyncRequest>(offset);
950 self.0.encode(encoder, offset + 0, depth)?;
954 Ok(())
955 }
956 }
957
958 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
959 for CoordinatorAcknowledgeVsyncRequest
960 {
961 #[inline(always)]
962 fn new_empty() -> Self {
963 Self { cookie: fidl::new_empty!(u64, D) }
964 }
965
966 #[inline]
967 unsafe fn decode(
968 &mut self,
969 decoder: &mut fidl::encoding::Decoder<'_, D>,
970 offset: usize,
971 _depth: fidl::encoding::Depth,
972 ) -> fidl::Result<()> {
973 decoder.debug_check_bounds::<Self>(offset);
974 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
975 unsafe {
978 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
979 }
980 Ok(())
981 }
982 }
983
984 impl fidl::encoding::ValueTypeMarker for CoordinatorCheckConfigResponse {
985 type Borrowed<'a> = &'a Self;
986 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
987 value
988 }
989 }
990
991 unsafe impl fidl::encoding::TypeMarker for CoordinatorCheckConfigResponse {
992 type Owned = Self;
993
994 #[inline(always)]
995 fn inline_align(_context: fidl::encoding::Context) -> usize {
996 4
997 }
998
999 #[inline(always)]
1000 fn inline_size(_context: fidl::encoding::Context) -> usize {
1001 4
1002 }
1003 }
1004
1005 unsafe impl<D: fidl::encoding::ResourceDialect>
1006 fidl::encoding::Encode<CoordinatorCheckConfigResponse, D>
1007 for &CoordinatorCheckConfigResponse
1008 {
1009 #[inline]
1010 unsafe fn encode(
1011 self,
1012 encoder: &mut fidl::encoding::Encoder<'_, D>,
1013 offset: usize,
1014 _depth: fidl::encoding::Depth,
1015 ) -> fidl::Result<()> {
1016 encoder.debug_check_bounds::<CoordinatorCheckConfigResponse>(offset);
1017 fidl::encoding::Encode::<CoordinatorCheckConfigResponse, D>::encode(
1019 (
1020 <fidl_fuchsia_hardware_display_types__common::ConfigResult as fidl::encoding::ValueTypeMarker>::borrow(&self.res),
1021 ),
1022 encoder, offset, _depth
1023 )
1024 }
1025 }
1026 unsafe impl<
1027 D: fidl::encoding::ResourceDialect,
1028 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::ConfigResult, D>,
1029 > fidl::encoding::Encode<CoordinatorCheckConfigResponse, D> for (T0,)
1030 {
1031 #[inline]
1032 unsafe fn encode(
1033 self,
1034 encoder: &mut fidl::encoding::Encoder<'_, D>,
1035 offset: usize,
1036 depth: fidl::encoding::Depth,
1037 ) -> fidl::Result<()> {
1038 encoder.debug_check_bounds::<CoordinatorCheckConfigResponse>(offset);
1039 self.0.encode(encoder, offset + 0, depth)?;
1043 Ok(())
1044 }
1045 }
1046
1047 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1048 for CoordinatorCheckConfigResponse
1049 {
1050 #[inline(always)]
1051 fn new_empty() -> Self {
1052 Self {
1053 res: fidl::new_empty!(fidl_fuchsia_hardware_display_types__common::ConfigResult, D),
1054 }
1055 }
1056
1057 #[inline]
1058 unsafe fn decode(
1059 &mut self,
1060 decoder: &mut fidl::encoding::Decoder<'_, D>,
1061 offset: usize,
1062 _depth: fidl::encoding::Depth,
1063 ) -> fidl::Result<()> {
1064 decoder.debug_check_bounds::<Self>(offset);
1065 fidl::decode!(
1067 fidl_fuchsia_hardware_display_types__common::ConfigResult,
1068 D,
1069 &mut self.res,
1070 decoder,
1071 offset + 0,
1072 _depth
1073 )?;
1074 Ok(())
1075 }
1076 }
1077
1078 impl fidl::encoding::ValueTypeMarker for CoordinatorDestroyLayerRequest {
1079 type Borrowed<'a> = &'a Self;
1080 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1081 value
1082 }
1083 }
1084
1085 unsafe impl fidl::encoding::TypeMarker for CoordinatorDestroyLayerRequest {
1086 type Owned = Self;
1087
1088 #[inline(always)]
1089 fn inline_align(_context: fidl::encoding::Context) -> usize {
1090 8
1091 }
1092
1093 #[inline(always)]
1094 fn inline_size(_context: fidl::encoding::Context) -> usize {
1095 8
1096 }
1097 #[inline(always)]
1098 fn encode_is_copy() -> bool {
1099 true
1100 }
1101
1102 #[inline(always)]
1103 fn decode_is_copy() -> bool {
1104 true
1105 }
1106 }
1107
1108 unsafe impl<D: fidl::encoding::ResourceDialect>
1109 fidl::encoding::Encode<CoordinatorDestroyLayerRequest, D>
1110 for &CoordinatorDestroyLayerRequest
1111 {
1112 #[inline]
1113 unsafe fn encode(
1114 self,
1115 encoder: &mut fidl::encoding::Encoder<'_, D>,
1116 offset: usize,
1117 _depth: fidl::encoding::Depth,
1118 ) -> fidl::Result<()> {
1119 encoder.debug_check_bounds::<CoordinatorDestroyLayerRequest>(offset);
1120 unsafe {
1121 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1123 (buf_ptr as *mut CoordinatorDestroyLayerRequest)
1124 .write_unaligned((self as *const CoordinatorDestroyLayerRequest).read());
1125 }
1128 Ok(())
1129 }
1130 }
1131 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LayerId, D>>
1132 fidl::encoding::Encode<CoordinatorDestroyLayerRequest, D> for (T0,)
1133 {
1134 #[inline]
1135 unsafe fn encode(
1136 self,
1137 encoder: &mut fidl::encoding::Encoder<'_, D>,
1138 offset: usize,
1139 depth: fidl::encoding::Depth,
1140 ) -> fidl::Result<()> {
1141 encoder.debug_check_bounds::<CoordinatorDestroyLayerRequest>(offset);
1142 self.0.encode(encoder, offset + 0, depth)?;
1146 Ok(())
1147 }
1148 }
1149
1150 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1151 for CoordinatorDestroyLayerRequest
1152 {
1153 #[inline(always)]
1154 fn new_empty() -> Self {
1155 Self { layer_id: fidl::new_empty!(LayerId, D) }
1156 }
1157
1158 #[inline]
1159 unsafe fn decode(
1160 &mut self,
1161 decoder: &mut fidl::encoding::Decoder<'_, D>,
1162 offset: usize,
1163 _depth: fidl::encoding::Depth,
1164 ) -> fidl::Result<()> {
1165 decoder.debug_check_bounds::<Self>(offset);
1166 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1167 unsafe {
1170 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1171 }
1172 Ok(())
1173 }
1174 }
1175
1176 impl fidl::encoding::ValueTypeMarker for CoordinatorGetLatestAppliedConfigStampResponse {
1177 type Borrowed<'a> = &'a Self;
1178 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1179 value
1180 }
1181 }
1182
1183 unsafe impl fidl::encoding::TypeMarker for CoordinatorGetLatestAppliedConfigStampResponse {
1184 type Owned = Self;
1185
1186 #[inline(always)]
1187 fn inline_align(_context: fidl::encoding::Context) -> usize {
1188 8
1189 }
1190
1191 #[inline(always)]
1192 fn inline_size(_context: fidl::encoding::Context) -> usize {
1193 8
1194 }
1195 #[inline(always)]
1196 fn encode_is_copy() -> bool {
1197 true
1198 }
1199
1200 #[inline(always)]
1201 fn decode_is_copy() -> bool {
1202 true
1203 }
1204 }
1205
1206 unsafe impl<D: fidl::encoding::ResourceDialect>
1207 fidl::encoding::Encode<CoordinatorGetLatestAppliedConfigStampResponse, D>
1208 for &CoordinatorGetLatestAppliedConfigStampResponse
1209 {
1210 #[inline]
1211 unsafe fn encode(
1212 self,
1213 encoder: &mut fidl::encoding::Encoder<'_, D>,
1214 offset: usize,
1215 _depth: fidl::encoding::Depth,
1216 ) -> fidl::Result<()> {
1217 encoder.debug_check_bounds::<CoordinatorGetLatestAppliedConfigStampResponse>(offset);
1218 unsafe {
1219 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1221 (buf_ptr as *mut CoordinatorGetLatestAppliedConfigStampResponse).write_unaligned(
1222 (self as *const CoordinatorGetLatestAppliedConfigStampResponse).read(),
1223 );
1224 }
1227 Ok(())
1228 }
1229 }
1230 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ConfigStamp, D>>
1231 fidl::encoding::Encode<CoordinatorGetLatestAppliedConfigStampResponse, D> for (T0,)
1232 {
1233 #[inline]
1234 unsafe fn encode(
1235 self,
1236 encoder: &mut fidl::encoding::Encoder<'_, D>,
1237 offset: usize,
1238 depth: fidl::encoding::Depth,
1239 ) -> fidl::Result<()> {
1240 encoder.debug_check_bounds::<CoordinatorGetLatestAppliedConfigStampResponse>(offset);
1241 self.0.encode(encoder, offset + 0, depth)?;
1245 Ok(())
1246 }
1247 }
1248
1249 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1250 for CoordinatorGetLatestAppliedConfigStampResponse
1251 {
1252 #[inline(always)]
1253 fn new_empty() -> Self {
1254 Self { stamp: fidl::new_empty!(ConfigStamp, D) }
1255 }
1256
1257 #[inline]
1258 unsafe fn decode(
1259 &mut self,
1260 decoder: &mut fidl::encoding::Decoder<'_, D>,
1261 offset: usize,
1262 _depth: fidl::encoding::Depth,
1263 ) -> fidl::Result<()> {
1264 decoder.debug_check_bounds::<Self>(offset);
1265 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1266 unsafe {
1269 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1270 }
1271 Ok(())
1272 }
1273 }
1274
1275 impl fidl::encoding::ValueTypeMarker for CoordinatorImportImageRequest {
1276 type Borrowed<'a> = &'a Self;
1277 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1278 value
1279 }
1280 }
1281
1282 unsafe impl fidl::encoding::TypeMarker for CoordinatorImportImageRequest {
1283 type Owned = Self;
1284
1285 #[inline(always)]
1286 fn inline_align(_context: fidl::encoding::Context) -> usize {
1287 8
1288 }
1289
1290 #[inline(always)]
1291 fn inline_size(_context: fidl::encoding::Context) -> usize {
1292 40
1293 }
1294 }
1295
1296 unsafe impl<D: fidl::encoding::ResourceDialect>
1297 fidl::encoding::Encode<CoordinatorImportImageRequest, D>
1298 for &CoordinatorImportImageRequest
1299 {
1300 #[inline]
1301 unsafe fn encode(
1302 self,
1303 encoder: &mut fidl::encoding::Encoder<'_, D>,
1304 offset: usize,
1305 _depth: fidl::encoding::Depth,
1306 ) -> fidl::Result<()> {
1307 encoder.debug_check_bounds::<CoordinatorImportImageRequest>(offset);
1308 fidl::encoding::Encode::<CoordinatorImportImageRequest, D>::encode(
1310 (
1311 <fidl_fuchsia_hardware_display_types__common::ImageMetadata as fidl::encoding::ValueTypeMarker>::borrow(&self.image_metadata),
1312 <BufferCollectionId as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_collection_id),
1313 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_index),
1314 <ImageId as fidl::encoding::ValueTypeMarker>::borrow(&self.image_id),
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__common::ImageMetadata, D>,
1323 T1: fidl::encoding::Encode<BufferCollectionId, D>,
1324 T2: fidl::encoding::Encode<u32, D>,
1325 T3: fidl::encoding::Encode<ImageId, D>,
1326 > fidl::encoding::Encode<CoordinatorImportImageRequest, D> for (T0, T1, T2, T3)
1327 {
1328 #[inline]
1329 unsafe fn encode(
1330 self,
1331 encoder: &mut fidl::encoding::Encoder<'_, D>,
1332 offset: usize,
1333 depth: fidl::encoding::Depth,
1334 ) -> fidl::Result<()> {
1335 encoder.debug_check_bounds::<CoordinatorImportImageRequest>(offset);
1336 unsafe {
1339 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
1340 (ptr as *mut u64).write_unaligned(0);
1341 }
1342 unsafe {
1343 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
1344 (ptr as *mut u64).write_unaligned(0);
1345 }
1346 self.0.encode(encoder, offset + 0, depth)?;
1348 self.1.encode(encoder, offset + 16, depth)?;
1349 self.2.encode(encoder, offset + 24, depth)?;
1350 self.3.encode(encoder, offset + 32, depth)?;
1351 Ok(())
1352 }
1353 }
1354
1355 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1356 for CoordinatorImportImageRequest
1357 {
1358 #[inline(always)]
1359 fn new_empty() -> Self {
1360 Self {
1361 image_metadata: fidl::new_empty!(
1362 fidl_fuchsia_hardware_display_types__common::ImageMetadata,
1363 D
1364 ),
1365 buffer_collection_id: fidl::new_empty!(BufferCollectionId, D),
1366 buffer_index: fidl::new_empty!(u32, D),
1367 image_id: fidl::new_empty!(ImageId, D),
1368 }
1369 }
1370
1371 #[inline]
1372 unsafe fn decode(
1373 &mut self,
1374 decoder: &mut fidl::encoding::Decoder<'_, D>,
1375 offset: usize,
1376 _depth: fidl::encoding::Depth,
1377 ) -> fidl::Result<()> {
1378 decoder.debug_check_bounds::<Self>(offset);
1379 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
1381 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1382 let mask = 0xffffffff00000000u64;
1383 let maskedval = padval & mask;
1384 if maskedval != 0 {
1385 return Err(fidl::Error::NonZeroPadding {
1386 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
1387 });
1388 }
1389 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
1390 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1391 let mask = 0xffffffff00000000u64;
1392 let maskedval = padval & mask;
1393 if maskedval != 0 {
1394 return Err(fidl::Error::NonZeroPadding {
1395 padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
1396 });
1397 }
1398 fidl::decode!(
1399 fidl_fuchsia_hardware_display_types__common::ImageMetadata,
1400 D,
1401 &mut self.image_metadata,
1402 decoder,
1403 offset + 0,
1404 _depth
1405 )?;
1406 fidl::decode!(
1407 BufferCollectionId,
1408 D,
1409 &mut self.buffer_collection_id,
1410 decoder,
1411 offset + 16,
1412 _depth
1413 )?;
1414 fidl::decode!(u32, D, &mut self.buffer_index, decoder, offset + 24, _depth)?;
1415 fidl::decode!(ImageId, D, &mut self.image_id, decoder, offset + 32, _depth)?;
1416 Ok(())
1417 }
1418 }
1419
1420 impl fidl::encoding::ValueTypeMarker for CoordinatorListenerOnClientOwnershipChangeRequest {
1421 type Borrowed<'a> = &'a Self;
1422 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1423 value
1424 }
1425 }
1426
1427 unsafe impl fidl::encoding::TypeMarker for CoordinatorListenerOnClientOwnershipChangeRequest {
1428 type Owned = Self;
1429
1430 #[inline(always)]
1431 fn inline_align(_context: fidl::encoding::Context) -> usize {
1432 1
1433 }
1434
1435 #[inline(always)]
1436 fn inline_size(_context: fidl::encoding::Context) -> usize {
1437 1
1438 }
1439 }
1440
1441 unsafe impl<D: fidl::encoding::ResourceDialect>
1442 fidl::encoding::Encode<CoordinatorListenerOnClientOwnershipChangeRequest, D>
1443 for &CoordinatorListenerOnClientOwnershipChangeRequest
1444 {
1445 #[inline]
1446 unsafe fn encode(
1447 self,
1448 encoder: &mut fidl::encoding::Encoder<'_, D>,
1449 offset: usize,
1450 _depth: fidl::encoding::Depth,
1451 ) -> fidl::Result<()> {
1452 encoder.debug_check_bounds::<CoordinatorListenerOnClientOwnershipChangeRequest>(offset);
1453 fidl::encoding::Encode::<CoordinatorListenerOnClientOwnershipChangeRequest, D>::encode(
1455 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.has_ownership),),
1456 encoder,
1457 offset,
1458 _depth,
1459 )
1460 }
1461 }
1462 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
1463 fidl::encoding::Encode<CoordinatorListenerOnClientOwnershipChangeRequest, D> for (T0,)
1464 {
1465 #[inline]
1466 unsafe fn encode(
1467 self,
1468 encoder: &mut fidl::encoding::Encoder<'_, D>,
1469 offset: usize,
1470 depth: fidl::encoding::Depth,
1471 ) -> fidl::Result<()> {
1472 encoder.debug_check_bounds::<CoordinatorListenerOnClientOwnershipChangeRequest>(offset);
1473 self.0.encode(encoder, offset + 0, depth)?;
1477 Ok(())
1478 }
1479 }
1480
1481 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1482 for CoordinatorListenerOnClientOwnershipChangeRequest
1483 {
1484 #[inline(always)]
1485 fn new_empty() -> Self {
1486 Self { has_ownership: fidl::new_empty!(bool, D) }
1487 }
1488
1489 #[inline]
1490 unsafe fn decode(
1491 &mut self,
1492 decoder: &mut fidl::encoding::Decoder<'_, D>,
1493 offset: usize,
1494 _depth: fidl::encoding::Depth,
1495 ) -> fidl::Result<()> {
1496 decoder.debug_check_bounds::<Self>(offset);
1497 fidl::decode!(bool, D, &mut self.has_ownership, decoder, offset + 0, _depth)?;
1499 Ok(())
1500 }
1501 }
1502
1503 impl fidl::encoding::ValueTypeMarker for CoordinatorListenerOnDisplaysChangedRequest {
1504 type Borrowed<'a> = &'a Self;
1505 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1506 value
1507 }
1508 }
1509
1510 unsafe impl fidl::encoding::TypeMarker for CoordinatorListenerOnDisplaysChangedRequest {
1511 type Owned = Self;
1512
1513 #[inline(always)]
1514 fn inline_align(_context: fidl::encoding::Context) -> usize {
1515 8
1516 }
1517
1518 #[inline(always)]
1519 fn inline_size(_context: fidl::encoding::Context) -> usize {
1520 32
1521 }
1522 }
1523
1524 unsafe impl<D: fidl::encoding::ResourceDialect>
1525 fidl::encoding::Encode<CoordinatorListenerOnDisplaysChangedRequest, D>
1526 for &CoordinatorListenerOnDisplaysChangedRequest
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::<CoordinatorListenerOnDisplaysChangedRequest>(offset);
1536 fidl::encoding::Encode::<CoordinatorListenerOnDisplaysChangedRequest, D>::encode(
1538 (
1539 <fidl::encoding::UnboundedVector<Info> as fidl::encoding::ValueTypeMarker>::borrow(&self.added),
1540 <fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types__common::DisplayId> as fidl::encoding::ValueTypeMarker>::borrow(&self.removed),
1541 ),
1542 encoder, offset, _depth
1543 )
1544 }
1545 }
1546 unsafe impl<
1547 D: fidl::encoding::ResourceDialect,
1548 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Info>, D>,
1549 T1: fidl::encoding::Encode<
1550 fidl::encoding::UnboundedVector<
1551 fidl_fuchsia_hardware_display_types__common::DisplayId,
1552 >,
1553 D,
1554 >,
1555 > fidl::encoding::Encode<CoordinatorListenerOnDisplaysChangedRequest, D> for (T0, T1)
1556 {
1557 #[inline]
1558 unsafe fn encode(
1559 self,
1560 encoder: &mut fidl::encoding::Encoder<'_, D>,
1561 offset: usize,
1562 depth: fidl::encoding::Depth,
1563 ) -> fidl::Result<()> {
1564 encoder.debug_check_bounds::<CoordinatorListenerOnDisplaysChangedRequest>(offset);
1565 self.0.encode(encoder, offset + 0, depth)?;
1569 self.1.encode(encoder, offset + 16, depth)?;
1570 Ok(())
1571 }
1572 }
1573
1574 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1575 for CoordinatorListenerOnDisplaysChangedRequest
1576 {
1577 #[inline(always)]
1578 fn new_empty() -> Self {
1579 Self {
1580 added: fidl::new_empty!(fidl::encoding::UnboundedVector<Info>, D),
1581 removed: fidl::new_empty!(
1582 fidl::encoding::UnboundedVector<
1583 fidl_fuchsia_hardware_display_types__common::DisplayId,
1584 >,
1585 D
1586 ),
1587 }
1588 }
1589
1590 #[inline]
1591 unsafe fn decode(
1592 &mut self,
1593 decoder: &mut fidl::encoding::Decoder<'_, D>,
1594 offset: usize,
1595 _depth: fidl::encoding::Depth,
1596 ) -> fidl::Result<()> {
1597 decoder.debug_check_bounds::<Self>(offset);
1598 fidl::decode!(
1600 fidl::encoding::UnboundedVector<Info>,
1601 D,
1602 &mut self.added,
1603 decoder,
1604 offset + 0,
1605 _depth
1606 )?;
1607 fidl::decode!(
1608 fidl::encoding::UnboundedVector<
1609 fidl_fuchsia_hardware_display_types__common::DisplayId,
1610 >,
1611 D,
1612 &mut self.removed,
1613 decoder,
1614 offset + 16,
1615 _depth
1616 )?;
1617 Ok(())
1618 }
1619 }
1620
1621 impl fidl::encoding::ValueTypeMarker for CoordinatorListenerOnVsyncRequest {
1622 type Borrowed<'a> = &'a Self;
1623 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1624 value
1625 }
1626 }
1627
1628 unsafe impl fidl::encoding::TypeMarker for CoordinatorListenerOnVsyncRequest {
1629 type Owned = Self;
1630
1631 #[inline(always)]
1632 fn inline_align(_context: fidl::encoding::Context) -> usize {
1633 8
1634 }
1635
1636 #[inline(always)]
1637 fn inline_size(_context: fidl::encoding::Context) -> usize {
1638 32
1639 }
1640 }
1641
1642 unsafe impl<D: fidl::encoding::ResourceDialect>
1643 fidl::encoding::Encode<CoordinatorListenerOnVsyncRequest, D>
1644 for &CoordinatorListenerOnVsyncRequest
1645 {
1646 #[inline]
1647 unsafe fn encode(
1648 self,
1649 encoder: &mut fidl::encoding::Encoder<'_, D>,
1650 offset: usize,
1651 _depth: fidl::encoding::Depth,
1652 ) -> fidl::Result<()> {
1653 encoder.debug_check_bounds::<CoordinatorListenerOnVsyncRequest>(offset);
1654 fidl::encoding::Encode::<CoordinatorListenerOnVsyncRequest, D>::encode(
1656 (
1657 <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
1658 <fidl::MonotonicInstant as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp),
1659 <ConfigStamp as fidl::encoding::ValueTypeMarker>::borrow(&self.applied_config_stamp),
1660 <VsyncAckCookie as fidl::encoding::ValueTypeMarker>::borrow(&self.cookie),
1661 ),
1662 encoder, offset, _depth
1663 )
1664 }
1665 }
1666 unsafe impl<
1667 D: fidl::encoding::ResourceDialect,
1668 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
1669 T1: fidl::encoding::Encode<fidl::MonotonicInstant, D>,
1670 T2: fidl::encoding::Encode<ConfigStamp, D>,
1671 T3: fidl::encoding::Encode<VsyncAckCookie, D>,
1672 > fidl::encoding::Encode<CoordinatorListenerOnVsyncRequest, D> for (T0, T1, T2, T3)
1673 {
1674 #[inline]
1675 unsafe fn encode(
1676 self,
1677 encoder: &mut fidl::encoding::Encoder<'_, D>,
1678 offset: usize,
1679 depth: fidl::encoding::Depth,
1680 ) -> fidl::Result<()> {
1681 encoder.debug_check_bounds::<CoordinatorListenerOnVsyncRequest>(offset);
1682 self.0.encode(encoder, offset + 0, depth)?;
1686 self.1.encode(encoder, offset + 8, depth)?;
1687 self.2.encode(encoder, offset + 16, depth)?;
1688 self.3.encode(encoder, offset + 24, depth)?;
1689 Ok(())
1690 }
1691 }
1692
1693 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1694 for CoordinatorListenerOnVsyncRequest
1695 {
1696 #[inline(always)]
1697 fn new_empty() -> Self {
1698 Self {
1699 display_id: fidl::new_empty!(
1700 fidl_fuchsia_hardware_display_types__common::DisplayId,
1701 D
1702 ),
1703 timestamp: fidl::new_empty!(fidl::MonotonicInstant, D),
1704 applied_config_stamp: fidl::new_empty!(ConfigStamp, D),
1705 cookie: fidl::new_empty!(VsyncAckCookie, D),
1706 }
1707 }
1708
1709 #[inline]
1710 unsafe fn decode(
1711 &mut self,
1712 decoder: &mut fidl::encoding::Decoder<'_, D>,
1713 offset: usize,
1714 _depth: fidl::encoding::Depth,
1715 ) -> fidl::Result<()> {
1716 decoder.debug_check_bounds::<Self>(offset);
1717 fidl::decode!(
1719 fidl_fuchsia_hardware_display_types__common::DisplayId,
1720 D,
1721 &mut self.display_id,
1722 decoder,
1723 offset + 0,
1724 _depth
1725 )?;
1726 fidl::decode!(
1727 fidl::MonotonicInstant,
1728 D,
1729 &mut self.timestamp,
1730 decoder,
1731 offset + 8,
1732 _depth
1733 )?;
1734 fidl::decode!(
1735 ConfigStamp,
1736 D,
1737 &mut self.applied_config_stamp,
1738 decoder,
1739 offset + 16,
1740 _depth
1741 )?;
1742 fidl::decode!(VsyncAckCookie, D, &mut self.cookie, decoder, offset + 24, _depth)?;
1743 Ok(())
1744 }
1745 }
1746
1747 impl fidl::encoding::ValueTypeMarker for CoordinatorReleaseBufferCollectionRequest {
1748 type Borrowed<'a> = &'a Self;
1749 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1750 value
1751 }
1752 }
1753
1754 unsafe impl fidl::encoding::TypeMarker for CoordinatorReleaseBufferCollectionRequest {
1755 type Owned = Self;
1756
1757 #[inline(always)]
1758 fn inline_align(_context: fidl::encoding::Context) -> usize {
1759 8
1760 }
1761
1762 #[inline(always)]
1763 fn inline_size(_context: fidl::encoding::Context) -> usize {
1764 8
1765 }
1766 #[inline(always)]
1767 fn encode_is_copy() -> bool {
1768 true
1769 }
1770
1771 #[inline(always)]
1772 fn decode_is_copy() -> bool {
1773 true
1774 }
1775 }
1776
1777 unsafe impl<D: fidl::encoding::ResourceDialect>
1778 fidl::encoding::Encode<CoordinatorReleaseBufferCollectionRequest, D>
1779 for &CoordinatorReleaseBufferCollectionRequest
1780 {
1781 #[inline]
1782 unsafe fn encode(
1783 self,
1784 encoder: &mut fidl::encoding::Encoder<'_, D>,
1785 offset: usize,
1786 _depth: fidl::encoding::Depth,
1787 ) -> fidl::Result<()> {
1788 encoder.debug_check_bounds::<CoordinatorReleaseBufferCollectionRequest>(offset);
1789 unsafe {
1790 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1792 (buf_ptr as *mut CoordinatorReleaseBufferCollectionRequest).write_unaligned(
1793 (self as *const CoordinatorReleaseBufferCollectionRequest).read(),
1794 );
1795 }
1798 Ok(())
1799 }
1800 }
1801 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<BufferCollectionId, D>>
1802 fidl::encoding::Encode<CoordinatorReleaseBufferCollectionRequest, D> for (T0,)
1803 {
1804 #[inline]
1805 unsafe fn encode(
1806 self,
1807 encoder: &mut fidl::encoding::Encoder<'_, D>,
1808 offset: usize,
1809 depth: fidl::encoding::Depth,
1810 ) -> fidl::Result<()> {
1811 encoder.debug_check_bounds::<CoordinatorReleaseBufferCollectionRequest>(offset);
1812 self.0.encode(encoder, offset + 0, depth)?;
1816 Ok(())
1817 }
1818 }
1819
1820 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1821 for CoordinatorReleaseBufferCollectionRequest
1822 {
1823 #[inline(always)]
1824 fn new_empty() -> Self {
1825 Self { buffer_collection_id: fidl::new_empty!(BufferCollectionId, D) }
1826 }
1827
1828 #[inline]
1829 unsafe fn decode(
1830 &mut self,
1831 decoder: &mut fidl::encoding::Decoder<'_, D>,
1832 offset: usize,
1833 _depth: fidl::encoding::Depth,
1834 ) -> fidl::Result<()> {
1835 decoder.debug_check_bounds::<Self>(offset);
1836 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1837 unsafe {
1840 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1841 }
1842 Ok(())
1843 }
1844 }
1845
1846 impl fidl::encoding::ValueTypeMarker for CoordinatorReleaseEventRequest {
1847 type Borrowed<'a> = &'a Self;
1848 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1849 value
1850 }
1851 }
1852
1853 unsafe impl fidl::encoding::TypeMarker for CoordinatorReleaseEventRequest {
1854 type Owned = Self;
1855
1856 #[inline(always)]
1857 fn inline_align(_context: fidl::encoding::Context) -> usize {
1858 8
1859 }
1860
1861 #[inline(always)]
1862 fn inline_size(_context: fidl::encoding::Context) -> usize {
1863 8
1864 }
1865 #[inline(always)]
1866 fn encode_is_copy() -> bool {
1867 true
1868 }
1869
1870 #[inline(always)]
1871 fn decode_is_copy() -> bool {
1872 true
1873 }
1874 }
1875
1876 unsafe impl<D: fidl::encoding::ResourceDialect>
1877 fidl::encoding::Encode<CoordinatorReleaseEventRequest, D>
1878 for &CoordinatorReleaseEventRequest
1879 {
1880 #[inline]
1881 unsafe fn encode(
1882 self,
1883 encoder: &mut fidl::encoding::Encoder<'_, D>,
1884 offset: usize,
1885 _depth: fidl::encoding::Depth,
1886 ) -> fidl::Result<()> {
1887 encoder.debug_check_bounds::<CoordinatorReleaseEventRequest>(offset);
1888 unsafe {
1889 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1891 (buf_ptr as *mut CoordinatorReleaseEventRequest)
1892 .write_unaligned((self as *const CoordinatorReleaseEventRequest).read());
1893 }
1896 Ok(())
1897 }
1898 }
1899 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<EventId, D>>
1900 fidl::encoding::Encode<CoordinatorReleaseEventRequest, D> for (T0,)
1901 {
1902 #[inline]
1903 unsafe fn encode(
1904 self,
1905 encoder: &mut fidl::encoding::Encoder<'_, D>,
1906 offset: usize,
1907 depth: fidl::encoding::Depth,
1908 ) -> fidl::Result<()> {
1909 encoder.debug_check_bounds::<CoordinatorReleaseEventRequest>(offset);
1910 self.0.encode(encoder, offset + 0, depth)?;
1914 Ok(())
1915 }
1916 }
1917
1918 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1919 for CoordinatorReleaseEventRequest
1920 {
1921 #[inline(always)]
1922 fn new_empty() -> Self {
1923 Self { id: fidl::new_empty!(EventId, D) }
1924 }
1925
1926 #[inline]
1927 unsafe fn decode(
1928 &mut self,
1929 decoder: &mut fidl::encoding::Decoder<'_, D>,
1930 offset: usize,
1931 _depth: fidl::encoding::Depth,
1932 ) -> fidl::Result<()> {
1933 decoder.debug_check_bounds::<Self>(offset);
1934 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1935 unsafe {
1938 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1939 }
1940 Ok(())
1941 }
1942 }
1943
1944 impl fidl::encoding::ValueTypeMarker for CoordinatorReleaseImageRequest {
1945 type Borrowed<'a> = &'a Self;
1946 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1947 value
1948 }
1949 }
1950
1951 unsafe impl fidl::encoding::TypeMarker for CoordinatorReleaseImageRequest {
1952 type Owned = Self;
1953
1954 #[inline(always)]
1955 fn inline_align(_context: fidl::encoding::Context) -> usize {
1956 8
1957 }
1958
1959 #[inline(always)]
1960 fn inline_size(_context: fidl::encoding::Context) -> usize {
1961 8
1962 }
1963 #[inline(always)]
1964 fn encode_is_copy() -> bool {
1965 true
1966 }
1967
1968 #[inline(always)]
1969 fn decode_is_copy() -> bool {
1970 true
1971 }
1972 }
1973
1974 unsafe impl<D: fidl::encoding::ResourceDialect>
1975 fidl::encoding::Encode<CoordinatorReleaseImageRequest, D>
1976 for &CoordinatorReleaseImageRequest
1977 {
1978 #[inline]
1979 unsafe fn encode(
1980 self,
1981 encoder: &mut fidl::encoding::Encoder<'_, D>,
1982 offset: usize,
1983 _depth: fidl::encoding::Depth,
1984 ) -> fidl::Result<()> {
1985 encoder.debug_check_bounds::<CoordinatorReleaseImageRequest>(offset);
1986 unsafe {
1987 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1989 (buf_ptr as *mut CoordinatorReleaseImageRequest)
1990 .write_unaligned((self as *const CoordinatorReleaseImageRequest).read());
1991 }
1994 Ok(())
1995 }
1996 }
1997 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ImageId, D>>
1998 fidl::encoding::Encode<CoordinatorReleaseImageRequest, D> for (T0,)
1999 {
2000 #[inline]
2001 unsafe fn encode(
2002 self,
2003 encoder: &mut fidl::encoding::Encoder<'_, D>,
2004 offset: usize,
2005 depth: fidl::encoding::Depth,
2006 ) -> fidl::Result<()> {
2007 encoder.debug_check_bounds::<CoordinatorReleaseImageRequest>(offset);
2008 self.0.encode(encoder, offset + 0, depth)?;
2012 Ok(())
2013 }
2014 }
2015
2016 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2017 for CoordinatorReleaseImageRequest
2018 {
2019 #[inline(always)]
2020 fn new_empty() -> Self {
2021 Self { image_id: fidl::new_empty!(ImageId, D) }
2022 }
2023
2024 #[inline]
2025 unsafe fn decode(
2026 &mut self,
2027 decoder: &mut fidl::encoding::Decoder<'_, D>,
2028 offset: usize,
2029 _depth: fidl::encoding::Depth,
2030 ) -> fidl::Result<()> {
2031 decoder.debug_check_bounds::<Self>(offset);
2032 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2033 unsafe {
2036 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2037 }
2038 Ok(())
2039 }
2040 }
2041
2042 impl fidl::encoding::ValueTypeMarker for CoordinatorSetBufferCollectionConstraintsRequest {
2043 type Borrowed<'a> = &'a Self;
2044 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2045 value
2046 }
2047 }
2048
2049 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetBufferCollectionConstraintsRequest {
2050 type Owned = Self;
2051
2052 #[inline(always)]
2053 fn inline_align(_context: fidl::encoding::Context) -> usize {
2054 8
2055 }
2056
2057 #[inline(always)]
2058 fn inline_size(_context: fidl::encoding::Context) -> usize {
2059 16
2060 }
2061 }
2062
2063 unsafe impl<D: fidl::encoding::ResourceDialect>
2064 fidl::encoding::Encode<CoordinatorSetBufferCollectionConstraintsRequest, D>
2065 for &CoordinatorSetBufferCollectionConstraintsRequest
2066 {
2067 #[inline]
2068 unsafe fn encode(
2069 self,
2070 encoder: &mut fidl::encoding::Encoder<'_, D>,
2071 offset: usize,
2072 _depth: fidl::encoding::Depth,
2073 ) -> fidl::Result<()> {
2074 encoder.debug_check_bounds::<CoordinatorSetBufferCollectionConstraintsRequest>(offset);
2075 fidl::encoding::Encode::<CoordinatorSetBufferCollectionConstraintsRequest, D>::encode(
2077 (
2078 <BufferCollectionId as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_collection_id),
2079 <fidl_fuchsia_hardware_display_types__common::ImageBufferUsage as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_usage),
2080 ),
2081 encoder, offset, _depth
2082 )
2083 }
2084 }
2085 unsafe impl<
2086 D: fidl::encoding::ResourceDialect,
2087 T0: fidl::encoding::Encode<BufferCollectionId, D>,
2088 T1: fidl::encoding::Encode<
2089 fidl_fuchsia_hardware_display_types__common::ImageBufferUsage,
2090 D,
2091 >,
2092 > fidl::encoding::Encode<CoordinatorSetBufferCollectionConstraintsRequest, D> for (T0, T1)
2093 {
2094 #[inline]
2095 unsafe fn encode(
2096 self,
2097 encoder: &mut fidl::encoding::Encoder<'_, D>,
2098 offset: usize,
2099 depth: fidl::encoding::Depth,
2100 ) -> fidl::Result<()> {
2101 encoder.debug_check_bounds::<CoordinatorSetBufferCollectionConstraintsRequest>(offset);
2102 unsafe {
2105 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2106 (ptr as *mut u64).write_unaligned(0);
2107 }
2108 self.0.encode(encoder, offset + 0, depth)?;
2110 self.1.encode(encoder, offset + 8, depth)?;
2111 Ok(())
2112 }
2113 }
2114
2115 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2116 for CoordinatorSetBufferCollectionConstraintsRequest
2117 {
2118 #[inline(always)]
2119 fn new_empty() -> Self {
2120 Self {
2121 buffer_collection_id: fidl::new_empty!(BufferCollectionId, D),
2122 buffer_usage: fidl::new_empty!(
2123 fidl_fuchsia_hardware_display_types__common::ImageBufferUsage,
2124 D
2125 ),
2126 }
2127 }
2128
2129 #[inline]
2130 unsafe fn decode(
2131 &mut self,
2132 decoder: &mut fidl::encoding::Decoder<'_, D>,
2133 offset: usize,
2134 _depth: fidl::encoding::Depth,
2135 ) -> fidl::Result<()> {
2136 decoder.debug_check_bounds::<Self>(offset);
2137 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2139 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2140 let mask = 0xffffffff00000000u64;
2141 let maskedval = padval & mask;
2142 if maskedval != 0 {
2143 return Err(fidl::Error::NonZeroPadding {
2144 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2145 });
2146 }
2147 fidl::decode!(
2148 BufferCollectionId,
2149 D,
2150 &mut self.buffer_collection_id,
2151 decoder,
2152 offset + 0,
2153 _depth
2154 )?;
2155 fidl::decode!(
2156 fidl_fuchsia_hardware_display_types__common::ImageBufferUsage,
2157 D,
2158 &mut self.buffer_usage,
2159 decoder,
2160 offset + 8,
2161 _depth
2162 )?;
2163 Ok(())
2164 }
2165 }
2166
2167 impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayColorConversionRequest {
2168 type Borrowed<'a> = &'a Self;
2169 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2170 value
2171 }
2172 }
2173
2174 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayColorConversionRequest {
2175 type Owned = Self;
2176
2177 #[inline(always)]
2178 fn inline_align(_context: fidl::encoding::Context) -> usize {
2179 8
2180 }
2181
2182 #[inline(always)]
2183 fn inline_size(_context: fidl::encoding::Context) -> usize {
2184 72
2185 }
2186 }
2187
2188 unsafe impl<D: fidl::encoding::ResourceDialect>
2189 fidl::encoding::Encode<CoordinatorSetDisplayColorConversionRequest, D>
2190 for &CoordinatorSetDisplayColorConversionRequest
2191 {
2192 #[inline]
2193 unsafe fn encode(
2194 self,
2195 encoder: &mut fidl::encoding::Encoder<'_, D>,
2196 offset: usize,
2197 _depth: fidl::encoding::Depth,
2198 ) -> fidl::Result<()> {
2199 encoder.debug_check_bounds::<CoordinatorSetDisplayColorConversionRequest>(offset);
2200 fidl::encoding::Encode::<CoordinatorSetDisplayColorConversionRequest, D>::encode(
2202 (
2203 <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
2204 <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(&self.preoffsets),
2205 <fidl::encoding::Array<f32, 9> as fidl::encoding::ValueTypeMarker>::borrow(&self.coefficients),
2206 <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(&self.postoffsets),
2207 ),
2208 encoder, offset, _depth
2209 )
2210 }
2211 }
2212 unsafe impl<
2213 D: fidl::encoding::ResourceDialect,
2214 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
2215 T1: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
2216 T2: fidl::encoding::Encode<fidl::encoding::Array<f32, 9>, D>,
2217 T3: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
2218 > fidl::encoding::Encode<CoordinatorSetDisplayColorConversionRequest, D>
2219 for (T0, T1, T2, T3)
2220 {
2221 #[inline]
2222 unsafe fn encode(
2223 self,
2224 encoder: &mut fidl::encoding::Encoder<'_, D>,
2225 offset: usize,
2226 depth: fidl::encoding::Depth,
2227 ) -> fidl::Result<()> {
2228 encoder.debug_check_bounds::<CoordinatorSetDisplayColorConversionRequest>(offset);
2229 unsafe {
2232 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(64);
2233 (ptr as *mut u64).write_unaligned(0);
2234 }
2235 self.0.encode(encoder, offset + 0, depth)?;
2237 self.1.encode(encoder, offset + 8, depth)?;
2238 self.2.encode(encoder, offset + 20, depth)?;
2239 self.3.encode(encoder, offset + 56, depth)?;
2240 Ok(())
2241 }
2242 }
2243
2244 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2245 for CoordinatorSetDisplayColorConversionRequest
2246 {
2247 #[inline(always)]
2248 fn new_empty() -> Self {
2249 Self {
2250 display_id: fidl::new_empty!(
2251 fidl_fuchsia_hardware_display_types__common::DisplayId,
2252 D
2253 ),
2254 preoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
2255 coefficients: fidl::new_empty!(fidl::encoding::Array<f32, 9>, D),
2256 postoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
2257 }
2258 }
2259
2260 #[inline]
2261 unsafe fn decode(
2262 &mut self,
2263 decoder: &mut fidl::encoding::Decoder<'_, D>,
2264 offset: usize,
2265 _depth: fidl::encoding::Depth,
2266 ) -> fidl::Result<()> {
2267 decoder.debug_check_bounds::<Self>(offset);
2268 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(64) };
2270 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2271 let mask = 0xffffffff00000000u64;
2272 let maskedval = padval & mask;
2273 if maskedval != 0 {
2274 return Err(fidl::Error::NonZeroPadding {
2275 padding_start: offset + 64 + ((mask as u64).trailing_zeros() / 8) as usize,
2276 });
2277 }
2278 fidl::decode!(
2279 fidl_fuchsia_hardware_display_types__common::DisplayId,
2280 D,
2281 &mut self.display_id,
2282 decoder,
2283 offset + 0,
2284 _depth
2285 )?;
2286 fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.preoffsets, decoder, offset + 8, _depth)?;
2287 fidl::decode!(fidl::encoding::Array<f32, 9>, D, &mut self.coefficients, decoder, offset + 20, _depth)?;
2288 fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.postoffsets, decoder, offset + 56, _depth)?;
2289 Ok(())
2290 }
2291 }
2292
2293 impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayLayersRequest {
2294 type Borrowed<'a> = &'a Self;
2295 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2296 value
2297 }
2298 }
2299
2300 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayLayersRequest {
2301 type Owned = Self;
2302
2303 #[inline(always)]
2304 fn inline_align(_context: fidl::encoding::Context) -> usize {
2305 8
2306 }
2307
2308 #[inline(always)]
2309 fn inline_size(_context: fidl::encoding::Context) -> usize {
2310 24
2311 }
2312 }
2313
2314 unsafe impl<D: fidl::encoding::ResourceDialect>
2315 fidl::encoding::Encode<CoordinatorSetDisplayLayersRequest, D>
2316 for &CoordinatorSetDisplayLayersRequest
2317 {
2318 #[inline]
2319 unsafe fn encode(
2320 self,
2321 encoder: &mut fidl::encoding::Encoder<'_, D>,
2322 offset: usize,
2323 _depth: fidl::encoding::Depth,
2324 ) -> fidl::Result<()> {
2325 encoder.debug_check_bounds::<CoordinatorSetDisplayLayersRequest>(offset);
2326 fidl::encoding::Encode::<CoordinatorSetDisplayLayersRequest, D>::encode(
2328 (
2329 <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
2330 <fidl::encoding::UnboundedVector<LayerId> as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_ids),
2331 ),
2332 encoder, offset, _depth
2333 )
2334 }
2335 }
2336 unsafe impl<
2337 D: fidl::encoding::ResourceDialect,
2338 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
2339 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<LayerId>, D>,
2340 > fidl::encoding::Encode<CoordinatorSetDisplayLayersRequest, D> for (T0, T1)
2341 {
2342 #[inline]
2343 unsafe fn encode(
2344 self,
2345 encoder: &mut fidl::encoding::Encoder<'_, D>,
2346 offset: usize,
2347 depth: fidl::encoding::Depth,
2348 ) -> fidl::Result<()> {
2349 encoder.debug_check_bounds::<CoordinatorSetDisplayLayersRequest>(offset);
2350 self.0.encode(encoder, offset + 0, depth)?;
2354 self.1.encode(encoder, offset + 8, depth)?;
2355 Ok(())
2356 }
2357 }
2358
2359 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2360 for CoordinatorSetDisplayLayersRequest
2361 {
2362 #[inline(always)]
2363 fn new_empty() -> Self {
2364 Self {
2365 display_id: fidl::new_empty!(
2366 fidl_fuchsia_hardware_display_types__common::DisplayId,
2367 D
2368 ),
2369 layer_ids: fidl::new_empty!(fidl::encoding::UnboundedVector<LayerId>, D),
2370 }
2371 }
2372
2373 #[inline]
2374 unsafe fn decode(
2375 &mut self,
2376 decoder: &mut fidl::encoding::Decoder<'_, D>,
2377 offset: usize,
2378 _depth: fidl::encoding::Depth,
2379 ) -> fidl::Result<()> {
2380 decoder.debug_check_bounds::<Self>(offset);
2381 fidl::decode!(
2383 fidl_fuchsia_hardware_display_types__common::DisplayId,
2384 D,
2385 &mut self.display_id,
2386 decoder,
2387 offset + 0,
2388 _depth
2389 )?;
2390 fidl::decode!(
2391 fidl::encoding::UnboundedVector<LayerId>,
2392 D,
2393 &mut self.layer_ids,
2394 decoder,
2395 offset + 8,
2396 _depth
2397 )?;
2398 Ok(())
2399 }
2400 }
2401
2402 impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayModeRequest {
2403 type Borrowed<'a> = &'a Self;
2404 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2405 value
2406 }
2407 }
2408
2409 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayModeRequest {
2410 type Owned = Self;
2411
2412 #[inline(always)]
2413 fn inline_align(_context: fidl::encoding::Context) -> usize {
2414 8
2415 }
2416
2417 #[inline(always)]
2418 fn inline_size(_context: fidl::encoding::Context) -> usize {
2419 24
2420 }
2421 }
2422
2423 unsafe impl<D: fidl::encoding::ResourceDialect>
2424 fidl::encoding::Encode<CoordinatorSetDisplayModeRequest, D>
2425 for &CoordinatorSetDisplayModeRequest
2426 {
2427 #[inline]
2428 unsafe fn encode(
2429 self,
2430 encoder: &mut fidl::encoding::Encoder<'_, D>,
2431 offset: usize,
2432 _depth: fidl::encoding::Depth,
2433 ) -> fidl::Result<()> {
2434 encoder.debug_check_bounds::<CoordinatorSetDisplayModeRequest>(offset);
2435 fidl::encoding::Encode::<CoordinatorSetDisplayModeRequest, D>::encode(
2437 (
2438 <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
2439 <fidl_fuchsia_hardware_display_types__common::Mode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
2440 ),
2441 encoder, offset, _depth
2442 )
2443 }
2444 }
2445 unsafe impl<
2446 D: fidl::encoding::ResourceDialect,
2447 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
2448 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::Mode, D>,
2449 > fidl::encoding::Encode<CoordinatorSetDisplayModeRequest, D> for (T0, T1)
2450 {
2451 #[inline]
2452 unsafe fn encode(
2453 self,
2454 encoder: &mut fidl::encoding::Encoder<'_, D>,
2455 offset: usize,
2456 depth: fidl::encoding::Depth,
2457 ) -> fidl::Result<()> {
2458 encoder.debug_check_bounds::<CoordinatorSetDisplayModeRequest>(offset);
2459 self.0.encode(encoder, offset + 0, depth)?;
2463 self.1.encode(encoder, offset + 8, depth)?;
2464 Ok(())
2465 }
2466 }
2467
2468 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2469 for CoordinatorSetDisplayModeRequest
2470 {
2471 #[inline(always)]
2472 fn new_empty() -> Self {
2473 Self {
2474 display_id: fidl::new_empty!(
2475 fidl_fuchsia_hardware_display_types__common::DisplayId,
2476 D
2477 ),
2478 mode: fidl::new_empty!(fidl_fuchsia_hardware_display_types__common::Mode, D),
2479 }
2480 }
2481
2482 #[inline]
2483 unsafe fn decode(
2484 &mut self,
2485 decoder: &mut fidl::encoding::Decoder<'_, D>,
2486 offset: usize,
2487 _depth: fidl::encoding::Depth,
2488 ) -> fidl::Result<()> {
2489 decoder.debug_check_bounds::<Self>(offset);
2490 fidl::decode!(
2492 fidl_fuchsia_hardware_display_types__common::DisplayId,
2493 D,
2494 &mut self.display_id,
2495 decoder,
2496 offset + 0,
2497 _depth
2498 )?;
2499 fidl::decode!(
2500 fidl_fuchsia_hardware_display_types__common::Mode,
2501 D,
2502 &mut self.mode,
2503 decoder,
2504 offset + 8,
2505 _depth
2506 )?;
2507 Ok(())
2508 }
2509 }
2510
2511 impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayPowerRequest {
2512 type Borrowed<'a> = &'a Self;
2513 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2514 value
2515 }
2516 }
2517
2518 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayPowerRequest {
2519 type Owned = Self;
2520
2521 #[inline(always)]
2522 fn inline_align(_context: fidl::encoding::Context) -> usize {
2523 8
2524 }
2525
2526 #[inline(always)]
2527 fn inline_size(_context: fidl::encoding::Context) -> usize {
2528 16
2529 }
2530 }
2531
2532 unsafe impl<D: fidl::encoding::ResourceDialect>
2533 fidl::encoding::Encode<CoordinatorSetDisplayPowerRequest, D>
2534 for &CoordinatorSetDisplayPowerRequest
2535 {
2536 #[inline]
2537 unsafe fn encode(
2538 self,
2539 encoder: &mut fidl::encoding::Encoder<'_, D>,
2540 offset: usize,
2541 _depth: fidl::encoding::Depth,
2542 ) -> fidl::Result<()> {
2543 encoder.debug_check_bounds::<CoordinatorSetDisplayPowerRequest>(offset);
2544 fidl::encoding::Encode::<CoordinatorSetDisplayPowerRequest, D>::encode(
2546 (
2547 <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
2548 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.power_on),
2549 ),
2550 encoder, offset, _depth
2551 )
2552 }
2553 }
2554 unsafe impl<
2555 D: fidl::encoding::ResourceDialect,
2556 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
2557 T1: fidl::encoding::Encode<bool, D>,
2558 > fidl::encoding::Encode<CoordinatorSetDisplayPowerRequest, D> for (T0, T1)
2559 {
2560 #[inline]
2561 unsafe fn encode(
2562 self,
2563 encoder: &mut fidl::encoding::Encoder<'_, D>,
2564 offset: usize,
2565 depth: fidl::encoding::Depth,
2566 ) -> fidl::Result<()> {
2567 encoder.debug_check_bounds::<CoordinatorSetDisplayPowerRequest>(offset);
2568 unsafe {
2571 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2572 (ptr as *mut u64).write_unaligned(0);
2573 }
2574 self.0.encode(encoder, offset + 0, depth)?;
2576 self.1.encode(encoder, offset + 8, depth)?;
2577 Ok(())
2578 }
2579 }
2580
2581 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2582 for CoordinatorSetDisplayPowerRequest
2583 {
2584 #[inline(always)]
2585 fn new_empty() -> Self {
2586 Self {
2587 display_id: fidl::new_empty!(
2588 fidl_fuchsia_hardware_display_types__common::DisplayId,
2589 D
2590 ),
2591 power_on: fidl::new_empty!(bool, D),
2592 }
2593 }
2594
2595 #[inline]
2596 unsafe fn decode(
2597 &mut self,
2598 decoder: &mut fidl::encoding::Decoder<'_, D>,
2599 offset: usize,
2600 _depth: fidl::encoding::Depth,
2601 ) -> fidl::Result<()> {
2602 decoder.debug_check_bounds::<Self>(offset);
2603 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2605 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2606 let mask = 0xffffffffffffff00u64;
2607 let maskedval = padval & mask;
2608 if maskedval != 0 {
2609 return Err(fidl::Error::NonZeroPadding {
2610 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2611 });
2612 }
2613 fidl::decode!(
2614 fidl_fuchsia_hardware_display_types__common::DisplayId,
2615 D,
2616 &mut self.display_id,
2617 decoder,
2618 offset + 0,
2619 _depth
2620 )?;
2621 fidl::decode!(bool, D, &mut self.power_on, decoder, offset + 8, _depth)?;
2622 Ok(())
2623 }
2624 }
2625
2626 impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerColorConfigRequest {
2627 type Borrowed<'a> = &'a Self;
2628 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2629 value
2630 }
2631 }
2632
2633 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerColorConfigRequest {
2634 type Owned = Self;
2635
2636 #[inline(always)]
2637 fn inline_align(_context: fidl::encoding::Context) -> usize {
2638 8
2639 }
2640
2641 #[inline(always)]
2642 fn inline_size(_context: fidl::encoding::Context) -> usize {
2643 40
2644 }
2645 }
2646
2647 unsafe impl<D: fidl::encoding::ResourceDialect>
2648 fidl::encoding::Encode<CoordinatorSetLayerColorConfigRequest, D>
2649 for &CoordinatorSetLayerColorConfigRequest
2650 {
2651 #[inline]
2652 unsafe fn encode(
2653 self,
2654 encoder: &mut fidl::encoding::Encoder<'_, D>,
2655 offset: usize,
2656 _depth: fidl::encoding::Depth,
2657 ) -> fidl::Result<()> {
2658 encoder.debug_check_bounds::<CoordinatorSetLayerColorConfigRequest>(offset);
2659 fidl::encoding::Encode::<CoordinatorSetLayerColorConfigRequest, D>::encode(
2661 (
2662 <LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
2663 <fidl_fuchsia_hardware_display_types__common::Color as fidl::encoding::ValueTypeMarker>::borrow(&self.color),
2664 <fidl_fuchsia_math__common::RectU as fidl::encoding::ValueTypeMarker>::borrow(&self.display_destination),
2665 ),
2666 encoder, offset, _depth
2667 )
2668 }
2669 }
2670 unsafe impl<
2671 D: fidl::encoding::ResourceDialect,
2672 T0: fidl::encoding::Encode<LayerId, D>,
2673 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::Color, D>,
2674 T2: fidl::encoding::Encode<fidl_fuchsia_math__common::RectU, D>,
2675 > fidl::encoding::Encode<CoordinatorSetLayerColorConfigRequest, D> for (T0, T1, T2)
2676 {
2677 #[inline]
2678 unsafe fn encode(
2679 self,
2680 encoder: &mut fidl::encoding::Encoder<'_, D>,
2681 offset: usize,
2682 depth: fidl::encoding::Depth,
2683 ) -> fidl::Result<()> {
2684 encoder.debug_check_bounds::<CoordinatorSetLayerColorConfigRequest>(offset);
2685 unsafe {
2688 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
2689 (ptr as *mut u64).write_unaligned(0);
2690 }
2691 self.0.encode(encoder, offset + 0, depth)?;
2693 self.1.encode(encoder, offset + 8, depth)?;
2694 self.2.encode(encoder, offset + 20, depth)?;
2695 Ok(())
2696 }
2697 }
2698
2699 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2700 for CoordinatorSetLayerColorConfigRequest
2701 {
2702 #[inline(always)]
2703 fn new_empty() -> Self {
2704 Self {
2705 layer_id: fidl::new_empty!(LayerId, D),
2706 color: fidl::new_empty!(fidl_fuchsia_hardware_display_types__common::Color, D),
2707 display_destination: fidl::new_empty!(fidl_fuchsia_math__common::RectU, D),
2708 }
2709 }
2710
2711 #[inline]
2712 unsafe fn decode(
2713 &mut self,
2714 decoder: &mut fidl::encoding::Decoder<'_, D>,
2715 offset: usize,
2716 _depth: fidl::encoding::Depth,
2717 ) -> fidl::Result<()> {
2718 decoder.debug_check_bounds::<Self>(offset);
2719 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
2721 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2722 let mask = 0xffffffff00000000u64;
2723 let maskedval = padval & mask;
2724 if maskedval != 0 {
2725 return Err(fidl::Error::NonZeroPadding {
2726 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
2727 });
2728 }
2729 fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
2730 fidl::decode!(
2731 fidl_fuchsia_hardware_display_types__common::Color,
2732 D,
2733 &mut self.color,
2734 decoder,
2735 offset + 8,
2736 _depth
2737 )?;
2738 fidl::decode!(
2739 fidl_fuchsia_math__common::RectU,
2740 D,
2741 &mut self.display_destination,
2742 decoder,
2743 offset + 20,
2744 _depth
2745 )?;
2746 Ok(())
2747 }
2748 }
2749
2750 impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerImage2Request {
2751 type Borrowed<'a> = &'a Self;
2752 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2753 value
2754 }
2755 }
2756
2757 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerImage2Request {
2758 type Owned = Self;
2759
2760 #[inline(always)]
2761 fn inline_align(_context: fidl::encoding::Context) -> usize {
2762 8
2763 }
2764
2765 #[inline(always)]
2766 fn inline_size(_context: fidl::encoding::Context) -> usize {
2767 24
2768 }
2769 #[inline(always)]
2770 fn encode_is_copy() -> bool {
2771 true
2772 }
2773
2774 #[inline(always)]
2775 fn decode_is_copy() -> bool {
2776 true
2777 }
2778 }
2779
2780 unsafe impl<D: fidl::encoding::ResourceDialect>
2781 fidl::encoding::Encode<CoordinatorSetLayerImage2Request, D>
2782 for &CoordinatorSetLayerImage2Request
2783 {
2784 #[inline]
2785 unsafe fn encode(
2786 self,
2787 encoder: &mut fidl::encoding::Encoder<'_, D>,
2788 offset: usize,
2789 _depth: fidl::encoding::Depth,
2790 ) -> fidl::Result<()> {
2791 encoder.debug_check_bounds::<CoordinatorSetLayerImage2Request>(offset);
2792 unsafe {
2793 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2795 (buf_ptr as *mut CoordinatorSetLayerImage2Request)
2796 .write_unaligned((self as *const CoordinatorSetLayerImage2Request).read());
2797 }
2800 Ok(())
2801 }
2802 }
2803 unsafe impl<
2804 D: fidl::encoding::ResourceDialect,
2805 T0: fidl::encoding::Encode<LayerId, D>,
2806 T1: fidl::encoding::Encode<ImageId, D>,
2807 T2: fidl::encoding::Encode<EventId, D>,
2808 > fidl::encoding::Encode<CoordinatorSetLayerImage2Request, D> for (T0, T1, T2)
2809 {
2810 #[inline]
2811 unsafe fn encode(
2812 self,
2813 encoder: &mut fidl::encoding::Encoder<'_, D>,
2814 offset: usize,
2815 depth: fidl::encoding::Depth,
2816 ) -> fidl::Result<()> {
2817 encoder.debug_check_bounds::<CoordinatorSetLayerImage2Request>(offset);
2818 self.0.encode(encoder, offset + 0, depth)?;
2822 self.1.encode(encoder, offset + 8, depth)?;
2823 self.2.encode(encoder, offset + 16, depth)?;
2824 Ok(())
2825 }
2826 }
2827
2828 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2829 for CoordinatorSetLayerImage2Request
2830 {
2831 #[inline(always)]
2832 fn new_empty() -> Self {
2833 Self {
2834 layer_id: fidl::new_empty!(LayerId, D),
2835 image_id: fidl::new_empty!(ImageId, D),
2836 wait_event_id: fidl::new_empty!(EventId, D),
2837 }
2838 }
2839
2840 #[inline]
2841 unsafe fn decode(
2842 &mut self,
2843 decoder: &mut fidl::encoding::Decoder<'_, D>,
2844 offset: usize,
2845 _depth: fidl::encoding::Depth,
2846 ) -> fidl::Result<()> {
2847 decoder.debug_check_bounds::<Self>(offset);
2848 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2849 unsafe {
2852 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
2853 }
2854 Ok(())
2855 }
2856 }
2857
2858 impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerPrimaryAlphaRequest {
2859 type Borrowed<'a> = &'a Self;
2860 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2861 value
2862 }
2863 }
2864
2865 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerPrimaryAlphaRequest {
2866 type Owned = Self;
2867
2868 #[inline(always)]
2869 fn inline_align(_context: fidl::encoding::Context) -> usize {
2870 8
2871 }
2872
2873 #[inline(always)]
2874 fn inline_size(_context: fidl::encoding::Context) -> usize {
2875 16
2876 }
2877 }
2878
2879 unsafe impl<D: fidl::encoding::ResourceDialect>
2880 fidl::encoding::Encode<CoordinatorSetLayerPrimaryAlphaRequest, D>
2881 for &CoordinatorSetLayerPrimaryAlphaRequest
2882 {
2883 #[inline]
2884 unsafe fn encode(
2885 self,
2886 encoder: &mut fidl::encoding::Encoder<'_, D>,
2887 offset: usize,
2888 _depth: fidl::encoding::Depth,
2889 ) -> fidl::Result<()> {
2890 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryAlphaRequest>(offset);
2891 fidl::encoding::Encode::<CoordinatorSetLayerPrimaryAlphaRequest, D>::encode(
2893 (
2894 <LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
2895 <fidl_fuchsia_hardware_display_types__common::AlphaMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
2896 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.val),
2897 ),
2898 encoder, offset, _depth
2899 )
2900 }
2901 }
2902 unsafe impl<
2903 D: fidl::encoding::ResourceDialect,
2904 T0: fidl::encoding::Encode<LayerId, D>,
2905 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::AlphaMode, D>,
2906 T2: fidl::encoding::Encode<f32, D>,
2907 > fidl::encoding::Encode<CoordinatorSetLayerPrimaryAlphaRequest, D> for (T0, T1, T2)
2908 {
2909 #[inline]
2910 unsafe fn encode(
2911 self,
2912 encoder: &mut fidl::encoding::Encoder<'_, D>,
2913 offset: usize,
2914 depth: fidl::encoding::Depth,
2915 ) -> fidl::Result<()> {
2916 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryAlphaRequest>(offset);
2917 unsafe {
2920 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2921 (ptr as *mut u64).write_unaligned(0);
2922 }
2923 self.0.encode(encoder, offset + 0, depth)?;
2925 self.1.encode(encoder, offset + 8, depth)?;
2926 self.2.encode(encoder, offset + 12, depth)?;
2927 Ok(())
2928 }
2929 }
2930
2931 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2932 for CoordinatorSetLayerPrimaryAlphaRequest
2933 {
2934 #[inline(always)]
2935 fn new_empty() -> Self {
2936 Self {
2937 layer_id: fidl::new_empty!(LayerId, D),
2938 mode: fidl::new_empty!(fidl_fuchsia_hardware_display_types__common::AlphaMode, D),
2939 val: fidl::new_empty!(f32, D),
2940 }
2941 }
2942
2943 #[inline]
2944 unsafe fn decode(
2945 &mut self,
2946 decoder: &mut fidl::encoding::Decoder<'_, D>,
2947 offset: usize,
2948 _depth: fidl::encoding::Depth,
2949 ) -> fidl::Result<()> {
2950 decoder.debug_check_bounds::<Self>(offset);
2951 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2953 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2954 let mask = 0xffffff00u64;
2955 let maskedval = padval & mask;
2956 if maskedval != 0 {
2957 return Err(fidl::Error::NonZeroPadding {
2958 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2959 });
2960 }
2961 fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
2962 fidl::decode!(
2963 fidl_fuchsia_hardware_display_types__common::AlphaMode,
2964 D,
2965 &mut self.mode,
2966 decoder,
2967 offset + 8,
2968 _depth
2969 )?;
2970 fidl::decode!(f32, D, &mut self.val, decoder, offset + 12, _depth)?;
2971 Ok(())
2972 }
2973 }
2974
2975 impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerPrimaryConfigRequest {
2976 type Borrowed<'a> = &'a Self;
2977 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2978 value
2979 }
2980 }
2981
2982 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerPrimaryConfigRequest {
2983 type Owned = Self;
2984
2985 #[inline(always)]
2986 fn inline_align(_context: fidl::encoding::Context) -> usize {
2987 8
2988 }
2989
2990 #[inline(always)]
2991 fn inline_size(_context: fidl::encoding::Context) -> usize {
2992 24
2993 }
2994 }
2995
2996 unsafe impl<D: fidl::encoding::ResourceDialect>
2997 fidl::encoding::Encode<CoordinatorSetLayerPrimaryConfigRequest, D>
2998 for &CoordinatorSetLayerPrimaryConfigRequest
2999 {
3000 #[inline]
3001 unsafe fn encode(
3002 self,
3003 encoder: &mut fidl::encoding::Encoder<'_, D>,
3004 offset: usize,
3005 _depth: fidl::encoding::Depth,
3006 ) -> fidl::Result<()> {
3007 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryConfigRequest>(offset);
3008 fidl::encoding::Encode::<CoordinatorSetLayerPrimaryConfigRequest, D>::encode(
3010 (
3011 <LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
3012 <fidl_fuchsia_hardware_display_types__common::ImageMetadata as fidl::encoding::ValueTypeMarker>::borrow(&self.image_metadata),
3013 ),
3014 encoder, offset, _depth
3015 )
3016 }
3017 }
3018 unsafe impl<
3019 D: fidl::encoding::ResourceDialect,
3020 T0: fidl::encoding::Encode<LayerId, D>,
3021 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::ImageMetadata, D>,
3022 > fidl::encoding::Encode<CoordinatorSetLayerPrimaryConfigRequest, D> for (T0, T1)
3023 {
3024 #[inline]
3025 unsafe fn encode(
3026 self,
3027 encoder: &mut fidl::encoding::Encoder<'_, D>,
3028 offset: usize,
3029 depth: fidl::encoding::Depth,
3030 ) -> fidl::Result<()> {
3031 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryConfigRequest>(offset);
3032 unsafe {
3035 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3036 (ptr as *mut u64).write_unaligned(0);
3037 }
3038 self.0.encode(encoder, offset + 0, depth)?;
3040 self.1.encode(encoder, offset + 8, depth)?;
3041 Ok(())
3042 }
3043 }
3044
3045 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3046 for CoordinatorSetLayerPrimaryConfigRequest
3047 {
3048 #[inline(always)]
3049 fn new_empty() -> Self {
3050 Self {
3051 layer_id: fidl::new_empty!(LayerId, D),
3052 image_metadata: fidl::new_empty!(
3053 fidl_fuchsia_hardware_display_types__common::ImageMetadata,
3054 D
3055 ),
3056 }
3057 }
3058
3059 #[inline]
3060 unsafe fn decode(
3061 &mut self,
3062 decoder: &mut fidl::encoding::Decoder<'_, D>,
3063 offset: usize,
3064 _depth: fidl::encoding::Depth,
3065 ) -> fidl::Result<()> {
3066 decoder.debug_check_bounds::<Self>(offset);
3067 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3069 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3070 let mask = 0xffffffff00000000u64;
3071 let maskedval = padval & mask;
3072 if maskedval != 0 {
3073 return Err(fidl::Error::NonZeroPadding {
3074 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3075 });
3076 }
3077 fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
3078 fidl::decode!(
3079 fidl_fuchsia_hardware_display_types__common::ImageMetadata,
3080 D,
3081 &mut self.image_metadata,
3082 decoder,
3083 offset + 8,
3084 _depth
3085 )?;
3086 Ok(())
3087 }
3088 }
3089
3090 impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerPrimaryPositionRequest {
3091 type Borrowed<'a> = &'a Self;
3092 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3093 value
3094 }
3095 }
3096
3097 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerPrimaryPositionRequest {
3098 type Owned = Self;
3099
3100 #[inline(always)]
3101 fn inline_align(_context: fidl::encoding::Context) -> usize {
3102 8
3103 }
3104
3105 #[inline(always)]
3106 fn inline_size(_context: fidl::encoding::Context) -> usize {
3107 48
3108 }
3109 }
3110
3111 unsafe impl<D: fidl::encoding::ResourceDialect>
3112 fidl::encoding::Encode<CoordinatorSetLayerPrimaryPositionRequest, D>
3113 for &CoordinatorSetLayerPrimaryPositionRequest
3114 {
3115 #[inline]
3116 unsafe fn encode(
3117 self,
3118 encoder: &mut fidl::encoding::Encoder<'_, D>,
3119 offset: usize,
3120 _depth: fidl::encoding::Depth,
3121 ) -> fidl::Result<()> {
3122 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryPositionRequest>(offset);
3123 fidl::encoding::Encode::<CoordinatorSetLayerPrimaryPositionRequest, D>::encode(
3125 (
3126 <LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
3127 <fidl_fuchsia_hardware_display_types__common::CoordinateTransformation as fidl::encoding::ValueTypeMarker>::borrow(&self.image_source_transformation),
3128 <fidl_fuchsia_math__common::RectU as fidl::encoding::ValueTypeMarker>::borrow(&self.image_source),
3129 <fidl_fuchsia_math__common::RectU as fidl::encoding::ValueTypeMarker>::borrow(&self.display_destination),
3130 ),
3131 encoder, offset, _depth
3132 )
3133 }
3134 }
3135 unsafe impl<
3136 D: fidl::encoding::ResourceDialect,
3137 T0: fidl::encoding::Encode<LayerId, D>,
3138 T1: fidl::encoding::Encode<
3139 fidl_fuchsia_hardware_display_types__common::CoordinateTransformation,
3140 D,
3141 >,
3142 T2: fidl::encoding::Encode<fidl_fuchsia_math__common::RectU, D>,
3143 T3: fidl::encoding::Encode<fidl_fuchsia_math__common::RectU, D>,
3144 > fidl::encoding::Encode<CoordinatorSetLayerPrimaryPositionRequest, D>
3145 for (T0, T1, T2, T3)
3146 {
3147 #[inline]
3148 unsafe fn encode(
3149 self,
3150 encoder: &mut fidl::encoding::Encoder<'_, D>,
3151 offset: usize,
3152 depth: fidl::encoding::Depth,
3153 ) -> fidl::Result<()> {
3154 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryPositionRequest>(offset);
3155 unsafe {
3158 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3159 (ptr as *mut u64).write_unaligned(0);
3160 }
3161 unsafe {
3162 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
3163 (ptr as *mut u64).write_unaligned(0);
3164 }
3165 self.0.encode(encoder, offset + 0, depth)?;
3167 self.1.encode(encoder, offset + 8, depth)?;
3168 self.2.encode(encoder, offset + 12, depth)?;
3169 self.3.encode(encoder, offset + 28, depth)?;
3170 Ok(())
3171 }
3172 }
3173
3174 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3175 for CoordinatorSetLayerPrimaryPositionRequest
3176 {
3177 #[inline(always)]
3178 fn new_empty() -> Self {
3179 Self {
3180 layer_id: fidl::new_empty!(LayerId, D),
3181 image_source_transformation: fidl::new_empty!(
3182 fidl_fuchsia_hardware_display_types__common::CoordinateTransformation,
3183 D
3184 ),
3185 image_source: fidl::new_empty!(fidl_fuchsia_math__common::RectU, D),
3186 display_destination: fidl::new_empty!(fidl_fuchsia_math__common::RectU, D),
3187 }
3188 }
3189
3190 #[inline]
3191 unsafe fn decode(
3192 &mut self,
3193 decoder: &mut fidl::encoding::Decoder<'_, D>,
3194 offset: usize,
3195 _depth: fidl::encoding::Depth,
3196 ) -> fidl::Result<()> {
3197 decoder.debug_check_bounds::<Self>(offset);
3198 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3200 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3201 let mask = 0xffffff00u64;
3202 let maskedval = padval & mask;
3203 if maskedval != 0 {
3204 return Err(fidl::Error::NonZeroPadding {
3205 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3206 });
3207 }
3208 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
3209 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3210 let mask = 0xffffffff00000000u64;
3211 let maskedval = padval & mask;
3212 if maskedval != 0 {
3213 return Err(fidl::Error::NonZeroPadding {
3214 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
3215 });
3216 }
3217 fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
3218 fidl::decode!(
3219 fidl_fuchsia_hardware_display_types__common::CoordinateTransformation,
3220 D,
3221 &mut self.image_source_transformation,
3222 decoder,
3223 offset + 8,
3224 _depth
3225 )?;
3226 fidl::decode!(
3227 fidl_fuchsia_math__common::RectU,
3228 D,
3229 &mut self.image_source,
3230 decoder,
3231 offset + 12,
3232 _depth
3233 )?;
3234 fidl::decode!(
3235 fidl_fuchsia_math__common::RectU,
3236 D,
3237 &mut self.display_destination,
3238 decoder,
3239 offset + 28,
3240 _depth
3241 )?;
3242 Ok(())
3243 }
3244 }
3245
3246 impl fidl::encoding::ValueTypeMarker for CoordinatorSetMinimumRgbRequest {
3247 type Borrowed<'a> = &'a Self;
3248 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3249 value
3250 }
3251 }
3252
3253 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetMinimumRgbRequest {
3254 type Owned = Self;
3255
3256 #[inline(always)]
3257 fn inline_align(_context: fidl::encoding::Context) -> usize {
3258 1
3259 }
3260
3261 #[inline(always)]
3262 fn inline_size(_context: fidl::encoding::Context) -> usize {
3263 1
3264 }
3265 #[inline(always)]
3266 fn encode_is_copy() -> bool {
3267 true
3268 }
3269
3270 #[inline(always)]
3271 fn decode_is_copy() -> bool {
3272 true
3273 }
3274 }
3275
3276 unsafe impl<D: fidl::encoding::ResourceDialect>
3277 fidl::encoding::Encode<CoordinatorSetMinimumRgbRequest, D>
3278 for &CoordinatorSetMinimumRgbRequest
3279 {
3280 #[inline]
3281 unsafe fn encode(
3282 self,
3283 encoder: &mut fidl::encoding::Encoder<'_, D>,
3284 offset: usize,
3285 _depth: fidl::encoding::Depth,
3286 ) -> fidl::Result<()> {
3287 encoder.debug_check_bounds::<CoordinatorSetMinimumRgbRequest>(offset);
3288 unsafe {
3289 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3291 (buf_ptr as *mut CoordinatorSetMinimumRgbRequest)
3292 .write_unaligned((self as *const CoordinatorSetMinimumRgbRequest).read());
3293 }
3296 Ok(())
3297 }
3298 }
3299 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
3300 fidl::encoding::Encode<CoordinatorSetMinimumRgbRequest, D> for (T0,)
3301 {
3302 #[inline]
3303 unsafe fn encode(
3304 self,
3305 encoder: &mut fidl::encoding::Encoder<'_, D>,
3306 offset: usize,
3307 depth: fidl::encoding::Depth,
3308 ) -> fidl::Result<()> {
3309 encoder.debug_check_bounds::<CoordinatorSetMinimumRgbRequest>(offset);
3310 self.0.encode(encoder, offset + 0, depth)?;
3314 Ok(())
3315 }
3316 }
3317
3318 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3319 for CoordinatorSetMinimumRgbRequest
3320 {
3321 #[inline(always)]
3322 fn new_empty() -> Self {
3323 Self { minimum_rgb: fidl::new_empty!(u8, D) }
3324 }
3325
3326 #[inline]
3327 unsafe fn decode(
3328 &mut self,
3329 decoder: &mut fidl::encoding::Decoder<'_, D>,
3330 offset: usize,
3331 _depth: fidl::encoding::Depth,
3332 ) -> fidl::Result<()> {
3333 decoder.debug_check_bounds::<Self>(offset);
3334 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3335 unsafe {
3338 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
3339 }
3340 Ok(())
3341 }
3342 }
3343
3344 impl fidl::encoding::ValueTypeMarker for CoordinatorSetVirtconModeRequest {
3345 type Borrowed<'a> = &'a Self;
3346 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3347 value
3348 }
3349 }
3350
3351 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetVirtconModeRequest {
3352 type Owned = Self;
3353
3354 #[inline(always)]
3355 fn inline_align(_context: fidl::encoding::Context) -> usize {
3356 1
3357 }
3358
3359 #[inline(always)]
3360 fn inline_size(_context: fidl::encoding::Context) -> usize {
3361 1
3362 }
3363 }
3364
3365 unsafe impl<D: fidl::encoding::ResourceDialect>
3366 fidl::encoding::Encode<CoordinatorSetVirtconModeRequest, D>
3367 for &CoordinatorSetVirtconModeRequest
3368 {
3369 #[inline]
3370 unsafe fn encode(
3371 self,
3372 encoder: &mut fidl::encoding::Encoder<'_, D>,
3373 offset: usize,
3374 _depth: fidl::encoding::Depth,
3375 ) -> fidl::Result<()> {
3376 encoder.debug_check_bounds::<CoordinatorSetVirtconModeRequest>(offset);
3377 fidl::encoding::Encode::<CoordinatorSetVirtconModeRequest, D>::encode(
3379 (<VirtconMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),),
3380 encoder,
3381 offset,
3382 _depth,
3383 )
3384 }
3385 }
3386 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<VirtconMode, D>>
3387 fidl::encoding::Encode<CoordinatorSetVirtconModeRequest, D> for (T0,)
3388 {
3389 #[inline]
3390 unsafe fn encode(
3391 self,
3392 encoder: &mut fidl::encoding::Encoder<'_, D>,
3393 offset: usize,
3394 depth: fidl::encoding::Depth,
3395 ) -> fidl::Result<()> {
3396 encoder.debug_check_bounds::<CoordinatorSetVirtconModeRequest>(offset);
3397 self.0.encode(encoder, offset + 0, depth)?;
3401 Ok(())
3402 }
3403 }
3404
3405 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3406 for CoordinatorSetVirtconModeRequest
3407 {
3408 #[inline(always)]
3409 fn new_empty() -> Self {
3410 Self { mode: fidl::new_empty!(VirtconMode, D) }
3411 }
3412
3413 #[inline]
3414 unsafe fn decode(
3415 &mut self,
3416 decoder: &mut fidl::encoding::Decoder<'_, D>,
3417 offset: usize,
3418 _depth: fidl::encoding::Depth,
3419 ) -> fidl::Result<()> {
3420 decoder.debug_check_bounds::<Self>(offset);
3421 fidl::decode!(VirtconMode, D, &mut self.mode, decoder, offset + 0, _depth)?;
3423 Ok(())
3424 }
3425 }
3426
3427 impl fidl::encoding::ValueTypeMarker for CoordinatorSetVsyncEventDeliveryRequest {
3428 type Borrowed<'a> = &'a Self;
3429 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3430 value
3431 }
3432 }
3433
3434 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetVsyncEventDeliveryRequest {
3435 type Owned = Self;
3436
3437 #[inline(always)]
3438 fn inline_align(_context: fidl::encoding::Context) -> usize {
3439 1
3440 }
3441
3442 #[inline(always)]
3443 fn inline_size(_context: fidl::encoding::Context) -> usize {
3444 1
3445 }
3446 }
3447
3448 unsafe impl<D: fidl::encoding::ResourceDialect>
3449 fidl::encoding::Encode<CoordinatorSetVsyncEventDeliveryRequest, D>
3450 for &CoordinatorSetVsyncEventDeliveryRequest
3451 {
3452 #[inline]
3453 unsafe fn encode(
3454 self,
3455 encoder: &mut fidl::encoding::Encoder<'_, D>,
3456 offset: usize,
3457 _depth: fidl::encoding::Depth,
3458 ) -> fidl::Result<()> {
3459 encoder.debug_check_bounds::<CoordinatorSetVsyncEventDeliveryRequest>(offset);
3460 fidl::encoding::Encode::<CoordinatorSetVsyncEventDeliveryRequest, D>::encode(
3462 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.vsync_delivery_enabled),),
3463 encoder,
3464 offset,
3465 _depth,
3466 )
3467 }
3468 }
3469 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3470 fidl::encoding::Encode<CoordinatorSetVsyncEventDeliveryRequest, D> for (T0,)
3471 {
3472 #[inline]
3473 unsafe fn encode(
3474 self,
3475 encoder: &mut fidl::encoding::Encoder<'_, D>,
3476 offset: usize,
3477 depth: fidl::encoding::Depth,
3478 ) -> fidl::Result<()> {
3479 encoder.debug_check_bounds::<CoordinatorSetVsyncEventDeliveryRequest>(offset);
3480 self.0.encode(encoder, offset + 0, depth)?;
3484 Ok(())
3485 }
3486 }
3487
3488 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3489 for CoordinatorSetVsyncEventDeliveryRequest
3490 {
3491 #[inline(always)]
3492 fn new_empty() -> Self {
3493 Self { vsync_delivery_enabled: fidl::new_empty!(bool, D) }
3494 }
3495
3496 #[inline]
3497 unsafe fn decode(
3498 &mut self,
3499 decoder: &mut fidl::encoding::Decoder<'_, D>,
3500 offset: usize,
3501 _depth: fidl::encoding::Depth,
3502 ) -> fidl::Result<()> {
3503 decoder.debug_check_bounds::<Self>(offset);
3504 fidl::decode!(bool, D, &mut self.vsync_delivery_enabled, decoder, offset + 0, _depth)?;
3506 Ok(())
3507 }
3508 }
3509
3510 impl fidl::encoding::ValueTypeMarker for CoordinatorStartCaptureRequest {
3511 type Borrowed<'a> = &'a Self;
3512 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3513 value
3514 }
3515 }
3516
3517 unsafe impl fidl::encoding::TypeMarker for CoordinatorStartCaptureRequest {
3518 type Owned = Self;
3519
3520 #[inline(always)]
3521 fn inline_align(_context: fidl::encoding::Context) -> usize {
3522 8
3523 }
3524
3525 #[inline(always)]
3526 fn inline_size(_context: fidl::encoding::Context) -> usize {
3527 16
3528 }
3529 #[inline(always)]
3530 fn encode_is_copy() -> bool {
3531 true
3532 }
3533
3534 #[inline(always)]
3535 fn decode_is_copy() -> bool {
3536 true
3537 }
3538 }
3539
3540 unsafe impl<D: fidl::encoding::ResourceDialect>
3541 fidl::encoding::Encode<CoordinatorStartCaptureRequest, D>
3542 for &CoordinatorStartCaptureRequest
3543 {
3544 #[inline]
3545 unsafe fn encode(
3546 self,
3547 encoder: &mut fidl::encoding::Encoder<'_, D>,
3548 offset: usize,
3549 _depth: fidl::encoding::Depth,
3550 ) -> fidl::Result<()> {
3551 encoder.debug_check_bounds::<CoordinatorStartCaptureRequest>(offset);
3552 unsafe {
3553 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3555 (buf_ptr as *mut CoordinatorStartCaptureRequest)
3556 .write_unaligned((self as *const CoordinatorStartCaptureRequest).read());
3557 }
3560 Ok(())
3561 }
3562 }
3563 unsafe impl<
3564 D: fidl::encoding::ResourceDialect,
3565 T0: fidl::encoding::Encode<EventId, D>,
3566 T1: fidl::encoding::Encode<ImageId, D>,
3567 > fidl::encoding::Encode<CoordinatorStartCaptureRequest, D> for (T0, T1)
3568 {
3569 #[inline]
3570 unsafe fn encode(
3571 self,
3572 encoder: &mut fidl::encoding::Encoder<'_, D>,
3573 offset: usize,
3574 depth: fidl::encoding::Depth,
3575 ) -> fidl::Result<()> {
3576 encoder.debug_check_bounds::<CoordinatorStartCaptureRequest>(offset);
3577 self.0.encode(encoder, offset + 0, depth)?;
3581 self.1.encode(encoder, offset + 8, depth)?;
3582 Ok(())
3583 }
3584 }
3585
3586 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3587 for CoordinatorStartCaptureRequest
3588 {
3589 #[inline(always)]
3590 fn new_empty() -> Self {
3591 Self {
3592 signal_event_id: fidl::new_empty!(EventId, D),
3593 image_id: fidl::new_empty!(ImageId, D),
3594 }
3595 }
3596
3597 #[inline]
3598 unsafe fn decode(
3599 &mut self,
3600 decoder: &mut fidl::encoding::Decoder<'_, D>,
3601 offset: usize,
3602 _depth: fidl::encoding::Depth,
3603 ) -> fidl::Result<()> {
3604 decoder.debug_check_bounds::<Self>(offset);
3605 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3606 unsafe {
3609 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
3610 }
3611 Ok(())
3612 }
3613 }
3614
3615 impl fidl::encoding::ValueTypeMarker for CoordinatorCreateLayerResponse {
3616 type Borrowed<'a> = &'a Self;
3617 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3618 value
3619 }
3620 }
3621
3622 unsafe impl fidl::encoding::TypeMarker for CoordinatorCreateLayerResponse {
3623 type Owned = Self;
3624
3625 #[inline(always)]
3626 fn inline_align(_context: fidl::encoding::Context) -> usize {
3627 8
3628 }
3629
3630 #[inline(always)]
3631 fn inline_size(_context: fidl::encoding::Context) -> usize {
3632 8
3633 }
3634 #[inline(always)]
3635 fn encode_is_copy() -> bool {
3636 true
3637 }
3638
3639 #[inline(always)]
3640 fn decode_is_copy() -> bool {
3641 true
3642 }
3643 }
3644
3645 unsafe impl<D: fidl::encoding::ResourceDialect>
3646 fidl::encoding::Encode<CoordinatorCreateLayerResponse, D>
3647 for &CoordinatorCreateLayerResponse
3648 {
3649 #[inline]
3650 unsafe fn encode(
3651 self,
3652 encoder: &mut fidl::encoding::Encoder<'_, D>,
3653 offset: usize,
3654 _depth: fidl::encoding::Depth,
3655 ) -> fidl::Result<()> {
3656 encoder.debug_check_bounds::<CoordinatorCreateLayerResponse>(offset);
3657 unsafe {
3658 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3660 (buf_ptr as *mut CoordinatorCreateLayerResponse)
3661 .write_unaligned((self as *const CoordinatorCreateLayerResponse).read());
3662 }
3665 Ok(())
3666 }
3667 }
3668 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LayerId, D>>
3669 fidl::encoding::Encode<CoordinatorCreateLayerResponse, D> for (T0,)
3670 {
3671 #[inline]
3672 unsafe fn encode(
3673 self,
3674 encoder: &mut fidl::encoding::Encoder<'_, D>,
3675 offset: usize,
3676 depth: fidl::encoding::Depth,
3677 ) -> fidl::Result<()> {
3678 encoder.debug_check_bounds::<CoordinatorCreateLayerResponse>(offset);
3679 self.0.encode(encoder, offset + 0, depth)?;
3683 Ok(())
3684 }
3685 }
3686
3687 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3688 for CoordinatorCreateLayerResponse
3689 {
3690 #[inline(always)]
3691 fn new_empty() -> Self {
3692 Self { layer_id: fidl::new_empty!(LayerId, D) }
3693 }
3694
3695 #[inline]
3696 unsafe fn decode(
3697 &mut self,
3698 decoder: &mut fidl::encoding::Decoder<'_, D>,
3699 offset: usize,
3700 _depth: fidl::encoding::Depth,
3701 ) -> fidl::Result<()> {
3702 decoder.debug_check_bounds::<Self>(offset);
3703 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3704 unsafe {
3707 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3708 }
3709 Ok(())
3710 }
3711 }
3712
3713 impl fidl::encoding::ValueTypeMarker for CoordinatorIsCaptureSupportedResponse {
3714 type Borrowed<'a> = &'a Self;
3715 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3716 value
3717 }
3718 }
3719
3720 unsafe impl fidl::encoding::TypeMarker for CoordinatorIsCaptureSupportedResponse {
3721 type Owned = Self;
3722
3723 #[inline(always)]
3724 fn inline_align(_context: fidl::encoding::Context) -> usize {
3725 1
3726 }
3727
3728 #[inline(always)]
3729 fn inline_size(_context: fidl::encoding::Context) -> usize {
3730 1
3731 }
3732 }
3733
3734 unsafe impl<D: fidl::encoding::ResourceDialect>
3735 fidl::encoding::Encode<CoordinatorIsCaptureSupportedResponse, D>
3736 for &CoordinatorIsCaptureSupportedResponse
3737 {
3738 #[inline]
3739 unsafe fn encode(
3740 self,
3741 encoder: &mut fidl::encoding::Encoder<'_, D>,
3742 offset: usize,
3743 _depth: fidl::encoding::Depth,
3744 ) -> fidl::Result<()> {
3745 encoder.debug_check_bounds::<CoordinatorIsCaptureSupportedResponse>(offset);
3746 fidl::encoding::Encode::<CoordinatorIsCaptureSupportedResponse, D>::encode(
3748 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
3749 encoder,
3750 offset,
3751 _depth,
3752 )
3753 }
3754 }
3755 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3756 fidl::encoding::Encode<CoordinatorIsCaptureSupportedResponse, D> for (T0,)
3757 {
3758 #[inline]
3759 unsafe fn encode(
3760 self,
3761 encoder: &mut fidl::encoding::Encoder<'_, D>,
3762 offset: usize,
3763 depth: fidl::encoding::Depth,
3764 ) -> fidl::Result<()> {
3765 encoder.debug_check_bounds::<CoordinatorIsCaptureSupportedResponse>(offset);
3766 self.0.encode(encoder, offset + 0, depth)?;
3770 Ok(())
3771 }
3772 }
3773
3774 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3775 for CoordinatorIsCaptureSupportedResponse
3776 {
3777 #[inline(always)]
3778 fn new_empty() -> Self {
3779 Self { supported: fidl::new_empty!(bool, D) }
3780 }
3781
3782 #[inline]
3783 unsafe fn decode(
3784 &mut self,
3785 decoder: &mut fidl::encoding::Decoder<'_, D>,
3786 offset: usize,
3787 _depth: fidl::encoding::Depth,
3788 ) -> fidl::Result<()> {
3789 decoder.debug_check_bounds::<Self>(offset);
3790 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
3792 Ok(())
3793 }
3794 }
3795
3796 impl fidl::encoding::ValueTypeMarker for EventId {
3797 type Borrowed<'a> = &'a Self;
3798 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3799 value
3800 }
3801 }
3802
3803 unsafe impl fidl::encoding::TypeMarker for EventId {
3804 type Owned = Self;
3805
3806 #[inline(always)]
3807 fn inline_align(_context: fidl::encoding::Context) -> usize {
3808 8
3809 }
3810
3811 #[inline(always)]
3812 fn inline_size(_context: fidl::encoding::Context) -> usize {
3813 8
3814 }
3815 #[inline(always)]
3816 fn encode_is_copy() -> bool {
3817 true
3818 }
3819
3820 #[inline(always)]
3821 fn decode_is_copy() -> bool {
3822 true
3823 }
3824 }
3825
3826 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EventId, D> for &EventId {
3827 #[inline]
3828 unsafe fn encode(
3829 self,
3830 encoder: &mut fidl::encoding::Encoder<'_, D>,
3831 offset: usize,
3832 _depth: fidl::encoding::Depth,
3833 ) -> fidl::Result<()> {
3834 encoder.debug_check_bounds::<EventId>(offset);
3835 unsafe {
3836 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3838 (buf_ptr as *mut EventId).write_unaligned((self as *const EventId).read());
3839 }
3842 Ok(())
3843 }
3844 }
3845 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
3846 fidl::encoding::Encode<EventId, D> for (T0,)
3847 {
3848 #[inline]
3849 unsafe fn encode(
3850 self,
3851 encoder: &mut fidl::encoding::Encoder<'_, D>,
3852 offset: usize,
3853 depth: fidl::encoding::Depth,
3854 ) -> fidl::Result<()> {
3855 encoder.debug_check_bounds::<EventId>(offset);
3856 self.0.encode(encoder, offset + 0, depth)?;
3860 Ok(())
3861 }
3862 }
3863
3864 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EventId {
3865 #[inline(always)]
3866 fn new_empty() -> Self {
3867 Self { value: fidl::new_empty!(u64, D) }
3868 }
3869
3870 #[inline]
3871 unsafe fn decode(
3872 &mut self,
3873 decoder: &mut fidl::encoding::Decoder<'_, D>,
3874 offset: usize,
3875 _depth: fidl::encoding::Depth,
3876 ) -> fidl::Result<()> {
3877 decoder.debug_check_bounds::<Self>(offset);
3878 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3879 unsafe {
3882 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3883 }
3884 Ok(())
3885 }
3886 }
3887
3888 impl fidl::encoding::ValueTypeMarker for ImageId {
3889 type Borrowed<'a> = &'a Self;
3890 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3891 value
3892 }
3893 }
3894
3895 unsafe impl fidl::encoding::TypeMarker for ImageId {
3896 type Owned = Self;
3897
3898 #[inline(always)]
3899 fn inline_align(_context: fidl::encoding::Context) -> usize {
3900 8
3901 }
3902
3903 #[inline(always)]
3904 fn inline_size(_context: fidl::encoding::Context) -> usize {
3905 8
3906 }
3907 #[inline(always)]
3908 fn encode_is_copy() -> bool {
3909 true
3910 }
3911
3912 #[inline(always)]
3913 fn decode_is_copy() -> bool {
3914 true
3915 }
3916 }
3917
3918 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageId, D> for &ImageId {
3919 #[inline]
3920 unsafe fn encode(
3921 self,
3922 encoder: &mut fidl::encoding::Encoder<'_, D>,
3923 offset: usize,
3924 _depth: fidl::encoding::Depth,
3925 ) -> fidl::Result<()> {
3926 encoder.debug_check_bounds::<ImageId>(offset);
3927 unsafe {
3928 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3930 (buf_ptr as *mut ImageId).write_unaligned((self as *const ImageId).read());
3931 }
3934 Ok(())
3935 }
3936 }
3937 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
3938 fidl::encoding::Encode<ImageId, D> for (T0,)
3939 {
3940 #[inline]
3941 unsafe fn encode(
3942 self,
3943 encoder: &mut fidl::encoding::Encoder<'_, D>,
3944 offset: usize,
3945 depth: fidl::encoding::Depth,
3946 ) -> fidl::Result<()> {
3947 encoder.debug_check_bounds::<ImageId>(offset);
3948 self.0.encode(encoder, offset + 0, depth)?;
3952 Ok(())
3953 }
3954 }
3955
3956 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageId {
3957 #[inline(always)]
3958 fn new_empty() -> Self {
3959 Self { value: fidl::new_empty!(u64, D) }
3960 }
3961
3962 #[inline]
3963 unsafe fn decode(
3964 &mut self,
3965 decoder: &mut fidl::encoding::Decoder<'_, D>,
3966 offset: usize,
3967 _depth: fidl::encoding::Depth,
3968 ) -> fidl::Result<()> {
3969 decoder.debug_check_bounds::<Self>(offset);
3970 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3971 unsafe {
3974 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3975 }
3976 Ok(())
3977 }
3978 }
3979
3980 impl fidl::encoding::ValueTypeMarker for Info {
3981 type Borrowed<'a> = &'a Self;
3982 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3983 value
3984 }
3985 }
3986
3987 unsafe impl fidl::encoding::TypeMarker for Info {
3988 type Owned = Self;
3989
3990 #[inline(always)]
3991 fn inline_align(_context: fidl::encoding::Context) -> usize {
3992 8
3993 }
3994
3995 #[inline(always)]
3996 fn inline_size(_context: fidl::encoding::Context) -> usize {
3997 104
3998 }
3999 }
4000
4001 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Info, D> for &Info {
4002 #[inline]
4003 unsafe fn encode(
4004 self,
4005 encoder: &mut fidl::encoding::Encoder<'_, D>,
4006 offset: usize,
4007 _depth: fidl::encoding::Depth,
4008 ) -> fidl::Result<()> {
4009 encoder.debug_check_bounds::<Info>(offset);
4010 fidl::encoding::Encode::<Info, D>::encode(
4012 (
4013 <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
4014 <fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types__common::Mode> as fidl::encoding::ValueTypeMarker>::borrow(&self.modes),
4015 <fidl::encoding::UnboundedVector<fidl_fuchsia_images2__common::PixelFormat> as fidl::encoding::ValueTypeMarker>::borrow(&self.pixel_format),
4016 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.manufacturer_name),
4017 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.monitor_name),
4018 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.monitor_serial),
4019 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.horizontal_size_mm),
4020 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.vertical_size_mm),
4021 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.using_fallback_size),
4022 ),
4023 encoder, offset, _depth
4024 )
4025 }
4026 }
4027 unsafe impl<
4028 D: fidl::encoding::ResourceDialect,
4029 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
4030 T1: fidl::encoding::Encode<
4031 fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types__common::Mode>,
4032 D,
4033 >,
4034 T2: fidl::encoding::Encode<
4035 fidl::encoding::UnboundedVector<fidl_fuchsia_images2__common::PixelFormat>,
4036 D,
4037 >,
4038 T3: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
4039 T4: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
4040 T5: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
4041 T6: fidl::encoding::Encode<u32, D>,
4042 T7: fidl::encoding::Encode<u32, D>,
4043 T8: fidl::encoding::Encode<bool, D>,
4044 > fidl::encoding::Encode<Info, D> for (T0, T1, T2, T3, T4, T5, T6, T7, T8)
4045 {
4046 #[inline]
4047 unsafe fn encode(
4048 self,
4049 encoder: &mut fidl::encoding::Encoder<'_, D>,
4050 offset: usize,
4051 depth: fidl::encoding::Depth,
4052 ) -> fidl::Result<()> {
4053 encoder.debug_check_bounds::<Info>(offset);
4054 unsafe {
4057 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(96);
4058 (ptr as *mut u64).write_unaligned(0);
4059 }
4060 self.0.encode(encoder, offset + 0, depth)?;
4062 self.1.encode(encoder, offset + 8, depth)?;
4063 self.2.encode(encoder, offset + 24, depth)?;
4064 self.3.encode(encoder, offset + 40, depth)?;
4065 self.4.encode(encoder, offset + 56, depth)?;
4066 self.5.encode(encoder, offset + 72, depth)?;
4067 self.6.encode(encoder, offset + 88, depth)?;
4068 self.7.encode(encoder, offset + 92, depth)?;
4069 self.8.encode(encoder, offset + 96, depth)?;
4070 Ok(())
4071 }
4072 }
4073
4074 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Info {
4075 #[inline(always)]
4076 fn new_empty() -> Self {
4077 Self {
4078 id: fidl::new_empty!(fidl_fuchsia_hardware_display_types__common::DisplayId, D),
4079 modes: fidl::new_empty!(
4080 fidl::encoding::UnboundedVector<
4081 fidl_fuchsia_hardware_display_types__common::Mode,
4082 >,
4083 D
4084 ),
4085 pixel_format: fidl::new_empty!(
4086 fidl::encoding::UnboundedVector<fidl_fuchsia_images2__common::PixelFormat>,
4087 D
4088 ),
4089 manufacturer_name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
4090 monitor_name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
4091 monitor_serial: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
4092 horizontal_size_mm: fidl::new_empty!(u32, D),
4093 vertical_size_mm: fidl::new_empty!(u32, D),
4094 using_fallback_size: fidl::new_empty!(bool, D),
4095 }
4096 }
4097
4098 #[inline]
4099 unsafe fn decode(
4100 &mut self,
4101 decoder: &mut fidl::encoding::Decoder<'_, D>,
4102 offset: usize,
4103 _depth: fidl::encoding::Depth,
4104 ) -> fidl::Result<()> {
4105 decoder.debug_check_bounds::<Self>(offset);
4106 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(96) };
4108 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4109 let mask = 0xffffffffffffff00u64;
4110 let maskedval = padval & mask;
4111 if maskedval != 0 {
4112 return Err(fidl::Error::NonZeroPadding {
4113 padding_start: offset + 96 + ((mask as u64).trailing_zeros() / 8) as usize,
4114 });
4115 }
4116 fidl::decode!(
4117 fidl_fuchsia_hardware_display_types__common::DisplayId,
4118 D,
4119 &mut self.id,
4120 decoder,
4121 offset + 0,
4122 _depth
4123 )?;
4124 fidl::decode!(
4125 fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types__common::Mode>,
4126 D,
4127 &mut self.modes,
4128 decoder,
4129 offset + 8,
4130 _depth
4131 )?;
4132 fidl::decode!(
4133 fidl::encoding::UnboundedVector<fidl_fuchsia_images2__common::PixelFormat>,
4134 D,
4135 &mut self.pixel_format,
4136 decoder,
4137 offset + 24,
4138 _depth
4139 )?;
4140 fidl::decode!(
4141 fidl::encoding::BoundedString<128>,
4142 D,
4143 &mut self.manufacturer_name,
4144 decoder,
4145 offset + 40,
4146 _depth
4147 )?;
4148 fidl::decode!(
4149 fidl::encoding::BoundedString<128>,
4150 D,
4151 &mut self.monitor_name,
4152 decoder,
4153 offset + 56,
4154 _depth
4155 )?;
4156 fidl::decode!(
4157 fidl::encoding::BoundedString<128>,
4158 D,
4159 &mut self.monitor_serial,
4160 decoder,
4161 offset + 72,
4162 _depth
4163 )?;
4164 fidl::decode!(u32, D, &mut self.horizontal_size_mm, decoder, offset + 88, _depth)?;
4165 fidl::decode!(u32, D, &mut self.vertical_size_mm, decoder, offset + 92, _depth)?;
4166 fidl::decode!(bool, D, &mut self.using_fallback_size, decoder, offset + 96, _depth)?;
4167 Ok(())
4168 }
4169 }
4170
4171 impl fidl::encoding::ValueTypeMarker for LayerId {
4172 type Borrowed<'a> = &'a Self;
4173 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4174 value
4175 }
4176 }
4177
4178 unsafe impl fidl::encoding::TypeMarker for LayerId {
4179 type Owned = Self;
4180
4181 #[inline(always)]
4182 fn inline_align(_context: fidl::encoding::Context) -> usize {
4183 8
4184 }
4185
4186 #[inline(always)]
4187 fn inline_size(_context: fidl::encoding::Context) -> usize {
4188 8
4189 }
4190 #[inline(always)]
4191 fn encode_is_copy() -> bool {
4192 true
4193 }
4194
4195 #[inline(always)]
4196 fn decode_is_copy() -> bool {
4197 true
4198 }
4199 }
4200
4201 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayerId, D> for &LayerId {
4202 #[inline]
4203 unsafe fn encode(
4204 self,
4205 encoder: &mut fidl::encoding::Encoder<'_, D>,
4206 offset: usize,
4207 _depth: fidl::encoding::Depth,
4208 ) -> fidl::Result<()> {
4209 encoder.debug_check_bounds::<LayerId>(offset);
4210 unsafe {
4211 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4213 (buf_ptr as *mut LayerId).write_unaligned((self as *const LayerId).read());
4214 }
4217 Ok(())
4218 }
4219 }
4220 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4221 fidl::encoding::Encode<LayerId, D> for (T0,)
4222 {
4223 #[inline]
4224 unsafe fn encode(
4225 self,
4226 encoder: &mut fidl::encoding::Encoder<'_, D>,
4227 offset: usize,
4228 depth: fidl::encoding::Depth,
4229 ) -> fidl::Result<()> {
4230 encoder.debug_check_bounds::<LayerId>(offset);
4231 self.0.encode(encoder, offset + 0, depth)?;
4235 Ok(())
4236 }
4237 }
4238
4239 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayerId {
4240 #[inline(always)]
4241 fn new_empty() -> Self {
4242 Self { value: fidl::new_empty!(u64, D) }
4243 }
4244
4245 #[inline]
4246 unsafe fn decode(
4247 &mut self,
4248 decoder: &mut fidl::encoding::Decoder<'_, D>,
4249 offset: usize,
4250 _depth: fidl::encoding::Depth,
4251 ) -> fidl::Result<()> {
4252 decoder.debug_check_bounds::<Self>(offset);
4253 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4254 unsafe {
4257 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4258 }
4259 Ok(())
4260 }
4261 }
4262
4263 impl fidl::encoding::ValueTypeMarker for VsyncAckCookie {
4264 type Borrowed<'a> = &'a Self;
4265 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4266 value
4267 }
4268 }
4269
4270 unsafe impl fidl::encoding::TypeMarker for VsyncAckCookie {
4271 type Owned = Self;
4272
4273 #[inline(always)]
4274 fn inline_align(_context: fidl::encoding::Context) -> usize {
4275 8
4276 }
4277
4278 #[inline(always)]
4279 fn inline_size(_context: fidl::encoding::Context) -> usize {
4280 8
4281 }
4282 #[inline(always)]
4283 fn encode_is_copy() -> bool {
4284 true
4285 }
4286
4287 #[inline(always)]
4288 fn decode_is_copy() -> bool {
4289 true
4290 }
4291 }
4292
4293 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VsyncAckCookie, D>
4294 for &VsyncAckCookie
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::<VsyncAckCookie>(offset);
4304 unsafe {
4305 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4307 (buf_ptr as *mut VsyncAckCookie)
4308 .write_unaligned((self as *const VsyncAckCookie).read());
4309 }
4312 Ok(())
4313 }
4314 }
4315 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4316 fidl::encoding::Encode<VsyncAckCookie, D> for (T0,)
4317 {
4318 #[inline]
4319 unsafe fn encode(
4320 self,
4321 encoder: &mut fidl::encoding::Encoder<'_, D>,
4322 offset: usize,
4323 depth: fidl::encoding::Depth,
4324 ) -> fidl::Result<()> {
4325 encoder.debug_check_bounds::<VsyncAckCookie>(offset);
4326 self.0.encode(encoder, offset + 0, depth)?;
4330 Ok(())
4331 }
4332 }
4333
4334 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VsyncAckCookie {
4335 #[inline(always)]
4336 fn new_empty() -> Self {
4337 Self { value: fidl::new_empty!(u64, D) }
4338 }
4339
4340 #[inline]
4341 unsafe fn decode(
4342 &mut self,
4343 decoder: &mut fidl::encoding::Decoder<'_, D>,
4344 offset: usize,
4345 _depth: fidl::encoding::Depth,
4346 ) -> fidl::Result<()> {
4347 decoder.debug_check_bounds::<Self>(offset);
4348 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4349 unsafe {
4352 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4353 }
4354 Ok(())
4355 }
4356 }
4357}