Skip to main content

fidl_next_fuchsia_input_report/
fidl_next_fuchsia_input_report.rs

1// DO NOT EDIT: This file is machine-generated by fidlgen
2#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7    pub use fidl_next_common_fuchsia_input_report::natural::*;
8
9    pub type Axis = ::fidl_next_fuchsia_input::natural::Axis;
10
11    pub type ConsumerControlButton = ::fidl_next_fuchsia_input::natural::ConsumerControlButton;
12
13    #[derive(Debug, PartialEq)]
14    #[repr(C)]
15    pub struct InputDeviceGetInputReportsReaderRequest {
16        pub reader:
17            ::fidl_next::ServerEnd<crate::InputReportsReader, ::fidl_next::fuchsia::zx::Channel>,
18    }
19
20    unsafe impl<___E>
21        ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportsReaderRequest, ___E>
22        for InputDeviceGetInputReportsReaderRequest
23    where
24        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
25        ___E: ::fidl_next::fuchsia::HandleEncoder,
26    {
27        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
28            Self,
29            crate::wire::InputDeviceGetInputReportsReaderRequest,
30        > = unsafe {
31            ::fidl_next::CopyOptimization::enable_if(
32                true && <::fidl_next::ServerEnd<
33                    crate::InputReportsReader,
34                    ::fidl_next::fuchsia::zx::Channel,
35                > as ::fidl_next::Encode<
36                    ::fidl_next::ServerEnd<
37                        crate::InputReportsReader,
38                        ::fidl_next::wire::fuchsia::Channel,
39                    >,
40                    ___E,
41                >>::COPY_OPTIMIZATION
42                    .is_enabled(),
43            )
44        };
45
46        #[inline]
47        fn encode(
48            self,
49            encoder_: &mut ___E,
50            out_: &mut ::core::mem::MaybeUninit<
51                crate::wire::InputDeviceGetInputReportsReaderRequest,
52            >,
53            _: (),
54        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
55            ::fidl_next::munge! {
56                let crate::wire::InputDeviceGetInputReportsReaderRequest {
57                    reader,
58
59                } = out_;
60            }
61
62            ::fidl_next::Encode::encode(self.reader, encoder_, reader, ())?;
63
64            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(reader.as_mut_ptr()) };
65
66            Ok(())
67        }
68    }
69
70    unsafe impl<___E>
71        ::fidl_next::EncodeOption<
72            ::fidl_next::wire::Box<'static, crate::wire::InputDeviceGetInputReportsReaderRequest>,
73            ___E,
74        > for InputDeviceGetInputReportsReaderRequest
75    where
76        ___E: ::fidl_next::Encoder + ?Sized,
77        InputDeviceGetInputReportsReaderRequest:
78            ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportsReaderRequest, ___E>,
79    {
80        #[inline]
81        fn encode_option(
82            this: ::core::option::Option<Self>,
83            encoder: &mut ___E,
84            out: &mut ::core::mem::MaybeUninit<
85                ::fidl_next::wire::Box<
86                    'static,
87                    crate::wire::InputDeviceGetInputReportsReaderRequest,
88                >,
89            >,
90            _: (),
91        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
92            if let Some(inner) = this {
93                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
94                ::fidl_next::wire::Box::encode_present(out);
95            } else {
96                ::fidl_next::wire::Box::encode_absent(out);
97            }
98
99            Ok(())
100        }
101    }
102
103    impl ::fidl_next::FromWire<crate::wire::InputDeviceGetInputReportsReaderRequest>
104        for InputDeviceGetInputReportsReaderRequest
105    {
106        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
107            crate::wire::InputDeviceGetInputReportsReaderRequest,
108            Self,
109        > = unsafe {
110            ::fidl_next::CopyOptimization::enable_if(
111                true && <::fidl_next::ServerEnd<
112                    crate::InputReportsReader,
113                    ::fidl_next::fuchsia::zx::Channel,
114                > as ::fidl_next::FromWire<
115                    ::fidl_next::ServerEnd<
116                        crate::InputReportsReader,
117                        ::fidl_next::wire::fuchsia::Channel,
118                    >,
119                >>::COPY_OPTIMIZATION
120                    .is_enabled(),
121            )
122        };
123
124        #[inline]
125        fn from_wire(wire: crate::wire::InputDeviceGetInputReportsReaderRequest) -> Self {
126            Self { reader: ::fidl_next::FromWire::from_wire(wire.reader) }
127        }
128    }
129
130    #[derive(Debug, PartialEq)]
131    pub struct InputDeviceGetInputReportsReaderV2Request {
132        pub reader:
133            ::fidl_next::ServerEnd<crate::InputReportsReaderV2, ::fidl_next::fuchsia::zx::Channel>,
134
135        pub max_unacknowledged_reports_limit: u16,
136    }
137
138    unsafe impl<___E>
139        ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportsReaderV2Request, ___E>
140        for InputDeviceGetInputReportsReaderV2Request
141    where
142        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
143        ___E: ::fidl_next::fuchsia::HandleEncoder,
144    {
145        #[inline]
146        fn encode(
147            self,
148            encoder_: &mut ___E,
149            out_: &mut ::core::mem::MaybeUninit<
150                crate::wire::InputDeviceGetInputReportsReaderV2Request,
151            >,
152            _: (),
153        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
154            ::fidl_next::munge! {
155                let crate::wire::InputDeviceGetInputReportsReaderV2Request {
156                    reader,
157                    max_unacknowledged_reports_limit,
158
159                } = out_;
160            }
161
162            ::fidl_next::Encode::encode(self.reader, encoder_, reader, ())?;
163
164            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(reader.as_mut_ptr()) };
165
166            ::fidl_next::Encode::encode(
167                self.max_unacknowledged_reports_limit,
168                encoder_,
169                max_unacknowledged_reports_limit,
170                (),
171            )?;
172
173            let mut _field = unsafe {
174                ::fidl_next::Slot::new_unchecked(max_unacknowledged_reports_limit.as_mut_ptr())
175            };
176
177            Ok(())
178        }
179    }
180
181    unsafe impl<___E>
182        ::fidl_next::EncodeOption<
183            ::fidl_next::wire::Box<'static, crate::wire::InputDeviceGetInputReportsReaderV2Request>,
184            ___E,
185        > for InputDeviceGetInputReportsReaderV2Request
186    where
187        ___E: ::fidl_next::Encoder + ?Sized,
188        InputDeviceGetInputReportsReaderV2Request:
189            ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportsReaderV2Request, ___E>,
190    {
191        #[inline]
192        fn encode_option(
193            this: ::core::option::Option<Self>,
194            encoder: &mut ___E,
195            out: &mut ::core::mem::MaybeUninit<
196                ::fidl_next::wire::Box<
197                    'static,
198                    crate::wire::InputDeviceGetInputReportsReaderV2Request,
199                >,
200            >,
201            _: (),
202        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
203            if let Some(inner) = this {
204                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
205                ::fidl_next::wire::Box::encode_present(out);
206            } else {
207                ::fidl_next::wire::Box::encode_absent(out);
208            }
209
210            Ok(())
211        }
212    }
213
214    impl ::fidl_next::FromWire<crate::wire::InputDeviceGetInputReportsReaderV2Request>
215        for InputDeviceGetInputReportsReaderV2Request
216    {
217        #[inline]
218        fn from_wire(wire: crate::wire::InputDeviceGetInputReportsReaderV2Request) -> Self {
219            Self {
220                reader: ::fidl_next::FromWire::from_wire(wire.reader),
221
222                max_unacknowledged_reports_limit: ::fidl_next::FromWire::from_wire(
223                    wire.max_unacknowledged_reports_limit,
224                ),
225            }
226        }
227    }
228
229    #[doc = " An `InputReport` is a single report that is created by an input device.\n An `InputReport` can contain one of many different report types. The report\n types are not mutually exclusive. The `event_time` is the time in\n nanoseconds when the report was generated.\n"]
230    #[derive(Debug, Default, PartialEq)]
231    pub struct InputReport {
232        pub event_time: ::core::option::Option<i64>,
233
234        pub mouse: ::core::option::Option<crate::natural::MouseInputReport>,
235
236        pub trace_id: ::core::option::Option<u64>,
237
238        pub sensor: ::core::option::Option<crate::natural::SensorInputReport>,
239
240        pub touch: ::core::option::Option<crate::natural::TouchInputReport>,
241
242        pub keyboard: ::core::option::Option<crate::natural::KeyboardInputReport>,
243
244        pub consumer_control: ::core::option::Option<crate::natural::ConsumerControlInputReport>,
245
246        pub report_id: ::core::option::Option<u8>,
247
248        pub wake_lease: ::core::option::Option<::fidl_next::fuchsia::zx::EventPair>,
249    }
250
251    impl InputReport {
252        fn __max_ordinal(&self) -> usize {
253            if self.wake_lease.is_some() {
254                return 9;
255            }
256
257            if self.report_id.is_some() {
258                return 8;
259            }
260
261            if self.consumer_control.is_some() {
262                return 7;
263            }
264
265            if self.keyboard.is_some() {
266                return 6;
267            }
268
269            if self.touch.is_some() {
270                return 5;
271            }
272
273            if self.sensor.is_some() {
274                return 4;
275            }
276
277            if self.trace_id.is_some() {
278                return 3;
279            }
280
281            if self.mouse.is_some() {
282                return 2;
283            }
284
285            if self.event_time.is_some() {
286                return 1;
287            }
288
289            0
290        }
291    }
292
293    unsafe impl<___E> ::fidl_next::Encode<crate::wire::InputReport<'static>, ___E> for InputReport
294    where
295        ___E: ::fidl_next::Encoder + ?Sized,
296        ___E: ::fidl_next::fuchsia::HandleEncoder,
297    {
298        #[inline]
299        fn encode(
300            mut self,
301            encoder: &mut ___E,
302            out: &mut ::core::mem::MaybeUninit<crate::wire::InputReport<'static>>,
303            _: (),
304        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
305            ::fidl_next::munge!(let crate::wire::InputReport { table } = out);
306
307            let max_ord = self.__max_ordinal();
308
309            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
310            ::fidl_next::Wire::zero_padding(&mut out);
311
312            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
313                ::fidl_next::wire::Envelope,
314            >(encoder, max_ord);
315
316            for i in 1..=max_ord {
317                match i {
318                    9 => {
319                        if let Some(value) = self.wake_lease.take() {
320                            ::fidl_next::wire::Envelope::encode_value::<
321                                ::fidl_next::wire::fuchsia::EventPair,
322                                ___E,
323                            >(
324                                value, preallocated.encoder, &mut out, ()
325                            )?;
326                        } else {
327                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
328                        }
329                    }
330
331                    8 => {
332                        if let Some(value) = self.report_id.take() {
333                            ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
334                                value,
335                                preallocated.encoder,
336                                &mut out,
337                                (),
338                            )?;
339                        } else {
340                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
341                        }
342                    }
343
344                    7 => {
345                        if let Some(value) = self.consumer_control.take() {
346                            ::fidl_next::wire::Envelope::encode_value::<
347                                crate::wire::ConsumerControlInputReport<'static>,
348                                ___E,
349                            >(
350                                value, preallocated.encoder, &mut out, ()
351                            )?;
352                        } else {
353                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
354                        }
355                    }
356
357                    6 => {
358                        if let Some(value) = self.keyboard.take() {
359                            ::fidl_next::wire::Envelope::encode_value::<
360                                crate::wire::KeyboardInputReport<'static>,
361                                ___E,
362                            >(
363                                value, preallocated.encoder, &mut out, ()
364                            )?;
365                        } else {
366                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
367                        }
368                    }
369
370                    5 => {
371                        if let Some(value) = self.touch.take() {
372                            ::fidl_next::wire::Envelope::encode_value::<
373                                crate::wire::TouchInputReport<'static>,
374                                ___E,
375                            >(
376                                value, preallocated.encoder, &mut out, ()
377                            )?;
378                        } else {
379                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
380                        }
381                    }
382
383                    4 => {
384                        if let Some(value) = self.sensor.take() {
385                            ::fidl_next::wire::Envelope::encode_value::<
386                                crate::wire::SensorInputReport<'static>,
387                                ___E,
388                            >(
389                                value, preallocated.encoder, &mut out, ()
390                            )?;
391                        } else {
392                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
393                        }
394                    }
395
396                    3 => {
397                        if let Some(value) = self.trace_id.take() {
398                            ::fidl_next::wire::Envelope::encode_value::<
399                                ::fidl_next::wire::Uint64,
400                                ___E,
401                            >(
402                                value, preallocated.encoder, &mut out, ()
403                            )?;
404                        } else {
405                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
406                        }
407                    }
408
409                    2 => {
410                        if let Some(value) = self.mouse.take() {
411                            ::fidl_next::wire::Envelope::encode_value::<
412                                crate::wire::MouseInputReport<'static>,
413                                ___E,
414                            >(
415                                value, preallocated.encoder, &mut out, ()
416                            )?;
417                        } else {
418                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
419                        }
420                    }
421
422                    1 => {
423                        if let Some(value) = self.event_time.take() {
424                            ::fidl_next::wire::Envelope::encode_value::<
425                                ::fidl_next::wire::Int64,
426                                ___E,
427                            >(
428                                value, preallocated.encoder, &mut out, ()
429                            )?;
430                        } else {
431                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
432                        }
433                    }
434
435                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
436                }
437                unsafe {
438                    preallocated.write_next(out.assume_init_ref());
439                }
440            }
441
442            ::fidl_next::wire::Table::encode_len(table, max_ord);
443
444            Ok(())
445        }
446    }
447
448    impl<'de> ::fidl_next::FromWire<crate::wire::InputReport<'de>> for InputReport {
449        #[inline]
450        fn from_wire(wire_: crate::wire::InputReport<'de>) -> Self {
451            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
452
453            let event_time = wire_.table.get(1);
454
455            let mouse = wire_.table.get(2);
456
457            let trace_id = wire_.table.get(3);
458
459            let sensor = wire_.table.get(4);
460
461            let touch = wire_.table.get(5);
462
463            let keyboard = wire_.table.get(6);
464
465            let consumer_control = wire_.table.get(7);
466
467            let report_id = wire_.table.get(8);
468
469            let wake_lease = wire_.table.get(9);
470
471            Self {
472                event_time: event_time.map(|envelope| {
473                    ::fidl_next::FromWire::from_wire(unsafe {
474                        envelope.read_unchecked::<::fidl_next::wire::Int64>()
475                    })
476                }),
477
478                mouse: mouse.map(|envelope| {
479                    ::fidl_next::FromWire::from_wire(unsafe {
480                        envelope.read_unchecked::<crate::wire::MouseInputReport<'de>>()
481                    })
482                }),
483
484                trace_id: trace_id.map(|envelope| {
485                    ::fidl_next::FromWire::from_wire(unsafe {
486                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
487                    })
488                }),
489
490                sensor: sensor.map(|envelope| {
491                    ::fidl_next::FromWire::from_wire(unsafe {
492                        envelope.read_unchecked::<crate::wire::SensorInputReport<'de>>()
493                    })
494                }),
495
496                touch: touch.map(|envelope| {
497                    ::fidl_next::FromWire::from_wire(unsafe {
498                        envelope.read_unchecked::<crate::wire::TouchInputReport<'de>>()
499                    })
500                }),
501
502                keyboard: keyboard.map(|envelope| {
503                    ::fidl_next::FromWire::from_wire(unsafe {
504                        envelope.read_unchecked::<crate::wire::KeyboardInputReport<'de>>()
505                    })
506                }),
507
508                consumer_control: consumer_control.map(|envelope| {
509                    ::fidl_next::FromWire::from_wire(unsafe {
510                        envelope.read_unchecked::<crate::wire::ConsumerControlInputReport<'de>>()
511                    })
512                }),
513
514                report_id: report_id.map(|envelope| {
515                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<u8>() })
516                }),
517
518                wake_lease: wake_lease.map(|envelope| {
519                    ::fidl_next::FromWire::from_wire(unsafe {
520                        envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
521                    })
522                }),
523            }
524        }
525    }
526
527    #[derive(Debug, PartialEq)]
528    pub struct InputDeviceGetInputReportResponse {
529        pub report: crate::natural::InputReport,
530    }
531
532    unsafe impl<___E>
533        ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportResponse<'static>, ___E>
534        for InputDeviceGetInputReportResponse
535    where
536        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
537        ___E: ::fidl_next::Encoder,
538        ___E: ::fidl_next::fuchsia::HandleEncoder,
539    {
540        #[inline]
541        fn encode(
542            self,
543            encoder_: &mut ___E,
544            out_: &mut ::core::mem::MaybeUninit<
545                crate::wire::InputDeviceGetInputReportResponse<'static>,
546            >,
547            _: (),
548        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
549            ::fidl_next::munge! {
550                let crate::wire::InputDeviceGetInputReportResponse {
551                    report,
552
553                } = out_;
554            }
555
556            ::fidl_next::Encode::encode(self.report, encoder_, report, ())?;
557
558            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(report.as_mut_ptr()) };
559
560            Ok(())
561        }
562    }
563
564    unsafe impl<___E>
565        ::fidl_next::EncodeOption<
566            ::fidl_next::wire::Box<
567                'static,
568                crate::wire::InputDeviceGetInputReportResponse<'static>,
569            >,
570            ___E,
571        > for InputDeviceGetInputReportResponse
572    where
573        ___E: ::fidl_next::Encoder + ?Sized,
574        InputDeviceGetInputReportResponse:
575            ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportResponse<'static>, ___E>,
576    {
577        #[inline]
578        fn encode_option(
579            this: ::core::option::Option<Self>,
580            encoder: &mut ___E,
581            out: &mut ::core::mem::MaybeUninit<
582                ::fidl_next::wire::Box<
583                    'static,
584                    crate::wire::InputDeviceGetInputReportResponse<'static>,
585                >,
586            >,
587            _: (),
588        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
589            if let Some(inner) = this {
590                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
591                ::fidl_next::wire::Box::encode_present(out);
592            } else {
593                ::fidl_next::wire::Box::encode_absent(out);
594            }
595
596            Ok(())
597        }
598    }
599
600    impl<'de> ::fidl_next::FromWire<crate::wire::InputDeviceGetInputReportResponse<'de>>
601        for InputDeviceGetInputReportResponse
602    {
603        #[inline]
604        fn from_wire(wire: crate::wire::InputDeviceGetInputReportResponse<'de>) -> Self {
605            Self { report: ::fidl_next::FromWire::from_wire(wire.report) }
606        }
607    }
608
609    #[derive(Debug, PartialEq)]
610    pub struct InputReportsReaderReadInputReportsResponse {
611        pub reports: ::std::vec::Vec<crate::natural::InputReport>,
612    }
613
614    unsafe impl<___E>
615        ::fidl_next::Encode<crate::wire::InputReportsReaderReadInputReportsResponse<'static>, ___E>
616        for InputReportsReaderReadInputReportsResponse
617    where
618        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
619        ___E: ::fidl_next::Encoder,
620        ___E: ::fidl_next::fuchsia::HandleEncoder,
621    {
622        #[inline]
623        fn encode(
624            self,
625            encoder_: &mut ___E,
626            out_: &mut ::core::mem::MaybeUninit<
627                crate::wire::InputReportsReaderReadInputReportsResponse<'static>,
628            >,
629            _: (),
630        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
631            ::fidl_next::munge! {
632                let crate::wire::InputReportsReaderReadInputReportsResponse {
633                    reports,
634
635                } = out_;
636            }
637
638            ::fidl_next::Encode::encode(self.reports, encoder_, reports, (50, ()))?;
639
640            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(reports.as_mut_ptr()) };
641            ::fidl_next::Constrained::validate(_field, (50, ()))?;
642
643            Ok(())
644        }
645    }
646
647    unsafe impl<___E>
648        ::fidl_next::EncodeOption<
649            ::fidl_next::wire::Box<
650                'static,
651                crate::wire::InputReportsReaderReadInputReportsResponse<'static>,
652            >,
653            ___E,
654        > for InputReportsReaderReadInputReportsResponse
655    where
656        ___E: ::fidl_next::Encoder + ?Sized,
657        InputReportsReaderReadInputReportsResponse: ::fidl_next::Encode<
658                crate::wire::InputReportsReaderReadInputReportsResponse<'static>,
659                ___E,
660            >,
661    {
662        #[inline]
663        fn encode_option(
664            this: ::core::option::Option<Self>,
665            encoder: &mut ___E,
666            out: &mut ::core::mem::MaybeUninit<
667                ::fidl_next::wire::Box<
668                    'static,
669                    crate::wire::InputReportsReaderReadInputReportsResponse<'static>,
670                >,
671            >,
672            _: (),
673        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
674            if let Some(inner) = this {
675                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
676                ::fidl_next::wire::Box::encode_present(out);
677            } else {
678                ::fidl_next::wire::Box::encode_absent(out);
679            }
680
681            Ok(())
682        }
683    }
684
685    impl<'de> ::fidl_next::FromWire<crate::wire::InputReportsReaderReadInputReportsResponse<'de>>
686        for InputReportsReaderReadInputReportsResponse
687    {
688        #[inline]
689        fn from_wire(wire: crate::wire::InputReportsReaderReadInputReportsResponse<'de>) -> Self {
690            Self { reports: ::fidl_next::FromWire::from_wire(wire.reports) }
691        }
692    }
693
694    #[derive(Debug, PartialEq)]
695    pub struct InputReportsReaderV2OnInputReportsRequest {
696        pub reports: ::std::vec::Vec<crate::natural::InputReport>,
697
698        pub last_report_stamp: u64,
699    }
700
701    unsafe impl<___E>
702        ::fidl_next::Encode<crate::wire::InputReportsReaderV2OnInputReportsRequest<'static>, ___E>
703        for InputReportsReaderV2OnInputReportsRequest
704    where
705        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
706        ___E: ::fidl_next::Encoder,
707        ___E: ::fidl_next::fuchsia::HandleEncoder,
708    {
709        #[inline]
710        fn encode(
711            self,
712            encoder_: &mut ___E,
713            out_: &mut ::core::mem::MaybeUninit<
714                crate::wire::InputReportsReaderV2OnInputReportsRequest<'static>,
715            >,
716            _: (),
717        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
718            ::fidl_next::munge! {
719                let crate::wire::InputReportsReaderV2OnInputReportsRequest {
720                    reports,
721                    last_report_stamp,
722
723                } = out_;
724            }
725
726            ::fidl_next::Encode::encode(self.reports, encoder_, reports, (50, ()))?;
727
728            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(reports.as_mut_ptr()) };
729            ::fidl_next::Constrained::validate(_field, (50, ()))?;
730
731            ::fidl_next::Encode::encode(self.last_report_stamp, encoder_, last_report_stamp, ())?;
732
733            let mut _field =
734                unsafe { ::fidl_next::Slot::new_unchecked(last_report_stamp.as_mut_ptr()) };
735
736            Ok(())
737        }
738    }
739
740    unsafe impl<___E>
741        ::fidl_next::EncodeOption<
742            ::fidl_next::wire::Box<
743                'static,
744                crate::wire::InputReportsReaderV2OnInputReportsRequest<'static>,
745            >,
746            ___E,
747        > for InputReportsReaderV2OnInputReportsRequest
748    where
749        ___E: ::fidl_next::Encoder + ?Sized,
750        InputReportsReaderV2OnInputReportsRequest: ::fidl_next::Encode<
751                crate::wire::InputReportsReaderV2OnInputReportsRequest<'static>,
752                ___E,
753            >,
754    {
755        #[inline]
756        fn encode_option(
757            this: ::core::option::Option<Self>,
758            encoder: &mut ___E,
759            out: &mut ::core::mem::MaybeUninit<
760                ::fidl_next::wire::Box<
761                    'static,
762                    crate::wire::InputReportsReaderV2OnInputReportsRequest<'static>,
763                >,
764            >,
765            _: (),
766        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
767            if let Some(inner) = this {
768                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
769                ::fidl_next::wire::Box::encode_present(out);
770            } else {
771                ::fidl_next::wire::Box::encode_absent(out);
772            }
773
774            Ok(())
775        }
776    }
777
778    impl<'de> ::fidl_next::FromWire<crate::wire::InputReportsReaderV2OnInputReportsRequest<'de>>
779        for InputReportsReaderV2OnInputReportsRequest
780    {
781        #[inline]
782        fn from_wire(wire: crate::wire::InputReportsReaderV2OnInputReportsRequest<'de>) -> Self {
783            Self {
784                reports: ::fidl_next::FromWire::from_wire(wire.reports),
785
786                last_report_stamp: ::fidl_next::FromWire::from_wire(wire.last_report_stamp),
787            }
788        }
789    }
790
791    pub type Range = ::fidl_next_fuchsia_input::natural::Range;
792
793    pub type Unit = ::fidl_next_fuchsia_input::natural::Unit;
794
795    pub type UnitType = ::fidl_next_fuchsia_input::natural::UnitType;
796}
797
798pub mod wire {
799
800    pub use fidl_next_common_fuchsia_input_report::wire::*;
801
802    /// The wire type corresponding to [`Axis`](crate::natural::Axis).
803    pub type Axis = ::fidl_next_fuchsia_input::wire::Axis;
804
805    /// The wire type corresponding to [`ConsumerControlButton`](crate::natural::ConsumerControlButton).
806    pub type ConsumerControlButton = ::fidl_next_fuchsia_input::wire::ConsumerControlButton;
807
808    /// The wire type corresponding to [`InputDeviceGetInputReportsReaderRequest`].
809    #[derive(Debug)]
810    #[repr(C)]
811    pub struct InputDeviceGetInputReportsReaderRequest {
812        pub reader:
813            ::fidl_next::ServerEnd<crate::InputReportsReader, ::fidl_next::wire::fuchsia::Channel>,
814    }
815
816    static_assertions::const_assert_eq!(
817        std::mem::size_of::<InputDeviceGetInputReportsReaderRequest>(),
818        4
819    );
820    static_assertions::const_assert_eq!(
821        std::mem::align_of::<InputDeviceGetInputReportsReaderRequest>(),
822        4
823    );
824
825    static_assertions::const_assert_eq!(
826        std::mem::offset_of!(InputDeviceGetInputReportsReaderRequest, reader),
827        0
828    );
829
830    impl ::fidl_next::Constrained for InputDeviceGetInputReportsReaderRequest {
831        type Constraint = ();
832
833        fn validate(
834            _: ::fidl_next::Slot<'_, Self>,
835            _: Self::Constraint,
836        ) -> Result<(), ::fidl_next::ValidationError> {
837            Ok(())
838        }
839    }
840
841    unsafe impl ::fidl_next::Wire for InputDeviceGetInputReportsReaderRequest {
842        type Narrowed<'de> = InputDeviceGetInputReportsReaderRequest;
843
844        #[inline]
845        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
846            ::fidl_next::munge! {
847                let Self {
848                    reader,
849
850                } = &mut *out_;
851            }
852
853            ::fidl_next::Wire::zero_padding(reader);
854        }
855    }
856
857    unsafe impl<___D> ::fidl_next::Decode<___D> for InputDeviceGetInputReportsReaderRequest
858    where
859        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
860        ___D: ::fidl_next::fuchsia::HandleDecoder,
861    {
862        fn decode(
863            slot_: ::fidl_next::Slot<'_, Self>,
864            decoder_: &mut ___D,
865            _: (),
866        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
867            ::fidl_next::munge! {
868                let Self {
869                    mut reader,
870
871                } = slot_;
872            }
873
874            let _field = reader.as_mut();
875
876            ::fidl_next::Decode::decode(reader.as_mut(), decoder_, ())?;
877
878            Ok(())
879        }
880    }
881
882    impl ::fidl_next::IntoNatural for InputDeviceGetInputReportsReaderRequest {
883        type Natural = crate::natural::InputDeviceGetInputReportsReaderRequest;
884    }
885
886    /// The wire type corresponding to [`InputDeviceGetInputReportsReaderV2Request`].
887    #[derive(Debug)]
888    #[repr(C)]
889    pub struct InputDeviceGetInputReportsReaderV2Request {
890        pub reader: ::fidl_next::ServerEnd<
891            crate::InputReportsReaderV2,
892            ::fidl_next::wire::fuchsia::Channel,
893        >,
894
895        pub max_unacknowledged_reports_limit: ::fidl_next::wire::Uint16,
896    }
897
898    static_assertions::const_assert_eq!(
899        std::mem::size_of::<InputDeviceGetInputReportsReaderV2Request>(),
900        8
901    );
902    static_assertions::const_assert_eq!(
903        std::mem::align_of::<InputDeviceGetInputReportsReaderV2Request>(),
904        4
905    );
906
907    static_assertions::const_assert_eq!(
908        std::mem::offset_of!(InputDeviceGetInputReportsReaderV2Request, reader),
909        0
910    );
911
912    static_assertions::const_assert_eq!(
913        std::mem::offset_of!(
914            InputDeviceGetInputReportsReaderV2Request,
915            max_unacknowledged_reports_limit
916        ),
917        4
918    );
919
920    impl ::fidl_next::Constrained for InputDeviceGetInputReportsReaderV2Request {
921        type Constraint = ();
922
923        fn validate(
924            _: ::fidl_next::Slot<'_, Self>,
925            _: Self::Constraint,
926        ) -> Result<(), ::fidl_next::ValidationError> {
927            Ok(())
928        }
929    }
930
931    unsafe impl ::fidl_next::Wire for InputDeviceGetInputReportsReaderV2Request {
932        type Narrowed<'de> = InputDeviceGetInputReportsReaderV2Request;
933
934        #[inline]
935        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
936            ::fidl_next::munge! {
937                let Self {
938                    reader,
939                    max_unacknowledged_reports_limit,
940
941                } = &mut *out_;
942            }
943
944            ::fidl_next::Wire::zero_padding(reader);
945
946            ::fidl_next::Wire::zero_padding(max_unacknowledged_reports_limit);
947
948            unsafe {
949                out_.as_mut_ptr().cast::<u8>().add(6).write_bytes(0, 2);
950            }
951        }
952    }
953
954    unsafe impl<___D> ::fidl_next::Decode<___D> for InputDeviceGetInputReportsReaderV2Request
955    where
956        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
957        ___D: ::fidl_next::fuchsia::HandleDecoder,
958    {
959        fn decode(
960            slot_: ::fidl_next::Slot<'_, Self>,
961            decoder_: &mut ___D,
962            _: (),
963        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
964            if slot_.as_bytes()[6..8] != [0u8; 2] {
965                return Err(::fidl_next::DecodeError::InvalidPadding);
966            }
967
968            ::fidl_next::munge! {
969                let Self {
970                    mut reader,
971                    mut max_unacknowledged_reports_limit,
972
973                } = slot_;
974            }
975
976            let _field = reader.as_mut();
977
978            ::fidl_next::Decode::decode(reader.as_mut(), decoder_, ())?;
979
980            let _field = max_unacknowledged_reports_limit.as_mut();
981
982            ::fidl_next::Decode::decode(max_unacknowledged_reports_limit.as_mut(), decoder_, ())?;
983
984            Ok(())
985        }
986    }
987
988    impl ::fidl_next::IntoNatural for InputDeviceGetInputReportsReaderV2Request {
989        type Natural = crate::natural::InputDeviceGetInputReportsReaderV2Request;
990    }
991
992    /// The wire type corresponding to [`InputReport`].
993    #[repr(C)]
994    pub struct InputReport<'de> {
995        pub(crate) table: ::fidl_next::wire::Table<'de>,
996    }
997
998    impl<'de> Drop for InputReport<'de> {
999        fn drop(&mut self) {
1000            let _ = self
1001                .table
1002                .get(1)
1003                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Int64>() });
1004
1005            let _ = self.table.get(2).map(|envelope| unsafe {
1006                envelope.read_unchecked::<crate::wire::MouseInputReport<'de>>()
1007            });
1008
1009            let _ = self
1010                .table
1011                .get(3)
1012                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
1013
1014            let _ = self.table.get(4).map(|envelope| unsafe {
1015                envelope.read_unchecked::<crate::wire::SensorInputReport<'de>>()
1016            });
1017
1018            let _ = self.table.get(5).map(|envelope| unsafe {
1019                envelope.read_unchecked::<crate::wire::TouchInputReport<'de>>()
1020            });
1021
1022            let _ = self.table.get(6).map(|envelope| unsafe {
1023                envelope.read_unchecked::<crate::wire::KeyboardInputReport<'de>>()
1024            });
1025
1026            let _ = self.table.get(7).map(|envelope| unsafe {
1027                envelope.read_unchecked::<crate::wire::ConsumerControlInputReport<'de>>()
1028            });
1029
1030            let _ = self.table.get(8).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
1031
1032            let _ = self.table.get(9).map(|envelope| unsafe {
1033                envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
1034            });
1035        }
1036    }
1037
1038    impl ::fidl_next::Constrained for InputReport<'_> {
1039        type Constraint = ();
1040
1041        fn validate(
1042            _: ::fidl_next::Slot<'_, Self>,
1043            _: Self::Constraint,
1044        ) -> Result<(), ::fidl_next::ValidationError> {
1045            Ok(())
1046        }
1047    }
1048
1049    unsafe impl ::fidl_next::Wire for InputReport<'static> {
1050        type Narrowed<'de> = InputReport<'de>;
1051
1052        #[inline]
1053        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1054            ::fidl_next::munge!(let Self { table } = out);
1055            ::fidl_next::wire::Table::zero_padding(table);
1056        }
1057    }
1058
1059    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for InputReport<'de>
1060    where
1061        ___D: ::fidl_next::Decoder<'de> + ?Sized,
1062        ___D: ::fidl_next::fuchsia::HandleDecoder,
1063    {
1064        fn decode(
1065            slot: ::fidl_next::Slot<'_, Self>,
1066            decoder: &mut ___D,
1067            _: (),
1068        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1069            ::fidl_next::munge!(let Self { table } = slot);
1070
1071            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1072                match ordinal {
1073                    0 => unsafe { ::core::hint::unreachable_unchecked() },
1074
1075                    1 => {
1076                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Int64>(
1077                            slot.as_mut(),
1078                            decoder,
1079                            (),
1080                        )?;
1081
1082                        Ok(())
1083                    }
1084
1085                    2 => {
1086                        ::fidl_next::wire::Envelope::decode_as::<
1087                            ___D,
1088                            crate::wire::MouseInputReport<'de>,
1089                        >(slot.as_mut(), decoder, ())?;
1090
1091                        Ok(())
1092                    }
1093
1094                    3 => {
1095                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
1096                            slot.as_mut(),
1097                            decoder,
1098                            (),
1099                        )?;
1100
1101                        Ok(())
1102                    }
1103
1104                    4 => {
1105                        ::fidl_next::wire::Envelope::decode_as::<
1106                            ___D,
1107                            crate::wire::SensorInputReport<'de>,
1108                        >(slot.as_mut(), decoder, ())?;
1109
1110                        Ok(())
1111                    }
1112
1113                    5 => {
1114                        ::fidl_next::wire::Envelope::decode_as::<
1115                            ___D,
1116                            crate::wire::TouchInputReport<'de>,
1117                        >(slot.as_mut(), decoder, ())?;
1118
1119                        Ok(())
1120                    }
1121
1122                    6 => {
1123                        ::fidl_next::wire::Envelope::decode_as::<
1124                            ___D,
1125                            crate::wire::KeyboardInputReport<'de>,
1126                        >(slot.as_mut(), decoder, ())?;
1127
1128                        Ok(())
1129                    }
1130
1131                    7 => {
1132                        ::fidl_next::wire::Envelope::decode_as::<
1133                            ___D,
1134                            crate::wire::ConsumerControlInputReport<'de>,
1135                        >(slot.as_mut(), decoder, ())?;
1136
1137                        Ok(())
1138                    }
1139
1140                    8 => {
1141                        ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
1142                            slot.as_mut(),
1143                            decoder,
1144                            (),
1145                        )?;
1146
1147                        Ok(())
1148                    }
1149
1150                    9 => {
1151                        ::fidl_next::wire::Envelope::decode_as::<
1152                            ___D,
1153                            ::fidl_next::wire::fuchsia::EventPair,
1154                        >(slot.as_mut(), decoder, ())?;
1155
1156                        Ok(())
1157                    }
1158
1159                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1160                }
1161            })
1162        }
1163    }
1164
1165    impl<'de> InputReport<'de> {
1166        pub fn event_time(&self) -> ::core::option::Option<&::fidl_next::wire::Int64> {
1167            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1168        }
1169
1170        pub fn take_event_time(&mut self) -> ::core::option::Option<::fidl_next::wire::Int64> {
1171            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1172        }
1173
1174        pub fn mouse(&self) -> ::core::option::Option<&crate::wire::MouseInputReport<'de>> {
1175            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1176        }
1177
1178        pub fn take_mouse(&mut self) -> ::core::option::Option<crate::wire::MouseInputReport<'de>> {
1179            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
1180        }
1181
1182        pub fn trace_id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
1183            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
1184        }
1185
1186        pub fn take_trace_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
1187            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
1188        }
1189
1190        pub fn sensor(&self) -> ::core::option::Option<&crate::wire::SensorInputReport<'de>> {
1191            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
1192        }
1193
1194        pub fn take_sensor(
1195            &mut self,
1196        ) -> ::core::option::Option<crate::wire::SensorInputReport<'de>> {
1197            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
1198        }
1199
1200        pub fn touch(&self) -> ::core::option::Option<&crate::wire::TouchInputReport<'de>> {
1201            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
1202        }
1203
1204        pub fn take_touch(&mut self) -> ::core::option::Option<crate::wire::TouchInputReport<'de>> {
1205            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
1206        }
1207
1208        pub fn keyboard(&self) -> ::core::option::Option<&crate::wire::KeyboardInputReport<'de>> {
1209            unsafe { Some(self.table.get(6)?.deref_unchecked()) }
1210        }
1211
1212        pub fn take_keyboard(
1213            &mut self,
1214        ) -> ::core::option::Option<crate::wire::KeyboardInputReport<'de>> {
1215            unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
1216        }
1217
1218        pub fn consumer_control(
1219            &self,
1220        ) -> ::core::option::Option<&crate::wire::ConsumerControlInputReport<'de>> {
1221            unsafe { Some(self.table.get(7)?.deref_unchecked()) }
1222        }
1223
1224        pub fn take_consumer_control(
1225            &mut self,
1226        ) -> ::core::option::Option<crate::wire::ConsumerControlInputReport<'de>> {
1227            unsafe { Some(self.table.get_mut(7)?.take_unchecked()) }
1228        }
1229
1230        pub fn report_id(&self) -> ::core::option::Option<&u8> {
1231            unsafe { Some(self.table.get(8)?.deref_unchecked()) }
1232        }
1233
1234        pub fn take_report_id(&mut self) -> ::core::option::Option<u8> {
1235            unsafe { Some(self.table.get_mut(8)?.take_unchecked()) }
1236        }
1237
1238        pub fn wake_lease(&self) -> ::core::option::Option<&::fidl_next::wire::fuchsia::EventPair> {
1239            unsafe { Some(self.table.get(9)?.deref_unchecked()) }
1240        }
1241
1242        pub fn take_wake_lease(
1243            &mut self,
1244        ) -> ::core::option::Option<::fidl_next::wire::fuchsia::EventPair> {
1245            unsafe { Some(self.table.get_mut(9)?.take_unchecked()) }
1246        }
1247    }
1248
1249    impl<'de> ::core::fmt::Debug for InputReport<'de> {
1250        fn fmt(
1251            &self,
1252            f: &mut ::core::fmt::Formatter<'_>,
1253        ) -> ::core::result::Result<(), ::core::fmt::Error> {
1254            f.debug_struct("InputReport")
1255                .field("event_time", &self.event_time())
1256                .field("mouse", &self.mouse())
1257                .field("trace_id", &self.trace_id())
1258                .field("sensor", &self.sensor())
1259                .field("touch", &self.touch())
1260                .field("keyboard", &self.keyboard())
1261                .field("consumer_control", &self.consumer_control())
1262                .field("report_id", &self.report_id())
1263                .field("wake_lease", &self.wake_lease())
1264                .finish()
1265        }
1266    }
1267
1268    impl<'de> ::fidl_next::IntoNatural for InputReport<'de> {
1269        type Natural = crate::natural::InputReport;
1270    }
1271
1272    /// The wire type corresponding to [`InputDeviceGetInputReportResponse`].
1273    #[derive(Debug)]
1274    #[repr(C)]
1275    pub struct InputDeviceGetInputReportResponse<'de> {
1276        pub report: crate::wire::InputReport<'de>,
1277    }
1278
1279    static_assertions::const_assert_eq!(
1280        std::mem::size_of::<InputDeviceGetInputReportResponse<'_>>(),
1281        16
1282    );
1283    static_assertions::const_assert_eq!(
1284        std::mem::align_of::<InputDeviceGetInputReportResponse<'_>>(),
1285        8
1286    );
1287
1288    static_assertions::const_assert_eq!(
1289        std::mem::offset_of!(InputDeviceGetInputReportResponse<'_>, report),
1290        0
1291    );
1292
1293    impl ::fidl_next::Constrained for InputDeviceGetInputReportResponse<'_> {
1294        type Constraint = ();
1295
1296        fn validate(
1297            _: ::fidl_next::Slot<'_, Self>,
1298            _: Self::Constraint,
1299        ) -> Result<(), ::fidl_next::ValidationError> {
1300            Ok(())
1301        }
1302    }
1303
1304    unsafe impl ::fidl_next::Wire for InputDeviceGetInputReportResponse<'static> {
1305        type Narrowed<'de> = InputDeviceGetInputReportResponse<'de>;
1306
1307        #[inline]
1308        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1309            ::fidl_next::munge! {
1310                let Self {
1311                    report,
1312
1313                } = &mut *out_;
1314            }
1315
1316            ::fidl_next::Wire::zero_padding(report);
1317        }
1318    }
1319
1320    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for InputDeviceGetInputReportResponse<'de>
1321    where
1322        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1323        ___D: ::fidl_next::Decoder<'de>,
1324        ___D: ::fidl_next::fuchsia::HandleDecoder,
1325    {
1326        fn decode(
1327            slot_: ::fidl_next::Slot<'_, Self>,
1328            decoder_: &mut ___D,
1329            _: (),
1330        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1331            ::fidl_next::munge! {
1332                let Self {
1333                    mut report,
1334
1335                } = slot_;
1336            }
1337
1338            let _field = report.as_mut();
1339
1340            ::fidl_next::Decode::decode(report.as_mut(), decoder_, ())?;
1341
1342            Ok(())
1343        }
1344    }
1345
1346    impl<'de> ::fidl_next::IntoNatural for InputDeviceGetInputReportResponse<'de> {
1347        type Natural = crate::natural::InputDeviceGetInputReportResponse;
1348    }
1349
1350    /// The wire type corresponding to [`InputReportsReaderReadInputReportsResponse`].
1351    #[derive(Debug)]
1352    #[repr(C)]
1353    pub struct InputReportsReaderReadInputReportsResponse<'de> {
1354        pub reports: ::fidl_next::wire::Vector<'de, crate::wire::InputReport<'de>>,
1355    }
1356
1357    static_assertions::const_assert_eq!(
1358        std::mem::size_of::<InputReportsReaderReadInputReportsResponse<'_>>(),
1359        16
1360    );
1361    static_assertions::const_assert_eq!(
1362        std::mem::align_of::<InputReportsReaderReadInputReportsResponse<'_>>(),
1363        8
1364    );
1365
1366    static_assertions::const_assert_eq!(
1367        std::mem::offset_of!(InputReportsReaderReadInputReportsResponse<'_>, reports),
1368        0
1369    );
1370
1371    impl ::fidl_next::Constrained for InputReportsReaderReadInputReportsResponse<'_> {
1372        type Constraint = ();
1373
1374        fn validate(
1375            _: ::fidl_next::Slot<'_, Self>,
1376            _: Self::Constraint,
1377        ) -> Result<(), ::fidl_next::ValidationError> {
1378            Ok(())
1379        }
1380    }
1381
1382    unsafe impl ::fidl_next::Wire for InputReportsReaderReadInputReportsResponse<'static> {
1383        type Narrowed<'de> = InputReportsReaderReadInputReportsResponse<'de>;
1384
1385        #[inline]
1386        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1387            ::fidl_next::munge! {
1388                let Self {
1389                    reports,
1390
1391                } = &mut *out_;
1392            }
1393
1394            ::fidl_next::Wire::zero_padding(reports);
1395        }
1396    }
1397
1398    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for InputReportsReaderReadInputReportsResponse<'de>
1399    where
1400        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1401        ___D: ::fidl_next::Decoder<'de>,
1402        ___D: ::fidl_next::fuchsia::HandleDecoder,
1403    {
1404        fn decode(
1405            slot_: ::fidl_next::Slot<'_, Self>,
1406            decoder_: &mut ___D,
1407            _: (),
1408        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1409            ::fidl_next::munge! {
1410                let Self {
1411                    mut reports,
1412
1413                } = slot_;
1414            }
1415
1416            let _field = reports.as_mut();
1417            ::fidl_next::Constrained::validate(_field, (50, ()))?;
1418            ::fidl_next::Decode::decode(reports.as_mut(), decoder_, (50, ()))?;
1419
1420            let reports = unsafe { reports.deref_unchecked() };
1421
1422            if reports.len() > 50 {
1423                return Err(::fidl_next::DecodeError::VectorTooLong {
1424                    size: reports.len() as u64,
1425                    limit: 50,
1426                });
1427            }
1428
1429            Ok(())
1430        }
1431    }
1432
1433    impl<'de> ::fidl_next::IntoNatural for InputReportsReaderReadInputReportsResponse<'de> {
1434        type Natural = crate::natural::InputReportsReaderReadInputReportsResponse;
1435    }
1436
1437    /// The wire type corresponding to [`InputReportsReaderV2OnInputReportsRequest`].
1438    #[derive(Debug)]
1439    #[repr(C)]
1440    pub struct InputReportsReaderV2OnInputReportsRequest<'de> {
1441        pub reports: ::fidl_next::wire::Vector<'de, crate::wire::InputReport<'de>>,
1442
1443        pub last_report_stamp: ::fidl_next::wire::Uint64,
1444    }
1445
1446    static_assertions::const_assert_eq!(
1447        std::mem::size_of::<InputReportsReaderV2OnInputReportsRequest<'_>>(),
1448        24
1449    );
1450    static_assertions::const_assert_eq!(
1451        std::mem::align_of::<InputReportsReaderV2OnInputReportsRequest<'_>>(),
1452        8
1453    );
1454
1455    static_assertions::const_assert_eq!(
1456        std::mem::offset_of!(InputReportsReaderV2OnInputReportsRequest<'_>, reports),
1457        0
1458    );
1459
1460    static_assertions::const_assert_eq!(
1461        std::mem::offset_of!(InputReportsReaderV2OnInputReportsRequest<'_>, last_report_stamp),
1462        16
1463    );
1464
1465    impl ::fidl_next::Constrained for InputReportsReaderV2OnInputReportsRequest<'_> {
1466        type Constraint = ();
1467
1468        fn validate(
1469            _: ::fidl_next::Slot<'_, Self>,
1470            _: Self::Constraint,
1471        ) -> Result<(), ::fidl_next::ValidationError> {
1472            Ok(())
1473        }
1474    }
1475
1476    unsafe impl ::fidl_next::Wire for InputReportsReaderV2OnInputReportsRequest<'static> {
1477        type Narrowed<'de> = InputReportsReaderV2OnInputReportsRequest<'de>;
1478
1479        #[inline]
1480        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1481            ::fidl_next::munge! {
1482                let Self {
1483                    reports,
1484                    last_report_stamp,
1485
1486                } = &mut *out_;
1487            }
1488
1489            ::fidl_next::Wire::zero_padding(reports);
1490
1491            ::fidl_next::Wire::zero_padding(last_report_stamp);
1492        }
1493    }
1494
1495    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for InputReportsReaderV2OnInputReportsRequest<'de>
1496    where
1497        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1498        ___D: ::fidl_next::Decoder<'de>,
1499        ___D: ::fidl_next::fuchsia::HandleDecoder,
1500    {
1501        fn decode(
1502            slot_: ::fidl_next::Slot<'_, Self>,
1503            decoder_: &mut ___D,
1504            _: (),
1505        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1506            ::fidl_next::munge! {
1507                let Self {
1508                    mut reports,
1509                    mut last_report_stamp,
1510
1511                } = slot_;
1512            }
1513
1514            let _field = reports.as_mut();
1515            ::fidl_next::Constrained::validate(_field, (50, ()))?;
1516            ::fidl_next::Decode::decode(reports.as_mut(), decoder_, (50, ()))?;
1517
1518            let reports = unsafe { reports.deref_unchecked() };
1519
1520            if reports.len() > 50 {
1521                return Err(::fidl_next::DecodeError::VectorTooLong {
1522                    size: reports.len() as u64,
1523                    limit: 50,
1524                });
1525            }
1526
1527            let _field = last_report_stamp.as_mut();
1528
1529            ::fidl_next::Decode::decode(last_report_stamp.as_mut(), decoder_, ())?;
1530
1531            Ok(())
1532        }
1533    }
1534
1535    impl<'de> ::fidl_next::IntoNatural for InputReportsReaderV2OnInputReportsRequest<'de> {
1536        type Natural = crate::natural::InputReportsReaderV2OnInputReportsRequest;
1537    }
1538
1539    /// The wire type corresponding to [`Range`](crate::natural::Range).
1540    pub type Range = ::fidl_next_fuchsia_input::wire::Range;
1541
1542    /// The wire type corresponding to [`Unit`](crate::natural::Unit).
1543    pub type Unit = ::fidl_next_fuchsia_input::wire::Unit;
1544
1545    /// The wire type corresponding to [`UnitType`](crate::natural::UnitType).
1546    pub type UnitType = ::fidl_next_fuchsia_input::wire::UnitType;
1547}
1548
1549pub mod wire_optional {
1550
1551    pub use fidl_next_common_fuchsia_input_report::wire_optional::*;
1552}
1553
1554pub mod generic {
1555
1556    pub use fidl_next_common_fuchsia_input_report::generic::*;
1557
1558    /// The generic type corresponding to [`InputDeviceGetInputReportsReaderRequest`].
1559    pub struct InputDeviceGetInputReportsReaderRequest<T0> {
1560        pub reader: T0,
1561    }
1562
1563    unsafe impl<___E, T0>
1564        ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportsReaderRequest, ___E>
1565        for InputDeviceGetInputReportsReaderRequest<T0>
1566    where
1567        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1568        ___E: ::fidl_next::fuchsia::HandleEncoder,
1569        T0: ::fidl_next::Encode<
1570                ::fidl_next::ServerEnd<
1571                    crate::InputReportsReader,
1572                    ::fidl_next::wire::fuchsia::Channel,
1573                >,
1574                ___E,
1575            >,
1576    {
1577        #[inline]
1578        fn encode(
1579            self,
1580            encoder_: &mut ___E,
1581            out_: &mut ::core::mem::MaybeUninit<
1582                crate::wire::InputDeviceGetInputReportsReaderRequest,
1583            >,
1584            _: (),
1585        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1586            ::fidl_next::munge! {
1587                let crate::wire::InputDeviceGetInputReportsReaderRequest {
1588                    reader,
1589
1590                } = out_;
1591            }
1592
1593            ::fidl_next::Encode::encode(self.reader, encoder_, reader, ())?;
1594
1595            Ok(())
1596        }
1597    }
1598
1599    unsafe impl<'a, ___E, T0>
1600        ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportsReaderRequest, ___E>
1601        for &'a InputDeviceGetInputReportsReaderRequest<T0>
1602    where
1603        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1604        ___E: ::fidl_next::fuchsia::HandleEncoder,
1605        &'a T0: ::fidl_next::Encode<
1606                ::fidl_next::ServerEnd<
1607                    crate::InputReportsReader,
1608                    ::fidl_next::wire::fuchsia::Channel,
1609                >,
1610                ___E,
1611            >,
1612    {
1613        #[inline]
1614        fn encode(
1615            self,
1616            encoder_: &mut ___E,
1617            out_: &mut ::core::mem::MaybeUninit<
1618                crate::wire::InputDeviceGetInputReportsReaderRequest,
1619            >,
1620            _: (),
1621        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1622            ::fidl_next::munge! {
1623                let crate::wire::InputDeviceGetInputReportsReaderRequest {
1624                    reader,
1625
1626                } = out_;
1627            }
1628
1629            ::fidl_next::Encode::encode(&self.reader, encoder_, reader, ())?;
1630
1631            Ok(())
1632        }
1633    }
1634
1635    /// The generic type corresponding to [`InputDeviceGetInputReportsReaderV2Request`].
1636    pub struct InputDeviceGetInputReportsReaderV2Request<T0, T1> {
1637        pub reader: T0,
1638
1639        pub max_unacknowledged_reports_limit: T1,
1640    }
1641
1642    unsafe impl<___E, T0, T1>
1643        ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportsReaderV2Request, ___E>
1644        for InputDeviceGetInputReportsReaderV2Request<T0, T1>
1645    where
1646        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1647        ___E: ::fidl_next::fuchsia::HandleEncoder,
1648        T0: ::fidl_next::Encode<
1649                ::fidl_next::ServerEnd<
1650                    crate::InputReportsReaderV2,
1651                    ::fidl_next::wire::fuchsia::Channel,
1652                >,
1653                ___E,
1654            >,
1655        T1: ::fidl_next::Encode<::fidl_next::wire::Uint16, ___E>,
1656    {
1657        #[inline]
1658        fn encode(
1659            self,
1660            encoder_: &mut ___E,
1661            out_: &mut ::core::mem::MaybeUninit<
1662                crate::wire::InputDeviceGetInputReportsReaderV2Request,
1663            >,
1664            _: (),
1665        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1666            ::fidl_next::munge! {
1667                let crate::wire::InputDeviceGetInputReportsReaderV2Request {
1668                    reader,
1669                    max_unacknowledged_reports_limit,
1670
1671                } = out_;
1672            }
1673
1674            ::fidl_next::Encode::encode(self.reader, encoder_, reader, ())?;
1675
1676            ::fidl_next::Encode::encode(
1677                self.max_unacknowledged_reports_limit,
1678                encoder_,
1679                max_unacknowledged_reports_limit,
1680                (),
1681            )?;
1682
1683            Ok(())
1684        }
1685    }
1686
1687    unsafe impl<'a, ___E, T0, T1>
1688        ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportsReaderV2Request, ___E>
1689        for &'a InputDeviceGetInputReportsReaderV2Request<T0, T1>
1690    where
1691        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1692        ___E: ::fidl_next::fuchsia::HandleEncoder,
1693        &'a T0: ::fidl_next::Encode<
1694                ::fidl_next::ServerEnd<
1695                    crate::InputReportsReaderV2,
1696                    ::fidl_next::wire::fuchsia::Channel,
1697                >,
1698                ___E,
1699            >,
1700        &'a T1: ::fidl_next::Encode<::fidl_next::wire::Uint16, ___E>,
1701    {
1702        #[inline]
1703        fn encode(
1704            self,
1705            encoder_: &mut ___E,
1706            out_: &mut ::core::mem::MaybeUninit<
1707                crate::wire::InputDeviceGetInputReportsReaderV2Request,
1708            >,
1709            _: (),
1710        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1711            ::fidl_next::munge! {
1712                let crate::wire::InputDeviceGetInputReportsReaderV2Request {
1713                    reader,
1714                    max_unacknowledged_reports_limit,
1715
1716                } = out_;
1717            }
1718
1719            ::fidl_next::Encode::encode(&self.reader, encoder_, reader, ())?;
1720
1721            ::fidl_next::Encode::encode(
1722                &self.max_unacknowledged_reports_limit,
1723                encoder_,
1724                max_unacknowledged_reports_limit,
1725                (),
1726            )?;
1727
1728            Ok(())
1729        }
1730    }
1731
1732    /// The generic type corresponding to [`InputDeviceGetInputReportResponse`].
1733    pub struct InputDeviceGetInputReportResponse<T0> {
1734        pub report: T0,
1735    }
1736
1737    unsafe impl<___E, T0>
1738        ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportResponse<'static>, ___E>
1739        for InputDeviceGetInputReportResponse<T0>
1740    where
1741        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1742        ___E: ::fidl_next::Encoder,
1743        ___E: ::fidl_next::fuchsia::HandleEncoder,
1744        T0: ::fidl_next::Encode<crate::wire::InputReport<'static>, ___E>,
1745    {
1746        #[inline]
1747        fn encode(
1748            self,
1749            encoder_: &mut ___E,
1750            out_: &mut ::core::mem::MaybeUninit<
1751                crate::wire::InputDeviceGetInputReportResponse<'static>,
1752            >,
1753            _: (),
1754        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1755            ::fidl_next::munge! {
1756                let crate::wire::InputDeviceGetInputReportResponse {
1757                    report,
1758
1759                } = out_;
1760            }
1761
1762            ::fidl_next::Encode::encode(self.report, encoder_, report, ())?;
1763
1764            Ok(())
1765        }
1766    }
1767
1768    unsafe impl<'a, ___E, T0>
1769        ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportResponse<'static>, ___E>
1770        for &'a InputDeviceGetInputReportResponse<T0>
1771    where
1772        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1773        ___E: ::fidl_next::Encoder,
1774        ___E: ::fidl_next::fuchsia::HandleEncoder,
1775        &'a T0: ::fidl_next::Encode<crate::wire::InputReport<'static>, ___E>,
1776    {
1777        #[inline]
1778        fn encode(
1779            self,
1780            encoder_: &mut ___E,
1781            out_: &mut ::core::mem::MaybeUninit<
1782                crate::wire::InputDeviceGetInputReportResponse<'static>,
1783            >,
1784            _: (),
1785        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1786            ::fidl_next::munge! {
1787                let crate::wire::InputDeviceGetInputReportResponse {
1788                    report,
1789
1790                } = out_;
1791            }
1792
1793            ::fidl_next::Encode::encode(&self.report, encoder_, report, ())?;
1794
1795            Ok(())
1796        }
1797    }
1798
1799    /// The generic type corresponding to [`InputReportsReaderReadInputReportsResponse`].
1800    pub struct InputReportsReaderReadInputReportsResponse<T0> {
1801        pub reports: T0,
1802    }
1803
1804    unsafe impl<___E, T0>
1805        ::fidl_next::Encode<crate::wire::InputReportsReaderReadInputReportsResponse<'static>, ___E>
1806        for InputReportsReaderReadInputReportsResponse<T0>
1807    where
1808        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1809        ___E: ::fidl_next::Encoder,
1810        ___E: ::fidl_next::fuchsia::HandleEncoder,
1811        T0: ::fidl_next::Encode<
1812                ::fidl_next::wire::Vector<'static, crate::wire::InputReport<'static>>,
1813                ___E,
1814            >,
1815    {
1816        #[inline]
1817        fn encode(
1818            self,
1819            encoder_: &mut ___E,
1820            out_: &mut ::core::mem::MaybeUninit<
1821                crate::wire::InputReportsReaderReadInputReportsResponse<'static>,
1822            >,
1823            _: (),
1824        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1825            ::fidl_next::munge! {
1826                let crate::wire::InputReportsReaderReadInputReportsResponse {
1827                    reports,
1828
1829                } = out_;
1830            }
1831
1832            ::fidl_next::Encode::encode(self.reports, encoder_, reports, (50, ()))?;
1833
1834            Ok(())
1835        }
1836    }
1837
1838    unsafe impl<'a, ___E, T0>
1839        ::fidl_next::Encode<crate::wire::InputReportsReaderReadInputReportsResponse<'static>, ___E>
1840        for &'a InputReportsReaderReadInputReportsResponse<T0>
1841    where
1842        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1843        ___E: ::fidl_next::Encoder,
1844        ___E: ::fidl_next::fuchsia::HandleEncoder,
1845        &'a T0: ::fidl_next::Encode<
1846                ::fidl_next::wire::Vector<'static, crate::wire::InputReport<'static>>,
1847                ___E,
1848            >,
1849    {
1850        #[inline]
1851        fn encode(
1852            self,
1853            encoder_: &mut ___E,
1854            out_: &mut ::core::mem::MaybeUninit<
1855                crate::wire::InputReportsReaderReadInputReportsResponse<'static>,
1856            >,
1857            _: (),
1858        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1859            ::fidl_next::munge! {
1860                let crate::wire::InputReportsReaderReadInputReportsResponse {
1861                    reports,
1862
1863                } = out_;
1864            }
1865
1866            ::fidl_next::Encode::encode(&self.reports, encoder_, reports, (50, ()))?;
1867
1868            Ok(())
1869        }
1870    }
1871
1872    /// The generic type corresponding to [`InputReportsReaderV2OnInputReportsRequest`].
1873    pub struct InputReportsReaderV2OnInputReportsRequest<T0, T1> {
1874        pub reports: T0,
1875
1876        pub last_report_stamp: T1,
1877    }
1878
1879    unsafe impl<___E, T0, T1>
1880        ::fidl_next::Encode<crate::wire::InputReportsReaderV2OnInputReportsRequest<'static>, ___E>
1881        for InputReportsReaderV2OnInputReportsRequest<T0, T1>
1882    where
1883        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1884        ___E: ::fidl_next::Encoder,
1885        ___E: ::fidl_next::fuchsia::HandleEncoder,
1886        T0: ::fidl_next::Encode<
1887                ::fidl_next::wire::Vector<'static, crate::wire::InputReport<'static>>,
1888                ___E,
1889            >,
1890        T1: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
1891    {
1892        #[inline]
1893        fn encode(
1894            self,
1895            encoder_: &mut ___E,
1896            out_: &mut ::core::mem::MaybeUninit<
1897                crate::wire::InputReportsReaderV2OnInputReportsRequest<'static>,
1898            >,
1899            _: (),
1900        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1901            ::fidl_next::munge! {
1902                let crate::wire::InputReportsReaderV2OnInputReportsRequest {
1903                    reports,
1904                    last_report_stamp,
1905
1906                } = out_;
1907            }
1908
1909            ::fidl_next::Encode::encode(self.reports, encoder_, reports, (50, ()))?;
1910
1911            ::fidl_next::Encode::encode(self.last_report_stamp, encoder_, last_report_stamp, ())?;
1912
1913            Ok(())
1914        }
1915    }
1916
1917    unsafe impl<'a, ___E, T0, T1>
1918        ::fidl_next::Encode<crate::wire::InputReportsReaderV2OnInputReportsRequest<'static>, ___E>
1919        for &'a InputReportsReaderV2OnInputReportsRequest<T0, T1>
1920    where
1921        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1922        ___E: ::fidl_next::Encoder,
1923        ___E: ::fidl_next::fuchsia::HandleEncoder,
1924        &'a T0: ::fidl_next::Encode<
1925                ::fidl_next::wire::Vector<'static, crate::wire::InputReport<'static>>,
1926                ___E,
1927            >,
1928        &'a T1: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
1929    {
1930        #[inline]
1931        fn encode(
1932            self,
1933            encoder_: &mut ___E,
1934            out_: &mut ::core::mem::MaybeUninit<
1935                crate::wire::InputReportsReaderV2OnInputReportsRequest<'static>,
1936            >,
1937            _: (),
1938        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1939            ::fidl_next::munge! {
1940                let crate::wire::InputReportsReaderV2OnInputReportsRequest {
1941                    reports,
1942                    last_report_stamp,
1943
1944                } = out_;
1945            }
1946
1947            ::fidl_next::Encode::encode(&self.reports, encoder_, reports, (50, ()))?;
1948
1949            ::fidl_next::Encode::encode(&self.last_report_stamp, encoder_, last_report_stamp, ())?;
1950
1951            Ok(())
1952        }
1953    }
1954}
1955
1956pub use self::natural::*;
1957
1958/// The type corresponding to the InputDevice protocol.
1959#[doc = " An `InputDevice` driver represents a single physical input device.\n The InputDevice maintains an internal FIFO of `MAX_DEVICE_REPORT_COUNT`\n reports for each client that connects. Reports are removed from the FIFO\n once they are read by the client. If the FIFO is full, it will drop the\n oldest report to make room for an incoming report.\n"]
1960#[derive(PartialEq, Debug)]
1961pub struct InputDevice;
1962
1963impl ::fidl_next::Discoverable for InputDevice {
1964    const PROTOCOL_NAME: &'static str = "fuchsia.input.report.InputDevice";
1965}
1966
1967#[cfg(target_os = "fuchsia")]
1968impl ::fidl_next::HasTransport for InputDevice {
1969    type Transport = ::fidl_next::fuchsia::zx::Channel;
1970}
1971
1972pub mod input_device {
1973    pub mod prelude {
1974        pub use crate::{
1975            InputDevice, InputDeviceClientHandler, InputDeviceLocalClientHandler,
1976            InputDeviceLocalServerHandler, InputDeviceServerHandler, input_device,
1977        };
1978
1979        pub use crate::natural::InputDeviceGetDescriptorResponse;
1980
1981        pub use crate::natural::InputDeviceGetInputReportRequest;
1982
1983        pub use crate::natural::InputDeviceGetInputReportsReaderRequest;
1984
1985        pub use crate::natural::InputDeviceGetInputReportsReaderV2Request;
1986
1987        pub use crate::natural::InputDeviceGetInputReportsReaderV2Response;
1988
1989        pub use crate::natural::InputDeviceSendOutputReportRequest;
1990
1991        pub use crate::natural::InputDeviceSetFeatureReportRequest;
1992
1993        pub use crate::natural::InputDeviceGetFeatureReportResponse;
1994
1995        pub use crate::natural::InputDeviceGetInputReportResponse;
1996
1997        pub use crate::natural::InputDeviceSendOutputReportResponse;
1998
1999        pub use crate::natural::InputDeviceSetFeatureReportResponse;
2000    }
2001
2002    pub struct GetInputReportsReader;
2003
2004    impl ::fidl_next::Method for GetInputReportsReader {
2005        const ORDINAL: u64 = 7555298015256750913;
2006        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2007            ::fidl_next::protocol::Flexibility::Strict;
2008
2009        type Protocol = crate::InputDevice;
2010
2011        type Request = crate::wire::InputDeviceGetInputReportsReaderRequest;
2012    }
2013
2014    pub struct GetInputReportsReaderV2;
2015
2016    impl ::fidl_next::Method for GetInputReportsReaderV2 {
2017        const ORDINAL: u64 = 464298209416351825;
2018        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2019            ::fidl_next::protocol::Flexibility::Strict;
2020
2021        type Protocol = crate::InputDevice;
2022
2023        type Request = crate::wire::InputDeviceGetInputReportsReaderV2Request;
2024    }
2025
2026    impl ::fidl_next::TwoWayMethod for GetInputReportsReaderV2 {
2027        type Response =
2028            ::fidl_next::wire::Strict<crate::wire::InputDeviceGetInputReportsReaderV2Response>;
2029    }
2030
2031    impl<___R> ::fidl_next::Respond<___R> for GetInputReportsReaderV2 {
2032        type Output =
2033            ::fidl_next::Strict<crate::generic::InputDeviceGetInputReportsReaderV2Response<___R>>;
2034
2035        fn respond(response: ___R) -> Self::Output {
2036            ::fidl_next::Strict(crate::generic::InputDeviceGetInputReportsReaderV2Response {
2037                max_unacknowledged_reports: response,
2038            })
2039        }
2040    }
2041
2042    pub struct GetDescriptor;
2043
2044    impl ::fidl_next::Method for GetDescriptor {
2045        const ORDINAL: u64 = 4428799916562230578;
2046        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2047            ::fidl_next::protocol::Flexibility::Strict;
2048
2049        type Protocol = crate::InputDevice;
2050
2051        type Request = ::fidl_next::wire::EmptyMessageBody;
2052    }
2053
2054    impl ::fidl_next::TwoWayMethod for GetDescriptor {
2055        type Response =
2056            ::fidl_next::wire::Strict<crate::wire::InputDeviceGetDescriptorResponse<'static>>;
2057    }
2058
2059    impl<___R> ::fidl_next::Respond<___R> for GetDescriptor {
2060        type Output = ::fidl_next::Strict<crate::generic::InputDeviceGetDescriptorResponse<___R>>;
2061
2062        fn respond(response: ___R) -> Self::Output {
2063            ::fidl_next::Strict(crate::generic::InputDeviceGetDescriptorResponse {
2064                descriptor: response,
2065            })
2066        }
2067    }
2068
2069    pub struct SendOutputReport;
2070
2071    impl ::fidl_next::Method for SendOutputReport {
2072        const ORDINAL: u64 = 466765262340648762;
2073        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2074            ::fidl_next::protocol::Flexibility::Strict;
2075
2076        type Protocol = crate::InputDevice;
2077
2078        type Request = crate::wire::InputDeviceSendOutputReportRequest<'static>;
2079    }
2080
2081    impl ::fidl_next::TwoWayMethod for SendOutputReport {
2082        type Response = ::fidl_next::wire::Result<
2083            'static,
2084            crate::wire::InputDeviceSendOutputReportResponse,
2085            ::fidl_next::wire::fuchsia::Status,
2086        >;
2087    }
2088
2089    impl<___R> ::fidl_next::Respond<___R> for SendOutputReport {
2090        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
2091
2092        fn respond(response: ___R) -> Self::Output {
2093            ::core::result::Result::Ok(response)
2094        }
2095    }
2096
2097    impl<___R> ::fidl_next::RespondErr<___R> for SendOutputReport {
2098        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2099
2100        fn respond_err(response: ___R) -> Self::Output {
2101            ::core::result::Result::Err(response)
2102        }
2103    }
2104
2105    pub struct GetFeatureReport;
2106
2107    impl ::fidl_next::Method for GetFeatureReport {
2108        const ORDINAL: u64 = 5294682407360339734;
2109        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2110            ::fidl_next::protocol::Flexibility::Strict;
2111
2112        type Protocol = crate::InputDevice;
2113
2114        type Request = ::fidl_next::wire::EmptyMessageBody;
2115    }
2116
2117    impl ::fidl_next::TwoWayMethod for GetFeatureReport {
2118        type Response = ::fidl_next::wire::Result<
2119            'static,
2120            crate::wire::InputDeviceGetFeatureReportResponse<'static>,
2121            ::fidl_next::wire::fuchsia::Status,
2122        >;
2123    }
2124
2125    impl<___R> ::fidl_next::Respond<___R> for GetFeatureReport {
2126        type Output = ::core::result::Result<
2127            crate::generic::InputDeviceGetFeatureReportResponse<___R>,
2128            ::fidl_next::never::Never,
2129        >;
2130
2131        fn respond(response: ___R) -> Self::Output {
2132            ::core::result::Result::Ok(crate::generic::InputDeviceGetFeatureReportResponse {
2133                report: response,
2134            })
2135        }
2136    }
2137
2138    impl<___R> ::fidl_next::RespondErr<___R> for GetFeatureReport {
2139        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2140
2141        fn respond_err(response: ___R) -> Self::Output {
2142            ::core::result::Result::Err(response)
2143        }
2144    }
2145
2146    pub struct SetFeatureReport;
2147
2148    impl ::fidl_next::Method for SetFeatureReport {
2149        const ORDINAL: u64 = 8537033744562275055;
2150        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2151            ::fidl_next::protocol::Flexibility::Strict;
2152
2153        type Protocol = crate::InputDevice;
2154
2155        type Request = crate::wire::InputDeviceSetFeatureReportRequest<'static>;
2156    }
2157
2158    impl ::fidl_next::TwoWayMethod for SetFeatureReport {
2159        type Response = ::fidl_next::wire::Result<
2160            'static,
2161            crate::wire::InputDeviceSetFeatureReportResponse,
2162            ::fidl_next::wire::fuchsia::Status,
2163        >;
2164    }
2165
2166    impl<___R> ::fidl_next::Respond<___R> for SetFeatureReport {
2167        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
2168
2169        fn respond(response: ___R) -> Self::Output {
2170            ::core::result::Result::Ok(response)
2171        }
2172    }
2173
2174    impl<___R> ::fidl_next::RespondErr<___R> for SetFeatureReport {
2175        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2176
2177        fn respond_err(response: ___R) -> Self::Output {
2178            ::core::result::Result::Err(response)
2179        }
2180    }
2181
2182    pub struct GetInputReport;
2183
2184    impl ::fidl_next::Method for GetInputReport {
2185        const ORDINAL: u64 = 5139395162123862600;
2186        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2187            ::fidl_next::protocol::Flexibility::Strict;
2188
2189        type Protocol = crate::InputDevice;
2190
2191        type Request = crate::wire::InputDeviceGetInputReportRequest;
2192    }
2193
2194    impl ::fidl_next::TwoWayMethod for GetInputReport {
2195        type Response = ::fidl_next::wire::Result<
2196            'static,
2197            crate::wire::InputDeviceGetInputReportResponse<'static>,
2198            ::fidl_next::wire::fuchsia::Status,
2199        >;
2200    }
2201
2202    impl<___R> ::fidl_next::Respond<___R> for GetInputReport {
2203        type Output = ::core::result::Result<
2204            crate::generic::InputDeviceGetInputReportResponse<___R>,
2205            ::fidl_next::never::Never,
2206        >;
2207
2208        fn respond(response: ___R) -> Self::Output {
2209            ::core::result::Result::Ok(crate::generic::InputDeviceGetInputReportResponse {
2210                report: response,
2211            })
2212        }
2213    }
2214
2215    impl<___R> ::fidl_next::RespondErr<___R> for GetInputReport {
2216        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2217
2218        fn respond_err(response: ___R) -> Self::Output {
2219            ::core::result::Result::Err(response)
2220        }
2221    }
2222
2223    mod ___detail {
2224        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::InputDevice
2225        where
2226            ___T: ::fidl_next::Transport,
2227        {
2228            type Client = InputDeviceClient<___T>;
2229            type Server = InputDeviceServer<___T>;
2230        }
2231
2232        /// The client for the `InputDevice` protocol.
2233        #[repr(transparent)]
2234        pub struct InputDeviceClient<___T: ::fidl_next::Transport> {
2235            #[allow(dead_code)]
2236            client: ::fidl_next::protocol::Client<___T>,
2237        }
2238
2239        impl<___T> InputDeviceClient<___T>
2240        where
2241            ___T: ::fidl_next::Transport,
2242        {
2243            #[doc = " Open a new InputReportsReader on this device. Each reader receives\n their own reports.\n"]
2244            pub fn get_input_reports_reader(
2245                &self,
2246
2247                reader: impl ::fidl_next::Encode<
2248                    ::fidl_next::ServerEnd<
2249                        crate::InputReportsReader,
2250                        ::fidl_next::wire::fuchsia::Channel,
2251                    >,
2252                    <___T as ::fidl_next::Transport>::SendBuffer,
2253                >,
2254            ) -> ::fidl_next::SendFuture<'_, ___T>
2255            where
2256                <___T as ::fidl_next::Transport>::SendBuffer:
2257                    ::fidl_next::encoder::InternalHandleEncoder,
2258                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2259            {
2260                self.get_input_reports_reader_with(
2261                    crate::generic::InputDeviceGetInputReportsReaderRequest { reader },
2262                )
2263            }
2264
2265            #[doc = " Open a new InputReportsReader on this device. Each reader receives\n their own reports.\n"]
2266            pub fn get_input_reports_reader_with<___R>(
2267                &self,
2268                request: ___R,
2269            ) -> ::fidl_next::SendFuture<'_, ___T>
2270            where
2271                ___R: ::fidl_next::Encode<
2272                        crate::wire::InputDeviceGetInputReportsReaderRequest,
2273                        <___T as ::fidl_next::Transport>::SendBuffer,
2274                    >,
2275            {
2276                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
2277                    7555298015256750913,
2278                    <super::GetInputReportsReader as ::fidl_next::Method>::FLEXIBILITY,
2279                    request,
2280                ))
2281            }
2282
2283            #[doc = " Open a new InputReportsReaderV2 on this device. Each reader receives\n the full stream of event reports.\n"]
2284            pub fn get_input_reports_reader_v2(
2285                &self,
2286
2287                reader: impl ::fidl_next::Encode<
2288                    ::fidl_next::ServerEnd<
2289                        crate::InputReportsReaderV2,
2290                        ::fidl_next::wire::fuchsia::Channel,
2291                    >,
2292                    <___T as ::fidl_next::Transport>::SendBuffer,
2293                >,
2294
2295                max_unacknowledged_reports_limit: impl ::fidl_next::Encode<
2296                    ::fidl_next::wire::Uint16,
2297                    <___T as ::fidl_next::Transport>::SendBuffer,
2298                >,
2299            ) -> ::fidl_next::TwoWayFuture<'_, super::GetInputReportsReaderV2, ___T>
2300            where
2301                <___T as ::fidl_next::Transport>::SendBuffer:
2302                    ::fidl_next::encoder::InternalHandleEncoder,
2303                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2304            {
2305                self.get_input_reports_reader_v2_with(
2306                    crate::generic::InputDeviceGetInputReportsReaderV2Request {
2307                        reader,
2308
2309                        max_unacknowledged_reports_limit,
2310                    },
2311                )
2312            }
2313
2314            #[doc = " Open a new InputReportsReaderV2 on this device. Each reader receives\n the full stream of event reports.\n"]
2315            pub fn get_input_reports_reader_v2_with<___R>(
2316                &self,
2317                request: ___R,
2318            ) -> ::fidl_next::TwoWayFuture<'_, super::GetInputReportsReaderV2, ___T>
2319            where
2320                ___R: ::fidl_next::Encode<
2321                        crate::wire::InputDeviceGetInputReportsReaderV2Request,
2322                        <___T as ::fidl_next::Transport>::SendBuffer,
2323                    >,
2324            {
2325                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2326                    464298209416351825,
2327                    <super::GetInputReportsReaderV2 as ::fidl_next::Method>::FLEXIBILITY,
2328                    request,
2329                ))
2330            }
2331
2332            #[doc = " Gets the device descriptor for this device.\n"]
2333            pub fn get_descriptor(
2334                &self,
2335            ) -> ::fidl_next::TwoWayFuture<'_, super::GetDescriptor, ___T> {
2336                ::fidl_next::TwoWayFuture::from_untyped(
2337                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
2338                        4428799916562230578,
2339                        <super::GetDescriptor as ::fidl_next::Method>::FLEXIBILITY,
2340                        (),
2341                    ),
2342                )
2343            }
2344
2345            #[doc = " Send a single output report to the device. This will throw an error\n if the output report does not follow the OutputDescriptor.\n"]
2346            pub fn send_output_report(
2347                &self,
2348
2349                report: impl ::fidl_next::Encode<
2350                    crate::wire::OutputReport<'static>,
2351                    <___T as ::fidl_next::Transport>::SendBuffer,
2352                >,
2353            ) -> ::fidl_next::TwoWayFuture<'_, super::SendOutputReport, ___T>
2354            where
2355                <___T as ::fidl_next::Transport>::SendBuffer:
2356                    ::fidl_next::encoder::InternalHandleEncoder,
2357                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2358            {
2359                self.send_output_report_with(crate::generic::InputDeviceSendOutputReportRequest {
2360                    report,
2361                })
2362            }
2363
2364            #[doc = " Send a single output report to the device. This will throw an error\n if the output report does not follow the OutputDescriptor.\n"]
2365            pub fn send_output_report_with<___R>(
2366                &self,
2367                request: ___R,
2368            ) -> ::fidl_next::TwoWayFuture<'_, super::SendOutputReport, ___T>
2369            where
2370                ___R: ::fidl_next::Encode<
2371                        crate::wire::InputDeviceSendOutputReportRequest<'static>,
2372                        <___T as ::fidl_next::Transport>::SendBuffer,
2373                    >,
2374            {
2375                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2376                    466765262340648762,
2377                    <super::SendOutputReport as ::fidl_next::Method>::FLEXIBILITY,
2378                    request,
2379                ))
2380            }
2381
2382            #[doc = " Get the feature report for a given device. This requests the state of\n the device\'s features.\n"]
2383            pub fn get_feature_report(
2384                &self,
2385            ) -> ::fidl_next::TwoWayFuture<'_, super::GetFeatureReport, ___T> {
2386                ::fidl_next::TwoWayFuture::from_untyped(
2387                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
2388                        5294682407360339734,
2389                        <super::GetFeatureReport as ::fidl_next::Method>::FLEXIBILITY,
2390                        (),
2391                    ),
2392                )
2393            }
2394
2395            #[doc = " Set the feature report for a given device. This sets the state of\n the device\'s features.\n"]
2396            pub fn set_feature_report(
2397                &self,
2398
2399                report: impl ::fidl_next::Encode<
2400                    crate::wire::FeatureReport<'static>,
2401                    <___T as ::fidl_next::Transport>::SendBuffer,
2402                >,
2403            ) -> ::fidl_next::TwoWayFuture<'_, super::SetFeatureReport, ___T>
2404            where
2405                <___T as ::fidl_next::Transport>::SendBuffer:
2406                    ::fidl_next::encoder::InternalHandleEncoder,
2407                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2408            {
2409                self.set_feature_report_with(crate::generic::InputDeviceSetFeatureReportRequest {
2410                    report,
2411                })
2412            }
2413
2414            #[doc = " Set the feature report for a given device. This sets the state of\n the device\'s features.\n"]
2415            pub fn set_feature_report_with<___R>(
2416                &self,
2417                request: ___R,
2418            ) -> ::fidl_next::TwoWayFuture<'_, super::SetFeatureReport, ___T>
2419            where
2420                ___R: ::fidl_next::Encode<
2421                        crate::wire::InputDeviceSetFeatureReportRequest<'static>,
2422                        <___T as ::fidl_next::Transport>::SendBuffer,
2423                    >,
2424            {
2425                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2426                    8537033744562275055,
2427                    <super::SetFeatureReport as ::fidl_next::Method>::FLEXIBILITY,
2428                    request,
2429                ))
2430            }
2431
2432            #[doc = " For general cases, InputReportReader is the preferred way of getting\n InputReports. For devices that don\'t send InputReports naturally, this\n method can be used to request a report from the device type indicated.\n Does not block, and returns ZX_ERR_NOT_SUPPORTED if `GetInputReport` or\n `device_type` are not supported.\n"]
2433            pub fn get_input_report(
2434                &self,
2435
2436                device_type: impl ::fidl_next::Encode<
2437                    crate::wire::DeviceType,
2438                    <___T as ::fidl_next::Transport>::SendBuffer,
2439                >,
2440            ) -> ::fidl_next::TwoWayFuture<'_, super::GetInputReport, ___T>
2441            where
2442                <___T as ::fidl_next::Transport>::SendBuffer:
2443                    ::fidl_next::encoder::InternalHandleEncoder,
2444            {
2445                self.get_input_report_with(crate::generic::InputDeviceGetInputReportRequest {
2446                    device_type,
2447                })
2448            }
2449
2450            #[doc = " For general cases, InputReportReader is the preferred way of getting\n InputReports. For devices that don\'t send InputReports naturally, this\n method can be used to request a report from the device type indicated.\n Does not block, and returns ZX_ERR_NOT_SUPPORTED if `GetInputReport` or\n `device_type` are not supported.\n"]
2451            pub fn get_input_report_with<___R>(
2452                &self,
2453                request: ___R,
2454            ) -> ::fidl_next::TwoWayFuture<'_, super::GetInputReport, ___T>
2455            where
2456                ___R: ::fidl_next::Encode<
2457                        crate::wire::InputDeviceGetInputReportRequest,
2458                        <___T as ::fidl_next::Transport>::SendBuffer,
2459                    >,
2460            {
2461                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2462                    5139395162123862600,
2463                    <super::GetInputReport as ::fidl_next::Method>::FLEXIBILITY,
2464                    request,
2465                ))
2466            }
2467        }
2468
2469        /// The server for the `InputDevice` protocol.
2470        #[repr(transparent)]
2471        pub struct InputDeviceServer<___T: ::fidl_next::Transport> {
2472            server: ::fidl_next::protocol::Server<___T>,
2473        }
2474
2475        impl<___T> InputDeviceServer<___T> where ___T: ::fidl_next::Transport {}
2476    }
2477}
2478
2479#[diagnostic::on_unimplemented(
2480    note = "If {Self} implements the non-local InputDeviceClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2481)]
2482
2483/// A client handler for the InputDevice protocol.
2484///
2485/// See [`InputDevice`] for more details.
2486pub trait InputDeviceLocalClientHandler<
2487    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2488    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2489>
2490{
2491    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2492        ::core::future::ready(())
2493    }
2494}
2495
2496impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for InputDevice
2497where
2498    ___H: InputDeviceLocalClientHandler<___T>,
2499    ___T: ::fidl_next::Transport,
2500{
2501    async fn on_event(
2502        handler: &mut ___H,
2503        mut message: ::fidl_next::Message<___T>,
2504    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2505        match *message.header().ordinal {
2506            ordinal => {
2507                handler.on_unknown_interaction(ordinal).await;
2508                if ::core::matches!(
2509                    message.header().flexibility(),
2510                    ::fidl_next::protocol::Flexibility::Strict
2511                ) {
2512                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2513                } else {
2514                    Ok(())
2515                }
2516            }
2517        }
2518    }
2519}
2520
2521#[diagnostic::on_unimplemented(
2522    note = "If {Self} implements the non-local InputDeviceServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2523)]
2524
2525/// A server handler for the InputDevice protocol.
2526///
2527/// See [`InputDevice`] for more details.
2528pub trait InputDeviceLocalServerHandler<
2529    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2530    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2531>
2532{
2533    #[doc = " Open a new InputReportsReader on this device. Each reader receives\n their own reports.\n"]
2534    fn get_input_reports_reader(
2535        &mut self,
2536
2537        request: ::fidl_next::Request<input_device::GetInputReportsReader, ___T>,
2538    ) -> impl ::core::future::Future<Output = ()>;
2539
2540    #[doc = " Open a new InputReportsReaderV2 on this device. Each reader receives\n the full stream of event reports.\n"]
2541    fn get_input_reports_reader_v2(
2542        &mut self,
2543
2544        request: ::fidl_next::Request<input_device::GetInputReportsReaderV2, ___T>,
2545
2546        responder: ::fidl_next::Responder<input_device::GetInputReportsReaderV2, ___T>,
2547    ) -> impl ::core::future::Future<Output = ()>;
2548
2549    #[doc = " Gets the device descriptor for this device.\n"]
2550    fn get_descriptor(
2551        &mut self,
2552
2553        responder: ::fidl_next::Responder<input_device::GetDescriptor, ___T>,
2554    ) -> impl ::core::future::Future<Output = ()>;
2555
2556    #[doc = " Send a single output report to the device. This will throw an error\n if the output report does not follow the OutputDescriptor.\n"]
2557    fn send_output_report(
2558        &mut self,
2559
2560        request: ::fidl_next::Request<input_device::SendOutputReport, ___T>,
2561
2562        responder: ::fidl_next::Responder<input_device::SendOutputReport, ___T>,
2563    ) -> impl ::core::future::Future<Output = ()>;
2564
2565    #[doc = " Get the feature report for a given device. This requests the state of\n the device\'s features.\n"]
2566    fn get_feature_report(
2567        &mut self,
2568
2569        responder: ::fidl_next::Responder<input_device::GetFeatureReport, ___T>,
2570    ) -> impl ::core::future::Future<Output = ()>;
2571
2572    #[doc = " Set the feature report for a given device. This sets the state of\n the device\'s features.\n"]
2573    fn set_feature_report(
2574        &mut self,
2575
2576        request: ::fidl_next::Request<input_device::SetFeatureReport, ___T>,
2577
2578        responder: ::fidl_next::Responder<input_device::SetFeatureReport, ___T>,
2579    ) -> impl ::core::future::Future<Output = ()>;
2580
2581    #[doc = " For general cases, InputReportReader is the preferred way of getting\n InputReports. For devices that don\'t send InputReports naturally, this\n method can be used to request a report from the device type indicated.\n Does not block, and returns ZX_ERR_NOT_SUPPORTED if `GetInputReport` or\n `device_type` are not supported.\n"]
2582    fn get_input_report(
2583        &mut self,
2584
2585        request: ::fidl_next::Request<input_device::GetInputReport, ___T>,
2586
2587        responder: ::fidl_next::Responder<input_device::GetInputReport, ___T>,
2588    ) -> impl ::core::future::Future<Output = ()>;
2589
2590    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2591        ::core::future::ready(())
2592    }
2593}
2594
2595impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for InputDevice
2596where
2597    ___H: InputDeviceLocalServerHandler<___T>,
2598    ___T: ::fidl_next::Transport,
2599    for<'de> crate::wire::InputDeviceGetInputReportsReaderRequest: ::fidl_next::Decode<
2600            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2601            Constraint = (),
2602        >,
2603    for<'de> crate::wire::InputDeviceGetInputReportsReaderV2Request: ::fidl_next::Decode<
2604            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2605            Constraint = (),
2606        >,
2607    for<'de> crate::wire::InputDeviceSendOutputReportRequest<'de>: ::fidl_next::Decode<
2608            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2609            Constraint = (),
2610        >,
2611    for<'de> crate::wire::InputDeviceSetFeatureReportRequest<'de>: ::fidl_next::Decode<
2612            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2613            Constraint = (),
2614        >,
2615    for<'de> crate::wire::InputDeviceGetInputReportRequest: ::fidl_next::Decode<
2616            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2617            Constraint = (),
2618        >,
2619{
2620    async fn on_one_way(
2621        handler: &mut ___H,
2622        mut message: ::fidl_next::Message<___T>,
2623    ) -> ::core::result::Result<
2624        (),
2625        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2626    > {
2627        match *message.header().ordinal {
2628            7555298015256750913 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
2629                Ok(decoded) => {
2630                    handler
2631                        .get_input_reports_reader(::fidl_next::Request::from_decoded(decoded))
2632                        .await;
2633                    Ok(())
2634                }
2635                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2636                    ordinal: 7555298015256750913,
2637                    error,
2638                }),
2639            },
2640
2641            ordinal => {
2642                handler.on_unknown_interaction(ordinal).await;
2643                if ::core::matches!(
2644                    message.header().flexibility(),
2645                    ::fidl_next::protocol::Flexibility::Strict
2646                ) {
2647                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2648                } else {
2649                    Ok(())
2650                }
2651            }
2652        }
2653    }
2654
2655    async fn on_two_way(
2656        handler: &mut ___H,
2657        mut message: ::fidl_next::Message<___T>,
2658        responder: ::fidl_next::protocol::Responder<___T>,
2659    ) -> ::core::result::Result<
2660        (),
2661        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2662    > {
2663        match *message.header().ordinal {
2664            464298209416351825 => {
2665                let responder = ::fidl_next::Responder::from_untyped(responder);
2666
2667                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2668                    Ok(decoded) => {
2669                        handler
2670                            .get_input_reports_reader_v2(
2671                                ::fidl_next::Request::from_decoded(decoded),
2672                                responder,
2673                            )
2674                            .await;
2675                        Ok(())
2676                    }
2677                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2678                        ordinal: 464298209416351825,
2679                        error,
2680                    }),
2681                }
2682            }
2683
2684            4428799916562230578 => {
2685                let responder = ::fidl_next::Responder::from_untyped(responder);
2686
2687                handler.get_descriptor(responder).await;
2688                Ok(())
2689            }
2690
2691            466765262340648762 => {
2692                let responder = ::fidl_next::Responder::from_untyped(responder);
2693
2694                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2695                    Ok(decoded) => {
2696                        handler
2697                            .send_output_report(
2698                                ::fidl_next::Request::from_decoded(decoded),
2699                                responder,
2700                            )
2701                            .await;
2702                        Ok(())
2703                    }
2704                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2705                        ordinal: 466765262340648762,
2706                        error,
2707                    }),
2708                }
2709            }
2710
2711            5294682407360339734 => {
2712                let responder = ::fidl_next::Responder::from_untyped(responder);
2713
2714                handler.get_feature_report(responder).await;
2715                Ok(())
2716            }
2717
2718            8537033744562275055 => {
2719                let responder = ::fidl_next::Responder::from_untyped(responder);
2720
2721                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2722                    Ok(decoded) => {
2723                        handler
2724                            .set_feature_report(
2725                                ::fidl_next::Request::from_decoded(decoded),
2726                                responder,
2727                            )
2728                            .await;
2729                        Ok(())
2730                    }
2731                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2732                        ordinal: 8537033744562275055,
2733                        error,
2734                    }),
2735                }
2736            }
2737
2738            5139395162123862600 => {
2739                let responder = ::fidl_next::Responder::from_untyped(responder);
2740
2741                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2742                    Ok(decoded) => {
2743                        handler
2744                            .get_input_report(
2745                                ::fidl_next::Request::from_decoded(decoded),
2746                                responder,
2747                            )
2748                            .await;
2749                        Ok(())
2750                    }
2751                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2752                        ordinal: 5139395162123862600,
2753                        error,
2754                    }),
2755                }
2756            }
2757
2758            ordinal => {
2759                handler.on_unknown_interaction(ordinal).await;
2760                if ::core::matches!(
2761                    message.header().flexibility(),
2762                    ::fidl_next::protocol::Flexibility::Strict
2763                ) {
2764                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2765                } else {
2766                    responder
2767                        .respond_framework_error(
2768                            ordinal,
2769                            ::fidl_next::FrameworkError::UnknownMethod,
2770                        )
2771                        .expect("encoding a framework error should never fail")
2772                        .await?;
2773                    Ok(())
2774                }
2775            }
2776        }
2777    }
2778}
2779
2780/// A client handler for the InputDevice protocol.
2781///
2782/// See [`InputDevice`] for more details.
2783pub trait InputDeviceClientHandler<
2784    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2785    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2786>
2787{
2788    fn on_unknown_interaction(
2789        &mut self,
2790        ordinal: u64,
2791    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2792        ::core::future::ready(())
2793    }
2794}
2795
2796impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for InputDevice
2797where
2798    ___H: InputDeviceClientHandler<___T> + ::core::marker::Send,
2799    ___T: ::fidl_next::Transport,
2800{
2801    async fn on_event(
2802        handler: &mut ___H,
2803        mut message: ::fidl_next::Message<___T>,
2804    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2805        match *message.header().ordinal {
2806            ordinal => {
2807                handler.on_unknown_interaction(ordinal).await;
2808                if ::core::matches!(
2809                    message.header().flexibility(),
2810                    ::fidl_next::protocol::Flexibility::Strict
2811                ) {
2812                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2813                } else {
2814                    Ok(())
2815                }
2816            }
2817        }
2818    }
2819}
2820
2821/// A server handler for the InputDevice protocol.
2822///
2823/// See [`InputDevice`] for more details.
2824pub trait InputDeviceServerHandler<
2825    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2826    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2827>
2828{
2829    #[doc = " Open a new InputReportsReader on this device. Each reader receives\n their own reports.\n"]
2830    fn get_input_reports_reader(
2831        &mut self,
2832
2833        request: ::fidl_next::Request<input_device::GetInputReportsReader, ___T>,
2834    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2835
2836    #[doc = " Open a new InputReportsReaderV2 on this device. Each reader receives\n the full stream of event reports.\n"]
2837    fn get_input_reports_reader_v2(
2838        &mut self,
2839
2840        request: ::fidl_next::Request<input_device::GetInputReportsReaderV2, ___T>,
2841
2842        responder: ::fidl_next::Responder<input_device::GetInputReportsReaderV2, ___T>,
2843    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2844
2845    #[doc = " Gets the device descriptor for this device.\n"]
2846    fn get_descriptor(
2847        &mut self,
2848
2849        responder: ::fidl_next::Responder<input_device::GetDescriptor, ___T>,
2850    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2851
2852    #[doc = " Send a single output report to the device. This will throw an error\n if the output report does not follow the OutputDescriptor.\n"]
2853    fn send_output_report(
2854        &mut self,
2855
2856        request: ::fidl_next::Request<input_device::SendOutputReport, ___T>,
2857
2858        responder: ::fidl_next::Responder<input_device::SendOutputReport, ___T>,
2859    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2860
2861    #[doc = " Get the feature report for a given device. This requests the state of\n the device\'s features.\n"]
2862    fn get_feature_report(
2863        &mut self,
2864
2865        responder: ::fidl_next::Responder<input_device::GetFeatureReport, ___T>,
2866    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2867
2868    #[doc = " Set the feature report for a given device. This sets the state of\n the device\'s features.\n"]
2869    fn set_feature_report(
2870        &mut self,
2871
2872        request: ::fidl_next::Request<input_device::SetFeatureReport, ___T>,
2873
2874        responder: ::fidl_next::Responder<input_device::SetFeatureReport, ___T>,
2875    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2876
2877    #[doc = " For general cases, InputReportReader is the preferred way of getting\n InputReports. For devices that don\'t send InputReports naturally, this\n method can be used to request a report from the device type indicated.\n Does not block, and returns ZX_ERR_NOT_SUPPORTED if `GetInputReport` or\n `device_type` are not supported.\n"]
2878    fn get_input_report(
2879        &mut self,
2880
2881        request: ::fidl_next::Request<input_device::GetInputReport, ___T>,
2882
2883        responder: ::fidl_next::Responder<input_device::GetInputReport, ___T>,
2884    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2885
2886    fn on_unknown_interaction(
2887        &mut self,
2888        ordinal: u64,
2889    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2890        ::core::future::ready(())
2891    }
2892}
2893
2894impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for InputDevice
2895where
2896    ___H: InputDeviceServerHandler<___T> + ::core::marker::Send,
2897    ___T: ::fidl_next::Transport,
2898    for<'de> crate::wire::InputDeviceGetInputReportsReaderRequest: ::fidl_next::Decode<
2899            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2900            Constraint = (),
2901        >,
2902    for<'de> crate::wire::InputDeviceGetInputReportsReaderV2Request: ::fidl_next::Decode<
2903            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2904            Constraint = (),
2905        >,
2906    for<'de> crate::wire::InputDeviceSendOutputReportRequest<'de>: ::fidl_next::Decode<
2907            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2908            Constraint = (),
2909        >,
2910    for<'de> crate::wire::InputDeviceSetFeatureReportRequest<'de>: ::fidl_next::Decode<
2911            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2912            Constraint = (),
2913        >,
2914    for<'de> crate::wire::InputDeviceGetInputReportRequest: ::fidl_next::Decode<
2915            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2916            Constraint = (),
2917        >,
2918{
2919    async fn on_one_way(
2920        handler: &mut ___H,
2921        mut message: ::fidl_next::Message<___T>,
2922    ) -> ::core::result::Result<
2923        (),
2924        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2925    > {
2926        match *message.header().ordinal {
2927            7555298015256750913 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
2928                Ok(decoded) => {
2929                    handler
2930                        .get_input_reports_reader(::fidl_next::Request::from_decoded(decoded))
2931                        .await;
2932                    Ok(())
2933                }
2934                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2935                    ordinal: 7555298015256750913,
2936                    error,
2937                }),
2938            },
2939
2940            ordinal => {
2941                handler.on_unknown_interaction(ordinal).await;
2942                if ::core::matches!(
2943                    message.header().flexibility(),
2944                    ::fidl_next::protocol::Flexibility::Strict
2945                ) {
2946                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2947                } else {
2948                    Ok(())
2949                }
2950            }
2951        }
2952    }
2953
2954    async fn on_two_way(
2955        handler: &mut ___H,
2956        mut message: ::fidl_next::Message<___T>,
2957        responder: ::fidl_next::protocol::Responder<___T>,
2958    ) -> ::core::result::Result<
2959        (),
2960        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2961    > {
2962        match *message.header().ordinal {
2963            464298209416351825 => {
2964                let responder = ::fidl_next::Responder::from_untyped(responder);
2965
2966                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2967                    Ok(decoded) => {
2968                        handler
2969                            .get_input_reports_reader_v2(
2970                                ::fidl_next::Request::from_decoded(decoded),
2971                                responder,
2972                            )
2973                            .await;
2974                        Ok(())
2975                    }
2976                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2977                        ordinal: 464298209416351825,
2978                        error,
2979                    }),
2980                }
2981            }
2982
2983            4428799916562230578 => {
2984                let responder = ::fidl_next::Responder::from_untyped(responder);
2985
2986                handler.get_descriptor(responder).await;
2987                Ok(())
2988            }
2989
2990            466765262340648762 => {
2991                let responder = ::fidl_next::Responder::from_untyped(responder);
2992
2993                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2994                    Ok(decoded) => {
2995                        handler
2996                            .send_output_report(
2997                                ::fidl_next::Request::from_decoded(decoded),
2998                                responder,
2999                            )
3000                            .await;
3001                        Ok(())
3002                    }
3003                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3004                        ordinal: 466765262340648762,
3005                        error,
3006                    }),
3007                }
3008            }
3009
3010            5294682407360339734 => {
3011                let responder = ::fidl_next::Responder::from_untyped(responder);
3012
3013                handler.get_feature_report(responder).await;
3014                Ok(())
3015            }
3016
3017            8537033744562275055 => {
3018                let responder = ::fidl_next::Responder::from_untyped(responder);
3019
3020                match ::fidl_next::AsDecoderExt::into_decoded(message) {
3021                    Ok(decoded) => {
3022                        handler
3023                            .set_feature_report(
3024                                ::fidl_next::Request::from_decoded(decoded),
3025                                responder,
3026                            )
3027                            .await;
3028                        Ok(())
3029                    }
3030                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3031                        ordinal: 8537033744562275055,
3032                        error,
3033                    }),
3034                }
3035            }
3036
3037            5139395162123862600 => {
3038                let responder = ::fidl_next::Responder::from_untyped(responder);
3039
3040                match ::fidl_next::AsDecoderExt::into_decoded(message) {
3041                    Ok(decoded) => {
3042                        handler
3043                            .get_input_report(
3044                                ::fidl_next::Request::from_decoded(decoded),
3045                                responder,
3046                            )
3047                            .await;
3048                        Ok(())
3049                    }
3050                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3051                        ordinal: 5139395162123862600,
3052                        error,
3053                    }),
3054                }
3055            }
3056
3057            ordinal => {
3058                handler.on_unknown_interaction(ordinal).await;
3059                if ::core::matches!(
3060                    message.header().flexibility(),
3061                    ::fidl_next::protocol::Flexibility::Strict
3062                ) {
3063                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3064                } else {
3065                    responder
3066                        .respond_framework_error(
3067                            ordinal,
3068                            ::fidl_next::FrameworkError::UnknownMethod,
3069                        )
3070                        .expect("encoding a framework error should never fail")
3071                        .await?;
3072                    Ok(())
3073                }
3074            }
3075        }
3076    }
3077}
3078
3079impl<___T> InputDeviceClientHandler<___T> for ::fidl_next::IgnoreEvents
3080where
3081    ___T: ::fidl_next::Transport,
3082{
3083    async fn on_unknown_interaction(&mut self, _: u64) {}
3084}
3085
3086impl<___H, ___T> InputDeviceLocalClientHandler<___T> for ::fidl_next::Local<___H>
3087where
3088    ___H: InputDeviceClientHandler<___T>,
3089    ___T: ::fidl_next::Transport,
3090{
3091    async fn on_unknown_interaction(&mut self, ordinal: u64) {
3092        ___H::on_unknown_interaction(&mut self.0, ordinal).await
3093    }
3094}
3095
3096impl<___H, ___T> InputDeviceLocalServerHandler<___T> for ::fidl_next::Local<___H>
3097where
3098    ___H: InputDeviceServerHandler<___T>,
3099    ___T: ::fidl_next::Transport,
3100{
3101    async fn get_input_reports_reader(
3102        &mut self,
3103
3104        request: ::fidl_next::Request<input_device::GetInputReportsReader, ___T>,
3105    ) {
3106        ___H::get_input_reports_reader(&mut self.0, request).await
3107    }
3108
3109    async fn get_input_reports_reader_v2(
3110        &mut self,
3111
3112        request: ::fidl_next::Request<input_device::GetInputReportsReaderV2, ___T>,
3113
3114        responder: ::fidl_next::Responder<input_device::GetInputReportsReaderV2, ___T>,
3115    ) {
3116        ___H::get_input_reports_reader_v2(&mut self.0, request, responder).await
3117    }
3118
3119    async fn get_descriptor(
3120        &mut self,
3121
3122        responder: ::fidl_next::Responder<input_device::GetDescriptor, ___T>,
3123    ) {
3124        ___H::get_descriptor(&mut self.0, responder).await
3125    }
3126
3127    async fn send_output_report(
3128        &mut self,
3129
3130        request: ::fidl_next::Request<input_device::SendOutputReport, ___T>,
3131
3132        responder: ::fidl_next::Responder<input_device::SendOutputReport, ___T>,
3133    ) {
3134        ___H::send_output_report(&mut self.0, request, responder).await
3135    }
3136
3137    async fn get_feature_report(
3138        &mut self,
3139
3140        responder: ::fidl_next::Responder<input_device::GetFeatureReport, ___T>,
3141    ) {
3142        ___H::get_feature_report(&mut self.0, responder).await
3143    }
3144
3145    async fn set_feature_report(
3146        &mut self,
3147
3148        request: ::fidl_next::Request<input_device::SetFeatureReport, ___T>,
3149
3150        responder: ::fidl_next::Responder<input_device::SetFeatureReport, ___T>,
3151    ) {
3152        ___H::set_feature_report(&mut self.0, request, responder).await
3153    }
3154
3155    async fn get_input_report(
3156        &mut self,
3157
3158        request: ::fidl_next::Request<input_device::GetInputReport, ___T>,
3159
3160        responder: ::fidl_next::Responder<input_device::GetInputReport, ___T>,
3161    ) {
3162        ___H::get_input_report(&mut self.0, request, responder).await
3163    }
3164
3165    async fn on_unknown_interaction(&mut self, ordinal: u64) {
3166        ___H::on_unknown_interaction(&mut self.0, ordinal).await
3167    }
3168}
3169
3170/// The type corresponding to the InputReportsReader protocol.
3171#[doc = " Each `InputReportsReader` has its own FIFO of InputReports that it maintains.\n When ReadInputReports is called it drains the InputReports FIFO.\n If too many InputReports are created before the FIFO is drained, then\n the oldest InputReport will be silently discarded.\n"]
3172#[derive(PartialEq, Debug)]
3173pub struct InputReportsReader;
3174
3175#[cfg(target_os = "fuchsia")]
3176impl ::fidl_next::HasTransport for InputReportsReader {
3177    type Transport = ::fidl_next::fuchsia::zx::Channel;
3178}
3179
3180pub mod input_reports_reader {
3181    pub mod prelude {
3182        pub use crate::{
3183            InputReportsReader, InputReportsReaderClientHandler,
3184            InputReportsReaderLocalClientHandler, InputReportsReaderLocalServerHandler,
3185            InputReportsReaderServerHandler, input_reports_reader,
3186        };
3187
3188        pub use crate::natural::InputReportsReaderReadInputReportsResponse;
3189    }
3190
3191    pub struct ReadInputReports;
3192
3193    impl ::fidl_next::Method for ReadInputReports {
3194        const ORDINAL: u64 = 3861255986002273625;
3195        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3196            ::fidl_next::protocol::Flexibility::Strict;
3197
3198        type Protocol = crate::InputReportsReader;
3199
3200        type Request = ::fidl_next::wire::EmptyMessageBody;
3201    }
3202
3203    impl ::fidl_next::TwoWayMethod for ReadInputReports {
3204        type Response = ::fidl_next::wire::Result<
3205            'static,
3206            crate::wire::InputReportsReaderReadInputReportsResponse<'static>,
3207            ::fidl_next::wire::fuchsia::Status,
3208        >;
3209    }
3210
3211    impl<___R> ::fidl_next::Respond<___R> for ReadInputReports {
3212        type Output = ::core::result::Result<
3213            crate::generic::InputReportsReaderReadInputReportsResponse<___R>,
3214            ::fidl_next::never::Never,
3215        >;
3216
3217        fn respond(response: ___R) -> Self::Output {
3218            ::core::result::Result::Ok(crate::generic::InputReportsReaderReadInputReportsResponse {
3219                reports: response,
3220            })
3221        }
3222    }
3223
3224    impl<___R> ::fidl_next::RespondErr<___R> for ReadInputReports {
3225        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3226
3227        fn respond_err(response: ___R) -> Self::Output {
3228            ::core::result::Result::Err(response)
3229        }
3230    }
3231
3232    mod ___detail {
3233        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::InputReportsReader
3234        where
3235            ___T: ::fidl_next::Transport,
3236        {
3237            type Client = InputReportsReaderClient<___T>;
3238            type Server = InputReportsReaderServer<___T>;
3239        }
3240
3241        /// The client for the `InputReportsReader` protocol.
3242        #[repr(transparent)]
3243        pub struct InputReportsReaderClient<___T: ::fidl_next::Transport> {
3244            #[allow(dead_code)]
3245            client: ::fidl_next::protocol::Client<___T>,
3246        }
3247
3248        impl<___T> InputReportsReaderClient<___T>
3249        where
3250            ___T: ::fidl_next::Transport,
3251        {
3252            #[doc = " This is a Hanging-Get function to read the reports in the\n InputReport FIFO. This will not reply until there is at least one\n report available.\n If there is already one outstanding Hanging-Get, calling this\n again will return ZX_ERR_ALREADY_BOUND.\n"]
3253            pub fn read_input_reports(
3254                &self,
3255            ) -> ::fidl_next::TwoWayFuture<'_, super::ReadInputReports, ___T> {
3256                ::fidl_next::TwoWayFuture::from_untyped(
3257                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
3258                        3861255986002273625,
3259                        <super::ReadInputReports as ::fidl_next::Method>::FLEXIBILITY,
3260                        (),
3261                    ),
3262                )
3263            }
3264        }
3265
3266        /// The server for the `InputReportsReader` protocol.
3267        #[repr(transparent)]
3268        pub struct InputReportsReaderServer<___T: ::fidl_next::Transport> {
3269            server: ::fidl_next::protocol::Server<___T>,
3270        }
3271
3272        impl<___T> InputReportsReaderServer<___T> where ___T: ::fidl_next::Transport {}
3273    }
3274}
3275
3276#[diagnostic::on_unimplemented(
3277    note = "If {Self} implements the non-local InputReportsReaderClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3278)]
3279
3280/// A client handler for the InputReportsReader protocol.
3281///
3282/// See [`InputReportsReader`] for more details.
3283pub trait InputReportsReaderLocalClientHandler<
3284    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3285    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3286>
3287{
3288}
3289
3290impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for InputReportsReader
3291where
3292    ___H: InputReportsReaderLocalClientHandler<___T>,
3293    ___T: ::fidl_next::Transport,
3294{
3295    async fn on_event(
3296        handler: &mut ___H,
3297        mut message: ::fidl_next::Message<___T>,
3298    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3299        match *message.header().ordinal {
3300            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3301        }
3302    }
3303}
3304
3305#[diagnostic::on_unimplemented(
3306    note = "If {Self} implements the non-local InputReportsReaderServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3307)]
3308
3309/// A server handler for the InputReportsReader protocol.
3310///
3311/// See [`InputReportsReader`] for more details.
3312pub trait InputReportsReaderLocalServerHandler<
3313    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3314    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3315>
3316{
3317    #[doc = " This is a Hanging-Get function to read the reports in the\n InputReport FIFO. This will not reply until there is at least one\n report available.\n If there is already one outstanding Hanging-Get, calling this\n again will return ZX_ERR_ALREADY_BOUND.\n"]
3318    fn read_input_reports(
3319        &mut self,
3320
3321        responder: ::fidl_next::Responder<input_reports_reader::ReadInputReports, ___T>,
3322    ) -> impl ::core::future::Future<Output = ()>;
3323}
3324
3325impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for InputReportsReader
3326where
3327    ___H: InputReportsReaderLocalServerHandler<___T>,
3328    ___T: ::fidl_next::Transport,
3329{
3330    async fn on_one_way(
3331        handler: &mut ___H,
3332        mut message: ::fidl_next::Message<___T>,
3333    ) -> ::core::result::Result<
3334        (),
3335        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3336    > {
3337        match *message.header().ordinal {
3338            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3339        }
3340    }
3341
3342    async fn on_two_way(
3343        handler: &mut ___H,
3344        mut message: ::fidl_next::Message<___T>,
3345        responder: ::fidl_next::protocol::Responder<___T>,
3346    ) -> ::core::result::Result<
3347        (),
3348        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3349    > {
3350        match *message.header().ordinal {
3351            3861255986002273625 => {
3352                let responder = ::fidl_next::Responder::from_untyped(responder);
3353
3354                handler.read_input_reports(responder).await;
3355                Ok(())
3356            }
3357
3358            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3359        }
3360    }
3361}
3362
3363/// A client handler for the InputReportsReader protocol.
3364///
3365/// See [`InputReportsReader`] for more details.
3366pub trait InputReportsReaderClientHandler<
3367    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3368    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3369>
3370{
3371}
3372
3373impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for InputReportsReader
3374where
3375    ___H: InputReportsReaderClientHandler<___T> + ::core::marker::Send,
3376    ___T: ::fidl_next::Transport,
3377{
3378    async fn on_event(
3379        handler: &mut ___H,
3380        mut message: ::fidl_next::Message<___T>,
3381    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3382        match *message.header().ordinal {
3383            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3384        }
3385    }
3386}
3387
3388/// A server handler for the InputReportsReader protocol.
3389///
3390/// See [`InputReportsReader`] for more details.
3391pub trait InputReportsReaderServerHandler<
3392    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3393    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3394>
3395{
3396    #[doc = " This is a Hanging-Get function to read the reports in the\n InputReport FIFO. This will not reply until there is at least one\n report available.\n If there is already one outstanding Hanging-Get, calling this\n again will return ZX_ERR_ALREADY_BOUND.\n"]
3397    fn read_input_reports(
3398        &mut self,
3399
3400        responder: ::fidl_next::Responder<input_reports_reader::ReadInputReports, ___T>,
3401    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3402}
3403
3404impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for InputReportsReader
3405where
3406    ___H: InputReportsReaderServerHandler<___T> + ::core::marker::Send,
3407    ___T: ::fidl_next::Transport,
3408{
3409    async fn on_one_way(
3410        handler: &mut ___H,
3411        mut message: ::fidl_next::Message<___T>,
3412    ) -> ::core::result::Result<
3413        (),
3414        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3415    > {
3416        match *message.header().ordinal {
3417            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3418        }
3419    }
3420
3421    async fn on_two_way(
3422        handler: &mut ___H,
3423        mut message: ::fidl_next::Message<___T>,
3424        responder: ::fidl_next::protocol::Responder<___T>,
3425    ) -> ::core::result::Result<
3426        (),
3427        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3428    > {
3429        match *message.header().ordinal {
3430            3861255986002273625 => {
3431                let responder = ::fidl_next::Responder::from_untyped(responder);
3432
3433                handler.read_input_reports(responder).await;
3434                Ok(())
3435            }
3436
3437            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3438        }
3439    }
3440}
3441
3442impl<___T> InputReportsReaderClientHandler<___T> for ::fidl_next::IgnoreEvents where
3443    ___T: ::fidl_next::Transport
3444{
3445}
3446
3447impl<___H, ___T> InputReportsReaderLocalClientHandler<___T> for ::fidl_next::Local<___H>
3448where
3449    ___H: InputReportsReaderClientHandler<___T>,
3450    ___T: ::fidl_next::Transport,
3451{
3452}
3453
3454impl<___H, ___T> InputReportsReaderLocalServerHandler<___T> for ::fidl_next::Local<___H>
3455where
3456    ___H: InputReportsReaderServerHandler<___T>,
3457    ___T: ::fidl_next::Transport,
3458{
3459    async fn read_input_reports(
3460        &mut self,
3461
3462        responder: ::fidl_next::Responder<input_reports_reader::ReadInputReports, ___T>,
3463    ) {
3464        ___H::read_input_reports(&mut self.0, responder).await
3465    }
3466}
3467
3468/// The type corresponding to the InputReportsReaderV2 protocol.
3469#[doc = " A reader protocol that reports input events.\n"]
3470#[derive(PartialEq, Debug)]
3471pub struct InputReportsReaderV2;
3472
3473#[cfg(target_os = "fuchsia")]
3474impl ::fidl_next::HasTransport for InputReportsReaderV2 {
3475    type Transport = ::fidl_next::fuchsia::zx::Channel;
3476}
3477
3478pub mod input_reports_reader_v2 {
3479    pub mod prelude {
3480        pub use crate::{
3481            InputReportsReaderV2, InputReportsReaderV2ClientHandler,
3482            InputReportsReaderV2LocalClientHandler, InputReportsReaderV2LocalServerHandler,
3483            InputReportsReaderV2ServerHandler, input_reports_reader_v2,
3484        };
3485
3486        pub use crate::natural::InputReportsReaderV2AcknowledgeReportsRequest;
3487
3488        pub use crate::natural::InputReportsReaderV2OnInputReportsRequest;
3489    }
3490
3491    pub struct OnInputReports;
3492
3493    impl ::fidl_next::Method for OnInputReports {
3494        const ORDINAL: u64 = 6354256711421322169;
3495        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3496            ::fidl_next::protocol::Flexibility::Flexible;
3497
3498        type Protocol = crate::InputReportsReaderV2;
3499
3500        type Request = crate::wire::InputReportsReaderV2OnInputReportsRequest<'static>;
3501    }
3502
3503    pub struct AcknowledgeReports;
3504
3505    impl ::fidl_next::Method for AcknowledgeReports {
3506        const ORDINAL: u64 = 8249168730373743369;
3507        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3508            ::fidl_next::protocol::Flexibility::Flexible;
3509
3510        type Protocol = crate::InputReportsReaderV2;
3511
3512        type Request = crate::wire::InputReportsReaderV2AcknowledgeReportsRequest;
3513    }
3514
3515    mod ___detail {
3516        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::InputReportsReaderV2
3517        where
3518            ___T: ::fidl_next::Transport,
3519        {
3520            type Client = InputReportsReaderV2Client<___T>;
3521            type Server = InputReportsReaderV2Server<___T>;
3522        }
3523
3524        /// The client for the `InputReportsReaderV2` protocol.
3525        #[repr(transparent)]
3526        pub struct InputReportsReaderV2Client<___T: ::fidl_next::Transport> {
3527            #[allow(dead_code)]
3528            client: ::fidl_next::protocol::Client<___T>,
3529        }
3530
3531        impl<___T> InputReportsReaderV2Client<___T>
3532        where
3533            ___T: ::fidl_next::Transport,
3534        {
3535            #[doc = " The client has processed events up to `last_acknowledged_report_stamp`.\n All reports sent with a `last_report_stamp` less than or equal to\n `last_acknowledged_report_stamp` will be considered acknowledged, and therefore\n will not count towards the `max_unacknowledged_reports` limit.\n"]
3536            pub fn acknowledge_reports(
3537                &self,
3538
3539                last_acknowledged_report_stamp: impl ::fidl_next::Encode<
3540                    ::fidl_next::wire::Uint64,
3541                    <___T as ::fidl_next::Transport>::SendBuffer,
3542                >,
3543            ) -> ::fidl_next::SendFuture<'_, ___T>
3544            where
3545                <___T as ::fidl_next::Transport>::SendBuffer:
3546                    ::fidl_next::encoder::InternalHandleEncoder,
3547            {
3548                self.acknowledge_reports_with(
3549                    crate::generic::InputReportsReaderV2AcknowledgeReportsRequest {
3550                        last_acknowledged_report_stamp,
3551                    },
3552                )
3553            }
3554
3555            #[doc = " The client has processed events up to `last_acknowledged_report_stamp`.\n All reports sent with a `last_report_stamp` less than or equal to\n `last_acknowledged_report_stamp` will be considered acknowledged, and therefore\n will not count towards the `max_unacknowledged_reports` limit.\n"]
3556            pub fn acknowledge_reports_with<___R>(
3557                &self,
3558                request: ___R,
3559            ) -> ::fidl_next::SendFuture<'_, ___T>
3560            where
3561                ___R: ::fidl_next::Encode<
3562                        crate::wire::InputReportsReaderV2AcknowledgeReportsRequest,
3563                        <___T as ::fidl_next::Transport>::SendBuffer,
3564                    >,
3565            {
3566                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
3567                    8249168730373743369,
3568                    <super::AcknowledgeReports as ::fidl_next::Method>::FLEXIBILITY,
3569                    request,
3570                ))
3571            }
3572        }
3573
3574        /// The server for the `InputReportsReaderV2` protocol.
3575        #[repr(transparent)]
3576        pub struct InputReportsReaderV2Server<___T: ::fidl_next::Transport> {
3577            server: ::fidl_next::protocol::Server<___T>,
3578        }
3579
3580        impl<___T> InputReportsReaderV2Server<___T>
3581        where
3582            ___T: ::fidl_next::Transport,
3583        {
3584            #[doc = " The device pushes events to the client.\n The client does not need to acknowledge every report; it can allow multiple\n reports to be in flight up to `max_unacknowledged_reports`.\n\n Streaming begins automatically on connection.\n"]
3585            pub fn on_input_reports(
3586                &self,
3587
3588                reports: impl ::fidl_next::Encode<
3589                    ::fidl_next::wire::Vector<'static, crate::wire::InputReport<'static>>,
3590                    <___T as ::fidl_next::Transport>::SendBuffer,
3591                >,
3592
3593                last_report_stamp: impl ::fidl_next::Encode<
3594                    ::fidl_next::wire::Uint64,
3595                    <___T as ::fidl_next::Transport>::SendBuffer,
3596                >,
3597            ) -> ::fidl_next::SendFuture<'_, ___T>
3598            where
3599                <___T as ::fidl_next::Transport>::SendBuffer:
3600                    ::fidl_next::encoder::InternalHandleEncoder,
3601                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3602                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3603            {
3604                self.on_input_reports_with(
3605                    crate::generic::InputReportsReaderV2OnInputReportsRequest {
3606                        reports,
3607
3608                        last_report_stamp,
3609                    },
3610                )
3611            }
3612
3613            #[doc = " The device pushes events to the client.\n The client does not need to acknowledge every report; it can allow multiple\n reports to be in flight up to `max_unacknowledged_reports`.\n\n Streaming begins automatically on connection.\n"]
3614
3615            pub fn on_input_reports_with<___R>(
3616                &self,
3617                request: ___R,
3618            ) -> ::fidl_next::SendFuture<'_, ___T>
3619            where
3620                ___R: ::fidl_next::Encode<
3621                        <super::OnInputReports as ::fidl_next::Method>::Request,
3622                        <___T as ::fidl_next::Transport>::SendBuffer,
3623                    >,
3624            {
3625                ::fidl_next::SendFuture::from_untyped(self.server.send_event(
3626                    6354256711421322169,
3627                    <super::OnInputReports as ::fidl_next::Method>::FLEXIBILITY,
3628                    request,
3629                ))
3630            }
3631        }
3632    }
3633}
3634
3635#[diagnostic::on_unimplemented(
3636    note = "If {Self} implements the non-local InputReportsReaderV2ClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3637)]
3638
3639/// A client handler for the InputReportsReaderV2 protocol.
3640///
3641/// See [`InputReportsReaderV2`] for more details.
3642pub trait InputReportsReaderV2LocalClientHandler<
3643    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3644    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3645>
3646{
3647    #[doc = " The device pushes events to the client.\n The client does not need to acknowledge every report; it can allow multiple\n reports to be in flight up to `max_unacknowledged_reports`.\n\n Streaming begins automatically on connection.\n"]
3648    fn on_input_reports(
3649        &mut self,
3650
3651        request: ::fidl_next::Request<input_reports_reader_v2::OnInputReports, ___T>,
3652    ) -> impl ::core::future::Future<Output = ()>;
3653
3654    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3655        ::core::future::ready(())
3656    }
3657}
3658
3659impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for InputReportsReaderV2
3660where
3661    ___H: InputReportsReaderV2LocalClientHandler<___T>,
3662    ___T: ::fidl_next::Transport,
3663    for<'de> crate::wire::InputReportsReaderV2OnInputReportsRequest<'de>: ::fidl_next::Decode<
3664            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3665            Constraint = (),
3666        >,
3667{
3668    async fn on_event(
3669        handler: &mut ___H,
3670        mut message: ::fidl_next::Message<___T>,
3671    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3672        match *message.header().ordinal {
3673            6354256711421322169 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3674                Ok(decoded) => {
3675                    handler.on_input_reports(::fidl_next::Request::from_decoded(decoded)).await;
3676                    Ok(())
3677                }
3678                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3679                    ordinal: 6354256711421322169,
3680                    error,
3681                }),
3682            },
3683
3684            ordinal => {
3685                handler.on_unknown_interaction(ordinal).await;
3686                if ::core::matches!(
3687                    message.header().flexibility(),
3688                    ::fidl_next::protocol::Flexibility::Strict
3689                ) {
3690                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3691                } else {
3692                    Ok(())
3693                }
3694            }
3695        }
3696    }
3697}
3698
3699#[diagnostic::on_unimplemented(
3700    note = "If {Self} implements the non-local InputReportsReaderV2ServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3701)]
3702
3703/// A server handler for the InputReportsReaderV2 protocol.
3704///
3705/// See [`InputReportsReaderV2`] for more details.
3706pub trait InputReportsReaderV2LocalServerHandler<
3707    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3708    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3709>
3710{
3711    #[doc = " The client has processed events up to `last_acknowledged_report_stamp`.\n All reports sent with a `last_report_stamp` less than or equal to\n `last_acknowledged_report_stamp` will be considered acknowledged, and therefore\n will not count towards the `max_unacknowledged_reports` limit.\n"]
3712    fn acknowledge_reports(
3713        &mut self,
3714
3715        request: ::fidl_next::Request<input_reports_reader_v2::AcknowledgeReports, ___T>,
3716    ) -> impl ::core::future::Future<Output = ()>;
3717
3718    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3719        ::core::future::ready(())
3720    }
3721}
3722
3723impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for InputReportsReaderV2
3724where
3725    ___H: InputReportsReaderV2LocalServerHandler<___T>,
3726    ___T: ::fidl_next::Transport,
3727    for<'de> crate::wire::InputReportsReaderV2AcknowledgeReportsRequest: ::fidl_next::Decode<
3728            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3729            Constraint = (),
3730        >,
3731{
3732    async fn on_one_way(
3733        handler: &mut ___H,
3734        mut message: ::fidl_next::Message<___T>,
3735    ) -> ::core::result::Result<
3736        (),
3737        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3738    > {
3739        match *message.header().ordinal {
3740            8249168730373743369 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3741                Ok(decoded) => {
3742                    handler.acknowledge_reports(::fidl_next::Request::from_decoded(decoded)).await;
3743                    Ok(())
3744                }
3745                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3746                    ordinal: 8249168730373743369,
3747                    error,
3748                }),
3749            },
3750
3751            ordinal => {
3752                handler.on_unknown_interaction(ordinal).await;
3753                if ::core::matches!(
3754                    message.header().flexibility(),
3755                    ::fidl_next::protocol::Flexibility::Strict
3756                ) {
3757                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3758                } else {
3759                    Ok(())
3760                }
3761            }
3762        }
3763    }
3764
3765    async fn on_two_way(
3766        handler: &mut ___H,
3767        mut message: ::fidl_next::Message<___T>,
3768        responder: ::fidl_next::protocol::Responder<___T>,
3769    ) -> ::core::result::Result<
3770        (),
3771        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3772    > {
3773        match *message.header().ordinal {
3774            ordinal => {
3775                handler.on_unknown_interaction(ordinal).await;
3776                if ::core::matches!(
3777                    message.header().flexibility(),
3778                    ::fidl_next::protocol::Flexibility::Strict
3779                ) {
3780                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3781                } else {
3782                    responder
3783                        .respond_framework_error(
3784                            ordinal,
3785                            ::fidl_next::FrameworkError::UnknownMethod,
3786                        )
3787                        .expect("encoding a framework error should never fail")
3788                        .await?;
3789                    Ok(())
3790                }
3791            }
3792        }
3793    }
3794}
3795
3796/// A client handler for the InputReportsReaderV2 protocol.
3797///
3798/// See [`InputReportsReaderV2`] for more details.
3799pub trait InputReportsReaderV2ClientHandler<
3800    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3801    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3802>
3803{
3804    #[doc = " The device pushes events to the client.\n The client does not need to acknowledge every report; it can allow multiple\n reports to be in flight up to `max_unacknowledged_reports`.\n\n Streaming begins automatically on connection.\n"]
3805    fn on_input_reports(
3806        &mut self,
3807
3808        request: ::fidl_next::Request<input_reports_reader_v2::OnInputReports, ___T>,
3809    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3810
3811    fn on_unknown_interaction(
3812        &mut self,
3813        ordinal: u64,
3814    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3815        ::core::future::ready(())
3816    }
3817}
3818
3819impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for InputReportsReaderV2
3820where
3821    ___H: InputReportsReaderV2ClientHandler<___T> + ::core::marker::Send,
3822    ___T: ::fidl_next::Transport,
3823    for<'de> crate::wire::InputReportsReaderV2OnInputReportsRequest<'de>: ::fidl_next::Decode<
3824            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3825            Constraint = (),
3826        >,
3827{
3828    async fn on_event(
3829        handler: &mut ___H,
3830        mut message: ::fidl_next::Message<___T>,
3831    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3832        match *message.header().ordinal {
3833            6354256711421322169 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3834                Ok(decoded) => {
3835                    handler.on_input_reports(::fidl_next::Request::from_decoded(decoded)).await;
3836                    Ok(())
3837                }
3838                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3839                    ordinal: 6354256711421322169,
3840                    error,
3841                }),
3842            },
3843
3844            ordinal => {
3845                handler.on_unknown_interaction(ordinal).await;
3846                if ::core::matches!(
3847                    message.header().flexibility(),
3848                    ::fidl_next::protocol::Flexibility::Strict
3849                ) {
3850                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3851                } else {
3852                    Ok(())
3853                }
3854            }
3855        }
3856    }
3857}
3858
3859/// A server handler for the InputReportsReaderV2 protocol.
3860///
3861/// See [`InputReportsReaderV2`] for more details.
3862pub trait InputReportsReaderV2ServerHandler<
3863    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3864    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3865>
3866{
3867    #[doc = " The client has processed events up to `last_acknowledged_report_stamp`.\n All reports sent with a `last_report_stamp` less than or equal to\n `last_acknowledged_report_stamp` will be considered acknowledged, and therefore\n will not count towards the `max_unacknowledged_reports` limit.\n"]
3868    fn acknowledge_reports(
3869        &mut self,
3870
3871        request: ::fidl_next::Request<input_reports_reader_v2::AcknowledgeReports, ___T>,
3872    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3873
3874    fn on_unknown_interaction(
3875        &mut self,
3876        ordinal: u64,
3877    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3878        ::core::future::ready(())
3879    }
3880}
3881
3882impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for InputReportsReaderV2
3883where
3884    ___H: InputReportsReaderV2ServerHandler<___T> + ::core::marker::Send,
3885    ___T: ::fidl_next::Transport,
3886    for<'de> crate::wire::InputReportsReaderV2AcknowledgeReportsRequest: ::fidl_next::Decode<
3887            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3888            Constraint = (),
3889        >,
3890{
3891    async fn on_one_way(
3892        handler: &mut ___H,
3893        mut message: ::fidl_next::Message<___T>,
3894    ) -> ::core::result::Result<
3895        (),
3896        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3897    > {
3898        match *message.header().ordinal {
3899            8249168730373743369 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
3900                Ok(decoded) => {
3901                    handler.acknowledge_reports(::fidl_next::Request::from_decoded(decoded)).await;
3902                    Ok(())
3903                }
3904                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3905                    ordinal: 8249168730373743369,
3906                    error,
3907                }),
3908            },
3909
3910            ordinal => {
3911                handler.on_unknown_interaction(ordinal).await;
3912                if ::core::matches!(
3913                    message.header().flexibility(),
3914                    ::fidl_next::protocol::Flexibility::Strict
3915                ) {
3916                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3917                } else {
3918                    Ok(())
3919                }
3920            }
3921        }
3922    }
3923
3924    async fn on_two_way(
3925        handler: &mut ___H,
3926        mut message: ::fidl_next::Message<___T>,
3927        responder: ::fidl_next::protocol::Responder<___T>,
3928    ) -> ::core::result::Result<
3929        (),
3930        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3931    > {
3932        match *message.header().ordinal {
3933            ordinal => {
3934                handler.on_unknown_interaction(ordinal).await;
3935                if ::core::matches!(
3936                    message.header().flexibility(),
3937                    ::fidl_next::protocol::Flexibility::Strict
3938                ) {
3939                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3940                } else {
3941                    responder
3942                        .respond_framework_error(
3943                            ordinal,
3944                            ::fidl_next::FrameworkError::UnknownMethod,
3945                        )
3946                        .expect("encoding a framework error should never fail")
3947                        .await?;
3948                    Ok(())
3949                }
3950            }
3951        }
3952    }
3953}
3954
3955impl<___T> InputReportsReaderV2ClientHandler<___T> for ::fidl_next::IgnoreEvents
3956where
3957    ___T: ::fidl_next::Transport,
3958{
3959    async fn on_input_reports(
3960        &mut self,
3961
3962        _: ::fidl_next::Request<input_reports_reader_v2::OnInputReports, ___T>,
3963    ) {
3964    }
3965
3966    async fn on_unknown_interaction(&mut self, _: u64) {}
3967}
3968
3969impl<___H, ___T> InputReportsReaderV2LocalClientHandler<___T> for ::fidl_next::Local<___H>
3970where
3971    ___H: InputReportsReaderV2ClientHandler<___T>,
3972    ___T: ::fidl_next::Transport,
3973{
3974    async fn on_input_reports(
3975        &mut self,
3976
3977        request: ::fidl_next::Request<input_reports_reader_v2::OnInputReports, ___T>,
3978    ) {
3979        ___H::on_input_reports(&mut self.0, request).await
3980    }
3981
3982    async fn on_unknown_interaction(&mut self, ordinal: u64) {
3983        ___H::on_unknown_interaction(&mut self.0, ordinal).await
3984    }
3985}
3986
3987impl<___H, ___T> InputReportsReaderV2LocalServerHandler<___T> for ::fidl_next::Local<___H>
3988where
3989    ___H: InputReportsReaderV2ServerHandler<___T>,
3990    ___T: ::fidl_next::Transport,
3991{
3992    async fn acknowledge_reports(
3993        &mut self,
3994
3995        request: ::fidl_next::Request<input_reports_reader_v2::AcknowledgeReports, ___T>,
3996    ) {
3997        ___H::acknowledge_reports(&mut self.0, request).await
3998    }
3999
4000    async fn on_unknown_interaction(&mut self, ordinal: u64) {
4001        ___H::on_unknown_interaction(&mut self.0, ordinal).await
4002    }
4003}
4004
4005/// The type corresponding to the Service service.
4006#[derive(Debug)]
4007pub struct Service;
4008
4009impl ::fidl_next::DiscoverableService for Service {
4010    const SERVICE_NAME: &'static str = "fuchsia.input.report.Service";
4011    const MEMBER_NAMES: &'static [&'static str] = &["input_device"];
4012}
4013
4014impl ::fidl_next::HasServiceRequest<::fidl_next::fuchsia::zx::Channel> for Service {}
4015
4016impl<___C> ::fidl_next::Service<___C> for Service
4017where
4018    ___C: ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>,
4019{
4020    type Connector = ServiceConnector<___C>;
4021}
4022
4023/// A strongly-typed service connector for the `Service` service.
4024#[repr(transparent)]
4025pub struct ServiceConnector<___C> {
4026    #[allow(dead_code)]
4027    connector: ___C,
4028}
4029
4030impl<___C> ServiceConnector<___C>
4031where
4032    ___C: ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>,
4033{
4034    /// Attempts to connect to the `input_device` service member.
4035    pub fn input_device(
4036        &self,
4037        server_end: ::fidl_next::ServerEnd<crate::InputDevice, ::fidl_next::fuchsia::zx::Channel>,
4038    ) -> ::core::result::Result<
4039        (),
4040        <___C as ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>>::Error,
4041    > {
4042        ::fidl_next::protocol::ServiceConnector::<
4043                ::fidl_next::fuchsia::zx::Channel
4044            >::connect_to_member(
4045                &self.connector,
4046                "input_device",
4047                server_end.into_untyped(),
4048            )
4049    }
4050}
4051
4052/// A service handler for the `Service` service.
4053pub trait ServiceHandler {
4054    /// Handles an attempt to connect to the `input_device` member.
4055    fn input_device(
4056        &self,
4057        server_end: ::fidl_next::ServerEnd<crate::InputDevice, ::fidl_next::fuchsia::zx::Channel>,
4058    );
4059}
4060
4061impl<___H, ___T> ::fidl_next::DispatchServiceHandler<___H, ___T> for Service
4062where
4063    ___H: ServiceHandler,
4064    ::fidl_next::fuchsia::zx::Channel: ::fidl_next::InstanceFromServiceTransport<___T>,
4065{
4066    fn on_connection(handler: &___H, member: &str, server_end: ___T) {
4067        use ::fidl_next::InstanceFromServiceTransport;
4068        match member {
4069            "input_device" => handler.input_device(::fidl_next::ServerEnd::from_untyped(
4070                ::fidl_next::fuchsia::zx::Channel::from_service_transport(server_end),
4071            )),
4072
4073            _ => unreachable!(),
4074        }
4075    }
4076}
4077
4078pub use fidl_next_common_fuchsia_input_report::*;