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