Skip to main content

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