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