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