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