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