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 CoordinatorCreateLayerRequest {
131 pub layer_id: LayerId,
132}
133
134impl fidl::Persistable for CoordinatorCreateLayerRequest {}
135
136#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
137#[repr(C)]
138pub struct CoordinatorDestroyLayerRequest {
139 pub layer_id: LayerId,
140}
141
142impl fidl::Persistable for CoordinatorDestroyLayerRequest {}
143
144#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
145#[repr(C)]
146pub struct CoordinatorGetLatestAppliedConfigStampResponse {
147 pub stamp: ConfigStamp,
148}
149
150impl fidl::Persistable for CoordinatorGetLatestAppliedConfigStampResponse {}
151
152#[derive(Clone, Debug, PartialEq)]
153pub struct CoordinatorImportImageRequest {
154 pub image_metadata: fidl_fuchsia_hardware_display_types__common::ImageMetadata,
158 pub buffer_collection_id: BufferCollectionId,
163 pub buffer_index: u32,
165 pub image_id: ImageId,
166}
167
168impl fidl::Persistable for CoordinatorImportImageRequest {}
169
170#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
171pub struct CoordinatorListenerOnClientOwnershipChangeRequest {
172 pub has_ownership: bool,
173}
174
175impl fidl::Persistable for CoordinatorListenerOnClientOwnershipChangeRequest {}
176
177#[derive(Clone, Debug, PartialEq)]
178pub struct CoordinatorListenerOnDisplaysChangedRequest {
179 pub added: Vec<Info>,
180 pub removed: Vec<fidl_fuchsia_hardware_display_types__common::DisplayId>,
181}
182
183impl fidl::Persistable for CoordinatorListenerOnDisplaysChangedRequest {}
184
185#[derive(Clone, Debug, PartialEq)]
186pub struct CoordinatorListenerOnVsyncRequest {
187 pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
189 pub timestamp: fidl::MonotonicInstant,
193 pub applied_config_stamp: ConfigStamp,
202 pub cookie: VsyncAckCookie,
211}
212
213impl fidl::Persistable for CoordinatorListenerOnVsyncRequest {}
214
215#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
216#[repr(C)]
217pub struct CoordinatorReleaseBufferCollectionRequest {
218 pub buffer_collection_id: BufferCollectionId,
219}
220
221impl fidl::Persistable for CoordinatorReleaseBufferCollectionRequest {}
222
223#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
224#[repr(C)]
225pub struct CoordinatorReleaseEventRequest {
226 pub id: EventId,
227}
228
229impl fidl::Persistable for CoordinatorReleaseEventRequest {}
230
231#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
232#[repr(C)]
233pub struct CoordinatorReleaseImageRequest {
234 pub image_id: ImageId,
235}
236
237impl fidl::Persistable for CoordinatorReleaseImageRequest {}
238
239#[derive(Clone, Debug, PartialEq)]
240pub struct CoordinatorSetBufferCollectionConstraintsRequest {
241 pub buffer_collection_id: BufferCollectionId,
242 pub buffer_usage: fidl_fuchsia_hardware_display_types__common::ImageBufferUsage,
243}
244
245impl fidl::Persistable for CoordinatorSetBufferCollectionConstraintsRequest {}
246
247#[derive(Clone, Debug, PartialEq)]
248pub struct CoordinatorSetDisplayColorConversionRequest {
249 pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
256 pub preoffsets: [f32; 3],
257 pub coefficients: [f32; 9],
258 pub postoffsets: [f32; 3],
259}
260
261impl fidl::Persistable for CoordinatorSetDisplayColorConversionRequest {}
262
263#[derive(Clone, Debug, PartialEq)]
264pub struct CoordinatorSetDisplayLayersRequest {
265 pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
272 pub layer_ids: Vec<LayerId>,
273}
274
275impl fidl::Persistable for CoordinatorSetDisplayLayersRequest {}
276
277#[derive(Clone, Debug, PartialEq)]
278pub struct CoordinatorSetDisplayModeRequest {
279 pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
286 pub mode: fidl_fuchsia_hardware_display_types__common::Mode,
290}
291
292impl fidl::Persistable for CoordinatorSetDisplayModeRequest {}
293
294#[derive(Clone, Debug, PartialEq)]
295pub struct CoordinatorSetDisplayPowerModeRequest {
296 pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
297 pub power_mode: fidl_fuchsia_hardware_display_types__common::PowerMode,
314}
315
316impl fidl::Persistable for CoordinatorSetDisplayPowerModeRequest {}
317
318#[derive(Clone, Debug, PartialEq)]
319pub struct CoordinatorSetLayerColorConfigRequest {
320 pub layer_id: LayerId,
321 pub color: fidl_fuchsia_hardware_display_types__common::Color,
322 pub display_destination: fidl_fuchsia_math__common::RectU,
331}
332
333impl fidl::Persistable for CoordinatorSetLayerColorConfigRequest {}
334
335#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
336#[repr(C)]
337pub struct CoordinatorSetLayerImage2Request {
338 pub layer_id: LayerId,
339 pub image_id: ImageId,
340 pub wait_event_id: EventId,
341}
342
343impl fidl::Persistable for CoordinatorSetLayerImage2Request {}
344
345#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
346pub struct CoordinatorSetLayerPrimaryAlphaRequest {
347 pub layer_id: LayerId,
348 pub mode: fidl_fuchsia_hardware_display_types__common::AlphaMode,
349 pub val: f32,
350}
351
352impl fidl::Persistable for CoordinatorSetLayerPrimaryAlphaRequest {}
353
354#[derive(Clone, Debug, PartialEq)]
355pub struct CoordinatorSetLayerPrimaryConfigRequest {
356 pub layer_id: LayerId,
357 pub image_metadata: fidl_fuchsia_hardware_display_types__common::ImageMetadata,
358}
359
360impl fidl::Persistable for CoordinatorSetLayerPrimaryConfigRequest {}
361
362#[derive(Clone, Debug, PartialEq)]
363pub struct CoordinatorSetLayerPrimaryPositionRequest {
364 pub layer_id: LayerId,
365 pub image_source_transformation:
372 fidl_fuchsia_hardware_display_types__common::CoordinateTransformation,
373 pub image_source: fidl_fuchsia_math__common::RectU,
386 pub display_destination: fidl_fuchsia_math__common::RectU,
400}
401
402impl fidl::Persistable for CoordinatorSetLayerPrimaryPositionRequest {}
403
404#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
405#[repr(C)]
406pub struct CoordinatorSetMinimumRgbRequest {
407 pub minimum_rgb: u8,
408}
409
410impl fidl::Persistable for CoordinatorSetMinimumRgbRequest {}
411
412#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
413pub struct CoordinatorSetVirtconModeRequest {
414 pub mode: VirtconMode,
415}
416
417impl fidl::Persistable for CoordinatorSetVirtconModeRequest {}
418
419#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
420#[repr(C)]
421pub struct CoordinatorStartCaptureRequest {
422 pub signal_event_id: EventId,
423 pub image_id: ImageId,
424}
425
426impl fidl::Persistable for CoordinatorStartCaptureRequest {}
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_MODE: u64 = 0xf4672f055072c92;
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 CoordinatorCreateLayerRequest {
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 CoordinatorCreateLayerRequest {
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<CoordinatorCreateLayerRequest, D>
1101 for &CoordinatorCreateLayerRequest
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::<CoordinatorCreateLayerRequest>(offset);
1111 unsafe {
1112 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1114 (buf_ptr as *mut CoordinatorCreateLayerRequest)
1115 .write_unaligned((self as *const CoordinatorCreateLayerRequest).read());
1116 }
1119 Ok(())
1120 }
1121 }
1122 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LayerId, D>>
1123 fidl::encoding::Encode<CoordinatorCreateLayerRequest, 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::<CoordinatorCreateLayerRequest>(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 CoordinatorCreateLayerRequest
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 CoordinatorDestroyLayerRequest {
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 CoordinatorDestroyLayerRequest {
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<CoordinatorDestroyLayerRequest, D>
1199 for &CoordinatorDestroyLayerRequest
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::<CoordinatorDestroyLayerRequest>(offset);
1209 unsafe {
1210 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1212 (buf_ptr as *mut CoordinatorDestroyLayerRequest)
1213 .write_unaligned((self as *const CoordinatorDestroyLayerRequest).read());
1214 }
1217 Ok(())
1218 }
1219 }
1220 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LayerId, D>>
1221 fidl::encoding::Encode<CoordinatorDestroyLayerRequest, D> for (T0,)
1222 {
1223 #[inline]
1224 unsafe fn encode(
1225 self,
1226 encoder: &mut fidl::encoding::Encoder<'_, D>,
1227 offset: usize,
1228 depth: fidl::encoding::Depth,
1229 ) -> fidl::Result<()> {
1230 encoder.debug_check_bounds::<CoordinatorDestroyLayerRequest>(offset);
1231 self.0.encode(encoder, offset + 0, depth)?;
1235 Ok(())
1236 }
1237 }
1238
1239 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1240 for CoordinatorDestroyLayerRequest
1241 {
1242 #[inline(always)]
1243 fn new_empty() -> Self {
1244 Self { layer_id: fidl::new_empty!(LayerId, D) }
1245 }
1246
1247 #[inline]
1248 unsafe fn decode(
1249 &mut self,
1250 decoder: &mut fidl::encoding::Decoder<'_, D>,
1251 offset: usize,
1252 _depth: fidl::encoding::Depth,
1253 ) -> fidl::Result<()> {
1254 decoder.debug_check_bounds::<Self>(offset);
1255 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1256 unsafe {
1259 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1260 }
1261 Ok(())
1262 }
1263 }
1264
1265 impl fidl::encoding::ValueTypeMarker for CoordinatorGetLatestAppliedConfigStampResponse {
1266 type Borrowed<'a> = &'a Self;
1267 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1268 value
1269 }
1270 }
1271
1272 unsafe impl fidl::encoding::TypeMarker for CoordinatorGetLatestAppliedConfigStampResponse {
1273 type Owned = Self;
1274
1275 #[inline(always)]
1276 fn inline_align(_context: fidl::encoding::Context) -> usize {
1277 8
1278 }
1279
1280 #[inline(always)]
1281 fn inline_size(_context: fidl::encoding::Context) -> usize {
1282 8
1283 }
1284 #[inline(always)]
1285 fn encode_is_copy() -> bool {
1286 true
1287 }
1288
1289 #[inline(always)]
1290 fn decode_is_copy() -> bool {
1291 true
1292 }
1293 }
1294
1295 unsafe impl<D: fidl::encoding::ResourceDialect>
1296 fidl::encoding::Encode<CoordinatorGetLatestAppliedConfigStampResponse, D>
1297 for &CoordinatorGetLatestAppliedConfigStampResponse
1298 {
1299 #[inline]
1300 unsafe fn encode(
1301 self,
1302 encoder: &mut fidl::encoding::Encoder<'_, D>,
1303 offset: usize,
1304 _depth: fidl::encoding::Depth,
1305 ) -> fidl::Result<()> {
1306 encoder.debug_check_bounds::<CoordinatorGetLatestAppliedConfigStampResponse>(offset);
1307 unsafe {
1308 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1310 (buf_ptr as *mut CoordinatorGetLatestAppliedConfigStampResponse).write_unaligned(
1311 (self as *const CoordinatorGetLatestAppliedConfigStampResponse).read(),
1312 );
1313 }
1316 Ok(())
1317 }
1318 }
1319 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ConfigStamp, D>>
1320 fidl::encoding::Encode<CoordinatorGetLatestAppliedConfigStampResponse, D> for (T0,)
1321 {
1322 #[inline]
1323 unsafe fn encode(
1324 self,
1325 encoder: &mut fidl::encoding::Encoder<'_, D>,
1326 offset: usize,
1327 depth: fidl::encoding::Depth,
1328 ) -> fidl::Result<()> {
1329 encoder.debug_check_bounds::<CoordinatorGetLatestAppliedConfigStampResponse>(offset);
1330 self.0.encode(encoder, offset + 0, depth)?;
1334 Ok(())
1335 }
1336 }
1337
1338 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1339 for CoordinatorGetLatestAppliedConfigStampResponse
1340 {
1341 #[inline(always)]
1342 fn new_empty() -> Self {
1343 Self { stamp: fidl::new_empty!(ConfigStamp, D) }
1344 }
1345
1346 #[inline]
1347 unsafe fn decode(
1348 &mut self,
1349 decoder: &mut fidl::encoding::Decoder<'_, D>,
1350 offset: usize,
1351 _depth: fidl::encoding::Depth,
1352 ) -> fidl::Result<()> {
1353 decoder.debug_check_bounds::<Self>(offset);
1354 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1355 unsafe {
1358 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1359 }
1360 Ok(())
1361 }
1362 }
1363
1364 impl fidl::encoding::ValueTypeMarker for CoordinatorImportImageRequest {
1365 type Borrowed<'a> = &'a Self;
1366 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1367 value
1368 }
1369 }
1370
1371 unsafe impl fidl::encoding::TypeMarker for CoordinatorImportImageRequest {
1372 type Owned = Self;
1373
1374 #[inline(always)]
1375 fn inline_align(_context: fidl::encoding::Context) -> usize {
1376 8
1377 }
1378
1379 #[inline(always)]
1380 fn inline_size(_context: fidl::encoding::Context) -> usize {
1381 40
1382 }
1383 }
1384
1385 unsafe impl<D: fidl::encoding::ResourceDialect>
1386 fidl::encoding::Encode<CoordinatorImportImageRequest, D>
1387 for &CoordinatorImportImageRequest
1388 {
1389 #[inline]
1390 unsafe fn encode(
1391 self,
1392 encoder: &mut fidl::encoding::Encoder<'_, D>,
1393 offset: usize,
1394 _depth: fidl::encoding::Depth,
1395 ) -> fidl::Result<()> {
1396 encoder.debug_check_bounds::<CoordinatorImportImageRequest>(offset);
1397 fidl::encoding::Encode::<CoordinatorImportImageRequest, D>::encode(
1399 (
1400 <fidl_fuchsia_hardware_display_types__common::ImageMetadata as fidl::encoding::ValueTypeMarker>::borrow(&self.image_metadata),
1401 <BufferCollectionId as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_collection_id),
1402 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_index),
1403 <ImageId as fidl::encoding::ValueTypeMarker>::borrow(&self.image_id),
1404 ),
1405 encoder, offset, _depth
1406 )
1407 }
1408 }
1409 unsafe impl<
1410 D: fidl::encoding::ResourceDialect,
1411 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::ImageMetadata, D>,
1412 T1: fidl::encoding::Encode<BufferCollectionId, D>,
1413 T2: fidl::encoding::Encode<u32, D>,
1414 T3: fidl::encoding::Encode<ImageId, D>,
1415 > fidl::encoding::Encode<CoordinatorImportImageRequest, D> for (T0, T1, T2, T3)
1416 {
1417 #[inline]
1418 unsafe fn encode(
1419 self,
1420 encoder: &mut fidl::encoding::Encoder<'_, D>,
1421 offset: usize,
1422 depth: fidl::encoding::Depth,
1423 ) -> fidl::Result<()> {
1424 encoder.debug_check_bounds::<CoordinatorImportImageRequest>(offset);
1425 unsafe {
1428 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
1429 (ptr as *mut u64).write_unaligned(0);
1430 }
1431 unsafe {
1432 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
1433 (ptr as *mut u64).write_unaligned(0);
1434 }
1435 self.0.encode(encoder, offset + 0, depth)?;
1437 self.1.encode(encoder, offset + 16, depth)?;
1438 self.2.encode(encoder, offset + 24, depth)?;
1439 self.3.encode(encoder, offset + 32, depth)?;
1440 Ok(())
1441 }
1442 }
1443
1444 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1445 for CoordinatorImportImageRequest
1446 {
1447 #[inline(always)]
1448 fn new_empty() -> Self {
1449 Self {
1450 image_metadata: fidl::new_empty!(
1451 fidl_fuchsia_hardware_display_types__common::ImageMetadata,
1452 D
1453 ),
1454 buffer_collection_id: fidl::new_empty!(BufferCollectionId, D),
1455 buffer_index: fidl::new_empty!(u32, D),
1456 image_id: fidl::new_empty!(ImageId, D),
1457 }
1458 }
1459
1460 #[inline]
1461 unsafe fn decode(
1462 &mut self,
1463 decoder: &mut fidl::encoding::Decoder<'_, D>,
1464 offset: usize,
1465 _depth: fidl::encoding::Depth,
1466 ) -> fidl::Result<()> {
1467 decoder.debug_check_bounds::<Self>(offset);
1468 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
1470 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1471 let mask = 0xffffffff00000000u64;
1472 let maskedval = padval & mask;
1473 if maskedval != 0 {
1474 return Err(fidl::Error::NonZeroPadding {
1475 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
1476 });
1477 }
1478 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
1479 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1480 let mask = 0xffffffff00000000u64;
1481 let maskedval = padval & mask;
1482 if maskedval != 0 {
1483 return Err(fidl::Error::NonZeroPadding {
1484 padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
1485 });
1486 }
1487 fidl::decode!(
1488 fidl_fuchsia_hardware_display_types__common::ImageMetadata,
1489 D,
1490 &mut self.image_metadata,
1491 decoder,
1492 offset + 0,
1493 _depth
1494 )?;
1495 fidl::decode!(
1496 BufferCollectionId,
1497 D,
1498 &mut self.buffer_collection_id,
1499 decoder,
1500 offset + 16,
1501 _depth
1502 )?;
1503 fidl::decode!(u32, D, &mut self.buffer_index, decoder, offset + 24, _depth)?;
1504 fidl::decode!(ImageId, D, &mut self.image_id, decoder, offset + 32, _depth)?;
1505 Ok(())
1506 }
1507 }
1508
1509 impl fidl::encoding::ValueTypeMarker for CoordinatorListenerOnClientOwnershipChangeRequest {
1510 type Borrowed<'a> = &'a Self;
1511 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1512 value
1513 }
1514 }
1515
1516 unsafe impl fidl::encoding::TypeMarker for CoordinatorListenerOnClientOwnershipChangeRequest {
1517 type Owned = Self;
1518
1519 #[inline(always)]
1520 fn inline_align(_context: fidl::encoding::Context) -> usize {
1521 1
1522 }
1523
1524 #[inline(always)]
1525 fn inline_size(_context: fidl::encoding::Context) -> usize {
1526 1
1527 }
1528 }
1529
1530 unsafe impl<D: fidl::encoding::ResourceDialect>
1531 fidl::encoding::Encode<CoordinatorListenerOnClientOwnershipChangeRequest, D>
1532 for &CoordinatorListenerOnClientOwnershipChangeRequest
1533 {
1534 #[inline]
1535 unsafe fn encode(
1536 self,
1537 encoder: &mut fidl::encoding::Encoder<'_, D>,
1538 offset: usize,
1539 _depth: fidl::encoding::Depth,
1540 ) -> fidl::Result<()> {
1541 encoder.debug_check_bounds::<CoordinatorListenerOnClientOwnershipChangeRequest>(offset);
1542 fidl::encoding::Encode::<CoordinatorListenerOnClientOwnershipChangeRequest, D>::encode(
1544 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.has_ownership),),
1545 encoder,
1546 offset,
1547 _depth,
1548 )
1549 }
1550 }
1551 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
1552 fidl::encoding::Encode<CoordinatorListenerOnClientOwnershipChangeRequest, D> for (T0,)
1553 {
1554 #[inline]
1555 unsafe fn encode(
1556 self,
1557 encoder: &mut fidl::encoding::Encoder<'_, D>,
1558 offset: usize,
1559 depth: fidl::encoding::Depth,
1560 ) -> fidl::Result<()> {
1561 encoder.debug_check_bounds::<CoordinatorListenerOnClientOwnershipChangeRequest>(offset);
1562 self.0.encode(encoder, offset + 0, depth)?;
1566 Ok(())
1567 }
1568 }
1569
1570 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1571 for CoordinatorListenerOnClientOwnershipChangeRequest
1572 {
1573 #[inline(always)]
1574 fn new_empty() -> Self {
1575 Self { has_ownership: fidl::new_empty!(bool, D) }
1576 }
1577
1578 #[inline]
1579 unsafe fn decode(
1580 &mut self,
1581 decoder: &mut fidl::encoding::Decoder<'_, D>,
1582 offset: usize,
1583 _depth: fidl::encoding::Depth,
1584 ) -> fidl::Result<()> {
1585 decoder.debug_check_bounds::<Self>(offset);
1586 fidl::decode!(bool, D, &mut self.has_ownership, decoder, offset + 0, _depth)?;
1588 Ok(())
1589 }
1590 }
1591
1592 impl fidl::encoding::ValueTypeMarker for CoordinatorListenerOnDisplaysChangedRequest {
1593 type Borrowed<'a> = &'a Self;
1594 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1595 value
1596 }
1597 }
1598
1599 unsafe impl fidl::encoding::TypeMarker for CoordinatorListenerOnDisplaysChangedRequest {
1600 type Owned = Self;
1601
1602 #[inline(always)]
1603 fn inline_align(_context: fidl::encoding::Context) -> usize {
1604 8
1605 }
1606
1607 #[inline(always)]
1608 fn inline_size(_context: fidl::encoding::Context) -> usize {
1609 32
1610 }
1611 }
1612
1613 unsafe impl<D: fidl::encoding::ResourceDialect>
1614 fidl::encoding::Encode<CoordinatorListenerOnDisplaysChangedRequest, D>
1615 for &CoordinatorListenerOnDisplaysChangedRequest
1616 {
1617 #[inline]
1618 unsafe fn encode(
1619 self,
1620 encoder: &mut fidl::encoding::Encoder<'_, D>,
1621 offset: usize,
1622 _depth: fidl::encoding::Depth,
1623 ) -> fidl::Result<()> {
1624 encoder.debug_check_bounds::<CoordinatorListenerOnDisplaysChangedRequest>(offset);
1625 fidl::encoding::Encode::<CoordinatorListenerOnDisplaysChangedRequest, D>::encode(
1627 (
1628 <fidl::encoding::UnboundedVector<Info> as fidl::encoding::ValueTypeMarker>::borrow(&self.added),
1629 <fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types__common::DisplayId> as fidl::encoding::ValueTypeMarker>::borrow(&self.removed),
1630 ),
1631 encoder, offset, _depth
1632 )
1633 }
1634 }
1635 unsafe impl<
1636 D: fidl::encoding::ResourceDialect,
1637 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Info>, D>,
1638 T1: fidl::encoding::Encode<
1639 fidl::encoding::UnboundedVector<
1640 fidl_fuchsia_hardware_display_types__common::DisplayId,
1641 >,
1642 D,
1643 >,
1644 > fidl::encoding::Encode<CoordinatorListenerOnDisplaysChangedRequest, D> for (T0, T1)
1645 {
1646 #[inline]
1647 unsafe fn encode(
1648 self,
1649 encoder: &mut fidl::encoding::Encoder<'_, D>,
1650 offset: usize,
1651 depth: fidl::encoding::Depth,
1652 ) -> fidl::Result<()> {
1653 encoder.debug_check_bounds::<CoordinatorListenerOnDisplaysChangedRequest>(offset);
1654 self.0.encode(encoder, offset + 0, depth)?;
1658 self.1.encode(encoder, offset + 16, depth)?;
1659 Ok(())
1660 }
1661 }
1662
1663 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1664 for CoordinatorListenerOnDisplaysChangedRequest
1665 {
1666 #[inline(always)]
1667 fn new_empty() -> Self {
1668 Self {
1669 added: fidl::new_empty!(fidl::encoding::UnboundedVector<Info>, D),
1670 removed: fidl::new_empty!(
1671 fidl::encoding::UnboundedVector<
1672 fidl_fuchsia_hardware_display_types__common::DisplayId,
1673 >,
1674 D
1675 ),
1676 }
1677 }
1678
1679 #[inline]
1680 unsafe fn decode(
1681 &mut self,
1682 decoder: &mut fidl::encoding::Decoder<'_, D>,
1683 offset: usize,
1684 _depth: fidl::encoding::Depth,
1685 ) -> fidl::Result<()> {
1686 decoder.debug_check_bounds::<Self>(offset);
1687 fidl::decode!(
1689 fidl::encoding::UnboundedVector<Info>,
1690 D,
1691 &mut self.added,
1692 decoder,
1693 offset + 0,
1694 _depth
1695 )?;
1696 fidl::decode!(
1697 fidl::encoding::UnboundedVector<
1698 fidl_fuchsia_hardware_display_types__common::DisplayId,
1699 >,
1700 D,
1701 &mut self.removed,
1702 decoder,
1703 offset + 16,
1704 _depth
1705 )?;
1706 Ok(())
1707 }
1708 }
1709
1710 impl fidl::encoding::ValueTypeMarker for CoordinatorListenerOnVsyncRequest {
1711 type Borrowed<'a> = &'a Self;
1712 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1713 value
1714 }
1715 }
1716
1717 unsafe impl fidl::encoding::TypeMarker for CoordinatorListenerOnVsyncRequest {
1718 type Owned = Self;
1719
1720 #[inline(always)]
1721 fn inline_align(_context: fidl::encoding::Context) -> usize {
1722 8
1723 }
1724
1725 #[inline(always)]
1726 fn inline_size(_context: fidl::encoding::Context) -> usize {
1727 32
1728 }
1729 }
1730
1731 unsafe impl<D: fidl::encoding::ResourceDialect>
1732 fidl::encoding::Encode<CoordinatorListenerOnVsyncRequest, D>
1733 for &CoordinatorListenerOnVsyncRequest
1734 {
1735 #[inline]
1736 unsafe fn encode(
1737 self,
1738 encoder: &mut fidl::encoding::Encoder<'_, D>,
1739 offset: usize,
1740 _depth: fidl::encoding::Depth,
1741 ) -> fidl::Result<()> {
1742 encoder.debug_check_bounds::<CoordinatorListenerOnVsyncRequest>(offset);
1743 fidl::encoding::Encode::<CoordinatorListenerOnVsyncRequest, D>::encode(
1745 (
1746 <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
1747 <fidl::MonotonicInstant as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp),
1748 <ConfigStamp as fidl::encoding::ValueTypeMarker>::borrow(&self.applied_config_stamp),
1749 <VsyncAckCookie as fidl::encoding::ValueTypeMarker>::borrow(&self.cookie),
1750 ),
1751 encoder, offset, _depth
1752 )
1753 }
1754 }
1755 unsafe impl<
1756 D: fidl::encoding::ResourceDialect,
1757 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
1758 T1: fidl::encoding::Encode<fidl::MonotonicInstant, D>,
1759 T2: fidl::encoding::Encode<ConfigStamp, D>,
1760 T3: fidl::encoding::Encode<VsyncAckCookie, D>,
1761 > fidl::encoding::Encode<CoordinatorListenerOnVsyncRequest, D> for (T0, T1, T2, T3)
1762 {
1763 #[inline]
1764 unsafe fn encode(
1765 self,
1766 encoder: &mut fidl::encoding::Encoder<'_, D>,
1767 offset: usize,
1768 depth: fidl::encoding::Depth,
1769 ) -> fidl::Result<()> {
1770 encoder.debug_check_bounds::<CoordinatorListenerOnVsyncRequest>(offset);
1771 self.0.encode(encoder, offset + 0, depth)?;
1775 self.1.encode(encoder, offset + 8, depth)?;
1776 self.2.encode(encoder, offset + 16, depth)?;
1777 self.3.encode(encoder, offset + 24, depth)?;
1778 Ok(())
1779 }
1780 }
1781
1782 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1783 for CoordinatorListenerOnVsyncRequest
1784 {
1785 #[inline(always)]
1786 fn new_empty() -> Self {
1787 Self {
1788 display_id: fidl::new_empty!(
1789 fidl_fuchsia_hardware_display_types__common::DisplayId,
1790 D
1791 ),
1792 timestamp: fidl::new_empty!(fidl::MonotonicInstant, D),
1793 applied_config_stamp: fidl::new_empty!(ConfigStamp, D),
1794 cookie: fidl::new_empty!(VsyncAckCookie, D),
1795 }
1796 }
1797
1798 #[inline]
1799 unsafe fn decode(
1800 &mut self,
1801 decoder: &mut fidl::encoding::Decoder<'_, D>,
1802 offset: usize,
1803 _depth: fidl::encoding::Depth,
1804 ) -> fidl::Result<()> {
1805 decoder.debug_check_bounds::<Self>(offset);
1806 fidl::decode!(
1808 fidl_fuchsia_hardware_display_types__common::DisplayId,
1809 D,
1810 &mut self.display_id,
1811 decoder,
1812 offset + 0,
1813 _depth
1814 )?;
1815 fidl::decode!(
1816 fidl::MonotonicInstant,
1817 D,
1818 &mut self.timestamp,
1819 decoder,
1820 offset + 8,
1821 _depth
1822 )?;
1823 fidl::decode!(
1824 ConfigStamp,
1825 D,
1826 &mut self.applied_config_stamp,
1827 decoder,
1828 offset + 16,
1829 _depth
1830 )?;
1831 fidl::decode!(VsyncAckCookie, D, &mut self.cookie, decoder, offset + 24, _depth)?;
1832 Ok(())
1833 }
1834 }
1835
1836 impl fidl::encoding::ValueTypeMarker for CoordinatorReleaseBufferCollectionRequest {
1837 type Borrowed<'a> = &'a Self;
1838 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1839 value
1840 }
1841 }
1842
1843 unsafe impl fidl::encoding::TypeMarker for CoordinatorReleaseBufferCollectionRequest {
1844 type Owned = Self;
1845
1846 #[inline(always)]
1847 fn inline_align(_context: fidl::encoding::Context) -> usize {
1848 8
1849 }
1850
1851 #[inline(always)]
1852 fn inline_size(_context: fidl::encoding::Context) -> usize {
1853 8
1854 }
1855 #[inline(always)]
1856 fn encode_is_copy() -> bool {
1857 true
1858 }
1859
1860 #[inline(always)]
1861 fn decode_is_copy() -> bool {
1862 true
1863 }
1864 }
1865
1866 unsafe impl<D: fidl::encoding::ResourceDialect>
1867 fidl::encoding::Encode<CoordinatorReleaseBufferCollectionRequest, D>
1868 for &CoordinatorReleaseBufferCollectionRequest
1869 {
1870 #[inline]
1871 unsafe fn encode(
1872 self,
1873 encoder: &mut fidl::encoding::Encoder<'_, D>,
1874 offset: usize,
1875 _depth: fidl::encoding::Depth,
1876 ) -> fidl::Result<()> {
1877 encoder.debug_check_bounds::<CoordinatorReleaseBufferCollectionRequest>(offset);
1878 unsafe {
1879 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1881 (buf_ptr as *mut CoordinatorReleaseBufferCollectionRequest).write_unaligned(
1882 (self as *const CoordinatorReleaseBufferCollectionRequest).read(),
1883 );
1884 }
1887 Ok(())
1888 }
1889 }
1890 unsafe impl<
1891 D: fidl::encoding::ResourceDialect,
1892 T0: fidl::encoding::Encode<BufferCollectionId, D>,
1893 > fidl::encoding::Encode<CoordinatorReleaseBufferCollectionRequest, 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::<CoordinatorReleaseBufferCollectionRequest>(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 CoordinatorReleaseBufferCollectionRequest
1913 {
1914 #[inline(always)]
1915 fn new_empty() -> Self {
1916 Self { buffer_collection_id: fidl::new_empty!(BufferCollectionId, 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 CoordinatorReleaseEventRequest {
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 CoordinatorReleaseEventRequest {
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<CoordinatorReleaseEventRequest, D>
1969 for &CoordinatorReleaseEventRequest
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::<CoordinatorReleaseEventRequest>(offset);
1979 unsafe {
1980 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1982 (buf_ptr as *mut CoordinatorReleaseEventRequest)
1983 .write_unaligned((self as *const CoordinatorReleaseEventRequest).read());
1984 }
1987 Ok(())
1988 }
1989 }
1990 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<EventId, D>>
1991 fidl::encoding::Encode<CoordinatorReleaseEventRequest, 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::<CoordinatorReleaseEventRequest>(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 CoordinatorReleaseEventRequest
2011 {
2012 #[inline(always)]
2013 fn new_empty() -> Self {
2014 Self { id: fidl::new_empty!(EventId, 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 CoordinatorReleaseImageRequest {
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 CoordinatorReleaseImageRequest {
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 8
2053 }
2054 #[inline(always)]
2055 fn encode_is_copy() -> bool {
2056 true
2057 }
2058
2059 #[inline(always)]
2060 fn decode_is_copy() -> bool {
2061 true
2062 }
2063 }
2064
2065 unsafe impl<D: fidl::encoding::ResourceDialect>
2066 fidl::encoding::Encode<CoordinatorReleaseImageRequest, D>
2067 for &CoordinatorReleaseImageRequest
2068 {
2069 #[inline]
2070 unsafe fn encode(
2071 self,
2072 encoder: &mut fidl::encoding::Encoder<'_, D>,
2073 offset: usize,
2074 _depth: fidl::encoding::Depth,
2075 ) -> fidl::Result<()> {
2076 encoder.debug_check_bounds::<CoordinatorReleaseImageRequest>(offset);
2077 unsafe {
2078 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2080 (buf_ptr as *mut CoordinatorReleaseImageRequest)
2081 .write_unaligned((self as *const CoordinatorReleaseImageRequest).read());
2082 }
2085 Ok(())
2086 }
2087 }
2088 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ImageId, D>>
2089 fidl::encoding::Encode<CoordinatorReleaseImageRequest, D> for (T0,)
2090 {
2091 #[inline]
2092 unsafe fn encode(
2093 self,
2094 encoder: &mut fidl::encoding::Encoder<'_, D>,
2095 offset: usize,
2096 depth: fidl::encoding::Depth,
2097 ) -> fidl::Result<()> {
2098 encoder.debug_check_bounds::<CoordinatorReleaseImageRequest>(offset);
2099 self.0.encode(encoder, offset + 0, depth)?;
2103 Ok(())
2104 }
2105 }
2106
2107 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2108 for CoordinatorReleaseImageRequest
2109 {
2110 #[inline(always)]
2111 fn new_empty() -> Self {
2112 Self { image_id: fidl::new_empty!(ImageId, D) }
2113 }
2114
2115 #[inline]
2116 unsafe fn decode(
2117 &mut self,
2118 decoder: &mut fidl::encoding::Decoder<'_, D>,
2119 offset: usize,
2120 _depth: fidl::encoding::Depth,
2121 ) -> fidl::Result<()> {
2122 decoder.debug_check_bounds::<Self>(offset);
2123 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2124 unsafe {
2127 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2128 }
2129 Ok(())
2130 }
2131 }
2132
2133 impl fidl::encoding::ValueTypeMarker for CoordinatorSetBufferCollectionConstraintsRequest {
2134 type Borrowed<'a> = &'a Self;
2135 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2136 value
2137 }
2138 }
2139
2140 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetBufferCollectionConstraintsRequest {
2141 type Owned = Self;
2142
2143 #[inline(always)]
2144 fn inline_align(_context: fidl::encoding::Context) -> usize {
2145 8
2146 }
2147
2148 #[inline(always)]
2149 fn inline_size(_context: fidl::encoding::Context) -> usize {
2150 16
2151 }
2152 }
2153
2154 unsafe impl<D: fidl::encoding::ResourceDialect>
2155 fidl::encoding::Encode<CoordinatorSetBufferCollectionConstraintsRequest, D>
2156 for &CoordinatorSetBufferCollectionConstraintsRequest
2157 {
2158 #[inline]
2159 unsafe fn encode(
2160 self,
2161 encoder: &mut fidl::encoding::Encoder<'_, D>,
2162 offset: usize,
2163 _depth: fidl::encoding::Depth,
2164 ) -> fidl::Result<()> {
2165 encoder.debug_check_bounds::<CoordinatorSetBufferCollectionConstraintsRequest>(offset);
2166 fidl::encoding::Encode::<CoordinatorSetBufferCollectionConstraintsRequest, D>::encode(
2168 (
2169 <BufferCollectionId as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_collection_id),
2170 <fidl_fuchsia_hardware_display_types__common::ImageBufferUsage as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_usage),
2171 ),
2172 encoder, offset, _depth
2173 )
2174 }
2175 }
2176 unsafe impl<
2177 D: fidl::encoding::ResourceDialect,
2178 T0: fidl::encoding::Encode<BufferCollectionId, D>,
2179 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::ImageBufferUsage, D>,
2180 > fidl::encoding::Encode<CoordinatorSetBufferCollectionConstraintsRequest, D> for (T0, T1)
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::<CoordinatorSetBufferCollectionConstraintsRequest>(offset);
2190 unsafe {
2193 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2194 (ptr as *mut u64).write_unaligned(0);
2195 }
2196 self.0.encode(encoder, offset + 0, depth)?;
2198 self.1.encode(encoder, offset + 8, depth)?;
2199 Ok(())
2200 }
2201 }
2202
2203 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2204 for CoordinatorSetBufferCollectionConstraintsRequest
2205 {
2206 #[inline(always)]
2207 fn new_empty() -> Self {
2208 Self {
2209 buffer_collection_id: fidl::new_empty!(BufferCollectionId, D),
2210 buffer_usage: fidl::new_empty!(
2211 fidl_fuchsia_hardware_display_types__common::ImageBufferUsage,
2212 D
2213 ),
2214 }
2215 }
2216
2217 #[inline]
2218 unsafe fn decode(
2219 &mut self,
2220 decoder: &mut fidl::encoding::Decoder<'_, D>,
2221 offset: usize,
2222 _depth: fidl::encoding::Depth,
2223 ) -> fidl::Result<()> {
2224 decoder.debug_check_bounds::<Self>(offset);
2225 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2227 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2228 let mask = 0xffffffff00000000u64;
2229 let maskedval = padval & mask;
2230 if maskedval != 0 {
2231 return Err(fidl::Error::NonZeroPadding {
2232 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2233 });
2234 }
2235 fidl::decode!(
2236 BufferCollectionId,
2237 D,
2238 &mut self.buffer_collection_id,
2239 decoder,
2240 offset + 0,
2241 _depth
2242 )?;
2243 fidl::decode!(
2244 fidl_fuchsia_hardware_display_types__common::ImageBufferUsage,
2245 D,
2246 &mut self.buffer_usage,
2247 decoder,
2248 offset + 8,
2249 _depth
2250 )?;
2251 Ok(())
2252 }
2253 }
2254
2255 impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayColorConversionRequest {
2256 type Borrowed<'a> = &'a Self;
2257 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2258 value
2259 }
2260 }
2261
2262 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayColorConversionRequest {
2263 type Owned = Self;
2264
2265 #[inline(always)]
2266 fn inline_align(_context: fidl::encoding::Context) -> usize {
2267 8
2268 }
2269
2270 #[inline(always)]
2271 fn inline_size(_context: fidl::encoding::Context) -> usize {
2272 72
2273 }
2274 }
2275
2276 unsafe impl<D: fidl::encoding::ResourceDialect>
2277 fidl::encoding::Encode<CoordinatorSetDisplayColorConversionRequest, D>
2278 for &CoordinatorSetDisplayColorConversionRequest
2279 {
2280 #[inline]
2281 unsafe fn encode(
2282 self,
2283 encoder: &mut fidl::encoding::Encoder<'_, D>,
2284 offset: usize,
2285 _depth: fidl::encoding::Depth,
2286 ) -> fidl::Result<()> {
2287 encoder.debug_check_bounds::<CoordinatorSetDisplayColorConversionRequest>(offset);
2288 fidl::encoding::Encode::<CoordinatorSetDisplayColorConversionRequest, D>::encode(
2290 (
2291 <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
2292 <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(&self.preoffsets),
2293 <fidl::encoding::Array<f32, 9> as fidl::encoding::ValueTypeMarker>::borrow(&self.coefficients),
2294 <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(&self.postoffsets),
2295 ),
2296 encoder, offset, _depth
2297 )
2298 }
2299 }
2300 unsafe impl<
2301 D: fidl::encoding::ResourceDialect,
2302 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
2303 T1: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
2304 T2: fidl::encoding::Encode<fidl::encoding::Array<f32, 9>, D>,
2305 T3: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
2306 > fidl::encoding::Encode<CoordinatorSetDisplayColorConversionRequest, D> for (T0, T1, T2, T3)
2307 {
2308 #[inline]
2309 unsafe fn encode(
2310 self,
2311 encoder: &mut fidl::encoding::Encoder<'_, D>,
2312 offset: usize,
2313 depth: fidl::encoding::Depth,
2314 ) -> fidl::Result<()> {
2315 encoder.debug_check_bounds::<CoordinatorSetDisplayColorConversionRequest>(offset);
2316 unsafe {
2319 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(64);
2320 (ptr as *mut u64).write_unaligned(0);
2321 }
2322 self.0.encode(encoder, offset + 0, depth)?;
2324 self.1.encode(encoder, offset + 8, depth)?;
2325 self.2.encode(encoder, offset + 20, depth)?;
2326 self.3.encode(encoder, offset + 56, depth)?;
2327 Ok(())
2328 }
2329 }
2330
2331 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2332 for CoordinatorSetDisplayColorConversionRequest
2333 {
2334 #[inline(always)]
2335 fn new_empty() -> Self {
2336 Self {
2337 display_id: fidl::new_empty!(
2338 fidl_fuchsia_hardware_display_types__common::DisplayId,
2339 D
2340 ),
2341 preoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
2342 coefficients: fidl::new_empty!(fidl::encoding::Array<f32, 9>, D),
2343 postoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
2344 }
2345 }
2346
2347 #[inline]
2348 unsafe fn decode(
2349 &mut self,
2350 decoder: &mut fidl::encoding::Decoder<'_, D>,
2351 offset: usize,
2352 _depth: fidl::encoding::Depth,
2353 ) -> fidl::Result<()> {
2354 decoder.debug_check_bounds::<Self>(offset);
2355 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(64) };
2357 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2358 let mask = 0xffffffff00000000u64;
2359 let maskedval = padval & mask;
2360 if maskedval != 0 {
2361 return Err(fidl::Error::NonZeroPadding {
2362 padding_start: offset + 64 + ((mask as u64).trailing_zeros() / 8) as usize,
2363 });
2364 }
2365 fidl::decode!(
2366 fidl_fuchsia_hardware_display_types__common::DisplayId,
2367 D,
2368 &mut self.display_id,
2369 decoder,
2370 offset + 0,
2371 _depth
2372 )?;
2373 fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.preoffsets, decoder, offset + 8, _depth)?;
2374 fidl::decode!(fidl::encoding::Array<f32, 9>, D, &mut self.coefficients, decoder, offset + 20, _depth)?;
2375 fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.postoffsets, decoder, offset + 56, _depth)?;
2376 Ok(())
2377 }
2378 }
2379
2380 impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayLayersRequest {
2381 type Borrowed<'a> = &'a Self;
2382 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2383 value
2384 }
2385 }
2386
2387 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayLayersRequest {
2388 type Owned = Self;
2389
2390 #[inline(always)]
2391 fn inline_align(_context: fidl::encoding::Context) -> usize {
2392 8
2393 }
2394
2395 #[inline(always)]
2396 fn inline_size(_context: fidl::encoding::Context) -> usize {
2397 24
2398 }
2399 }
2400
2401 unsafe impl<D: fidl::encoding::ResourceDialect>
2402 fidl::encoding::Encode<CoordinatorSetDisplayLayersRequest, D>
2403 for &CoordinatorSetDisplayLayersRequest
2404 {
2405 #[inline]
2406 unsafe fn encode(
2407 self,
2408 encoder: &mut fidl::encoding::Encoder<'_, D>,
2409 offset: usize,
2410 _depth: fidl::encoding::Depth,
2411 ) -> fidl::Result<()> {
2412 encoder.debug_check_bounds::<CoordinatorSetDisplayLayersRequest>(offset);
2413 fidl::encoding::Encode::<CoordinatorSetDisplayLayersRequest, D>::encode(
2415 (
2416 <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
2417 <fidl::encoding::UnboundedVector<LayerId> as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_ids),
2418 ),
2419 encoder, offset, _depth
2420 )
2421 }
2422 }
2423 unsafe impl<
2424 D: fidl::encoding::ResourceDialect,
2425 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
2426 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<LayerId>, D>,
2427 > fidl::encoding::Encode<CoordinatorSetDisplayLayersRequest, D> for (T0, T1)
2428 {
2429 #[inline]
2430 unsafe fn encode(
2431 self,
2432 encoder: &mut fidl::encoding::Encoder<'_, D>,
2433 offset: usize,
2434 depth: fidl::encoding::Depth,
2435 ) -> fidl::Result<()> {
2436 encoder.debug_check_bounds::<CoordinatorSetDisplayLayersRequest>(offset);
2437 self.0.encode(encoder, offset + 0, depth)?;
2441 self.1.encode(encoder, offset + 8, depth)?;
2442 Ok(())
2443 }
2444 }
2445
2446 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2447 for CoordinatorSetDisplayLayersRequest
2448 {
2449 #[inline(always)]
2450 fn new_empty() -> Self {
2451 Self {
2452 display_id: fidl::new_empty!(
2453 fidl_fuchsia_hardware_display_types__common::DisplayId,
2454 D
2455 ),
2456 layer_ids: fidl::new_empty!(fidl::encoding::UnboundedVector<LayerId>, D),
2457 }
2458 }
2459
2460 #[inline]
2461 unsafe fn decode(
2462 &mut self,
2463 decoder: &mut fidl::encoding::Decoder<'_, D>,
2464 offset: usize,
2465 _depth: fidl::encoding::Depth,
2466 ) -> fidl::Result<()> {
2467 decoder.debug_check_bounds::<Self>(offset);
2468 fidl::decode!(
2470 fidl_fuchsia_hardware_display_types__common::DisplayId,
2471 D,
2472 &mut self.display_id,
2473 decoder,
2474 offset + 0,
2475 _depth
2476 )?;
2477 fidl::decode!(
2478 fidl::encoding::UnboundedVector<LayerId>,
2479 D,
2480 &mut self.layer_ids,
2481 decoder,
2482 offset + 8,
2483 _depth
2484 )?;
2485 Ok(())
2486 }
2487 }
2488
2489 impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayModeRequest {
2490 type Borrowed<'a> = &'a Self;
2491 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2492 value
2493 }
2494 }
2495
2496 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayModeRequest {
2497 type Owned = Self;
2498
2499 #[inline(always)]
2500 fn inline_align(_context: fidl::encoding::Context) -> usize {
2501 8
2502 }
2503
2504 #[inline(always)]
2505 fn inline_size(_context: fidl::encoding::Context) -> usize {
2506 24
2507 }
2508 }
2509
2510 unsafe impl<D: fidl::encoding::ResourceDialect>
2511 fidl::encoding::Encode<CoordinatorSetDisplayModeRequest, D>
2512 for &CoordinatorSetDisplayModeRequest
2513 {
2514 #[inline]
2515 unsafe fn encode(
2516 self,
2517 encoder: &mut fidl::encoding::Encoder<'_, D>,
2518 offset: usize,
2519 _depth: fidl::encoding::Depth,
2520 ) -> fidl::Result<()> {
2521 encoder.debug_check_bounds::<CoordinatorSetDisplayModeRequest>(offset);
2522 fidl::encoding::Encode::<CoordinatorSetDisplayModeRequest, D>::encode(
2524 (
2525 <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
2526 <fidl_fuchsia_hardware_display_types__common::Mode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
2527 ),
2528 encoder, offset, _depth
2529 )
2530 }
2531 }
2532 unsafe impl<
2533 D: fidl::encoding::ResourceDialect,
2534 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
2535 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::Mode, D>,
2536 > fidl::encoding::Encode<CoordinatorSetDisplayModeRequest, D> for (T0, T1)
2537 {
2538 #[inline]
2539 unsafe fn encode(
2540 self,
2541 encoder: &mut fidl::encoding::Encoder<'_, D>,
2542 offset: usize,
2543 depth: fidl::encoding::Depth,
2544 ) -> fidl::Result<()> {
2545 encoder.debug_check_bounds::<CoordinatorSetDisplayModeRequest>(offset);
2546 self.0.encode(encoder, offset + 0, depth)?;
2550 self.1.encode(encoder, offset + 8, depth)?;
2551 Ok(())
2552 }
2553 }
2554
2555 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2556 for CoordinatorSetDisplayModeRequest
2557 {
2558 #[inline(always)]
2559 fn new_empty() -> Self {
2560 Self {
2561 display_id: fidl::new_empty!(
2562 fidl_fuchsia_hardware_display_types__common::DisplayId,
2563 D
2564 ),
2565 mode: fidl::new_empty!(fidl_fuchsia_hardware_display_types__common::Mode, D),
2566 }
2567 }
2568
2569 #[inline]
2570 unsafe fn decode(
2571 &mut self,
2572 decoder: &mut fidl::encoding::Decoder<'_, D>,
2573 offset: usize,
2574 _depth: fidl::encoding::Depth,
2575 ) -> fidl::Result<()> {
2576 decoder.debug_check_bounds::<Self>(offset);
2577 fidl::decode!(
2579 fidl_fuchsia_hardware_display_types__common::DisplayId,
2580 D,
2581 &mut self.display_id,
2582 decoder,
2583 offset + 0,
2584 _depth
2585 )?;
2586 fidl::decode!(
2587 fidl_fuchsia_hardware_display_types__common::Mode,
2588 D,
2589 &mut self.mode,
2590 decoder,
2591 offset + 8,
2592 _depth
2593 )?;
2594 Ok(())
2595 }
2596 }
2597
2598 impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayPowerModeRequest {
2599 type Borrowed<'a> = &'a Self;
2600 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2601 value
2602 }
2603 }
2604
2605 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayPowerModeRequest {
2606 type Owned = Self;
2607
2608 #[inline(always)]
2609 fn inline_align(_context: fidl::encoding::Context) -> usize {
2610 8
2611 }
2612
2613 #[inline(always)]
2614 fn inline_size(_context: fidl::encoding::Context) -> usize {
2615 16
2616 }
2617 }
2618
2619 unsafe impl<D: fidl::encoding::ResourceDialect>
2620 fidl::encoding::Encode<CoordinatorSetDisplayPowerModeRequest, D>
2621 for &CoordinatorSetDisplayPowerModeRequest
2622 {
2623 #[inline]
2624 unsafe fn encode(
2625 self,
2626 encoder: &mut fidl::encoding::Encoder<'_, D>,
2627 offset: usize,
2628 _depth: fidl::encoding::Depth,
2629 ) -> fidl::Result<()> {
2630 encoder.debug_check_bounds::<CoordinatorSetDisplayPowerModeRequest>(offset);
2631 fidl::encoding::Encode::<CoordinatorSetDisplayPowerModeRequest, D>::encode(
2633 (
2634 <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
2635 <fidl_fuchsia_hardware_display_types__common::PowerMode as fidl::encoding::ValueTypeMarker>::borrow(&self.power_mode),
2636 ),
2637 encoder, offset, _depth
2638 )
2639 }
2640 }
2641 unsafe impl<
2642 D: fidl::encoding::ResourceDialect,
2643 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
2644 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::PowerMode, D>,
2645 > fidl::encoding::Encode<CoordinatorSetDisplayPowerModeRequest, D> for (T0, T1)
2646 {
2647 #[inline]
2648 unsafe fn encode(
2649 self,
2650 encoder: &mut fidl::encoding::Encoder<'_, D>,
2651 offset: usize,
2652 depth: fidl::encoding::Depth,
2653 ) -> fidl::Result<()> {
2654 encoder.debug_check_bounds::<CoordinatorSetDisplayPowerModeRequest>(offset);
2655 unsafe {
2658 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2659 (ptr as *mut u64).write_unaligned(0);
2660 }
2661 self.0.encode(encoder, offset + 0, depth)?;
2663 self.1.encode(encoder, offset + 8, depth)?;
2664 Ok(())
2665 }
2666 }
2667
2668 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2669 for CoordinatorSetDisplayPowerModeRequest
2670 {
2671 #[inline(always)]
2672 fn new_empty() -> Self {
2673 Self {
2674 display_id: fidl::new_empty!(
2675 fidl_fuchsia_hardware_display_types__common::DisplayId,
2676 D
2677 ),
2678 power_mode: fidl::new_empty!(
2679 fidl_fuchsia_hardware_display_types__common::PowerMode,
2680 D
2681 ),
2682 }
2683 }
2684
2685 #[inline]
2686 unsafe fn decode(
2687 &mut self,
2688 decoder: &mut fidl::encoding::Decoder<'_, D>,
2689 offset: usize,
2690 _depth: fidl::encoding::Depth,
2691 ) -> fidl::Result<()> {
2692 decoder.debug_check_bounds::<Self>(offset);
2693 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2695 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2696 let mask = 0xffffffff00000000u64;
2697 let maskedval = padval & mask;
2698 if maskedval != 0 {
2699 return Err(fidl::Error::NonZeroPadding {
2700 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2701 });
2702 }
2703 fidl::decode!(
2704 fidl_fuchsia_hardware_display_types__common::DisplayId,
2705 D,
2706 &mut self.display_id,
2707 decoder,
2708 offset + 0,
2709 _depth
2710 )?;
2711 fidl::decode!(
2712 fidl_fuchsia_hardware_display_types__common::PowerMode,
2713 D,
2714 &mut self.power_mode,
2715 decoder,
2716 offset + 8,
2717 _depth
2718 )?;
2719 Ok(())
2720 }
2721 }
2722
2723 impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerColorConfigRequest {
2724 type Borrowed<'a> = &'a Self;
2725 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2726 value
2727 }
2728 }
2729
2730 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerColorConfigRequest {
2731 type Owned = Self;
2732
2733 #[inline(always)]
2734 fn inline_align(_context: fidl::encoding::Context) -> usize {
2735 8
2736 }
2737
2738 #[inline(always)]
2739 fn inline_size(_context: fidl::encoding::Context) -> usize {
2740 40
2741 }
2742 }
2743
2744 unsafe impl<D: fidl::encoding::ResourceDialect>
2745 fidl::encoding::Encode<CoordinatorSetLayerColorConfigRequest, D>
2746 for &CoordinatorSetLayerColorConfigRequest
2747 {
2748 #[inline]
2749 unsafe fn encode(
2750 self,
2751 encoder: &mut fidl::encoding::Encoder<'_, D>,
2752 offset: usize,
2753 _depth: fidl::encoding::Depth,
2754 ) -> fidl::Result<()> {
2755 encoder.debug_check_bounds::<CoordinatorSetLayerColorConfigRequest>(offset);
2756 fidl::encoding::Encode::<CoordinatorSetLayerColorConfigRequest, D>::encode(
2758 (
2759 <LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
2760 <fidl_fuchsia_hardware_display_types__common::Color as fidl::encoding::ValueTypeMarker>::borrow(&self.color),
2761 <fidl_fuchsia_math__common::RectU as fidl::encoding::ValueTypeMarker>::borrow(&self.display_destination),
2762 ),
2763 encoder, offset, _depth
2764 )
2765 }
2766 }
2767 unsafe impl<
2768 D: fidl::encoding::ResourceDialect,
2769 T0: fidl::encoding::Encode<LayerId, D>,
2770 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::Color, D>,
2771 T2: fidl::encoding::Encode<fidl_fuchsia_math__common::RectU, D>,
2772 > fidl::encoding::Encode<CoordinatorSetLayerColorConfigRequest, D> for (T0, T1, T2)
2773 {
2774 #[inline]
2775 unsafe fn encode(
2776 self,
2777 encoder: &mut fidl::encoding::Encoder<'_, D>,
2778 offset: usize,
2779 depth: fidl::encoding::Depth,
2780 ) -> fidl::Result<()> {
2781 encoder.debug_check_bounds::<CoordinatorSetLayerColorConfigRequest>(offset);
2782 unsafe {
2785 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
2786 (ptr as *mut u64).write_unaligned(0);
2787 }
2788 self.0.encode(encoder, offset + 0, depth)?;
2790 self.1.encode(encoder, offset + 8, depth)?;
2791 self.2.encode(encoder, offset + 20, depth)?;
2792 Ok(())
2793 }
2794 }
2795
2796 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2797 for CoordinatorSetLayerColorConfigRequest
2798 {
2799 #[inline(always)]
2800 fn new_empty() -> Self {
2801 Self {
2802 layer_id: fidl::new_empty!(LayerId, D),
2803 color: fidl::new_empty!(fidl_fuchsia_hardware_display_types__common::Color, D),
2804 display_destination: fidl::new_empty!(fidl_fuchsia_math__common::RectU, D),
2805 }
2806 }
2807
2808 #[inline]
2809 unsafe fn decode(
2810 &mut self,
2811 decoder: &mut fidl::encoding::Decoder<'_, D>,
2812 offset: usize,
2813 _depth: fidl::encoding::Depth,
2814 ) -> fidl::Result<()> {
2815 decoder.debug_check_bounds::<Self>(offset);
2816 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
2818 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2819 let mask = 0xffffffff00000000u64;
2820 let maskedval = padval & mask;
2821 if maskedval != 0 {
2822 return Err(fidl::Error::NonZeroPadding {
2823 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
2824 });
2825 }
2826 fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
2827 fidl::decode!(
2828 fidl_fuchsia_hardware_display_types__common::Color,
2829 D,
2830 &mut self.color,
2831 decoder,
2832 offset + 8,
2833 _depth
2834 )?;
2835 fidl::decode!(
2836 fidl_fuchsia_math__common::RectU,
2837 D,
2838 &mut self.display_destination,
2839 decoder,
2840 offset + 20,
2841 _depth
2842 )?;
2843 Ok(())
2844 }
2845 }
2846
2847 impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerImage2Request {
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 CoordinatorSetLayerImage2Request {
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 24
2865 }
2866 #[inline(always)]
2867 fn encode_is_copy() -> bool {
2868 true
2869 }
2870
2871 #[inline(always)]
2872 fn decode_is_copy() -> bool {
2873 true
2874 }
2875 }
2876
2877 unsafe impl<D: fidl::encoding::ResourceDialect>
2878 fidl::encoding::Encode<CoordinatorSetLayerImage2Request, D>
2879 for &CoordinatorSetLayerImage2Request
2880 {
2881 #[inline]
2882 unsafe fn encode(
2883 self,
2884 encoder: &mut fidl::encoding::Encoder<'_, D>,
2885 offset: usize,
2886 _depth: fidl::encoding::Depth,
2887 ) -> fidl::Result<()> {
2888 encoder.debug_check_bounds::<CoordinatorSetLayerImage2Request>(offset);
2889 unsafe {
2890 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2892 (buf_ptr as *mut CoordinatorSetLayerImage2Request)
2893 .write_unaligned((self as *const CoordinatorSetLayerImage2Request).read());
2894 }
2897 Ok(())
2898 }
2899 }
2900 unsafe impl<
2901 D: fidl::encoding::ResourceDialect,
2902 T0: fidl::encoding::Encode<LayerId, D>,
2903 T1: fidl::encoding::Encode<ImageId, D>,
2904 T2: fidl::encoding::Encode<EventId, D>,
2905 > fidl::encoding::Encode<CoordinatorSetLayerImage2Request, D> for (T0, T1, T2)
2906 {
2907 #[inline]
2908 unsafe fn encode(
2909 self,
2910 encoder: &mut fidl::encoding::Encoder<'_, D>,
2911 offset: usize,
2912 depth: fidl::encoding::Depth,
2913 ) -> fidl::Result<()> {
2914 encoder.debug_check_bounds::<CoordinatorSetLayerImage2Request>(offset);
2915 self.0.encode(encoder, offset + 0, depth)?;
2919 self.1.encode(encoder, offset + 8, depth)?;
2920 self.2.encode(encoder, offset + 16, depth)?;
2921 Ok(())
2922 }
2923 }
2924
2925 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2926 for CoordinatorSetLayerImage2Request
2927 {
2928 #[inline(always)]
2929 fn new_empty() -> Self {
2930 Self {
2931 layer_id: fidl::new_empty!(LayerId, D),
2932 image_id: fidl::new_empty!(ImageId, D),
2933 wait_event_id: fidl::new_empty!(EventId, D),
2934 }
2935 }
2936
2937 #[inline]
2938 unsafe fn decode(
2939 &mut self,
2940 decoder: &mut fidl::encoding::Decoder<'_, D>,
2941 offset: usize,
2942 _depth: fidl::encoding::Depth,
2943 ) -> fidl::Result<()> {
2944 decoder.debug_check_bounds::<Self>(offset);
2945 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2946 unsafe {
2949 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
2950 }
2951 Ok(())
2952 }
2953 }
2954
2955 impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerPrimaryAlphaRequest {
2956 type Borrowed<'a> = &'a Self;
2957 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2958 value
2959 }
2960 }
2961
2962 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerPrimaryAlphaRequest {
2963 type Owned = Self;
2964
2965 #[inline(always)]
2966 fn inline_align(_context: fidl::encoding::Context) -> usize {
2967 8
2968 }
2969
2970 #[inline(always)]
2971 fn inline_size(_context: fidl::encoding::Context) -> usize {
2972 16
2973 }
2974 }
2975
2976 unsafe impl<D: fidl::encoding::ResourceDialect>
2977 fidl::encoding::Encode<CoordinatorSetLayerPrimaryAlphaRequest, D>
2978 for &CoordinatorSetLayerPrimaryAlphaRequest
2979 {
2980 #[inline]
2981 unsafe fn encode(
2982 self,
2983 encoder: &mut fidl::encoding::Encoder<'_, D>,
2984 offset: usize,
2985 _depth: fidl::encoding::Depth,
2986 ) -> fidl::Result<()> {
2987 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryAlphaRequest>(offset);
2988 fidl::encoding::Encode::<CoordinatorSetLayerPrimaryAlphaRequest, D>::encode(
2990 (
2991 <LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
2992 <fidl_fuchsia_hardware_display_types__common::AlphaMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
2993 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.val),
2994 ),
2995 encoder, offset, _depth
2996 )
2997 }
2998 }
2999 unsafe impl<
3000 D: fidl::encoding::ResourceDialect,
3001 T0: fidl::encoding::Encode<LayerId, D>,
3002 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::AlphaMode, D>,
3003 T2: fidl::encoding::Encode<f32, D>,
3004 > fidl::encoding::Encode<CoordinatorSetLayerPrimaryAlphaRequest, D> for (T0, T1, T2)
3005 {
3006 #[inline]
3007 unsafe fn encode(
3008 self,
3009 encoder: &mut fidl::encoding::Encoder<'_, D>,
3010 offset: usize,
3011 depth: fidl::encoding::Depth,
3012 ) -> fidl::Result<()> {
3013 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryAlphaRequest>(offset);
3014 unsafe {
3017 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3018 (ptr as *mut u64).write_unaligned(0);
3019 }
3020 self.0.encode(encoder, offset + 0, depth)?;
3022 self.1.encode(encoder, offset + 8, depth)?;
3023 self.2.encode(encoder, offset + 12, depth)?;
3024 Ok(())
3025 }
3026 }
3027
3028 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3029 for CoordinatorSetLayerPrimaryAlphaRequest
3030 {
3031 #[inline(always)]
3032 fn new_empty() -> Self {
3033 Self {
3034 layer_id: fidl::new_empty!(LayerId, D),
3035 mode: fidl::new_empty!(fidl_fuchsia_hardware_display_types__common::AlphaMode, D),
3036 val: fidl::new_empty!(f32, D),
3037 }
3038 }
3039
3040 #[inline]
3041 unsafe fn decode(
3042 &mut self,
3043 decoder: &mut fidl::encoding::Decoder<'_, D>,
3044 offset: usize,
3045 _depth: fidl::encoding::Depth,
3046 ) -> fidl::Result<()> {
3047 decoder.debug_check_bounds::<Self>(offset);
3048 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3050 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3051 let mask = 0xffffff00u64;
3052 let maskedval = padval & mask;
3053 if maskedval != 0 {
3054 return Err(fidl::Error::NonZeroPadding {
3055 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3056 });
3057 }
3058 fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
3059 fidl::decode!(
3060 fidl_fuchsia_hardware_display_types__common::AlphaMode,
3061 D,
3062 &mut self.mode,
3063 decoder,
3064 offset + 8,
3065 _depth
3066 )?;
3067 fidl::decode!(f32, D, &mut self.val, decoder, offset + 12, _depth)?;
3068 Ok(())
3069 }
3070 }
3071
3072 impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerPrimaryConfigRequest {
3073 type Borrowed<'a> = &'a Self;
3074 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3075 value
3076 }
3077 }
3078
3079 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerPrimaryConfigRequest {
3080 type Owned = Self;
3081
3082 #[inline(always)]
3083 fn inline_align(_context: fidl::encoding::Context) -> usize {
3084 8
3085 }
3086
3087 #[inline(always)]
3088 fn inline_size(_context: fidl::encoding::Context) -> usize {
3089 24
3090 }
3091 }
3092
3093 unsafe impl<D: fidl::encoding::ResourceDialect>
3094 fidl::encoding::Encode<CoordinatorSetLayerPrimaryConfigRequest, D>
3095 for &CoordinatorSetLayerPrimaryConfigRequest
3096 {
3097 #[inline]
3098 unsafe fn encode(
3099 self,
3100 encoder: &mut fidl::encoding::Encoder<'_, D>,
3101 offset: usize,
3102 _depth: fidl::encoding::Depth,
3103 ) -> fidl::Result<()> {
3104 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryConfigRequest>(offset);
3105 fidl::encoding::Encode::<CoordinatorSetLayerPrimaryConfigRequest, D>::encode(
3107 (
3108 <LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
3109 <fidl_fuchsia_hardware_display_types__common::ImageMetadata as fidl::encoding::ValueTypeMarker>::borrow(&self.image_metadata),
3110 ),
3111 encoder, offset, _depth
3112 )
3113 }
3114 }
3115 unsafe impl<
3116 D: fidl::encoding::ResourceDialect,
3117 T0: fidl::encoding::Encode<LayerId, D>,
3118 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::ImageMetadata, D>,
3119 > fidl::encoding::Encode<CoordinatorSetLayerPrimaryConfigRequest, D> for (T0, T1)
3120 {
3121 #[inline]
3122 unsafe fn encode(
3123 self,
3124 encoder: &mut fidl::encoding::Encoder<'_, D>,
3125 offset: usize,
3126 depth: fidl::encoding::Depth,
3127 ) -> fidl::Result<()> {
3128 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryConfigRequest>(offset);
3129 unsafe {
3132 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3133 (ptr as *mut u64).write_unaligned(0);
3134 }
3135 self.0.encode(encoder, offset + 0, depth)?;
3137 self.1.encode(encoder, offset + 8, depth)?;
3138 Ok(())
3139 }
3140 }
3141
3142 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3143 for CoordinatorSetLayerPrimaryConfigRequest
3144 {
3145 #[inline(always)]
3146 fn new_empty() -> Self {
3147 Self {
3148 layer_id: fidl::new_empty!(LayerId, D),
3149 image_metadata: fidl::new_empty!(
3150 fidl_fuchsia_hardware_display_types__common::ImageMetadata,
3151 D
3152 ),
3153 }
3154 }
3155
3156 #[inline]
3157 unsafe fn decode(
3158 &mut self,
3159 decoder: &mut fidl::encoding::Decoder<'_, D>,
3160 offset: usize,
3161 _depth: fidl::encoding::Depth,
3162 ) -> fidl::Result<()> {
3163 decoder.debug_check_bounds::<Self>(offset);
3164 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3166 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3167 let mask = 0xffffffff00000000u64;
3168 let maskedval = padval & mask;
3169 if maskedval != 0 {
3170 return Err(fidl::Error::NonZeroPadding {
3171 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3172 });
3173 }
3174 fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
3175 fidl::decode!(
3176 fidl_fuchsia_hardware_display_types__common::ImageMetadata,
3177 D,
3178 &mut self.image_metadata,
3179 decoder,
3180 offset + 8,
3181 _depth
3182 )?;
3183 Ok(())
3184 }
3185 }
3186
3187 impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerPrimaryPositionRequest {
3188 type Borrowed<'a> = &'a Self;
3189 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3190 value
3191 }
3192 }
3193
3194 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerPrimaryPositionRequest {
3195 type Owned = Self;
3196
3197 #[inline(always)]
3198 fn inline_align(_context: fidl::encoding::Context) -> usize {
3199 8
3200 }
3201
3202 #[inline(always)]
3203 fn inline_size(_context: fidl::encoding::Context) -> usize {
3204 48
3205 }
3206 }
3207
3208 unsafe impl<D: fidl::encoding::ResourceDialect>
3209 fidl::encoding::Encode<CoordinatorSetLayerPrimaryPositionRequest, D>
3210 for &CoordinatorSetLayerPrimaryPositionRequest
3211 {
3212 #[inline]
3213 unsafe fn encode(
3214 self,
3215 encoder: &mut fidl::encoding::Encoder<'_, D>,
3216 offset: usize,
3217 _depth: fidl::encoding::Depth,
3218 ) -> fidl::Result<()> {
3219 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryPositionRequest>(offset);
3220 fidl::encoding::Encode::<CoordinatorSetLayerPrimaryPositionRequest, D>::encode(
3222 (
3223 <LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
3224 <fidl_fuchsia_hardware_display_types__common::CoordinateTransformation as fidl::encoding::ValueTypeMarker>::borrow(&self.image_source_transformation),
3225 <fidl_fuchsia_math__common::RectU as fidl::encoding::ValueTypeMarker>::borrow(&self.image_source),
3226 <fidl_fuchsia_math__common::RectU as fidl::encoding::ValueTypeMarker>::borrow(&self.display_destination),
3227 ),
3228 encoder, offset, _depth
3229 )
3230 }
3231 }
3232 unsafe impl<
3233 D: fidl::encoding::ResourceDialect,
3234 T0: fidl::encoding::Encode<LayerId, D>,
3235 T1: fidl::encoding::Encode<
3236 fidl_fuchsia_hardware_display_types__common::CoordinateTransformation,
3237 D,
3238 >,
3239 T2: fidl::encoding::Encode<fidl_fuchsia_math__common::RectU, D>,
3240 T3: fidl::encoding::Encode<fidl_fuchsia_math__common::RectU, D>,
3241 > fidl::encoding::Encode<CoordinatorSetLayerPrimaryPositionRequest, D> for (T0, T1, T2, T3)
3242 {
3243 #[inline]
3244 unsafe fn encode(
3245 self,
3246 encoder: &mut fidl::encoding::Encoder<'_, D>,
3247 offset: usize,
3248 depth: fidl::encoding::Depth,
3249 ) -> fidl::Result<()> {
3250 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryPositionRequest>(offset);
3251 unsafe {
3254 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3255 (ptr as *mut u64).write_unaligned(0);
3256 }
3257 unsafe {
3258 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
3259 (ptr as *mut u64).write_unaligned(0);
3260 }
3261 self.0.encode(encoder, offset + 0, depth)?;
3263 self.1.encode(encoder, offset + 8, depth)?;
3264 self.2.encode(encoder, offset + 12, depth)?;
3265 self.3.encode(encoder, offset + 28, depth)?;
3266 Ok(())
3267 }
3268 }
3269
3270 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3271 for CoordinatorSetLayerPrimaryPositionRequest
3272 {
3273 #[inline(always)]
3274 fn new_empty() -> Self {
3275 Self {
3276 layer_id: fidl::new_empty!(LayerId, D),
3277 image_source_transformation: fidl::new_empty!(
3278 fidl_fuchsia_hardware_display_types__common::CoordinateTransformation,
3279 D
3280 ),
3281 image_source: fidl::new_empty!(fidl_fuchsia_math__common::RectU, D),
3282 display_destination: fidl::new_empty!(fidl_fuchsia_math__common::RectU, D),
3283 }
3284 }
3285
3286 #[inline]
3287 unsafe fn decode(
3288 &mut self,
3289 decoder: &mut fidl::encoding::Decoder<'_, D>,
3290 offset: usize,
3291 _depth: fidl::encoding::Depth,
3292 ) -> fidl::Result<()> {
3293 decoder.debug_check_bounds::<Self>(offset);
3294 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3296 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3297 let mask = 0xffffff00u64;
3298 let maskedval = padval & mask;
3299 if maskedval != 0 {
3300 return Err(fidl::Error::NonZeroPadding {
3301 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3302 });
3303 }
3304 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
3305 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3306 let mask = 0xffffffff00000000u64;
3307 let maskedval = padval & mask;
3308 if maskedval != 0 {
3309 return Err(fidl::Error::NonZeroPadding {
3310 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
3311 });
3312 }
3313 fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
3314 fidl::decode!(
3315 fidl_fuchsia_hardware_display_types__common::CoordinateTransformation,
3316 D,
3317 &mut self.image_source_transformation,
3318 decoder,
3319 offset + 8,
3320 _depth
3321 )?;
3322 fidl::decode!(
3323 fidl_fuchsia_math__common::RectU,
3324 D,
3325 &mut self.image_source,
3326 decoder,
3327 offset + 12,
3328 _depth
3329 )?;
3330 fidl::decode!(
3331 fidl_fuchsia_math__common::RectU,
3332 D,
3333 &mut self.display_destination,
3334 decoder,
3335 offset + 28,
3336 _depth
3337 )?;
3338 Ok(())
3339 }
3340 }
3341
3342 impl fidl::encoding::ValueTypeMarker for CoordinatorSetMinimumRgbRequest {
3343 type Borrowed<'a> = &'a Self;
3344 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3345 value
3346 }
3347 }
3348
3349 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetMinimumRgbRequest {
3350 type Owned = Self;
3351
3352 #[inline(always)]
3353 fn inline_align(_context: fidl::encoding::Context) -> usize {
3354 1
3355 }
3356
3357 #[inline(always)]
3358 fn inline_size(_context: fidl::encoding::Context) -> usize {
3359 1
3360 }
3361 #[inline(always)]
3362 fn encode_is_copy() -> bool {
3363 true
3364 }
3365
3366 #[inline(always)]
3367 fn decode_is_copy() -> bool {
3368 true
3369 }
3370 }
3371
3372 unsafe impl<D: fidl::encoding::ResourceDialect>
3373 fidl::encoding::Encode<CoordinatorSetMinimumRgbRequest, D>
3374 for &CoordinatorSetMinimumRgbRequest
3375 {
3376 #[inline]
3377 unsafe fn encode(
3378 self,
3379 encoder: &mut fidl::encoding::Encoder<'_, D>,
3380 offset: usize,
3381 _depth: fidl::encoding::Depth,
3382 ) -> fidl::Result<()> {
3383 encoder.debug_check_bounds::<CoordinatorSetMinimumRgbRequest>(offset);
3384 unsafe {
3385 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3387 (buf_ptr as *mut CoordinatorSetMinimumRgbRequest)
3388 .write_unaligned((self as *const CoordinatorSetMinimumRgbRequest).read());
3389 }
3392 Ok(())
3393 }
3394 }
3395 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
3396 fidl::encoding::Encode<CoordinatorSetMinimumRgbRequest, D> for (T0,)
3397 {
3398 #[inline]
3399 unsafe fn encode(
3400 self,
3401 encoder: &mut fidl::encoding::Encoder<'_, D>,
3402 offset: usize,
3403 depth: fidl::encoding::Depth,
3404 ) -> fidl::Result<()> {
3405 encoder.debug_check_bounds::<CoordinatorSetMinimumRgbRequest>(offset);
3406 self.0.encode(encoder, offset + 0, depth)?;
3410 Ok(())
3411 }
3412 }
3413
3414 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3415 for CoordinatorSetMinimumRgbRequest
3416 {
3417 #[inline(always)]
3418 fn new_empty() -> Self {
3419 Self { minimum_rgb: fidl::new_empty!(u8, D) }
3420 }
3421
3422 #[inline]
3423 unsafe fn decode(
3424 &mut self,
3425 decoder: &mut fidl::encoding::Decoder<'_, D>,
3426 offset: usize,
3427 _depth: fidl::encoding::Depth,
3428 ) -> fidl::Result<()> {
3429 decoder.debug_check_bounds::<Self>(offset);
3430 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3431 unsafe {
3434 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
3435 }
3436 Ok(())
3437 }
3438 }
3439
3440 impl fidl::encoding::ValueTypeMarker for CoordinatorSetVirtconModeRequest {
3441 type Borrowed<'a> = &'a Self;
3442 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3443 value
3444 }
3445 }
3446
3447 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetVirtconModeRequest {
3448 type Owned = Self;
3449
3450 #[inline(always)]
3451 fn inline_align(_context: fidl::encoding::Context) -> usize {
3452 1
3453 }
3454
3455 #[inline(always)]
3456 fn inline_size(_context: fidl::encoding::Context) -> usize {
3457 1
3458 }
3459 }
3460
3461 unsafe impl<D: fidl::encoding::ResourceDialect>
3462 fidl::encoding::Encode<CoordinatorSetVirtconModeRequest, D>
3463 for &CoordinatorSetVirtconModeRequest
3464 {
3465 #[inline]
3466 unsafe fn encode(
3467 self,
3468 encoder: &mut fidl::encoding::Encoder<'_, D>,
3469 offset: usize,
3470 _depth: fidl::encoding::Depth,
3471 ) -> fidl::Result<()> {
3472 encoder.debug_check_bounds::<CoordinatorSetVirtconModeRequest>(offset);
3473 fidl::encoding::Encode::<CoordinatorSetVirtconModeRequest, D>::encode(
3475 (<VirtconMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),),
3476 encoder,
3477 offset,
3478 _depth,
3479 )
3480 }
3481 }
3482 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<VirtconMode, D>>
3483 fidl::encoding::Encode<CoordinatorSetVirtconModeRequest, D> for (T0,)
3484 {
3485 #[inline]
3486 unsafe fn encode(
3487 self,
3488 encoder: &mut fidl::encoding::Encoder<'_, D>,
3489 offset: usize,
3490 depth: fidl::encoding::Depth,
3491 ) -> fidl::Result<()> {
3492 encoder.debug_check_bounds::<CoordinatorSetVirtconModeRequest>(offset);
3493 self.0.encode(encoder, offset + 0, depth)?;
3497 Ok(())
3498 }
3499 }
3500
3501 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3502 for CoordinatorSetVirtconModeRequest
3503 {
3504 #[inline(always)]
3505 fn new_empty() -> Self {
3506 Self { mode: fidl::new_empty!(VirtconMode, D) }
3507 }
3508
3509 #[inline]
3510 unsafe fn decode(
3511 &mut self,
3512 decoder: &mut fidl::encoding::Decoder<'_, D>,
3513 offset: usize,
3514 _depth: fidl::encoding::Depth,
3515 ) -> fidl::Result<()> {
3516 decoder.debug_check_bounds::<Self>(offset);
3517 fidl::decode!(VirtconMode, D, &mut self.mode, decoder, offset + 0, _depth)?;
3519 Ok(())
3520 }
3521 }
3522
3523 impl fidl::encoding::ValueTypeMarker for CoordinatorStartCaptureRequest {
3524 type Borrowed<'a> = &'a Self;
3525 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3526 value
3527 }
3528 }
3529
3530 unsafe impl fidl::encoding::TypeMarker for CoordinatorStartCaptureRequest {
3531 type Owned = Self;
3532
3533 #[inline(always)]
3534 fn inline_align(_context: fidl::encoding::Context) -> usize {
3535 8
3536 }
3537
3538 #[inline(always)]
3539 fn inline_size(_context: fidl::encoding::Context) -> usize {
3540 16
3541 }
3542 #[inline(always)]
3543 fn encode_is_copy() -> bool {
3544 true
3545 }
3546
3547 #[inline(always)]
3548 fn decode_is_copy() -> bool {
3549 true
3550 }
3551 }
3552
3553 unsafe impl<D: fidl::encoding::ResourceDialect>
3554 fidl::encoding::Encode<CoordinatorStartCaptureRequest, D>
3555 for &CoordinatorStartCaptureRequest
3556 {
3557 #[inline]
3558 unsafe fn encode(
3559 self,
3560 encoder: &mut fidl::encoding::Encoder<'_, D>,
3561 offset: usize,
3562 _depth: fidl::encoding::Depth,
3563 ) -> fidl::Result<()> {
3564 encoder.debug_check_bounds::<CoordinatorStartCaptureRequest>(offset);
3565 unsafe {
3566 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3568 (buf_ptr as *mut CoordinatorStartCaptureRequest)
3569 .write_unaligned((self as *const CoordinatorStartCaptureRequest).read());
3570 }
3573 Ok(())
3574 }
3575 }
3576 unsafe impl<
3577 D: fidl::encoding::ResourceDialect,
3578 T0: fidl::encoding::Encode<EventId, D>,
3579 T1: fidl::encoding::Encode<ImageId, D>,
3580 > fidl::encoding::Encode<CoordinatorStartCaptureRequest, D> for (T0, T1)
3581 {
3582 #[inline]
3583 unsafe fn encode(
3584 self,
3585 encoder: &mut fidl::encoding::Encoder<'_, D>,
3586 offset: usize,
3587 depth: fidl::encoding::Depth,
3588 ) -> fidl::Result<()> {
3589 encoder.debug_check_bounds::<CoordinatorStartCaptureRequest>(offset);
3590 self.0.encode(encoder, offset + 0, depth)?;
3594 self.1.encode(encoder, offset + 8, depth)?;
3595 Ok(())
3596 }
3597 }
3598
3599 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3600 for CoordinatorStartCaptureRequest
3601 {
3602 #[inline(always)]
3603 fn new_empty() -> Self {
3604 Self {
3605 signal_event_id: fidl::new_empty!(EventId, D),
3606 image_id: fidl::new_empty!(ImageId, D),
3607 }
3608 }
3609
3610 #[inline]
3611 unsafe fn decode(
3612 &mut self,
3613 decoder: &mut fidl::encoding::Decoder<'_, D>,
3614 offset: usize,
3615 _depth: fidl::encoding::Depth,
3616 ) -> fidl::Result<()> {
3617 decoder.debug_check_bounds::<Self>(offset);
3618 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3619 unsafe {
3622 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
3623 }
3624 Ok(())
3625 }
3626 }
3627
3628 impl fidl::encoding::ValueTypeMarker for CoordinatorIsCaptureSupportedResponse {
3629 type Borrowed<'a> = &'a Self;
3630 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3631 value
3632 }
3633 }
3634
3635 unsafe impl fidl::encoding::TypeMarker for CoordinatorIsCaptureSupportedResponse {
3636 type Owned = Self;
3637
3638 #[inline(always)]
3639 fn inline_align(_context: fidl::encoding::Context) -> usize {
3640 1
3641 }
3642
3643 #[inline(always)]
3644 fn inline_size(_context: fidl::encoding::Context) -> usize {
3645 1
3646 }
3647 }
3648
3649 unsafe impl<D: fidl::encoding::ResourceDialect>
3650 fidl::encoding::Encode<CoordinatorIsCaptureSupportedResponse, D>
3651 for &CoordinatorIsCaptureSupportedResponse
3652 {
3653 #[inline]
3654 unsafe fn encode(
3655 self,
3656 encoder: &mut fidl::encoding::Encoder<'_, D>,
3657 offset: usize,
3658 _depth: fidl::encoding::Depth,
3659 ) -> fidl::Result<()> {
3660 encoder.debug_check_bounds::<CoordinatorIsCaptureSupportedResponse>(offset);
3661 fidl::encoding::Encode::<CoordinatorIsCaptureSupportedResponse, D>::encode(
3663 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
3664 encoder,
3665 offset,
3666 _depth,
3667 )
3668 }
3669 }
3670 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
3671 fidl::encoding::Encode<CoordinatorIsCaptureSupportedResponse, D> for (T0,)
3672 {
3673 #[inline]
3674 unsafe fn encode(
3675 self,
3676 encoder: &mut fidl::encoding::Encoder<'_, D>,
3677 offset: usize,
3678 depth: fidl::encoding::Depth,
3679 ) -> fidl::Result<()> {
3680 encoder.debug_check_bounds::<CoordinatorIsCaptureSupportedResponse>(offset);
3681 self.0.encode(encoder, offset + 0, depth)?;
3685 Ok(())
3686 }
3687 }
3688
3689 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3690 for CoordinatorIsCaptureSupportedResponse
3691 {
3692 #[inline(always)]
3693 fn new_empty() -> Self {
3694 Self { supported: fidl::new_empty!(bool, D) }
3695 }
3696
3697 #[inline]
3698 unsafe fn decode(
3699 &mut self,
3700 decoder: &mut fidl::encoding::Decoder<'_, D>,
3701 offset: usize,
3702 _depth: fidl::encoding::Depth,
3703 ) -> fidl::Result<()> {
3704 decoder.debug_check_bounds::<Self>(offset);
3705 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
3707 Ok(())
3708 }
3709 }
3710
3711 impl fidl::encoding::ValueTypeMarker for EventId {
3712 type Borrowed<'a> = &'a Self;
3713 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3714 value
3715 }
3716 }
3717
3718 unsafe impl fidl::encoding::TypeMarker for EventId {
3719 type Owned = Self;
3720
3721 #[inline(always)]
3722 fn inline_align(_context: fidl::encoding::Context) -> usize {
3723 8
3724 }
3725
3726 #[inline(always)]
3727 fn inline_size(_context: fidl::encoding::Context) -> usize {
3728 8
3729 }
3730 #[inline(always)]
3731 fn encode_is_copy() -> bool {
3732 true
3733 }
3734
3735 #[inline(always)]
3736 fn decode_is_copy() -> bool {
3737 true
3738 }
3739 }
3740
3741 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EventId, D> for &EventId {
3742 #[inline]
3743 unsafe fn encode(
3744 self,
3745 encoder: &mut fidl::encoding::Encoder<'_, D>,
3746 offset: usize,
3747 _depth: fidl::encoding::Depth,
3748 ) -> fidl::Result<()> {
3749 encoder.debug_check_bounds::<EventId>(offset);
3750 unsafe {
3751 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3753 (buf_ptr as *mut EventId).write_unaligned((self as *const EventId).read());
3754 }
3757 Ok(())
3758 }
3759 }
3760 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
3761 fidl::encoding::Encode<EventId, D> for (T0,)
3762 {
3763 #[inline]
3764 unsafe fn encode(
3765 self,
3766 encoder: &mut fidl::encoding::Encoder<'_, D>,
3767 offset: usize,
3768 depth: fidl::encoding::Depth,
3769 ) -> fidl::Result<()> {
3770 encoder.debug_check_bounds::<EventId>(offset);
3771 self.0.encode(encoder, offset + 0, depth)?;
3775 Ok(())
3776 }
3777 }
3778
3779 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EventId {
3780 #[inline(always)]
3781 fn new_empty() -> Self {
3782 Self { value: fidl::new_empty!(u64, D) }
3783 }
3784
3785 #[inline]
3786 unsafe fn decode(
3787 &mut self,
3788 decoder: &mut fidl::encoding::Decoder<'_, D>,
3789 offset: usize,
3790 _depth: fidl::encoding::Depth,
3791 ) -> fidl::Result<()> {
3792 decoder.debug_check_bounds::<Self>(offset);
3793 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3794 unsafe {
3797 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3798 }
3799 Ok(())
3800 }
3801 }
3802
3803 impl fidl::encoding::ValueTypeMarker for ImageId {
3804 type Borrowed<'a> = &'a Self;
3805 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3806 value
3807 }
3808 }
3809
3810 unsafe impl fidl::encoding::TypeMarker for ImageId {
3811 type Owned = Self;
3812
3813 #[inline(always)]
3814 fn inline_align(_context: fidl::encoding::Context) -> usize {
3815 8
3816 }
3817
3818 #[inline(always)]
3819 fn inline_size(_context: fidl::encoding::Context) -> usize {
3820 8
3821 }
3822 #[inline(always)]
3823 fn encode_is_copy() -> bool {
3824 true
3825 }
3826
3827 #[inline(always)]
3828 fn decode_is_copy() -> bool {
3829 true
3830 }
3831 }
3832
3833 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ImageId, D> for &ImageId {
3834 #[inline]
3835 unsafe fn encode(
3836 self,
3837 encoder: &mut fidl::encoding::Encoder<'_, D>,
3838 offset: usize,
3839 _depth: fidl::encoding::Depth,
3840 ) -> fidl::Result<()> {
3841 encoder.debug_check_bounds::<ImageId>(offset);
3842 unsafe {
3843 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3845 (buf_ptr as *mut ImageId).write_unaligned((self as *const ImageId).read());
3846 }
3849 Ok(())
3850 }
3851 }
3852 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
3853 fidl::encoding::Encode<ImageId, D> for (T0,)
3854 {
3855 #[inline]
3856 unsafe fn encode(
3857 self,
3858 encoder: &mut fidl::encoding::Encoder<'_, D>,
3859 offset: usize,
3860 depth: fidl::encoding::Depth,
3861 ) -> fidl::Result<()> {
3862 encoder.debug_check_bounds::<ImageId>(offset);
3863 self.0.encode(encoder, offset + 0, depth)?;
3867 Ok(())
3868 }
3869 }
3870
3871 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ImageId {
3872 #[inline(always)]
3873 fn new_empty() -> Self {
3874 Self { value: fidl::new_empty!(u64, D) }
3875 }
3876
3877 #[inline]
3878 unsafe fn decode(
3879 &mut self,
3880 decoder: &mut fidl::encoding::Decoder<'_, D>,
3881 offset: usize,
3882 _depth: fidl::encoding::Depth,
3883 ) -> fidl::Result<()> {
3884 decoder.debug_check_bounds::<Self>(offset);
3885 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3886 unsafe {
3889 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3890 }
3891 Ok(())
3892 }
3893 }
3894
3895 impl fidl::encoding::ValueTypeMarker for Info {
3896 type Borrowed<'a> = &'a Self;
3897 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3898 value
3899 }
3900 }
3901
3902 unsafe impl fidl::encoding::TypeMarker for Info {
3903 type Owned = Self;
3904
3905 #[inline(always)]
3906 fn inline_align(_context: fidl::encoding::Context) -> usize {
3907 8
3908 }
3909
3910 #[inline(always)]
3911 fn inline_size(_context: fidl::encoding::Context) -> usize {
3912 104
3913 }
3914 }
3915
3916 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Info, D> for &Info {
3917 #[inline]
3918 unsafe fn encode(
3919 self,
3920 encoder: &mut fidl::encoding::Encoder<'_, D>,
3921 offset: usize,
3922 _depth: fidl::encoding::Depth,
3923 ) -> fidl::Result<()> {
3924 encoder.debug_check_bounds::<Info>(offset);
3925 fidl::encoding::Encode::<Info, D>::encode(
3927 (
3928 <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
3929 <fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types__common::Mode> as fidl::encoding::ValueTypeMarker>::borrow(&self.modes),
3930 <fidl::encoding::UnboundedVector<fidl_fuchsia_images2__common::PixelFormat> as fidl::encoding::ValueTypeMarker>::borrow(&self.pixel_format),
3931 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.manufacturer_name),
3932 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.monitor_name),
3933 <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(&self.monitor_serial),
3934 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.horizontal_size_mm),
3935 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.vertical_size_mm),
3936 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.using_fallback_size),
3937 ),
3938 encoder, offset, _depth
3939 )
3940 }
3941 }
3942 unsafe impl<
3943 D: fidl::encoding::ResourceDialect,
3944 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
3945 T1: fidl::encoding::Encode<
3946 fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types__common::Mode>,
3947 D,
3948 >,
3949 T2: fidl::encoding::Encode<
3950 fidl::encoding::UnboundedVector<fidl_fuchsia_images2__common::PixelFormat>,
3951 D,
3952 >,
3953 T3: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
3954 T4: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
3955 T5: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
3956 T6: fidl::encoding::Encode<u32, D>,
3957 T7: fidl::encoding::Encode<u32, D>,
3958 T8: fidl::encoding::Encode<bool, D>,
3959 > fidl::encoding::Encode<Info, D> for (T0, T1, T2, T3, T4, T5, T6, T7, T8)
3960 {
3961 #[inline]
3962 unsafe fn encode(
3963 self,
3964 encoder: &mut fidl::encoding::Encoder<'_, D>,
3965 offset: usize,
3966 depth: fidl::encoding::Depth,
3967 ) -> fidl::Result<()> {
3968 encoder.debug_check_bounds::<Info>(offset);
3969 unsafe {
3972 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(96);
3973 (ptr as *mut u64).write_unaligned(0);
3974 }
3975 self.0.encode(encoder, offset + 0, depth)?;
3977 self.1.encode(encoder, offset + 8, depth)?;
3978 self.2.encode(encoder, offset + 24, depth)?;
3979 self.3.encode(encoder, offset + 40, depth)?;
3980 self.4.encode(encoder, offset + 56, depth)?;
3981 self.5.encode(encoder, offset + 72, depth)?;
3982 self.6.encode(encoder, offset + 88, depth)?;
3983 self.7.encode(encoder, offset + 92, depth)?;
3984 self.8.encode(encoder, offset + 96, depth)?;
3985 Ok(())
3986 }
3987 }
3988
3989 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Info {
3990 #[inline(always)]
3991 fn new_empty() -> Self {
3992 Self {
3993 id: fidl::new_empty!(fidl_fuchsia_hardware_display_types__common::DisplayId, D),
3994 modes: fidl::new_empty!(
3995 fidl::encoding::UnboundedVector<
3996 fidl_fuchsia_hardware_display_types__common::Mode,
3997 >,
3998 D
3999 ),
4000 pixel_format: fidl::new_empty!(
4001 fidl::encoding::UnboundedVector<fidl_fuchsia_images2__common::PixelFormat>,
4002 D
4003 ),
4004 manufacturer_name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
4005 monitor_name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
4006 monitor_serial: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
4007 horizontal_size_mm: fidl::new_empty!(u32, D),
4008 vertical_size_mm: fidl::new_empty!(u32, D),
4009 using_fallback_size: fidl::new_empty!(bool, D),
4010 }
4011 }
4012
4013 #[inline]
4014 unsafe fn decode(
4015 &mut self,
4016 decoder: &mut fidl::encoding::Decoder<'_, D>,
4017 offset: usize,
4018 _depth: fidl::encoding::Depth,
4019 ) -> fidl::Result<()> {
4020 decoder.debug_check_bounds::<Self>(offset);
4021 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(96) };
4023 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4024 let mask = 0xffffffffffffff00u64;
4025 let maskedval = padval & mask;
4026 if maskedval != 0 {
4027 return Err(fidl::Error::NonZeroPadding {
4028 padding_start: offset + 96 + ((mask as u64).trailing_zeros() / 8) as usize,
4029 });
4030 }
4031 fidl::decode!(
4032 fidl_fuchsia_hardware_display_types__common::DisplayId,
4033 D,
4034 &mut self.id,
4035 decoder,
4036 offset + 0,
4037 _depth
4038 )?;
4039 fidl::decode!(
4040 fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types__common::Mode>,
4041 D,
4042 &mut self.modes,
4043 decoder,
4044 offset + 8,
4045 _depth
4046 )?;
4047 fidl::decode!(
4048 fidl::encoding::UnboundedVector<fidl_fuchsia_images2__common::PixelFormat>,
4049 D,
4050 &mut self.pixel_format,
4051 decoder,
4052 offset + 24,
4053 _depth
4054 )?;
4055 fidl::decode!(
4056 fidl::encoding::BoundedString<128>,
4057 D,
4058 &mut self.manufacturer_name,
4059 decoder,
4060 offset + 40,
4061 _depth
4062 )?;
4063 fidl::decode!(
4064 fidl::encoding::BoundedString<128>,
4065 D,
4066 &mut self.monitor_name,
4067 decoder,
4068 offset + 56,
4069 _depth
4070 )?;
4071 fidl::decode!(
4072 fidl::encoding::BoundedString<128>,
4073 D,
4074 &mut self.monitor_serial,
4075 decoder,
4076 offset + 72,
4077 _depth
4078 )?;
4079 fidl::decode!(u32, D, &mut self.horizontal_size_mm, decoder, offset + 88, _depth)?;
4080 fidl::decode!(u32, D, &mut self.vertical_size_mm, decoder, offset + 92, _depth)?;
4081 fidl::decode!(bool, D, &mut self.using_fallback_size, decoder, offset + 96, _depth)?;
4082 Ok(())
4083 }
4084 }
4085
4086 impl fidl::encoding::ValueTypeMarker for LayerId {
4087 type Borrowed<'a> = &'a Self;
4088 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4089 value
4090 }
4091 }
4092
4093 unsafe impl fidl::encoding::TypeMarker for LayerId {
4094 type Owned = Self;
4095
4096 #[inline(always)]
4097 fn inline_align(_context: fidl::encoding::Context) -> usize {
4098 8
4099 }
4100
4101 #[inline(always)]
4102 fn inline_size(_context: fidl::encoding::Context) -> usize {
4103 8
4104 }
4105 #[inline(always)]
4106 fn encode_is_copy() -> bool {
4107 true
4108 }
4109
4110 #[inline(always)]
4111 fn decode_is_copy() -> bool {
4112 true
4113 }
4114 }
4115
4116 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LayerId, D> for &LayerId {
4117 #[inline]
4118 unsafe fn encode(
4119 self,
4120 encoder: &mut fidl::encoding::Encoder<'_, D>,
4121 offset: usize,
4122 _depth: fidl::encoding::Depth,
4123 ) -> fidl::Result<()> {
4124 encoder.debug_check_bounds::<LayerId>(offset);
4125 unsafe {
4126 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4128 (buf_ptr as *mut LayerId).write_unaligned((self as *const LayerId).read());
4129 }
4132 Ok(())
4133 }
4134 }
4135 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4136 fidl::encoding::Encode<LayerId, D> for (T0,)
4137 {
4138 #[inline]
4139 unsafe fn encode(
4140 self,
4141 encoder: &mut fidl::encoding::Encoder<'_, D>,
4142 offset: usize,
4143 depth: fidl::encoding::Depth,
4144 ) -> fidl::Result<()> {
4145 encoder.debug_check_bounds::<LayerId>(offset);
4146 self.0.encode(encoder, offset + 0, depth)?;
4150 Ok(())
4151 }
4152 }
4153
4154 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LayerId {
4155 #[inline(always)]
4156 fn new_empty() -> Self {
4157 Self { value: fidl::new_empty!(u64, D) }
4158 }
4159
4160 #[inline]
4161 unsafe fn decode(
4162 &mut self,
4163 decoder: &mut fidl::encoding::Decoder<'_, D>,
4164 offset: usize,
4165 _depth: fidl::encoding::Depth,
4166 ) -> fidl::Result<()> {
4167 decoder.debug_check_bounds::<Self>(offset);
4168 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4169 unsafe {
4172 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4173 }
4174 Ok(())
4175 }
4176 }
4177
4178 impl fidl::encoding::ValueTypeMarker for VsyncAckCookie {
4179 type Borrowed<'a> = &'a Self;
4180 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4181 value
4182 }
4183 }
4184
4185 unsafe impl fidl::encoding::TypeMarker for VsyncAckCookie {
4186 type Owned = Self;
4187
4188 #[inline(always)]
4189 fn inline_align(_context: fidl::encoding::Context) -> usize {
4190 8
4191 }
4192
4193 #[inline(always)]
4194 fn inline_size(_context: fidl::encoding::Context) -> usize {
4195 8
4196 }
4197 #[inline(always)]
4198 fn encode_is_copy() -> bool {
4199 true
4200 }
4201
4202 #[inline(always)]
4203 fn decode_is_copy() -> bool {
4204 true
4205 }
4206 }
4207
4208 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VsyncAckCookie, D>
4209 for &VsyncAckCookie
4210 {
4211 #[inline]
4212 unsafe fn encode(
4213 self,
4214 encoder: &mut fidl::encoding::Encoder<'_, D>,
4215 offset: usize,
4216 _depth: fidl::encoding::Depth,
4217 ) -> fidl::Result<()> {
4218 encoder.debug_check_bounds::<VsyncAckCookie>(offset);
4219 unsafe {
4220 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4222 (buf_ptr as *mut VsyncAckCookie)
4223 .write_unaligned((self as *const VsyncAckCookie).read());
4224 }
4227 Ok(())
4228 }
4229 }
4230 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4231 fidl::encoding::Encode<VsyncAckCookie, D> for (T0,)
4232 {
4233 #[inline]
4234 unsafe fn encode(
4235 self,
4236 encoder: &mut fidl::encoding::Encoder<'_, D>,
4237 offset: usize,
4238 depth: fidl::encoding::Depth,
4239 ) -> fidl::Result<()> {
4240 encoder.debug_check_bounds::<VsyncAckCookie>(offset);
4241 self.0.encode(encoder, offset + 0, depth)?;
4245 Ok(())
4246 }
4247 }
4248
4249 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VsyncAckCookie {
4250 #[inline(always)]
4251 fn new_empty() -> Self {
4252 Self { value: fidl::new_empty!(u64, D) }
4253 }
4254
4255 #[inline]
4256 unsafe fn decode(
4257 &mut self,
4258 decoder: &mut fidl::encoding::Decoder<'_, D>,
4259 offset: usize,
4260 _depth: fidl::encoding::Depth,
4261 ) -> fidl::Result<()> {
4262 decoder.debug_check_bounds::<Self>(offset);
4263 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4264 unsafe {
4267 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4268 }
4269 Ok(())
4270 }
4271 }
4272}