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 const MAX_FINGERS: u8 = 10;
12
13pub const MOUSE_MAX_NUM_BUTTONS: u32 = 32;
16
17#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
20pub enum CoordinateUnit {
21 Default,
28 PhysicalPixels,
41 RegisteredDimensions,
44 #[doc(hidden)]
45 __SourceBreaking { unknown_ordinal: u32 },
46}
47
48#[macro_export]
50macro_rules! CoordinateUnitUnknown {
51 () => {
52 _
53 };
54}
55
56impl CoordinateUnit {
57 #[inline]
58 pub fn from_primitive(prim: u32) -> Option<Self> {
59 match prim {
60 0 => Some(Self::Default),
61 1 => Some(Self::PhysicalPixels),
62 2 => Some(Self::RegisteredDimensions),
63 _ => None,
64 }
65 }
66
67 #[inline]
68 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
69 match prim {
70 0 => Self::Default,
71 1 => Self::PhysicalPixels,
72 2 => Self::RegisteredDimensions,
73 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
74 }
75 }
76
77 #[inline]
78 pub fn unknown() -> Self {
79 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
80 }
81
82 #[inline]
83 pub const fn into_primitive(self) -> u32 {
84 match self {
85 Self::Default => 0,
86 Self::PhysicalPixels => 1,
87 Self::RegisteredDimensions => 2,
88 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
89 }
90 }
91
92 #[inline]
93 pub fn is_unknown(&self) -> bool {
94 match self {
95 Self::__SourceBreaking { unknown_ordinal: _ } => true,
96 _ => false,
97 }
98 }
99}
100
101#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
103pub enum MouseButton {
104 First,
106 Second,
108 Third,
110 #[doc(hidden)]
111 __SourceBreaking { unknown_ordinal: u32 },
112}
113
114#[macro_export]
116macro_rules! MouseButtonUnknown {
117 () => {
118 _
119 };
120}
121
122impl MouseButton {
123 #[inline]
124 pub fn from_primitive(prim: u32) -> Option<Self> {
125 match prim {
126 0 => Some(Self::First),
127 1 => Some(Self::Second),
128 2 => Some(Self::Third),
129 _ => None,
130 }
131 }
132
133 #[inline]
134 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
135 match prim {
136 0 => Self::First,
137 1 => Self::Second,
138 2 => Self::Third,
139 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
140 }
141 }
142
143 #[inline]
144 pub fn unknown() -> Self {
145 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
146 }
147
148 #[inline]
149 pub const fn into_primitive(self) -> u32 {
150 match self {
151 Self::First => 0,
152 Self::Second => 1,
153 Self::Third => 2,
154 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
155 }
156 }
157
158 #[inline]
159 pub fn is_unknown(&self) -> bool {
160 match self {
161 Self::__SourceBreaking { unknown_ordinal: _ } => true,
162 _ => false,
163 }
164 }
165}
166
167#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
169pub enum MouseEventPhase {
170 Add,
172 Hover,
175 Down,
177 Move,
179 Up,
181 Wheel,
183 #[doc(hidden)]
184 __SourceBreaking { unknown_ordinal: u32 },
185}
186
187#[macro_export]
189macro_rules! MouseEventPhaseUnknown {
190 () => {
191 _
192 };
193}
194
195impl MouseEventPhase {
196 #[inline]
197 pub fn from_primitive(prim: u32) -> Option<Self> {
198 match prim {
199 0 => Some(Self::Add),
200 1 => Some(Self::Hover),
201 2 => Some(Self::Down),
202 3 => Some(Self::Move),
203 4 => Some(Self::Up),
204 5 => Some(Self::Wheel),
205 _ => None,
206 }
207 }
208
209 #[inline]
210 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
211 match prim {
212 0 => Self::Add,
213 1 => Self::Hover,
214 2 => Self::Down,
215 3 => Self::Move,
216 4 => Self::Up,
217 5 => Self::Wheel,
218 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
219 }
220 }
221
222 #[inline]
223 pub fn unknown() -> Self {
224 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
225 }
226
227 #[inline]
228 pub const fn into_primitive(self) -> u32 {
229 match self {
230 Self::Add => 0,
231 Self::Hover => 1,
232 Self::Down => 2,
233 Self::Move => 3,
234 Self::Up => 4,
235 Self::Wheel => 5,
236 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
237 }
238 }
239
240 #[inline]
241 pub fn is_unknown(&self) -> bool {
242 match self {
243 Self::__SourceBreaking { unknown_ordinal: _ } => true,
244 _ => false,
245 }
246 }
247}
248
249#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
250pub enum TestAppStatus {
251 HandlersRegistered,
255 ElementFocused,
260 #[doc(hidden)]
261 __SourceBreaking { unknown_ordinal: u16 },
262}
263
264#[macro_export]
266macro_rules! TestAppStatusUnknown {
267 () => {
268 _
269 };
270}
271
272impl TestAppStatus {
273 #[inline]
274 pub fn from_primitive(prim: u16) -> Option<Self> {
275 match prim {
276 1 => Some(Self::HandlersRegistered),
277 2 => Some(Self::ElementFocused),
278 _ => None,
279 }
280 }
281
282 #[inline]
283 pub fn from_primitive_allow_unknown(prim: u16) -> Self {
284 match prim {
285 1 => Self::HandlersRegistered,
286 2 => Self::ElementFocused,
287 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
288 }
289 }
290
291 #[inline]
292 pub fn unknown() -> Self {
293 Self::__SourceBreaking { unknown_ordinal: 0xffff }
294 }
295
296 #[inline]
297 pub const fn into_primitive(self) -> u16 {
298 match self {
299 Self::HandlersRegistered => 1,
300 Self::ElementFocused => 2,
301 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
302 }
303 }
304
305 #[inline]
306 pub fn is_unknown(&self) -> bool {
307 match self {
308 Self::__SourceBreaking { unknown_ordinal: _ } => true,
309 _ => false,
310 }
311 }
312}
313
314#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
315#[repr(C)]
316pub struct DisplayDimensions {
317 pub min_x: i64,
319 pub min_y: i64,
321 pub max_x: i64,
323 pub max_y: i64,
325}
326
327impl fidl::Persistable for DisplayDimensions {}
328
329#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
330pub struct TestAppStatusListenerReportStatusRequest {
331 pub status: TestAppStatus,
332}
333
334impl fidl::Persistable for TestAppStatusListenerReportStatusRequest {}
335
336#[derive(Clone, Debug, PartialEq)]
337pub struct TouchScreenSimulateTouchEventRequest {
338 pub report: fidl_fuchsia_input_report__common::TouchInputReport,
339}
340
341impl fidl::Persistable for TouchScreenSimulateTouchEventRequest {}
342
343#[derive(Clone, Debug, Default, PartialEq)]
344pub struct KeyboardInputListenerReportTextInputRequest {
345 pub text: Option<String>,
347 pub non_printable: Option<fidl_fuchsia_ui_input3__common::NonPrintableKey>,
349 pub device_id: Option<u32>,
350 #[doc(hidden)]
351 pub __source_breaking: fidl::marker::SourceBreaking,
352}
353
354impl fidl::Persistable for KeyboardInputListenerReportTextInputRequest {}
355
356#[derive(Clone, Debug, Default, PartialEq)]
357pub struct KeyboardSimulateKeyEventRequest {
358 pub report: Option<fidl_fuchsia_input_report__common::KeyboardInputReport>,
359 #[doc(hidden)]
360 pub __source_breaking: fidl::marker::SourceBreaking,
361}
362
363impl fidl::Persistable for KeyboardSimulateKeyEventRequest {}
364
365#[derive(Clone, Debug, Default, PartialEq)]
366pub struct KeyboardSimulateKeyPressRequest {
367 pub key_code: Option<fidl_fuchsia_input__common::Key>,
368 #[doc(hidden)]
369 pub __source_breaking: fidl::marker::SourceBreaking,
370}
371
372impl fidl::Persistable for KeyboardSimulateKeyPressRequest {}
373
374#[derive(Clone, Debug, Default, PartialEq)]
375pub struct KeyboardSimulateUsAsciiTextEntryRequest {
376 pub text: Option<String>,
377 #[doc(hidden)]
378 pub __source_breaking: fidl::marker::SourceBreaking,
379}
380
381impl fidl::Persistable for KeyboardSimulateUsAsciiTextEntryRequest {}
382
383#[derive(Clone, Debug, Default, PartialEq)]
384pub struct MediaButtonsDeviceSendButtonsStateRequest {
385 pub buttons: Option<Vec<fidl_fuchsia_input_report__common::ConsumerControlButton>>,
387 #[doc(hidden)]
388 pub __source_breaking: fidl::marker::SourceBreaking,
389}
390
391impl fidl::Persistable for MediaButtonsDeviceSendButtonsStateRequest {}
392
393#[derive(Clone, Debug, Default, PartialEq)]
394pub struct MediaButtonsDeviceSimulateButtonPressRequest {
395 pub button: Option<fidl_fuchsia_input_report__common::ConsumerControlButton>,
397 #[doc(hidden)]
398 pub __source_breaking: fidl::marker::SourceBreaking,
399}
400
401impl fidl::Persistable for MediaButtonsDeviceSimulateButtonPressRequest {}
402
403#[derive(Clone, Debug, Default, PartialEq)]
404pub struct MouseInputListenerReportMouseInputRequest {
405 pub local_x: Option<f64>,
407 pub local_y: Option<f64>,
409 pub time_received: Option<i64>,
413 pub component_name: Option<String>,
418 pub buttons: Option<Vec<MouseButton>>,
420 pub phase: Option<MouseEventPhase>,
422 pub device_pixel_ratio: Option<f64>,
427 pub wheel_x_physical_pixel: Option<f64>,
429 pub wheel_y_physical_pixel: Option<f64>,
431 pub device_id: Option<u32>,
432 #[doc(hidden)]
433 pub __source_breaking: fidl::marker::SourceBreaking,
434}
435
436impl fidl::Persistable for MouseInputListenerReportMouseInputRequest {}
437
438#[derive(Clone, Debug, Default, PartialEq)]
439pub struct MouseSimulateMouseEventRequest {
440 pub pressed_buttons: Option<Vec<MouseButton>>,
443 pub movement_x: Option<i64>,
445 pub movement_y: Option<i64>,
447 pub scroll_v_detent: Option<i64>,
449 pub scroll_h_detent: Option<i64>,
451 pub scroll_v_physical_pixel: Option<f64>,
454 pub scroll_h_physical_pixel: Option<f64>,
457 #[doc(hidden)]
458 pub __source_breaking: fidl::marker::SourceBreaking,
459}
460
461impl fidl::Persistable for MouseSimulateMouseEventRequest {}
462
463#[derive(Clone, Debug, Default, PartialEq)]
464pub struct TouchInputListenerReportTouchInputRequest {
465 pub local_x: Option<f64>,
467 pub local_y: Option<f64>,
469 pub time_received: Option<i64>,
473 pub device_pixel_ratio: Option<f64>,
475 pub component_name: Option<String>,
480 pub phase: Option<fidl_fuchsia_ui_pointer__common::EventPhase>,
482 pub pointer_id: Option<u32>,
486 pub device_id: Option<u32>,
487 #[doc(hidden)]
488 pub __source_breaking: fidl::marker::SourceBreaking,
489}
490
491impl fidl::Persistable for TouchInputListenerReportTouchInputRequest {}
492
493#[derive(Clone, Debug, Default, PartialEq)]
494pub struct TouchScreenSimulateMultiFingerGestureRequest {
495 pub start_locations: Option<[fidl_fuchsia_math__common::Vec_; 10]>,
498 pub end_locations: Option<[fidl_fuchsia_math__common::Vec_; 10]>,
501 pub move_event_count: Option<u32>,
503 pub finger_count: Option<u32>,
506 #[doc(hidden)]
507 pub __source_breaking: fidl::marker::SourceBreaking,
508}
509
510impl fidl::Persistable for TouchScreenSimulateMultiFingerGestureRequest {}
511
512#[derive(Clone, Debug, Default, PartialEq)]
513pub struct TouchScreenSimulateMultiTapRequest {
514 pub tap_locations: Option<Vec<fidl_fuchsia_math__common::Vec_>>,
517 #[doc(hidden)]
518 pub __source_breaking: fidl::marker::SourceBreaking,
519}
520
521impl fidl::Persistable for TouchScreenSimulateMultiTapRequest {}
522
523#[derive(Clone, Debug, Default, PartialEq)]
524pub struct TouchScreenSimulateSwipeRequest {
525 pub start_location: Option<fidl_fuchsia_math__common::Vec_>,
528 pub end_location: Option<fidl_fuchsia_math__common::Vec_>,
531 pub move_event_count: Option<u32>,
533 pub duration: Option<i64>,
538 #[doc(hidden)]
539 pub __source_breaking: fidl::marker::SourceBreaking,
540}
541
542impl fidl::Persistable for TouchScreenSimulateSwipeRequest {}
543
544#[derive(Clone, Debug, Default, PartialEq)]
545pub struct TouchScreenSimulateTapRequest {
546 pub tap_location: Option<fidl_fuchsia_math__common::Vec_>,
549 #[doc(hidden)]
550 pub __source_breaking: fidl::marker::SourceBreaking,
551}
552
553impl fidl::Persistable for TouchScreenSimulateTapRequest {}
554
555pub mod keyboard_ordinals {
556 pub const SIMULATE_US_ASCII_TEXT_ENTRY: u64 = 0x7111724d25453cfb;
557 pub const SIMULATE_KEY_EVENT: u64 = 0x23e0ae9874a68211;
558 pub const SIMULATE_KEY_PRESS: u64 = 0xb3ba0ef4996ebaf;
559}
560
561pub mod keyboard_input_listener_ordinals {
562 pub const REPORT_READY: u64 = 0x4b7f18cd3570971b;
563 pub const REPORT_TEXT_INPUT: u64 = 0x4d53b1fe481185d1;
564}
565
566pub mod media_buttons_device_ordinals {
567 pub const SIMULATE_BUTTON_PRESS: u64 = 0x256d8b895296c5b2;
568 pub const SEND_BUTTONS_STATE: u64 = 0x254fc23643cdef6b;
569}
570
571pub mod mouse_ordinals {
572 pub const SIMULATE_MOUSE_EVENT: u64 = 0x55c55dcd35c8768f;
573}
574
575pub mod mouse_input_listener_ordinals {
576 pub const REPORT_MOUSE_INPUT: u64 = 0x78182130ca3aff13;
577}
578
579pub mod registry_ordinals {
580 pub const REGISTER_TOUCH_SCREEN: u64 = 0x406fb450685ecb73;
581 pub const REGISTER_TOUCH_SCREEN_AND_GET_DEVICE_INFO: u64 = 0x2e8df048a411ed2b;
582 pub const REGISTER_MEDIA_BUTTONS_DEVICE: u64 = 0x3a0b22e6d40e9629;
583 pub const REGISTER_MEDIA_BUTTONS_DEVICE_AND_GET_DEVICE_INFO: u64 = 0x15fb627d190ebd73;
584 pub const REGISTER_KEYBOARD: u64 = 0x291c697601404b38;
585 pub const REGISTER_KEYBOARD_AND_GET_DEVICE_INFO: u64 = 0x1e4edc6c56d2ac7e;
586 pub const REGISTER_MOUSE: u64 = 0xf330169355a1add;
587 pub const REGISTER_MOUSE_AND_GET_DEVICE_INFO: u64 = 0x34aa807670bbae29;
588}
589
590pub mod test_app_status_listener_ordinals {
591 pub const REPORT_STATUS: u64 = 0x6bde93eb7bb3da54;
592}
593
594pub mod touch_input_listener_ordinals {
595 pub const REPORT_TOUCH_INPUT: u64 = 0x371dcd048ac842aa;
596}
597
598pub mod touch_screen_ordinals {
599 pub const SIMULATE_TAP: u64 = 0x2301a93caf2527fd;
600 pub const SIMULATE_MULTI_TAP: u64 = 0x101f5014bda76352;
601 pub const SIMULATE_SWIPE: u64 = 0xcebf566f3f489e4;
602 pub const SIMULATE_MULTI_FINGER_GESTURE: u64 = 0x426074401c1f212b;
603 pub const SIMULATE_TOUCH_EVENT: u64 = 0x557ab909d22a837d;
604}
605
606mod internal {
607 use super::*;
608 unsafe impl fidl::encoding::TypeMarker for CoordinateUnit {
609 type Owned = Self;
610
611 #[inline(always)]
612 fn inline_align(_context: fidl::encoding::Context) -> usize {
613 std::mem::align_of::<u32>()
614 }
615
616 #[inline(always)]
617 fn inline_size(_context: fidl::encoding::Context) -> usize {
618 std::mem::size_of::<u32>()
619 }
620
621 #[inline(always)]
622 fn encode_is_copy() -> bool {
623 false
624 }
625
626 #[inline(always)]
627 fn decode_is_copy() -> bool {
628 false
629 }
630 }
631
632 impl fidl::encoding::ValueTypeMarker for CoordinateUnit {
633 type Borrowed<'a> = Self;
634 #[inline(always)]
635 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
636 *value
637 }
638 }
639
640 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CoordinateUnit {
641 #[inline]
642 unsafe fn encode(
643 self,
644 encoder: &mut fidl::encoding::Encoder<'_, D>,
645 offset: usize,
646 _depth: fidl::encoding::Depth,
647 ) -> fidl::Result<()> {
648 encoder.debug_check_bounds::<Self>(offset);
649 encoder.write_num(self.into_primitive(), offset);
650 Ok(())
651 }
652 }
653
654 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CoordinateUnit {
655 #[inline(always)]
656 fn new_empty() -> Self {
657 Self::unknown()
658 }
659
660 #[inline]
661 unsafe fn decode(
662 &mut self,
663 decoder: &mut fidl::encoding::Decoder<'_, D>,
664 offset: usize,
665 _depth: fidl::encoding::Depth,
666 ) -> fidl::Result<()> {
667 decoder.debug_check_bounds::<Self>(offset);
668 let prim = decoder.read_num::<u32>(offset);
669
670 *self = Self::from_primitive_allow_unknown(prim);
671 Ok(())
672 }
673 }
674 unsafe impl fidl::encoding::TypeMarker for MouseButton {
675 type Owned = Self;
676
677 #[inline(always)]
678 fn inline_align(_context: fidl::encoding::Context) -> usize {
679 std::mem::align_of::<u32>()
680 }
681
682 #[inline(always)]
683 fn inline_size(_context: fidl::encoding::Context) -> usize {
684 std::mem::size_of::<u32>()
685 }
686
687 #[inline(always)]
688 fn encode_is_copy() -> bool {
689 false
690 }
691
692 #[inline(always)]
693 fn decode_is_copy() -> bool {
694 false
695 }
696 }
697
698 impl fidl::encoding::ValueTypeMarker for MouseButton {
699 type Borrowed<'a> = Self;
700 #[inline(always)]
701 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
702 *value
703 }
704 }
705
706 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for MouseButton {
707 #[inline]
708 unsafe fn encode(
709 self,
710 encoder: &mut fidl::encoding::Encoder<'_, D>,
711 offset: usize,
712 _depth: fidl::encoding::Depth,
713 ) -> fidl::Result<()> {
714 encoder.debug_check_bounds::<Self>(offset);
715 encoder.write_num(self.into_primitive(), offset);
716 Ok(())
717 }
718 }
719
720 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MouseButton {
721 #[inline(always)]
722 fn new_empty() -> Self {
723 Self::unknown()
724 }
725
726 #[inline]
727 unsafe fn decode(
728 &mut self,
729 decoder: &mut fidl::encoding::Decoder<'_, D>,
730 offset: usize,
731 _depth: fidl::encoding::Depth,
732 ) -> fidl::Result<()> {
733 decoder.debug_check_bounds::<Self>(offset);
734 let prim = decoder.read_num::<u32>(offset);
735
736 *self = Self::from_primitive_allow_unknown(prim);
737 Ok(())
738 }
739 }
740 unsafe impl fidl::encoding::TypeMarker for MouseEventPhase {
741 type Owned = Self;
742
743 #[inline(always)]
744 fn inline_align(_context: fidl::encoding::Context) -> usize {
745 std::mem::align_of::<u32>()
746 }
747
748 #[inline(always)]
749 fn inline_size(_context: fidl::encoding::Context) -> usize {
750 std::mem::size_of::<u32>()
751 }
752
753 #[inline(always)]
754 fn encode_is_copy() -> bool {
755 false
756 }
757
758 #[inline(always)]
759 fn decode_is_copy() -> bool {
760 false
761 }
762 }
763
764 impl fidl::encoding::ValueTypeMarker for MouseEventPhase {
765 type Borrowed<'a> = Self;
766 #[inline(always)]
767 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
768 *value
769 }
770 }
771
772 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
773 for MouseEventPhase
774 {
775 #[inline]
776 unsafe fn encode(
777 self,
778 encoder: &mut fidl::encoding::Encoder<'_, D>,
779 offset: usize,
780 _depth: fidl::encoding::Depth,
781 ) -> fidl::Result<()> {
782 encoder.debug_check_bounds::<Self>(offset);
783 encoder.write_num(self.into_primitive(), offset);
784 Ok(())
785 }
786 }
787
788 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MouseEventPhase {
789 #[inline(always)]
790 fn new_empty() -> Self {
791 Self::unknown()
792 }
793
794 #[inline]
795 unsafe fn decode(
796 &mut self,
797 decoder: &mut fidl::encoding::Decoder<'_, D>,
798 offset: usize,
799 _depth: fidl::encoding::Depth,
800 ) -> fidl::Result<()> {
801 decoder.debug_check_bounds::<Self>(offset);
802 let prim = decoder.read_num::<u32>(offset);
803
804 *self = Self::from_primitive_allow_unknown(prim);
805 Ok(())
806 }
807 }
808 unsafe impl fidl::encoding::TypeMarker for TestAppStatus {
809 type Owned = Self;
810
811 #[inline(always)]
812 fn inline_align(_context: fidl::encoding::Context) -> usize {
813 std::mem::align_of::<u16>()
814 }
815
816 #[inline(always)]
817 fn inline_size(_context: fidl::encoding::Context) -> usize {
818 std::mem::size_of::<u16>()
819 }
820
821 #[inline(always)]
822 fn encode_is_copy() -> bool {
823 false
824 }
825
826 #[inline(always)]
827 fn decode_is_copy() -> bool {
828 false
829 }
830 }
831
832 impl fidl::encoding::ValueTypeMarker for TestAppStatus {
833 type Borrowed<'a> = Self;
834 #[inline(always)]
835 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
836 *value
837 }
838 }
839
840 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for TestAppStatus {
841 #[inline]
842 unsafe fn encode(
843 self,
844 encoder: &mut fidl::encoding::Encoder<'_, D>,
845 offset: usize,
846 _depth: fidl::encoding::Depth,
847 ) -> fidl::Result<()> {
848 encoder.debug_check_bounds::<Self>(offset);
849 encoder.write_num(self.into_primitive(), offset);
850 Ok(())
851 }
852 }
853
854 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TestAppStatus {
855 #[inline(always)]
856 fn new_empty() -> Self {
857 Self::unknown()
858 }
859
860 #[inline]
861 unsafe fn decode(
862 &mut self,
863 decoder: &mut fidl::encoding::Decoder<'_, D>,
864 offset: usize,
865 _depth: fidl::encoding::Depth,
866 ) -> fidl::Result<()> {
867 decoder.debug_check_bounds::<Self>(offset);
868 let prim = decoder.read_num::<u16>(offset);
869
870 *self = Self::from_primitive_allow_unknown(prim);
871 Ok(())
872 }
873 }
874
875 impl fidl::encoding::ValueTypeMarker for DisplayDimensions {
876 type Borrowed<'a> = &'a Self;
877 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
878 value
879 }
880 }
881
882 unsafe impl fidl::encoding::TypeMarker for DisplayDimensions {
883 type Owned = Self;
884
885 #[inline(always)]
886 fn inline_align(_context: fidl::encoding::Context) -> usize {
887 8
888 }
889
890 #[inline(always)]
891 fn inline_size(_context: fidl::encoding::Context) -> usize {
892 32
893 }
894 #[inline(always)]
895 fn encode_is_copy() -> bool {
896 true
897 }
898
899 #[inline(always)]
900 fn decode_is_copy() -> bool {
901 true
902 }
903 }
904
905 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DisplayDimensions, D>
906 for &DisplayDimensions
907 {
908 #[inline]
909 unsafe fn encode(
910 self,
911 encoder: &mut fidl::encoding::Encoder<'_, D>,
912 offset: usize,
913 _depth: fidl::encoding::Depth,
914 ) -> fidl::Result<()> {
915 encoder.debug_check_bounds::<DisplayDimensions>(offset);
916 unsafe {
917 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
919 (buf_ptr as *mut DisplayDimensions)
920 .write_unaligned((self as *const DisplayDimensions).read());
921 }
924 Ok(())
925 }
926 }
927 unsafe impl<
928 D: fidl::encoding::ResourceDialect,
929 T0: fidl::encoding::Encode<i64, D>,
930 T1: fidl::encoding::Encode<i64, D>,
931 T2: fidl::encoding::Encode<i64, D>,
932 T3: fidl::encoding::Encode<i64, D>,
933 > fidl::encoding::Encode<DisplayDimensions, D> for (T0, T1, T2, T3)
934 {
935 #[inline]
936 unsafe fn encode(
937 self,
938 encoder: &mut fidl::encoding::Encoder<'_, D>,
939 offset: usize,
940 depth: fidl::encoding::Depth,
941 ) -> fidl::Result<()> {
942 encoder.debug_check_bounds::<DisplayDimensions>(offset);
943 self.0.encode(encoder, offset + 0, depth)?;
947 self.1.encode(encoder, offset + 8, depth)?;
948 self.2.encode(encoder, offset + 16, depth)?;
949 self.3.encode(encoder, offset + 24, depth)?;
950 Ok(())
951 }
952 }
953
954 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DisplayDimensions {
955 #[inline(always)]
956 fn new_empty() -> Self {
957 Self {
958 min_x: fidl::new_empty!(i64, D),
959 min_y: fidl::new_empty!(i64, D),
960 max_x: fidl::new_empty!(i64, D),
961 max_y: fidl::new_empty!(i64, D),
962 }
963 }
964
965 #[inline]
966 unsafe fn decode(
967 &mut self,
968 decoder: &mut fidl::encoding::Decoder<'_, D>,
969 offset: usize,
970 _depth: fidl::encoding::Depth,
971 ) -> fidl::Result<()> {
972 decoder.debug_check_bounds::<Self>(offset);
973 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
974 unsafe {
977 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 32);
978 }
979 Ok(())
980 }
981 }
982
983 impl fidl::encoding::ValueTypeMarker for TestAppStatusListenerReportStatusRequest {
984 type Borrowed<'a> = &'a Self;
985 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
986 value
987 }
988 }
989
990 unsafe impl fidl::encoding::TypeMarker for TestAppStatusListenerReportStatusRequest {
991 type Owned = Self;
992
993 #[inline(always)]
994 fn inline_align(_context: fidl::encoding::Context) -> usize {
995 2
996 }
997
998 #[inline(always)]
999 fn inline_size(_context: fidl::encoding::Context) -> usize {
1000 2
1001 }
1002 }
1003
1004 unsafe impl<D: fidl::encoding::ResourceDialect>
1005 fidl::encoding::Encode<TestAppStatusListenerReportStatusRequest, D>
1006 for &TestAppStatusListenerReportStatusRequest
1007 {
1008 #[inline]
1009 unsafe fn encode(
1010 self,
1011 encoder: &mut fidl::encoding::Encoder<'_, D>,
1012 offset: usize,
1013 _depth: fidl::encoding::Depth,
1014 ) -> fidl::Result<()> {
1015 encoder.debug_check_bounds::<TestAppStatusListenerReportStatusRequest>(offset);
1016 fidl::encoding::Encode::<TestAppStatusListenerReportStatusRequest, D>::encode(
1018 (<TestAppStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
1019 encoder,
1020 offset,
1021 _depth,
1022 )
1023 }
1024 }
1025 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TestAppStatus, D>>
1026 fidl::encoding::Encode<TestAppStatusListenerReportStatusRequest, D> for (T0,)
1027 {
1028 #[inline]
1029 unsafe fn encode(
1030 self,
1031 encoder: &mut fidl::encoding::Encoder<'_, D>,
1032 offset: usize,
1033 depth: fidl::encoding::Depth,
1034 ) -> fidl::Result<()> {
1035 encoder.debug_check_bounds::<TestAppStatusListenerReportStatusRequest>(offset);
1036 self.0.encode(encoder, offset + 0, depth)?;
1040 Ok(())
1041 }
1042 }
1043
1044 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1045 for TestAppStatusListenerReportStatusRequest
1046 {
1047 #[inline(always)]
1048 fn new_empty() -> Self {
1049 Self { status: fidl::new_empty!(TestAppStatus, D) }
1050 }
1051
1052 #[inline]
1053 unsafe fn decode(
1054 &mut self,
1055 decoder: &mut fidl::encoding::Decoder<'_, D>,
1056 offset: usize,
1057 _depth: fidl::encoding::Depth,
1058 ) -> fidl::Result<()> {
1059 decoder.debug_check_bounds::<Self>(offset);
1060 fidl::decode!(TestAppStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
1062 Ok(())
1063 }
1064 }
1065
1066 impl fidl::encoding::ValueTypeMarker for TouchScreenSimulateTouchEventRequest {
1067 type Borrowed<'a> = &'a Self;
1068 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1069 value
1070 }
1071 }
1072
1073 unsafe impl fidl::encoding::TypeMarker for TouchScreenSimulateTouchEventRequest {
1074 type Owned = Self;
1075
1076 #[inline(always)]
1077 fn inline_align(_context: fidl::encoding::Context) -> usize {
1078 8
1079 }
1080
1081 #[inline(always)]
1082 fn inline_size(_context: fidl::encoding::Context) -> usize {
1083 16
1084 }
1085 }
1086
1087 unsafe impl<D: fidl::encoding::ResourceDialect>
1088 fidl::encoding::Encode<TouchScreenSimulateTouchEventRequest, D>
1089 for &TouchScreenSimulateTouchEventRequest
1090 {
1091 #[inline]
1092 unsafe fn encode(
1093 self,
1094 encoder: &mut fidl::encoding::Encoder<'_, D>,
1095 offset: usize,
1096 _depth: fidl::encoding::Depth,
1097 ) -> fidl::Result<()> {
1098 encoder.debug_check_bounds::<TouchScreenSimulateTouchEventRequest>(offset);
1099 fidl::encoding::Encode::<TouchScreenSimulateTouchEventRequest, D>::encode(
1101 (
1102 <fidl_fuchsia_input_report__common::TouchInputReport as fidl::encoding::ValueTypeMarker>::borrow(&self.report),
1103 ),
1104 encoder, offset, _depth
1105 )
1106 }
1107 }
1108 unsafe impl<
1109 D: fidl::encoding::ResourceDialect,
1110 T0: fidl::encoding::Encode<fidl_fuchsia_input_report__common::TouchInputReport, D>,
1111 > fidl::encoding::Encode<TouchScreenSimulateTouchEventRequest, D> for (T0,)
1112 {
1113 #[inline]
1114 unsafe fn encode(
1115 self,
1116 encoder: &mut fidl::encoding::Encoder<'_, D>,
1117 offset: usize,
1118 depth: fidl::encoding::Depth,
1119 ) -> fidl::Result<()> {
1120 encoder.debug_check_bounds::<TouchScreenSimulateTouchEventRequest>(offset);
1121 self.0.encode(encoder, offset + 0, depth)?;
1125 Ok(())
1126 }
1127 }
1128
1129 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1130 for TouchScreenSimulateTouchEventRequest
1131 {
1132 #[inline(always)]
1133 fn new_empty() -> Self {
1134 Self {
1135 report: fidl::new_empty!(fidl_fuchsia_input_report__common::TouchInputReport, D),
1136 }
1137 }
1138
1139 #[inline]
1140 unsafe fn decode(
1141 &mut self,
1142 decoder: &mut fidl::encoding::Decoder<'_, D>,
1143 offset: usize,
1144 _depth: fidl::encoding::Depth,
1145 ) -> fidl::Result<()> {
1146 decoder.debug_check_bounds::<Self>(offset);
1147 fidl::decode!(
1149 fidl_fuchsia_input_report__common::TouchInputReport,
1150 D,
1151 &mut self.report,
1152 decoder,
1153 offset + 0,
1154 _depth
1155 )?;
1156 Ok(())
1157 }
1158 }
1159
1160 impl KeyboardInputListenerReportTextInputRequest {
1161 #[inline(always)]
1162 fn max_ordinal_present(&self) -> u64 {
1163 if let Some(_) = self.device_id {
1164 return 3;
1165 }
1166 if let Some(_) = self.non_printable {
1167 return 2;
1168 }
1169 if let Some(_) = self.text {
1170 return 1;
1171 }
1172 0
1173 }
1174 }
1175
1176 impl fidl::encoding::ValueTypeMarker for KeyboardInputListenerReportTextInputRequest {
1177 type Borrowed<'a> = &'a Self;
1178 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1179 value
1180 }
1181 }
1182
1183 unsafe impl fidl::encoding::TypeMarker for KeyboardInputListenerReportTextInputRequest {
1184 type Owned = Self;
1185
1186 #[inline(always)]
1187 fn inline_align(_context: fidl::encoding::Context) -> usize {
1188 8
1189 }
1190
1191 #[inline(always)]
1192 fn inline_size(_context: fidl::encoding::Context) -> usize {
1193 16
1194 }
1195 }
1196
1197 unsafe impl<D: fidl::encoding::ResourceDialect>
1198 fidl::encoding::Encode<KeyboardInputListenerReportTextInputRequest, D>
1199 for &KeyboardInputListenerReportTextInputRequest
1200 {
1201 unsafe fn encode(
1202 self,
1203 encoder: &mut fidl::encoding::Encoder<'_, D>,
1204 offset: usize,
1205 mut depth: fidl::encoding::Depth,
1206 ) -> fidl::Result<()> {
1207 encoder.debug_check_bounds::<KeyboardInputListenerReportTextInputRequest>(offset);
1208 let max_ordinal: u64 = self.max_ordinal_present();
1210 encoder.write_num(max_ordinal, offset);
1211 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1212 if max_ordinal == 0 {
1214 return Ok(());
1215 }
1216 depth.increment()?;
1217 let envelope_size = 8;
1218 let bytes_len = max_ordinal as usize * envelope_size;
1219 #[allow(unused_variables)]
1220 let offset = encoder.out_of_line_offset(bytes_len);
1221 let mut _prev_end_offset: usize = 0;
1222 if 1 > max_ordinal {
1223 return Ok(());
1224 }
1225
1226 let cur_offset: usize = (1 - 1) * envelope_size;
1229
1230 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1232
1233 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
1238 self.text.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
1239 encoder, offset + cur_offset, depth
1240 )?;
1241
1242 _prev_end_offset = cur_offset + envelope_size;
1243 if 2 > max_ordinal {
1244 return Ok(());
1245 }
1246
1247 let cur_offset: usize = (2 - 1) * envelope_size;
1250
1251 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1253
1254 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_ui_input3__common::NonPrintableKey, D>(
1259 self.non_printable.as_ref().map(<fidl_fuchsia_ui_input3__common::NonPrintableKey as fidl::encoding::ValueTypeMarker>::borrow),
1260 encoder, offset + cur_offset, depth
1261 )?;
1262
1263 _prev_end_offset = cur_offset + envelope_size;
1264 if 3 > max_ordinal {
1265 return Ok(());
1266 }
1267
1268 let cur_offset: usize = (3 - 1) * envelope_size;
1271
1272 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1274
1275 fidl::encoding::encode_in_envelope_optional::<u32, D>(
1280 self.device_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
1281 encoder,
1282 offset + cur_offset,
1283 depth,
1284 )?;
1285
1286 _prev_end_offset = cur_offset + envelope_size;
1287
1288 Ok(())
1289 }
1290 }
1291
1292 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1293 for KeyboardInputListenerReportTextInputRequest
1294 {
1295 #[inline(always)]
1296 fn new_empty() -> Self {
1297 Self::default()
1298 }
1299
1300 unsafe fn decode(
1301 &mut self,
1302 decoder: &mut fidl::encoding::Decoder<'_, D>,
1303 offset: usize,
1304 mut depth: fidl::encoding::Depth,
1305 ) -> fidl::Result<()> {
1306 decoder.debug_check_bounds::<Self>(offset);
1307 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1308 None => return Err(fidl::Error::NotNullable),
1309 Some(len) => len,
1310 };
1311 if len == 0 {
1313 return Ok(());
1314 };
1315 depth.increment()?;
1316 let envelope_size = 8;
1317 let bytes_len = len * envelope_size;
1318 let offset = decoder.out_of_line_offset(bytes_len)?;
1319 let mut _next_ordinal_to_read = 0;
1321 let mut next_offset = offset;
1322 let end_offset = offset + bytes_len;
1323 _next_ordinal_to_read += 1;
1324 if next_offset >= end_offset {
1325 return Ok(());
1326 }
1327
1328 while _next_ordinal_to_read < 1 {
1330 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1331 _next_ordinal_to_read += 1;
1332 next_offset += envelope_size;
1333 }
1334
1335 let next_out_of_line = decoder.next_out_of_line();
1336 let handles_before = decoder.remaining_handles();
1337 if let Some((inlined, num_bytes, num_handles)) =
1338 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1339 {
1340 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1341 if inlined != (member_inline_size <= 4) {
1342 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1343 }
1344 let inner_offset;
1345 let mut inner_depth = depth.clone();
1346 if inlined {
1347 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1348 inner_offset = next_offset;
1349 } else {
1350 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1351 inner_depth.increment()?;
1352 }
1353 let val_ref = self.text.get_or_insert_with(|| {
1354 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
1355 });
1356 fidl::decode!(
1357 fidl::encoding::BoundedString<1024>,
1358 D,
1359 val_ref,
1360 decoder,
1361 inner_offset,
1362 inner_depth
1363 )?;
1364 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1365 {
1366 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1367 }
1368 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1369 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1370 }
1371 }
1372
1373 next_offset += envelope_size;
1374 _next_ordinal_to_read += 1;
1375 if next_offset >= end_offset {
1376 return Ok(());
1377 }
1378
1379 while _next_ordinal_to_read < 2 {
1381 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1382 _next_ordinal_to_read += 1;
1383 next_offset += envelope_size;
1384 }
1385
1386 let next_out_of_line = decoder.next_out_of_line();
1387 let handles_before = decoder.remaining_handles();
1388 if let Some((inlined, num_bytes, num_handles)) =
1389 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1390 {
1391 let member_inline_size = <fidl_fuchsia_ui_input3__common::NonPrintableKey as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1392 if inlined != (member_inline_size <= 4) {
1393 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1394 }
1395 let inner_offset;
1396 let mut inner_depth = depth.clone();
1397 if inlined {
1398 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1399 inner_offset = next_offset;
1400 } else {
1401 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1402 inner_depth.increment()?;
1403 }
1404 let val_ref = self.non_printable.get_or_insert_with(|| {
1405 fidl::new_empty!(fidl_fuchsia_ui_input3__common::NonPrintableKey, D)
1406 });
1407 fidl::decode!(
1408 fidl_fuchsia_ui_input3__common::NonPrintableKey,
1409 D,
1410 val_ref,
1411 decoder,
1412 inner_offset,
1413 inner_depth
1414 )?;
1415 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1416 {
1417 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1418 }
1419 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1420 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1421 }
1422 }
1423
1424 next_offset += envelope_size;
1425 _next_ordinal_to_read += 1;
1426 if next_offset >= end_offset {
1427 return Ok(());
1428 }
1429
1430 while _next_ordinal_to_read < 3 {
1432 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1433 _next_ordinal_to_read += 1;
1434 next_offset += envelope_size;
1435 }
1436
1437 let next_out_of_line = decoder.next_out_of_line();
1438 let handles_before = decoder.remaining_handles();
1439 if let Some((inlined, num_bytes, num_handles)) =
1440 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1441 {
1442 let member_inline_size =
1443 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1444 if inlined != (member_inline_size <= 4) {
1445 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1446 }
1447 let inner_offset;
1448 let mut inner_depth = depth.clone();
1449 if inlined {
1450 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1451 inner_offset = next_offset;
1452 } else {
1453 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1454 inner_depth.increment()?;
1455 }
1456 let val_ref = self.device_id.get_or_insert_with(|| fidl::new_empty!(u32, D));
1457 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
1458 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1459 {
1460 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1461 }
1462 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1463 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1464 }
1465 }
1466
1467 next_offset += envelope_size;
1468
1469 while next_offset < end_offset {
1471 _next_ordinal_to_read += 1;
1472 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1473 next_offset += envelope_size;
1474 }
1475
1476 Ok(())
1477 }
1478 }
1479
1480 impl KeyboardSimulateKeyEventRequest {
1481 #[inline(always)]
1482 fn max_ordinal_present(&self) -> u64 {
1483 if let Some(_) = self.report {
1484 return 1;
1485 }
1486 0
1487 }
1488 }
1489
1490 impl fidl::encoding::ValueTypeMarker for KeyboardSimulateKeyEventRequest {
1491 type Borrowed<'a> = &'a Self;
1492 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1493 value
1494 }
1495 }
1496
1497 unsafe impl fidl::encoding::TypeMarker for KeyboardSimulateKeyEventRequest {
1498 type Owned = Self;
1499
1500 #[inline(always)]
1501 fn inline_align(_context: fidl::encoding::Context) -> usize {
1502 8
1503 }
1504
1505 #[inline(always)]
1506 fn inline_size(_context: fidl::encoding::Context) -> usize {
1507 16
1508 }
1509 }
1510
1511 unsafe impl<D: fidl::encoding::ResourceDialect>
1512 fidl::encoding::Encode<KeyboardSimulateKeyEventRequest, D>
1513 for &KeyboardSimulateKeyEventRequest
1514 {
1515 unsafe fn encode(
1516 self,
1517 encoder: &mut fidl::encoding::Encoder<'_, D>,
1518 offset: usize,
1519 mut depth: fidl::encoding::Depth,
1520 ) -> fidl::Result<()> {
1521 encoder.debug_check_bounds::<KeyboardSimulateKeyEventRequest>(offset);
1522 let max_ordinal: u64 = self.max_ordinal_present();
1524 encoder.write_num(max_ordinal, offset);
1525 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1526 if max_ordinal == 0 {
1528 return Ok(());
1529 }
1530 depth.increment()?;
1531 let envelope_size = 8;
1532 let bytes_len = max_ordinal as usize * envelope_size;
1533 #[allow(unused_variables)]
1534 let offset = encoder.out_of_line_offset(bytes_len);
1535 let mut _prev_end_offset: usize = 0;
1536 if 1 > max_ordinal {
1537 return Ok(());
1538 }
1539
1540 let cur_offset: usize = (1 - 1) * envelope_size;
1543
1544 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1546
1547 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_input_report__common::KeyboardInputReport, D>(
1552 self.report.as_ref().map(<fidl_fuchsia_input_report__common::KeyboardInputReport as fidl::encoding::ValueTypeMarker>::borrow),
1553 encoder, offset + cur_offset, depth
1554 )?;
1555
1556 _prev_end_offset = cur_offset + envelope_size;
1557
1558 Ok(())
1559 }
1560 }
1561
1562 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1563 for KeyboardSimulateKeyEventRequest
1564 {
1565 #[inline(always)]
1566 fn new_empty() -> Self {
1567 Self::default()
1568 }
1569
1570 unsafe fn decode(
1571 &mut self,
1572 decoder: &mut fidl::encoding::Decoder<'_, D>,
1573 offset: usize,
1574 mut depth: fidl::encoding::Depth,
1575 ) -> fidl::Result<()> {
1576 decoder.debug_check_bounds::<Self>(offset);
1577 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1578 None => return Err(fidl::Error::NotNullable),
1579 Some(len) => len,
1580 };
1581 if len == 0 {
1583 return Ok(());
1584 };
1585 depth.increment()?;
1586 let envelope_size = 8;
1587 let bytes_len = len * envelope_size;
1588 let offset = decoder.out_of_line_offset(bytes_len)?;
1589 let mut _next_ordinal_to_read = 0;
1591 let mut next_offset = offset;
1592 let end_offset = offset + bytes_len;
1593 _next_ordinal_to_read += 1;
1594 if next_offset >= end_offset {
1595 return Ok(());
1596 }
1597
1598 while _next_ordinal_to_read < 1 {
1600 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1601 _next_ordinal_to_read += 1;
1602 next_offset += envelope_size;
1603 }
1604
1605 let next_out_of_line = decoder.next_out_of_line();
1606 let handles_before = decoder.remaining_handles();
1607 if let Some((inlined, num_bytes, num_handles)) =
1608 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1609 {
1610 let member_inline_size = <fidl_fuchsia_input_report__common::KeyboardInputReport as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1611 if inlined != (member_inline_size <= 4) {
1612 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1613 }
1614 let inner_offset;
1615 let mut inner_depth = depth.clone();
1616 if inlined {
1617 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1618 inner_offset = next_offset;
1619 } else {
1620 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1621 inner_depth.increment()?;
1622 }
1623 let val_ref = self.report.get_or_insert_with(|| {
1624 fidl::new_empty!(fidl_fuchsia_input_report__common::KeyboardInputReport, D)
1625 });
1626 fidl::decode!(
1627 fidl_fuchsia_input_report__common::KeyboardInputReport,
1628 D,
1629 val_ref,
1630 decoder,
1631 inner_offset,
1632 inner_depth
1633 )?;
1634 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1635 {
1636 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1637 }
1638 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1639 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1640 }
1641 }
1642
1643 next_offset += envelope_size;
1644
1645 while next_offset < end_offset {
1647 _next_ordinal_to_read += 1;
1648 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1649 next_offset += envelope_size;
1650 }
1651
1652 Ok(())
1653 }
1654 }
1655
1656 impl KeyboardSimulateKeyPressRequest {
1657 #[inline(always)]
1658 fn max_ordinal_present(&self) -> u64 {
1659 if let Some(_) = self.key_code {
1660 return 1;
1661 }
1662 0
1663 }
1664 }
1665
1666 impl fidl::encoding::ValueTypeMarker for KeyboardSimulateKeyPressRequest {
1667 type Borrowed<'a> = &'a Self;
1668 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1669 value
1670 }
1671 }
1672
1673 unsafe impl fidl::encoding::TypeMarker for KeyboardSimulateKeyPressRequest {
1674 type Owned = Self;
1675
1676 #[inline(always)]
1677 fn inline_align(_context: fidl::encoding::Context) -> usize {
1678 8
1679 }
1680
1681 #[inline(always)]
1682 fn inline_size(_context: fidl::encoding::Context) -> usize {
1683 16
1684 }
1685 }
1686
1687 unsafe impl<D: fidl::encoding::ResourceDialect>
1688 fidl::encoding::Encode<KeyboardSimulateKeyPressRequest, D>
1689 for &KeyboardSimulateKeyPressRequest
1690 {
1691 unsafe fn encode(
1692 self,
1693 encoder: &mut fidl::encoding::Encoder<'_, D>,
1694 offset: usize,
1695 mut depth: fidl::encoding::Depth,
1696 ) -> fidl::Result<()> {
1697 encoder.debug_check_bounds::<KeyboardSimulateKeyPressRequest>(offset);
1698 let max_ordinal: u64 = self.max_ordinal_present();
1700 encoder.write_num(max_ordinal, offset);
1701 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1702 if max_ordinal == 0 {
1704 return Ok(());
1705 }
1706 depth.increment()?;
1707 let envelope_size = 8;
1708 let bytes_len = max_ordinal as usize * envelope_size;
1709 #[allow(unused_variables)]
1710 let offset = encoder.out_of_line_offset(bytes_len);
1711 let mut _prev_end_offset: usize = 0;
1712 if 1 > max_ordinal {
1713 return Ok(());
1714 }
1715
1716 let cur_offset: usize = (1 - 1) * envelope_size;
1719
1720 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1722
1723 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_input__common::Key, D>(
1728 self.key_code.as_ref().map(
1729 <fidl_fuchsia_input__common::Key as fidl::encoding::ValueTypeMarker>::borrow,
1730 ),
1731 encoder,
1732 offset + cur_offset,
1733 depth,
1734 )?;
1735
1736 _prev_end_offset = cur_offset + envelope_size;
1737
1738 Ok(())
1739 }
1740 }
1741
1742 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1743 for KeyboardSimulateKeyPressRequest
1744 {
1745 #[inline(always)]
1746 fn new_empty() -> Self {
1747 Self::default()
1748 }
1749
1750 unsafe fn decode(
1751 &mut self,
1752 decoder: &mut fidl::encoding::Decoder<'_, D>,
1753 offset: usize,
1754 mut depth: fidl::encoding::Depth,
1755 ) -> fidl::Result<()> {
1756 decoder.debug_check_bounds::<Self>(offset);
1757 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1758 None => return Err(fidl::Error::NotNullable),
1759 Some(len) => len,
1760 };
1761 if len == 0 {
1763 return Ok(());
1764 };
1765 depth.increment()?;
1766 let envelope_size = 8;
1767 let bytes_len = len * envelope_size;
1768 let offset = decoder.out_of_line_offset(bytes_len)?;
1769 let mut _next_ordinal_to_read = 0;
1771 let mut next_offset = offset;
1772 let end_offset = offset + bytes_len;
1773 _next_ordinal_to_read += 1;
1774 if next_offset >= end_offset {
1775 return Ok(());
1776 }
1777
1778 while _next_ordinal_to_read < 1 {
1780 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1781 _next_ordinal_to_read += 1;
1782 next_offset += envelope_size;
1783 }
1784
1785 let next_out_of_line = decoder.next_out_of_line();
1786 let handles_before = decoder.remaining_handles();
1787 if let Some((inlined, num_bytes, num_handles)) =
1788 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1789 {
1790 let member_inline_size =
1791 <fidl_fuchsia_input__common::Key as fidl::encoding::TypeMarker>::inline_size(
1792 decoder.context,
1793 );
1794 if inlined != (member_inline_size <= 4) {
1795 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1796 }
1797 let inner_offset;
1798 let mut inner_depth = depth.clone();
1799 if inlined {
1800 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1801 inner_offset = next_offset;
1802 } else {
1803 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1804 inner_depth.increment()?;
1805 }
1806 let val_ref = self
1807 .key_code
1808 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_input__common::Key, D));
1809 fidl::decode!(
1810 fidl_fuchsia_input__common::Key,
1811 D,
1812 val_ref,
1813 decoder,
1814 inner_offset,
1815 inner_depth
1816 )?;
1817 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1818 {
1819 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1820 }
1821 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1822 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1823 }
1824 }
1825
1826 next_offset += envelope_size;
1827
1828 while next_offset < end_offset {
1830 _next_ordinal_to_read += 1;
1831 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1832 next_offset += envelope_size;
1833 }
1834
1835 Ok(())
1836 }
1837 }
1838
1839 impl KeyboardSimulateUsAsciiTextEntryRequest {
1840 #[inline(always)]
1841 fn max_ordinal_present(&self) -> u64 {
1842 if let Some(_) = self.text {
1843 return 1;
1844 }
1845 0
1846 }
1847 }
1848
1849 impl fidl::encoding::ValueTypeMarker for KeyboardSimulateUsAsciiTextEntryRequest {
1850 type Borrowed<'a> = &'a Self;
1851 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1852 value
1853 }
1854 }
1855
1856 unsafe impl fidl::encoding::TypeMarker for KeyboardSimulateUsAsciiTextEntryRequest {
1857 type Owned = Self;
1858
1859 #[inline(always)]
1860 fn inline_align(_context: fidl::encoding::Context) -> usize {
1861 8
1862 }
1863
1864 #[inline(always)]
1865 fn inline_size(_context: fidl::encoding::Context) -> usize {
1866 16
1867 }
1868 }
1869
1870 unsafe impl<D: fidl::encoding::ResourceDialect>
1871 fidl::encoding::Encode<KeyboardSimulateUsAsciiTextEntryRequest, D>
1872 for &KeyboardSimulateUsAsciiTextEntryRequest
1873 {
1874 unsafe fn encode(
1875 self,
1876 encoder: &mut fidl::encoding::Encoder<'_, D>,
1877 offset: usize,
1878 mut depth: fidl::encoding::Depth,
1879 ) -> fidl::Result<()> {
1880 encoder.debug_check_bounds::<KeyboardSimulateUsAsciiTextEntryRequest>(offset);
1881 let max_ordinal: u64 = self.max_ordinal_present();
1883 encoder.write_num(max_ordinal, offset);
1884 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
1885 if max_ordinal == 0 {
1887 return Ok(());
1888 }
1889 depth.increment()?;
1890 let envelope_size = 8;
1891 let bytes_len = max_ordinal as usize * envelope_size;
1892 #[allow(unused_variables)]
1893 let offset = encoder.out_of_line_offset(bytes_len);
1894 let mut _prev_end_offset: usize = 0;
1895 if 1 > max_ordinal {
1896 return Ok(());
1897 }
1898
1899 let cur_offset: usize = (1 - 1) * envelope_size;
1902
1903 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
1905
1906 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
1911 self.text.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
1912 encoder, offset + cur_offset, depth
1913 )?;
1914
1915 _prev_end_offset = cur_offset + envelope_size;
1916
1917 Ok(())
1918 }
1919 }
1920
1921 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1922 for KeyboardSimulateUsAsciiTextEntryRequest
1923 {
1924 #[inline(always)]
1925 fn new_empty() -> Self {
1926 Self::default()
1927 }
1928
1929 unsafe fn decode(
1930 &mut self,
1931 decoder: &mut fidl::encoding::Decoder<'_, D>,
1932 offset: usize,
1933 mut depth: fidl::encoding::Depth,
1934 ) -> fidl::Result<()> {
1935 decoder.debug_check_bounds::<Self>(offset);
1936 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
1937 None => return Err(fidl::Error::NotNullable),
1938 Some(len) => len,
1939 };
1940 if len == 0 {
1942 return Ok(());
1943 };
1944 depth.increment()?;
1945 let envelope_size = 8;
1946 let bytes_len = len * envelope_size;
1947 let offset = decoder.out_of_line_offset(bytes_len)?;
1948 let mut _next_ordinal_to_read = 0;
1950 let mut next_offset = offset;
1951 let end_offset = offset + bytes_len;
1952 _next_ordinal_to_read += 1;
1953 if next_offset >= end_offset {
1954 return Ok(());
1955 }
1956
1957 while _next_ordinal_to_read < 1 {
1959 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
1960 _next_ordinal_to_read += 1;
1961 next_offset += envelope_size;
1962 }
1963
1964 let next_out_of_line = decoder.next_out_of_line();
1965 let handles_before = decoder.remaining_handles();
1966 if let Some((inlined, num_bytes, num_handles)) =
1967 fidl::encoding::decode_envelope_header(decoder, next_offset)?
1968 {
1969 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
1970 if inlined != (member_inline_size <= 4) {
1971 return Err(fidl::Error::InvalidInlineBitInEnvelope);
1972 }
1973 let inner_offset;
1974 let mut inner_depth = depth.clone();
1975 if inlined {
1976 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
1977 inner_offset = next_offset;
1978 } else {
1979 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
1980 inner_depth.increment()?;
1981 }
1982 let val_ref = self.text.get_or_insert_with(|| {
1983 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
1984 });
1985 fidl::decode!(
1986 fidl::encoding::BoundedString<1024>,
1987 D,
1988 val_ref,
1989 decoder,
1990 inner_offset,
1991 inner_depth
1992 )?;
1993 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
1994 {
1995 return Err(fidl::Error::InvalidNumBytesInEnvelope);
1996 }
1997 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
1998 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
1999 }
2000 }
2001
2002 next_offset += envelope_size;
2003
2004 while next_offset < end_offset {
2006 _next_ordinal_to_read += 1;
2007 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2008 next_offset += envelope_size;
2009 }
2010
2011 Ok(())
2012 }
2013 }
2014
2015 impl MediaButtonsDeviceSendButtonsStateRequest {
2016 #[inline(always)]
2017 fn max_ordinal_present(&self) -> u64 {
2018 if let Some(_) = self.buttons {
2019 return 1;
2020 }
2021 0
2022 }
2023 }
2024
2025 impl fidl::encoding::ValueTypeMarker for MediaButtonsDeviceSendButtonsStateRequest {
2026 type Borrowed<'a> = &'a Self;
2027 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2028 value
2029 }
2030 }
2031
2032 unsafe impl fidl::encoding::TypeMarker for MediaButtonsDeviceSendButtonsStateRequest {
2033 type Owned = Self;
2034
2035 #[inline(always)]
2036 fn inline_align(_context: fidl::encoding::Context) -> usize {
2037 8
2038 }
2039
2040 #[inline(always)]
2041 fn inline_size(_context: fidl::encoding::Context) -> usize {
2042 16
2043 }
2044 }
2045
2046 unsafe impl<D: fidl::encoding::ResourceDialect>
2047 fidl::encoding::Encode<MediaButtonsDeviceSendButtonsStateRequest, D>
2048 for &MediaButtonsDeviceSendButtonsStateRequest
2049 {
2050 unsafe fn encode(
2051 self,
2052 encoder: &mut fidl::encoding::Encoder<'_, D>,
2053 offset: usize,
2054 mut depth: fidl::encoding::Depth,
2055 ) -> fidl::Result<()> {
2056 encoder.debug_check_bounds::<MediaButtonsDeviceSendButtonsStateRequest>(offset);
2057 let max_ordinal: u64 = self.max_ordinal_present();
2059 encoder.write_num(max_ordinal, offset);
2060 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2061 if max_ordinal == 0 {
2063 return Ok(());
2064 }
2065 depth.increment()?;
2066 let envelope_size = 8;
2067 let bytes_len = max_ordinal as usize * envelope_size;
2068 #[allow(unused_variables)]
2069 let offset = encoder.out_of_line_offset(bytes_len);
2070 let mut _prev_end_offset: usize = 0;
2071 if 1 > max_ordinal {
2072 return Ok(());
2073 }
2074
2075 let cur_offset: usize = (1 - 1) * envelope_size;
2078
2079 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2081
2082 fidl::encoding::encode_in_envelope_optional::<
2087 fidl::encoding::Vector<
2088 fidl_fuchsia_input_report__common::ConsumerControlButton,
2089 255,
2090 >,
2091 D,
2092 >(
2093 self.buttons.as_ref().map(
2094 <fidl::encoding::Vector<
2095 fidl_fuchsia_input_report__common::ConsumerControlButton,
2096 255,
2097 > as fidl::encoding::ValueTypeMarker>::borrow,
2098 ),
2099 encoder,
2100 offset + cur_offset,
2101 depth,
2102 )?;
2103
2104 _prev_end_offset = cur_offset + envelope_size;
2105
2106 Ok(())
2107 }
2108 }
2109
2110 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2111 for MediaButtonsDeviceSendButtonsStateRequest
2112 {
2113 #[inline(always)]
2114 fn new_empty() -> Self {
2115 Self::default()
2116 }
2117
2118 unsafe fn decode(
2119 &mut self,
2120 decoder: &mut fidl::encoding::Decoder<'_, D>,
2121 offset: usize,
2122 mut depth: fidl::encoding::Depth,
2123 ) -> fidl::Result<()> {
2124 decoder.debug_check_bounds::<Self>(offset);
2125 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2126 None => return Err(fidl::Error::NotNullable),
2127 Some(len) => len,
2128 };
2129 if len == 0 {
2131 return Ok(());
2132 };
2133 depth.increment()?;
2134 let envelope_size = 8;
2135 let bytes_len = len * envelope_size;
2136 let offset = decoder.out_of_line_offset(bytes_len)?;
2137 let mut _next_ordinal_to_read = 0;
2139 let mut next_offset = offset;
2140 let end_offset = offset + bytes_len;
2141 _next_ordinal_to_read += 1;
2142 if next_offset >= end_offset {
2143 return Ok(());
2144 }
2145
2146 while _next_ordinal_to_read < 1 {
2148 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2149 _next_ordinal_to_read += 1;
2150 next_offset += envelope_size;
2151 }
2152
2153 let next_out_of_line = decoder.next_out_of_line();
2154 let handles_before = decoder.remaining_handles();
2155 if let Some((inlined, num_bytes, num_handles)) =
2156 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2157 {
2158 let member_inline_size = <fidl::encoding::Vector<
2159 fidl_fuchsia_input_report__common::ConsumerControlButton,
2160 255,
2161 > as fidl::encoding::TypeMarker>::inline_size(
2162 decoder.context
2163 );
2164 if inlined != (member_inline_size <= 4) {
2165 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2166 }
2167 let inner_offset;
2168 let mut inner_depth = depth.clone();
2169 if inlined {
2170 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2171 inner_offset = next_offset;
2172 } else {
2173 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2174 inner_depth.increment()?;
2175 }
2176 let val_ref =
2177 self.buttons.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_input_report__common::ConsumerControlButton, 255>, D));
2178 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_input_report__common::ConsumerControlButton, 255>, D, val_ref, decoder, inner_offset, inner_depth)?;
2179 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2180 {
2181 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2182 }
2183 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2184 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2185 }
2186 }
2187
2188 next_offset += envelope_size;
2189
2190 while next_offset < end_offset {
2192 _next_ordinal_to_read += 1;
2193 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2194 next_offset += envelope_size;
2195 }
2196
2197 Ok(())
2198 }
2199 }
2200
2201 impl MediaButtonsDeviceSimulateButtonPressRequest {
2202 #[inline(always)]
2203 fn max_ordinal_present(&self) -> u64 {
2204 if let Some(_) = self.button {
2205 return 1;
2206 }
2207 0
2208 }
2209 }
2210
2211 impl fidl::encoding::ValueTypeMarker for MediaButtonsDeviceSimulateButtonPressRequest {
2212 type Borrowed<'a> = &'a Self;
2213 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2214 value
2215 }
2216 }
2217
2218 unsafe impl fidl::encoding::TypeMarker for MediaButtonsDeviceSimulateButtonPressRequest {
2219 type Owned = Self;
2220
2221 #[inline(always)]
2222 fn inline_align(_context: fidl::encoding::Context) -> usize {
2223 8
2224 }
2225
2226 #[inline(always)]
2227 fn inline_size(_context: fidl::encoding::Context) -> usize {
2228 16
2229 }
2230 }
2231
2232 unsafe impl<D: fidl::encoding::ResourceDialect>
2233 fidl::encoding::Encode<MediaButtonsDeviceSimulateButtonPressRequest, D>
2234 for &MediaButtonsDeviceSimulateButtonPressRequest
2235 {
2236 unsafe fn encode(
2237 self,
2238 encoder: &mut fidl::encoding::Encoder<'_, D>,
2239 offset: usize,
2240 mut depth: fidl::encoding::Depth,
2241 ) -> fidl::Result<()> {
2242 encoder.debug_check_bounds::<MediaButtonsDeviceSimulateButtonPressRequest>(offset);
2243 let max_ordinal: u64 = self.max_ordinal_present();
2245 encoder.write_num(max_ordinal, offset);
2246 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2247 if max_ordinal == 0 {
2249 return Ok(());
2250 }
2251 depth.increment()?;
2252 let envelope_size = 8;
2253 let bytes_len = max_ordinal as usize * envelope_size;
2254 #[allow(unused_variables)]
2255 let offset = encoder.out_of_line_offset(bytes_len);
2256 let mut _prev_end_offset: usize = 0;
2257 if 1 > max_ordinal {
2258 return Ok(());
2259 }
2260
2261 let cur_offset: usize = (1 - 1) * envelope_size;
2264
2265 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2267
2268 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_input_report__common::ConsumerControlButton, D>(
2273 self.button.as_ref().map(<fidl_fuchsia_input_report__common::ConsumerControlButton as fidl::encoding::ValueTypeMarker>::borrow),
2274 encoder, offset + cur_offset, depth
2275 )?;
2276
2277 _prev_end_offset = cur_offset + envelope_size;
2278
2279 Ok(())
2280 }
2281 }
2282
2283 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2284 for MediaButtonsDeviceSimulateButtonPressRequest
2285 {
2286 #[inline(always)]
2287 fn new_empty() -> Self {
2288 Self::default()
2289 }
2290
2291 unsafe fn decode(
2292 &mut self,
2293 decoder: &mut fidl::encoding::Decoder<'_, D>,
2294 offset: usize,
2295 mut depth: fidl::encoding::Depth,
2296 ) -> fidl::Result<()> {
2297 decoder.debug_check_bounds::<Self>(offset);
2298 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2299 None => return Err(fidl::Error::NotNullable),
2300 Some(len) => len,
2301 };
2302 if len == 0 {
2304 return Ok(());
2305 };
2306 depth.increment()?;
2307 let envelope_size = 8;
2308 let bytes_len = len * envelope_size;
2309 let offset = decoder.out_of_line_offset(bytes_len)?;
2310 let mut _next_ordinal_to_read = 0;
2312 let mut next_offset = offset;
2313 let end_offset = offset + bytes_len;
2314 _next_ordinal_to_read += 1;
2315 if next_offset >= end_offset {
2316 return Ok(());
2317 }
2318
2319 while _next_ordinal_to_read < 1 {
2321 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2322 _next_ordinal_to_read += 1;
2323 next_offset += envelope_size;
2324 }
2325
2326 let next_out_of_line = decoder.next_out_of_line();
2327 let handles_before = decoder.remaining_handles();
2328 if let Some((inlined, num_bytes, num_handles)) =
2329 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2330 {
2331 let member_inline_size = <fidl_fuchsia_input_report__common::ConsumerControlButton as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2332 if inlined != (member_inline_size <= 4) {
2333 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2334 }
2335 let inner_offset;
2336 let mut inner_depth = depth.clone();
2337 if inlined {
2338 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2339 inner_offset = next_offset;
2340 } else {
2341 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2342 inner_depth.increment()?;
2343 }
2344 let val_ref = self.button.get_or_insert_with(|| {
2345 fidl::new_empty!(fidl_fuchsia_input_report__common::ConsumerControlButton, D)
2346 });
2347 fidl::decode!(
2348 fidl_fuchsia_input_report__common::ConsumerControlButton,
2349 D,
2350 val_ref,
2351 decoder,
2352 inner_offset,
2353 inner_depth
2354 )?;
2355 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2356 {
2357 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2358 }
2359 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2360 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2361 }
2362 }
2363
2364 next_offset += envelope_size;
2365
2366 while next_offset < end_offset {
2368 _next_ordinal_to_read += 1;
2369 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2370 next_offset += envelope_size;
2371 }
2372
2373 Ok(())
2374 }
2375 }
2376
2377 impl MouseInputListenerReportMouseInputRequest {
2378 #[inline(always)]
2379 fn max_ordinal_present(&self) -> u64 {
2380 if let Some(_) = self.device_id {
2381 return 10;
2382 }
2383 if let Some(_) = self.wheel_y_physical_pixel {
2384 return 9;
2385 }
2386 if let Some(_) = self.wheel_x_physical_pixel {
2387 return 8;
2388 }
2389 if let Some(_) = self.device_pixel_ratio {
2390 return 7;
2391 }
2392 if let Some(_) = self.phase {
2393 return 6;
2394 }
2395 if let Some(_) = self.buttons {
2396 return 5;
2397 }
2398 if let Some(_) = self.component_name {
2399 return 4;
2400 }
2401 if let Some(_) = self.time_received {
2402 return 3;
2403 }
2404 if let Some(_) = self.local_y {
2405 return 2;
2406 }
2407 if let Some(_) = self.local_x {
2408 return 1;
2409 }
2410 0
2411 }
2412 }
2413
2414 impl fidl::encoding::ValueTypeMarker for MouseInputListenerReportMouseInputRequest {
2415 type Borrowed<'a> = &'a Self;
2416 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2417 value
2418 }
2419 }
2420
2421 unsafe impl fidl::encoding::TypeMarker for MouseInputListenerReportMouseInputRequest {
2422 type Owned = Self;
2423
2424 #[inline(always)]
2425 fn inline_align(_context: fidl::encoding::Context) -> usize {
2426 8
2427 }
2428
2429 #[inline(always)]
2430 fn inline_size(_context: fidl::encoding::Context) -> usize {
2431 16
2432 }
2433 }
2434
2435 unsafe impl<D: fidl::encoding::ResourceDialect>
2436 fidl::encoding::Encode<MouseInputListenerReportMouseInputRequest, D>
2437 for &MouseInputListenerReportMouseInputRequest
2438 {
2439 unsafe fn encode(
2440 self,
2441 encoder: &mut fidl::encoding::Encoder<'_, D>,
2442 offset: usize,
2443 mut depth: fidl::encoding::Depth,
2444 ) -> fidl::Result<()> {
2445 encoder.debug_check_bounds::<MouseInputListenerReportMouseInputRequest>(offset);
2446 let max_ordinal: u64 = self.max_ordinal_present();
2448 encoder.write_num(max_ordinal, offset);
2449 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2450 if max_ordinal == 0 {
2452 return Ok(());
2453 }
2454 depth.increment()?;
2455 let envelope_size = 8;
2456 let bytes_len = max_ordinal as usize * envelope_size;
2457 #[allow(unused_variables)]
2458 let offset = encoder.out_of_line_offset(bytes_len);
2459 let mut _prev_end_offset: usize = 0;
2460 if 1 > max_ordinal {
2461 return Ok(());
2462 }
2463
2464 let cur_offset: usize = (1 - 1) * envelope_size;
2467
2468 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2470
2471 fidl::encoding::encode_in_envelope_optional::<f64, D>(
2476 self.local_x.as_ref().map(<f64 as fidl::encoding::ValueTypeMarker>::borrow),
2477 encoder,
2478 offset + cur_offset,
2479 depth,
2480 )?;
2481
2482 _prev_end_offset = cur_offset + envelope_size;
2483 if 2 > max_ordinal {
2484 return Ok(());
2485 }
2486
2487 let cur_offset: usize = (2 - 1) * envelope_size;
2490
2491 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2493
2494 fidl::encoding::encode_in_envelope_optional::<f64, D>(
2499 self.local_y.as_ref().map(<f64 as fidl::encoding::ValueTypeMarker>::borrow),
2500 encoder,
2501 offset + cur_offset,
2502 depth,
2503 )?;
2504
2505 _prev_end_offset = cur_offset + envelope_size;
2506 if 3 > max_ordinal {
2507 return Ok(());
2508 }
2509
2510 let cur_offset: usize = (3 - 1) * envelope_size;
2513
2514 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2516
2517 fidl::encoding::encode_in_envelope_optional::<i64, D>(
2522 self.time_received.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
2523 encoder,
2524 offset + cur_offset,
2525 depth,
2526 )?;
2527
2528 _prev_end_offset = cur_offset + envelope_size;
2529 if 4 > max_ordinal {
2530 return Ok(());
2531 }
2532
2533 let cur_offset: usize = (4 - 1) * envelope_size;
2536
2537 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2539
2540 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
2545 self.component_name.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
2546 encoder, offset + cur_offset, depth
2547 )?;
2548
2549 _prev_end_offset = cur_offset + envelope_size;
2550 if 5 > max_ordinal {
2551 return Ok(());
2552 }
2553
2554 let cur_offset: usize = (5 - 1) * envelope_size;
2557
2558 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2560
2561 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<MouseButton, 32>, D>(
2566 self.buttons.as_ref().map(<fidl::encoding::Vector<MouseButton, 32> as fidl::encoding::ValueTypeMarker>::borrow),
2567 encoder, offset + cur_offset, depth
2568 )?;
2569
2570 _prev_end_offset = cur_offset + envelope_size;
2571 if 6 > max_ordinal {
2572 return Ok(());
2573 }
2574
2575 let cur_offset: usize = (6 - 1) * envelope_size;
2578
2579 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2581
2582 fidl::encoding::encode_in_envelope_optional::<MouseEventPhase, D>(
2587 self.phase
2588 .as_ref()
2589 .map(<MouseEventPhase as fidl::encoding::ValueTypeMarker>::borrow),
2590 encoder,
2591 offset + cur_offset,
2592 depth,
2593 )?;
2594
2595 _prev_end_offset = cur_offset + envelope_size;
2596 if 7 > max_ordinal {
2597 return Ok(());
2598 }
2599
2600 let cur_offset: usize = (7 - 1) * envelope_size;
2603
2604 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2606
2607 fidl::encoding::encode_in_envelope_optional::<f64, D>(
2612 self.device_pixel_ratio
2613 .as_ref()
2614 .map(<f64 as fidl::encoding::ValueTypeMarker>::borrow),
2615 encoder,
2616 offset + cur_offset,
2617 depth,
2618 )?;
2619
2620 _prev_end_offset = cur_offset + envelope_size;
2621 if 8 > max_ordinal {
2622 return Ok(());
2623 }
2624
2625 let cur_offset: usize = (8 - 1) * envelope_size;
2628
2629 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2631
2632 fidl::encoding::encode_in_envelope_optional::<f64, D>(
2637 self.wheel_x_physical_pixel
2638 .as_ref()
2639 .map(<f64 as fidl::encoding::ValueTypeMarker>::borrow),
2640 encoder,
2641 offset + cur_offset,
2642 depth,
2643 )?;
2644
2645 _prev_end_offset = cur_offset + envelope_size;
2646 if 9 > max_ordinal {
2647 return Ok(());
2648 }
2649
2650 let cur_offset: usize = (9 - 1) * envelope_size;
2653
2654 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2656
2657 fidl::encoding::encode_in_envelope_optional::<f64, D>(
2662 self.wheel_y_physical_pixel
2663 .as_ref()
2664 .map(<f64 as fidl::encoding::ValueTypeMarker>::borrow),
2665 encoder,
2666 offset + cur_offset,
2667 depth,
2668 )?;
2669
2670 _prev_end_offset = cur_offset + envelope_size;
2671 if 10 > max_ordinal {
2672 return Ok(());
2673 }
2674
2675 let cur_offset: usize = (10 - 1) * envelope_size;
2678
2679 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2681
2682 fidl::encoding::encode_in_envelope_optional::<u32, D>(
2687 self.device_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
2688 encoder,
2689 offset + cur_offset,
2690 depth,
2691 )?;
2692
2693 _prev_end_offset = cur_offset + envelope_size;
2694
2695 Ok(())
2696 }
2697 }
2698
2699 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2700 for MouseInputListenerReportMouseInputRequest
2701 {
2702 #[inline(always)]
2703 fn new_empty() -> Self {
2704 Self::default()
2705 }
2706
2707 unsafe fn decode(
2708 &mut self,
2709 decoder: &mut fidl::encoding::Decoder<'_, D>,
2710 offset: usize,
2711 mut depth: fidl::encoding::Depth,
2712 ) -> fidl::Result<()> {
2713 decoder.debug_check_bounds::<Self>(offset);
2714 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2715 None => return Err(fidl::Error::NotNullable),
2716 Some(len) => len,
2717 };
2718 if len == 0 {
2720 return Ok(());
2721 };
2722 depth.increment()?;
2723 let envelope_size = 8;
2724 let bytes_len = len * envelope_size;
2725 let offset = decoder.out_of_line_offset(bytes_len)?;
2726 let mut _next_ordinal_to_read = 0;
2728 let mut next_offset = offset;
2729 let end_offset = offset + bytes_len;
2730 _next_ordinal_to_read += 1;
2731 if next_offset >= end_offset {
2732 return Ok(());
2733 }
2734
2735 while _next_ordinal_to_read < 1 {
2737 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2738 _next_ordinal_to_read += 1;
2739 next_offset += envelope_size;
2740 }
2741
2742 let next_out_of_line = decoder.next_out_of_line();
2743 let handles_before = decoder.remaining_handles();
2744 if let Some((inlined, num_bytes, num_handles)) =
2745 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2746 {
2747 let member_inline_size =
2748 <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2749 if inlined != (member_inline_size <= 4) {
2750 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2751 }
2752 let inner_offset;
2753 let mut inner_depth = depth.clone();
2754 if inlined {
2755 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2756 inner_offset = next_offset;
2757 } else {
2758 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2759 inner_depth.increment()?;
2760 }
2761 let val_ref = self.local_x.get_or_insert_with(|| fidl::new_empty!(f64, D));
2762 fidl::decode!(f64, D, val_ref, decoder, inner_offset, inner_depth)?;
2763 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2764 {
2765 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2766 }
2767 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2768 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2769 }
2770 }
2771
2772 next_offset += envelope_size;
2773 _next_ordinal_to_read += 1;
2774 if next_offset >= end_offset {
2775 return Ok(());
2776 }
2777
2778 while _next_ordinal_to_read < 2 {
2780 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2781 _next_ordinal_to_read += 1;
2782 next_offset += envelope_size;
2783 }
2784
2785 let next_out_of_line = decoder.next_out_of_line();
2786 let handles_before = decoder.remaining_handles();
2787 if let Some((inlined, num_bytes, num_handles)) =
2788 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2789 {
2790 let member_inline_size =
2791 <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2792 if inlined != (member_inline_size <= 4) {
2793 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2794 }
2795 let inner_offset;
2796 let mut inner_depth = depth.clone();
2797 if inlined {
2798 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2799 inner_offset = next_offset;
2800 } else {
2801 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2802 inner_depth.increment()?;
2803 }
2804 let val_ref = self.local_y.get_or_insert_with(|| fidl::new_empty!(f64, D));
2805 fidl::decode!(f64, D, val_ref, decoder, inner_offset, inner_depth)?;
2806 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2807 {
2808 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2809 }
2810 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2811 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2812 }
2813 }
2814
2815 next_offset += envelope_size;
2816 _next_ordinal_to_read += 1;
2817 if next_offset >= end_offset {
2818 return Ok(());
2819 }
2820
2821 while _next_ordinal_to_read < 3 {
2823 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2824 _next_ordinal_to_read += 1;
2825 next_offset += envelope_size;
2826 }
2827
2828 let next_out_of_line = decoder.next_out_of_line();
2829 let handles_before = decoder.remaining_handles();
2830 if let Some((inlined, num_bytes, num_handles)) =
2831 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2832 {
2833 let member_inline_size =
2834 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2835 if inlined != (member_inline_size <= 4) {
2836 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2837 }
2838 let inner_offset;
2839 let mut inner_depth = depth.clone();
2840 if inlined {
2841 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2842 inner_offset = next_offset;
2843 } else {
2844 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2845 inner_depth.increment()?;
2846 }
2847 let val_ref = self.time_received.get_or_insert_with(|| fidl::new_empty!(i64, D));
2848 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
2849 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2850 {
2851 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2852 }
2853 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2854 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2855 }
2856 }
2857
2858 next_offset += envelope_size;
2859 _next_ordinal_to_read += 1;
2860 if next_offset >= end_offset {
2861 return Ok(());
2862 }
2863
2864 while _next_ordinal_to_read < 4 {
2866 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2867 _next_ordinal_to_read += 1;
2868 next_offset += envelope_size;
2869 }
2870
2871 let next_out_of_line = decoder.next_out_of_line();
2872 let handles_before = decoder.remaining_handles();
2873 if let Some((inlined, num_bytes, num_handles)) =
2874 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2875 {
2876 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2877 if inlined != (member_inline_size <= 4) {
2878 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2879 }
2880 let inner_offset;
2881 let mut inner_depth = depth.clone();
2882 if inlined {
2883 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2884 inner_offset = next_offset;
2885 } else {
2886 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2887 inner_depth.increment()?;
2888 }
2889 let val_ref = self.component_name.get_or_insert_with(|| {
2890 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
2891 });
2892 fidl::decode!(
2893 fidl::encoding::BoundedString<1024>,
2894 D,
2895 val_ref,
2896 decoder,
2897 inner_offset,
2898 inner_depth
2899 )?;
2900 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2901 {
2902 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2903 }
2904 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2905 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2906 }
2907 }
2908
2909 next_offset += envelope_size;
2910 _next_ordinal_to_read += 1;
2911 if next_offset >= end_offset {
2912 return Ok(());
2913 }
2914
2915 while _next_ordinal_to_read < 5 {
2917 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2918 _next_ordinal_to_read += 1;
2919 next_offset += envelope_size;
2920 }
2921
2922 let next_out_of_line = decoder.next_out_of_line();
2923 let handles_before = decoder.remaining_handles();
2924 if let Some((inlined, num_bytes, num_handles)) =
2925 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2926 {
2927 let member_inline_size = <fidl::encoding::Vector<MouseButton, 32> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2928 if inlined != (member_inline_size <= 4) {
2929 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2930 }
2931 let inner_offset;
2932 let mut inner_depth = depth.clone();
2933 if inlined {
2934 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2935 inner_offset = next_offset;
2936 } else {
2937 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2938 inner_depth.increment()?;
2939 }
2940 let val_ref = self.buttons.get_or_insert_with(
2941 || fidl::new_empty!(fidl::encoding::Vector<MouseButton, 32>, D),
2942 );
2943 fidl::decode!(fidl::encoding::Vector<MouseButton, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
2944 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2945 {
2946 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2947 }
2948 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2949 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2950 }
2951 }
2952
2953 next_offset += envelope_size;
2954 _next_ordinal_to_read += 1;
2955 if next_offset >= end_offset {
2956 return Ok(());
2957 }
2958
2959 while _next_ordinal_to_read < 6 {
2961 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2962 _next_ordinal_to_read += 1;
2963 next_offset += envelope_size;
2964 }
2965
2966 let next_out_of_line = decoder.next_out_of_line();
2967 let handles_before = decoder.remaining_handles();
2968 if let Some((inlined, num_bytes, num_handles)) =
2969 fidl::encoding::decode_envelope_header(decoder, next_offset)?
2970 {
2971 let member_inline_size =
2972 <MouseEventPhase as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2973 if inlined != (member_inline_size <= 4) {
2974 return Err(fidl::Error::InvalidInlineBitInEnvelope);
2975 }
2976 let inner_offset;
2977 let mut inner_depth = depth.clone();
2978 if inlined {
2979 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2980 inner_offset = next_offset;
2981 } else {
2982 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2983 inner_depth.increment()?;
2984 }
2985 let val_ref =
2986 self.phase.get_or_insert_with(|| fidl::new_empty!(MouseEventPhase, D));
2987 fidl::decode!(MouseEventPhase, D, val_ref, decoder, inner_offset, inner_depth)?;
2988 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2989 {
2990 return Err(fidl::Error::InvalidNumBytesInEnvelope);
2991 }
2992 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2993 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2994 }
2995 }
2996
2997 next_offset += envelope_size;
2998 _next_ordinal_to_read += 1;
2999 if next_offset >= end_offset {
3000 return Ok(());
3001 }
3002
3003 while _next_ordinal_to_read < 7 {
3005 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3006 _next_ordinal_to_read += 1;
3007 next_offset += envelope_size;
3008 }
3009
3010 let next_out_of_line = decoder.next_out_of_line();
3011 let handles_before = decoder.remaining_handles();
3012 if let Some((inlined, num_bytes, num_handles)) =
3013 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3014 {
3015 let member_inline_size =
3016 <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3017 if inlined != (member_inline_size <= 4) {
3018 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3019 }
3020 let inner_offset;
3021 let mut inner_depth = depth.clone();
3022 if inlined {
3023 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3024 inner_offset = next_offset;
3025 } else {
3026 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3027 inner_depth.increment()?;
3028 }
3029 let val_ref =
3030 self.device_pixel_ratio.get_or_insert_with(|| fidl::new_empty!(f64, D));
3031 fidl::decode!(f64, D, val_ref, decoder, inner_offset, inner_depth)?;
3032 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3033 {
3034 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3035 }
3036 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3037 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3038 }
3039 }
3040
3041 next_offset += envelope_size;
3042 _next_ordinal_to_read += 1;
3043 if next_offset >= end_offset {
3044 return Ok(());
3045 }
3046
3047 while _next_ordinal_to_read < 8 {
3049 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3050 _next_ordinal_to_read += 1;
3051 next_offset += envelope_size;
3052 }
3053
3054 let next_out_of_line = decoder.next_out_of_line();
3055 let handles_before = decoder.remaining_handles();
3056 if let Some((inlined, num_bytes, num_handles)) =
3057 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3058 {
3059 let member_inline_size =
3060 <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3061 if inlined != (member_inline_size <= 4) {
3062 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3063 }
3064 let inner_offset;
3065 let mut inner_depth = depth.clone();
3066 if inlined {
3067 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3068 inner_offset = next_offset;
3069 } else {
3070 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3071 inner_depth.increment()?;
3072 }
3073 let val_ref =
3074 self.wheel_x_physical_pixel.get_or_insert_with(|| fidl::new_empty!(f64, D));
3075 fidl::decode!(f64, D, val_ref, decoder, inner_offset, inner_depth)?;
3076 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3077 {
3078 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3079 }
3080 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3081 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3082 }
3083 }
3084
3085 next_offset += envelope_size;
3086 _next_ordinal_to_read += 1;
3087 if next_offset >= end_offset {
3088 return Ok(());
3089 }
3090
3091 while _next_ordinal_to_read < 9 {
3093 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3094 _next_ordinal_to_read += 1;
3095 next_offset += envelope_size;
3096 }
3097
3098 let next_out_of_line = decoder.next_out_of_line();
3099 let handles_before = decoder.remaining_handles();
3100 if let Some((inlined, num_bytes, num_handles)) =
3101 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3102 {
3103 let member_inline_size =
3104 <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3105 if inlined != (member_inline_size <= 4) {
3106 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3107 }
3108 let inner_offset;
3109 let mut inner_depth = depth.clone();
3110 if inlined {
3111 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3112 inner_offset = next_offset;
3113 } else {
3114 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3115 inner_depth.increment()?;
3116 }
3117 let val_ref =
3118 self.wheel_y_physical_pixel.get_or_insert_with(|| fidl::new_empty!(f64, D));
3119 fidl::decode!(f64, D, val_ref, decoder, inner_offset, inner_depth)?;
3120 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3121 {
3122 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3123 }
3124 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3125 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3126 }
3127 }
3128
3129 next_offset += envelope_size;
3130 _next_ordinal_to_read += 1;
3131 if next_offset >= end_offset {
3132 return Ok(());
3133 }
3134
3135 while _next_ordinal_to_read < 10 {
3137 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3138 _next_ordinal_to_read += 1;
3139 next_offset += envelope_size;
3140 }
3141
3142 let next_out_of_line = decoder.next_out_of_line();
3143 let handles_before = decoder.remaining_handles();
3144 if let Some((inlined, num_bytes, num_handles)) =
3145 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3146 {
3147 let member_inline_size =
3148 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3149 if inlined != (member_inline_size <= 4) {
3150 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3151 }
3152 let inner_offset;
3153 let mut inner_depth = depth.clone();
3154 if inlined {
3155 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3156 inner_offset = next_offset;
3157 } else {
3158 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3159 inner_depth.increment()?;
3160 }
3161 let val_ref = self.device_id.get_or_insert_with(|| fidl::new_empty!(u32, D));
3162 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
3163 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3164 {
3165 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3166 }
3167 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3168 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3169 }
3170 }
3171
3172 next_offset += envelope_size;
3173
3174 while next_offset < end_offset {
3176 _next_ordinal_to_read += 1;
3177 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3178 next_offset += envelope_size;
3179 }
3180
3181 Ok(())
3182 }
3183 }
3184
3185 impl MouseSimulateMouseEventRequest {
3186 #[inline(always)]
3187 fn max_ordinal_present(&self) -> u64 {
3188 if let Some(_) = self.scroll_h_physical_pixel {
3189 return 7;
3190 }
3191 if let Some(_) = self.scroll_v_physical_pixel {
3192 return 6;
3193 }
3194 if let Some(_) = self.scroll_h_detent {
3195 return 5;
3196 }
3197 if let Some(_) = self.scroll_v_detent {
3198 return 4;
3199 }
3200 if let Some(_) = self.movement_y {
3201 return 3;
3202 }
3203 if let Some(_) = self.movement_x {
3204 return 2;
3205 }
3206 if let Some(_) = self.pressed_buttons {
3207 return 1;
3208 }
3209 0
3210 }
3211 }
3212
3213 impl fidl::encoding::ValueTypeMarker for MouseSimulateMouseEventRequest {
3214 type Borrowed<'a> = &'a Self;
3215 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3216 value
3217 }
3218 }
3219
3220 unsafe impl fidl::encoding::TypeMarker for MouseSimulateMouseEventRequest {
3221 type Owned = Self;
3222
3223 #[inline(always)]
3224 fn inline_align(_context: fidl::encoding::Context) -> usize {
3225 8
3226 }
3227
3228 #[inline(always)]
3229 fn inline_size(_context: fidl::encoding::Context) -> usize {
3230 16
3231 }
3232 }
3233
3234 unsafe impl<D: fidl::encoding::ResourceDialect>
3235 fidl::encoding::Encode<MouseSimulateMouseEventRequest, D>
3236 for &MouseSimulateMouseEventRequest
3237 {
3238 unsafe fn encode(
3239 self,
3240 encoder: &mut fidl::encoding::Encoder<'_, D>,
3241 offset: usize,
3242 mut depth: fidl::encoding::Depth,
3243 ) -> fidl::Result<()> {
3244 encoder.debug_check_bounds::<MouseSimulateMouseEventRequest>(offset);
3245 let max_ordinal: u64 = self.max_ordinal_present();
3247 encoder.write_num(max_ordinal, offset);
3248 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3249 if max_ordinal == 0 {
3251 return Ok(());
3252 }
3253 depth.increment()?;
3254 let envelope_size = 8;
3255 let bytes_len = max_ordinal as usize * envelope_size;
3256 #[allow(unused_variables)]
3257 let offset = encoder.out_of_line_offset(bytes_len);
3258 let mut _prev_end_offset: usize = 0;
3259 if 1 > max_ordinal {
3260 return Ok(());
3261 }
3262
3263 let cur_offset: usize = (1 - 1) * envelope_size;
3266
3267 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3269
3270 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<MouseButton, 32>, D>(
3275 self.pressed_buttons.as_ref().map(<fidl::encoding::Vector<MouseButton, 32> as fidl::encoding::ValueTypeMarker>::borrow),
3276 encoder, offset + cur_offset, depth
3277 )?;
3278
3279 _prev_end_offset = cur_offset + envelope_size;
3280 if 2 > max_ordinal {
3281 return Ok(());
3282 }
3283
3284 let cur_offset: usize = (2 - 1) * envelope_size;
3287
3288 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3290
3291 fidl::encoding::encode_in_envelope_optional::<i64, D>(
3296 self.movement_x.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
3297 encoder,
3298 offset + cur_offset,
3299 depth,
3300 )?;
3301
3302 _prev_end_offset = cur_offset + envelope_size;
3303 if 3 > max_ordinal {
3304 return Ok(());
3305 }
3306
3307 let cur_offset: usize = (3 - 1) * envelope_size;
3310
3311 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3313
3314 fidl::encoding::encode_in_envelope_optional::<i64, D>(
3319 self.movement_y.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
3320 encoder,
3321 offset + cur_offset,
3322 depth,
3323 )?;
3324
3325 _prev_end_offset = cur_offset + envelope_size;
3326 if 4 > max_ordinal {
3327 return Ok(());
3328 }
3329
3330 let cur_offset: usize = (4 - 1) * envelope_size;
3333
3334 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3336
3337 fidl::encoding::encode_in_envelope_optional::<i64, D>(
3342 self.scroll_v_detent.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
3343 encoder,
3344 offset + cur_offset,
3345 depth,
3346 )?;
3347
3348 _prev_end_offset = cur_offset + envelope_size;
3349 if 5 > max_ordinal {
3350 return Ok(());
3351 }
3352
3353 let cur_offset: usize = (5 - 1) * envelope_size;
3356
3357 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3359
3360 fidl::encoding::encode_in_envelope_optional::<i64, D>(
3365 self.scroll_h_detent.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
3366 encoder,
3367 offset + cur_offset,
3368 depth,
3369 )?;
3370
3371 _prev_end_offset = cur_offset + envelope_size;
3372 if 6 > max_ordinal {
3373 return Ok(());
3374 }
3375
3376 let cur_offset: usize = (6 - 1) * envelope_size;
3379
3380 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3382
3383 fidl::encoding::encode_in_envelope_optional::<f64, D>(
3388 self.scroll_v_physical_pixel
3389 .as_ref()
3390 .map(<f64 as fidl::encoding::ValueTypeMarker>::borrow),
3391 encoder,
3392 offset + cur_offset,
3393 depth,
3394 )?;
3395
3396 _prev_end_offset = cur_offset + envelope_size;
3397 if 7 > max_ordinal {
3398 return Ok(());
3399 }
3400
3401 let cur_offset: usize = (7 - 1) * envelope_size;
3404
3405 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3407
3408 fidl::encoding::encode_in_envelope_optional::<f64, D>(
3413 self.scroll_h_physical_pixel
3414 .as_ref()
3415 .map(<f64 as fidl::encoding::ValueTypeMarker>::borrow),
3416 encoder,
3417 offset + cur_offset,
3418 depth,
3419 )?;
3420
3421 _prev_end_offset = cur_offset + envelope_size;
3422
3423 Ok(())
3424 }
3425 }
3426
3427 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3428 for MouseSimulateMouseEventRequest
3429 {
3430 #[inline(always)]
3431 fn new_empty() -> Self {
3432 Self::default()
3433 }
3434
3435 unsafe fn decode(
3436 &mut self,
3437 decoder: &mut fidl::encoding::Decoder<'_, D>,
3438 offset: usize,
3439 mut depth: fidl::encoding::Depth,
3440 ) -> fidl::Result<()> {
3441 decoder.debug_check_bounds::<Self>(offset);
3442 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3443 None => return Err(fidl::Error::NotNullable),
3444 Some(len) => len,
3445 };
3446 if len == 0 {
3448 return Ok(());
3449 };
3450 depth.increment()?;
3451 let envelope_size = 8;
3452 let bytes_len = len * envelope_size;
3453 let offset = decoder.out_of_line_offset(bytes_len)?;
3454 let mut _next_ordinal_to_read = 0;
3456 let mut next_offset = offset;
3457 let end_offset = offset + bytes_len;
3458 _next_ordinal_to_read += 1;
3459 if next_offset >= end_offset {
3460 return Ok(());
3461 }
3462
3463 while _next_ordinal_to_read < 1 {
3465 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3466 _next_ordinal_to_read += 1;
3467 next_offset += envelope_size;
3468 }
3469
3470 let next_out_of_line = decoder.next_out_of_line();
3471 let handles_before = decoder.remaining_handles();
3472 if let Some((inlined, num_bytes, num_handles)) =
3473 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3474 {
3475 let member_inline_size = <fidl::encoding::Vector<MouseButton, 32> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3476 if inlined != (member_inline_size <= 4) {
3477 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3478 }
3479 let inner_offset;
3480 let mut inner_depth = depth.clone();
3481 if inlined {
3482 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3483 inner_offset = next_offset;
3484 } else {
3485 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3486 inner_depth.increment()?;
3487 }
3488 let val_ref = self.pressed_buttons.get_or_insert_with(
3489 || fidl::new_empty!(fidl::encoding::Vector<MouseButton, 32>, D),
3490 );
3491 fidl::decode!(fidl::encoding::Vector<MouseButton, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
3492 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3493 {
3494 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3495 }
3496 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3497 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3498 }
3499 }
3500
3501 next_offset += envelope_size;
3502 _next_ordinal_to_read += 1;
3503 if next_offset >= end_offset {
3504 return Ok(());
3505 }
3506
3507 while _next_ordinal_to_read < 2 {
3509 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3510 _next_ordinal_to_read += 1;
3511 next_offset += envelope_size;
3512 }
3513
3514 let next_out_of_line = decoder.next_out_of_line();
3515 let handles_before = decoder.remaining_handles();
3516 if let Some((inlined, num_bytes, num_handles)) =
3517 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3518 {
3519 let member_inline_size =
3520 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3521 if inlined != (member_inline_size <= 4) {
3522 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3523 }
3524 let inner_offset;
3525 let mut inner_depth = depth.clone();
3526 if inlined {
3527 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3528 inner_offset = next_offset;
3529 } else {
3530 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3531 inner_depth.increment()?;
3532 }
3533 let val_ref = self.movement_x.get_or_insert_with(|| fidl::new_empty!(i64, D));
3534 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3535 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3536 {
3537 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3538 }
3539 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3540 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3541 }
3542 }
3543
3544 next_offset += envelope_size;
3545 _next_ordinal_to_read += 1;
3546 if next_offset >= end_offset {
3547 return Ok(());
3548 }
3549
3550 while _next_ordinal_to_read < 3 {
3552 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3553 _next_ordinal_to_read += 1;
3554 next_offset += envelope_size;
3555 }
3556
3557 let next_out_of_line = decoder.next_out_of_line();
3558 let handles_before = decoder.remaining_handles();
3559 if let Some((inlined, num_bytes, num_handles)) =
3560 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3561 {
3562 let member_inline_size =
3563 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3564 if inlined != (member_inline_size <= 4) {
3565 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3566 }
3567 let inner_offset;
3568 let mut inner_depth = depth.clone();
3569 if inlined {
3570 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3571 inner_offset = next_offset;
3572 } else {
3573 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3574 inner_depth.increment()?;
3575 }
3576 let val_ref = self.movement_y.get_or_insert_with(|| fidl::new_empty!(i64, D));
3577 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3578 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3579 {
3580 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3581 }
3582 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3583 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3584 }
3585 }
3586
3587 next_offset += envelope_size;
3588 _next_ordinal_to_read += 1;
3589 if next_offset >= end_offset {
3590 return Ok(());
3591 }
3592
3593 while _next_ordinal_to_read < 4 {
3595 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3596 _next_ordinal_to_read += 1;
3597 next_offset += envelope_size;
3598 }
3599
3600 let next_out_of_line = decoder.next_out_of_line();
3601 let handles_before = decoder.remaining_handles();
3602 if let Some((inlined, num_bytes, num_handles)) =
3603 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3604 {
3605 let member_inline_size =
3606 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3607 if inlined != (member_inline_size <= 4) {
3608 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3609 }
3610 let inner_offset;
3611 let mut inner_depth = depth.clone();
3612 if inlined {
3613 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3614 inner_offset = next_offset;
3615 } else {
3616 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3617 inner_depth.increment()?;
3618 }
3619 let val_ref = self.scroll_v_detent.get_or_insert_with(|| fidl::new_empty!(i64, D));
3620 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3621 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3622 {
3623 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3624 }
3625 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3626 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3627 }
3628 }
3629
3630 next_offset += envelope_size;
3631 _next_ordinal_to_read += 1;
3632 if next_offset >= end_offset {
3633 return Ok(());
3634 }
3635
3636 while _next_ordinal_to_read < 5 {
3638 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3639 _next_ordinal_to_read += 1;
3640 next_offset += envelope_size;
3641 }
3642
3643 let next_out_of_line = decoder.next_out_of_line();
3644 let handles_before = decoder.remaining_handles();
3645 if let Some((inlined, num_bytes, num_handles)) =
3646 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3647 {
3648 let member_inline_size =
3649 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3650 if inlined != (member_inline_size <= 4) {
3651 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3652 }
3653 let inner_offset;
3654 let mut inner_depth = depth.clone();
3655 if inlined {
3656 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3657 inner_offset = next_offset;
3658 } else {
3659 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3660 inner_depth.increment()?;
3661 }
3662 let val_ref = self.scroll_h_detent.get_or_insert_with(|| fidl::new_empty!(i64, D));
3663 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
3664 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3665 {
3666 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3667 }
3668 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3669 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3670 }
3671 }
3672
3673 next_offset += envelope_size;
3674 _next_ordinal_to_read += 1;
3675 if next_offset >= end_offset {
3676 return Ok(());
3677 }
3678
3679 while _next_ordinal_to_read < 6 {
3681 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3682 _next_ordinal_to_read += 1;
3683 next_offset += envelope_size;
3684 }
3685
3686 let next_out_of_line = decoder.next_out_of_line();
3687 let handles_before = decoder.remaining_handles();
3688 if let Some((inlined, num_bytes, num_handles)) =
3689 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3690 {
3691 let member_inline_size =
3692 <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3693 if inlined != (member_inline_size <= 4) {
3694 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3695 }
3696 let inner_offset;
3697 let mut inner_depth = depth.clone();
3698 if inlined {
3699 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3700 inner_offset = next_offset;
3701 } else {
3702 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3703 inner_depth.increment()?;
3704 }
3705 let val_ref =
3706 self.scroll_v_physical_pixel.get_or_insert_with(|| fidl::new_empty!(f64, D));
3707 fidl::decode!(f64, D, val_ref, decoder, inner_offset, inner_depth)?;
3708 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3709 {
3710 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3711 }
3712 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3713 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3714 }
3715 }
3716
3717 next_offset += envelope_size;
3718 _next_ordinal_to_read += 1;
3719 if next_offset >= end_offset {
3720 return Ok(());
3721 }
3722
3723 while _next_ordinal_to_read < 7 {
3725 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3726 _next_ordinal_to_read += 1;
3727 next_offset += envelope_size;
3728 }
3729
3730 let next_out_of_line = decoder.next_out_of_line();
3731 let handles_before = decoder.remaining_handles();
3732 if let Some((inlined, num_bytes, num_handles)) =
3733 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3734 {
3735 let member_inline_size =
3736 <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3737 if inlined != (member_inline_size <= 4) {
3738 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3739 }
3740 let inner_offset;
3741 let mut inner_depth = depth.clone();
3742 if inlined {
3743 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3744 inner_offset = next_offset;
3745 } else {
3746 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3747 inner_depth.increment()?;
3748 }
3749 let val_ref =
3750 self.scroll_h_physical_pixel.get_or_insert_with(|| fidl::new_empty!(f64, D));
3751 fidl::decode!(f64, D, val_ref, decoder, inner_offset, inner_depth)?;
3752 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3753 {
3754 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3755 }
3756 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3757 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3758 }
3759 }
3760
3761 next_offset += envelope_size;
3762
3763 while next_offset < end_offset {
3765 _next_ordinal_to_read += 1;
3766 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3767 next_offset += envelope_size;
3768 }
3769
3770 Ok(())
3771 }
3772 }
3773
3774 impl TouchInputListenerReportTouchInputRequest {
3775 #[inline(always)]
3776 fn max_ordinal_present(&self) -> u64 {
3777 if let Some(_) = self.device_id {
3778 return 8;
3779 }
3780 if let Some(_) = self.pointer_id {
3781 return 7;
3782 }
3783 if let Some(_) = self.phase {
3784 return 6;
3785 }
3786 if let Some(_) = self.component_name {
3787 return 5;
3788 }
3789 if let Some(_) = self.device_pixel_ratio {
3790 return 4;
3791 }
3792 if let Some(_) = self.time_received {
3793 return 3;
3794 }
3795 if let Some(_) = self.local_y {
3796 return 2;
3797 }
3798 if let Some(_) = self.local_x {
3799 return 1;
3800 }
3801 0
3802 }
3803 }
3804
3805 impl fidl::encoding::ValueTypeMarker for TouchInputListenerReportTouchInputRequest {
3806 type Borrowed<'a> = &'a Self;
3807 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3808 value
3809 }
3810 }
3811
3812 unsafe impl fidl::encoding::TypeMarker for TouchInputListenerReportTouchInputRequest {
3813 type Owned = Self;
3814
3815 #[inline(always)]
3816 fn inline_align(_context: fidl::encoding::Context) -> usize {
3817 8
3818 }
3819
3820 #[inline(always)]
3821 fn inline_size(_context: fidl::encoding::Context) -> usize {
3822 16
3823 }
3824 }
3825
3826 unsafe impl<D: fidl::encoding::ResourceDialect>
3827 fidl::encoding::Encode<TouchInputListenerReportTouchInputRequest, D>
3828 for &TouchInputListenerReportTouchInputRequest
3829 {
3830 unsafe fn encode(
3831 self,
3832 encoder: &mut fidl::encoding::Encoder<'_, D>,
3833 offset: usize,
3834 mut depth: fidl::encoding::Depth,
3835 ) -> fidl::Result<()> {
3836 encoder.debug_check_bounds::<TouchInputListenerReportTouchInputRequest>(offset);
3837 let max_ordinal: u64 = self.max_ordinal_present();
3839 encoder.write_num(max_ordinal, offset);
3840 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3841 if max_ordinal == 0 {
3843 return Ok(());
3844 }
3845 depth.increment()?;
3846 let envelope_size = 8;
3847 let bytes_len = max_ordinal as usize * envelope_size;
3848 #[allow(unused_variables)]
3849 let offset = encoder.out_of_line_offset(bytes_len);
3850 let mut _prev_end_offset: usize = 0;
3851 if 1 > max_ordinal {
3852 return Ok(());
3853 }
3854
3855 let cur_offset: usize = (1 - 1) * envelope_size;
3858
3859 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3861
3862 fidl::encoding::encode_in_envelope_optional::<f64, D>(
3867 self.local_x.as_ref().map(<f64 as fidl::encoding::ValueTypeMarker>::borrow),
3868 encoder,
3869 offset + cur_offset,
3870 depth,
3871 )?;
3872
3873 _prev_end_offset = cur_offset + envelope_size;
3874 if 2 > max_ordinal {
3875 return Ok(());
3876 }
3877
3878 let cur_offset: usize = (2 - 1) * envelope_size;
3881
3882 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3884
3885 fidl::encoding::encode_in_envelope_optional::<f64, D>(
3890 self.local_y.as_ref().map(<f64 as fidl::encoding::ValueTypeMarker>::borrow),
3891 encoder,
3892 offset + cur_offset,
3893 depth,
3894 )?;
3895
3896 _prev_end_offset = cur_offset + envelope_size;
3897 if 3 > max_ordinal {
3898 return Ok(());
3899 }
3900
3901 let cur_offset: usize = (3 - 1) * envelope_size;
3904
3905 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3907
3908 fidl::encoding::encode_in_envelope_optional::<i64, D>(
3913 self.time_received.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
3914 encoder,
3915 offset + cur_offset,
3916 depth,
3917 )?;
3918
3919 _prev_end_offset = cur_offset + envelope_size;
3920 if 4 > max_ordinal {
3921 return Ok(());
3922 }
3923
3924 let cur_offset: usize = (4 - 1) * envelope_size;
3927
3928 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3930
3931 fidl::encoding::encode_in_envelope_optional::<f64, D>(
3936 self.device_pixel_ratio
3937 .as_ref()
3938 .map(<f64 as fidl::encoding::ValueTypeMarker>::borrow),
3939 encoder,
3940 offset + cur_offset,
3941 depth,
3942 )?;
3943
3944 _prev_end_offset = cur_offset + envelope_size;
3945 if 5 > max_ordinal {
3946 return Ok(());
3947 }
3948
3949 let cur_offset: usize = (5 - 1) * envelope_size;
3952
3953 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3955
3956 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, D>(
3961 self.component_name.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
3962 encoder, offset + cur_offset, depth
3963 )?;
3964
3965 _prev_end_offset = cur_offset + envelope_size;
3966 if 6 > max_ordinal {
3967 return Ok(());
3968 }
3969
3970 let cur_offset: usize = (6 - 1) * envelope_size;
3973
3974 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3976
3977 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_ui_pointer__common::EventPhase, D>(
3982 self.phase.as_ref().map(<fidl_fuchsia_ui_pointer__common::EventPhase as fidl::encoding::ValueTypeMarker>::borrow),
3983 encoder, offset + cur_offset, depth
3984 )?;
3985
3986 _prev_end_offset = cur_offset + envelope_size;
3987 if 7 > max_ordinal {
3988 return Ok(());
3989 }
3990
3991 let cur_offset: usize = (7 - 1) * envelope_size;
3994
3995 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3997
3998 fidl::encoding::encode_in_envelope_optional::<u32, D>(
4003 self.pointer_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4004 encoder,
4005 offset + cur_offset,
4006 depth,
4007 )?;
4008
4009 _prev_end_offset = cur_offset + envelope_size;
4010 if 8 > max_ordinal {
4011 return Ok(());
4012 }
4013
4014 let cur_offset: usize = (8 - 1) * envelope_size;
4017
4018 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4020
4021 fidl::encoding::encode_in_envelope_optional::<u32, D>(
4026 self.device_id.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4027 encoder,
4028 offset + cur_offset,
4029 depth,
4030 )?;
4031
4032 _prev_end_offset = cur_offset + envelope_size;
4033
4034 Ok(())
4035 }
4036 }
4037
4038 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4039 for TouchInputListenerReportTouchInputRequest
4040 {
4041 #[inline(always)]
4042 fn new_empty() -> Self {
4043 Self::default()
4044 }
4045
4046 unsafe fn decode(
4047 &mut self,
4048 decoder: &mut fidl::encoding::Decoder<'_, D>,
4049 offset: usize,
4050 mut depth: fidl::encoding::Depth,
4051 ) -> fidl::Result<()> {
4052 decoder.debug_check_bounds::<Self>(offset);
4053 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4054 None => return Err(fidl::Error::NotNullable),
4055 Some(len) => len,
4056 };
4057 if len == 0 {
4059 return Ok(());
4060 };
4061 depth.increment()?;
4062 let envelope_size = 8;
4063 let bytes_len = len * envelope_size;
4064 let offset = decoder.out_of_line_offset(bytes_len)?;
4065 let mut _next_ordinal_to_read = 0;
4067 let mut next_offset = offset;
4068 let end_offset = offset + bytes_len;
4069 _next_ordinal_to_read += 1;
4070 if next_offset >= end_offset {
4071 return Ok(());
4072 }
4073
4074 while _next_ordinal_to_read < 1 {
4076 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4077 _next_ordinal_to_read += 1;
4078 next_offset += envelope_size;
4079 }
4080
4081 let next_out_of_line = decoder.next_out_of_line();
4082 let handles_before = decoder.remaining_handles();
4083 if let Some((inlined, num_bytes, num_handles)) =
4084 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4085 {
4086 let member_inline_size =
4087 <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4088 if inlined != (member_inline_size <= 4) {
4089 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4090 }
4091 let inner_offset;
4092 let mut inner_depth = depth.clone();
4093 if inlined {
4094 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4095 inner_offset = next_offset;
4096 } else {
4097 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4098 inner_depth.increment()?;
4099 }
4100 let val_ref = self.local_x.get_or_insert_with(|| fidl::new_empty!(f64, D));
4101 fidl::decode!(f64, D, val_ref, decoder, inner_offset, inner_depth)?;
4102 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4103 {
4104 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4105 }
4106 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4107 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4108 }
4109 }
4110
4111 next_offset += envelope_size;
4112 _next_ordinal_to_read += 1;
4113 if next_offset >= end_offset {
4114 return Ok(());
4115 }
4116
4117 while _next_ordinal_to_read < 2 {
4119 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4120 _next_ordinal_to_read += 1;
4121 next_offset += envelope_size;
4122 }
4123
4124 let next_out_of_line = decoder.next_out_of_line();
4125 let handles_before = decoder.remaining_handles();
4126 if let Some((inlined, num_bytes, num_handles)) =
4127 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4128 {
4129 let member_inline_size =
4130 <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4131 if inlined != (member_inline_size <= 4) {
4132 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4133 }
4134 let inner_offset;
4135 let mut inner_depth = depth.clone();
4136 if inlined {
4137 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4138 inner_offset = next_offset;
4139 } else {
4140 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4141 inner_depth.increment()?;
4142 }
4143 let val_ref = self.local_y.get_or_insert_with(|| fidl::new_empty!(f64, D));
4144 fidl::decode!(f64, D, val_ref, decoder, inner_offset, inner_depth)?;
4145 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4146 {
4147 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4148 }
4149 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4150 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4151 }
4152 }
4153
4154 next_offset += envelope_size;
4155 _next_ordinal_to_read += 1;
4156 if next_offset >= end_offset {
4157 return Ok(());
4158 }
4159
4160 while _next_ordinal_to_read < 3 {
4162 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4163 _next_ordinal_to_read += 1;
4164 next_offset += envelope_size;
4165 }
4166
4167 let next_out_of_line = decoder.next_out_of_line();
4168 let handles_before = decoder.remaining_handles();
4169 if let Some((inlined, num_bytes, num_handles)) =
4170 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4171 {
4172 let member_inline_size =
4173 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4174 if inlined != (member_inline_size <= 4) {
4175 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4176 }
4177 let inner_offset;
4178 let mut inner_depth = depth.clone();
4179 if inlined {
4180 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4181 inner_offset = next_offset;
4182 } else {
4183 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4184 inner_depth.increment()?;
4185 }
4186 let val_ref = self.time_received.get_or_insert_with(|| fidl::new_empty!(i64, D));
4187 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
4188 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4189 {
4190 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4191 }
4192 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4193 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4194 }
4195 }
4196
4197 next_offset += envelope_size;
4198 _next_ordinal_to_read += 1;
4199 if next_offset >= end_offset {
4200 return Ok(());
4201 }
4202
4203 while _next_ordinal_to_read < 4 {
4205 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4206 _next_ordinal_to_read += 1;
4207 next_offset += envelope_size;
4208 }
4209
4210 let next_out_of_line = decoder.next_out_of_line();
4211 let handles_before = decoder.remaining_handles();
4212 if let Some((inlined, num_bytes, num_handles)) =
4213 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4214 {
4215 let member_inline_size =
4216 <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4217 if inlined != (member_inline_size <= 4) {
4218 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4219 }
4220 let inner_offset;
4221 let mut inner_depth = depth.clone();
4222 if inlined {
4223 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4224 inner_offset = next_offset;
4225 } else {
4226 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4227 inner_depth.increment()?;
4228 }
4229 let val_ref =
4230 self.device_pixel_ratio.get_or_insert_with(|| fidl::new_empty!(f64, D));
4231 fidl::decode!(f64, D, val_ref, decoder, inner_offset, inner_depth)?;
4232 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4233 {
4234 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4235 }
4236 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4237 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4238 }
4239 }
4240
4241 next_offset += envelope_size;
4242 _next_ordinal_to_read += 1;
4243 if next_offset >= end_offset {
4244 return Ok(());
4245 }
4246
4247 while _next_ordinal_to_read < 5 {
4249 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4250 _next_ordinal_to_read += 1;
4251 next_offset += envelope_size;
4252 }
4253
4254 let next_out_of_line = decoder.next_out_of_line();
4255 let handles_before = decoder.remaining_handles();
4256 if let Some((inlined, num_bytes, num_handles)) =
4257 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4258 {
4259 let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4260 if inlined != (member_inline_size <= 4) {
4261 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4262 }
4263 let inner_offset;
4264 let mut inner_depth = depth.clone();
4265 if inlined {
4266 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4267 inner_offset = next_offset;
4268 } else {
4269 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4270 inner_depth.increment()?;
4271 }
4272 let val_ref = self.component_name.get_or_insert_with(|| {
4273 fidl::new_empty!(fidl::encoding::BoundedString<1024>, D)
4274 });
4275 fidl::decode!(
4276 fidl::encoding::BoundedString<1024>,
4277 D,
4278 val_ref,
4279 decoder,
4280 inner_offset,
4281 inner_depth
4282 )?;
4283 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4284 {
4285 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4286 }
4287 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4288 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4289 }
4290 }
4291
4292 next_offset += envelope_size;
4293 _next_ordinal_to_read += 1;
4294 if next_offset >= end_offset {
4295 return Ok(());
4296 }
4297
4298 while _next_ordinal_to_read < 6 {
4300 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4301 _next_ordinal_to_read += 1;
4302 next_offset += envelope_size;
4303 }
4304
4305 let next_out_of_line = decoder.next_out_of_line();
4306 let handles_before = decoder.remaining_handles();
4307 if let Some((inlined, num_bytes, num_handles)) =
4308 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4309 {
4310 let member_inline_size = <fidl_fuchsia_ui_pointer__common::EventPhase as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4311 if inlined != (member_inline_size <= 4) {
4312 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4313 }
4314 let inner_offset;
4315 let mut inner_depth = depth.clone();
4316 if inlined {
4317 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4318 inner_offset = next_offset;
4319 } else {
4320 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4321 inner_depth.increment()?;
4322 }
4323 let val_ref = self.phase.get_or_insert_with(|| {
4324 fidl::new_empty!(fidl_fuchsia_ui_pointer__common::EventPhase, D)
4325 });
4326 fidl::decode!(
4327 fidl_fuchsia_ui_pointer__common::EventPhase,
4328 D,
4329 val_ref,
4330 decoder,
4331 inner_offset,
4332 inner_depth
4333 )?;
4334 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4335 {
4336 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4337 }
4338 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4339 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4340 }
4341 }
4342
4343 next_offset += envelope_size;
4344 _next_ordinal_to_read += 1;
4345 if next_offset >= end_offset {
4346 return Ok(());
4347 }
4348
4349 while _next_ordinal_to_read < 7 {
4351 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4352 _next_ordinal_to_read += 1;
4353 next_offset += envelope_size;
4354 }
4355
4356 let next_out_of_line = decoder.next_out_of_line();
4357 let handles_before = decoder.remaining_handles();
4358 if let Some((inlined, num_bytes, num_handles)) =
4359 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4360 {
4361 let member_inline_size =
4362 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4363 if inlined != (member_inline_size <= 4) {
4364 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4365 }
4366 let inner_offset;
4367 let mut inner_depth = depth.clone();
4368 if inlined {
4369 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4370 inner_offset = next_offset;
4371 } else {
4372 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4373 inner_depth.increment()?;
4374 }
4375 let val_ref = self.pointer_id.get_or_insert_with(|| fidl::new_empty!(u32, D));
4376 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
4377 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4378 {
4379 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4380 }
4381 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4382 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4383 }
4384 }
4385
4386 next_offset += envelope_size;
4387 _next_ordinal_to_read += 1;
4388 if next_offset >= end_offset {
4389 return Ok(());
4390 }
4391
4392 while _next_ordinal_to_read < 8 {
4394 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4395 _next_ordinal_to_read += 1;
4396 next_offset += envelope_size;
4397 }
4398
4399 let next_out_of_line = decoder.next_out_of_line();
4400 let handles_before = decoder.remaining_handles();
4401 if let Some((inlined, num_bytes, num_handles)) =
4402 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4403 {
4404 let member_inline_size =
4405 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4406 if inlined != (member_inline_size <= 4) {
4407 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4408 }
4409 let inner_offset;
4410 let mut inner_depth = depth.clone();
4411 if inlined {
4412 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4413 inner_offset = next_offset;
4414 } else {
4415 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4416 inner_depth.increment()?;
4417 }
4418 let val_ref = self.device_id.get_or_insert_with(|| fidl::new_empty!(u32, D));
4419 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
4420 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4421 {
4422 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4423 }
4424 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4425 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4426 }
4427 }
4428
4429 next_offset += envelope_size;
4430
4431 while next_offset < end_offset {
4433 _next_ordinal_to_read += 1;
4434 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4435 next_offset += envelope_size;
4436 }
4437
4438 Ok(())
4439 }
4440 }
4441
4442 impl TouchScreenSimulateMultiFingerGestureRequest {
4443 #[inline(always)]
4444 fn max_ordinal_present(&self) -> u64 {
4445 if let Some(_) = self.finger_count {
4446 return 4;
4447 }
4448 if let Some(_) = self.move_event_count {
4449 return 3;
4450 }
4451 if let Some(_) = self.end_locations {
4452 return 2;
4453 }
4454 if let Some(_) = self.start_locations {
4455 return 1;
4456 }
4457 0
4458 }
4459 }
4460
4461 impl fidl::encoding::ValueTypeMarker for TouchScreenSimulateMultiFingerGestureRequest {
4462 type Borrowed<'a> = &'a Self;
4463 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4464 value
4465 }
4466 }
4467
4468 unsafe impl fidl::encoding::TypeMarker for TouchScreenSimulateMultiFingerGestureRequest {
4469 type Owned = Self;
4470
4471 #[inline(always)]
4472 fn inline_align(_context: fidl::encoding::Context) -> usize {
4473 8
4474 }
4475
4476 #[inline(always)]
4477 fn inline_size(_context: fidl::encoding::Context) -> usize {
4478 16
4479 }
4480 }
4481
4482 unsafe impl<D: fidl::encoding::ResourceDialect>
4483 fidl::encoding::Encode<TouchScreenSimulateMultiFingerGestureRequest, D>
4484 for &TouchScreenSimulateMultiFingerGestureRequest
4485 {
4486 unsafe fn encode(
4487 self,
4488 encoder: &mut fidl::encoding::Encoder<'_, D>,
4489 offset: usize,
4490 mut depth: fidl::encoding::Depth,
4491 ) -> fidl::Result<()> {
4492 encoder.debug_check_bounds::<TouchScreenSimulateMultiFingerGestureRequest>(offset);
4493 let max_ordinal: u64 = self.max_ordinal_present();
4495 encoder.write_num(max_ordinal, offset);
4496 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4497 if max_ordinal == 0 {
4499 return Ok(());
4500 }
4501 depth.increment()?;
4502 let envelope_size = 8;
4503 let bytes_len = max_ordinal as usize * envelope_size;
4504 #[allow(unused_variables)]
4505 let offset = encoder.out_of_line_offset(bytes_len);
4506 let mut _prev_end_offset: usize = 0;
4507 if 1 > max_ordinal {
4508 return Ok(());
4509 }
4510
4511 let cur_offset: usize = (1 - 1) * envelope_size;
4514
4515 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4517
4518 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<fidl_fuchsia_math__common::Vec_, 10>, D>(
4523 self.start_locations.as_ref().map(<fidl::encoding::Array<fidl_fuchsia_math__common::Vec_, 10> as fidl::encoding::ValueTypeMarker>::borrow),
4524 encoder, offset + cur_offset, depth
4525 )?;
4526
4527 _prev_end_offset = cur_offset + envelope_size;
4528 if 2 > max_ordinal {
4529 return Ok(());
4530 }
4531
4532 let cur_offset: usize = (2 - 1) * envelope_size;
4535
4536 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4538
4539 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<fidl_fuchsia_math__common::Vec_, 10>, D>(
4544 self.end_locations.as_ref().map(<fidl::encoding::Array<fidl_fuchsia_math__common::Vec_, 10> as fidl::encoding::ValueTypeMarker>::borrow),
4545 encoder, offset + cur_offset, depth
4546 )?;
4547
4548 _prev_end_offset = cur_offset + envelope_size;
4549 if 3 > max_ordinal {
4550 return Ok(());
4551 }
4552
4553 let cur_offset: usize = (3 - 1) * envelope_size;
4556
4557 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4559
4560 fidl::encoding::encode_in_envelope_optional::<u32, D>(
4565 self.move_event_count
4566 .as_ref()
4567 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4568 encoder,
4569 offset + cur_offset,
4570 depth,
4571 )?;
4572
4573 _prev_end_offset = cur_offset + envelope_size;
4574 if 4 > max_ordinal {
4575 return Ok(());
4576 }
4577
4578 let cur_offset: usize = (4 - 1) * envelope_size;
4581
4582 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4584
4585 fidl::encoding::encode_in_envelope_optional::<u32, D>(
4590 self.finger_count.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
4591 encoder,
4592 offset + cur_offset,
4593 depth,
4594 )?;
4595
4596 _prev_end_offset = cur_offset + envelope_size;
4597
4598 Ok(())
4599 }
4600 }
4601
4602 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4603 for TouchScreenSimulateMultiFingerGestureRequest
4604 {
4605 #[inline(always)]
4606 fn new_empty() -> Self {
4607 Self::default()
4608 }
4609
4610 unsafe fn decode(
4611 &mut self,
4612 decoder: &mut fidl::encoding::Decoder<'_, D>,
4613 offset: usize,
4614 mut depth: fidl::encoding::Depth,
4615 ) -> fidl::Result<()> {
4616 decoder.debug_check_bounds::<Self>(offset);
4617 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4618 None => return Err(fidl::Error::NotNullable),
4619 Some(len) => len,
4620 };
4621 if len == 0 {
4623 return Ok(());
4624 };
4625 depth.increment()?;
4626 let envelope_size = 8;
4627 let bytes_len = len * envelope_size;
4628 let offset = decoder.out_of_line_offset(bytes_len)?;
4629 let mut _next_ordinal_to_read = 0;
4631 let mut next_offset = offset;
4632 let end_offset = offset + bytes_len;
4633 _next_ordinal_to_read += 1;
4634 if next_offset >= end_offset {
4635 return Ok(());
4636 }
4637
4638 while _next_ordinal_to_read < 1 {
4640 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4641 _next_ordinal_to_read += 1;
4642 next_offset += envelope_size;
4643 }
4644
4645 let next_out_of_line = decoder.next_out_of_line();
4646 let handles_before = decoder.remaining_handles();
4647 if let Some((inlined, num_bytes, num_handles)) =
4648 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4649 {
4650 let member_inline_size = <fidl::encoding::Array<fidl_fuchsia_math__common::Vec_, 10> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4651 if inlined != (member_inline_size <= 4) {
4652 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4653 }
4654 let inner_offset;
4655 let mut inner_depth = depth.clone();
4656 if inlined {
4657 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4658 inner_offset = next_offset;
4659 } else {
4660 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4661 inner_depth.increment()?;
4662 }
4663 let val_ref =
4664 self.start_locations.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<fidl_fuchsia_math__common::Vec_, 10>, D));
4665 fidl::decode!(fidl::encoding::Array<fidl_fuchsia_math__common::Vec_, 10>, D, val_ref, decoder, inner_offset, inner_depth)?;
4666 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4667 {
4668 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4669 }
4670 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4671 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4672 }
4673 }
4674
4675 next_offset += envelope_size;
4676 _next_ordinal_to_read += 1;
4677 if next_offset >= end_offset {
4678 return Ok(());
4679 }
4680
4681 while _next_ordinal_to_read < 2 {
4683 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4684 _next_ordinal_to_read += 1;
4685 next_offset += envelope_size;
4686 }
4687
4688 let next_out_of_line = decoder.next_out_of_line();
4689 let handles_before = decoder.remaining_handles();
4690 if let Some((inlined, num_bytes, num_handles)) =
4691 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4692 {
4693 let member_inline_size = <fidl::encoding::Array<fidl_fuchsia_math__common::Vec_, 10> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4694 if inlined != (member_inline_size <= 4) {
4695 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4696 }
4697 let inner_offset;
4698 let mut inner_depth = depth.clone();
4699 if inlined {
4700 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4701 inner_offset = next_offset;
4702 } else {
4703 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4704 inner_depth.increment()?;
4705 }
4706 let val_ref =
4707 self.end_locations.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<fidl_fuchsia_math__common::Vec_, 10>, D));
4708 fidl::decode!(fidl::encoding::Array<fidl_fuchsia_math__common::Vec_, 10>, D, val_ref, decoder, inner_offset, inner_depth)?;
4709 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4710 {
4711 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4712 }
4713 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4714 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4715 }
4716 }
4717
4718 next_offset += envelope_size;
4719 _next_ordinal_to_read += 1;
4720 if next_offset >= end_offset {
4721 return Ok(());
4722 }
4723
4724 while _next_ordinal_to_read < 3 {
4726 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4727 _next_ordinal_to_read += 1;
4728 next_offset += envelope_size;
4729 }
4730
4731 let next_out_of_line = decoder.next_out_of_line();
4732 let handles_before = decoder.remaining_handles();
4733 if let Some((inlined, num_bytes, num_handles)) =
4734 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4735 {
4736 let member_inline_size =
4737 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4738 if inlined != (member_inline_size <= 4) {
4739 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4740 }
4741 let inner_offset;
4742 let mut inner_depth = depth.clone();
4743 if inlined {
4744 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4745 inner_offset = next_offset;
4746 } else {
4747 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4748 inner_depth.increment()?;
4749 }
4750 let val_ref = self.move_event_count.get_or_insert_with(|| fidl::new_empty!(u32, D));
4751 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
4752 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4753 {
4754 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4755 }
4756 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4757 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4758 }
4759 }
4760
4761 next_offset += envelope_size;
4762 _next_ordinal_to_read += 1;
4763 if next_offset >= end_offset {
4764 return Ok(());
4765 }
4766
4767 while _next_ordinal_to_read < 4 {
4769 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4770 _next_ordinal_to_read += 1;
4771 next_offset += envelope_size;
4772 }
4773
4774 let next_out_of_line = decoder.next_out_of_line();
4775 let handles_before = decoder.remaining_handles();
4776 if let Some((inlined, num_bytes, num_handles)) =
4777 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4778 {
4779 let member_inline_size =
4780 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4781 if inlined != (member_inline_size <= 4) {
4782 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4783 }
4784 let inner_offset;
4785 let mut inner_depth = depth.clone();
4786 if inlined {
4787 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4788 inner_offset = next_offset;
4789 } else {
4790 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4791 inner_depth.increment()?;
4792 }
4793 let val_ref = self.finger_count.get_or_insert_with(|| fidl::new_empty!(u32, D));
4794 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
4795 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4796 {
4797 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4798 }
4799 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4800 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4801 }
4802 }
4803
4804 next_offset += envelope_size;
4805
4806 while next_offset < end_offset {
4808 _next_ordinal_to_read += 1;
4809 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4810 next_offset += envelope_size;
4811 }
4812
4813 Ok(())
4814 }
4815 }
4816
4817 impl TouchScreenSimulateMultiTapRequest {
4818 #[inline(always)]
4819 fn max_ordinal_present(&self) -> u64 {
4820 if let Some(_) = self.tap_locations {
4821 return 1;
4822 }
4823 0
4824 }
4825 }
4826
4827 impl fidl::encoding::ValueTypeMarker for TouchScreenSimulateMultiTapRequest {
4828 type Borrowed<'a> = &'a Self;
4829 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4830 value
4831 }
4832 }
4833
4834 unsafe impl fidl::encoding::TypeMarker for TouchScreenSimulateMultiTapRequest {
4835 type Owned = Self;
4836
4837 #[inline(always)]
4838 fn inline_align(_context: fidl::encoding::Context) -> usize {
4839 8
4840 }
4841
4842 #[inline(always)]
4843 fn inline_size(_context: fidl::encoding::Context) -> usize {
4844 16
4845 }
4846 }
4847
4848 unsafe impl<D: fidl::encoding::ResourceDialect>
4849 fidl::encoding::Encode<TouchScreenSimulateMultiTapRequest, D>
4850 for &TouchScreenSimulateMultiTapRequest
4851 {
4852 unsafe fn encode(
4853 self,
4854 encoder: &mut fidl::encoding::Encoder<'_, D>,
4855 offset: usize,
4856 mut depth: fidl::encoding::Depth,
4857 ) -> fidl::Result<()> {
4858 encoder.debug_check_bounds::<TouchScreenSimulateMultiTapRequest>(offset);
4859 let max_ordinal: u64 = self.max_ordinal_present();
4861 encoder.write_num(max_ordinal, offset);
4862 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4863 if max_ordinal == 0 {
4865 return Ok(());
4866 }
4867 depth.increment()?;
4868 let envelope_size = 8;
4869 let bytes_len = max_ordinal as usize * envelope_size;
4870 #[allow(unused_variables)]
4871 let offset = encoder.out_of_line_offset(bytes_len);
4872 let mut _prev_end_offset: usize = 0;
4873 if 1 > max_ordinal {
4874 return Ok(());
4875 }
4876
4877 let cur_offset: usize = (1 - 1) * envelope_size;
4880
4881 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4883
4884 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_math__common::Vec_, 10>, D>(
4889 self.tap_locations.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_math__common::Vec_, 10> as fidl::encoding::ValueTypeMarker>::borrow),
4890 encoder, offset + cur_offset, depth
4891 )?;
4892
4893 _prev_end_offset = cur_offset + envelope_size;
4894
4895 Ok(())
4896 }
4897 }
4898
4899 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4900 for TouchScreenSimulateMultiTapRequest
4901 {
4902 #[inline(always)]
4903 fn new_empty() -> Self {
4904 Self::default()
4905 }
4906
4907 unsafe fn decode(
4908 &mut self,
4909 decoder: &mut fidl::encoding::Decoder<'_, D>,
4910 offset: usize,
4911 mut depth: fidl::encoding::Depth,
4912 ) -> fidl::Result<()> {
4913 decoder.debug_check_bounds::<Self>(offset);
4914 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4915 None => return Err(fidl::Error::NotNullable),
4916 Some(len) => len,
4917 };
4918 if len == 0 {
4920 return Ok(());
4921 };
4922 depth.increment()?;
4923 let envelope_size = 8;
4924 let bytes_len = len * envelope_size;
4925 let offset = decoder.out_of_line_offset(bytes_len)?;
4926 let mut _next_ordinal_to_read = 0;
4928 let mut next_offset = offset;
4929 let end_offset = offset + bytes_len;
4930 _next_ordinal_to_read += 1;
4931 if next_offset >= end_offset {
4932 return Ok(());
4933 }
4934
4935 while _next_ordinal_to_read < 1 {
4937 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4938 _next_ordinal_to_read += 1;
4939 next_offset += envelope_size;
4940 }
4941
4942 let next_out_of_line = decoder.next_out_of_line();
4943 let handles_before = decoder.remaining_handles();
4944 if let Some((inlined, num_bytes, num_handles)) =
4945 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4946 {
4947 let member_inline_size = <fidl::encoding::Vector<
4948 fidl_fuchsia_math__common::Vec_,
4949 10,
4950 > as fidl::encoding::TypeMarker>::inline_size(
4951 decoder.context
4952 );
4953 if inlined != (member_inline_size <= 4) {
4954 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4955 }
4956 let inner_offset;
4957 let mut inner_depth = depth.clone();
4958 if inlined {
4959 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4960 inner_offset = next_offset;
4961 } else {
4962 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4963 inner_depth.increment()?;
4964 }
4965 let val_ref =
4966 self.tap_locations.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_math__common::Vec_, 10>, D));
4967 fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_math__common::Vec_, 10>, D, val_ref, decoder, inner_offset, inner_depth)?;
4968 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4969 {
4970 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4971 }
4972 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4973 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4974 }
4975 }
4976
4977 next_offset += envelope_size;
4978
4979 while next_offset < end_offset {
4981 _next_ordinal_to_read += 1;
4982 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4983 next_offset += envelope_size;
4984 }
4985
4986 Ok(())
4987 }
4988 }
4989
4990 impl TouchScreenSimulateSwipeRequest {
4991 #[inline(always)]
4992 fn max_ordinal_present(&self) -> u64 {
4993 if let Some(_) = self.duration {
4994 return 4;
4995 }
4996 if let Some(_) = self.move_event_count {
4997 return 3;
4998 }
4999 if let Some(_) = self.end_location {
5000 return 2;
5001 }
5002 if let Some(_) = self.start_location {
5003 return 1;
5004 }
5005 0
5006 }
5007 }
5008
5009 impl fidl::encoding::ValueTypeMarker for TouchScreenSimulateSwipeRequest {
5010 type Borrowed<'a> = &'a Self;
5011 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5012 value
5013 }
5014 }
5015
5016 unsafe impl fidl::encoding::TypeMarker for TouchScreenSimulateSwipeRequest {
5017 type Owned = Self;
5018
5019 #[inline(always)]
5020 fn inline_align(_context: fidl::encoding::Context) -> usize {
5021 8
5022 }
5023
5024 #[inline(always)]
5025 fn inline_size(_context: fidl::encoding::Context) -> usize {
5026 16
5027 }
5028 }
5029
5030 unsafe impl<D: fidl::encoding::ResourceDialect>
5031 fidl::encoding::Encode<TouchScreenSimulateSwipeRequest, D>
5032 for &TouchScreenSimulateSwipeRequest
5033 {
5034 unsafe fn encode(
5035 self,
5036 encoder: &mut fidl::encoding::Encoder<'_, D>,
5037 offset: usize,
5038 mut depth: fidl::encoding::Depth,
5039 ) -> fidl::Result<()> {
5040 encoder.debug_check_bounds::<TouchScreenSimulateSwipeRequest>(offset);
5041 let max_ordinal: u64 = self.max_ordinal_present();
5043 encoder.write_num(max_ordinal, offset);
5044 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5045 if max_ordinal == 0 {
5047 return Ok(());
5048 }
5049 depth.increment()?;
5050 let envelope_size = 8;
5051 let bytes_len = max_ordinal as usize * envelope_size;
5052 #[allow(unused_variables)]
5053 let offset = encoder.out_of_line_offset(bytes_len);
5054 let mut _prev_end_offset: usize = 0;
5055 if 1 > max_ordinal {
5056 return Ok(());
5057 }
5058
5059 let cur_offset: usize = (1 - 1) * envelope_size;
5062
5063 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5065
5066 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math__common::Vec_, D>(
5071 self.start_location.as_ref().map(
5072 <fidl_fuchsia_math__common::Vec_ as fidl::encoding::ValueTypeMarker>::borrow,
5073 ),
5074 encoder,
5075 offset + cur_offset,
5076 depth,
5077 )?;
5078
5079 _prev_end_offset = cur_offset + envelope_size;
5080 if 2 > max_ordinal {
5081 return Ok(());
5082 }
5083
5084 let cur_offset: usize = (2 - 1) * envelope_size;
5087
5088 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5090
5091 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math__common::Vec_, D>(
5096 self.end_location.as_ref().map(
5097 <fidl_fuchsia_math__common::Vec_ as fidl::encoding::ValueTypeMarker>::borrow,
5098 ),
5099 encoder,
5100 offset + cur_offset,
5101 depth,
5102 )?;
5103
5104 _prev_end_offset = cur_offset + envelope_size;
5105 if 3 > max_ordinal {
5106 return Ok(());
5107 }
5108
5109 let cur_offset: usize = (3 - 1) * envelope_size;
5112
5113 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5115
5116 fidl::encoding::encode_in_envelope_optional::<u32, D>(
5121 self.move_event_count
5122 .as_ref()
5123 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
5124 encoder,
5125 offset + cur_offset,
5126 depth,
5127 )?;
5128
5129 _prev_end_offset = cur_offset + envelope_size;
5130 if 4 > max_ordinal {
5131 return Ok(());
5132 }
5133
5134 let cur_offset: usize = (4 - 1) * envelope_size;
5137
5138 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5140
5141 fidl::encoding::encode_in_envelope_optional::<i64, D>(
5146 self.duration.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
5147 encoder,
5148 offset + cur_offset,
5149 depth,
5150 )?;
5151
5152 _prev_end_offset = cur_offset + envelope_size;
5153
5154 Ok(())
5155 }
5156 }
5157
5158 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5159 for TouchScreenSimulateSwipeRequest
5160 {
5161 #[inline(always)]
5162 fn new_empty() -> Self {
5163 Self::default()
5164 }
5165
5166 unsafe fn decode(
5167 &mut self,
5168 decoder: &mut fidl::encoding::Decoder<'_, D>,
5169 offset: usize,
5170 mut depth: fidl::encoding::Depth,
5171 ) -> fidl::Result<()> {
5172 decoder.debug_check_bounds::<Self>(offset);
5173 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5174 None => return Err(fidl::Error::NotNullable),
5175 Some(len) => len,
5176 };
5177 if len == 0 {
5179 return Ok(());
5180 };
5181 depth.increment()?;
5182 let envelope_size = 8;
5183 let bytes_len = len * envelope_size;
5184 let offset = decoder.out_of_line_offset(bytes_len)?;
5185 let mut _next_ordinal_to_read = 0;
5187 let mut next_offset = offset;
5188 let end_offset = offset + bytes_len;
5189 _next_ordinal_to_read += 1;
5190 if next_offset >= end_offset {
5191 return Ok(());
5192 }
5193
5194 while _next_ordinal_to_read < 1 {
5196 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5197 _next_ordinal_to_read += 1;
5198 next_offset += envelope_size;
5199 }
5200
5201 let next_out_of_line = decoder.next_out_of_line();
5202 let handles_before = decoder.remaining_handles();
5203 if let Some((inlined, num_bytes, num_handles)) =
5204 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5205 {
5206 let member_inline_size =
5207 <fidl_fuchsia_math__common::Vec_ as fidl::encoding::TypeMarker>::inline_size(
5208 decoder.context,
5209 );
5210 if inlined != (member_inline_size <= 4) {
5211 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5212 }
5213 let inner_offset;
5214 let mut inner_depth = depth.clone();
5215 if inlined {
5216 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5217 inner_offset = next_offset;
5218 } else {
5219 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5220 inner_depth.increment()?;
5221 }
5222 let val_ref = self
5223 .start_location
5224 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math__common::Vec_, D));
5225 fidl::decode!(
5226 fidl_fuchsia_math__common::Vec_,
5227 D,
5228 val_ref,
5229 decoder,
5230 inner_offset,
5231 inner_depth
5232 )?;
5233 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5234 {
5235 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5236 }
5237 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5238 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5239 }
5240 }
5241
5242 next_offset += envelope_size;
5243 _next_ordinal_to_read += 1;
5244 if next_offset >= end_offset {
5245 return Ok(());
5246 }
5247
5248 while _next_ordinal_to_read < 2 {
5250 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5251 _next_ordinal_to_read += 1;
5252 next_offset += envelope_size;
5253 }
5254
5255 let next_out_of_line = decoder.next_out_of_line();
5256 let handles_before = decoder.remaining_handles();
5257 if let Some((inlined, num_bytes, num_handles)) =
5258 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5259 {
5260 let member_inline_size =
5261 <fidl_fuchsia_math__common::Vec_ as fidl::encoding::TypeMarker>::inline_size(
5262 decoder.context,
5263 );
5264 if inlined != (member_inline_size <= 4) {
5265 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5266 }
5267 let inner_offset;
5268 let mut inner_depth = depth.clone();
5269 if inlined {
5270 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5271 inner_offset = next_offset;
5272 } else {
5273 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5274 inner_depth.increment()?;
5275 }
5276 let val_ref = self
5277 .end_location
5278 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math__common::Vec_, D));
5279 fidl::decode!(
5280 fidl_fuchsia_math__common::Vec_,
5281 D,
5282 val_ref,
5283 decoder,
5284 inner_offset,
5285 inner_depth
5286 )?;
5287 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5288 {
5289 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5290 }
5291 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5292 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5293 }
5294 }
5295
5296 next_offset += envelope_size;
5297 _next_ordinal_to_read += 1;
5298 if next_offset >= end_offset {
5299 return Ok(());
5300 }
5301
5302 while _next_ordinal_to_read < 3 {
5304 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5305 _next_ordinal_to_read += 1;
5306 next_offset += envelope_size;
5307 }
5308
5309 let next_out_of_line = decoder.next_out_of_line();
5310 let handles_before = decoder.remaining_handles();
5311 if let Some((inlined, num_bytes, num_handles)) =
5312 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5313 {
5314 let member_inline_size =
5315 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5316 if inlined != (member_inline_size <= 4) {
5317 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5318 }
5319 let inner_offset;
5320 let mut inner_depth = depth.clone();
5321 if inlined {
5322 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5323 inner_offset = next_offset;
5324 } else {
5325 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5326 inner_depth.increment()?;
5327 }
5328 let val_ref = self.move_event_count.get_or_insert_with(|| fidl::new_empty!(u32, D));
5329 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
5330 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5331 {
5332 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5333 }
5334 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5335 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5336 }
5337 }
5338
5339 next_offset += envelope_size;
5340 _next_ordinal_to_read += 1;
5341 if next_offset >= end_offset {
5342 return Ok(());
5343 }
5344
5345 while _next_ordinal_to_read < 4 {
5347 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5348 _next_ordinal_to_read += 1;
5349 next_offset += envelope_size;
5350 }
5351
5352 let next_out_of_line = decoder.next_out_of_line();
5353 let handles_before = decoder.remaining_handles();
5354 if let Some((inlined, num_bytes, num_handles)) =
5355 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5356 {
5357 let member_inline_size =
5358 <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5359 if inlined != (member_inline_size <= 4) {
5360 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5361 }
5362 let inner_offset;
5363 let mut inner_depth = depth.clone();
5364 if inlined {
5365 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5366 inner_offset = next_offset;
5367 } else {
5368 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5369 inner_depth.increment()?;
5370 }
5371 let val_ref = self.duration.get_or_insert_with(|| fidl::new_empty!(i64, D));
5372 fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
5373 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5374 {
5375 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5376 }
5377 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5378 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5379 }
5380 }
5381
5382 next_offset += envelope_size;
5383
5384 while next_offset < end_offset {
5386 _next_ordinal_to_read += 1;
5387 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5388 next_offset += envelope_size;
5389 }
5390
5391 Ok(())
5392 }
5393 }
5394
5395 impl TouchScreenSimulateTapRequest {
5396 #[inline(always)]
5397 fn max_ordinal_present(&self) -> u64 {
5398 if let Some(_) = self.tap_location {
5399 return 1;
5400 }
5401 0
5402 }
5403 }
5404
5405 impl fidl::encoding::ValueTypeMarker for TouchScreenSimulateTapRequest {
5406 type Borrowed<'a> = &'a Self;
5407 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5408 value
5409 }
5410 }
5411
5412 unsafe impl fidl::encoding::TypeMarker for TouchScreenSimulateTapRequest {
5413 type Owned = Self;
5414
5415 #[inline(always)]
5416 fn inline_align(_context: fidl::encoding::Context) -> usize {
5417 8
5418 }
5419
5420 #[inline(always)]
5421 fn inline_size(_context: fidl::encoding::Context) -> usize {
5422 16
5423 }
5424 }
5425
5426 unsafe impl<D: fidl::encoding::ResourceDialect>
5427 fidl::encoding::Encode<TouchScreenSimulateTapRequest, D>
5428 for &TouchScreenSimulateTapRequest
5429 {
5430 unsafe fn encode(
5431 self,
5432 encoder: &mut fidl::encoding::Encoder<'_, D>,
5433 offset: usize,
5434 mut depth: fidl::encoding::Depth,
5435 ) -> fidl::Result<()> {
5436 encoder.debug_check_bounds::<TouchScreenSimulateTapRequest>(offset);
5437 let max_ordinal: u64 = self.max_ordinal_present();
5439 encoder.write_num(max_ordinal, offset);
5440 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5441 if max_ordinal == 0 {
5443 return Ok(());
5444 }
5445 depth.increment()?;
5446 let envelope_size = 8;
5447 let bytes_len = max_ordinal as usize * envelope_size;
5448 #[allow(unused_variables)]
5449 let offset = encoder.out_of_line_offset(bytes_len);
5450 let mut _prev_end_offset: usize = 0;
5451 if 1 > max_ordinal {
5452 return Ok(());
5453 }
5454
5455 let cur_offset: usize = (1 - 1) * envelope_size;
5458
5459 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5461
5462 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math__common::Vec_, D>(
5467 self.tap_location.as_ref().map(
5468 <fidl_fuchsia_math__common::Vec_ as fidl::encoding::ValueTypeMarker>::borrow,
5469 ),
5470 encoder,
5471 offset + cur_offset,
5472 depth,
5473 )?;
5474
5475 _prev_end_offset = cur_offset + envelope_size;
5476
5477 Ok(())
5478 }
5479 }
5480
5481 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5482 for TouchScreenSimulateTapRequest
5483 {
5484 #[inline(always)]
5485 fn new_empty() -> Self {
5486 Self::default()
5487 }
5488
5489 unsafe fn decode(
5490 &mut self,
5491 decoder: &mut fidl::encoding::Decoder<'_, D>,
5492 offset: usize,
5493 mut depth: fidl::encoding::Depth,
5494 ) -> fidl::Result<()> {
5495 decoder.debug_check_bounds::<Self>(offset);
5496 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5497 None => return Err(fidl::Error::NotNullable),
5498 Some(len) => len,
5499 };
5500 if len == 0 {
5502 return Ok(());
5503 };
5504 depth.increment()?;
5505 let envelope_size = 8;
5506 let bytes_len = len * envelope_size;
5507 let offset = decoder.out_of_line_offset(bytes_len)?;
5508 let mut _next_ordinal_to_read = 0;
5510 let mut next_offset = offset;
5511 let end_offset = offset + bytes_len;
5512 _next_ordinal_to_read += 1;
5513 if next_offset >= end_offset {
5514 return Ok(());
5515 }
5516
5517 while _next_ordinal_to_read < 1 {
5519 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5520 _next_ordinal_to_read += 1;
5521 next_offset += envelope_size;
5522 }
5523
5524 let next_out_of_line = decoder.next_out_of_line();
5525 let handles_before = decoder.remaining_handles();
5526 if let Some((inlined, num_bytes, num_handles)) =
5527 fidl::encoding::decode_envelope_header(decoder, next_offset)?
5528 {
5529 let member_inline_size =
5530 <fidl_fuchsia_math__common::Vec_ as fidl::encoding::TypeMarker>::inline_size(
5531 decoder.context,
5532 );
5533 if inlined != (member_inline_size <= 4) {
5534 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5535 }
5536 let inner_offset;
5537 let mut inner_depth = depth.clone();
5538 if inlined {
5539 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5540 inner_offset = next_offset;
5541 } else {
5542 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5543 inner_depth.increment()?;
5544 }
5545 let val_ref = self
5546 .tap_location
5547 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math__common::Vec_, D));
5548 fidl::decode!(
5549 fidl_fuchsia_math__common::Vec_,
5550 D,
5551 val_ref,
5552 decoder,
5553 inner_offset,
5554 inner_depth
5555 )?;
5556 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5557 {
5558 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5559 }
5560 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5561 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5562 }
5563 }
5564
5565 next_offset += envelope_size;
5566
5567 while next_offset < end_offset {
5569 _next_ordinal_to_read += 1;
5570 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5571 next_offset += envelope_size;
5572 }
5573
5574 Ok(())
5575 }
5576 }
5577}