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 QuaternionF = Vec4F;
12
13#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
19#[repr(C)]
20pub struct Inset {
21 pub top: i32,
24 pub right: i32,
27 pub bottom: i32,
30 pub left: i32,
33}
34
35impl fidl::Persistable for Inset {}
36
37#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
43pub struct InsetF {
44 pub top: f32,
47 pub right: f32,
50 pub bottom: f32,
53 pub left: f32,
56}
57
58impl fidl::Persistable for InsetF {}
59
60#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
66#[repr(C)]
67pub struct Point {
68 pub x: i32,
70 pub y: i32,
72}
73
74impl fidl::Persistable for Point {}
75
76#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
82pub struct Point3F {
83 pub x: f32,
85 pub y: f32,
87 pub z: f32,
89}
90
91impl fidl::Persistable for Point3F {}
92
93#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
99pub struct PointF {
100 pub x: f32,
102 pub y: f32,
104}
105
106impl fidl::Persistable for PointF {}
107
108#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
121pub struct RRectF {
122 pub x: f32,
124 pub y: f32,
126 pub width: f32,
132 pub height: f32,
138 pub top_left_radius_x: f32,
143 pub top_left_radius_y: f32,
148 pub top_right_radius_x: f32,
153 pub top_right_radius_y: f32,
158 pub bottom_left_radius_x: f32,
163 pub bottom_left_radius_y: f32,
168 pub bottom_right_radius_x: f32,
173 pub bottom_right_radius_y: f32,
178}
179
180impl fidl::Persistable for RRectF {}
181
182#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
184#[repr(C)]
185pub struct RatioU32 {
186 pub numerator: u32,
188 pub denominator: u32,
190}
191
192impl fidl::Persistable for RatioU32 {}
193
194#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
196#[repr(C)]
197pub struct RatioU64 {
198 pub numerator: u64,
200 pub denominator: u64,
202}
203
204impl fidl::Persistable for RatioU64 {}
205
206#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
213#[repr(C)]
214pub struct Rect {
215 pub x: i32,
217 pub y: i32,
219 pub width: i32,
225 pub height: i32,
231}
232
233impl fidl::Persistable for Rect {}
234
235#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
242pub struct RectF {
243 pub x: f32,
245 pub y: f32,
247 pub width: f32,
253 pub height: f32,
259}
260
261impl fidl::Persistable for RectF {}
262
263#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
270#[repr(C)]
271pub struct RectU {
272 pub x: u32,
274 pub y: u32,
276 pub width: u32,
281 pub height: u32,
286}
287
288impl fidl::Persistable for RectU {}
289
290#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
300#[repr(C)]
301pub struct Size {
302 pub width: i32,
304 pub height: i32,
306}
307
308impl fidl::Persistable for Size {}
309
310#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
321pub struct SizeF {
322 pub width: f32,
324 pub height: f32,
326}
327
328impl fidl::Persistable for SizeF {}
329
330#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
337#[repr(C)]
338pub struct SizeU {
339 pub width: u32,
341 pub height: u32,
343}
344
345impl fidl::Persistable for SizeU {}
346
347#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
354pub struct Transform {
355 pub matrix: [f32; 16],
369}
370
371impl fidl::Persistable for Transform {}
372
373#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
379#[repr(C)]
380pub struct Vec_ {
381 pub x: i32,
382 pub y: i32,
383}
384
385impl fidl::Persistable for Vec_ {}
386
387#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
393pub struct Vec3F {
394 pub x: f32,
395 pub y: f32,
396 pub z: f32,
397}
398
399impl fidl::Persistable for Vec3F {}
400
401#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
407pub struct Vec4F {
408 pub x: f32,
409 pub y: f32,
410 pub z: f32,
411 pub w: f32,
412}
413
414impl fidl::Persistable for Vec4F {}
415
416#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
422pub struct VecF {
423 pub x: f32,
424 pub y: f32,
425}
426
427impl fidl::Persistable for VecF {}
428
429mod internal {
430 use super::*;
431
432 impl fidl::encoding::ValueTypeMarker for Inset {
433 type Borrowed<'a> = &'a Self;
434 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
435 value
436 }
437 }
438
439 unsafe impl fidl::encoding::TypeMarker for Inset {
440 type Owned = Self;
441
442 #[inline(always)]
443 fn inline_align(_context: fidl::encoding::Context) -> usize {
444 4
445 }
446
447 #[inline(always)]
448 fn inline_size(_context: fidl::encoding::Context) -> usize {
449 16
450 }
451 #[inline(always)]
452 fn encode_is_copy() -> bool {
453 true
454 }
455
456 #[inline(always)]
457 fn decode_is_copy() -> bool {
458 true
459 }
460 }
461
462 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Inset, D> for &Inset {
463 #[inline]
464 unsafe fn encode(
465 self,
466 encoder: &mut fidl::encoding::Encoder<'_, D>,
467 offset: usize,
468 _depth: fidl::encoding::Depth,
469 ) -> fidl::Result<()> {
470 encoder.debug_check_bounds::<Inset>(offset);
471 unsafe {
472 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
474 (buf_ptr as *mut Inset).write_unaligned((self as *const Inset).read());
475 }
478 Ok(())
479 }
480 }
481 unsafe impl<
482 D: fidl::encoding::ResourceDialect,
483 T0: fidl::encoding::Encode<i32, D>,
484 T1: fidl::encoding::Encode<i32, D>,
485 T2: fidl::encoding::Encode<i32, D>,
486 T3: fidl::encoding::Encode<i32, D>,
487 > fidl::encoding::Encode<Inset, D> for (T0, T1, T2, T3)
488 {
489 #[inline]
490 unsafe fn encode(
491 self,
492 encoder: &mut fidl::encoding::Encoder<'_, D>,
493 offset: usize,
494 depth: fidl::encoding::Depth,
495 ) -> fidl::Result<()> {
496 encoder.debug_check_bounds::<Inset>(offset);
497 self.0.encode(encoder, offset + 0, depth)?;
501 self.1.encode(encoder, offset + 4, depth)?;
502 self.2.encode(encoder, offset + 8, depth)?;
503 self.3.encode(encoder, offset + 12, depth)?;
504 Ok(())
505 }
506 }
507
508 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Inset {
509 #[inline(always)]
510 fn new_empty() -> Self {
511 Self {
512 top: fidl::new_empty!(i32, D),
513 right: fidl::new_empty!(i32, D),
514 bottom: fidl::new_empty!(i32, D),
515 left: fidl::new_empty!(i32, D),
516 }
517 }
518
519 #[inline]
520 unsafe fn decode(
521 &mut self,
522 decoder: &mut fidl::encoding::Decoder<'_, D>,
523 offset: usize,
524 _depth: fidl::encoding::Depth,
525 ) -> fidl::Result<()> {
526 decoder.debug_check_bounds::<Self>(offset);
527 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
528 unsafe {
531 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
532 }
533 Ok(())
534 }
535 }
536
537 impl fidl::encoding::ValueTypeMarker for InsetF {
538 type Borrowed<'a> = &'a Self;
539 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
540 value
541 }
542 }
543
544 unsafe impl fidl::encoding::TypeMarker for InsetF {
545 type Owned = Self;
546
547 #[inline(always)]
548 fn inline_align(_context: fidl::encoding::Context) -> usize {
549 4
550 }
551
552 #[inline(always)]
553 fn inline_size(_context: fidl::encoding::Context) -> usize {
554 16
555 }
556 }
557
558 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<InsetF, D> for &InsetF {
559 #[inline]
560 unsafe fn encode(
561 self,
562 encoder: &mut fidl::encoding::Encoder<'_, D>,
563 offset: usize,
564 _depth: fidl::encoding::Depth,
565 ) -> fidl::Result<()> {
566 encoder.debug_check_bounds::<InsetF>(offset);
567 fidl::encoding::Encode::<InsetF, D>::encode(
569 (
570 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.top),
571 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.right),
572 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.bottom),
573 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.left),
574 ),
575 encoder,
576 offset,
577 _depth,
578 )
579 }
580 }
581 unsafe impl<
582 D: fidl::encoding::ResourceDialect,
583 T0: fidl::encoding::Encode<f32, D>,
584 T1: fidl::encoding::Encode<f32, D>,
585 T2: fidl::encoding::Encode<f32, D>,
586 T3: fidl::encoding::Encode<f32, D>,
587 > fidl::encoding::Encode<InsetF, D> for (T0, T1, T2, T3)
588 {
589 #[inline]
590 unsafe fn encode(
591 self,
592 encoder: &mut fidl::encoding::Encoder<'_, D>,
593 offset: usize,
594 depth: fidl::encoding::Depth,
595 ) -> fidl::Result<()> {
596 encoder.debug_check_bounds::<InsetF>(offset);
597 self.0.encode(encoder, offset + 0, depth)?;
601 self.1.encode(encoder, offset + 4, depth)?;
602 self.2.encode(encoder, offset + 8, depth)?;
603 self.3.encode(encoder, offset + 12, depth)?;
604 Ok(())
605 }
606 }
607
608 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for InsetF {
609 #[inline(always)]
610 fn new_empty() -> Self {
611 Self {
612 top: fidl::new_empty!(f32, D),
613 right: fidl::new_empty!(f32, D),
614 bottom: fidl::new_empty!(f32, D),
615 left: fidl::new_empty!(f32, D),
616 }
617 }
618
619 #[inline]
620 unsafe fn decode(
621 &mut self,
622 decoder: &mut fidl::encoding::Decoder<'_, D>,
623 offset: usize,
624 _depth: fidl::encoding::Depth,
625 ) -> fidl::Result<()> {
626 decoder.debug_check_bounds::<Self>(offset);
627 fidl::decode!(f32, D, &mut self.top, decoder, offset + 0, _depth)?;
629 fidl::decode!(f32, D, &mut self.right, decoder, offset + 4, _depth)?;
630 fidl::decode!(f32, D, &mut self.bottom, decoder, offset + 8, _depth)?;
631 fidl::decode!(f32, D, &mut self.left, decoder, offset + 12, _depth)?;
632 Ok(())
633 }
634 }
635
636 impl fidl::encoding::ValueTypeMarker for Point {
637 type Borrowed<'a> = &'a Self;
638 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
639 value
640 }
641 }
642
643 unsafe impl fidl::encoding::TypeMarker for Point {
644 type Owned = Self;
645
646 #[inline(always)]
647 fn inline_align(_context: fidl::encoding::Context) -> usize {
648 4
649 }
650
651 #[inline(always)]
652 fn inline_size(_context: fidl::encoding::Context) -> usize {
653 8
654 }
655 #[inline(always)]
656 fn encode_is_copy() -> bool {
657 true
658 }
659
660 #[inline(always)]
661 fn decode_is_copy() -> bool {
662 true
663 }
664 }
665
666 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Point, D> for &Point {
667 #[inline]
668 unsafe fn encode(
669 self,
670 encoder: &mut fidl::encoding::Encoder<'_, D>,
671 offset: usize,
672 _depth: fidl::encoding::Depth,
673 ) -> fidl::Result<()> {
674 encoder.debug_check_bounds::<Point>(offset);
675 unsafe {
676 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
678 (buf_ptr as *mut Point).write_unaligned((self as *const Point).read());
679 }
682 Ok(())
683 }
684 }
685 unsafe impl<
686 D: fidl::encoding::ResourceDialect,
687 T0: fidl::encoding::Encode<i32, D>,
688 T1: fidl::encoding::Encode<i32, D>,
689 > fidl::encoding::Encode<Point, D> for (T0, T1)
690 {
691 #[inline]
692 unsafe fn encode(
693 self,
694 encoder: &mut fidl::encoding::Encoder<'_, D>,
695 offset: usize,
696 depth: fidl::encoding::Depth,
697 ) -> fidl::Result<()> {
698 encoder.debug_check_bounds::<Point>(offset);
699 self.0.encode(encoder, offset + 0, depth)?;
703 self.1.encode(encoder, offset + 4, depth)?;
704 Ok(())
705 }
706 }
707
708 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Point {
709 #[inline(always)]
710 fn new_empty() -> Self {
711 Self { x: fidl::new_empty!(i32, D), y: fidl::new_empty!(i32, D) }
712 }
713
714 #[inline]
715 unsafe fn decode(
716 &mut self,
717 decoder: &mut fidl::encoding::Decoder<'_, D>,
718 offset: usize,
719 _depth: fidl::encoding::Depth,
720 ) -> fidl::Result<()> {
721 decoder.debug_check_bounds::<Self>(offset);
722 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
723 unsafe {
726 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
727 }
728 Ok(())
729 }
730 }
731
732 impl fidl::encoding::ValueTypeMarker for Point3F {
733 type Borrowed<'a> = &'a Self;
734 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
735 value
736 }
737 }
738
739 unsafe impl fidl::encoding::TypeMarker for Point3F {
740 type Owned = Self;
741
742 #[inline(always)]
743 fn inline_align(_context: fidl::encoding::Context) -> usize {
744 4
745 }
746
747 #[inline(always)]
748 fn inline_size(_context: fidl::encoding::Context) -> usize {
749 12
750 }
751 }
752
753 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Point3F, D> for &Point3F {
754 #[inline]
755 unsafe fn encode(
756 self,
757 encoder: &mut fidl::encoding::Encoder<'_, D>,
758 offset: usize,
759 _depth: fidl::encoding::Depth,
760 ) -> fidl::Result<()> {
761 encoder.debug_check_bounds::<Point3F>(offset);
762 fidl::encoding::Encode::<Point3F, D>::encode(
764 (
765 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
766 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
767 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
768 ),
769 encoder,
770 offset,
771 _depth,
772 )
773 }
774 }
775 unsafe impl<
776 D: fidl::encoding::ResourceDialect,
777 T0: fidl::encoding::Encode<f32, D>,
778 T1: fidl::encoding::Encode<f32, D>,
779 T2: fidl::encoding::Encode<f32, D>,
780 > fidl::encoding::Encode<Point3F, D> for (T0, T1, T2)
781 {
782 #[inline]
783 unsafe fn encode(
784 self,
785 encoder: &mut fidl::encoding::Encoder<'_, D>,
786 offset: usize,
787 depth: fidl::encoding::Depth,
788 ) -> fidl::Result<()> {
789 encoder.debug_check_bounds::<Point3F>(offset);
790 self.0.encode(encoder, offset + 0, depth)?;
794 self.1.encode(encoder, offset + 4, depth)?;
795 self.2.encode(encoder, offset + 8, depth)?;
796 Ok(())
797 }
798 }
799
800 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Point3F {
801 #[inline(always)]
802 fn new_empty() -> Self {
803 Self {
804 x: fidl::new_empty!(f32, D),
805 y: fidl::new_empty!(f32, D),
806 z: fidl::new_empty!(f32, D),
807 }
808 }
809
810 #[inline]
811 unsafe fn decode(
812 &mut self,
813 decoder: &mut fidl::encoding::Decoder<'_, D>,
814 offset: usize,
815 _depth: fidl::encoding::Depth,
816 ) -> fidl::Result<()> {
817 decoder.debug_check_bounds::<Self>(offset);
818 fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
820 fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
821 fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
822 Ok(())
823 }
824 }
825
826 impl fidl::encoding::ValueTypeMarker for PointF {
827 type Borrowed<'a> = &'a Self;
828 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
829 value
830 }
831 }
832
833 unsafe impl fidl::encoding::TypeMarker for PointF {
834 type Owned = Self;
835
836 #[inline(always)]
837 fn inline_align(_context: fidl::encoding::Context) -> usize {
838 4
839 }
840
841 #[inline(always)]
842 fn inline_size(_context: fidl::encoding::Context) -> usize {
843 8
844 }
845 }
846
847 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PointF, D> for &PointF {
848 #[inline]
849 unsafe fn encode(
850 self,
851 encoder: &mut fidl::encoding::Encoder<'_, D>,
852 offset: usize,
853 _depth: fidl::encoding::Depth,
854 ) -> fidl::Result<()> {
855 encoder.debug_check_bounds::<PointF>(offset);
856 fidl::encoding::Encode::<PointF, D>::encode(
858 (
859 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
860 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
861 ),
862 encoder,
863 offset,
864 _depth,
865 )
866 }
867 }
868 unsafe impl<
869 D: fidl::encoding::ResourceDialect,
870 T0: fidl::encoding::Encode<f32, D>,
871 T1: fidl::encoding::Encode<f32, D>,
872 > fidl::encoding::Encode<PointF, D> for (T0, T1)
873 {
874 #[inline]
875 unsafe fn encode(
876 self,
877 encoder: &mut fidl::encoding::Encoder<'_, D>,
878 offset: usize,
879 depth: fidl::encoding::Depth,
880 ) -> fidl::Result<()> {
881 encoder.debug_check_bounds::<PointF>(offset);
882 self.0.encode(encoder, offset + 0, depth)?;
886 self.1.encode(encoder, offset + 4, depth)?;
887 Ok(())
888 }
889 }
890
891 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PointF {
892 #[inline(always)]
893 fn new_empty() -> Self {
894 Self { x: fidl::new_empty!(f32, D), y: fidl::new_empty!(f32, D) }
895 }
896
897 #[inline]
898 unsafe fn decode(
899 &mut self,
900 decoder: &mut fidl::encoding::Decoder<'_, D>,
901 offset: usize,
902 _depth: fidl::encoding::Depth,
903 ) -> fidl::Result<()> {
904 decoder.debug_check_bounds::<Self>(offset);
905 fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
907 fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
908 Ok(())
909 }
910 }
911
912 impl fidl::encoding::ValueTypeMarker for RRectF {
913 type Borrowed<'a> = &'a Self;
914 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
915 value
916 }
917 }
918
919 unsafe impl fidl::encoding::TypeMarker for RRectF {
920 type Owned = Self;
921
922 #[inline(always)]
923 fn inline_align(_context: fidl::encoding::Context) -> usize {
924 4
925 }
926
927 #[inline(always)]
928 fn inline_size(_context: fidl::encoding::Context) -> usize {
929 48
930 }
931 }
932
933 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RRectF, D> for &RRectF {
934 #[inline]
935 unsafe fn encode(
936 self,
937 encoder: &mut fidl::encoding::Encoder<'_, D>,
938 offset: usize,
939 _depth: fidl::encoding::Depth,
940 ) -> fidl::Result<()> {
941 encoder.debug_check_bounds::<RRectF>(offset);
942 fidl::encoding::Encode::<RRectF, D>::encode(
944 (
945 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
946 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
947 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
948 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
949 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.top_left_radius_x),
950 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.top_left_radius_y),
951 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.top_right_radius_x),
952 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.top_right_radius_y),
953 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.bottom_left_radius_x),
954 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.bottom_left_radius_y),
955 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.bottom_right_radius_x),
956 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.bottom_right_radius_y),
957 ),
958 encoder,
959 offset,
960 _depth,
961 )
962 }
963 }
964 unsafe impl<
965 D: fidl::encoding::ResourceDialect,
966 T0: fidl::encoding::Encode<f32, D>,
967 T1: fidl::encoding::Encode<f32, D>,
968 T2: fidl::encoding::Encode<f32, D>,
969 T3: fidl::encoding::Encode<f32, D>,
970 T4: fidl::encoding::Encode<f32, D>,
971 T5: fidl::encoding::Encode<f32, D>,
972 T6: fidl::encoding::Encode<f32, D>,
973 T7: fidl::encoding::Encode<f32, D>,
974 T8: fidl::encoding::Encode<f32, D>,
975 T9: fidl::encoding::Encode<f32, D>,
976 T10: fidl::encoding::Encode<f32, D>,
977 T11: fidl::encoding::Encode<f32, D>,
978 > fidl::encoding::Encode<RRectF, D> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
979 {
980 #[inline]
981 unsafe fn encode(
982 self,
983 encoder: &mut fidl::encoding::Encoder<'_, D>,
984 offset: usize,
985 depth: fidl::encoding::Depth,
986 ) -> fidl::Result<()> {
987 encoder.debug_check_bounds::<RRectF>(offset);
988 self.0.encode(encoder, offset + 0, depth)?;
992 self.1.encode(encoder, offset + 4, depth)?;
993 self.2.encode(encoder, offset + 8, depth)?;
994 self.3.encode(encoder, offset + 12, depth)?;
995 self.4.encode(encoder, offset + 16, depth)?;
996 self.5.encode(encoder, offset + 20, depth)?;
997 self.6.encode(encoder, offset + 24, depth)?;
998 self.7.encode(encoder, offset + 28, depth)?;
999 self.8.encode(encoder, offset + 32, depth)?;
1000 self.9.encode(encoder, offset + 36, depth)?;
1001 self.10.encode(encoder, offset + 40, depth)?;
1002 self.11.encode(encoder, offset + 44, depth)?;
1003 Ok(())
1004 }
1005 }
1006
1007 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RRectF {
1008 #[inline(always)]
1009 fn new_empty() -> Self {
1010 Self {
1011 x: fidl::new_empty!(f32, D),
1012 y: fidl::new_empty!(f32, D),
1013 width: fidl::new_empty!(f32, D),
1014 height: fidl::new_empty!(f32, D),
1015 top_left_radius_x: fidl::new_empty!(f32, D),
1016 top_left_radius_y: fidl::new_empty!(f32, D),
1017 top_right_radius_x: fidl::new_empty!(f32, D),
1018 top_right_radius_y: fidl::new_empty!(f32, D),
1019 bottom_left_radius_x: fidl::new_empty!(f32, D),
1020 bottom_left_radius_y: fidl::new_empty!(f32, D),
1021 bottom_right_radius_x: fidl::new_empty!(f32, D),
1022 bottom_right_radius_y: fidl::new_empty!(f32, D),
1023 }
1024 }
1025
1026 #[inline]
1027 unsafe fn decode(
1028 &mut self,
1029 decoder: &mut fidl::encoding::Decoder<'_, D>,
1030 offset: usize,
1031 _depth: fidl::encoding::Depth,
1032 ) -> fidl::Result<()> {
1033 decoder.debug_check_bounds::<Self>(offset);
1034 fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
1036 fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
1037 fidl::decode!(f32, D, &mut self.width, decoder, offset + 8, _depth)?;
1038 fidl::decode!(f32, D, &mut self.height, decoder, offset + 12, _depth)?;
1039 fidl::decode!(f32, D, &mut self.top_left_radius_x, decoder, offset + 16, _depth)?;
1040 fidl::decode!(f32, D, &mut self.top_left_radius_y, decoder, offset + 20, _depth)?;
1041 fidl::decode!(f32, D, &mut self.top_right_radius_x, decoder, offset + 24, _depth)?;
1042 fidl::decode!(f32, D, &mut self.top_right_radius_y, decoder, offset + 28, _depth)?;
1043 fidl::decode!(f32, D, &mut self.bottom_left_radius_x, decoder, offset + 32, _depth)?;
1044 fidl::decode!(f32, D, &mut self.bottom_left_radius_y, decoder, offset + 36, _depth)?;
1045 fidl::decode!(f32, D, &mut self.bottom_right_radius_x, decoder, offset + 40, _depth)?;
1046 fidl::decode!(f32, D, &mut self.bottom_right_radius_y, decoder, offset + 44, _depth)?;
1047 Ok(())
1048 }
1049 }
1050
1051 impl fidl::encoding::ValueTypeMarker for RatioU32 {
1052 type Borrowed<'a> = &'a Self;
1053 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1054 value
1055 }
1056 }
1057
1058 unsafe impl fidl::encoding::TypeMarker for RatioU32 {
1059 type Owned = Self;
1060
1061 #[inline(always)]
1062 fn inline_align(_context: fidl::encoding::Context) -> usize {
1063 4
1064 }
1065
1066 #[inline(always)]
1067 fn inline_size(_context: fidl::encoding::Context) -> usize {
1068 8
1069 }
1070 #[inline(always)]
1071 fn encode_is_copy() -> bool {
1072 true
1073 }
1074
1075 #[inline(always)]
1076 fn decode_is_copy() -> bool {
1077 true
1078 }
1079 }
1080
1081 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RatioU32, D> for &RatioU32 {
1082 #[inline]
1083 unsafe fn encode(
1084 self,
1085 encoder: &mut fidl::encoding::Encoder<'_, D>,
1086 offset: usize,
1087 _depth: fidl::encoding::Depth,
1088 ) -> fidl::Result<()> {
1089 encoder.debug_check_bounds::<RatioU32>(offset);
1090 unsafe {
1091 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1093 (buf_ptr as *mut RatioU32).write_unaligned((self as *const RatioU32).read());
1094 }
1097 Ok(())
1098 }
1099 }
1100 unsafe impl<
1101 D: fidl::encoding::ResourceDialect,
1102 T0: fidl::encoding::Encode<u32, D>,
1103 T1: fidl::encoding::Encode<u32, D>,
1104 > fidl::encoding::Encode<RatioU32, D> for (T0, T1)
1105 {
1106 #[inline]
1107 unsafe fn encode(
1108 self,
1109 encoder: &mut fidl::encoding::Encoder<'_, D>,
1110 offset: usize,
1111 depth: fidl::encoding::Depth,
1112 ) -> fidl::Result<()> {
1113 encoder.debug_check_bounds::<RatioU32>(offset);
1114 self.0.encode(encoder, offset + 0, depth)?;
1118 self.1.encode(encoder, offset + 4, depth)?;
1119 Ok(())
1120 }
1121 }
1122
1123 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RatioU32 {
1124 #[inline(always)]
1125 fn new_empty() -> Self {
1126 Self { numerator: fidl::new_empty!(u32, D), denominator: fidl::new_empty!(u32, D) }
1127 }
1128
1129 #[inline]
1130 unsafe fn decode(
1131 &mut self,
1132 decoder: &mut fidl::encoding::Decoder<'_, D>,
1133 offset: usize,
1134 _depth: fidl::encoding::Depth,
1135 ) -> fidl::Result<()> {
1136 decoder.debug_check_bounds::<Self>(offset);
1137 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1138 unsafe {
1141 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1142 }
1143 Ok(())
1144 }
1145 }
1146
1147 impl fidl::encoding::ValueTypeMarker for RatioU64 {
1148 type Borrowed<'a> = &'a Self;
1149 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1150 value
1151 }
1152 }
1153
1154 unsafe impl fidl::encoding::TypeMarker for RatioU64 {
1155 type Owned = Self;
1156
1157 #[inline(always)]
1158 fn inline_align(_context: fidl::encoding::Context) -> usize {
1159 8
1160 }
1161
1162 #[inline(always)]
1163 fn inline_size(_context: fidl::encoding::Context) -> usize {
1164 16
1165 }
1166 #[inline(always)]
1167 fn encode_is_copy() -> bool {
1168 true
1169 }
1170
1171 #[inline(always)]
1172 fn decode_is_copy() -> bool {
1173 true
1174 }
1175 }
1176
1177 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RatioU64, D> for &RatioU64 {
1178 #[inline]
1179 unsafe fn encode(
1180 self,
1181 encoder: &mut fidl::encoding::Encoder<'_, D>,
1182 offset: usize,
1183 _depth: fidl::encoding::Depth,
1184 ) -> fidl::Result<()> {
1185 encoder.debug_check_bounds::<RatioU64>(offset);
1186 unsafe {
1187 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1189 (buf_ptr as *mut RatioU64).write_unaligned((self as *const RatioU64).read());
1190 }
1193 Ok(())
1194 }
1195 }
1196 unsafe impl<
1197 D: fidl::encoding::ResourceDialect,
1198 T0: fidl::encoding::Encode<u64, D>,
1199 T1: fidl::encoding::Encode<u64, D>,
1200 > fidl::encoding::Encode<RatioU64, D> for (T0, T1)
1201 {
1202 #[inline]
1203 unsafe fn encode(
1204 self,
1205 encoder: &mut fidl::encoding::Encoder<'_, D>,
1206 offset: usize,
1207 depth: fidl::encoding::Depth,
1208 ) -> fidl::Result<()> {
1209 encoder.debug_check_bounds::<RatioU64>(offset);
1210 self.0.encode(encoder, offset + 0, depth)?;
1214 self.1.encode(encoder, offset + 8, depth)?;
1215 Ok(())
1216 }
1217 }
1218
1219 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RatioU64 {
1220 #[inline(always)]
1221 fn new_empty() -> Self {
1222 Self { numerator: fidl::new_empty!(u64, D), denominator: fidl::new_empty!(u64, D) }
1223 }
1224
1225 #[inline]
1226 unsafe fn decode(
1227 &mut self,
1228 decoder: &mut fidl::encoding::Decoder<'_, D>,
1229 offset: usize,
1230 _depth: fidl::encoding::Depth,
1231 ) -> fidl::Result<()> {
1232 decoder.debug_check_bounds::<Self>(offset);
1233 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1234 unsafe {
1237 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
1238 }
1239 Ok(())
1240 }
1241 }
1242
1243 impl fidl::encoding::ValueTypeMarker for Rect {
1244 type Borrowed<'a> = &'a Self;
1245 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1246 value
1247 }
1248 }
1249
1250 unsafe impl fidl::encoding::TypeMarker for Rect {
1251 type Owned = Self;
1252
1253 #[inline(always)]
1254 fn inline_align(_context: fidl::encoding::Context) -> usize {
1255 4
1256 }
1257
1258 #[inline(always)]
1259 fn inline_size(_context: fidl::encoding::Context) -> usize {
1260 16
1261 }
1262 #[inline(always)]
1263 fn encode_is_copy() -> bool {
1264 true
1265 }
1266
1267 #[inline(always)]
1268 fn decode_is_copy() -> bool {
1269 true
1270 }
1271 }
1272
1273 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Rect, D> for &Rect {
1274 #[inline]
1275 unsafe fn encode(
1276 self,
1277 encoder: &mut fidl::encoding::Encoder<'_, D>,
1278 offset: usize,
1279 _depth: fidl::encoding::Depth,
1280 ) -> fidl::Result<()> {
1281 encoder.debug_check_bounds::<Rect>(offset);
1282 unsafe {
1283 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1285 (buf_ptr as *mut Rect).write_unaligned((self as *const Rect).read());
1286 }
1289 Ok(())
1290 }
1291 }
1292 unsafe impl<
1293 D: fidl::encoding::ResourceDialect,
1294 T0: fidl::encoding::Encode<i32, D>,
1295 T1: fidl::encoding::Encode<i32, D>,
1296 T2: fidl::encoding::Encode<i32, D>,
1297 T3: fidl::encoding::Encode<i32, D>,
1298 > fidl::encoding::Encode<Rect, D> for (T0, T1, T2, T3)
1299 {
1300 #[inline]
1301 unsafe fn encode(
1302 self,
1303 encoder: &mut fidl::encoding::Encoder<'_, D>,
1304 offset: usize,
1305 depth: fidl::encoding::Depth,
1306 ) -> fidl::Result<()> {
1307 encoder.debug_check_bounds::<Rect>(offset);
1308 self.0.encode(encoder, offset + 0, depth)?;
1312 self.1.encode(encoder, offset + 4, depth)?;
1313 self.2.encode(encoder, offset + 8, depth)?;
1314 self.3.encode(encoder, offset + 12, depth)?;
1315 Ok(())
1316 }
1317 }
1318
1319 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Rect {
1320 #[inline(always)]
1321 fn new_empty() -> Self {
1322 Self {
1323 x: fidl::new_empty!(i32, D),
1324 y: fidl::new_empty!(i32, D),
1325 width: fidl::new_empty!(i32, D),
1326 height: fidl::new_empty!(i32, D),
1327 }
1328 }
1329
1330 #[inline]
1331 unsafe fn decode(
1332 &mut self,
1333 decoder: &mut fidl::encoding::Decoder<'_, D>,
1334 offset: usize,
1335 _depth: fidl::encoding::Depth,
1336 ) -> fidl::Result<()> {
1337 decoder.debug_check_bounds::<Self>(offset);
1338 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1339 unsafe {
1342 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
1343 }
1344 Ok(())
1345 }
1346 }
1347
1348 impl fidl::encoding::ValueTypeMarker for RectF {
1349 type Borrowed<'a> = &'a Self;
1350 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1351 value
1352 }
1353 }
1354
1355 unsafe impl fidl::encoding::TypeMarker for RectF {
1356 type Owned = Self;
1357
1358 #[inline(always)]
1359 fn inline_align(_context: fidl::encoding::Context) -> usize {
1360 4
1361 }
1362
1363 #[inline(always)]
1364 fn inline_size(_context: fidl::encoding::Context) -> usize {
1365 16
1366 }
1367 }
1368
1369 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RectF, D> for &RectF {
1370 #[inline]
1371 unsafe fn encode(
1372 self,
1373 encoder: &mut fidl::encoding::Encoder<'_, D>,
1374 offset: usize,
1375 _depth: fidl::encoding::Depth,
1376 ) -> fidl::Result<()> {
1377 encoder.debug_check_bounds::<RectF>(offset);
1378 fidl::encoding::Encode::<RectF, D>::encode(
1380 (
1381 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
1382 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
1383 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
1384 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
1385 ),
1386 encoder,
1387 offset,
1388 _depth,
1389 )
1390 }
1391 }
1392 unsafe impl<
1393 D: fidl::encoding::ResourceDialect,
1394 T0: fidl::encoding::Encode<f32, D>,
1395 T1: fidl::encoding::Encode<f32, D>,
1396 T2: fidl::encoding::Encode<f32, D>,
1397 T3: fidl::encoding::Encode<f32, D>,
1398 > fidl::encoding::Encode<RectF, D> for (T0, T1, T2, T3)
1399 {
1400 #[inline]
1401 unsafe fn encode(
1402 self,
1403 encoder: &mut fidl::encoding::Encoder<'_, D>,
1404 offset: usize,
1405 depth: fidl::encoding::Depth,
1406 ) -> fidl::Result<()> {
1407 encoder.debug_check_bounds::<RectF>(offset);
1408 self.0.encode(encoder, offset + 0, depth)?;
1412 self.1.encode(encoder, offset + 4, depth)?;
1413 self.2.encode(encoder, offset + 8, depth)?;
1414 self.3.encode(encoder, offset + 12, depth)?;
1415 Ok(())
1416 }
1417 }
1418
1419 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RectF {
1420 #[inline(always)]
1421 fn new_empty() -> Self {
1422 Self {
1423 x: fidl::new_empty!(f32, D),
1424 y: fidl::new_empty!(f32, D),
1425 width: fidl::new_empty!(f32, D),
1426 height: fidl::new_empty!(f32, D),
1427 }
1428 }
1429
1430 #[inline]
1431 unsafe fn decode(
1432 &mut self,
1433 decoder: &mut fidl::encoding::Decoder<'_, D>,
1434 offset: usize,
1435 _depth: fidl::encoding::Depth,
1436 ) -> fidl::Result<()> {
1437 decoder.debug_check_bounds::<Self>(offset);
1438 fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
1440 fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
1441 fidl::decode!(f32, D, &mut self.width, decoder, offset + 8, _depth)?;
1442 fidl::decode!(f32, D, &mut self.height, decoder, offset + 12, _depth)?;
1443 Ok(())
1444 }
1445 }
1446
1447 impl fidl::encoding::ValueTypeMarker for RectU {
1448 type Borrowed<'a> = &'a Self;
1449 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1450 value
1451 }
1452 }
1453
1454 unsafe impl fidl::encoding::TypeMarker for RectU {
1455 type Owned = Self;
1456
1457 #[inline(always)]
1458 fn inline_align(_context: fidl::encoding::Context) -> usize {
1459 4
1460 }
1461
1462 #[inline(always)]
1463 fn inline_size(_context: fidl::encoding::Context) -> usize {
1464 16
1465 }
1466 #[inline(always)]
1467 fn encode_is_copy() -> bool {
1468 true
1469 }
1470
1471 #[inline(always)]
1472 fn decode_is_copy() -> bool {
1473 true
1474 }
1475 }
1476
1477 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<RectU, D> for &RectU {
1478 #[inline]
1479 unsafe fn encode(
1480 self,
1481 encoder: &mut fidl::encoding::Encoder<'_, D>,
1482 offset: usize,
1483 _depth: fidl::encoding::Depth,
1484 ) -> fidl::Result<()> {
1485 encoder.debug_check_bounds::<RectU>(offset);
1486 unsafe {
1487 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1489 (buf_ptr as *mut RectU).write_unaligned((self as *const RectU).read());
1490 }
1493 Ok(())
1494 }
1495 }
1496 unsafe impl<
1497 D: fidl::encoding::ResourceDialect,
1498 T0: fidl::encoding::Encode<u32, D>,
1499 T1: fidl::encoding::Encode<u32, D>,
1500 T2: fidl::encoding::Encode<u32, D>,
1501 T3: fidl::encoding::Encode<u32, D>,
1502 > fidl::encoding::Encode<RectU, D> for (T0, T1, T2, T3)
1503 {
1504 #[inline]
1505 unsafe fn encode(
1506 self,
1507 encoder: &mut fidl::encoding::Encoder<'_, D>,
1508 offset: usize,
1509 depth: fidl::encoding::Depth,
1510 ) -> fidl::Result<()> {
1511 encoder.debug_check_bounds::<RectU>(offset);
1512 self.0.encode(encoder, offset + 0, depth)?;
1516 self.1.encode(encoder, offset + 4, depth)?;
1517 self.2.encode(encoder, offset + 8, depth)?;
1518 self.3.encode(encoder, offset + 12, depth)?;
1519 Ok(())
1520 }
1521 }
1522
1523 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RectU {
1524 #[inline(always)]
1525 fn new_empty() -> Self {
1526 Self {
1527 x: fidl::new_empty!(u32, D),
1528 y: fidl::new_empty!(u32, D),
1529 width: fidl::new_empty!(u32, D),
1530 height: fidl::new_empty!(u32, D),
1531 }
1532 }
1533
1534 #[inline]
1535 unsafe fn decode(
1536 &mut self,
1537 decoder: &mut fidl::encoding::Decoder<'_, D>,
1538 offset: usize,
1539 _depth: fidl::encoding::Depth,
1540 ) -> fidl::Result<()> {
1541 decoder.debug_check_bounds::<Self>(offset);
1542 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1543 unsafe {
1546 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
1547 }
1548 Ok(())
1549 }
1550 }
1551
1552 impl fidl::encoding::ValueTypeMarker for Size {
1553 type Borrowed<'a> = &'a Self;
1554 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1555 value
1556 }
1557 }
1558
1559 unsafe impl fidl::encoding::TypeMarker for Size {
1560 type Owned = Self;
1561
1562 #[inline(always)]
1563 fn inline_align(_context: fidl::encoding::Context) -> usize {
1564 4
1565 }
1566
1567 #[inline(always)]
1568 fn inline_size(_context: fidl::encoding::Context) -> usize {
1569 8
1570 }
1571 #[inline(always)]
1572 fn encode_is_copy() -> bool {
1573 true
1574 }
1575
1576 #[inline(always)]
1577 fn decode_is_copy() -> bool {
1578 true
1579 }
1580 }
1581
1582 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Size, D> for &Size {
1583 #[inline]
1584 unsafe fn encode(
1585 self,
1586 encoder: &mut fidl::encoding::Encoder<'_, D>,
1587 offset: usize,
1588 _depth: fidl::encoding::Depth,
1589 ) -> fidl::Result<()> {
1590 encoder.debug_check_bounds::<Size>(offset);
1591 unsafe {
1592 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1594 (buf_ptr as *mut Size).write_unaligned((self as *const Size).read());
1595 }
1598 Ok(())
1599 }
1600 }
1601 unsafe impl<
1602 D: fidl::encoding::ResourceDialect,
1603 T0: fidl::encoding::Encode<i32, D>,
1604 T1: fidl::encoding::Encode<i32, D>,
1605 > fidl::encoding::Encode<Size, D> for (T0, T1)
1606 {
1607 #[inline]
1608 unsafe fn encode(
1609 self,
1610 encoder: &mut fidl::encoding::Encoder<'_, D>,
1611 offset: usize,
1612 depth: fidl::encoding::Depth,
1613 ) -> fidl::Result<()> {
1614 encoder.debug_check_bounds::<Size>(offset);
1615 self.0.encode(encoder, offset + 0, depth)?;
1619 self.1.encode(encoder, offset + 4, depth)?;
1620 Ok(())
1621 }
1622 }
1623
1624 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Size {
1625 #[inline(always)]
1626 fn new_empty() -> Self {
1627 Self { width: fidl::new_empty!(i32, D), height: fidl::new_empty!(i32, D) }
1628 }
1629
1630 #[inline]
1631 unsafe fn decode(
1632 &mut self,
1633 decoder: &mut fidl::encoding::Decoder<'_, D>,
1634 offset: usize,
1635 _depth: fidl::encoding::Depth,
1636 ) -> fidl::Result<()> {
1637 decoder.debug_check_bounds::<Self>(offset);
1638 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1639 unsafe {
1642 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1643 }
1644 Ok(())
1645 }
1646 }
1647
1648 impl fidl::encoding::ValueTypeMarker for SizeF {
1649 type Borrowed<'a> = &'a Self;
1650 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1651 value
1652 }
1653 }
1654
1655 unsafe impl fidl::encoding::TypeMarker for SizeF {
1656 type Owned = Self;
1657
1658 #[inline(always)]
1659 fn inline_align(_context: fidl::encoding::Context) -> usize {
1660 4
1661 }
1662
1663 #[inline(always)]
1664 fn inline_size(_context: fidl::encoding::Context) -> usize {
1665 8
1666 }
1667 }
1668
1669 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SizeF, D> for &SizeF {
1670 #[inline]
1671 unsafe fn encode(
1672 self,
1673 encoder: &mut fidl::encoding::Encoder<'_, D>,
1674 offset: usize,
1675 _depth: fidl::encoding::Depth,
1676 ) -> fidl::Result<()> {
1677 encoder.debug_check_bounds::<SizeF>(offset);
1678 fidl::encoding::Encode::<SizeF, D>::encode(
1680 (
1681 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
1682 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
1683 ),
1684 encoder,
1685 offset,
1686 _depth,
1687 )
1688 }
1689 }
1690 unsafe impl<
1691 D: fidl::encoding::ResourceDialect,
1692 T0: fidl::encoding::Encode<f32, D>,
1693 T1: fidl::encoding::Encode<f32, D>,
1694 > fidl::encoding::Encode<SizeF, D> for (T0, T1)
1695 {
1696 #[inline]
1697 unsafe fn encode(
1698 self,
1699 encoder: &mut fidl::encoding::Encoder<'_, D>,
1700 offset: usize,
1701 depth: fidl::encoding::Depth,
1702 ) -> fidl::Result<()> {
1703 encoder.debug_check_bounds::<SizeF>(offset);
1704 self.0.encode(encoder, offset + 0, depth)?;
1708 self.1.encode(encoder, offset + 4, depth)?;
1709 Ok(())
1710 }
1711 }
1712
1713 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SizeF {
1714 #[inline(always)]
1715 fn new_empty() -> Self {
1716 Self { width: fidl::new_empty!(f32, D), height: fidl::new_empty!(f32, D) }
1717 }
1718
1719 #[inline]
1720 unsafe fn decode(
1721 &mut self,
1722 decoder: &mut fidl::encoding::Decoder<'_, D>,
1723 offset: usize,
1724 _depth: fidl::encoding::Depth,
1725 ) -> fidl::Result<()> {
1726 decoder.debug_check_bounds::<Self>(offset);
1727 fidl::decode!(f32, D, &mut self.width, decoder, offset + 0, _depth)?;
1729 fidl::decode!(f32, D, &mut self.height, decoder, offset + 4, _depth)?;
1730 Ok(())
1731 }
1732 }
1733
1734 impl fidl::encoding::ValueTypeMarker for SizeU {
1735 type Borrowed<'a> = &'a Self;
1736 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1737 value
1738 }
1739 }
1740
1741 unsafe impl fidl::encoding::TypeMarker for SizeU {
1742 type Owned = Self;
1743
1744 #[inline(always)]
1745 fn inline_align(_context: fidl::encoding::Context) -> usize {
1746 4
1747 }
1748
1749 #[inline(always)]
1750 fn inline_size(_context: fidl::encoding::Context) -> usize {
1751 8
1752 }
1753 #[inline(always)]
1754 fn encode_is_copy() -> bool {
1755 true
1756 }
1757
1758 #[inline(always)]
1759 fn decode_is_copy() -> bool {
1760 true
1761 }
1762 }
1763
1764 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SizeU, D> for &SizeU {
1765 #[inline]
1766 unsafe fn encode(
1767 self,
1768 encoder: &mut fidl::encoding::Encoder<'_, D>,
1769 offset: usize,
1770 _depth: fidl::encoding::Depth,
1771 ) -> fidl::Result<()> {
1772 encoder.debug_check_bounds::<SizeU>(offset);
1773 unsafe {
1774 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1776 (buf_ptr as *mut SizeU).write_unaligned((self as *const SizeU).read());
1777 }
1780 Ok(())
1781 }
1782 }
1783 unsafe impl<
1784 D: fidl::encoding::ResourceDialect,
1785 T0: fidl::encoding::Encode<u32, D>,
1786 T1: fidl::encoding::Encode<u32, D>,
1787 > fidl::encoding::Encode<SizeU, D> for (T0, T1)
1788 {
1789 #[inline]
1790 unsafe fn encode(
1791 self,
1792 encoder: &mut fidl::encoding::Encoder<'_, D>,
1793 offset: usize,
1794 depth: fidl::encoding::Depth,
1795 ) -> fidl::Result<()> {
1796 encoder.debug_check_bounds::<SizeU>(offset);
1797 self.0.encode(encoder, offset + 0, depth)?;
1801 self.1.encode(encoder, offset + 4, depth)?;
1802 Ok(())
1803 }
1804 }
1805
1806 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SizeU {
1807 #[inline(always)]
1808 fn new_empty() -> Self {
1809 Self { width: fidl::new_empty!(u32, D), height: fidl::new_empty!(u32, D) }
1810 }
1811
1812 #[inline]
1813 unsafe fn decode(
1814 &mut self,
1815 decoder: &mut fidl::encoding::Decoder<'_, D>,
1816 offset: usize,
1817 _depth: fidl::encoding::Depth,
1818 ) -> fidl::Result<()> {
1819 decoder.debug_check_bounds::<Self>(offset);
1820 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1821 unsafe {
1824 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1825 }
1826 Ok(())
1827 }
1828 }
1829
1830 impl fidl::encoding::ValueTypeMarker for Transform {
1831 type Borrowed<'a> = &'a Self;
1832 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1833 value
1834 }
1835 }
1836
1837 unsafe impl fidl::encoding::TypeMarker for Transform {
1838 type Owned = Self;
1839
1840 #[inline(always)]
1841 fn inline_align(_context: fidl::encoding::Context) -> usize {
1842 4
1843 }
1844
1845 #[inline(always)]
1846 fn inline_size(_context: fidl::encoding::Context) -> usize {
1847 64
1848 }
1849 }
1850
1851 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Transform, D>
1852 for &Transform
1853 {
1854 #[inline]
1855 unsafe fn encode(
1856 self,
1857 encoder: &mut fidl::encoding::Encoder<'_, D>,
1858 offset: usize,
1859 _depth: fidl::encoding::Depth,
1860 ) -> fidl::Result<()> {
1861 encoder.debug_check_bounds::<Transform>(offset);
1862 fidl::encoding::Encode::<Transform, D>::encode(
1864 (<fidl::encoding::Array<f32, 16> as fidl::encoding::ValueTypeMarker>::borrow(
1865 &self.matrix,
1866 ),),
1867 encoder,
1868 offset,
1869 _depth,
1870 )
1871 }
1872 }
1873 unsafe impl<
1874 D: fidl::encoding::ResourceDialect,
1875 T0: fidl::encoding::Encode<fidl::encoding::Array<f32, 16>, D>,
1876 > fidl::encoding::Encode<Transform, D> for (T0,)
1877 {
1878 #[inline]
1879 unsafe fn encode(
1880 self,
1881 encoder: &mut fidl::encoding::Encoder<'_, D>,
1882 offset: usize,
1883 depth: fidl::encoding::Depth,
1884 ) -> fidl::Result<()> {
1885 encoder.debug_check_bounds::<Transform>(offset);
1886 self.0.encode(encoder, offset + 0, depth)?;
1890 Ok(())
1891 }
1892 }
1893
1894 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Transform {
1895 #[inline(always)]
1896 fn new_empty() -> Self {
1897 Self { matrix: fidl::new_empty!(fidl::encoding::Array<f32, 16>, D) }
1898 }
1899
1900 #[inline]
1901 unsafe fn decode(
1902 &mut self,
1903 decoder: &mut fidl::encoding::Decoder<'_, D>,
1904 offset: usize,
1905 _depth: fidl::encoding::Depth,
1906 ) -> fidl::Result<()> {
1907 decoder.debug_check_bounds::<Self>(offset);
1908 fidl::decode!(fidl::encoding::Array<f32, 16>, D, &mut self.matrix, decoder, offset + 0, _depth)?;
1910 Ok(())
1911 }
1912 }
1913
1914 impl fidl::encoding::ValueTypeMarker for Vec_ {
1915 type Borrowed<'a> = &'a Self;
1916 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1917 value
1918 }
1919 }
1920
1921 unsafe impl fidl::encoding::TypeMarker for Vec_ {
1922 type Owned = Self;
1923
1924 #[inline(always)]
1925 fn inline_align(_context: fidl::encoding::Context) -> usize {
1926 4
1927 }
1928
1929 #[inline(always)]
1930 fn inline_size(_context: fidl::encoding::Context) -> usize {
1931 8
1932 }
1933 #[inline(always)]
1934 fn encode_is_copy() -> bool {
1935 true
1936 }
1937
1938 #[inline(always)]
1939 fn decode_is_copy() -> bool {
1940 true
1941 }
1942 }
1943
1944 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec_, D> for &Vec_ {
1945 #[inline]
1946 unsafe fn encode(
1947 self,
1948 encoder: &mut fidl::encoding::Encoder<'_, D>,
1949 offset: usize,
1950 _depth: fidl::encoding::Depth,
1951 ) -> fidl::Result<()> {
1952 encoder.debug_check_bounds::<Vec_>(offset);
1953 unsafe {
1954 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1956 (buf_ptr as *mut Vec_).write_unaligned((self as *const Vec_).read());
1957 }
1960 Ok(())
1961 }
1962 }
1963 unsafe impl<
1964 D: fidl::encoding::ResourceDialect,
1965 T0: fidl::encoding::Encode<i32, D>,
1966 T1: fidl::encoding::Encode<i32, D>,
1967 > fidl::encoding::Encode<Vec_, D> for (T0, T1)
1968 {
1969 #[inline]
1970 unsafe fn encode(
1971 self,
1972 encoder: &mut fidl::encoding::Encoder<'_, D>,
1973 offset: usize,
1974 depth: fidl::encoding::Depth,
1975 ) -> fidl::Result<()> {
1976 encoder.debug_check_bounds::<Vec_>(offset);
1977 self.0.encode(encoder, offset + 0, depth)?;
1981 self.1.encode(encoder, offset + 4, depth)?;
1982 Ok(())
1983 }
1984 }
1985
1986 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec_ {
1987 #[inline(always)]
1988 fn new_empty() -> Self {
1989 Self { x: fidl::new_empty!(i32, D), y: fidl::new_empty!(i32, D) }
1990 }
1991
1992 #[inline]
1993 unsafe fn decode(
1994 &mut self,
1995 decoder: &mut fidl::encoding::Decoder<'_, D>,
1996 offset: usize,
1997 _depth: fidl::encoding::Depth,
1998 ) -> fidl::Result<()> {
1999 decoder.debug_check_bounds::<Self>(offset);
2000 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2001 unsafe {
2004 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
2005 }
2006 Ok(())
2007 }
2008 }
2009
2010 impl fidl::encoding::ValueTypeMarker for Vec3F {
2011 type Borrowed<'a> = &'a Self;
2012 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2013 value
2014 }
2015 }
2016
2017 unsafe impl fidl::encoding::TypeMarker for Vec3F {
2018 type Owned = Self;
2019
2020 #[inline(always)]
2021 fn inline_align(_context: fidl::encoding::Context) -> usize {
2022 4
2023 }
2024
2025 #[inline(always)]
2026 fn inline_size(_context: fidl::encoding::Context) -> usize {
2027 12
2028 }
2029 }
2030
2031 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec3F, D> for &Vec3F {
2032 #[inline]
2033 unsafe fn encode(
2034 self,
2035 encoder: &mut fidl::encoding::Encoder<'_, D>,
2036 offset: usize,
2037 _depth: fidl::encoding::Depth,
2038 ) -> fidl::Result<()> {
2039 encoder.debug_check_bounds::<Vec3F>(offset);
2040 fidl::encoding::Encode::<Vec3F, D>::encode(
2042 (
2043 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
2044 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
2045 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
2046 ),
2047 encoder,
2048 offset,
2049 _depth,
2050 )
2051 }
2052 }
2053 unsafe impl<
2054 D: fidl::encoding::ResourceDialect,
2055 T0: fidl::encoding::Encode<f32, D>,
2056 T1: fidl::encoding::Encode<f32, D>,
2057 T2: fidl::encoding::Encode<f32, D>,
2058 > fidl::encoding::Encode<Vec3F, D> for (T0, T1, T2)
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::<Vec3F>(offset);
2068 self.0.encode(encoder, offset + 0, depth)?;
2072 self.1.encode(encoder, offset + 4, depth)?;
2073 self.2.encode(encoder, offset + 8, depth)?;
2074 Ok(())
2075 }
2076 }
2077
2078 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec3F {
2079 #[inline(always)]
2080 fn new_empty() -> Self {
2081 Self {
2082 x: fidl::new_empty!(f32, D),
2083 y: fidl::new_empty!(f32, D),
2084 z: fidl::new_empty!(f32, D),
2085 }
2086 }
2087
2088 #[inline]
2089 unsafe fn decode(
2090 &mut self,
2091 decoder: &mut fidl::encoding::Decoder<'_, D>,
2092 offset: usize,
2093 _depth: fidl::encoding::Depth,
2094 ) -> fidl::Result<()> {
2095 decoder.debug_check_bounds::<Self>(offset);
2096 fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
2098 fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
2099 fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
2100 Ok(())
2101 }
2102 }
2103
2104 impl fidl::encoding::ValueTypeMarker for Vec4F {
2105 type Borrowed<'a> = &'a Self;
2106 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2107 value
2108 }
2109 }
2110
2111 unsafe impl fidl::encoding::TypeMarker for Vec4F {
2112 type Owned = Self;
2113
2114 #[inline(always)]
2115 fn inline_align(_context: fidl::encoding::Context) -> usize {
2116 4
2117 }
2118
2119 #[inline(always)]
2120 fn inline_size(_context: fidl::encoding::Context) -> usize {
2121 16
2122 }
2123 }
2124
2125 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Vec4F, D> for &Vec4F {
2126 #[inline]
2127 unsafe fn encode(
2128 self,
2129 encoder: &mut fidl::encoding::Encoder<'_, D>,
2130 offset: usize,
2131 _depth: fidl::encoding::Depth,
2132 ) -> fidl::Result<()> {
2133 encoder.debug_check_bounds::<Vec4F>(offset);
2134 fidl::encoding::Encode::<Vec4F, D>::encode(
2136 (
2137 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
2138 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
2139 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.z),
2140 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.w),
2141 ),
2142 encoder,
2143 offset,
2144 _depth,
2145 )
2146 }
2147 }
2148 unsafe impl<
2149 D: fidl::encoding::ResourceDialect,
2150 T0: fidl::encoding::Encode<f32, D>,
2151 T1: fidl::encoding::Encode<f32, D>,
2152 T2: fidl::encoding::Encode<f32, D>,
2153 T3: fidl::encoding::Encode<f32, D>,
2154 > fidl::encoding::Encode<Vec4F, D> for (T0, T1, T2, T3)
2155 {
2156 #[inline]
2157 unsafe fn encode(
2158 self,
2159 encoder: &mut fidl::encoding::Encoder<'_, D>,
2160 offset: usize,
2161 depth: fidl::encoding::Depth,
2162 ) -> fidl::Result<()> {
2163 encoder.debug_check_bounds::<Vec4F>(offset);
2164 self.0.encode(encoder, offset + 0, depth)?;
2168 self.1.encode(encoder, offset + 4, depth)?;
2169 self.2.encode(encoder, offset + 8, depth)?;
2170 self.3.encode(encoder, offset + 12, depth)?;
2171 Ok(())
2172 }
2173 }
2174
2175 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Vec4F {
2176 #[inline(always)]
2177 fn new_empty() -> Self {
2178 Self {
2179 x: fidl::new_empty!(f32, D),
2180 y: fidl::new_empty!(f32, D),
2181 z: fidl::new_empty!(f32, D),
2182 w: fidl::new_empty!(f32, D),
2183 }
2184 }
2185
2186 #[inline]
2187 unsafe fn decode(
2188 &mut self,
2189 decoder: &mut fidl::encoding::Decoder<'_, D>,
2190 offset: usize,
2191 _depth: fidl::encoding::Depth,
2192 ) -> fidl::Result<()> {
2193 decoder.debug_check_bounds::<Self>(offset);
2194 fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
2196 fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
2197 fidl::decode!(f32, D, &mut self.z, decoder, offset + 8, _depth)?;
2198 fidl::decode!(f32, D, &mut self.w, decoder, offset + 12, _depth)?;
2199 Ok(())
2200 }
2201 }
2202
2203 impl fidl::encoding::ValueTypeMarker for VecF {
2204 type Borrowed<'a> = &'a Self;
2205 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2206 value
2207 }
2208 }
2209
2210 unsafe impl fidl::encoding::TypeMarker for VecF {
2211 type Owned = Self;
2212
2213 #[inline(always)]
2214 fn inline_align(_context: fidl::encoding::Context) -> usize {
2215 4
2216 }
2217
2218 #[inline(always)]
2219 fn inline_size(_context: fidl::encoding::Context) -> usize {
2220 8
2221 }
2222 }
2223
2224 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VecF, D> for &VecF {
2225 #[inline]
2226 unsafe fn encode(
2227 self,
2228 encoder: &mut fidl::encoding::Encoder<'_, D>,
2229 offset: usize,
2230 _depth: fidl::encoding::Depth,
2231 ) -> fidl::Result<()> {
2232 encoder.debug_check_bounds::<VecF>(offset);
2233 fidl::encoding::Encode::<VecF, D>::encode(
2235 (
2236 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.x),
2237 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.y),
2238 ),
2239 encoder,
2240 offset,
2241 _depth,
2242 )
2243 }
2244 }
2245 unsafe impl<
2246 D: fidl::encoding::ResourceDialect,
2247 T0: fidl::encoding::Encode<f32, D>,
2248 T1: fidl::encoding::Encode<f32, D>,
2249 > fidl::encoding::Encode<VecF, D> for (T0, T1)
2250 {
2251 #[inline]
2252 unsafe fn encode(
2253 self,
2254 encoder: &mut fidl::encoding::Encoder<'_, D>,
2255 offset: usize,
2256 depth: fidl::encoding::Depth,
2257 ) -> fidl::Result<()> {
2258 encoder.debug_check_bounds::<VecF>(offset);
2259 self.0.encode(encoder, offset + 0, depth)?;
2263 self.1.encode(encoder, offset + 4, depth)?;
2264 Ok(())
2265 }
2266 }
2267
2268 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VecF {
2269 #[inline(always)]
2270 fn new_empty() -> Self {
2271 Self { x: fidl::new_empty!(f32, D), y: fidl::new_empty!(f32, D) }
2272 }
2273
2274 #[inline]
2275 unsafe fn decode(
2276 &mut self,
2277 decoder: &mut fidl::encoding::Decoder<'_, D>,
2278 offset: usize,
2279 _depth: fidl::encoding::Depth,
2280 ) -> fidl::Result<()> {
2281 decoder.debug_check_bounds::<Self>(offset);
2282 fidl::decode!(f32, D, &mut self.x, decoder, offset + 0, _depth)?;
2284 fidl::decode!(f32, D, &mut self.y, decoder, offset + 4, _depth)?;
2285 Ok(())
2286 }
2287 }
2288}