1#![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 #[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 #[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 #[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 #[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 #[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 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 unsafe impl<'a, ___E, T0>
1757 ::fidl_next::Encode<crate::wire::DeviceListenerRegistryRegisterListenerRequest, ___E>
1758 for &'a DeviceListenerRegistryRegisterListenerRequest<T0>
1759 where
1760 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1761 ___E: ::fidl_next::fuchsia::HandleEncoder,
1762 &'a T0: ::fidl_next::Encode<
1763 ::fidl_next::ClientEnd<crate::DeviceListener, ::fidl_next::wire::fuchsia::Channel>,
1764 ___E,
1765 >,
1766 {
1767 #[inline]
1768 fn encode(
1769 self,
1770 encoder_: &mut ___E,
1771 out_: &mut ::core::mem::MaybeUninit<
1772 crate::wire::DeviceListenerRegistryRegisterListenerRequest,
1773 >,
1774 _: (),
1775 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1776 ::fidl_next::munge! {
1777 let crate::wire::DeviceListenerRegistryRegisterListenerRequest {
1778 listener,
1779
1780 } = out_;
1781 }
1782
1783 ::fidl_next::Encode::encode(&self.listener, encoder_, listener, ())?;
1784
1785 Ok(())
1786 }
1787 }
1788
1789 pub struct DeviceListenerRegistryRegisterListenerResponse<T0> {
1791 pub iterator: T0,
1792 }
1793
1794 unsafe impl<___E, T0>
1795 ::fidl_next::Encode<crate::wire::DeviceListenerRegistryRegisterListenerResponse, ___E>
1796 for DeviceListenerRegistryRegisterListenerResponse<T0>
1797 where
1798 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1799 ___E: ::fidl_next::fuchsia::HandleEncoder,
1800 T0: ::fidl_next::Encode<
1801 ::fidl_next::ClientEnd<crate::DeviceIterator, ::fidl_next::wire::fuchsia::Channel>,
1802 ___E,
1803 >,
1804 {
1805 #[inline]
1806 fn encode(
1807 self,
1808 encoder_: &mut ___E,
1809 out_: &mut ::core::mem::MaybeUninit<
1810 crate::wire::DeviceListenerRegistryRegisterListenerResponse,
1811 >,
1812 _: (),
1813 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1814 ::fidl_next::munge! {
1815 let crate::wire::DeviceListenerRegistryRegisterListenerResponse {
1816 iterator,
1817
1818 } = out_;
1819 }
1820
1821 ::fidl_next::Encode::encode(self.iterator, encoder_, iterator, ())?;
1822
1823 Ok(())
1824 }
1825 }
1826
1827 unsafe impl<'a, ___E, T0>
1828 ::fidl_next::Encode<crate::wire::DeviceListenerRegistryRegisterListenerResponse, ___E>
1829 for &'a DeviceListenerRegistryRegisterListenerResponse<T0>
1830 where
1831 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1832 ___E: ::fidl_next::fuchsia::HandleEncoder,
1833 &'a T0: ::fidl_next::Encode<
1834 ::fidl_next::ClientEnd<crate::DeviceIterator, ::fidl_next::wire::fuchsia::Channel>,
1835 ___E,
1836 >,
1837 {
1838 #[inline]
1839 fn encode(
1840 self,
1841 encoder_: &mut ___E,
1842 out_: &mut ::core::mem::MaybeUninit<
1843 crate::wire::DeviceListenerRegistryRegisterListenerResponse,
1844 >,
1845 _: (),
1846 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1847 ::fidl_next::munge! {
1848 let crate::wire::DeviceListenerRegistryRegisterListenerResponse {
1849 iterator,
1850
1851 } = out_;
1852 }
1853
1854 ::fidl_next::Encode::encode(&self.iterator, encoder_, iterator, ())?;
1855
1856 Ok(())
1857 }
1858 }
1859
1860 pub struct ImeServiceGetInputMethodEditorRequest<T0, T1, T2, T3, T4> {
1862 pub keyboard_type: T0,
1863
1864 pub action: T1,
1865
1866 pub initial_state: T2,
1867
1868 pub client: T3,
1869
1870 pub editor: T4,
1871 }
1872
1873 unsafe impl<___E, T0, T1, T2, T3, T4>
1874 ::fidl_next::Encode<crate::wire::ImeServiceGetInputMethodEditorRequest<'static>, ___E>
1875 for ImeServiceGetInputMethodEditorRequest<T0, T1, T2, T3, T4>
1876 where
1877 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1878 ___E: ::fidl_next::Encoder,
1879 ___E: ::fidl_next::fuchsia::HandleEncoder,
1880 T0: ::fidl_next::Encode<crate::wire::KeyboardType, ___E>,
1881 T1: ::fidl_next::Encode<crate::wire::InputMethodAction, ___E>,
1882 T2: ::fidl_next::Encode<crate::wire::TextInputState<'static>, ___E>,
1883 T3: ::fidl_next::Encode<
1884 ::fidl_next::ClientEnd<
1885 crate::InputMethodEditorClient,
1886 ::fidl_next::wire::fuchsia::Channel,
1887 >,
1888 ___E,
1889 >,
1890 T4: ::fidl_next::Encode<
1891 ::fidl_next::ServerEnd<
1892 crate::InputMethodEditor,
1893 ::fidl_next::wire::fuchsia::Channel,
1894 >,
1895 ___E,
1896 >,
1897 {
1898 #[inline]
1899 fn encode(
1900 self,
1901 encoder_: &mut ___E,
1902 out_: &mut ::core::mem::MaybeUninit<
1903 crate::wire::ImeServiceGetInputMethodEditorRequest<'static>,
1904 >,
1905 _: (),
1906 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1907 ::fidl_next::munge! {
1908 let crate::wire::ImeServiceGetInputMethodEditorRequest {
1909 keyboard_type,
1910 action,
1911 initial_state,
1912 client,
1913 editor,
1914
1915 } = out_;
1916 }
1917
1918 ::fidl_next::Encode::encode(self.keyboard_type, encoder_, keyboard_type, ())?;
1919
1920 ::fidl_next::Encode::encode(self.action, encoder_, action, ())?;
1921
1922 ::fidl_next::Encode::encode(self.initial_state, encoder_, initial_state, ())?;
1923
1924 ::fidl_next::Encode::encode(self.client, encoder_, client, ())?;
1925
1926 ::fidl_next::Encode::encode(self.editor, encoder_, editor, ())?;
1927
1928 Ok(())
1929 }
1930 }
1931
1932 unsafe impl<'a, ___E, T0, T1, T2, T3, T4>
1933 ::fidl_next::Encode<crate::wire::ImeServiceGetInputMethodEditorRequest<'static>, ___E>
1934 for &'a ImeServiceGetInputMethodEditorRequest<T0, T1, T2, T3, T4>
1935 where
1936 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1937 ___E: ::fidl_next::Encoder,
1938 ___E: ::fidl_next::fuchsia::HandleEncoder,
1939 &'a T0: ::fidl_next::Encode<crate::wire::KeyboardType, ___E>,
1940 &'a T1: ::fidl_next::Encode<crate::wire::InputMethodAction, ___E>,
1941 &'a T2: ::fidl_next::Encode<crate::wire::TextInputState<'static>, ___E>,
1942 &'a T3: ::fidl_next::Encode<
1943 ::fidl_next::ClientEnd<
1944 crate::InputMethodEditorClient,
1945 ::fidl_next::wire::fuchsia::Channel,
1946 >,
1947 ___E,
1948 >,
1949 &'a T4: ::fidl_next::Encode<
1950 ::fidl_next::ServerEnd<
1951 crate::InputMethodEditor,
1952 ::fidl_next::wire::fuchsia::Channel,
1953 >,
1954 ___E,
1955 >,
1956 {
1957 #[inline]
1958 fn encode(
1959 self,
1960 encoder_: &mut ___E,
1961 out_: &mut ::core::mem::MaybeUninit<
1962 crate::wire::ImeServiceGetInputMethodEditorRequest<'static>,
1963 >,
1964 _: (),
1965 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1966 ::fidl_next::munge! {
1967 let crate::wire::ImeServiceGetInputMethodEditorRequest {
1968 keyboard_type,
1969 action,
1970 initial_state,
1971 client,
1972 editor,
1973
1974 } = out_;
1975 }
1976
1977 ::fidl_next::Encode::encode(&self.keyboard_type, encoder_, keyboard_type, ())?;
1978
1979 ::fidl_next::Encode::encode(&self.action, encoder_, action, ())?;
1980
1981 ::fidl_next::Encode::encode(&self.initial_state, encoder_, initial_state, ())?;
1982
1983 ::fidl_next::Encode::encode(&self.client, encoder_, client, ())?;
1984
1985 ::fidl_next::Encode::encode(&self.editor, encoder_, editor, ())?;
1986
1987 Ok(())
1988 }
1989 }
1990}
1991
1992pub use self::natural::*;
1993
1994#[doc = " Registry service that allows clients to monitor input device changes.\n"]
1996#[derive(PartialEq, Debug)]
1997pub struct DeviceListenerRegistry;
1998
1999impl ::fidl_next::Discoverable for DeviceListenerRegistry {
2000 const PROTOCOL_NAME: &'static str = "fuchsia.ui.input.DeviceListenerRegistry";
2001}
2002
2003#[cfg(target_os = "fuchsia")]
2004impl ::fidl_next::HasTransport for DeviceListenerRegistry {
2005 type Transport = ::fidl_next::fuchsia::zx::Channel;
2006}
2007
2008pub mod device_listener_registry {
2009 pub mod prelude {
2010 pub use crate::{
2011 DeviceListenerRegistry, DeviceListenerRegistryClientHandler,
2012 DeviceListenerRegistryLocalClientHandler, DeviceListenerRegistryLocalServerHandler,
2013 DeviceListenerRegistryServerHandler, device_listener_registry,
2014 };
2015
2016 pub use crate::natural::DeviceListenerRegistryRegisterListenerRequest;
2017
2018 pub use crate::natural::DeviceListenerRegistryRegisterListenerResponse;
2019 }
2020
2021 pub struct RegisterListener;
2022
2023 impl ::fidl_next::Method for RegisterListener {
2024 const ORDINAL: u64 = 2866676296029265929;
2025 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2026 ::fidl_next::protocol::Flexibility::Strict;
2027
2028 type Protocol = crate::DeviceListenerRegistry;
2029
2030 type Request = crate::wire::DeviceListenerRegistryRegisterListenerRequest;
2031 }
2032
2033 impl ::fidl_next::TwoWayMethod for RegisterListener {
2034 type Response =
2035 ::fidl_next::wire::Strict<crate::wire::DeviceListenerRegistryRegisterListenerResponse>;
2036 }
2037
2038 impl<___R> ::fidl_next::Respond<___R> for RegisterListener {
2039 type Output = ::fidl_next::Strict<
2040 crate::generic::DeviceListenerRegistryRegisterListenerResponse<___R>,
2041 >;
2042
2043 fn respond(response: ___R) -> Self::Output {
2044 ::fidl_next::Strict(crate::generic::DeviceListenerRegistryRegisterListenerResponse {
2045 iterator: response,
2046 })
2047 }
2048 }
2049
2050 mod ___detail {
2051 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::DeviceListenerRegistry
2052 where
2053 ___T: ::fidl_next::Transport,
2054 {
2055 type Client = DeviceListenerRegistryClient<___T>;
2056 type Server = DeviceListenerRegistryServer<___T>;
2057 }
2058
2059 #[repr(transparent)]
2061 pub struct DeviceListenerRegistryClient<___T: ::fidl_next::Transport> {
2062 #[allow(dead_code)]
2063 client: ::fidl_next::protocol::Client<___T>,
2064 }
2065
2066 impl<___T> DeviceListenerRegistryClient<___T>
2067 where
2068 ___T: ::fidl_next::Transport,
2069 {
2070 #[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"]
2071 pub fn register_listener(
2072 &self,
2073
2074 listener: impl ::fidl_next::Encode<
2075 ::fidl_next::ClientEnd<
2076 crate::DeviceListener,
2077 ::fidl_next::wire::fuchsia::Channel,
2078 >,
2079 <___T as ::fidl_next::Transport>::SendBuffer,
2080 >,
2081 ) -> ::fidl_next::TwoWayFuture<'_, super::RegisterListener, ___T>
2082 where
2083 <___T as ::fidl_next::Transport>::SendBuffer:
2084 ::fidl_next::encoder::InternalHandleEncoder,
2085 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2086 {
2087 self.register_listener_with(
2088 crate::generic::DeviceListenerRegistryRegisterListenerRequest { listener },
2089 )
2090 }
2091
2092 #[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"]
2093 pub fn register_listener_with<___R>(
2094 &self,
2095 request: ___R,
2096 ) -> ::fidl_next::TwoWayFuture<'_, super::RegisterListener, ___T>
2097 where
2098 ___R: ::fidl_next::Encode<
2099 crate::wire::DeviceListenerRegistryRegisterListenerRequest,
2100 <___T as ::fidl_next::Transport>::SendBuffer,
2101 >,
2102 {
2103 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2104 2866676296029265929,
2105 <super::RegisterListener as ::fidl_next::Method>::FLEXIBILITY,
2106 request,
2107 ))
2108 }
2109 }
2110
2111 #[repr(transparent)]
2113 pub struct DeviceListenerRegistryServer<___T: ::fidl_next::Transport> {
2114 server: ::fidl_next::protocol::Server<___T>,
2115 }
2116
2117 impl<___T> DeviceListenerRegistryServer<___T> where ___T: ::fidl_next::Transport {}
2118 }
2119}
2120
2121#[diagnostic::on_unimplemented(
2122 note = "If {Self} implements the non-local DeviceListenerRegistryClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2123)]
2124
2125pub trait DeviceListenerRegistryLocalClientHandler<
2129 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2130 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2131>
2132{
2133 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2134 ::core::future::ready(())
2135 }
2136}
2137
2138impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for DeviceListenerRegistry
2139where
2140 ___H: DeviceListenerRegistryLocalClientHandler<___T>,
2141 ___T: ::fidl_next::Transport,
2142{
2143 async fn on_event(
2144 handler: &mut ___H,
2145 mut message: ::fidl_next::Message<___T>,
2146 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2147 match *message.header().ordinal {
2148 ordinal => {
2149 handler.on_unknown_interaction(ordinal).await;
2150 if ::core::matches!(
2151 message.header().flexibility(),
2152 ::fidl_next::protocol::Flexibility::Strict
2153 ) {
2154 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2155 } else {
2156 Ok(())
2157 }
2158 }
2159 }
2160 }
2161}
2162
2163#[diagnostic::on_unimplemented(
2164 note = "If {Self} implements the non-local DeviceListenerRegistryServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2165)]
2166
2167pub trait DeviceListenerRegistryLocalServerHandler<
2171 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2172 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2173>
2174{
2175 #[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"]
2176 fn register_listener(
2177 &mut self,
2178
2179 request: ::fidl_next::Request<device_listener_registry::RegisterListener, ___T>,
2180
2181 responder: ::fidl_next::Responder<device_listener_registry::RegisterListener, ___T>,
2182 ) -> impl ::core::future::Future<Output = ()>;
2183
2184 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2185 ::core::future::ready(())
2186 }
2187}
2188
2189impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for DeviceListenerRegistry
2190where
2191 ___H: DeviceListenerRegistryLocalServerHandler<___T>,
2192 ___T: ::fidl_next::Transport,
2193 for<'de> crate::wire::DeviceListenerRegistryRegisterListenerRequest: ::fidl_next::Decode<
2194 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2195 Constraint = (),
2196 >,
2197{
2198 async fn on_one_way(
2199 handler: &mut ___H,
2200 mut message: ::fidl_next::Message<___T>,
2201 ) -> ::core::result::Result<
2202 (),
2203 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2204 > {
2205 match *message.header().ordinal {
2206 ordinal => {
2207 handler.on_unknown_interaction(ordinal).await;
2208 if ::core::matches!(
2209 message.header().flexibility(),
2210 ::fidl_next::protocol::Flexibility::Strict
2211 ) {
2212 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2213 } else {
2214 Ok(())
2215 }
2216 }
2217 }
2218 }
2219
2220 async fn on_two_way(
2221 handler: &mut ___H,
2222 mut message: ::fidl_next::Message<___T>,
2223 responder: ::fidl_next::protocol::Responder<___T>,
2224 ) -> ::core::result::Result<
2225 (),
2226 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2227 > {
2228 match *message.header().ordinal {
2229 2866676296029265929 => {
2230 let responder = ::fidl_next::Responder::from_untyped(responder);
2231
2232 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2233 Ok(decoded) => {
2234 handler
2235 .register_listener(
2236 ::fidl_next::Request::from_decoded(decoded),
2237 responder,
2238 )
2239 .await;
2240 Ok(())
2241 }
2242 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2243 ordinal: 2866676296029265929,
2244 error,
2245 }),
2246 }
2247 }
2248
2249 ordinal => {
2250 handler.on_unknown_interaction(ordinal).await;
2251 if ::core::matches!(
2252 message.header().flexibility(),
2253 ::fidl_next::protocol::Flexibility::Strict
2254 ) {
2255 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2256 } else {
2257 responder
2258 .respond_framework_error(
2259 ordinal,
2260 ::fidl_next::FrameworkError::UnknownMethod,
2261 )
2262 .expect("encoding a framework error should never fail")
2263 .await?;
2264 Ok(())
2265 }
2266 }
2267 }
2268 }
2269}
2270
2271pub trait DeviceListenerRegistryClientHandler<
2275 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2276 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2277>
2278{
2279 fn on_unknown_interaction(
2280 &mut self,
2281 ordinal: u64,
2282 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2283 ::core::future::ready(())
2284 }
2285}
2286
2287impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for DeviceListenerRegistry
2288where
2289 ___H: DeviceListenerRegistryClientHandler<___T> + ::core::marker::Send,
2290 ___T: ::fidl_next::Transport,
2291{
2292 async fn on_event(
2293 handler: &mut ___H,
2294 mut message: ::fidl_next::Message<___T>,
2295 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2296 match *message.header().ordinal {
2297 ordinal => {
2298 handler.on_unknown_interaction(ordinal).await;
2299 if ::core::matches!(
2300 message.header().flexibility(),
2301 ::fidl_next::protocol::Flexibility::Strict
2302 ) {
2303 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2304 } else {
2305 Ok(())
2306 }
2307 }
2308 }
2309 }
2310}
2311
2312pub trait DeviceListenerRegistryServerHandler<
2316 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2317 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2318>
2319{
2320 #[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"]
2321 fn register_listener(
2322 &mut self,
2323
2324 request: ::fidl_next::Request<device_listener_registry::RegisterListener, ___T>,
2325
2326 responder: ::fidl_next::Responder<device_listener_registry::RegisterListener, ___T>,
2327 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2328
2329 fn on_unknown_interaction(
2330 &mut self,
2331 ordinal: u64,
2332 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2333 ::core::future::ready(())
2334 }
2335}
2336
2337impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for DeviceListenerRegistry
2338where
2339 ___H: DeviceListenerRegistryServerHandler<___T> + ::core::marker::Send,
2340 ___T: ::fidl_next::Transport,
2341 for<'de> crate::wire::DeviceListenerRegistryRegisterListenerRequest: ::fidl_next::Decode<
2342 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2343 Constraint = (),
2344 >,
2345{
2346 async fn on_one_way(
2347 handler: &mut ___H,
2348 mut message: ::fidl_next::Message<___T>,
2349 ) -> ::core::result::Result<
2350 (),
2351 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2352 > {
2353 match *message.header().ordinal {
2354 ordinal => {
2355 handler.on_unknown_interaction(ordinal).await;
2356 if ::core::matches!(
2357 message.header().flexibility(),
2358 ::fidl_next::protocol::Flexibility::Strict
2359 ) {
2360 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2361 } else {
2362 Ok(())
2363 }
2364 }
2365 }
2366 }
2367
2368 async fn on_two_way(
2369 handler: &mut ___H,
2370 mut message: ::fidl_next::Message<___T>,
2371 responder: ::fidl_next::protocol::Responder<___T>,
2372 ) -> ::core::result::Result<
2373 (),
2374 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2375 > {
2376 match *message.header().ordinal {
2377 2866676296029265929 => {
2378 let responder = ::fidl_next::Responder::from_untyped(responder);
2379
2380 match ::fidl_next::AsDecoderExt::into_decoded(message) {
2381 Ok(decoded) => {
2382 handler
2383 .register_listener(
2384 ::fidl_next::Request::from_decoded(decoded),
2385 responder,
2386 )
2387 .await;
2388 Ok(())
2389 }
2390 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2391 ordinal: 2866676296029265929,
2392 error,
2393 }),
2394 }
2395 }
2396
2397 ordinal => {
2398 handler.on_unknown_interaction(ordinal).await;
2399 if ::core::matches!(
2400 message.header().flexibility(),
2401 ::fidl_next::protocol::Flexibility::Strict
2402 ) {
2403 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2404 } else {
2405 responder
2406 .respond_framework_error(
2407 ordinal,
2408 ::fidl_next::FrameworkError::UnknownMethod,
2409 )
2410 .expect("encoding a framework error should never fail")
2411 .await?;
2412 Ok(())
2413 }
2414 }
2415 }
2416 }
2417}
2418
2419impl<___T> DeviceListenerRegistryClientHandler<___T> for ::fidl_next::IgnoreEvents
2420where
2421 ___T: ::fidl_next::Transport,
2422{
2423 async fn on_unknown_interaction(&mut self, _: u64) {}
2424}
2425
2426impl<___H, ___T> DeviceListenerRegistryLocalClientHandler<___T> for ::fidl_next::Local<___H>
2427where
2428 ___H: DeviceListenerRegistryClientHandler<___T>,
2429 ___T: ::fidl_next::Transport,
2430{
2431 async fn on_unknown_interaction(&mut self, ordinal: u64) {
2432 ___H::on_unknown_interaction(&mut self.0, ordinal).await
2433 }
2434}
2435
2436impl<___H, ___T> DeviceListenerRegistryLocalServerHandler<___T> for ::fidl_next::Local<___H>
2437where
2438 ___H: DeviceListenerRegistryServerHandler<___T>,
2439 ___T: ::fidl_next::Transport,
2440{
2441 async fn register_listener(
2442 &mut self,
2443
2444 request: ::fidl_next::Request<device_listener_registry::RegisterListener, ___T>,
2445
2446 responder: ::fidl_next::Responder<device_listener_registry::RegisterListener, ___T>,
2447 ) {
2448 ___H::register_listener(&mut self.0, request, responder).await
2449 }
2450
2451 async fn on_unknown_interaction(&mut self, ordinal: u64) {
2452 ___H::on_unknown_interaction(&mut self.0, ordinal).await
2453 }
2454}
2455
2456#[doc = " The service provided by an IME\n"]
2458#[derive(PartialEq, Debug)]
2459pub struct ImeService;
2460
2461impl ::fidl_next::Discoverable for ImeService {
2462 const PROTOCOL_NAME: &'static str = "fuchsia.ui.input.ImeService";
2463}
2464
2465#[cfg(target_os = "fuchsia")]
2466impl ::fidl_next::HasTransport for ImeService {
2467 type Transport = ::fidl_next::fuchsia::zx::Channel;
2468}
2469
2470pub mod ime_service {
2471 pub mod prelude {
2472 pub use crate::{
2473 ImeService, ImeServiceClientHandler, ImeServiceLocalClientHandler,
2474 ImeServiceLocalServerHandler, ImeServiceServerHandler, ime_service,
2475 };
2476
2477 pub use crate::natural::ImeServiceGetInputMethodEditorRequest;
2478 }
2479
2480 pub struct GetInputMethodEditor;
2481
2482 impl ::fidl_next::Method for GetInputMethodEditor {
2483 const ORDINAL: u64 = 1480890716194628092;
2484 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2485 ::fidl_next::protocol::Flexibility::Strict;
2486
2487 type Protocol = crate::ImeService;
2488
2489 type Request = crate::wire::ImeServiceGetInputMethodEditorRequest<'static>;
2490 }
2491
2492 pub struct ShowKeyboard;
2493
2494 impl ::fidl_next::Method for ShowKeyboard {
2495 const ORDINAL: u64 = 4101981143447698672;
2496 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2497 ::fidl_next::protocol::Flexibility::Strict;
2498
2499 type Protocol = crate::ImeService;
2500
2501 type Request = ::fidl_next::wire::EmptyMessageBody;
2502 }
2503
2504 pub struct HideKeyboard;
2505
2506 impl ::fidl_next::Method for HideKeyboard {
2507 const ORDINAL: u64 = 8532052555131062781;
2508 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2509 ::fidl_next::protocol::Flexibility::Strict;
2510
2511 type Protocol = crate::ImeService;
2512
2513 type Request = ::fidl_next::wire::EmptyMessageBody;
2514 }
2515
2516 mod ___detail {
2517 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::ImeService
2518 where
2519 ___T: ::fidl_next::Transport,
2520 {
2521 type Client = ImeServiceClient<___T>;
2522 type Server = ImeServiceServer<___T>;
2523 }
2524
2525 #[repr(transparent)]
2527 pub struct ImeServiceClient<___T: ::fidl_next::Transport> {
2528 #[allow(dead_code)]
2529 client: ::fidl_next::protocol::Client<___T>,
2530 }
2531
2532 impl<___T> ImeServiceClient<___T>
2533 where
2534 ___T: ::fidl_next::Transport,
2535 {
2536 pub fn get_input_method_editor(
2537 &self,
2538
2539 keyboard_type: impl ::fidl_next::Encode<
2540 crate::wire::KeyboardType,
2541 <___T as ::fidl_next::Transport>::SendBuffer,
2542 >,
2543
2544 action: impl ::fidl_next::Encode<
2545 crate::wire::InputMethodAction,
2546 <___T as ::fidl_next::Transport>::SendBuffer,
2547 >,
2548
2549 initial_state: impl ::fidl_next::Encode<
2550 crate::wire::TextInputState<'static>,
2551 <___T as ::fidl_next::Transport>::SendBuffer,
2552 >,
2553
2554 client: impl ::fidl_next::Encode<
2555 ::fidl_next::ClientEnd<
2556 crate::InputMethodEditorClient,
2557 ::fidl_next::wire::fuchsia::Channel,
2558 >,
2559 <___T as ::fidl_next::Transport>::SendBuffer,
2560 >,
2561
2562 editor: impl ::fidl_next::Encode<
2563 ::fidl_next::ServerEnd<
2564 crate::InputMethodEditor,
2565 ::fidl_next::wire::fuchsia::Channel,
2566 >,
2567 <___T as ::fidl_next::Transport>::SendBuffer,
2568 >,
2569 ) -> ::fidl_next::SendFuture<'_, ___T>
2570 where
2571 <___T as ::fidl_next::Transport>::SendBuffer:
2572 ::fidl_next::encoder::InternalHandleEncoder,
2573 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2574 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2575 {
2576 self.get_input_method_editor_with(
2577 crate::generic::ImeServiceGetInputMethodEditorRequest {
2578 keyboard_type,
2579
2580 action,
2581
2582 initial_state,
2583
2584 client,
2585
2586 editor,
2587 },
2588 )
2589 }
2590
2591 pub fn get_input_method_editor_with<___R>(
2592 &self,
2593 request: ___R,
2594 ) -> ::fidl_next::SendFuture<'_, ___T>
2595 where
2596 ___R: ::fidl_next::Encode<
2597 crate::wire::ImeServiceGetInputMethodEditorRequest<'static>,
2598 <___T as ::fidl_next::Transport>::SendBuffer,
2599 >,
2600 {
2601 ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
2602 1480890716194628092,
2603 <super::GetInputMethodEditor as ::fidl_next::Method>::FLEXIBILITY,
2604 request,
2605 ))
2606 }
2607
2608 pub fn show_keyboard(&self) -> ::fidl_next::SendFuture<'_, ___T> {
2609 ::fidl_next::SendFuture::from_untyped(
2610 self.client.send_one_way::<::fidl_next::wire::EmptyMessageBody>(
2611 4101981143447698672,
2612 <super::ShowKeyboard as ::fidl_next::Method>::FLEXIBILITY,
2613 (),
2614 ),
2615 )
2616 }
2617
2618 pub fn hide_keyboard(&self) -> ::fidl_next::SendFuture<'_, ___T> {
2619 ::fidl_next::SendFuture::from_untyped(
2620 self.client.send_one_way::<::fidl_next::wire::EmptyMessageBody>(
2621 8532052555131062781,
2622 <super::HideKeyboard as ::fidl_next::Method>::FLEXIBILITY,
2623 (),
2624 ),
2625 )
2626 }
2627 }
2628
2629 #[repr(transparent)]
2631 pub struct ImeServiceServer<___T: ::fidl_next::Transport> {
2632 server: ::fidl_next::protocol::Server<___T>,
2633 }
2634
2635 impl<___T> ImeServiceServer<___T> where ___T: ::fidl_next::Transport {}
2636 }
2637}
2638
2639#[diagnostic::on_unimplemented(
2640 note = "If {Self} implements the non-local ImeServiceClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2641)]
2642
2643pub trait ImeServiceLocalClientHandler<
2647 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2648 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2649>
2650{
2651}
2652
2653impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for ImeService
2654where
2655 ___H: ImeServiceLocalClientHandler<___T>,
2656 ___T: ::fidl_next::Transport,
2657{
2658 async fn on_event(
2659 handler: &mut ___H,
2660 mut message: ::fidl_next::Message<___T>,
2661 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2662 match *message.header().ordinal {
2663 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2664 }
2665 }
2666}
2667
2668#[diagnostic::on_unimplemented(
2669 note = "If {Self} implements the non-local ImeServiceServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2670)]
2671
2672pub trait ImeServiceLocalServerHandler<
2676 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2677 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2678>
2679{
2680 fn get_input_method_editor(
2681 &mut self,
2682
2683 request: ::fidl_next::Request<ime_service::GetInputMethodEditor, ___T>,
2684 ) -> impl ::core::future::Future<Output = ()>;
2685
2686 fn show_keyboard(&mut self) -> impl ::core::future::Future<Output = ()>;
2687
2688 fn hide_keyboard(&mut self) -> impl ::core::future::Future<Output = ()>;
2689}
2690
2691impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for ImeService
2692where
2693 ___H: ImeServiceLocalServerHandler<___T>,
2694 ___T: ::fidl_next::Transport,
2695 for<'de> crate::wire::ImeServiceGetInputMethodEditorRequest<'de>: ::fidl_next::Decode<
2696 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2697 Constraint = (),
2698 >,
2699{
2700 async fn on_one_way(
2701 handler: &mut ___H,
2702 mut message: ::fidl_next::Message<___T>,
2703 ) -> ::core::result::Result<
2704 (),
2705 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2706 > {
2707 match *message.header().ordinal {
2708 1480890716194628092 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
2709 Ok(decoded) => {
2710 handler
2711 .get_input_method_editor(::fidl_next::Request::from_decoded(decoded))
2712 .await;
2713 Ok(())
2714 }
2715 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2716 ordinal: 1480890716194628092,
2717 error,
2718 }),
2719 },
2720
2721 4101981143447698672 => {
2722 handler.show_keyboard().await;
2723 Ok(())
2724 }
2725
2726 8532052555131062781 => {
2727 handler.hide_keyboard().await;
2728 Ok(())
2729 }
2730
2731 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2732 }
2733 }
2734
2735 async fn on_two_way(
2736 handler: &mut ___H,
2737 mut message: ::fidl_next::Message<___T>,
2738 responder: ::fidl_next::protocol::Responder<___T>,
2739 ) -> ::core::result::Result<
2740 (),
2741 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2742 > {
2743 match *message.header().ordinal {
2744 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2745 }
2746 }
2747}
2748
2749pub trait ImeServiceClientHandler<
2753 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2754 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2755>
2756{
2757}
2758
2759impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ImeService
2760where
2761 ___H: ImeServiceClientHandler<___T> + ::core::marker::Send,
2762 ___T: ::fidl_next::Transport,
2763{
2764 async fn on_event(
2765 handler: &mut ___H,
2766 mut message: ::fidl_next::Message<___T>,
2767 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2768 match *message.header().ordinal {
2769 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2770 }
2771 }
2772}
2773
2774pub trait ImeServiceServerHandler<
2778 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2779 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2780>
2781{
2782 fn get_input_method_editor(
2783 &mut self,
2784
2785 request: ::fidl_next::Request<ime_service::GetInputMethodEditor, ___T>,
2786 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2787
2788 fn show_keyboard(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2789
2790 fn hide_keyboard(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2791}
2792
2793impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ImeService
2794where
2795 ___H: ImeServiceServerHandler<___T> + ::core::marker::Send,
2796 ___T: ::fidl_next::Transport,
2797 for<'de> crate::wire::ImeServiceGetInputMethodEditorRequest<'de>: ::fidl_next::Decode<
2798 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2799 Constraint = (),
2800 >,
2801{
2802 async fn on_one_way(
2803 handler: &mut ___H,
2804 mut message: ::fidl_next::Message<___T>,
2805 ) -> ::core::result::Result<
2806 (),
2807 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2808 > {
2809 match *message.header().ordinal {
2810 1480890716194628092 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
2811 Ok(decoded) => {
2812 handler
2813 .get_input_method_editor(::fidl_next::Request::from_decoded(decoded))
2814 .await;
2815 Ok(())
2816 }
2817 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2818 ordinal: 1480890716194628092,
2819 error,
2820 }),
2821 },
2822
2823 4101981143447698672 => {
2824 handler.show_keyboard().await;
2825 Ok(())
2826 }
2827
2828 8532052555131062781 => {
2829 handler.hide_keyboard().await;
2830 Ok(())
2831 }
2832
2833 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2834 }
2835 }
2836
2837 async fn on_two_way(
2838 handler: &mut ___H,
2839 mut message: ::fidl_next::Message<___T>,
2840 responder: ::fidl_next::protocol::Responder<___T>,
2841 ) -> ::core::result::Result<
2842 (),
2843 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2844 > {
2845 match *message.header().ordinal {
2846 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2847 }
2848 }
2849}
2850
2851impl<___T> ImeServiceClientHandler<___T> for ::fidl_next::IgnoreEvents where
2852 ___T: ::fidl_next::Transport
2853{
2854}
2855
2856impl<___H, ___T> ImeServiceLocalClientHandler<___T> for ::fidl_next::Local<___H>
2857where
2858 ___H: ImeServiceClientHandler<___T>,
2859 ___T: ::fidl_next::Transport,
2860{
2861}
2862
2863impl<___H, ___T> ImeServiceLocalServerHandler<___T> for ::fidl_next::Local<___H>
2864where
2865 ___H: ImeServiceServerHandler<___T>,
2866 ___T: ::fidl_next::Transport,
2867{
2868 async fn get_input_method_editor(
2869 &mut self,
2870
2871 request: ::fidl_next::Request<ime_service::GetInputMethodEditor, ___T>,
2872 ) {
2873 ___H::get_input_method_editor(&mut self.0, request).await
2874 }
2875
2876 async fn show_keyboard(&mut self) {
2877 ___H::show_keyboard(&mut self.0).await
2878 }
2879
2880 async fn hide_keyboard(&mut self) {
2881 ___H::hide_keyboard(&mut self.0).await
2882 }
2883}
2884
2885pub use fidl_next_common_fuchsia_ui_input::*;