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    #[derive(Debug, PartialEq)]
10    #[repr(C)]
11    pub struct InputDeviceGetInputReportsReaderRequest {
12        pub reader:
13            ::fidl_next::ServerEnd<crate::InputReportsReader, ::fidl_next::fuchsia::zx::Channel>,
14    }
15
16    unsafe impl<___E>
17        ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportsReaderRequest, ___E>
18        for InputDeviceGetInputReportsReaderRequest
19    where
20        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21        ___E: ::fidl_next::fuchsia::HandleEncoder,
22    {
23        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
24            Self,
25            crate::wire::InputDeviceGetInputReportsReaderRequest,
26        > = unsafe {
27            ::fidl_next::CopyOptimization::enable_if(
28                true && <::fidl_next::ServerEnd<
29                    crate::InputReportsReader,
30                    ::fidl_next::fuchsia::zx::Channel,
31                > as ::fidl_next::Encode<
32                    ::fidl_next::ServerEnd<
33                        crate::InputReportsReader,
34                        ::fidl_next::wire::fuchsia::Channel,
35                    >,
36                    ___E,
37                >>::COPY_OPTIMIZATION
38                    .is_enabled(),
39            )
40        };
41
42        #[inline]
43        fn encode(
44            self,
45            encoder_: &mut ___E,
46            out_: &mut ::core::mem::MaybeUninit<
47                crate::wire::InputDeviceGetInputReportsReaderRequest,
48            >,
49            _: (),
50        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
51            ::fidl_next::munge! {
52                let crate::wire::InputDeviceGetInputReportsReaderRequest {
53                    reader,
54
55                } = out_;
56            }
57
58            ::fidl_next::Encode::encode(self.reader, encoder_, reader, ())?;
59
60            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(reader.as_mut_ptr()) };
61
62            Ok(())
63        }
64    }
65
66    unsafe impl<___E>
67        ::fidl_next::EncodeOption<
68            ::fidl_next::wire::Box<'static, crate::wire::InputDeviceGetInputReportsReaderRequest>,
69            ___E,
70        > for InputDeviceGetInputReportsReaderRequest
71    where
72        ___E: ::fidl_next::Encoder + ?Sized,
73        InputDeviceGetInputReportsReaderRequest:
74            ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportsReaderRequest, ___E>,
75    {
76        #[inline]
77        fn encode_option(
78            this: ::core::option::Option<Self>,
79            encoder: &mut ___E,
80            out: &mut ::core::mem::MaybeUninit<
81                ::fidl_next::wire::Box<
82                    'static,
83                    crate::wire::InputDeviceGetInputReportsReaderRequest,
84                >,
85            >,
86            _: (),
87        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
88            if let Some(inner) = this {
89                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
90                ::fidl_next::wire::Box::encode_present(out);
91            } else {
92                ::fidl_next::wire::Box::encode_absent(out);
93            }
94
95            Ok(())
96        }
97    }
98
99    impl ::fidl_next::FromWire<crate::wire::InputDeviceGetInputReportsReaderRequest>
100        for InputDeviceGetInputReportsReaderRequest
101    {
102        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
103            crate::wire::InputDeviceGetInputReportsReaderRequest,
104            Self,
105        > = unsafe {
106            ::fidl_next::CopyOptimization::enable_if(
107                true && <::fidl_next::ServerEnd<
108                    crate::InputReportsReader,
109                    ::fidl_next::fuchsia::zx::Channel,
110                > as ::fidl_next::FromWire<
111                    ::fidl_next::ServerEnd<
112                        crate::InputReportsReader,
113                        ::fidl_next::wire::fuchsia::Channel,
114                    >,
115                >>::COPY_OPTIMIZATION
116                    .is_enabled(),
117            )
118        };
119
120        #[inline]
121        fn from_wire(wire: crate::wire::InputDeviceGetInputReportsReaderRequest) -> Self {
122            Self { reader: ::fidl_next::FromWire::from_wire(wire.reader) }
123        }
124    }
125
126    #[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"]
127    #[derive(Debug, Default, PartialEq)]
128    pub struct InputReport {
129        pub event_time: ::core::option::Option<i64>,
130
131        pub mouse: ::core::option::Option<crate::natural::MouseInputReport>,
132
133        pub trace_id: ::core::option::Option<u64>,
134
135        pub sensor: ::core::option::Option<crate::natural::SensorInputReport>,
136
137        pub touch: ::core::option::Option<crate::natural::TouchInputReport>,
138
139        pub keyboard: ::core::option::Option<crate::natural::KeyboardInputReport>,
140
141        pub consumer_control: ::core::option::Option<crate::natural::ConsumerControlInputReport>,
142
143        pub report_id: ::core::option::Option<u8>,
144
145        pub wake_lease: ::core::option::Option<::fidl_next::fuchsia::zx::EventPair>,
146    }
147
148    impl InputReport {
149        fn __max_ordinal(&self) -> usize {
150            if self.wake_lease.is_some() {
151                return 9;
152            }
153
154            if self.report_id.is_some() {
155                return 8;
156            }
157
158            if self.consumer_control.is_some() {
159                return 7;
160            }
161
162            if self.keyboard.is_some() {
163                return 6;
164            }
165
166            if self.touch.is_some() {
167                return 5;
168            }
169
170            if self.sensor.is_some() {
171                return 4;
172            }
173
174            if self.trace_id.is_some() {
175                return 3;
176            }
177
178            if self.mouse.is_some() {
179                return 2;
180            }
181
182            if self.event_time.is_some() {
183                return 1;
184            }
185
186            0
187        }
188    }
189
190    unsafe impl<___E> ::fidl_next::Encode<crate::wire::InputReport<'static>, ___E> for InputReport
191    where
192        ___E: ::fidl_next::Encoder + ?Sized,
193        ___E: ::fidl_next::fuchsia::HandleEncoder,
194    {
195        #[inline]
196        fn encode(
197            mut self,
198            encoder: &mut ___E,
199            out: &mut ::core::mem::MaybeUninit<crate::wire::InputReport<'static>>,
200            _: (),
201        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
202            ::fidl_next::munge!(let crate::wire::InputReport { table } = out);
203
204            let max_ord = self.__max_ordinal();
205
206            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
207            ::fidl_next::Wire::zero_padding(&mut out);
208
209            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
210                ::fidl_next::wire::Envelope,
211            >(encoder, max_ord);
212
213            for i in 1..=max_ord {
214                match i {
215                    9 => {
216                        if let Some(value) = self.wake_lease.take() {
217                            ::fidl_next::wire::Envelope::encode_value::<
218                                ::fidl_next::wire::fuchsia::EventPair,
219                                ___E,
220                            >(
221                                value, preallocated.encoder, &mut out, ()
222                            )?;
223                        } else {
224                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
225                        }
226                    }
227
228                    8 => {
229                        if let Some(value) = self.report_id.take() {
230                            ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
231                                value,
232                                preallocated.encoder,
233                                &mut out,
234                                (),
235                            )?;
236                        } else {
237                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
238                        }
239                    }
240
241                    7 => {
242                        if let Some(value) = self.consumer_control.take() {
243                            ::fidl_next::wire::Envelope::encode_value::<
244                                crate::wire::ConsumerControlInputReport<'static>,
245                                ___E,
246                            >(
247                                value, preallocated.encoder, &mut out, ()
248                            )?;
249                        } else {
250                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
251                        }
252                    }
253
254                    6 => {
255                        if let Some(value) = self.keyboard.take() {
256                            ::fidl_next::wire::Envelope::encode_value::<
257                                crate::wire::KeyboardInputReport<'static>,
258                                ___E,
259                            >(
260                                value, preallocated.encoder, &mut out, ()
261                            )?;
262                        } else {
263                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
264                        }
265                    }
266
267                    5 => {
268                        if let Some(value) = self.touch.take() {
269                            ::fidl_next::wire::Envelope::encode_value::<
270                                crate::wire::TouchInputReport<'static>,
271                                ___E,
272                            >(
273                                value, preallocated.encoder, &mut out, ()
274                            )?;
275                        } else {
276                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
277                        }
278                    }
279
280                    4 => {
281                        if let Some(value) = self.sensor.take() {
282                            ::fidl_next::wire::Envelope::encode_value::<
283                                crate::wire::SensorInputReport<'static>,
284                                ___E,
285                            >(
286                                value, preallocated.encoder, &mut out, ()
287                            )?;
288                        } else {
289                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
290                        }
291                    }
292
293                    3 => {
294                        if let Some(value) = self.trace_id.take() {
295                            ::fidl_next::wire::Envelope::encode_value::<
296                                ::fidl_next::wire::Uint64,
297                                ___E,
298                            >(
299                                value, preallocated.encoder, &mut out, ()
300                            )?;
301                        } else {
302                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
303                        }
304                    }
305
306                    2 => {
307                        if let Some(value) = self.mouse.take() {
308                            ::fidl_next::wire::Envelope::encode_value::<
309                                crate::wire::MouseInputReport<'static>,
310                                ___E,
311                            >(
312                                value, preallocated.encoder, &mut out, ()
313                            )?;
314                        } else {
315                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
316                        }
317                    }
318
319                    1 => {
320                        if let Some(value) = self.event_time.take() {
321                            ::fidl_next::wire::Envelope::encode_value::<
322                                ::fidl_next::wire::Int64,
323                                ___E,
324                            >(
325                                value, preallocated.encoder, &mut out, ()
326                            )?;
327                        } else {
328                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
329                        }
330                    }
331
332                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
333                }
334                unsafe {
335                    preallocated.write_next(out.assume_init_ref());
336                }
337            }
338
339            ::fidl_next::wire::Table::encode_len(table, max_ord);
340
341            Ok(())
342        }
343    }
344
345    impl<'de> ::fidl_next::FromWire<crate::wire::InputReport<'de>> for InputReport {
346        #[inline]
347        fn from_wire(wire_: crate::wire::InputReport<'de>) -> Self {
348            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
349
350            let event_time = wire_.table.get(1);
351
352            let mouse = wire_.table.get(2);
353
354            let trace_id = wire_.table.get(3);
355
356            let sensor = wire_.table.get(4);
357
358            let touch = wire_.table.get(5);
359
360            let keyboard = wire_.table.get(6);
361
362            let consumer_control = wire_.table.get(7);
363
364            let report_id = wire_.table.get(8);
365
366            let wake_lease = wire_.table.get(9);
367
368            Self {
369                event_time: event_time.map(|envelope| {
370                    ::fidl_next::FromWire::from_wire(unsafe {
371                        envelope.read_unchecked::<::fidl_next::wire::Int64>()
372                    })
373                }),
374
375                mouse: mouse.map(|envelope| {
376                    ::fidl_next::FromWire::from_wire(unsafe {
377                        envelope.read_unchecked::<crate::wire::MouseInputReport<'de>>()
378                    })
379                }),
380
381                trace_id: trace_id.map(|envelope| {
382                    ::fidl_next::FromWire::from_wire(unsafe {
383                        envelope.read_unchecked::<::fidl_next::wire::Uint64>()
384                    })
385                }),
386
387                sensor: sensor.map(|envelope| {
388                    ::fidl_next::FromWire::from_wire(unsafe {
389                        envelope.read_unchecked::<crate::wire::SensorInputReport<'de>>()
390                    })
391                }),
392
393                touch: touch.map(|envelope| {
394                    ::fidl_next::FromWire::from_wire(unsafe {
395                        envelope.read_unchecked::<crate::wire::TouchInputReport<'de>>()
396                    })
397                }),
398
399                keyboard: keyboard.map(|envelope| {
400                    ::fidl_next::FromWire::from_wire(unsafe {
401                        envelope.read_unchecked::<crate::wire::KeyboardInputReport<'de>>()
402                    })
403                }),
404
405                consumer_control: consumer_control.map(|envelope| {
406                    ::fidl_next::FromWire::from_wire(unsafe {
407                        envelope.read_unchecked::<crate::wire::ConsumerControlInputReport<'de>>()
408                    })
409                }),
410
411                report_id: report_id.map(|envelope| {
412                    ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<u8>() })
413                }),
414
415                wake_lease: wake_lease.map(|envelope| {
416                    ::fidl_next::FromWire::from_wire(unsafe {
417                        envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
418                    })
419                }),
420            }
421        }
422    }
423
424    #[derive(Debug, PartialEq)]
425    pub struct InputDeviceGetInputReportResponse {
426        pub report: crate::natural::InputReport,
427    }
428
429    unsafe impl<___E>
430        ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportResponse<'static>, ___E>
431        for InputDeviceGetInputReportResponse
432    where
433        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
434        ___E: ::fidl_next::Encoder,
435        ___E: ::fidl_next::fuchsia::HandleEncoder,
436    {
437        #[inline]
438        fn encode(
439            self,
440            encoder_: &mut ___E,
441            out_: &mut ::core::mem::MaybeUninit<
442                crate::wire::InputDeviceGetInputReportResponse<'static>,
443            >,
444            _: (),
445        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
446            ::fidl_next::munge! {
447                let crate::wire::InputDeviceGetInputReportResponse {
448                    report,
449
450                } = out_;
451            }
452
453            ::fidl_next::Encode::encode(self.report, encoder_, report, ())?;
454
455            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(report.as_mut_ptr()) };
456
457            Ok(())
458        }
459    }
460
461    unsafe impl<___E>
462        ::fidl_next::EncodeOption<
463            ::fidl_next::wire::Box<
464                'static,
465                crate::wire::InputDeviceGetInputReportResponse<'static>,
466            >,
467            ___E,
468        > for InputDeviceGetInputReportResponse
469    where
470        ___E: ::fidl_next::Encoder + ?Sized,
471        InputDeviceGetInputReportResponse:
472            ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportResponse<'static>, ___E>,
473    {
474        #[inline]
475        fn encode_option(
476            this: ::core::option::Option<Self>,
477            encoder: &mut ___E,
478            out: &mut ::core::mem::MaybeUninit<
479                ::fidl_next::wire::Box<
480                    'static,
481                    crate::wire::InputDeviceGetInputReportResponse<'static>,
482                >,
483            >,
484            _: (),
485        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
486            if let Some(inner) = this {
487                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
488                ::fidl_next::wire::Box::encode_present(out);
489            } else {
490                ::fidl_next::wire::Box::encode_absent(out);
491            }
492
493            Ok(())
494        }
495    }
496
497    impl<'de> ::fidl_next::FromWire<crate::wire::InputDeviceGetInputReportResponse<'de>>
498        for InputDeviceGetInputReportResponse
499    {
500        #[inline]
501        fn from_wire(wire: crate::wire::InputDeviceGetInputReportResponse<'de>) -> Self {
502            Self { report: ::fidl_next::FromWire::from_wire(wire.report) }
503        }
504    }
505
506    #[derive(Debug, PartialEq)]
507    pub struct InputReportsReaderReadInputReportsResponse {
508        pub reports: ::std::vec::Vec<crate::natural::InputReport>,
509    }
510
511    unsafe impl<___E>
512        ::fidl_next::Encode<crate::wire::InputReportsReaderReadInputReportsResponse<'static>, ___E>
513        for InputReportsReaderReadInputReportsResponse
514    where
515        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
516        ___E: ::fidl_next::Encoder,
517        ___E: ::fidl_next::fuchsia::HandleEncoder,
518    {
519        #[inline]
520        fn encode(
521            self,
522            encoder_: &mut ___E,
523            out_: &mut ::core::mem::MaybeUninit<
524                crate::wire::InputReportsReaderReadInputReportsResponse<'static>,
525            >,
526            _: (),
527        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
528            ::fidl_next::munge! {
529                let crate::wire::InputReportsReaderReadInputReportsResponse {
530                    reports,
531
532                } = out_;
533            }
534
535            ::fidl_next::Encode::encode(self.reports, encoder_, reports, (50, ()))?;
536
537            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(reports.as_mut_ptr()) };
538            ::fidl_next::Constrained::validate(_field, (50, ()))?;
539
540            Ok(())
541        }
542    }
543
544    unsafe impl<___E>
545        ::fidl_next::EncodeOption<
546            ::fidl_next::wire::Box<
547                'static,
548                crate::wire::InputReportsReaderReadInputReportsResponse<'static>,
549            >,
550            ___E,
551        > for InputReportsReaderReadInputReportsResponse
552    where
553        ___E: ::fidl_next::Encoder + ?Sized,
554        InputReportsReaderReadInputReportsResponse: ::fidl_next::Encode<
555                crate::wire::InputReportsReaderReadInputReportsResponse<'static>,
556                ___E,
557            >,
558    {
559        #[inline]
560        fn encode_option(
561            this: ::core::option::Option<Self>,
562            encoder: &mut ___E,
563            out: &mut ::core::mem::MaybeUninit<
564                ::fidl_next::wire::Box<
565                    'static,
566                    crate::wire::InputReportsReaderReadInputReportsResponse<'static>,
567                >,
568            >,
569            _: (),
570        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
571            if let Some(inner) = this {
572                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
573                ::fidl_next::wire::Box::encode_present(out);
574            } else {
575                ::fidl_next::wire::Box::encode_absent(out);
576            }
577
578            Ok(())
579        }
580    }
581
582    impl<'de> ::fidl_next::FromWire<crate::wire::InputReportsReaderReadInputReportsResponse<'de>>
583        for InputReportsReaderReadInputReportsResponse
584    {
585        #[inline]
586        fn from_wire(wire: crate::wire::InputReportsReaderReadInputReportsResponse<'de>) -> Self {
587            Self { reports: ::fidl_next::FromWire::from_wire(wire.reports) }
588        }
589    }
590}
591
592pub mod wire {
593
594    pub use fidl_next_common_fuchsia_input_report::wire::*;
595
596    /// The wire type corresponding to [`InputDeviceGetInputReportsReaderRequest`].
597    #[derive(Debug)]
598    #[repr(C)]
599    pub struct InputDeviceGetInputReportsReaderRequest {
600        pub reader:
601            ::fidl_next::ServerEnd<crate::InputReportsReader, ::fidl_next::wire::fuchsia::Channel>,
602    }
603
604    static_assertions::const_assert_eq!(
605        std::mem::size_of::<InputDeviceGetInputReportsReaderRequest>(),
606        4
607    );
608    static_assertions::const_assert_eq!(
609        std::mem::align_of::<InputDeviceGetInputReportsReaderRequest>(),
610        4
611    );
612
613    static_assertions::const_assert_eq!(
614        std::mem::offset_of!(InputDeviceGetInputReportsReaderRequest, reader),
615        0
616    );
617
618    impl ::fidl_next::Constrained for InputDeviceGetInputReportsReaderRequest {
619        type Constraint = ();
620
621        fn validate(
622            _: ::fidl_next::Slot<'_, Self>,
623            _: Self::Constraint,
624        ) -> Result<(), ::fidl_next::ValidationError> {
625            Ok(())
626        }
627    }
628
629    unsafe impl ::fidl_next::Wire for InputDeviceGetInputReportsReaderRequest {
630        type Narrowed<'de> = InputDeviceGetInputReportsReaderRequest;
631
632        #[inline]
633        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
634            ::fidl_next::munge! {
635                let Self {
636                    reader,
637
638                } = &mut *out_;
639            }
640
641            ::fidl_next::Wire::zero_padding(reader);
642        }
643    }
644
645    unsafe impl<___D> ::fidl_next::Decode<___D> for InputDeviceGetInputReportsReaderRequest
646    where
647        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
648        ___D: ::fidl_next::fuchsia::HandleDecoder,
649    {
650        fn decode(
651            slot_: ::fidl_next::Slot<'_, Self>,
652            decoder_: &mut ___D,
653            _: (),
654        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
655            ::fidl_next::munge! {
656                let Self {
657                    mut reader,
658
659                } = slot_;
660            }
661
662            let _field = reader.as_mut();
663
664            ::fidl_next::Decode::decode(reader.as_mut(), decoder_, ())?;
665
666            Ok(())
667        }
668    }
669
670    impl ::fidl_next::IntoNatural for InputDeviceGetInputReportsReaderRequest {
671        type Natural = crate::natural::InputDeviceGetInputReportsReaderRequest;
672    }
673
674    /// The wire type corresponding to [`InputReport`].
675    #[repr(C)]
676    pub struct InputReport<'de> {
677        pub(crate) table: ::fidl_next::wire::Table<'de>,
678    }
679
680    impl<'de> Drop for InputReport<'de> {
681        fn drop(&mut self) {
682            let _ = self
683                .table
684                .get(1)
685                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Int64>() });
686
687            let _ = self.table.get(2).map(|envelope| unsafe {
688                envelope.read_unchecked::<crate::wire::MouseInputReport<'de>>()
689            });
690
691            let _ = self
692                .table
693                .get(3)
694                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
695
696            let _ = self.table.get(4).map(|envelope| unsafe {
697                envelope.read_unchecked::<crate::wire::SensorInputReport<'de>>()
698            });
699
700            let _ = self.table.get(5).map(|envelope| unsafe {
701                envelope.read_unchecked::<crate::wire::TouchInputReport<'de>>()
702            });
703
704            let _ = self.table.get(6).map(|envelope| unsafe {
705                envelope.read_unchecked::<crate::wire::KeyboardInputReport<'de>>()
706            });
707
708            let _ = self.table.get(7).map(|envelope| unsafe {
709                envelope.read_unchecked::<crate::wire::ConsumerControlInputReport<'de>>()
710            });
711
712            let _ = self.table.get(8).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
713
714            let _ = self.table.get(9).map(|envelope| unsafe {
715                envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
716            });
717        }
718    }
719
720    impl ::fidl_next::Constrained for InputReport<'_> {
721        type Constraint = ();
722
723        fn validate(
724            _: ::fidl_next::Slot<'_, Self>,
725            _: Self::Constraint,
726        ) -> Result<(), ::fidl_next::ValidationError> {
727            Ok(())
728        }
729    }
730
731    unsafe impl ::fidl_next::Wire for InputReport<'static> {
732        type Narrowed<'de> = InputReport<'de>;
733
734        #[inline]
735        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
736            ::fidl_next::munge!(let Self { table } = out);
737            ::fidl_next::wire::Table::zero_padding(table);
738        }
739    }
740
741    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for InputReport<'de>
742    where
743        ___D: ::fidl_next::Decoder<'de> + ?Sized,
744        ___D: ::fidl_next::fuchsia::HandleDecoder,
745    {
746        fn decode(
747            slot: ::fidl_next::Slot<'_, Self>,
748            decoder: &mut ___D,
749            _: (),
750        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
751            ::fidl_next::munge!(let Self { table } = slot);
752
753            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
754                match ordinal {
755                    0 => unsafe { ::core::hint::unreachable_unchecked() },
756
757                    1 => {
758                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Int64>(
759                            slot.as_mut(),
760                            decoder,
761                            (),
762                        )?;
763
764                        Ok(())
765                    }
766
767                    2 => {
768                        ::fidl_next::wire::Envelope::decode_as::<
769                            ___D,
770                            crate::wire::MouseInputReport<'de>,
771                        >(slot.as_mut(), decoder, ())?;
772
773                        Ok(())
774                    }
775
776                    3 => {
777                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
778                            slot.as_mut(),
779                            decoder,
780                            (),
781                        )?;
782
783                        Ok(())
784                    }
785
786                    4 => {
787                        ::fidl_next::wire::Envelope::decode_as::<
788                            ___D,
789                            crate::wire::SensorInputReport<'de>,
790                        >(slot.as_mut(), decoder, ())?;
791
792                        Ok(())
793                    }
794
795                    5 => {
796                        ::fidl_next::wire::Envelope::decode_as::<
797                            ___D,
798                            crate::wire::TouchInputReport<'de>,
799                        >(slot.as_mut(), decoder, ())?;
800
801                        Ok(())
802                    }
803
804                    6 => {
805                        ::fidl_next::wire::Envelope::decode_as::<
806                            ___D,
807                            crate::wire::KeyboardInputReport<'de>,
808                        >(slot.as_mut(), decoder, ())?;
809
810                        Ok(())
811                    }
812
813                    7 => {
814                        ::fidl_next::wire::Envelope::decode_as::<
815                            ___D,
816                            crate::wire::ConsumerControlInputReport<'de>,
817                        >(slot.as_mut(), decoder, ())?;
818
819                        Ok(())
820                    }
821
822                    8 => {
823                        ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
824                            slot.as_mut(),
825                            decoder,
826                            (),
827                        )?;
828
829                        Ok(())
830                    }
831
832                    9 => {
833                        ::fidl_next::wire::Envelope::decode_as::<
834                            ___D,
835                            ::fidl_next::wire::fuchsia::EventPair,
836                        >(slot.as_mut(), decoder, ())?;
837
838                        Ok(())
839                    }
840
841                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
842                }
843            })
844        }
845    }
846
847    impl<'de> InputReport<'de> {
848        pub fn event_time(&self) -> ::core::option::Option<&::fidl_next::wire::Int64> {
849            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
850        }
851
852        pub fn take_event_time(&mut self) -> ::core::option::Option<::fidl_next::wire::Int64> {
853            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
854        }
855
856        pub fn mouse(&self) -> ::core::option::Option<&crate::wire::MouseInputReport<'de>> {
857            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
858        }
859
860        pub fn take_mouse(&mut self) -> ::core::option::Option<crate::wire::MouseInputReport<'de>> {
861            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
862        }
863
864        pub fn trace_id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
865            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
866        }
867
868        pub fn take_trace_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
869            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
870        }
871
872        pub fn sensor(&self) -> ::core::option::Option<&crate::wire::SensorInputReport<'de>> {
873            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
874        }
875
876        pub fn take_sensor(
877            &mut self,
878        ) -> ::core::option::Option<crate::wire::SensorInputReport<'de>> {
879            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
880        }
881
882        pub fn touch(&self) -> ::core::option::Option<&crate::wire::TouchInputReport<'de>> {
883            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
884        }
885
886        pub fn take_touch(&mut self) -> ::core::option::Option<crate::wire::TouchInputReport<'de>> {
887            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
888        }
889
890        pub fn keyboard(&self) -> ::core::option::Option<&crate::wire::KeyboardInputReport<'de>> {
891            unsafe { Some(self.table.get(6)?.deref_unchecked()) }
892        }
893
894        pub fn take_keyboard(
895            &mut self,
896        ) -> ::core::option::Option<crate::wire::KeyboardInputReport<'de>> {
897            unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
898        }
899
900        pub fn consumer_control(
901            &self,
902        ) -> ::core::option::Option<&crate::wire::ConsumerControlInputReport<'de>> {
903            unsafe { Some(self.table.get(7)?.deref_unchecked()) }
904        }
905
906        pub fn take_consumer_control(
907            &mut self,
908        ) -> ::core::option::Option<crate::wire::ConsumerControlInputReport<'de>> {
909            unsafe { Some(self.table.get_mut(7)?.take_unchecked()) }
910        }
911
912        pub fn report_id(&self) -> ::core::option::Option<&u8> {
913            unsafe { Some(self.table.get(8)?.deref_unchecked()) }
914        }
915
916        pub fn take_report_id(&mut self) -> ::core::option::Option<u8> {
917            unsafe { Some(self.table.get_mut(8)?.take_unchecked()) }
918        }
919
920        pub fn wake_lease(&self) -> ::core::option::Option<&::fidl_next::wire::fuchsia::EventPair> {
921            unsafe { Some(self.table.get(9)?.deref_unchecked()) }
922        }
923
924        pub fn take_wake_lease(
925            &mut self,
926        ) -> ::core::option::Option<::fidl_next::wire::fuchsia::EventPair> {
927            unsafe { Some(self.table.get_mut(9)?.take_unchecked()) }
928        }
929    }
930
931    impl<'de> ::core::fmt::Debug for InputReport<'de> {
932        fn fmt(
933            &self,
934            f: &mut ::core::fmt::Formatter<'_>,
935        ) -> ::core::result::Result<(), ::core::fmt::Error> {
936            f.debug_struct("InputReport")
937                .field("event_time", &self.event_time())
938                .field("mouse", &self.mouse())
939                .field("trace_id", &self.trace_id())
940                .field("sensor", &self.sensor())
941                .field("touch", &self.touch())
942                .field("keyboard", &self.keyboard())
943                .field("consumer_control", &self.consumer_control())
944                .field("report_id", &self.report_id())
945                .field("wake_lease", &self.wake_lease())
946                .finish()
947        }
948    }
949
950    impl<'de> ::fidl_next::IntoNatural for InputReport<'de> {
951        type Natural = crate::natural::InputReport;
952    }
953
954    /// The wire type corresponding to [`InputDeviceGetInputReportResponse`].
955    #[derive(Debug)]
956    #[repr(C)]
957    pub struct InputDeviceGetInputReportResponse<'de> {
958        pub report: crate::wire::InputReport<'de>,
959    }
960
961    static_assertions::const_assert_eq!(
962        std::mem::size_of::<InputDeviceGetInputReportResponse<'_>>(),
963        16
964    );
965    static_assertions::const_assert_eq!(
966        std::mem::align_of::<InputDeviceGetInputReportResponse<'_>>(),
967        8
968    );
969
970    static_assertions::const_assert_eq!(
971        std::mem::offset_of!(InputDeviceGetInputReportResponse<'_>, report),
972        0
973    );
974
975    impl ::fidl_next::Constrained for InputDeviceGetInputReportResponse<'_> {
976        type Constraint = ();
977
978        fn validate(
979            _: ::fidl_next::Slot<'_, Self>,
980            _: Self::Constraint,
981        ) -> Result<(), ::fidl_next::ValidationError> {
982            Ok(())
983        }
984    }
985
986    unsafe impl ::fidl_next::Wire for InputDeviceGetInputReportResponse<'static> {
987        type Narrowed<'de> = InputDeviceGetInputReportResponse<'de>;
988
989        #[inline]
990        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
991            ::fidl_next::munge! {
992                let Self {
993                    report,
994
995                } = &mut *out_;
996            }
997
998            ::fidl_next::Wire::zero_padding(report);
999        }
1000    }
1001
1002    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for InputDeviceGetInputReportResponse<'de>
1003    where
1004        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1005        ___D: ::fidl_next::Decoder<'de>,
1006        ___D: ::fidl_next::fuchsia::HandleDecoder,
1007    {
1008        fn decode(
1009            slot_: ::fidl_next::Slot<'_, Self>,
1010            decoder_: &mut ___D,
1011            _: (),
1012        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1013            ::fidl_next::munge! {
1014                let Self {
1015                    mut report,
1016
1017                } = slot_;
1018            }
1019
1020            let _field = report.as_mut();
1021
1022            ::fidl_next::Decode::decode(report.as_mut(), decoder_, ())?;
1023
1024            Ok(())
1025        }
1026    }
1027
1028    impl<'de> ::fidl_next::IntoNatural for InputDeviceGetInputReportResponse<'de> {
1029        type Natural = crate::natural::InputDeviceGetInputReportResponse;
1030    }
1031
1032    /// The wire type corresponding to [`InputReportsReaderReadInputReportsResponse`].
1033    #[derive(Debug)]
1034    #[repr(C)]
1035    pub struct InputReportsReaderReadInputReportsResponse<'de> {
1036        pub reports: ::fidl_next::wire::Vector<'de, crate::wire::InputReport<'de>>,
1037    }
1038
1039    static_assertions::const_assert_eq!(
1040        std::mem::size_of::<InputReportsReaderReadInputReportsResponse<'_>>(),
1041        16
1042    );
1043    static_assertions::const_assert_eq!(
1044        std::mem::align_of::<InputReportsReaderReadInputReportsResponse<'_>>(),
1045        8
1046    );
1047
1048    static_assertions::const_assert_eq!(
1049        std::mem::offset_of!(InputReportsReaderReadInputReportsResponse<'_>, reports),
1050        0
1051    );
1052
1053    impl ::fidl_next::Constrained for InputReportsReaderReadInputReportsResponse<'_> {
1054        type Constraint = ();
1055
1056        fn validate(
1057            _: ::fidl_next::Slot<'_, Self>,
1058            _: Self::Constraint,
1059        ) -> Result<(), ::fidl_next::ValidationError> {
1060            Ok(())
1061        }
1062    }
1063
1064    unsafe impl ::fidl_next::Wire for InputReportsReaderReadInputReportsResponse<'static> {
1065        type Narrowed<'de> = InputReportsReaderReadInputReportsResponse<'de>;
1066
1067        #[inline]
1068        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1069            ::fidl_next::munge! {
1070                let Self {
1071                    reports,
1072
1073                } = &mut *out_;
1074            }
1075
1076            ::fidl_next::Wire::zero_padding(reports);
1077        }
1078    }
1079
1080    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for InputReportsReaderReadInputReportsResponse<'de>
1081    where
1082        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1083        ___D: ::fidl_next::Decoder<'de>,
1084        ___D: ::fidl_next::fuchsia::HandleDecoder,
1085    {
1086        fn decode(
1087            slot_: ::fidl_next::Slot<'_, Self>,
1088            decoder_: &mut ___D,
1089            _: (),
1090        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1091            ::fidl_next::munge! {
1092                let Self {
1093                    mut reports,
1094
1095                } = slot_;
1096            }
1097
1098            let _field = reports.as_mut();
1099            ::fidl_next::Constrained::validate(_field, (50, ()))?;
1100            ::fidl_next::Decode::decode(reports.as_mut(), decoder_, (50, ()))?;
1101
1102            let reports = unsafe { reports.deref_unchecked() };
1103
1104            if reports.len() > 50 {
1105                return Err(::fidl_next::DecodeError::VectorTooLong {
1106                    size: reports.len() as u64,
1107                    limit: 50,
1108                });
1109            }
1110
1111            Ok(())
1112        }
1113    }
1114
1115    impl<'de> ::fidl_next::IntoNatural for InputReportsReaderReadInputReportsResponse<'de> {
1116        type Natural = crate::natural::InputReportsReaderReadInputReportsResponse;
1117    }
1118}
1119
1120pub mod wire_optional {
1121
1122    pub use fidl_next_common_fuchsia_input_report::wire_optional::*;
1123}
1124
1125pub mod generic {
1126
1127    pub use fidl_next_common_fuchsia_input_report::generic::*;
1128
1129    /// The generic type corresponding to [`InputDeviceGetInputReportsReaderRequest`].
1130    pub struct InputDeviceGetInputReportsReaderRequest<T0> {
1131        pub reader: T0,
1132    }
1133
1134    unsafe impl<___E, T0>
1135        ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportsReaderRequest, ___E>
1136        for InputDeviceGetInputReportsReaderRequest<T0>
1137    where
1138        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1139        ___E: ::fidl_next::fuchsia::HandleEncoder,
1140        T0: ::fidl_next::Encode<
1141                ::fidl_next::ServerEnd<
1142                    crate::InputReportsReader,
1143                    ::fidl_next::wire::fuchsia::Channel,
1144                >,
1145                ___E,
1146            >,
1147    {
1148        #[inline]
1149        fn encode(
1150            self,
1151            encoder_: &mut ___E,
1152            out_: &mut ::core::mem::MaybeUninit<
1153                crate::wire::InputDeviceGetInputReportsReaderRequest,
1154            >,
1155            _: (),
1156        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1157            ::fidl_next::munge! {
1158                let crate::wire::InputDeviceGetInputReportsReaderRequest {
1159                    reader,
1160
1161                } = out_;
1162            }
1163
1164            ::fidl_next::Encode::encode(self.reader, encoder_, reader, ())?;
1165
1166            Ok(())
1167        }
1168    }
1169
1170    /// The generic type corresponding to [`InputDeviceGetInputReportResponse`].
1171    pub struct InputDeviceGetInputReportResponse<T0> {
1172        pub report: T0,
1173    }
1174
1175    unsafe impl<___E, T0>
1176        ::fidl_next::Encode<crate::wire::InputDeviceGetInputReportResponse<'static>, ___E>
1177        for InputDeviceGetInputReportResponse<T0>
1178    where
1179        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1180        ___E: ::fidl_next::Encoder,
1181        ___E: ::fidl_next::fuchsia::HandleEncoder,
1182        T0: ::fidl_next::Encode<crate::wire::InputReport<'static>, ___E>,
1183    {
1184        #[inline]
1185        fn encode(
1186            self,
1187            encoder_: &mut ___E,
1188            out_: &mut ::core::mem::MaybeUninit<
1189                crate::wire::InputDeviceGetInputReportResponse<'static>,
1190            >,
1191            _: (),
1192        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1193            ::fidl_next::munge! {
1194                let crate::wire::InputDeviceGetInputReportResponse {
1195                    report,
1196
1197                } = out_;
1198            }
1199
1200            ::fidl_next::Encode::encode(self.report, encoder_, report, ())?;
1201
1202            Ok(())
1203        }
1204    }
1205
1206    /// The generic type corresponding to [`InputReportsReaderReadInputReportsResponse`].
1207    pub struct InputReportsReaderReadInputReportsResponse<T0> {
1208        pub reports: T0,
1209    }
1210
1211    unsafe impl<___E, T0>
1212        ::fidl_next::Encode<crate::wire::InputReportsReaderReadInputReportsResponse<'static>, ___E>
1213        for InputReportsReaderReadInputReportsResponse<T0>
1214    where
1215        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1216        ___E: ::fidl_next::Encoder,
1217        ___E: ::fidl_next::fuchsia::HandleEncoder,
1218        T0: ::fidl_next::Encode<
1219                ::fidl_next::wire::Vector<'static, crate::wire::InputReport<'static>>,
1220                ___E,
1221            >,
1222    {
1223        #[inline]
1224        fn encode(
1225            self,
1226            encoder_: &mut ___E,
1227            out_: &mut ::core::mem::MaybeUninit<
1228                crate::wire::InputReportsReaderReadInputReportsResponse<'static>,
1229            >,
1230            _: (),
1231        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1232            ::fidl_next::munge! {
1233                let crate::wire::InputReportsReaderReadInputReportsResponse {
1234                    reports,
1235
1236                } = out_;
1237            }
1238
1239            ::fidl_next::Encode::encode(self.reports, encoder_, reports, (50, ()))?;
1240
1241            Ok(())
1242        }
1243    }
1244}
1245
1246pub use self::natural::*;
1247
1248/// The type corresponding to the InputDevice protocol.
1249#[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"]
1250#[derive(PartialEq, Debug)]
1251pub struct InputDevice;
1252
1253impl ::fidl_next::Discoverable for InputDevice {
1254    const PROTOCOL_NAME: &'static str = "fuchsia.input.report.InputDevice";
1255}
1256
1257#[cfg(target_os = "fuchsia")]
1258impl ::fidl_next::HasTransport for InputDevice {
1259    type Transport = ::fidl_next::fuchsia::zx::Channel;
1260}
1261
1262pub mod input_device {
1263    pub mod prelude {
1264        pub use crate::{
1265            InputDevice, InputDeviceClientHandler, InputDeviceLocalClientHandler,
1266            InputDeviceLocalServerHandler, InputDeviceServerHandler, input_device,
1267        };
1268
1269        pub use crate::natural::InputDeviceGetDescriptorResponse;
1270
1271        pub use crate::natural::InputDeviceGetInputReportRequest;
1272
1273        pub use crate::natural::InputDeviceGetInputReportsReaderRequest;
1274
1275        pub use crate::natural::InputDeviceSendOutputReportRequest;
1276
1277        pub use crate::natural::InputDeviceSetFeatureReportRequest;
1278
1279        pub use crate::natural::InputDeviceGetFeatureReportResponse;
1280
1281        pub use crate::natural::InputDeviceGetInputReportResponse;
1282
1283        pub use crate::natural::InputDeviceSendOutputReportResponse;
1284
1285        pub use crate::natural::InputDeviceSetFeatureReportResponse;
1286    }
1287
1288    pub struct GetInputReportsReader;
1289
1290    impl ::fidl_next::Method for GetInputReportsReader {
1291        const ORDINAL: u64 = 7555298015256750913;
1292        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1293            ::fidl_next::protocol::Flexibility::Strict;
1294
1295        type Protocol = crate::InputDevice;
1296
1297        type Request = crate::wire::InputDeviceGetInputReportsReaderRequest;
1298    }
1299
1300    pub struct GetDescriptor;
1301
1302    impl ::fidl_next::Method for GetDescriptor {
1303        const ORDINAL: u64 = 4428799916562230578;
1304        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1305            ::fidl_next::protocol::Flexibility::Strict;
1306
1307        type Protocol = crate::InputDevice;
1308
1309        type Request = ::fidl_next::wire::EmptyMessageBody;
1310    }
1311
1312    impl ::fidl_next::TwoWayMethod for GetDescriptor {
1313        type Response =
1314            ::fidl_next::wire::Strict<crate::wire::InputDeviceGetDescriptorResponse<'static>>;
1315    }
1316
1317    impl<___R> ::fidl_next::Respond<___R> for GetDescriptor {
1318        type Output = ::fidl_next::Strict<crate::generic::InputDeviceGetDescriptorResponse<___R>>;
1319
1320        fn respond(response: ___R) -> Self::Output {
1321            ::fidl_next::Strict(crate::generic::InputDeviceGetDescriptorResponse {
1322                descriptor: response,
1323            })
1324        }
1325    }
1326
1327    pub struct SendOutputReport;
1328
1329    impl ::fidl_next::Method for SendOutputReport {
1330        const ORDINAL: u64 = 466765262340648762;
1331        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1332            ::fidl_next::protocol::Flexibility::Strict;
1333
1334        type Protocol = crate::InputDevice;
1335
1336        type Request = crate::wire::InputDeviceSendOutputReportRequest<'static>;
1337    }
1338
1339    impl ::fidl_next::TwoWayMethod for SendOutputReport {
1340        type Response = ::fidl_next::wire::Result<
1341            'static,
1342            crate::wire::InputDeviceSendOutputReportResponse,
1343            ::fidl_next::wire::fuchsia::Status,
1344        >;
1345    }
1346
1347    impl<___R> ::fidl_next::Respond<___R> for SendOutputReport {
1348        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
1349
1350        fn respond(response: ___R) -> Self::Output {
1351            ::core::result::Result::Ok(response)
1352        }
1353    }
1354
1355    impl<___R> ::fidl_next::RespondErr<___R> for SendOutputReport {
1356        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1357
1358        fn respond_err(response: ___R) -> Self::Output {
1359            ::core::result::Result::Err(response)
1360        }
1361    }
1362
1363    pub struct GetFeatureReport;
1364
1365    impl ::fidl_next::Method for GetFeatureReport {
1366        const ORDINAL: u64 = 5294682407360339734;
1367        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1368            ::fidl_next::protocol::Flexibility::Strict;
1369
1370        type Protocol = crate::InputDevice;
1371
1372        type Request = ::fidl_next::wire::EmptyMessageBody;
1373    }
1374
1375    impl ::fidl_next::TwoWayMethod for GetFeatureReport {
1376        type Response = ::fidl_next::wire::Result<
1377            'static,
1378            crate::wire::InputDeviceGetFeatureReportResponse<'static>,
1379            ::fidl_next::wire::fuchsia::Status,
1380        >;
1381    }
1382
1383    impl<___R> ::fidl_next::Respond<___R> for GetFeatureReport {
1384        type Output = ::core::result::Result<
1385            crate::generic::InputDeviceGetFeatureReportResponse<___R>,
1386            ::fidl_next::never::Never,
1387        >;
1388
1389        fn respond(response: ___R) -> Self::Output {
1390            ::core::result::Result::Ok(crate::generic::InputDeviceGetFeatureReportResponse {
1391                report: response,
1392            })
1393        }
1394    }
1395
1396    impl<___R> ::fidl_next::RespondErr<___R> for GetFeatureReport {
1397        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1398
1399        fn respond_err(response: ___R) -> Self::Output {
1400            ::core::result::Result::Err(response)
1401        }
1402    }
1403
1404    pub struct SetFeatureReport;
1405
1406    impl ::fidl_next::Method for SetFeatureReport {
1407        const ORDINAL: u64 = 8537033744562275055;
1408        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1409            ::fidl_next::protocol::Flexibility::Strict;
1410
1411        type Protocol = crate::InputDevice;
1412
1413        type Request = crate::wire::InputDeviceSetFeatureReportRequest<'static>;
1414    }
1415
1416    impl ::fidl_next::TwoWayMethod for SetFeatureReport {
1417        type Response = ::fidl_next::wire::Result<
1418            'static,
1419            crate::wire::InputDeviceSetFeatureReportResponse,
1420            ::fidl_next::wire::fuchsia::Status,
1421        >;
1422    }
1423
1424    impl<___R> ::fidl_next::Respond<___R> for SetFeatureReport {
1425        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
1426
1427        fn respond(response: ___R) -> Self::Output {
1428            ::core::result::Result::Ok(response)
1429        }
1430    }
1431
1432    impl<___R> ::fidl_next::RespondErr<___R> for SetFeatureReport {
1433        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1434
1435        fn respond_err(response: ___R) -> Self::Output {
1436            ::core::result::Result::Err(response)
1437        }
1438    }
1439
1440    pub struct GetInputReport;
1441
1442    impl ::fidl_next::Method for GetInputReport {
1443        const ORDINAL: u64 = 5139395162123862600;
1444        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1445            ::fidl_next::protocol::Flexibility::Strict;
1446
1447        type Protocol = crate::InputDevice;
1448
1449        type Request = crate::wire::InputDeviceGetInputReportRequest;
1450    }
1451
1452    impl ::fidl_next::TwoWayMethod for GetInputReport {
1453        type Response = ::fidl_next::wire::Result<
1454            'static,
1455            crate::wire::InputDeviceGetInputReportResponse<'static>,
1456            ::fidl_next::wire::fuchsia::Status,
1457        >;
1458    }
1459
1460    impl<___R> ::fidl_next::Respond<___R> for GetInputReport {
1461        type Output = ::core::result::Result<
1462            crate::generic::InputDeviceGetInputReportResponse<___R>,
1463            ::fidl_next::never::Never,
1464        >;
1465
1466        fn respond(response: ___R) -> Self::Output {
1467            ::core::result::Result::Ok(crate::generic::InputDeviceGetInputReportResponse {
1468                report: response,
1469            })
1470        }
1471    }
1472
1473    impl<___R> ::fidl_next::RespondErr<___R> for GetInputReport {
1474        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1475
1476        fn respond_err(response: ___R) -> Self::Output {
1477            ::core::result::Result::Err(response)
1478        }
1479    }
1480
1481    mod ___detail {
1482        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::InputDevice
1483        where
1484            ___T: ::fidl_next::Transport,
1485        {
1486            type Client = InputDeviceClient<___T>;
1487            type Server = InputDeviceServer<___T>;
1488        }
1489
1490        /// The client for the `InputDevice` protocol.
1491        #[repr(transparent)]
1492        pub struct InputDeviceClient<___T: ::fidl_next::Transport> {
1493            #[allow(dead_code)]
1494            client: ::fidl_next::protocol::Client<___T>,
1495        }
1496
1497        impl<___T> InputDeviceClient<___T>
1498        where
1499            ___T: ::fidl_next::Transport,
1500        {
1501            #[doc = " Open a new InputReportsReader on this device. Each reader receives\n their own reports.\n"]
1502            pub fn get_input_reports_reader(
1503                &self,
1504
1505                reader: impl ::fidl_next::Encode<
1506                    ::fidl_next::ServerEnd<
1507                        crate::InputReportsReader,
1508                        ::fidl_next::wire::fuchsia::Channel,
1509                    >,
1510                    <___T as ::fidl_next::Transport>::SendBuffer,
1511                >,
1512            ) -> ::fidl_next::SendFuture<'_, ___T>
1513            where
1514                <___T as ::fidl_next::Transport>::SendBuffer:
1515                    ::fidl_next::encoder::InternalHandleEncoder,
1516                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
1517            {
1518                self.get_input_reports_reader_with(
1519                    crate::generic::InputDeviceGetInputReportsReaderRequest { reader },
1520                )
1521            }
1522
1523            #[doc = " Open a new InputReportsReader on this device. Each reader receives\n their own reports.\n"]
1524            pub fn get_input_reports_reader_with<___R>(
1525                &self,
1526                request: ___R,
1527            ) -> ::fidl_next::SendFuture<'_, ___T>
1528            where
1529                ___R: ::fidl_next::Encode<
1530                        crate::wire::InputDeviceGetInputReportsReaderRequest,
1531                        <___T as ::fidl_next::Transport>::SendBuffer,
1532                    >,
1533            {
1534                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
1535                    7555298015256750913,
1536                    <super::GetInputReportsReader as ::fidl_next::Method>::FLEXIBILITY,
1537                    request,
1538                ))
1539            }
1540
1541            #[doc = " Gets the device descriptor for this device.\n"]
1542            pub fn get_descriptor(
1543                &self,
1544            ) -> ::fidl_next::TwoWayFuture<'_, super::GetDescriptor, ___T> {
1545                ::fidl_next::TwoWayFuture::from_untyped(
1546                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
1547                        4428799916562230578,
1548                        <super::GetDescriptor as ::fidl_next::Method>::FLEXIBILITY,
1549                        (),
1550                    ),
1551                )
1552            }
1553
1554            #[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"]
1555            pub fn send_output_report(
1556                &self,
1557
1558                report: impl ::fidl_next::Encode<
1559                    crate::wire::OutputReport<'static>,
1560                    <___T as ::fidl_next::Transport>::SendBuffer,
1561                >,
1562            ) -> ::fidl_next::TwoWayFuture<'_, super::SendOutputReport, ___T>
1563            where
1564                <___T as ::fidl_next::Transport>::SendBuffer:
1565                    ::fidl_next::encoder::InternalHandleEncoder,
1566                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1567            {
1568                self.send_output_report_with(crate::generic::InputDeviceSendOutputReportRequest {
1569                    report,
1570                })
1571            }
1572
1573            #[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"]
1574            pub fn send_output_report_with<___R>(
1575                &self,
1576                request: ___R,
1577            ) -> ::fidl_next::TwoWayFuture<'_, super::SendOutputReport, ___T>
1578            where
1579                ___R: ::fidl_next::Encode<
1580                        crate::wire::InputDeviceSendOutputReportRequest<'static>,
1581                        <___T as ::fidl_next::Transport>::SendBuffer,
1582                    >,
1583            {
1584                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1585                    466765262340648762,
1586                    <super::SendOutputReport as ::fidl_next::Method>::FLEXIBILITY,
1587                    request,
1588                ))
1589            }
1590
1591            #[doc = " Get the feature report for a given device. This requests the state of\n the device\'s features.\n"]
1592            pub fn get_feature_report(
1593                &self,
1594            ) -> ::fidl_next::TwoWayFuture<'_, super::GetFeatureReport, ___T> {
1595                ::fidl_next::TwoWayFuture::from_untyped(
1596                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
1597                        5294682407360339734,
1598                        <super::GetFeatureReport as ::fidl_next::Method>::FLEXIBILITY,
1599                        (),
1600                    ),
1601                )
1602            }
1603
1604            #[doc = " Set the feature report for a given device. This sets the state of\n the device\'s features.\n"]
1605            pub fn set_feature_report(
1606                &self,
1607
1608                report: impl ::fidl_next::Encode<
1609                    crate::wire::FeatureReport<'static>,
1610                    <___T as ::fidl_next::Transport>::SendBuffer,
1611                >,
1612            ) -> ::fidl_next::TwoWayFuture<'_, super::SetFeatureReport, ___T>
1613            where
1614                <___T as ::fidl_next::Transport>::SendBuffer:
1615                    ::fidl_next::encoder::InternalHandleEncoder,
1616                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1617            {
1618                self.set_feature_report_with(crate::generic::InputDeviceSetFeatureReportRequest {
1619                    report,
1620                })
1621            }
1622
1623            #[doc = " Set the feature report for a given device. This sets the state of\n the device\'s features.\n"]
1624            pub fn set_feature_report_with<___R>(
1625                &self,
1626                request: ___R,
1627            ) -> ::fidl_next::TwoWayFuture<'_, super::SetFeatureReport, ___T>
1628            where
1629                ___R: ::fidl_next::Encode<
1630                        crate::wire::InputDeviceSetFeatureReportRequest<'static>,
1631                        <___T as ::fidl_next::Transport>::SendBuffer,
1632                    >,
1633            {
1634                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1635                    8537033744562275055,
1636                    <super::SetFeatureReport as ::fidl_next::Method>::FLEXIBILITY,
1637                    request,
1638                ))
1639            }
1640
1641            #[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"]
1642            pub fn get_input_report(
1643                &self,
1644
1645                device_type: impl ::fidl_next::Encode<
1646                    crate::wire::DeviceType,
1647                    <___T as ::fidl_next::Transport>::SendBuffer,
1648                >,
1649            ) -> ::fidl_next::TwoWayFuture<'_, super::GetInputReport, ___T>
1650            where
1651                <___T as ::fidl_next::Transport>::SendBuffer:
1652                    ::fidl_next::encoder::InternalHandleEncoder,
1653            {
1654                self.get_input_report_with(crate::generic::InputDeviceGetInputReportRequest {
1655                    device_type,
1656                })
1657            }
1658
1659            #[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"]
1660            pub fn get_input_report_with<___R>(
1661                &self,
1662                request: ___R,
1663            ) -> ::fidl_next::TwoWayFuture<'_, super::GetInputReport, ___T>
1664            where
1665                ___R: ::fidl_next::Encode<
1666                        crate::wire::InputDeviceGetInputReportRequest,
1667                        <___T as ::fidl_next::Transport>::SendBuffer,
1668                    >,
1669            {
1670                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1671                    5139395162123862600,
1672                    <super::GetInputReport as ::fidl_next::Method>::FLEXIBILITY,
1673                    request,
1674                ))
1675            }
1676        }
1677
1678        /// The server for the `InputDevice` protocol.
1679        #[repr(transparent)]
1680        pub struct InputDeviceServer<___T: ::fidl_next::Transport> {
1681            server: ::fidl_next::protocol::Server<___T>,
1682        }
1683
1684        impl<___T> InputDeviceServer<___T> where ___T: ::fidl_next::Transport {}
1685    }
1686}
1687
1688#[diagnostic::on_unimplemented(
1689    note = "If {Self} implements the non-local InputDeviceClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
1690)]
1691
1692/// A client handler for the InputDevice protocol.
1693///
1694/// See [`InputDevice`] for more details.
1695pub trait InputDeviceLocalClientHandler<
1696    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1697    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1698>
1699{
1700    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1701        ::core::future::ready(())
1702    }
1703}
1704
1705impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for InputDevice
1706where
1707    ___H: InputDeviceLocalClientHandler<___T>,
1708    ___T: ::fidl_next::Transport,
1709{
1710    async fn on_event(
1711        handler: &mut ___H,
1712        mut message: ::fidl_next::Message<___T>,
1713    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1714        match *message.header().ordinal {
1715            ordinal => {
1716                handler.on_unknown_interaction(ordinal).await;
1717                if ::core::matches!(
1718                    message.header().flexibility(),
1719                    ::fidl_next::protocol::Flexibility::Strict
1720                ) {
1721                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1722                } else {
1723                    Ok(())
1724                }
1725            }
1726        }
1727    }
1728}
1729
1730#[diagnostic::on_unimplemented(
1731    note = "If {Self} implements the non-local InputDeviceServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
1732)]
1733
1734/// A server handler for the InputDevice protocol.
1735///
1736/// See [`InputDevice`] for more details.
1737pub trait InputDeviceLocalServerHandler<
1738    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1739    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1740>
1741{
1742    #[doc = " Open a new InputReportsReader on this device. Each reader receives\n their own reports.\n"]
1743    fn get_input_reports_reader(
1744        &mut self,
1745
1746        request: ::fidl_next::Request<input_device::GetInputReportsReader, ___T>,
1747    ) -> impl ::core::future::Future<Output = ()>;
1748
1749    #[doc = " Gets the device descriptor for this device.\n"]
1750    fn get_descriptor(
1751        &mut self,
1752
1753        responder: ::fidl_next::Responder<input_device::GetDescriptor, ___T>,
1754    ) -> impl ::core::future::Future<Output = ()>;
1755
1756    #[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"]
1757    fn send_output_report(
1758        &mut self,
1759
1760        request: ::fidl_next::Request<input_device::SendOutputReport, ___T>,
1761
1762        responder: ::fidl_next::Responder<input_device::SendOutputReport, ___T>,
1763    ) -> impl ::core::future::Future<Output = ()>;
1764
1765    #[doc = " Get the feature report for a given device. This requests the state of\n the device\'s features.\n"]
1766    fn get_feature_report(
1767        &mut self,
1768
1769        responder: ::fidl_next::Responder<input_device::GetFeatureReport, ___T>,
1770    ) -> impl ::core::future::Future<Output = ()>;
1771
1772    #[doc = " Set the feature report for a given device. This sets the state of\n the device\'s features.\n"]
1773    fn set_feature_report(
1774        &mut self,
1775
1776        request: ::fidl_next::Request<input_device::SetFeatureReport, ___T>,
1777
1778        responder: ::fidl_next::Responder<input_device::SetFeatureReport, ___T>,
1779    ) -> impl ::core::future::Future<Output = ()>;
1780
1781    #[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"]
1782    fn get_input_report(
1783        &mut self,
1784
1785        request: ::fidl_next::Request<input_device::GetInputReport, ___T>,
1786
1787        responder: ::fidl_next::Responder<input_device::GetInputReport, ___T>,
1788    ) -> impl ::core::future::Future<Output = ()>;
1789
1790    fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1791        ::core::future::ready(())
1792    }
1793}
1794
1795impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for InputDevice
1796where
1797    ___H: InputDeviceLocalServerHandler<___T>,
1798    ___T: ::fidl_next::Transport,
1799    for<'de> crate::wire::InputDeviceGetInputReportsReaderRequest: ::fidl_next::Decode<
1800            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1801            Constraint = (),
1802        >,
1803    for<'de> crate::wire::InputDeviceSendOutputReportRequest<'de>: ::fidl_next::Decode<
1804            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1805            Constraint = (),
1806        >,
1807    for<'de> crate::wire::InputDeviceSetFeatureReportRequest<'de>: ::fidl_next::Decode<
1808            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1809            Constraint = (),
1810        >,
1811    for<'de> crate::wire::InputDeviceGetInputReportRequest: ::fidl_next::Decode<
1812            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1813            Constraint = (),
1814        >,
1815{
1816    async fn on_one_way(
1817        handler: &mut ___H,
1818        mut message: ::fidl_next::Message<___T>,
1819    ) -> ::core::result::Result<
1820        (),
1821        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1822    > {
1823        match *message.header().ordinal {
1824            7555298015256750913 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
1825                Ok(decoded) => {
1826                    handler
1827                        .get_input_reports_reader(::fidl_next::Request::from_decoded(decoded))
1828                        .await;
1829                    Ok(())
1830                }
1831                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1832                    ordinal: 7555298015256750913,
1833                    error,
1834                }),
1835            },
1836
1837            ordinal => {
1838                handler.on_unknown_interaction(ordinal).await;
1839                if ::core::matches!(
1840                    message.header().flexibility(),
1841                    ::fidl_next::protocol::Flexibility::Strict
1842                ) {
1843                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1844                } else {
1845                    Ok(())
1846                }
1847            }
1848        }
1849    }
1850
1851    async fn on_two_way(
1852        handler: &mut ___H,
1853        mut message: ::fidl_next::Message<___T>,
1854        responder: ::fidl_next::protocol::Responder<___T>,
1855    ) -> ::core::result::Result<
1856        (),
1857        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1858    > {
1859        match *message.header().ordinal {
1860            4428799916562230578 => {
1861                let responder = ::fidl_next::Responder::from_untyped(responder);
1862
1863                handler.get_descriptor(responder).await;
1864                Ok(())
1865            }
1866
1867            466765262340648762 => {
1868                let responder = ::fidl_next::Responder::from_untyped(responder);
1869
1870                match ::fidl_next::AsDecoderExt::into_decoded(message) {
1871                    Ok(decoded) => {
1872                        handler
1873                            .send_output_report(
1874                                ::fidl_next::Request::from_decoded(decoded),
1875                                responder,
1876                            )
1877                            .await;
1878                        Ok(())
1879                    }
1880                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1881                        ordinal: 466765262340648762,
1882                        error,
1883                    }),
1884                }
1885            }
1886
1887            5294682407360339734 => {
1888                let responder = ::fidl_next::Responder::from_untyped(responder);
1889
1890                handler.get_feature_report(responder).await;
1891                Ok(())
1892            }
1893
1894            8537033744562275055 => {
1895                let responder = ::fidl_next::Responder::from_untyped(responder);
1896
1897                match ::fidl_next::AsDecoderExt::into_decoded(message) {
1898                    Ok(decoded) => {
1899                        handler
1900                            .set_feature_report(
1901                                ::fidl_next::Request::from_decoded(decoded),
1902                                responder,
1903                            )
1904                            .await;
1905                        Ok(())
1906                    }
1907                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1908                        ordinal: 8537033744562275055,
1909                        error,
1910                    }),
1911                }
1912            }
1913
1914            5139395162123862600 => {
1915                let responder = ::fidl_next::Responder::from_untyped(responder);
1916
1917                match ::fidl_next::AsDecoderExt::into_decoded(message) {
1918                    Ok(decoded) => {
1919                        handler
1920                            .get_input_report(
1921                                ::fidl_next::Request::from_decoded(decoded),
1922                                responder,
1923                            )
1924                            .await;
1925                        Ok(())
1926                    }
1927                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1928                        ordinal: 5139395162123862600,
1929                        error,
1930                    }),
1931                }
1932            }
1933
1934            ordinal => {
1935                handler.on_unknown_interaction(ordinal).await;
1936                if ::core::matches!(
1937                    message.header().flexibility(),
1938                    ::fidl_next::protocol::Flexibility::Strict
1939                ) {
1940                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1941                } else {
1942                    responder
1943                        .respond_framework_error(
1944                            ordinal,
1945                            ::fidl_next::FrameworkError::UnknownMethod,
1946                        )
1947                        .expect("encoding a framework error should never fail")
1948                        .await?;
1949                    Ok(())
1950                }
1951            }
1952        }
1953    }
1954}
1955
1956/// A client handler for the InputDevice protocol.
1957///
1958/// See [`InputDevice`] for more details.
1959pub trait InputDeviceClientHandler<
1960    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1961    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1962>
1963{
1964    fn on_unknown_interaction(
1965        &mut self,
1966        ordinal: u64,
1967    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1968        ::core::future::ready(())
1969    }
1970}
1971
1972impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for InputDevice
1973where
1974    ___H: InputDeviceClientHandler<___T> + ::core::marker::Send,
1975    ___T: ::fidl_next::Transport,
1976{
1977    async fn on_event(
1978        handler: &mut ___H,
1979        mut message: ::fidl_next::Message<___T>,
1980    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1981        match *message.header().ordinal {
1982            ordinal => {
1983                handler.on_unknown_interaction(ordinal).await;
1984                if ::core::matches!(
1985                    message.header().flexibility(),
1986                    ::fidl_next::protocol::Flexibility::Strict
1987                ) {
1988                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1989                } else {
1990                    Ok(())
1991                }
1992            }
1993        }
1994    }
1995}
1996
1997/// A server handler for the InputDevice protocol.
1998///
1999/// See [`InputDevice`] for more details.
2000pub trait InputDeviceServerHandler<
2001    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2002    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2003>
2004{
2005    #[doc = " Open a new InputReportsReader on this device. Each reader receives\n their own reports.\n"]
2006    fn get_input_reports_reader(
2007        &mut self,
2008
2009        request: ::fidl_next::Request<input_device::GetInputReportsReader, ___T>,
2010    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2011
2012    #[doc = " Gets the device descriptor for this device.\n"]
2013    fn get_descriptor(
2014        &mut self,
2015
2016        responder: ::fidl_next::Responder<input_device::GetDescriptor, ___T>,
2017    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2018
2019    #[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"]
2020    fn send_output_report(
2021        &mut self,
2022
2023        request: ::fidl_next::Request<input_device::SendOutputReport, ___T>,
2024
2025        responder: ::fidl_next::Responder<input_device::SendOutputReport, ___T>,
2026    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2027
2028    #[doc = " Get the feature report for a given device. This requests the state of\n the device\'s features.\n"]
2029    fn get_feature_report(
2030        &mut self,
2031
2032        responder: ::fidl_next::Responder<input_device::GetFeatureReport, ___T>,
2033    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2034
2035    #[doc = " Set the feature report for a given device. This sets the state of\n the device\'s features.\n"]
2036    fn set_feature_report(
2037        &mut self,
2038
2039        request: ::fidl_next::Request<input_device::SetFeatureReport, ___T>,
2040
2041        responder: ::fidl_next::Responder<input_device::SetFeatureReport, ___T>,
2042    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2043
2044    #[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"]
2045    fn get_input_report(
2046        &mut self,
2047
2048        request: ::fidl_next::Request<input_device::GetInputReport, ___T>,
2049
2050        responder: ::fidl_next::Responder<input_device::GetInputReport, ___T>,
2051    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2052
2053    fn on_unknown_interaction(
2054        &mut self,
2055        ordinal: u64,
2056    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2057        ::core::future::ready(())
2058    }
2059}
2060
2061impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for InputDevice
2062where
2063    ___H: InputDeviceServerHandler<___T> + ::core::marker::Send,
2064    ___T: ::fidl_next::Transport,
2065    for<'de> crate::wire::InputDeviceGetInputReportsReaderRequest: ::fidl_next::Decode<
2066            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2067            Constraint = (),
2068        >,
2069    for<'de> crate::wire::InputDeviceSendOutputReportRequest<'de>: ::fidl_next::Decode<
2070            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2071            Constraint = (),
2072        >,
2073    for<'de> crate::wire::InputDeviceSetFeatureReportRequest<'de>: ::fidl_next::Decode<
2074            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2075            Constraint = (),
2076        >,
2077    for<'de> crate::wire::InputDeviceGetInputReportRequest: ::fidl_next::Decode<
2078            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2079            Constraint = (),
2080        >,
2081{
2082    async fn on_one_way(
2083        handler: &mut ___H,
2084        mut message: ::fidl_next::Message<___T>,
2085    ) -> ::core::result::Result<
2086        (),
2087        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2088    > {
2089        match *message.header().ordinal {
2090            7555298015256750913 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
2091                Ok(decoded) => {
2092                    handler
2093                        .get_input_reports_reader(::fidl_next::Request::from_decoded(decoded))
2094                        .await;
2095                    Ok(())
2096                }
2097                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2098                    ordinal: 7555298015256750913,
2099                    error,
2100                }),
2101            },
2102
2103            ordinal => {
2104                handler.on_unknown_interaction(ordinal).await;
2105                if ::core::matches!(
2106                    message.header().flexibility(),
2107                    ::fidl_next::protocol::Flexibility::Strict
2108                ) {
2109                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2110                } else {
2111                    Ok(())
2112                }
2113            }
2114        }
2115    }
2116
2117    async fn on_two_way(
2118        handler: &mut ___H,
2119        mut message: ::fidl_next::Message<___T>,
2120        responder: ::fidl_next::protocol::Responder<___T>,
2121    ) -> ::core::result::Result<
2122        (),
2123        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2124    > {
2125        match *message.header().ordinal {
2126            4428799916562230578 => {
2127                let responder = ::fidl_next::Responder::from_untyped(responder);
2128
2129                handler.get_descriptor(responder).await;
2130                Ok(())
2131            }
2132
2133            466765262340648762 => {
2134                let responder = ::fidl_next::Responder::from_untyped(responder);
2135
2136                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2137                    Ok(decoded) => {
2138                        handler
2139                            .send_output_report(
2140                                ::fidl_next::Request::from_decoded(decoded),
2141                                responder,
2142                            )
2143                            .await;
2144                        Ok(())
2145                    }
2146                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2147                        ordinal: 466765262340648762,
2148                        error,
2149                    }),
2150                }
2151            }
2152
2153            5294682407360339734 => {
2154                let responder = ::fidl_next::Responder::from_untyped(responder);
2155
2156                handler.get_feature_report(responder).await;
2157                Ok(())
2158            }
2159
2160            8537033744562275055 => {
2161                let responder = ::fidl_next::Responder::from_untyped(responder);
2162
2163                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2164                    Ok(decoded) => {
2165                        handler
2166                            .set_feature_report(
2167                                ::fidl_next::Request::from_decoded(decoded),
2168                                responder,
2169                            )
2170                            .await;
2171                        Ok(())
2172                    }
2173                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2174                        ordinal: 8537033744562275055,
2175                        error,
2176                    }),
2177                }
2178            }
2179
2180            5139395162123862600 => {
2181                let responder = ::fidl_next::Responder::from_untyped(responder);
2182
2183                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2184                    Ok(decoded) => {
2185                        handler
2186                            .get_input_report(
2187                                ::fidl_next::Request::from_decoded(decoded),
2188                                responder,
2189                            )
2190                            .await;
2191                        Ok(())
2192                    }
2193                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2194                        ordinal: 5139395162123862600,
2195                        error,
2196                    }),
2197                }
2198            }
2199
2200            ordinal => {
2201                handler.on_unknown_interaction(ordinal).await;
2202                if ::core::matches!(
2203                    message.header().flexibility(),
2204                    ::fidl_next::protocol::Flexibility::Strict
2205                ) {
2206                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2207                } else {
2208                    responder
2209                        .respond_framework_error(
2210                            ordinal,
2211                            ::fidl_next::FrameworkError::UnknownMethod,
2212                        )
2213                        .expect("encoding a framework error should never fail")
2214                        .await?;
2215                    Ok(())
2216                }
2217            }
2218        }
2219    }
2220}
2221
2222impl<___T> InputDeviceClientHandler<___T> for ::fidl_next::IgnoreEvents
2223where
2224    ___T: ::fidl_next::Transport,
2225{
2226    async fn on_unknown_interaction(&mut self, _: u64) {}
2227}
2228
2229impl<___H, ___T> InputDeviceLocalClientHandler<___T> for ::fidl_next::Local<___H>
2230where
2231    ___H: InputDeviceClientHandler<___T>,
2232    ___T: ::fidl_next::Transport,
2233{
2234    async fn on_unknown_interaction(&mut self, ordinal: u64) {
2235        ___H::on_unknown_interaction(&mut self.0, ordinal).await
2236    }
2237}
2238
2239impl<___H, ___T> InputDeviceLocalServerHandler<___T> for ::fidl_next::Local<___H>
2240where
2241    ___H: InputDeviceServerHandler<___T>,
2242    ___T: ::fidl_next::Transport,
2243{
2244    async fn get_input_reports_reader(
2245        &mut self,
2246
2247        request: ::fidl_next::Request<input_device::GetInputReportsReader, ___T>,
2248    ) {
2249        ___H::get_input_reports_reader(&mut self.0, request).await
2250    }
2251
2252    async fn get_descriptor(
2253        &mut self,
2254
2255        responder: ::fidl_next::Responder<input_device::GetDescriptor, ___T>,
2256    ) {
2257        ___H::get_descriptor(&mut self.0, responder).await
2258    }
2259
2260    async fn send_output_report(
2261        &mut self,
2262
2263        request: ::fidl_next::Request<input_device::SendOutputReport, ___T>,
2264
2265        responder: ::fidl_next::Responder<input_device::SendOutputReport, ___T>,
2266    ) {
2267        ___H::send_output_report(&mut self.0, request, responder).await
2268    }
2269
2270    async fn get_feature_report(
2271        &mut self,
2272
2273        responder: ::fidl_next::Responder<input_device::GetFeatureReport, ___T>,
2274    ) {
2275        ___H::get_feature_report(&mut self.0, responder).await
2276    }
2277
2278    async fn set_feature_report(
2279        &mut self,
2280
2281        request: ::fidl_next::Request<input_device::SetFeatureReport, ___T>,
2282
2283        responder: ::fidl_next::Responder<input_device::SetFeatureReport, ___T>,
2284    ) {
2285        ___H::set_feature_report(&mut self.0, request, responder).await
2286    }
2287
2288    async fn get_input_report(
2289        &mut self,
2290
2291        request: ::fidl_next::Request<input_device::GetInputReport, ___T>,
2292
2293        responder: ::fidl_next::Responder<input_device::GetInputReport, ___T>,
2294    ) {
2295        ___H::get_input_report(&mut self.0, request, responder).await
2296    }
2297
2298    async fn on_unknown_interaction(&mut self, ordinal: u64) {
2299        ___H::on_unknown_interaction(&mut self.0, ordinal).await
2300    }
2301}
2302
2303/// The type corresponding to the InputReportsReader protocol.
2304#[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"]
2305#[derive(PartialEq, Debug)]
2306pub struct InputReportsReader;
2307
2308#[cfg(target_os = "fuchsia")]
2309impl ::fidl_next::HasTransport for InputReportsReader {
2310    type Transport = ::fidl_next::fuchsia::zx::Channel;
2311}
2312
2313pub mod input_reports_reader {
2314    pub mod prelude {
2315        pub use crate::{
2316            InputReportsReader, InputReportsReaderClientHandler,
2317            InputReportsReaderLocalClientHandler, InputReportsReaderLocalServerHandler,
2318            InputReportsReaderServerHandler, input_reports_reader,
2319        };
2320
2321        pub use crate::natural::InputReportsReaderReadInputReportsResponse;
2322    }
2323
2324    pub struct ReadInputReports;
2325
2326    impl ::fidl_next::Method for ReadInputReports {
2327        const ORDINAL: u64 = 3861255986002273625;
2328        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2329            ::fidl_next::protocol::Flexibility::Strict;
2330
2331        type Protocol = crate::InputReportsReader;
2332
2333        type Request = ::fidl_next::wire::EmptyMessageBody;
2334    }
2335
2336    impl ::fidl_next::TwoWayMethod for ReadInputReports {
2337        type Response = ::fidl_next::wire::Result<
2338            'static,
2339            crate::wire::InputReportsReaderReadInputReportsResponse<'static>,
2340            ::fidl_next::wire::fuchsia::Status,
2341        >;
2342    }
2343
2344    impl<___R> ::fidl_next::Respond<___R> for ReadInputReports {
2345        type Output = ::core::result::Result<
2346            crate::generic::InputReportsReaderReadInputReportsResponse<___R>,
2347            ::fidl_next::never::Never,
2348        >;
2349
2350        fn respond(response: ___R) -> Self::Output {
2351            ::core::result::Result::Ok(crate::generic::InputReportsReaderReadInputReportsResponse {
2352                reports: response,
2353            })
2354        }
2355    }
2356
2357    impl<___R> ::fidl_next::RespondErr<___R> for ReadInputReports {
2358        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2359
2360        fn respond_err(response: ___R) -> Self::Output {
2361            ::core::result::Result::Err(response)
2362        }
2363    }
2364
2365    mod ___detail {
2366        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::InputReportsReader
2367        where
2368            ___T: ::fidl_next::Transport,
2369        {
2370            type Client = InputReportsReaderClient<___T>;
2371            type Server = InputReportsReaderServer<___T>;
2372        }
2373
2374        /// The client for the `InputReportsReader` protocol.
2375        #[repr(transparent)]
2376        pub struct InputReportsReaderClient<___T: ::fidl_next::Transport> {
2377            #[allow(dead_code)]
2378            client: ::fidl_next::protocol::Client<___T>,
2379        }
2380
2381        impl<___T> InputReportsReaderClient<___T>
2382        where
2383            ___T: ::fidl_next::Transport,
2384        {
2385            #[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"]
2386            pub fn read_input_reports(
2387                &self,
2388            ) -> ::fidl_next::TwoWayFuture<'_, super::ReadInputReports, ___T> {
2389                ::fidl_next::TwoWayFuture::from_untyped(
2390                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
2391                        3861255986002273625,
2392                        <super::ReadInputReports as ::fidl_next::Method>::FLEXIBILITY,
2393                        (),
2394                    ),
2395                )
2396            }
2397        }
2398
2399        /// The server for the `InputReportsReader` protocol.
2400        #[repr(transparent)]
2401        pub struct InputReportsReaderServer<___T: ::fidl_next::Transport> {
2402            server: ::fidl_next::protocol::Server<___T>,
2403        }
2404
2405        impl<___T> InputReportsReaderServer<___T> where ___T: ::fidl_next::Transport {}
2406    }
2407}
2408
2409#[diagnostic::on_unimplemented(
2410    note = "If {Self} implements the non-local InputReportsReaderClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2411)]
2412
2413/// A client handler for the InputReportsReader protocol.
2414///
2415/// See [`InputReportsReader`] for more details.
2416pub trait InputReportsReaderLocalClientHandler<
2417    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2418    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2419>
2420{
2421}
2422
2423impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for InputReportsReader
2424where
2425    ___H: InputReportsReaderLocalClientHandler<___T>,
2426    ___T: ::fidl_next::Transport,
2427{
2428    async fn on_event(
2429        handler: &mut ___H,
2430        mut message: ::fidl_next::Message<___T>,
2431    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2432        match *message.header().ordinal {
2433            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2434        }
2435    }
2436}
2437
2438#[diagnostic::on_unimplemented(
2439    note = "If {Self} implements the non-local InputReportsReaderServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2440)]
2441
2442/// A server handler for the InputReportsReader protocol.
2443///
2444/// See [`InputReportsReader`] for more details.
2445pub trait InputReportsReaderLocalServerHandler<
2446    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2447    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2448>
2449{
2450    #[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"]
2451    fn read_input_reports(
2452        &mut self,
2453
2454        responder: ::fidl_next::Responder<input_reports_reader::ReadInputReports, ___T>,
2455    ) -> impl ::core::future::Future<Output = ()>;
2456}
2457
2458impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for InputReportsReader
2459where
2460    ___H: InputReportsReaderLocalServerHandler<___T>,
2461    ___T: ::fidl_next::Transport,
2462{
2463    async fn on_one_way(
2464        handler: &mut ___H,
2465        mut message: ::fidl_next::Message<___T>,
2466    ) -> ::core::result::Result<
2467        (),
2468        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2469    > {
2470        match *message.header().ordinal {
2471            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2472        }
2473    }
2474
2475    async fn on_two_way(
2476        handler: &mut ___H,
2477        mut message: ::fidl_next::Message<___T>,
2478        responder: ::fidl_next::protocol::Responder<___T>,
2479    ) -> ::core::result::Result<
2480        (),
2481        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2482    > {
2483        match *message.header().ordinal {
2484            3861255986002273625 => {
2485                let responder = ::fidl_next::Responder::from_untyped(responder);
2486
2487                handler.read_input_reports(responder).await;
2488                Ok(())
2489            }
2490
2491            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2492        }
2493    }
2494}
2495
2496/// A client handler for the InputReportsReader protocol.
2497///
2498/// See [`InputReportsReader`] for more details.
2499pub trait InputReportsReaderClientHandler<
2500    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2501    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2502>
2503{
2504}
2505
2506impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for InputReportsReader
2507where
2508    ___H: InputReportsReaderClientHandler<___T> + ::core::marker::Send,
2509    ___T: ::fidl_next::Transport,
2510{
2511    async fn on_event(
2512        handler: &mut ___H,
2513        mut message: ::fidl_next::Message<___T>,
2514    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2515        match *message.header().ordinal {
2516            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2517        }
2518    }
2519}
2520
2521/// A server handler for the InputReportsReader protocol.
2522///
2523/// See [`InputReportsReader`] for more details.
2524pub trait InputReportsReaderServerHandler<
2525    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2526    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2527>
2528{
2529    #[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"]
2530    fn read_input_reports(
2531        &mut self,
2532
2533        responder: ::fidl_next::Responder<input_reports_reader::ReadInputReports, ___T>,
2534    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2535}
2536
2537impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for InputReportsReader
2538where
2539    ___H: InputReportsReaderServerHandler<___T> + ::core::marker::Send,
2540    ___T: ::fidl_next::Transport,
2541{
2542    async fn on_one_way(
2543        handler: &mut ___H,
2544        mut message: ::fidl_next::Message<___T>,
2545    ) -> ::core::result::Result<
2546        (),
2547        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2548    > {
2549        match *message.header().ordinal {
2550            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2551        }
2552    }
2553
2554    async fn on_two_way(
2555        handler: &mut ___H,
2556        mut message: ::fidl_next::Message<___T>,
2557        responder: ::fidl_next::protocol::Responder<___T>,
2558    ) -> ::core::result::Result<
2559        (),
2560        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2561    > {
2562        match *message.header().ordinal {
2563            3861255986002273625 => {
2564                let responder = ::fidl_next::Responder::from_untyped(responder);
2565
2566                handler.read_input_reports(responder).await;
2567                Ok(())
2568            }
2569
2570            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2571        }
2572    }
2573}
2574
2575impl<___T> InputReportsReaderClientHandler<___T> for ::fidl_next::IgnoreEvents where
2576    ___T: ::fidl_next::Transport
2577{
2578}
2579
2580impl<___H, ___T> InputReportsReaderLocalClientHandler<___T> for ::fidl_next::Local<___H>
2581where
2582    ___H: InputReportsReaderClientHandler<___T>,
2583    ___T: ::fidl_next::Transport,
2584{
2585}
2586
2587impl<___H, ___T> InputReportsReaderLocalServerHandler<___T> for ::fidl_next::Local<___H>
2588where
2589    ___H: InputReportsReaderServerHandler<___T>,
2590    ___T: ::fidl_next::Transport,
2591{
2592    async fn read_input_reports(
2593        &mut self,
2594
2595        responder: ::fidl_next::Responder<input_reports_reader::ReadInputReports, ___T>,
2596    ) {
2597        ___H::read_input_reports(&mut self.0, responder).await
2598    }
2599}
2600
2601/// The type corresponding to the Service service.
2602#[derive(Debug)]
2603pub struct Service;
2604
2605impl ::fidl_next::DiscoverableService for Service {
2606    const SERVICE_NAME: &'static str = "fuchsia.input.report.Service";
2607    const MEMBER_NAMES: &'static [&'static str] = &["input_device"];
2608}
2609
2610impl ::fidl_next::HasServiceRequest<::fidl_next::fuchsia::zx::Channel> for Service {}
2611
2612impl<___C> ::fidl_next::Service<___C> for Service
2613where
2614    ___C: ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>,
2615{
2616    type Connector = ServiceConnector<___C>;
2617}
2618
2619/// A strongly-typed service connector for the `Service` service.
2620#[repr(transparent)]
2621pub struct ServiceConnector<___C> {
2622    #[allow(dead_code)]
2623    connector: ___C,
2624}
2625
2626impl<___C> ServiceConnector<___C>
2627where
2628    ___C: ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>,
2629{
2630    /// Attempts to connect to the `input_device` service member.
2631    pub fn input_device(
2632        &self,
2633        server_end: ::fidl_next::ServerEnd<crate::InputDevice, ::fidl_next::fuchsia::zx::Channel>,
2634    ) -> ::core::result::Result<
2635        (),
2636        <___C as ::fidl_next::protocol::ServiceConnector<::fidl_next::fuchsia::zx::Channel>>::Error,
2637    > {
2638        ::fidl_next::protocol::ServiceConnector::<
2639                ::fidl_next::fuchsia::zx::Channel
2640            >::connect_to_member(
2641                &self.connector,
2642                "input_device",
2643                server_end.into_untyped(),
2644            )
2645    }
2646}
2647
2648/// A service handler for the `Service` service.
2649pub trait ServiceHandler {
2650    /// Handles an attempt to connect to the `input_device` member.
2651    fn input_device(
2652        &self,
2653        server_end: ::fidl_next::ServerEnd<crate::InputDevice, ::fidl_next::fuchsia::zx::Channel>,
2654    );
2655}
2656
2657impl<___H, ___T> ::fidl_next::DispatchServiceHandler<___H, ___T> for Service
2658where
2659    ___H: ServiceHandler,
2660    ::fidl_next::fuchsia::zx::Channel: ::fidl_next::InstanceFromServiceTransport<___T>,
2661{
2662    fn on_connection(handler: &___H, member: &str, server_end: ___T) {
2663        use ::fidl_next::InstanceFromServiceTransport;
2664        match member {
2665            "input_device" => handler.input_device(::fidl_next::ServerEnd::from_untyped(
2666                ::fidl_next::fuchsia::zx::Channel::from_service_transport(server_end),
2667            )),
2668
2669            _ => unreachable!(),
2670        }
2671    }
2672}
2673
2674pub use fidl_next_common_fuchsia_input_report::*;