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