1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub type BufferCollectionIdValue = u64;
13
14pub type ConfigStampValue = u64;
16
17pub type EventIdValue = u64;
19
20pub type ImageIdValue = u64;
22
23pub type LayerIdValue = u64;
25
26pub type VsyncAckCookieValue = u64;
28
29pub const IDENTIFIER_MAX_LEN: u32 = 128;
30
31pub const INVALID_CONFIG_STAMP_VALUE: u64 = 0;
32
33pub const MAX_WAITING_IMAGES_PER_LAYER: u32 = 10;
35
36#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
37#[repr(u8)]
38pub enum VirtconMode {
39 Fallback = 0,
41 Forced = 1,
44}
45
46impl VirtconMode {
47 #[inline]
48 pub fn from_primitive(prim: u8) -> Option<Self> {
49 match prim {
50 0 => Some(Self::Fallback),
51 1 => Some(Self::Forced),
52 _ => None,
53 }
54 }
55
56 #[inline]
57 pub const fn into_primitive(self) -> u8 {
58 self as u8
59 }
60}
61
62#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
75#[repr(C)]
76pub struct BufferCollectionId {
77 pub value: u64,
78}
79
80impl fidl::Persistable for BufferCollectionId {}
81
82#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
100#[repr(C)]
101pub struct ConfigStamp {
102 pub value: u64,
103}
104
105impl fidl::Persistable for ConfigStamp {}
106
107#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
108#[repr(C)]
109pub struct CoordinatorAcknowledgeVsyncRequest {
110 pub cookie: u64,
117}
118
119impl fidl::Persistable for CoordinatorAcknowledgeVsyncRequest {}
120
121#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
122pub struct CoordinatorCheckConfigResponse {
123 pub res: fidl_fuchsia_hardware_display_types__common::ConfigResult,
124}
125
126impl fidl::Persistable for CoordinatorCheckConfigResponse {}
127
128#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
129#[repr(C)]
130pub struct CoordinatorDestroyLayerRequest {
131 pub layer_id: LayerId,
132}
133
134impl fidl::Persistable for CoordinatorDestroyLayerRequest {}
135
136#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
137#[repr(C)]
138pub struct CoordinatorGetLatestAppliedConfigStampResponse {
139 pub stamp: ConfigStamp,
140}
141
142impl fidl::Persistable for CoordinatorGetLatestAppliedConfigStampResponse {}
143
144#[derive(Clone, Debug, PartialEq)]
145pub struct CoordinatorImportImageRequest {
146 pub image_metadata: fidl_fuchsia_hardware_display_types__common::ImageMetadata,
150 pub buffer_collection_id: BufferCollectionId,
155 pub buffer_index: u32,
157 pub image_id: ImageId,
158}
159
160impl fidl::Persistable for CoordinatorImportImageRequest {}
161
162#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
163pub struct CoordinatorListenerOnClientOwnershipChangeRequest {
164 pub has_ownership: bool,
165}
166
167impl fidl::Persistable for CoordinatorListenerOnClientOwnershipChangeRequest {}
168
169#[derive(Clone, Debug, PartialEq)]
170pub struct CoordinatorListenerOnDisplaysChangedRequest {
171 pub added: Vec<Info>,
172 pub removed: Vec<fidl_fuchsia_hardware_display_types__common::DisplayId>,
173}
174
175impl fidl::Persistable for CoordinatorListenerOnDisplaysChangedRequest {}
176
177#[derive(Clone, Debug, PartialEq)]
178pub struct CoordinatorListenerOnVsyncRequest {
179 pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
181 pub timestamp: fidl::MonotonicInstant,
185 pub applied_config_stamp: ConfigStamp,
194 pub cookie: VsyncAckCookie,
203}
204
205impl fidl::Persistable for CoordinatorListenerOnVsyncRequest {}
206
207#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
208#[repr(C)]
209pub struct CoordinatorReleaseBufferCollectionRequest {
210 pub buffer_collection_id: BufferCollectionId,
211}
212
213impl fidl::Persistable for CoordinatorReleaseBufferCollectionRequest {}
214
215#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
216#[repr(C)]
217pub struct CoordinatorReleaseEventRequest {
218 pub id: EventId,
219}
220
221impl fidl::Persistable for CoordinatorReleaseEventRequest {}
222
223#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
224#[repr(C)]
225pub struct CoordinatorReleaseImageRequest {
226 pub image_id: ImageId,
227}
228
229impl fidl::Persistable for CoordinatorReleaseImageRequest {}
230
231#[derive(Clone, Debug, PartialEq)]
232pub struct CoordinatorSetBufferCollectionConstraintsRequest {
233 pub buffer_collection_id: BufferCollectionId,
234 pub buffer_usage: fidl_fuchsia_hardware_display_types__common::ImageBufferUsage,
235}
236
237impl fidl::Persistable for CoordinatorSetBufferCollectionConstraintsRequest {}
238
239#[derive(Clone, Debug, PartialEq)]
240pub struct CoordinatorSetDisplayColorConversionRequest {
241 pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
248 pub preoffsets: [f32; 3],
249 pub coefficients: [f32; 9],
250 pub postoffsets: [f32; 3],
251}
252
253impl fidl::Persistable for CoordinatorSetDisplayColorConversionRequest {}
254
255#[derive(Clone, Debug, PartialEq)]
256pub struct CoordinatorSetDisplayLayersRequest {
257 pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
264 pub layer_ids: Vec<LayerId>,
265}
266
267impl fidl::Persistable for CoordinatorSetDisplayLayersRequest {}
268
269#[derive(Clone, Debug, PartialEq)]
270pub struct CoordinatorSetDisplayModeRequest {
271 pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
278 pub mode: fidl_fuchsia_hardware_display_types__common::Mode,
282}
283
284impl fidl::Persistable for CoordinatorSetDisplayModeRequest {}
285
286#[derive(Clone, Debug, PartialEq)]
287pub struct CoordinatorSetDisplayPowerModeRequest {
288 pub display_id: fidl_fuchsia_hardware_display_types__common::DisplayId,
289 pub power_mode: fidl_fuchsia_hardware_display_types__common::PowerMode,
306}
307
308impl fidl::Persistable for CoordinatorSetDisplayPowerModeRequest {}
309
310#[derive(Clone, Debug, PartialEq)]
311pub struct CoordinatorSetLayerColorConfigRequest {
312 pub layer_id: LayerId,
313 pub color: fidl_fuchsia_hardware_display_types__common::Color,
314 pub display_destination: fidl_fuchsia_math__common::RectU,
323}
324
325impl fidl::Persistable for CoordinatorSetLayerColorConfigRequest {}
326
327#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
328#[repr(C)]
329pub struct CoordinatorSetLayerImage2Request {
330 pub layer_id: LayerId,
331 pub image_id: ImageId,
332 pub wait_event_id: EventId,
333}
334
335impl fidl::Persistable for CoordinatorSetLayerImage2Request {}
336
337#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
338pub struct CoordinatorSetLayerPrimaryAlphaRequest {
339 pub layer_id: LayerId,
340 pub mode: fidl_fuchsia_hardware_display_types__common::AlphaMode,
341 pub val: f32,
342}
343
344impl fidl::Persistable for CoordinatorSetLayerPrimaryAlphaRequest {}
345
346#[derive(Clone, Debug, PartialEq)]
347pub struct CoordinatorSetLayerPrimaryConfigRequest {
348 pub layer_id: LayerId,
349 pub image_metadata: fidl_fuchsia_hardware_display_types__common::ImageMetadata,
350}
351
352impl fidl::Persistable for CoordinatorSetLayerPrimaryConfigRequest {}
353
354#[derive(Clone, Debug, PartialEq)]
355pub struct CoordinatorSetLayerPrimaryPositionRequest {
356 pub layer_id: LayerId,
357 pub image_source_transformation:
364 fidl_fuchsia_hardware_display_types__common::CoordinateTransformation,
365 pub image_source: fidl_fuchsia_math__common::RectU,
378 pub display_destination: fidl_fuchsia_math__common::RectU,
392}
393
394impl fidl::Persistable for CoordinatorSetLayerPrimaryPositionRequest {}
395
396#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
397#[repr(C)]
398pub struct CoordinatorSetMinimumRgbRequest {
399 pub minimum_rgb: u8,
400}
401
402impl fidl::Persistable for CoordinatorSetMinimumRgbRequest {}
403
404#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
405pub struct CoordinatorSetVirtconModeRequest {
406 pub mode: VirtconMode,
407}
408
409impl fidl::Persistable for CoordinatorSetVirtconModeRequest {}
410
411#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
412#[repr(C)]
413pub struct CoordinatorStartCaptureRequest {
414 pub signal_event_id: EventId,
415 pub image_id: ImageId,
416}
417
418impl fidl::Persistable for CoordinatorStartCaptureRequest {}
419
420#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
421#[repr(C)]
422pub struct CoordinatorCreateLayerResponse {
423 pub layer_id: LayerId,
424}
425
426impl fidl::Persistable for CoordinatorCreateLayerResponse {}
427
428#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
429pub struct CoordinatorIsCaptureSupportedResponse {
430 pub supported: bool,
431}
432
433impl fidl::Persistable for CoordinatorIsCaptureSupportedResponse {}
434
435#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
447#[repr(C)]
448pub struct EventId {
449 pub value: u64,
450}
451
452impl fidl::Persistable for EventId {}
453
454#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
473#[repr(C)]
474pub struct ImageId {
475 pub value: u64,
476}
477
478impl fidl::Persistable for ImageId {}
479
480#[derive(Clone, Debug, PartialEq)]
484pub struct Info {
485 pub id: fidl_fuchsia_hardware_display_types__common::DisplayId,
489 pub modes: Vec<fidl_fuchsia_hardware_display_types__common::Mode>,
493 pub pixel_format: Vec<fidl_fuchsia_images2__common::PixelFormat>,
514 pub manufacturer_name: String,
522 pub monitor_name: String,
526 pub monitor_serial: String,
530 pub horizontal_size_mm: u32,
535 pub vertical_size_mm: u32,
539 pub using_fallback_size: bool,
541}
542
543impl fidl::Persistable for Info {}
544
545#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
558#[repr(C)]
559pub struct LayerId {
560 pub value: u64,
561}
562
563impl fidl::Persistable for LayerId {}
564
565#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
571#[repr(C)]
572pub struct VsyncAckCookie {
573 pub value: u64,
574}
575
576impl fidl::Persistable for VsyncAckCookie {}
577
578pub mod coordinator_ordinals {
579 pub const IMPORT_IMAGE: u64 = 0x3a8636eb9656b4f4;
580 pub const RELEASE_IMAGE: u64 = 0x477192230517504;
581 pub const IMPORT_EVENT: u64 = 0x2864e5dc59390543;
582 pub const RELEASE_EVENT: u64 = 0x32508c2101606b87;
583 pub const CREATE_LAYER: u64 = 0x2137cfd788a3496b;
584 pub const DESTROY_LAYER: u64 = 0x386e12d092bea2f8;
585 pub const SET_DISPLAY_MODE: u64 = 0xbde3c59ee9c1777;
586 pub const SET_DISPLAY_COLOR_CONVERSION: u64 = 0x2f18186a987d51aa;
587 pub const SET_DISPLAY_LAYERS: u64 = 0x190e0f6f93be1d89;
588 pub const SET_LAYER_PRIMARY_CONFIG: u64 = 0x68d89ebd518b45b9;
589 pub const SET_LAYER_PRIMARY_POSITION: u64 = 0x27b192b5a43851e2;
590 pub const SET_LAYER_PRIMARY_ALPHA: u64 = 0x104cf2b18b27296d;
591 pub const SET_LAYER_COLOR_CONFIG: u64 = 0x2fa91e9a2a01875f;
592 pub const SET_LAYER_IMAGE2: u64 = 0x53c6376dfc13a971;
593 pub const CHECK_CONFIG: u64 = 0x2bcfb4eb16878158;
594 pub const DISCARD_CONFIG: u64 = 0x1673399e9231dedf;
595 pub const GET_LATEST_APPLIED_CONFIG_STAMP: u64 = 0x76a50c0537265f65;
596 pub const APPLY_CONFIG3: u64 = 0x7f0fe0e4f062a67e;
597 pub const ACKNOWLEDGE_VSYNC: u64 = 0x25e921d26107d6ef;
598 pub const SET_VIRTCON_MODE: u64 = 0x4fe0721526068f00;
599 pub const IMPORT_BUFFER_COLLECTION: u64 = 0x30d06f510e7f4601;
600 pub const RELEASE_BUFFER_COLLECTION: u64 = 0x1c7dd5f8b0690be0;
601 pub const SET_BUFFER_COLLECTION_CONSTRAINTS: u64 = 0x509a4ee9af6035df;
602 pub const IS_CAPTURE_SUPPORTED: u64 = 0x4ca407277277971b;
603 pub const START_CAPTURE: u64 = 0x35cb38f19d96a8db;
604 pub const SET_MINIMUM_RGB: u64 = 0x1b49251437038b0b;
605 pub const SET_DISPLAY_POWER_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 CoordinatorDestroyLayerRequest {
1070 type Borrowed<'a> = &'a Self;
1071 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1072 value
1073 }
1074 }
1075
1076 unsafe impl fidl::encoding::TypeMarker for CoordinatorDestroyLayerRequest {
1077 type Owned = Self;
1078
1079 #[inline(always)]
1080 fn inline_align(_context: fidl::encoding::Context) -> usize {
1081 8
1082 }
1083
1084 #[inline(always)]
1085 fn inline_size(_context: fidl::encoding::Context) -> usize {
1086 8
1087 }
1088 #[inline(always)]
1089 fn encode_is_copy() -> bool {
1090 true
1091 }
1092
1093 #[inline(always)]
1094 fn decode_is_copy() -> bool {
1095 true
1096 }
1097 }
1098
1099 unsafe impl<D: fidl::encoding::ResourceDialect>
1100 fidl::encoding::Encode<CoordinatorDestroyLayerRequest, D>
1101 for &CoordinatorDestroyLayerRequest
1102 {
1103 #[inline]
1104 unsafe fn encode(
1105 self,
1106 encoder: &mut fidl::encoding::Encoder<'_, D>,
1107 offset: usize,
1108 _depth: fidl::encoding::Depth,
1109 ) -> fidl::Result<()> {
1110 encoder.debug_check_bounds::<CoordinatorDestroyLayerRequest>(offset);
1111 unsafe {
1112 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1114 (buf_ptr as *mut CoordinatorDestroyLayerRequest)
1115 .write_unaligned((self as *const CoordinatorDestroyLayerRequest).read());
1116 }
1119 Ok(())
1120 }
1121 }
1122 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LayerId, D>>
1123 fidl::encoding::Encode<CoordinatorDestroyLayerRequest, D> for (T0,)
1124 {
1125 #[inline]
1126 unsafe fn encode(
1127 self,
1128 encoder: &mut fidl::encoding::Encoder<'_, D>,
1129 offset: usize,
1130 depth: fidl::encoding::Depth,
1131 ) -> fidl::Result<()> {
1132 encoder.debug_check_bounds::<CoordinatorDestroyLayerRequest>(offset);
1133 self.0.encode(encoder, offset + 0, depth)?;
1137 Ok(())
1138 }
1139 }
1140
1141 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1142 for CoordinatorDestroyLayerRequest
1143 {
1144 #[inline(always)]
1145 fn new_empty() -> Self {
1146 Self { layer_id: fidl::new_empty!(LayerId, D) }
1147 }
1148
1149 #[inline]
1150 unsafe fn decode(
1151 &mut self,
1152 decoder: &mut fidl::encoding::Decoder<'_, D>,
1153 offset: usize,
1154 _depth: fidl::encoding::Depth,
1155 ) -> fidl::Result<()> {
1156 decoder.debug_check_bounds::<Self>(offset);
1157 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1158 unsafe {
1161 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1162 }
1163 Ok(())
1164 }
1165 }
1166
1167 impl fidl::encoding::ValueTypeMarker for CoordinatorGetLatestAppliedConfigStampResponse {
1168 type Borrowed<'a> = &'a Self;
1169 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1170 value
1171 }
1172 }
1173
1174 unsafe impl fidl::encoding::TypeMarker for CoordinatorGetLatestAppliedConfigStampResponse {
1175 type Owned = Self;
1176
1177 #[inline(always)]
1178 fn inline_align(_context: fidl::encoding::Context) -> usize {
1179 8
1180 }
1181
1182 #[inline(always)]
1183 fn inline_size(_context: fidl::encoding::Context) -> usize {
1184 8
1185 }
1186 #[inline(always)]
1187 fn encode_is_copy() -> bool {
1188 true
1189 }
1190
1191 #[inline(always)]
1192 fn decode_is_copy() -> bool {
1193 true
1194 }
1195 }
1196
1197 unsafe impl<D: fidl::encoding::ResourceDialect>
1198 fidl::encoding::Encode<CoordinatorGetLatestAppliedConfigStampResponse, D>
1199 for &CoordinatorGetLatestAppliedConfigStampResponse
1200 {
1201 #[inline]
1202 unsafe fn encode(
1203 self,
1204 encoder: &mut fidl::encoding::Encoder<'_, D>,
1205 offset: usize,
1206 _depth: fidl::encoding::Depth,
1207 ) -> fidl::Result<()> {
1208 encoder.debug_check_bounds::<CoordinatorGetLatestAppliedConfigStampResponse>(offset);
1209 unsafe {
1210 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1212 (buf_ptr as *mut CoordinatorGetLatestAppliedConfigStampResponse).write_unaligned(
1213 (self as *const CoordinatorGetLatestAppliedConfigStampResponse).read(),
1214 );
1215 }
1218 Ok(())
1219 }
1220 }
1221 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ConfigStamp, D>>
1222 fidl::encoding::Encode<CoordinatorGetLatestAppliedConfigStampResponse, D> for (T0,)
1223 {
1224 #[inline]
1225 unsafe fn encode(
1226 self,
1227 encoder: &mut fidl::encoding::Encoder<'_, D>,
1228 offset: usize,
1229 depth: fidl::encoding::Depth,
1230 ) -> fidl::Result<()> {
1231 encoder.debug_check_bounds::<CoordinatorGetLatestAppliedConfigStampResponse>(offset);
1232 self.0.encode(encoder, offset + 0, depth)?;
1236 Ok(())
1237 }
1238 }
1239
1240 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1241 for CoordinatorGetLatestAppliedConfigStampResponse
1242 {
1243 #[inline(always)]
1244 fn new_empty() -> Self {
1245 Self { stamp: fidl::new_empty!(ConfigStamp, D) }
1246 }
1247
1248 #[inline]
1249 unsafe fn decode(
1250 &mut self,
1251 decoder: &mut fidl::encoding::Decoder<'_, D>,
1252 offset: usize,
1253 _depth: fidl::encoding::Depth,
1254 ) -> fidl::Result<()> {
1255 decoder.debug_check_bounds::<Self>(offset);
1256 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1257 unsafe {
1260 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1261 }
1262 Ok(())
1263 }
1264 }
1265
1266 impl fidl::encoding::ValueTypeMarker for CoordinatorImportImageRequest {
1267 type Borrowed<'a> = &'a Self;
1268 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1269 value
1270 }
1271 }
1272
1273 unsafe impl fidl::encoding::TypeMarker for CoordinatorImportImageRequest {
1274 type Owned = Self;
1275
1276 #[inline(always)]
1277 fn inline_align(_context: fidl::encoding::Context) -> usize {
1278 8
1279 }
1280
1281 #[inline(always)]
1282 fn inline_size(_context: fidl::encoding::Context) -> usize {
1283 40
1284 }
1285 }
1286
1287 unsafe impl<D: fidl::encoding::ResourceDialect>
1288 fidl::encoding::Encode<CoordinatorImportImageRequest, D>
1289 for &CoordinatorImportImageRequest
1290 {
1291 #[inline]
1292 unsafe fn encode(
1293 self,
1294 encoder: &mut fidl::encoding::Encoder<'_, D>,
1295 offset: usize,
1296 _depth: fidl::encoding::Depth,
1297 ) -> fidl::Result<()> {
1298 encoder.debug_check_bounds::<CoordinatorImportImageRequest>(offset);
1299 fidl::encoding::Encode::<CoordinatorImportImageRequest, D>::encode(
1301 (
1302 <fidl_fuchsia_hardware_display_types__common::ImageMetadata as fidl::encoding::ValueTypeMarker>::borrow(&self.image_metadata),
1303 <BufferCollectionId as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_collection_id),
1304 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_index),
1305 <ImageId as fidl::encoding::ValueTypeMarker>::borrow(&self.image_id),
1306 ),
1307 encoder, offset, _depth
1308 )
1309 }
1310 }
1311 unsafe impl<
1312 D: fidl::encoding::ResourceDialect,
1313 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::ImageMetadata, D>,
1314 T1: fidl::encoding::Encode<BufferCollectionId, D>,
1315 T2: fidl::encoding::Encode<u32, D>,
1316 T3: fidl::encoding::Encode<ImageId, D>,
1317 > fidl::encoding::Encode<CoordinatorImportImageRequest, D> for (T0, T1, T2, T3)
1318 {
1319 #[inline]
1320 unsafe fn encode(
1321 self,
1322 encoder: &mut fidl::encoding::Encoder<'_, D>,
1323 offset: usize,
1324 depth: fidl::encoding::Depth,
1325 ) -> fidl::Result<()> {
1326 encoder.debug_check_bounds::<CoordinatorImportImageRequest>(offset);
1327 unsafe {
1330 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
1331 (ptr as *mut u64).write_unaligned(0);
1332 }
1333 unsafe {
1334 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
1335 (ptr as *mut u64).write_unaligned(0);
1336 }
1337 self.0.encode(encoder, offset + 0, depth)?;
1339 self.1.encode(encoder, offset + 16, depth)?;
1340 self.2.encode(encoder, offset + 24, depth)?;
1341 self.3.encode(encoder, offset + 32, depth)?;
1342 Ok(())
1343 }
1344 }
1345
1346 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1347 for CoordinatorImportImageRequest
1348 {
1349 #[inline(always)]
1350 fn new_empty() -> Self {
1351 Self {
1352 image_metadata: fidl::new_empty!(
1353 fidl_fuchsia_hardware_display_types__common::ImageMetadata,
1354 D
1355 ),
1356 buffer_collection_id: fidl::new_empty!(BufferCollectionId, D),
1357 buffer_index: fidl::new_empty!(u32, D),
1358 image_id: fidl::new_empty!(ImageId, D),
1359 }
1360 }
1361
1362 #[inline]
1363 unsafe fn decode(
1364 &mut self,
1365 decoder: &mut fidl::encoding::Decoder<'_, D>,
1366 offset: usize,
1367 _depth: fidl::encoding::Depth,
1368 ) -> fidl::Result<()> {
1369 decoder.debug_check_bounds::<Self>(offset);
1370 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
1372 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1373 let mask = 0xffffffff00000000u64;
1374 let maskedval = padval & mask;
1375 if maskedval != 0 {
1376 return Err(fidl::Error::NonZeroPadding {
1377 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
1378 });
1379 }
1380 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
1381 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1382 let mask = 0xffffffff00000000u64;
1383 let maskedval = padval & mask;
1384 if maskedval != 0 {
1385 return Err(fidl::Error::NonZeroPadding {
1386 padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
1387 });
1388 }
1389 fidl::decode!(
1390 fidl_fuchsia_hardware_display_types__common::ImageMetadata,
1391 D,
1392 &mut self.image_metadata,
1393 decoder,
1394 offset + 0,
1395 _depth
1396 )?;
1397 fidl::decode!(
1398 BufferCollectionId,
1399 D,
1400 &mut self.buffer_collection_id,
1401 decoder,
1402 offset + 16,
1403 _depth
1404 )?;
1405 fidl::decode!(u32, D, &mut self.buffer_index, decoder, offset + 24, _depth)?;
1406 fidl::decode!(ImageId, D, &mut self.image_id, decoder, offset + 32, _depth)?;
1407 Ok(())
1408 }
1409 }
1410
1411 impl fidl::encoding::ValueTypeMarker for CoordinatorListenerOnClientOwnershipChangeRequest {
1412 type Borrowed<'a> = &'a Self;
1413 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1414 value
1415 }
1416 }
1417
1418 unsafe impl fidl::encoding::TypeMarker for CoordinatorListenerOnClientOwnershipChangeRequest {
1419 type Owned = Self;
1420
1421 #[inline(always)]
1422 fn inline_align(_context: fidl::encoding::Context) -> usize {
1423 1
1424 }
1425
1426 #[inline(always)]
1427 fn inline_size(_context: fidl::encoding::Context) -> usize {
1428 1
1429 }
1430 }
1431
1432 unsafe impl<D: fidl::encoding::ResourceDialect>
1433 fidl::encoding::Encode<CoordinatorListenerOnClientOwnershipChangeRequest, D>
1434 for &CoordinatorListenerOnClientOwnershipChangeRequest
1435 {
1436 #[inline]
1437 unsafe fn encode(
1438 self,
1439 encoder: &mut fidl::encoding::Encoder<'_, D>,
1440 offset: usize,
1441 _depth: fidl::encoding::Depth,
1442 ) -> fidl::Result<()> {
1443 encoder.debug_check_bounds::<CoordinatorListenerOnClientOwnershipChangeRequest>(offset);
1444 fidl::encoding::Encode::<CoordinatorListenerOnClientOwnershipChangeRequest, D>::encode(
1446 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.has_ownership),),
1447 encoder,
1448 offset,
1449 _depth,
1450 )
1451 }
1452 }
1453 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
1454 fidl::encoding::Encode<CoordinatorListenerOnClientOwnershipChangeRequest, D> for (T0,)
1455 {
1456 #[inline]
1457 unsafe fn encode(
1458 self,
1459 encoder: &mut fidl::encoding::Encoder<'_, D>,
1460 offset: usize,
1461 depth: fidl::encoding::Depth,
1462 ) -> fidl::Result<()> {
1463 encoder.debug_check_bounds::<CoordinatorListenerOnClientOwnershipChangeRequest>(offset);
1464 self.0.encode(encoder, offset + 0, depth)?;
1468 Ok(())
1469 }
1470 }
1471
1472 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1473 for CoordinatorListenerOnClientOwnershipChangeRequest
1474 {
1475 #[inline(always)]
1476 fn new_empty() -> Self {
1477 Self { has_ownership: fidl::new_empty!(bool, D) }
1478 }
1479
1480 #[inline]
1481 unsafe fn decode(
1482 &mut self,
1483 decoder: &mut fidl::encoding::Decoder<'_, D>,
1484 offset: usize,
1485 _depth: fidl::encoding::Depth,
1486 ) -> fidl::Result<()> {
1487 decoder.debug_check_bounds::<Self>(offset);
1488 fidl::decode!(bool, D, &mut self.has_ownership, decoder, offset + 0, _depth)?;
1490 Ok(())
1491 }
1492 }
1493
1494 impl fidl::encoding::ValueTypeMarker for CoordinatorListenerOnDisplaysChangedRequest {
1495 type Borrowed<'a> = &'a Self;
1496 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1497 value
1498 }
1499 }
1500
1501 unsafe impl fidl::encoding::TypeMarker for CoordinatorListenerOnDisplaysChangedRequest {
1502 type Owned = Self;
1503
1504 #[inline(always)]
1505 fn inline_align(_context: fidl::encoding::Context) -> usize {
1506 8
1507 }
1508
1509 #[inline(always)]
1510 fn inline_size(_context: fidl::encoding::Context) -> usize {
1511 32
1512 }
1513 }
1514
1515 unsafe impl<D: fidl::encoding::ResourceDialect>
1516 fidl::encoding::Encode<CoordinatorListenerOnDisplaysChangedRequest, D>
1517 for &CoordinatorListenerOnDisplaysChangedRequest
1518 {
1519 #[inline]
1520 unsafe fn encode(
1521 self,
1522 encoder: &mut fidl::encoding::Encoder<'_, D>,
1523 offset: usize,
1524 _depth: fidl::encoding::Depth,
1525 ) -> fidl::Result<()> {
1526 encoder.debug_check_bounds::<CoordinatorListenerOnDisplaysChangedRequest>(offset);
1527 fidl::encoding::Encode::<CoordinatorListenerOnDisplaysChangedRequest, D>::encode(
1529 (
1530 <fidl::encoding::UnboundedVector<Info> as fidl::encoding::ValueTypeMarker>::borrow(&self.added),
1531 <fidl::encoding::UnboundedVector<fidl_fuchsia_hardware_display_types__common::DisplayId> as fidl::encoding::ValueTypeMarker>::borrow(&self.removed),
1532 ),
1533 encoder, offset, _depth
1534 )
1535 }
1536 }
1537 unsafe impl<
1538 D: fidl::encoding::ResourceDialect,
1539 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Info>, D>,
1540 T1: fidl::encoding::Encode<
1541 fidl::encoding::UnboundedVector<
1542 fidl_fuchsia_hardware_display_types__common::DisplayId,
1543 >,
1544 D,
1545 >,
1546 > fidl::encoding::Encode<CoordinatorListenerOnDisplaysChangedRequest, D> for (T0, T1)
1547 {
1548 #[inline]
1549 unsafe fn encode(
1550 self,
1551 encoder: &mut fidl::encoding::Encoder<'_, D>,
1552 offset: usize,
1553 depth: fidl::encoding::Depth,
1554 ) -> fidl::Result<()> {
1555 encoder.debug_check_bounds::<CoordinatorListenerOnDisplaysChangedRequest>(offset);
1556 self.0.encode(encoder, offset + 0, depth)?;
1560 self.1.encode(encoder, offset + 16, depth)?;
1561 Ok(())
1562 }
1563 }
1564
1565 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1566 for CoordinatorListenerOnDisplaysChangedRequest
1567 {
1568 #[inline(always)]
1569 fn new_empty() -> Self {
1570 Self {
1571 added: fidl::new_empty!(fidl::encoding::UnboundedVector<Info>, D),
1572 removed: fidl::new_empty!(
1573 fidl::encoding::UnboundedVector<
1574 fidl_fuchsia_hardware_display_types__common::DisplayId,
1575 >,
1576 D
1577 ),
1578 }
1579 }
1580
1581 #[inline]
1582 unsafe fn decode(
1583 &mut self,
1584 decoder: &mut fidl::encoding::Decoder<'_, D>,
1585 offset: usize,
1586 _depth: fidl::encoding::Depth,
1587 ) -> fidl::Result<()> {
1588 decoder.debug_check_bounds::<Self>(offset);
1589 fidl::decode!(
1591 fidl::encoding::UnboundedVector<Info>,
1592 D,
1593 &mut self.added,
1594 decoder,
1595 offset + 0,
1596 _depth
1597 )?;
1598 fidl::decode!(
1599 fidl::encoding::UnboundedVector<
1600 fidl_fuchsia_hardware_display_types__common::DisplayId,
1601 >,
1602 D,
1603 &mut self.removed,
1604 decoder,
1605 offset + 16,
1606 _depth
1607 )?;
1608 Ok(())
1609 }
1610 }
1611
1612 impl fidl::encoding::ValueTypeMarker for CoordinatorListenerOnVsyncRequest {
1613 type Borrowed<'a> = &'a Self;
1614 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1615 value
1616 }
1617 }
1618
1619 unsafe impl fidl::encoding::TypeMarker for CoordinatorListenerOnVsyncRequest {
1620 type Owned = Self;
1621
1622 #[inline(always)]
1623 fn inline_align(_context: fidl::encoding::Context) -> usize {
1624 8
1625 }
1626
1627 #[inline(always)]
1628 fn inline_size(_context: fidl::encoding::Context) -> usize {
1629 32
1630 }
1631 }
1632
1633 unsafe impl<D: fidl::encoding::ResourceDialect>
1634 fidl::encoding::Encode<CoordinatorListenerOnVsyncRequest, D>
1635 for &CoordinatorListenerOnVsyncRequest
1636 {
1637 #[inline]
1638 unsafe fn encode(
1639 self,
1640 encoder: &mut fidl::encoding::Encoder<'_, D>,
1641 offset: usize,
1642 _depth: fidl::encoding::Depth,
1643 ) -> fidl::Result<()> {
1644 encoder.debug_check_bounds::<CoordinatorListenerOnVsyncRequest>(offset);
1645 fidl::encoding::Encode::<CoordinatorListenerOnVsyncRequest, D>::encode(
1647 (
1648 <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
1649 <fidl::MonotonicInstant as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp),
1650 <ConfigStamp as fidl::encoding::ValueTypeMarker>::borrow(&self.applied_config_stamp),
1651 <VsyncAckCookie as fidl::encoding::ValueTypeMarker>::borrow(&self.cookie),
1652 ),
1653 encoder, offset, _depth
1654 )
1655 }
1656 }
1657 unsafe impl<
1658 D: fidl::encoding::ResourceDialect,
1659 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
1660 T1: fidl::encoding::Encode<fidl::MonotonicInstant, D>,
1661 T2: fidl::encoding::Encode<ConfigStamp, D>,
1662 T3: fidl::encoding::Encode<VsyncAckCookie, D>,
1663 > fidl::encoding::Encode<CoordinatorListenerOnVsyncRequest, D> for (T0, T1, T2, T3)
1664 {
1665 #[inline]
1666 unsafe fn encode(
1667 self,
1668 encoder: &mut fidl::encoding::Encoder<'_, D>,
1669 offset: usize,
1670 depth: fidl::encoding::Depth,
1671 ) -> fidl::Result<()> {
1672 encoder.debug_check_bounds::<CoordinatorListenerOnVsyncRequest>(offset);
1673 self.0.encode(encoder, offset + 0, depth)?;
1677 self.1.encode(encoder, offset + 8, depth)?;
1678 self.2.encode(encoder, offset + 16, depth)?;
1679 self.3.encode(encoder, offset + 24, depth)?;
1680 Ok(())
1681 }
1682 }
1683
1684 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1685 for CoordinatorListenerOnVsyncRequest
1686 {
1687 #[inline(always)]
1688 fn new_empty() -> Self {
1689 Self {
1690 display_id: fidl::new_empty!(
1691 fidl_fuchsia_hardware_display_types__common::DisplayId,
1692 D
1693 ),
1694 timestamp: fidl::new_empty!(fidl::MonotonicInstant, D),
1695 applied_config_stamp: fidl::new_empty!(ConfigStamp, D),
1696 cookie: fidl::new_empty!(VsyncAckCookie, D),
1697 }
1698 }
1699
1700 #[inline]
1701 unsafe fn decode(
1702 &mut self,
1703 decoder: &mut fidl::encoding::Decoder<'_, D>,
1704 offset: usize,
1705 _depth: fidl::encoding::Depth,
1706 ) -> fidl::Result<()> {
1707 decoder.debug_check_bounds::<Self>(offset);
1708 fidl::decode!(
1710 fidl_fuchsia_hardware_display_types__common::DisplayId,
1711 D,
1712 &mut self.display_id,
1713 decoder,
1714 offset + 0,
1715 _depth
1716 )?;
1717 fidl::decode!(
1718 fidl::MonotonicInstant,
1719 D,
1720 &mut self.timestamp,
1721 decoder,
1722 offset + 8,
1723 _depth
1724 )?;
1725 fidl::decode!(
1726 ConfigStamp,
1727 D,
1728 &mut self.applied_config_stamp,
1729 decoder,
1730 offset + 16,
1731 _depth
1732 )?;
1733 fidl::decode!(VsyncAckCookie, D, &mut self.cookie, decoder, offset + 24, _depth)?;
1734 Ok(())
1735 }
1736 }
1737
1738 impl fidl::encoding::ValueTypeMarker for CoordinatorReleaseBufferCollectionRequest {
1739 type Borrowed<'a> = &'a Self;
1740 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1741 value
1742 }
1743 }
1744
1745 unsafe impl fidl::encoding::TypeMarker for CoordinatorReleaseBufferCollectionRequest {
1746 type Owned = Self;
1747
1748 #[inline(always)]
1749 fn inline_align(_context: fidl::encoding::Context) -> usize {
1750 8
1751 }
1752
1753 #[inline(always)]
1754 fn inline_size(_context: fidl::encoding::Context) -> usize {
1755 8
1756 }
1757 #[inline(always)]
1758 fn encode_is_copy() -> bool {
1759 true
1760 }
1761
1762 #[inline(always)]
1763 fn decode_is_copy() -> bool {
1764 true
1765 }
1766 }
1767
1768 unsafe impl<D: fidl::encoding::ResourceDialect>
1769 fidl::encoding::Encode<CoordinatorReleaseBufferCollectionRequest, D>
1770 for &CoordinatorReleaseBufferCollectionRequest
1771 {
1772 #[inline]
1773 unsafe fn encode(
1774 self,
1775 encoder: &mut fidl::encoding::Encoder<'_, D>,
1776 offset: usize,
1777 _depth: fidl::encoding::Depth,
1778 ) -> fidl::Result<()> {
1779 encoder.debug_check_bounds::<CoordinatorReleaseBufferCollectionRequest>(offset);
1780 unsafe {
1781 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1783 (buf_ptr as *mut CoordinatorReleaseBufferCollectionRequest).write_unaligned(
1784 (self as *const CoordinatorReleaseBufferCollectionRequest).read(),
1785 );
1786 }
1789 Ok(())
1790 }
1791 }
1792 unsafe impl<
1793 D: fidl::encoding::ResourceDialect,
1794 T0: fidl::encoding::Encode<BufferCollectionId, D>,
1795 > fidl::encoding::Encode<CoordinatorReleaseBufferCollectionRequest, D> for (T0,)
1796 {
1797 #[inline]
1798 unsafe fn encode(
1799 self,
1800 encoder: &mut fidl::encoding::Encoder<'_, D>,
1801 offset: usize,
1802 depth: fidl::encoding::Depth,
1803 ) -> fidl::Result<()> {
1804 encoder.debug_check_bounds::<CoordinatorReleaseBufferCollectionRequest>(offset);
1805 self.0.encode(encoder, offset + 0, depth)?;
1809 Ok(())
1810 }
1811 }
1812
1813 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1814 for CoordinatorReleaseBufferCollectionRequest
1815 {
1816 #[inline(always)]
1817 fn new_empty() -> Self {
1818 Self { buffer_collection_id: fidl::new_empty!(BufferCollectionId, D) }
1819 }
1820
1821 #[inline]
1822 unsafe fn decode(
1823 &mut self,
1824 decoder: &mut fidl::encoding::Decoder<'_, D>,
1825 offset: usize,
1826 _depth: fidl::encoding::Depth,
1827 ) -> fidl::Result<()> {
1828 decoder.debug_check_bounds::<Self>(offset);
1829 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1830 unsafe {
1833 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1834 }
1835 Ok(())
1836 }
1837 }
1838
1839 impl fidl::encoding::ValueTypeMarker for CoordinatorReleaseEventRequest {
1840 type Borrowed<'a> = &'a Self;
1841 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1842 value
1843 }
1844 }
1845
1846 unsafe impl fidl::encoding::TypeMarker for CoordinatorReleaseEventRequest {
1847 type Owned = Self;
1848
1849 #[inline(always)]
1850 fn inline_align(_context: fidl::encoding::Context) -> usize {
1851 8
1852 }
1853
1854 #[inline(always)]
1855 fn inline_size(_context: fidl::encoding::Context) -> usize {
1856 8
1857 }
1858 #[inline(always)]
1859 fn encode_is_copy() -> bool {
1860 true
1861 }
1862
1863 #[inline(always)]
1864 fn decode_is_copy() -> bool {
1865 true
1866 }
1867 }
1868
1869 unsafe impl<D: fidl::encoding::ResourceDialect>
1870 fidl::encoding::Encode<CoordinatorReleaseEventRequest, D>
1871 for &CoordinatorReleaseEventRequest
1872 {
1873 #[inline]
1874 unsafe fn encode(
1875 self,
1876 encoder: &mut fidl::encoding::Encoder<'_, D>,
1877 offset: usize,
1878 _depth: fidl::encoding::Depth,
1879 ) -> fidl::Result<()> {
1880 encoder.debug_check_bounds::<CoordinatorReleaseEventRequest>(offset);
1881 unsafe {
1882 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1884 (buf_ptr as *mut CoordinatorReleaseEventRequest)
1885 .write_unaligned((self as *const CoordinatorReleaseEventRequest).read());
1886 }
1889 Ok(())
1890 }
1891 }
1892 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<EventId, D>>
1893 fidl::encoding::Encode<CoordinatorReleaseEventRequest, D> for (T0,)
1894 {
1895 #[inline]
1896 unsafe fn encode(
1897 self,
1898 encoder: &mut fidl::encoding::Encoder<'_, D>,
1899 offset: usize,
1900 depth: fidl::encoding::Depth,
1901 ) -> fidl::Result<()> {
1902 encoder.debug_check_bounds::<CoordinatorReleaseEventRequest>(offset);
1903 self.0.encode(encoder, offset + 0, depth)?;
1907 Ok(())
1908 }
1909 }
1910
1911 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1912 for CoordinatorReleaseEventRequest
1913 {
1914 #[inline(always)]
1915 fn new_empty() -> Self {
1916 Self { id: fidl::new_empty!(EventId, D) }
1917 }
1918
1919 #[inline]
1920 unsafe fn decode(
1921 &mut self,
1922 decoder: &mut fidl::encoding::Decoder<'_, D>,
1923 offset: usize,
1924 _depth: fidl::encoding::Depth,
1925 ) -> fidl::Result<()> {
1926 decoder.debug_check_bounds::<Self>(offset);
1927 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1928 unsafe {
1931 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1932 }
1933 Ok(())
1934 }
1935 }
1936
1937 impl fidl::encoding::ValueTypeMarker for CoordinatorReleaseImageRequest {
1938 type Borrowed<'a> = &'a Self;
1939 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1940 value
1941 }
1942 }
1943
1944 unsafe impl fidl::encoding::TypeMarker for CoordinatorReleaseImageRequest {
1945 type Owned = Self;
1946
1947 #[inline(always)]
1948 fn inline_align(_context: fidl::encoding::Context) -> usize {
1949 8
1950 }
1951
1952 #[inline(always)]
1953 fn inline_size(_context: fidl::encoding::Context) -> usize {
1954 8
1955 }
1956 #[inline(always)]
1957 fn encode_is_copy() -> bool {
1958 true
1959 }
1960
1961 #[inline(always)]
1962 fn decode_is_copy() -> bool {
1963 true
1964 }
1965 }
1966
1967 unsafe impl<D: fidl::encoding::ResourceDialect>
1968 fidl::encoding::Encode<CoordinatorReleaseImageRequest, D>
1969 for &CoordinatorReleaseImageRequest
1970 {
1971 #[inline]
1972 unsafe fn encode(
1973 self,
1974 encoder: &mut fidl::encoding::Encoder<'_, D>,
1975 offset: usize,
1976 _depth: fidl::encoding::Depth,
1977 ) -> fidl::Result<()> {
1978 encoder.debug_check_bounds::<CoordinatorReleaseImageRequest>(offset);
1979 unsafe {
1980 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1982 (buf_ptr as *mut CoordinatorReleaseImageRequest)
1983 .write_unaligned((self as *const CoordinatorReleaseImageRequest).read());
1984 }
1987 Ok(())
1988 }
1989 }
1990 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<ImageId, D>>
1991 fidl::encoding::Encode<CoordinatorReleaseImageRequest, D> for (T0,)
1992 {
1993 #[inline]
1994 unsafe fn encode(
1995 self,
1996 encoder: &mut fidl::encoding::Encoder<'_, D>,
1997 offset: usize,
1998 depth: fidl::encoding::Depth,
1999 ) -> fidl::Result<()> {
2000 encoder.debug_check_bounds::<CoordinatorReleaseImageRequest>(offset);
2001 self.0.encode(encoder, offset + 0, depth)?;
2005 Ok(())
2006 }
2007 }
2008
2009 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2010 for CoordinatorReleaseImageRequest
2011 {
2012 #[inline(always)]
2013 fn new_empty() -> Self {
2014 Self { image_id: fidl::new_empty!(ImageId, D) }
2015 }
2016
2017 #[inline]
2018 unsafe fn decode(
2019 &mut self,
2020 decoder: &mut fidl::encoding::Decoder<'_, D>,
2021 offset: usize,
2022 _depth: fidl::encoding::Depth,
2023 ) -> fidl::Result<()> {
2024 decoder.debug_check_bounds::<Self>(offset);
2025 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2026 unsafe {
2029 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2030 }
2031 Ok(())
2032 }
2033 }
2034
2035 impl fidl::encoding::ValueTypeMarker for CoordinatorSetBufferCollectionConstraintsRequest {
2036 type Borrowed<'a> = &'a Self;
2037 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2038 value
2039 }
2040 }
2041
2042 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetBufferCollectionConstraintsRequest {
2043 type Owned = Self;
2044
2045 #[inline(always)]
2046 fn inline_align(_context: fidl::encoding::Context) -> usize {
2047 8
2048 }
2049
2050 #[inline(always)]
2051 fn inline_size(_context: fidl::encoding::Context) -> usize {
2052 16
2053 }
2054 }
2055
2056 unsafe impl<D: fidl::encoding::ResourceDialect>
2057 fidl::encoding::Encode<CoordinatorSetBufferCollectionConstraintsRequest, D>
2058 for &CoordinatorSetBufferCollectionConstraintsRequest
2059 {
2060 #[inline]
2061 unsafe fn encode(
2062 self,
2063 encoder: &mut fidl::encoding::Encoder<'_, D>,
2064 offset: usize,
2065 _depth: fidl::encoding::Depth,
2066 ) -> fidl::Result<()> {
2067 encoder.debug_check_bounds::<CoordinatorSetBufferCollectionConstraintsRequest>(offset);
2068 fidl::encoding::Encode::<CoordinatorSetBufferCollectionConstraintsRequest, D>::encode(
2070 (
2071 <BufferCollectionId as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_collection_id),
2072 <fidl_fuchsia_hardware_display_types__common::ImageBufferUsage as fidl::encoding::ValueTypeMarker>::borrow(&self.buffer_usage),
2073 ),
2074 encoder, offset, _depth
2075 )
2076 }
2077 }
2078 unsafe impl<
2079 D: fidl::encoding::ResourceDialect,
2080 T0: fidl::encoding::Encode<BufferCollectionId, D>,
2081 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::ImageBufferUsage, D>,
2082 > fidl::encoding::Encode<CoordinatorSetBufferCollectionConstraintsRequest, D> for (T0, T1)
2083 {
2084 #[inline]
2085 unsafe fn encode(
2086 self,
2087 encoder: &mut fidl::encoding::Encoder<'_, D>,
2088 offset: usize,
2089 depth: fidl::encoding::Depth,
2090 ) -> fidl::Result<()> {
2091 encoder.debug_check_bounds::<CoordinatorSetBufferCollectionConstraintsRequest>(offset);
2092 unsafe {
2095 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2096 (ptr as *mut u64).write_unaligned(0);
2097 }
2098 self.0.encode(encoder, offset + 0, depth)?;
2100 self.1.encode(encoder, offset + 8, depth)?;
2101 Ok(())
2102 }
2103 }
2104
2105 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2106 for CoordinatorSetBufferCollectionConstraintsRequest
2107 {
2108 #[inline(always)]
2109 fn new_empty() -> Self {
2110 Self {
2111 buffer_collection_id: fidl::new_empty!(BufferCollectionId, D),
2112 buffer_usage: fidl::new_empty!(
2113 fidl_fuchsia_hardware_display_types__common::ImageBufferUsage,
2114 D
2115 ),
2116 }
2117 }
2118
2119 #[inline]
2120 unsafe fn decode(
2121 &mut self,
2122 decoder: &mut fidl::encoding::Decoder<'_, D>,
2123 offset: usize,
2124 _depth: fidl::encoding::Depth,
2125 ) -> fidl::Result<()> {
2126 decoder.debug_check_bounds::<Self>(offset);
2127 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2129 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2130 let mask = 0xffffffff00000000u64;
2131 let maskedval = padval & mask;
2132 if maskedval != 0 {
2133 return Err(fidl::Error::NonZeroPadding {
2134 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2135 });
2136 }
2137 fidl::decode!(
2138 BufferCollectionId,
2139 D,
2140 &mut self.buffer_collection_id,
2141 decoder,
2142 offset + 0,
2143 _depth
2144 )?;
2145 fidl::decode!(
2146 fidl_fuchsia_hardware_display_types__common::ImageBufferUsage,
2147 D,
2148 &mut self.buffer_usage,
2149 decoder,
2150 offset + 8,
2151 _depth
2152 )?;
2153 Ok(())
2154 }
2155 }
2156
2157 impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayColorConversionRequest {
2158 type Borrowed<'a> = &'a Self;
2159 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2160 value
2161 }
2162 }
2163
2164 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayColorConversionRequest {
2165 type Owned = Self;
2166
2167 #[inline(always)]
2168 fn inline_align(_context: fidl::encoding::Context) -> usize {
2169 8
2170 }
2171
2172 #[inline(always)]
2173 fn inline_size(_context: fidl::encoding::Context) -> usize {
2174 72
2175 }
2176 }
2177
2178 unsafe impl<D: fidl::encoding::ResourceDialect>
2179 fidl::encoding::Encode<CoordinatorSetDisplayColorConversionRequest, D>
2180 for &CoordinatorSetDisplayColorConversionRequest
2181 {
2182 #[inline]
2183 unsafe fn encode(
2184 self,
2185 encoder: &mut fidl::encoding::Encoder<'_, D>,
2186 offset: usize,
2187 _depth: fidl::encoding::Depth,
2188 ) -> fidl::Result<()> {
2189 encoder.debug_check_bounds::<CoordinatorSetDisplayColorConversionRequest>(offset);
2190 fidl::encoding::Encode::<CoordinatorSetDisplayColorConversionRequest, D>::encode(
2192 (
2193 <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
2194 <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(&self.preoffsets),
2195 <fidl::encoding::Array<f32, 9> as fidl::encoding::ValueTypeMarker>::borrow(&self.coefficients),
2196 <fidl::encoding::Array<f32, 3> as fidl::encoding::ValueTypeMarker>::borrow(&self.postoffsets),
2197 ),
2198 encoder, offset, _depth
2199 )
2200 }
2201 }
2202 unsafe impl<
2203 D: fidl::encoding::ResourceDialect,
2204 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
2205 T1: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
2206 T2: fidl::encoding::Encode<fidl::encoding::Array<f32, 9>, D>,
2207 T3: fidl::encoding::Encode<fidl::encoding::Array<f32, 3>, D>,
2208 > fidl::encoding::Encode<CoordinatorSetDisplayColorConversionRequest, D> for (T0, T1, T2, T3)
2209 {
2210 #[inline]
2211 unsafe fn encode(
2212 self,
2213 encoder: &mut fidl::encoding::Encoder<'_, D>,
2214 offset: usize,
2215 depth: fidl::encoding::Depth,
2216 ) -> fidl::Result<()> {
2217 encoder.debug_check_bounds::<CoordinatorSetDisplayColorConversionRequest>(offset);
2218 unsafe {
2221 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(64);
2222 (ptr as *mut u64).write_unaligned(0);
2223 }
2224 self.0.encode(encoder, offset + 0, depth)?;
2226 self.1.encode(encoder, offset + 8, depth)?;
2227 self.2.encode(encoder, offset + 20, depth)?;
2228 self.3.encode(encoder, offset + 56, depth)?;
2229 Ok(())
2230 }
2231 }
2232
2233 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2234 for CoordinatorSetDisplayColorConversionRequest
2235 {
2236 #[inline(always)]
2237 fn new_empty() -> Self {
2238 Self {
2239 display_id: fidl::new_empty!(
2240 fidl_fuchsia_hardware_display_types__common::DisplayId,
2241 D
2242 ),
2243 preoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
2244 coefficients: fidl::new_empty!(fidl::encoding::Array<f32, 9>, D),
2245 postoffsets: fidl::new_empty!(fidl::encoding::Array<f32, 3>, D),
2246 }
2247 }
2248
2249 #[inline]
2250 unsafe fn decode(
2251 &mut self,
2252 decoder: &mut fidl::encoding::Decoder<'_, D>,
2253 offset: usize,
2254 _depth: fidl::encoding::Depth,
2255 ) -> fidl::Result<()> {
2256 decoder.debug_check_bounds::<Self>(offset);
2257 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(64) };
2259 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2260 let mask = 0xffffffff00000000u64;
2261 let maskedval = padval & mask;
2262 if maskedval != 0 {
2263 return Err(fidl::Error::NonZeroPadding {
2264 padding_start: offset + 64 + ((mask as u64).trailing_zeros() / 8) as usize,
2265 });
2266 }
2267 fidl::decode!(
2268 fidl_fuchsia_hardware_display_types__common::DisplayId,
2269 D,
2270 &mut self.display_id,
2271 decoder,
2272 offset + 0,
2273 _depth
2274 )?;
2275 fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.preoffsets, decoder, offset + 8, _depth)?;
2276 fidl::decode!(fidl::encoding::Array<f32, 9>, D, &mut self.coefficients, decoder, offset + 20, _depth)?;
2277 fidl::decode!(fidl::encoding::Array<f32, 3>, D, &mut self.postoffsets, decoder, offset + 56, _depth)?;
2278 Ok(())
2279 }
2280 }
2281
2282 impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayLayersRequest {
2283 type Borrowed<'a> = &'a Self;
2284 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2285 value
2286 }
2287 }
2288
2289 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayLayersRequest {
2290 type Owned = Self;
2291
2292 #[inline(always)]
2293 fn inline_align(_context: fidl::encoding::Context) -> usize {
2294 8
2295 }
2296
2297 #[inline(always)]
2298 fn inline_size(_context: fidl::encoding::Context) -> usize {
2299 24
2300 }
2301 }
2302
2303 unsafe impl<D: fidl::encoding::ResourceDialect>
2304 fidl::encoding::Encode<CoordinatorSetDisplayLayersRequest, D>
2305 for &CoordinatorSetDisplayLayersRequest
2306 {
2307 #[inline]
2308 unsafe fn encode(
2309 self,
2310 encoder: &mut fidl::encoding::Encoder<'_, D>,
2311 offset: usize,
2312 _depth: fidl::encoding::Depth,
2313 ) -> fidl::Result<()> {
2314 encoder.debug_check_bounds::<CoordinatorSetDisplayLayersRequest>(offset);
2315 fidl::encoding::Encode::<CoordinatorSetDisplayLayersRequest, D>::encode(
2317 (
2318 <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
2319 <fidl::encoding::UnboundedVector<LayerId> as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_ids),
2320 ),
2321 encoder, offset, _depth
2322 )
2323 }
2324 }
2325 unsafe impl<
2326 D: fidl::encoding::ResourceDialect,
2327 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
2328 T1: fidl::encoding::Encode<fidl::encoding::UnboundedVector<LayerId>, D>,
2329 > fidl::encoding::Encode<CoordinatorSetDisplayLayersRequest, D> for (T0, T1)
2330 {
2331 #[inline]
2332 unsafe fn encode(
2333 self,
2334 encoder: &mut fidl::encoding::Encoder<'_, D>,
2335 offset: usize,
2336 depth: fidl::encoding::Depth,
2337 ) -> fidl::Result<()> {
2338 encoder.debug_check_bounds::<CoordinatorSetDisplayLayersRequest>(offset);
2339 self.0.encode(encoder, offset + 0, depth)?;
2343 self.1.encode(encoder, offset + 8, depth)?;
2344 Ok(())
2345 }
2346 }
2347
2348 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2349 for CoordinatorSetDisplayLayersRequest
2350 {
2351 #[inline(always)]
2352 fn new_empty() -> Self {
2353 Self {
2354 display_id: fidl::new_empty!(
2355 fidl_fuchsia_hardware_display_types__common::DisplayId,
2356 D
2357 ),
2358 layer_ids: fidl::new_empty!(fidl::encoding::UnboundedVector<LayerId>, D),
2359 }
2360 }
2361
2362 #[inline]
2363 unsafe fn decode(
2364 &mut self,
2365 decoder: &mut fidl::encoding::Decoder<'_, D>,
2366 offset: usize,
2367 _depth: fidl::encoding::Depth,
2368 ) -> fidl::Result<()> {
2369 decoder.debug_check_bounds::<Self>(offset);
2370 fidl::decode!(
2372 fidl_fuchsia_hardware_display_types__common::DisplayId,
2373 D,
2374 &mut self.display_id,
2375 decoder,
2376 offset + 0,
2377 _depth
2378 )?;
2379 fidl::decode!(
2380 fidl::encoding::UnboundedVector<LayerId>,
2381 D,
2382 &mut self.layer_ids,
2383 decoder,
2384 offset + 8,
2385 _depth
2386 )?;
2387 Ok(())
2388 }
2389 }
2390
2391 impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayModeRequest {
2392 type Borrowed<'a> = &'a Self;
2393 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2394 value
2395 }
2396 }
2397
2398 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayModeRequest {
2399 type Owned = Self;
2400
2401 #[inline(always)]
2402 fn inline_align(_context: fidl::encoding::Context) -> usize {
2403 8
2404 }
2405
2406 #[inline(always)]
2407 fn inline_size(_context: fidl::encoding::Context) -> usize {
2408 24
2409 }
2410 }
2411
2412 unsafe impl<D: fidl::encoding::ResourceDialect>
2413 fidl::encoding::Encode<CoordinatorSetDisplayModeRequest, D>
2414 for &CoordinatorSetDisplayModeRequest
2415 {
2416 #[inline]
2417 unsafe fn encode(
2418 self,
2419 encoder: &mut fidl::encoding::Encoder<'_, D>,
2420 offset: usize,
2421 _depth: fidl::encoding::Depth,
2422 ) -> fidl::Result<()> {
2423 encoder.debug_check_bounds::<CoordinatorSetDisplayModeRequest>(offset);
2424 fidl::encoding::Encode::<CoordinatorSetDisplayModeRequest, D>::encode(
2426 (
2427 <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
2428 <fidl_fuchsia_hardware_display_types__common::Mode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
2429 ),
2430 encoder, offset, _depth
2431 )
2432 }
2433 }
2434 unsafe impl<
2435 D: fidl::encoding::ResourceDialect,
2436 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
2437 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::Mode, D>,
2438 > fidl::encoding::Encode<CoordinatorSetDisplayModeRequest, D> for (T0, T1)
2439 {
2440 #[inline]
2441 unsafe fn encode(
2442 self,
2443 encoder: &mut fidl::encoding::Encoder<'_, D>,
2444 offset: usize,
2445 depth: fidl::encoding::Depth,
2446 ) -> fidl::Result<()> {
2447 encoder.debug_check_bounds::<CoordinatorSetDisplayModeRequest>(offset);
2448 self.0.encode(encoder, offset + 0, depth)?;
2452 self.1.encode(encoder, offset + 8, depth)?;
2453 Ok(())
2454 }
2455 }
2456
2457 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2458 for CoordinatorSetDisplayModeRequest
2459 {
2460 #[inline(always)]
2461 fn new_empty() -> Self {
2462 Self {
2463 display_id: fidl::new_empty!(
2464 fidl_fuchsia_hardware_display_types__common::DisplayId,
2465 D
2466 ),
2467 mode: fidl::new_empty!(fidl_fuchsia_hardware_display_types__common::Mode, D),
2468 }
2469 }
2470
2471 #[inline]
2472 unsafe fn decode(
2473 &mut self,
2474 decoder: &mut fidl::encoding::Decoder<'_, D>,
2475 offset: usize,
2476 _depth: fidl::encoding::Depth,
2477 ) -> fidl::Result<()> {
2478 decoder.debug_check_bounds::<Self>(offset);
2479 fidl::decode!(
2481 fidl_fuchsia_hardware_display_types__common::DisplayId,
2482 D,
2483 &mut self.display_id,
2484 decoder,
2485 offset + 0,
2486 _depth
2487 )?;
2488 fidl::decode!(
2489 fidl_fuchsia_hardware_display_types__common::Mode,
2490 D,
2491 &mut self.mode,
2492 decoder,
2493 offset + 8,
2494 _depth
2495 )?;
2496 Ok(())
2497 }
2498 }
2499
2500 impl fidl::encoding::ValueTypeMarker for CoordinatorSetDisplayPowerModeRequest {
2501 type Borrowed<'a> = &'a Self;
2502 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2503 value
2504 }
2505 }
2506
2507 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetDisplayPowerModeRequest {
2508 type Owned = Self;
2509
2510 #[inline(always)]
2511 fn inline_align(_context: fidl::encoding::Context) -> usize {
2512 8
2513 }
2514
2515 #[inline(always)]
2516 fn inline_size(_context: fidl::encoding::Context) -> usize {
2517 16
2518 }
2519 }
2520
2521 unsafe impl<D: fidl::encoding::ResourceDialect>
2522 fidl::encoding::Encode<CoordinatorSetDisplayPowerModeRequest, D>
2523 for &CoordinatorSetDisplayPowerModeRequest
2524 {
2525 #[inline]
2526 unsafe fn encode(
2527 self,
2528 encoder: &mut fidl::encoding::Encoder<'_, D>,
2529 offset: usize,
2530 _depth: fidl::encoding::Depth,
2531 ) -> fidl::Result<()> {
2532 encoder.debug_check_bounds::<CoordinatorSetDisplayPowerModeRequest>(offset);
2533 fidl::encoding::Encode::<CoordinatorSetDisplayPowerModeRequest, D>::encode(
2535 (
2536 <fidl_fuchsia_hardware_display_types__common::DisplayId as fidl::encoding::ValueTypeMarker>::borrow(&self.display_id),
2537 <fidl_fuchsia_hardware_display_types__common::PowerMode as fidl::encoding::ValueTypeMarker>::borrow(&self.power_mode),
2538 ),
2539 encoder, offset, _depth
2540 )
2541 }
2542 }
2543 unsafe impl<
2544 D: fidl::encoding::ResourceDialect,
2545 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::DisplayId, D>,
2546 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::PowerMode, D>,
2547 > fidl::encoding::Encode<CoordinatorSetDisplayPowerModeRequest, D> for (T0, T1)
2548 {
2549 #[inline]
2550 unsafe fn encode(
2551 self,
2552 encoder: &mut fidl::encoding::Encoder<'_, D>,
2553 offset: usize,
2554 depth: fidl::encoding::Depth,
2555 ) -> fidl::Result<()> {
2556 encoder.debug_check_bounds::<CoordinatorSetDisplayPowerModeRequest>(offset);
2557 unsafe {
2560 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2561 (ptr as *mut u64).write_unaligned(0);
2562 }
2563 self.0.encode(encoder, offset + 0, depth)?;
2565 self.1.encode(encoder, offset + 8, depth)?;
2566 Ok(())
2567 }
2568 }
2569
2570 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2571 for CoordinatorSetDisplayPowerModeRequest
2572 {
2573 #[inline(always)]
2574 fn new_empty() -> Self {
2575 Self {
2576 display_id: fidl::new_empty!(
2577 fidl_fuchsia_hardware_display_types__common::DisplayId,
2578 D
2579 ),
2580 power_mode: fidl::new_empty!(
2581 fidl_fuchsia_hardware_display_types__common::PowerMode,
2582 D
2583 ),
2584 }
2585 }
2586
2587 #[inline]
2588 unsafe fn decode(
2589 &mut self,
2590 decoder: &mut fidl::encoding::Decoder<'_, D>,
2591 offset: usize,
2592 _depth: fidl::encoding::Depth,
2593 ) -> fidl::Result<()> {
2594 decoder.debug_check_bounds::<Self>(offset);
2595 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2597 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2598 let mask = 0xffffffff00000000u64;
2599 let maskedval = padval & mask;
2600 if maskedval != 0 {
2601 return Err(fidl::Error::NonZeroPadding {
2602 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2603 });
2604 }
2605 fidl::decode!(
2606 fidl_fuchsia_hardware_display_types__common::DisplayId,
2607 D,
2608 &mut self.display_id,
2609 decoder,
2610 offset + 0,
2611 _depth
2612 )?;
2613 fidl::decode!(
2614 fidl_fuchsia_hardware_display_types__common::PowerMode,
2615 D,
2616 &mut self.power_mode,
2617 decoder,
2618 offset + 8,
2619 _depth
2620 )?;
2621 Ok(())
2622 }
2623 }
2624
2625 impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerColorConfigRequest {
2626 type Borrowed<'a> = &'a Self;
2627 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2628 value
2629 }
2630 }
2631
2632 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerColorConfigRequest {
2633 type Owned = Self;
2634
2635 #[inline(always)]
2636 fn inline_align(_context: fidl::encoding::Context) -> usize {
2637 8
2638 }
2639
2640 #[inline(always)]
2641 fn inline_size(_context: fidl::encoding::Context) -> usize {
2642 40
2643 }
2644 }
2645
2646 unsafe impl<D: fidl::encoding::ResourceDialect>
2647 fidl::encoding::Encode<CoordinatorSetLayerColorConfigRequest, D>
2648 for &CoordinatorSetLayerColorConfigRequest
2649 {
2650 #[inline]
2651 unsafe fn encode(
2652 self,
2653 encoder: &mut fidl::encoding::Encoder<'_, D>,
2654 offset: usize,
2655 _depth: fidl::encoding::Depth,
2656 ) -> fidl::Result<()> {
2657 encoder.debug_check_bounds::<CoordinatorSetLayerColorConfigRequest>(offset);
2658 fidl::encoding::Encode::<CoordinatorSetLayerColorConfigRequest, D>::encode(
2660 (
2661 <LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
2662 <fidl_fuchsia_hardware_display_types__common::Color as fidl::encoding::ValueTypeMarker>::borrow(&self.color),
2663 <fidl_fuchsia_math__common::RectU as fidl::encoding::ValueTypeMarker>::borrow(&self.display_destination),
2664 ),
2665 encoder, offset, _depth
2666 )
2667 }
2668 }
2669 unsafe impl<
2670 D: fidl::encoding::ResourceDialect,
2671 T0: fidl::encoding::Encode<LayerId, D>,
2672 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::Color, D>,
2673 T2: fidl::encoding::Encode<fidl_fuchsia_math__common::RectU, D>,
2674 > fidl::encoding::Encode<CoordinatorSetLayerColorConfigRequest, D> for (T0, T1, T2)
2675 {
2676 #[inline]
2677 unsafe fn encode(
2678 self,
2679 encoder: &mut fidl::encoding::Encoder<'_, D>,
2680 offset: usize,
2681 depth: fidl::encoding::Depth,
2682 ) -> fidl::Result<()> {
2683 encoder.debug_check_bounds::<CoordinatorSetLayerColorConfigRequest>(offset);
2684 unsafe {
2687 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
2688 (ptr as *mut u64).write_unaligned(0);
2689 }
2690 self.0.encode(encoder, offset + 0, depth)?;
2692 self.1.encode(encoder, offset + 8, depth)?;
2693 self.2.encode(encoder, offset + 20, depth)?;
2694 Ok(())
2695 }
2696 }
2697
2698 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2699 for CoordinatorSetLayerColorConfigRequest
2700 {
2701 #[inline(always)]
2702 fn new_empty() -> Self {
2703 Self {
2704 layer_id: fidl::new_empty!(LayerId, D),
2705 color: fidl::new_empty!(fidl_fuchsia_hardware_display_types__common::Color, D),
2706 display_destination: fidl::new_empty!(fidl_fuchsia_math__common::RectU, D),
2707 }
2708 }
2709
2710 #[inline]
2711 unsafe fn decode(
2712 &mut self,
2713 decoder: &mut fidl::encoding::Decoder<'_, D>,
2714 offset: usize,
2715 _depth: fidl::encoding::Depth,
2716 ) -> fidl::Result<()> {
2717 decoder.debug_check_bounds::<Self>(offset);
2718 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
2720 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2721 let mask = 0xffffffff00000000u64;
2722 let maskedval = padval & mask;
2723 if maskedval != 0 {
2724 return Err(fidl::Error::NonZeroPadding {
2725 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
2726 });
2727 }
2728 fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
2729 fidl::decode!(
2730 fidl_fuchsia_hardware_display_types__common::Color,
2731 D,
2732 &mut self.color,
2733 decoder,
2734 offset + 8,
2735 _depth
2736 )?;
2737 fidl::decode!(
2738 fidl_fuchsia_math__common::RectU,
2739 D,
2740 &mut self.display_destination,
2741 decoder,
2742 offset + 20,
2743 _depth
2744 )?;
2745 Ok(())
2746 }
2747 }
2748
2749 impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerImage2Request {
2750 type Borrowed<'a> = &'a Self;
2751 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2752 value
2753 }
2754 }
2755
2756 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerImage2Request {
2757 type Owned = Self;
2758
2759 #[inline(always)]
2760 fn inline_align(_context: fidl::encoding::Context) -> usize {
2761 8
2762 }
2763
2764 #[inline(always)]
2765 fn inline_size(_context: fidl::encoding::Context) -> usize {
2766 24
2767 }
2768 #[inline(always)]
2769 fn encode_is_copy() -> bool {
2770 true
2771 }
2772
2773 #[inline(always)]
2774 fn decode_is_copy() -> bool {
2775 true
2776 }
2777 }
2778
2779 unsafe impl<D: fidl::encoding::ResourceDialect>
2780 fidl::encoding::Encode<CoordinatorSetLayerImage2Request, D>
2781 for &CoordinatorSetLayerImage2Request
2782 {
2783 #[inline]
2784 unsafe fn encode(
2785 self,
2786 encoder: &mut fidl::encoding::Encoder<'_, D>,
2787 offset: usize,
2788 _depth: fidl::encoding::Depth,
2789 ) -> fidl::Result<()> {
2790 encoder.debug_check_bounds::<CoordinatorSetLayerImage2Request>(offset);
2791 unsafe {
2792 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2794 (buf_ptr as *mut CoordinatorSetLayerImage2Request)
2795 .write_unaligned((self as *const CoordinatorSetLayerImage2Request).read());
2796 }
2799 Ok(())
2800 }
2801 }
2802 unsafe impl<
2803 D: fidl::encoding::ResourceDialect,
2804 T0: fidl::encoding::Encode<LayerId, D>,
2805 T1: fidl::encoding::Encode<ImageId, D>,
2806 T2: fidl::encoding::Encode<EventId, D>,
2807 > fidl::encoding::Encode<CoordinatorSetLayerImage2Request, D> for (T0, T1, T2)
2808 {
2809 #[inline]
2810 unsafe fn encode(
2811 self,
2812 encoder: &mut fidl::encoding::Encoder<'_, D>,
2813 offset: usize,
2814 depth: fidl::encoding::Depth,
2815 ) -> fidl::Result<()> {
2816 encoder.debug_check_bounds::<CoordinatorSetLayerImage2Request>(offset);
2817 self.0.encode(encoder, offset + 0, depth)?;
2821 self.1.encode(encoder, offset + 8, depth)?;
2822 self.2.encode(encoder, offset + 16, depth)?;
2823 Ok(())
2824 }
2825 }
2826
2827 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2828 for CoordinatorSetLayerImage2Request
2829 {
2830 #[inline(always)]
2831 fn new_empty() -> Self {
2832 Self {
2833 layer_id: fidl::new_empty!(LayerId, D),
2834 image_id: fidl::new_empty!(ImageId, D),
2835 wait_event_id: fidl::new_empty!(EventId, D),
2836 }
2837 }
2838
2839 #[inline]
2840 unsafe fn decode(
2841 &mut self,
2842 decoder: &mut fidl::encoding::Decoder<'_, D>,
2843 offset: usize,
2844 _depth: fidl::encoding::Depth,
2845 ) -> fidl::Result<()> {
2846 decoder.debug_check_bounds::<Self>(offset);
2847 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2848 unsafe {
2851 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
2852 }
2853 Ok(())
2854 }
2855 }
2856
2857 impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerPrimaryAlphaRequest {
2858 type Borrowed<'a> = &'a Self;
2859 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2860 value
2861 }
2862 }
2863
2864 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerPrimaryAlphaRequest {
2865 type Owned = Self;
2866
2867 #[inline(always)]
2868 fn inline_align(_context: fidl::encoding::Context) -> usize {
2869 8
2870 }
2871
2872 #[inline(always)]
2873 fn inline_size(_context: fidl::encoding::Context) -> usize {
2874 16
2875 }
2876 }
2877
2878 unsafe impl<D: fidl::encoding::ResourceDialect>
2879 fidl::encoding::Encode<CoordinatorSetLayerPrimaryAlphaRequest, D>
2880 for &CoordinatorSetLayerPrimaryAlphaRequest
2881 {
2882 #[inline]
2883 unsafe fn encode(
2884 self,
2885 encoder: &mut fidl::encoding::Encoder<'_, D>,
2886 offset: usize,
2887 _depth: fidl::encoding::Depth,
2888 ) -> fidl::Result<()> {
2889 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryAlphaRequest>(offset);
2890 fidl::encoding::Encode::<CoordinatorSetLayerPrimaryAlphaRequest, D>::encode(
2892 (
2893 <LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
2894 <fidl_fuchsia_hardware_display_types__common::AlphaMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),
2895 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.val),
2896 ),
2897 encoder, offset, _depth
2898 )
2899 }
2900 }
2901 unsafe impl<
2902 D: fidl::encoding::ResourceDialect,
2903 T0: fidl::encoding::Encode<LayerId, D>,
2904 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::AlphaMode, D>,
2905 T2: fidl::encoding::Encode<f32, D>,
2906 > fidl::encoding::Encode<CoordinatorSetLayerPrimaryAlphaRequest, D> for (T0, T1, T2)
2907 {
2908 #[inline]
2909 unsafe fn encode(
2910 self,
2911 encoder: &mut fidl::encoding::Encoder<'_, D>,
2912 offset: usize,
2913 depth: fidl::encoding::Depth,
2914 ) -> fidl::Result<()> {
2915 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryAlphaRequest>(offset);
2916 unsafe {
2919 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2920 (ptr as *mut u64).write_unaligned(0);
2921 }
2922 self.0.encode(encoder, offset + 0, depth)?;
2924 self.1.encode(encoder, offset + 8, depth)?;
2925 self.2.encode(encoder, offset + 12, depth)?;
2926 Ok(())
2927 }
2928 }
2929
2930 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2931 for CoordinatorSetLayerPrimaryAlphaRequest
2932 {
2933 #[inline(always)]
2934 fn new_empty() -> Self {
2935 Self {
2936 layer_id: fidl::new_empty!(LayerId, D),
2937 mode: fidl::new_empty!(fidl_fuchsia_hardware_display_types__common::AlphaMode, D),
2938 val: fidl::new_empty!(f32, D),
2939 }
2940 }
2941
2942 #[inline]
2943 unsafe fn decode(
2944 &mut self,
2945 decoder: &mut fidl::encoding::Decoder<'_, D>,
2946 offset: usize,
2947 _depth: fidl::encoding::Depth,
2948 ) -> fidl::Result<()> {
2949 decoder.debug_check_bounds::<Self>(offset);
2950 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2952 let padval = unsafe { (ptr as *const u64).read_unaligned() };
2953 let mask = 0xffffff00u64;
2954 let maskedval = padval & mask;
2955 if maskedval != 0 {
2956 return Err(fidl::Error::NonZeroPadding {
2957 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2958 });
2959 }
2960 fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
2961 fidl::decode!(
2962 fidl_fuchsia_hardware_display_types__common::AlphaMode,
2963 D,
2964 &mut self.mode,
2965 decoder,
2966 offset + 8,
2967 _depth
2968 )?;
2969 fidl::decode!(f32, D, &mut self.val, decoder, offset + 12, _depth)?;
2970 Ok(())
2971 }
2972 }
2973
2974 impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerPrimaryConfigRequest {
2975 type Borrowed<'a> = &'a Self;
2976 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2977 value
2978 }
2979 }
2980
2981 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerPrimaryConfigRequest {
2982 type Owned = Self;
2983
2984 #[inline(always)]
2985 fn inline_align(_context: fidl::encoding::Context) -> usize {
2986 8
2987 }
2988
2989 #[inline(always)]
2990 fn inline_size(_context: fidl::encoding::Context) -> usize {
2991 24
2992 }
2993 }
2994
2995 unsafe impl<D: fidl::encoding::ResourceDialect>
2996 fidl::encoding::Encode<CoordinatorSetLayerPrimaryConfigRequest, D>
2997 for &CoordinatorSetLayerPrimaryConfigRequest
2998 {
2999 #[inline]
3000 unsafe fn encode(
3001 self,
3002 encoder: &mut fidl::encoding::Encoder<'_, D>,
3003 offset: usize,
3004 _depth: fidl::encoding::Depth,
3005 ) -> fidl::Result<()> {
3006 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryConfigRequest>(offset);
3007 fidl::encoding::Encode::<CoordinatorSetLayerPrimaryConfigRequest, D>::encode(
3009 (
3010 <LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
3011 <fidl_fuchsia_hardware_display_types__common::ImageMetadata as fidl::encoding::ValueTypeMarker>::borrow(&self.image_metadata),
3012 ),
3013 encoder, offset, _depth
3014 )
3015 }
3016 }
3017 unsafe impl<
3018 D: fidl::encoding::ResourceDialect,
3019 T0: fidl::encoding::Encode<LayerId, D>,
3020 T1: fidl::encoding::Encode<fidl_fuchsia_hardware_display_types__common::ImageMetadata, D>,
3021 > fidl::encoding::Encode<CoordinatorSetLayerPrimaryConfigRequest, D> for (T0, T1)
3022 {
3023 #[inline]
3024 unsafe fn encode(
3025 self,
3026 encoder: &mut fidl::encoding::Encoder<'_, D>,
3027 offset: usize,
3028 depth: fidl::encoding::Depth,
3029 ) -> fidl::Result<()> {
3030 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryConfigRequest>(offset);
3031 unsafe {
3034 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3035 (ptr as *mut u64).write_unaligned(0);
3036 }
3037 self.0.encode(encoder, offset + 0, depth)?;
3039 self.1.encode(encoder, offset + 8, depth)?;
3040 Ok(())
3041 }
3042 }
3043
3044 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3045 for CoordinatorSetLayerPrimaryConfigRequest
3046 {
3047 #[inline(always)]
3048 fn new_empty() -> Self {
3049 Self {
3050 layer_id: fidl::new_empty!(LayerId, D),
3051 image_metadata: fidl::new_empty!(
3052 fidl_fuchsia_hardware_display_types__common::ImageMetadata,
3053 D
3054 ),
3055 }
3056 }
3057
3058 #[inline]
3059 unsafe fn decode(
3060 &mut self,
3061 decoder: &mut fidl::encoding::Decoder<'_, D>,
3062 offset: usize,
3063 _depth: fidl::encoding::Depth,
3064 ) -> fidl::Result<()> {
3065 decoder.debug_check_bounds::<Self>(offset);
3066 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3068 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3069 let mask = 0xffffffff00000000u64;
3070 let maskedval = padval & mask;
3071 if maskedval != 0 {
3072 return Err(fidl::Error::NonZeroPadding {
3073 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3074 });
3075 }
3076 fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
3077 fidl::decode!(
3078 fidl_fuchsia_hardware_display_types__common::ImageMetadata,
3079 D,
3080 &mut self.image_metadata,
3081 decoder,
3082 offset + 8,
3083 _depth
3084 )?;
3085 Ok(())
3086 }
3087 }
3088
3089 impl fidl::encoding::ValueTypeMarker for CoordinatorSetLayerPrimaryPositionRequest {
3090 type Borrowed<'a> = &'a Self;
3091 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3092 value
3093 }
3094 }
3095
3096 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetLayerPrimaryPositionRequest {
3097 type Owned = Self;
3098
3099 #[inline(always)]
3100 fn inline_align(_context: fidl::encoding::Context) -> usize {
3101 8
3102 }
3103
3104 #[inline(always)]
3105 fn inline_size(_context: fidl::encoding::Context) -> usize {
3106 48
3107 }
3108 }
3109
3110 unsafe impl<D: fidl::encoding::ResourceDialect>
3111 fidl::encoding::Encode<CoordinatorSetLayerPrimaryPositionRequest, D>
3112 for &CoordinatorSetLayerPrimaryPositionRequest
3113 {
3114 #[inline]
3115 unsafe fn encode(
3116 self,
3117 encoder: &mut fidl::encoding::Encoder<'_, D>,
3118 offset: usize,
3119 _depth: fidl::encoding::Depth,
3120 ) -> fidl::Result<()> {
3121 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryPositionRequest>(offset);
3122 fidl::encoding::Encode::<CoordinatorSetLayerPrimaryPositionRequest, D>::encode(
3124 (
3125 <LayerId as fidl::encoding::ValueTypeMarker>::borrow(&self.layer_id),
3126 <fidl_fuchsia_hardware_display_types__common::CoordinateTransformation as fidl::encoding::ValueTypeMarker>::borrow(&self.image_source_transformation),
3127 <fidl_fuchsia_math__common::RectU as fidl::encoding::ValueTypeMarker>::borrow(&self.image_source),
3128 <fidl_fuchsia_math__common::RectU as fidl::encoding::ValueTypeMarker>::borrow(&self.display_destination),
3129 ),
3130 encoder, offset, _depth
3131 )
3132 }
3133 }
3134 unsafe impl<
3135 D: fidl::encoding::ResourceDialect,
3136 T0: fidl::encoding::Encode<LayerId, D>,
3137 T1: fidl::encoding::Encode<
3138 fidl_fuchsia_hardware_display_types__common::CoordinateTransformation,
3139 D,
3140 >,
3141 T2: fidl::encoding::Encode<fidl_fuchsia_math__common::RectU, D>,
3142 T3: fidl::encoding::Encode<fidl_fuchsia_math__common::RectU, D>,
3143 > fidl::encoding::Encode<CoordinatorSetLayerPrimaryPositionRequest, D> for (T0, T1, T2, T3)
3144 {
3145 #[inline]
3146 unsafe fn encode(
3147 self,
3148 encoder: &mut fidl::encoding::Encoder<'_, D>,
3149 offset: usize,
3150 depth: fidl::encoding::Depth,
3151 ) -> fidl::Result<()> {
3152 encoder.debug_check_bounds::<CoordinatorSetLayerPrimaryPositionRequest>(offset);
3153 unsafe {
3156 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3157 (ptr as *mut u64).write_unaligned(0);
3158 }
3159 unsafe {
3160 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
3161 (ptr as *mut u64).write_unaligned(0);
3162 }
3163 self.0.encode(encoder, offset + 0, depth)?;
3165 self.1.encode(encoder, offset + 8, depth)?;
3166 self.2.encode(encoder, offset + 12, depth)?;
3167 self.3.encode(encoder, offset + 28, depth)?;
3168 Ok(())
3169 }
3170 }
3171
3172 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3173 for CoordinatorSetLayerPrimaryPositionRequest
3174 {
3175 #[inline(always)]
3176 fn new_empty() -> Self {
3177 Self {
3178 layer_id: fidl::new_empty!(LayerId, D),
3179 image_source_transformation: fidl::new_empty!(
3180 fidl_fuchsia_hardware_display_types__common::CoordinateTransformation,
3181 D
3182 ),
3183 image_source: fidl::new_empty!(fidl_fuchsia_math__common::RectU, D),
3184 display_destination: fidl::new_empty!(fidl_fuchsia_math__common::RectU, D),
3185 }
3186 }
3187
3188 #[inline]
3189 unsafe fn decode(
3190 &mut self,
3191 decoder: &mut fidl::encoding::Decoder<'_, D>,
3192 offset: usize,
3193 _depth: fidl::encoding::Depth,
3194 ) -> fidl::Result<()> {
3195 decoder.debug_check_bounds::<Self>(offset);
3196 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3198 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3199 let mask = 0xffffff00u64;
3200 let maskedval = padval & mask;
3201 if maskedval != 0 {
3202 return Err(fidl::Error::NonZeroPadding {
3203 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3204 });
3205 }
3206 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
3207 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3208 let mask = 0xffffffff00000000u64;
3209 let maskedval = padval & mask;
3210 if maskedval != 0 {
3211 return Err(fidl::Error::NonZeroPadding {
3212 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
3213 });
3214 }
3215 fidl::decode!(LayerId, D, &mut self.layer_id, decoder, offset + 0, _depth)?;
3216 fidl::decode!(
3217 fidl_fuchsia_hardware_display_types__common::CoordinateTransformation,
3218 D,
3219 &mut self.image_source_transformation,
3220 decoder,
3221 offset + 8,
3222 _depth
3223 )?;
3224 fidl::decode!(
3225 fidl_fuchsia_math__common::RectU,
3226 D,
3227 &mut self.image_source,
3228 decoder,
3229 offset + 12,
3230 _depth
3231 )?;
3232 fidl::decode!(
3233 fidl_fuchsia_math__common::RectU,
3234 D,
3235 &mut self.display_destination,
3236 decoder,
3237 offset + 28,
3238 _depth
3239 )?;
3240 Ok(())
3241 }
3242 }
3243
3244 impl fidl::encoding::ValueTypeMarker for CoordinatorSetMinimumRgbRequest {
3245 type Borrowed<'a> = &'a Self;
3246 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3247 value
3248 }
3249 }
3250
3251 unsafe impl fidl::encoding::TypeMarker for CoordinatorSetMinimumRgbRequest {
3252 type Owned = Self;
3253
3254 #[inline(always)]
3255 fn inline_align(_context: fidl::encoding::Context) -> usize {
3256 1
3257 }
3258
3259 #[inline(always)]
3260 fn inline_size(_context: fidl::encoding::Context) -> usize {
3261 1
3262 }
3263 #[inline(always)]
3264 fn encode_is_copy() -> bool {
3265 true
3266 }
3267
3268 #[inline(always)]
3269 fn decode_is_copy() -> bool {
3270 true
3271 }
3272 }
3273
3274 unsafe impl<D: fidl::encoding::ResourceDialect>
3275 fidl::encoding::Encode<CoordinatorSetMinimumRgbRequest, D>
3276 for &CoordinatorSetMinimumRgbRequest
3277 {
3278 #[inline]
3279 unsafe fn encode(
3280 self,
3281 encoder: &mut fidl::encoding::Encoder<'_, D>,
3282 offset: usize,
3283 _depth: fidl::encoding::Depth,
3284 ) -> fidl::Result<()> {
3285 encoder.debug_check_bounds::<CoordinatorSetMinimumRgbRequest>(offset);
3286 unsafe {
3287 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3289 (buf_ptr as *mut CoordinatorSetMinimumRgbRequest)
3290 .write_unaligned((self as *const CoordinatorSetMinimumRgbRequest).read());
3291 }
3294 Ok(())
3295 }
3296 }
3297 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
3298 fidl::encoding::Encode<CoordinatorSetMinimumRgbRequest, D> for (T0,)
3299 {
3300 #[inline]
3301 unsafe fn encode(
3302 self,
3303 encoder: &mut fidl::encoding::Encoder<'_, D>,
3304 offset: usize,
3305 depth: fidl::encoding::Depth,
3306 ) -> fidl::Result<()> {
3307 encoder.debug_check_bounds::<CoordinatorSetMinimumRgbRequest>(offset);
3308 self.0.encode(encoder, offset + 0, depth)?;
3312 Ok(())
3313 }
3314 }
3315
3316 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3317 for CoordinatorSetMinimumRgbRequest
3318 {
3319 #[inline(always)]
3320 fn new_empty() -> Self {
3321 Self { minimum_rgb: fidl::new_empty!(u8, D) }
3322 }
3323
3324 #[inline]
3325 unsafe fn decode(
3326 &mut self,
3327 decoder: &mut fidl::encoding::Decoder<'_, D>,
3328 offset: usize,
3329 _depth: fidl::encoding::Depth,
3330 ) -> fidl::Result<()> {
3331 decoder.debug_check_bounds::<Self>(offset);
3332 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3333 unsafe {
3336 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
3337 }
3338 Ok(())
3339 }
3340 }
3341
3342 impl fidl::encoding::ValueTypeMarker for CoordinatorSetVirtconModeRequest {
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 CoordinatorSetVirtconModeRequest {
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 }
3362
3363 unsafe impl<D: fidl::encoding::ResourceDialect>
3364 fidl::encoding::Encode<CoordinatorSetVirtconModeRequest, D>
3365 for &CoordinatorSetVirtconModeRequest
3366 {
3367 #[inline]
3368 unsafe fn encode(
3369 self,
3370 encoder: &mut fidl::encoding::Encoder<'_, D>,
3371 offset: usize,
3372 _depth: fidl::encoding::Depth,
3373 ) -> fidl::Result<()> {
3374 encoder.debug_check_bounds::<CoordinatorSetVirtconModeRequest>(offset);
3375 fidl::encoding::Encode::<CoordinatorSetVirtconModeRequest, D>::encode(
3377 (<VirtconMode as fidl::encoding::ValueTypeMarker>::borrow(&self.mode),),
3378 encoder,
3379 offset,
3380 _depth,
3381 )
3382 }
3383 }
3384 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<VirtconMode, D>>
3385 fidl::encoding::Encode<CoordinatorSetVirtconModeRequest, D> for (T0,)
3386 {
3387 #[inline]
3388 unsafe fn encode(
3389 self,
3390 encoder: &mut fidl::encoding::Encoder<'_, D>,
3391 offset: usize,
3392 depth: fidl::encoding::Depth,
3393 ) -> fidl::Result<()> {
3394 encoder.debug_check_bounds::<CoordinatorSetVirtconModeRequest>(offset);
3395 self.0.encode(encoder, offset + 0, depth)?;
3399 Ok(())
3400 }
3401 }
3402
3403 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3404 for CoordinatorSetVirtconModeRequest
3405 {
3406 #[inline(always)]
3407 fn new_empty() -> Self {
3408 Self { mode: fidl::new_empty!(VirtconMode, D) }
3409 }
3410
3411 #[inline]
3412 unsafe fn decode(
3413 &mut self,
3414 decoder: &mut fidl::encoding::Decoder<'_, D>,
3415 offset: usize,
3416 _depth: fidl::encoding::Depth,
3417 ) -> fidl::Result<()> {
3418 decoder.debug_check_bounds::<Self>(offset);
3419 fidl::decode!(VirtconMode, D, &mut self.mode, decoder, offset + 0, _depth)?;
3421 Ok(())
3422 }
3423 }
3424
3425 impl fidl::encoding::ValueTypeMarker for CoordinatorStartCaptureRequest {
3426 type Borrowed<'a> = &'a Self;
3427 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3428 value
3429 }
3430 }
3431
3432 unsafe impl fidl::encoding::TypeMarker for CoordinatorStartCaptureRequest {
3433 type Owned = Self;
3434
3435 #[inline(always)]
3436 fn inline_align(_context: fidl::encoding::Context) -> usize {
3437 8
3438 }
3439
3440 #[inline(always)]
3441 fn inline_size(_context: fidl::encoding::Context) -> usize {
3442 16
3443 }
3444 #[inline(always)]
3445 fn encode_is_copy() -> bool {
3446 true
3447 }
3448
3449 #[inline(always)]
3450 fn decode_is_copy() -> bool {
3451 true
3452 }
3453 }
3454
3455 unsafe impl<D: fidl::encoding::ResourceDialect>
3456 fidl::encoding::Encode<CoordinatorStartCaptureRequest, D>
3457 for &CoordinatorStartCaptureRequest
3458 {
3459 #[inline]
3460 unsafe fn encode(
3461 self,
3462 encoder: &mut fidl::encoding::Encoder<'_, D>,
3463 offset: usize,
3464 _depth: fidl::encoding::Depth,
3465 ) -> fidl::Result<()> {
3466 encoder.debug_check_bounds::<CoordinatorStartCaptureRequest>(offset);
3467 unsafe {
3468 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3470 (buf_ptr as *mut CoordinatorStartCaptureRequest)
3471 .write_unaligned((self as *const CoordinatorStartCaptureRequest).read());
3472 }
3475 Ok(())
3476 }
3477 }
3478 unsafe impl<
3479 D: fidl::encoding::ResourceDialect,
3480 T0: fidl::encoding::Encode<EventId, D>,
3481 T1: fidl::encoding::Encode<ImageId, D>,
3482 > fidl::encoding::Encode<CoordinatorStartCaptureRequest, D> for (T0, T1)
3483 {
3484 #[inline]
3485 unsafe fn encode(
3486 self,
3487 encoder: &mut fidl::encoding::Encoder<'_, D>,
3488 offset: usize,
3489 depth: fidl::encoding::Depth,
3490 ) -> fidl::Result<()> {
3491 encoder.debug_check_bounds::<CoordinatorStartCaptureRequest>(offset);
3492 self.0.encode(encoder, offset + 0, depth)?;
3496 self.1.encode(encoder, offset + 8, depth)?;
3497 Ok(())
3498 }
3499 }
3500
3501 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3502 for CoordinatorStartCaptureRequest
3503 {
3504 #[inline(always)]
3505 fn new_empty() -> Self {
3506 Self {
3507 signal_event_id: fidl::new_empty!(EventId, D),
3508 image_id: fidl::new_empty!(ImageId, D),
3509 }
3510 }
3511
3512 #[inline]
3513 unsafe fn decode(
3514 &mut self,
3515 decoder: &mut fidl::encoding::Decoder<'_, D>,
3516 offset: usize,
3517 _depth: fidl::encoding::Depth,
3518 ) -> fidl::Result<()> {
3519 decoder.debug_check_bounds::<Self>(offset);
3520 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3521 unsafe {
3524 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
3525 }
3526 Ok(())
3527 }
3528 }
3529
3530 impl fidl::encoding::ValueTypeMarker for CoordinatorCreateLayerResponse {
3531 type Borrowed<'a> = &'a Self;
3532 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3533 value
3534 }
3535 }
3536
3537 unsafe impl fidl::encoding::TypeMarker for CoordinatorCreateLayerResponse {
3538 type Owned = Self;
3539
3540 #[inline(always)]
3541 fn inline_align(_context: fidl::encoding::Context) -> usize {
3542 8
3543 }
3544
3545 #[inline(always)]
3546 fn inline_size(_context: fidl::encoding::Context) -> usize {
3547 8
3548 }
3549 #[inline(always)]
3550 fn encode_is_copy() -> bool {
3551 true
3552 }
3553
3554 #[inline(always)]
3555 fn decode_is_copy() -> bool {
3556 true
3557 }
3558 }
3559
3560 unsafe impl<D: fidl::encoding::ResourceDialect>
3561 fidl::encoding::Encode<CoordinatorCreateLayerResponse, D>
3562 for &CoordinatorCreateLayerResponse
3563 {
3564 #[inline]
3565 unsafe fn encode(
3566 self,
3567 encoder: &mut fidl::encoding::Encoder<'_, D>,
3568 offset: usize,
3569 _depth: fidl::encoding::Depth,
3570 ) -> fidl::Result<()> {
3571 encoder.debug_check_bounds::<CoordinatorCreateLayerResponse>(offset);
3572 unsafe {
3573 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3575 (buf_ptr as *mut CoordinatorCreateLayerResponse)
3576 .write_unaligned((self as *const CoordinatorCreateLayerResponse).read());
3577 }
3580 Ok(())
3581 }
3582 }
3583 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<LayerId, D>>
3584 fidl::encoding::Encode<CoordinatorCreateLayerResponse, D> for (T0,)
3585 {
3586 #[inline]
3587 unsafe fn encode(
3588 self,
3589 encoder: &mut fidl::encoding::Encoder<'_, D>,
3590 offset: usize,
3591 depth: fidl::encoding::Depth,
3592 ) -> fidl::Result<()> {
3593 encoder.debug_check_bounds::<CoordinatorCreateLayerResponse>(offset);
3594 self.0.encode(encoder, offset + 0, depth)?;
3598 Ok(())
3599 }
3600 }
3601
3602 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3603 for CoordinatorCreateLayerResponse
3604 {
3605 #[inline(always)]
3606 fn new_empty() -> Self {
3607 Self { layer_id: fidl::new_empty!(LayerId, D) }
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, 8);
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}