1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 #[doc = " Type of the keyboard key input event.\n\n We do not expect new values to be added into this enum.\n"]
8 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9 #[repr(u32)]
10 pub enum KeyEventType {
11 Pressed = 1,
12 Released = 2,
13 Sync = 3,
14 Cancel = 4,
15 }
16 impl ::core::convert::TryFrom<u32> for KeyEventType {
17 type Error = ::fidl_next::UnknownStrictEnumMemberError;
18 fn try_from(
19 value: u32,
20 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
21 match value {
22 1 => Ok(Self::Pressed),
23 2 => Ok(Self::Released),
24 3 => Ok(Self::Sync),
25 4 => Ok(Self::Cancel),
26
27 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
28 }
29 }
30 }
31
32 impl ::std::convert::From<KeyEventType> for u32 {
33 fn from(value: KeyEventType) -> Self {
34 match value {
35 KeyEventType::Pressed => 1,
36 KeyEventType::Released => 2,
37 KeyEventType::Sync => 3,
38 KeyEventType::Cancel => 4,
39 }
40 }
41 }
42
43 unsafe impl<___E> ::fidl_next::Encode<crate::wire::KeyEventType, ___E> for KeyEventType
44 where
45 ___E: ?Sized,
46 {
47 #[inline]
48 fn encode(
49 self,
50 encoder: &mut ___E,
51 out: &mut ::core::mem::MaybeUninit<crate::wire::KeyEventType>,
52 _: (),
53 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
54 ::fidl_next::Encode::encode(&self, encoder, out, ())
55 }
56 }
57
58 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::KeyEventType, ___E> for &'a KeyEventType
59 where
60 ___E: ?Sized,
61 {
62 #[inline]
63 fn encode(
64 self,
65 encoder: &mut ___E,
66 out: &mut ::core::mem::MaybeUninit<crate::wire::KeyEventType>,
67 _: (),
68 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
69 ::fidl_next::munge!(let crate::wire::KeyEventType { value } = out);
70 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
71 KeyEventType::Pressed => 1,
72
73 KeyEventType::Released => 2,
74
75 KeyEventType::Sync => 3,
76
77 KeyEventType::Cancel => 4,
78 }));
79
80 Ok(())
81 }
82 }
83
84 impl ::core::convert::From<crate::wire::KeyEventType> for KeyEventType {
85 fn from(wire: crate::wire::KeyEventType) -> Self {
86 match u32::from(wire.value) {
87 1 => Self::Pressed,
88
89 2 => Self::Released,
90
91 3 => Self::Sync,
92
93 4 => Self::Cancel,
94
95 _ => unsafe { ::core::hint::unreachable_unchecked() },
96 }
97 }
98 }
99
100 impl ::fidl_next::FromWire<crate::wire::KeyEventType> for KeyEventType {
101 #[inline]
102 fn from_wire(wire: crate::wire::KeyEventType) -> Self {
103 Self::from(wire)
104 }
105 }
106
107 impl ::fidl_next::FromWireRef<crate::wire::KeyEventType> for KeyEventType {
108 #[inline]
109 fn from_wire_ref(wire: &crate::wire::KeyEventType) -> Self {
110 Self::from(*wire)
111 }
112 }
113
114 ::fidl_next::bitflags::bitflags! {
115 #[doc = " Declares all the modifiers supported by Fuchsia\'s input subsystem.\n\n Modifiers are special keys that modify the purpose or the function\n of other keys when used in combination with them. In the Modifiers type,\n a bit is set if the specific modifier key is actuated (held down),\n irrespective of whether the modifier has an associated lock state or not.\n\n **NOTE:** If you want to examine the lock state (such as whether Caps\n Lock needs to turn all letters into uppercase),you want [LockState]\n instead.\n\n Somewhat specially, and as a convenience for the users, the modifiers that\n have \"left\" and \"right\" flavors have special bit values which can be used\n if the distinction between sides does not matter.\n"]#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct Modifiers: u64 {
116 #[doc = " Applies when the `CAPS_LOCK` modifier is actuated.\n"]const CAPS_LOCK = 1;
117 #[doc = " Applies when the `NUM_LOCK` modifier is actuated.\n"]const NUM_LOCK = 2;
118 #[doc = " Applies when the `SCROLL_LOCK` modifier is actuated.\n"]const SCROLL_LOCK = 4;
119 #[doc = " Applies when the `FUNCTION` modifier is actuated.\n"]const FUNCTION = 8;
120 #[doc = " Applies when the `SYMBOL` modifier is actuated.\n"]const SYMBOL = 16;
121 #[doc = " Applies when the left SHIFT modifier is actuated.\n"]const LEFT_SHIFT = 32;
122 #[doc = " Applies when the right SHIFT modifier is actuated.\n"]const RIGHT_SHIFT = 64;
123 #[doc = " Applies when either `LEFT_SHIFT` or `RIGHT_SHIFT` modifier is actuated.\n\n This bit mask a convenience to test for either `LEFT_SHIFT`\n or `RIGHT_SHIFT`.\n"]const SHIFT = 128;
124 #[doc = " Applies when the left `ALT` modifier is actuated.\n"]const LEFT_ALT = 256;
125 #[doc = " Applies when the right `ALT` modifier is actuated.\n"]const RIGHT_ALT = 512;
126 #[doc = " Applies when either the left `ALT` or the right `ALT` modifier\n is actuated.\n"]const ALT = 1024;
127 #[doc = " Applies when the `ALT_GRAPH` modifier is actuated.\n"]const ALT_GRAPH = 2048;
128 #[doc = " Applies when the `LEFT_META` modifier is actuated.\n"]const LEFT_META = 4096;
129 #[doc = " Applies when the `RIGHT_META` modifier is actuated.\n"]const RIGHT_META = 8192;
130 #[doc = " Applies when either `LEFT_META` or `RIGHT_META` modifier is actuated.\n"]const META = 16384;
131 #[doc = " Applies when the `LEFT_CTRL` modifier is actuated.\n"]const LEFT_CTRL = 32768;
132 #[doc = " Applies when the `RIGHT_CTRL` modifier is actuated.\n"]const RIGHT_CTRL = 65536;
133 #[doc = " Applies when either `LEFT_CTRL` or `RIGHT_CTRL` modifier is actuated.\n"]const CTRL = 131072;
134 const _ = !0;
135 }
136 }
137
138 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Modifiers, ___E> for Modifiers
139 where
140 ___E: ?Sized,
141 {
142 #[inline]
143 fn encode(
144 self,
145 encoder: &mut ___E,
146 out: &mut ::core::mem::MaybeUninit<crate::wire::Modifiers>,
147 _: (),
148 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
149 ::fidl_next::Encode::encode(&self, encoder, out, ())
150 }
151 }
152
153 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Modifiers, ___E> for &'a Modifiers
154 where
155 ___E: ?Sized,
156 {
157 #[inline]
158 fn encode(
159 self,
160 _: &mut ___E,
161 out: &mut ::core::mem::MaybeUninit<crate::wire::Modifiers>,
162 _: (),
163 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
164 ::fidl_next::munge!(let crate::wire::Modifiers { value } = out);
165
166 let _ = value.write(::fidl_next::wire::Uint64::from(self.bits()));
167 Ok(())
168 }
169 }
170
171 impl ::core::convert::From<crate::wire::Modifiers> for Modifiers {
172 fn from(wire: crate::wire::Modifiers) -> Self {
173 Self::from_bits_retain(u64::from(wire.value))
174 }
175 }
176
177 impl ::fidl_next::FromWire<crate::wire::Modifiers> for Modifiers {
178 #[inline]
179 fn from_wire(wire: crate::wire::Modifiers) -> Self {
180 Self::from(wire)
181 }
182 }
183
184 impl ::fidl_next::FromWireRef<crate::wire::Modifiers> for Modifiers {
185 #[inline]
186 fn from_wire_ref(wire: &crate::wire::Modifiers) -> Self {
187 Self::from(*wire)
188 }
189 }
190
191 ::fidl_next::bitflags::bitflags! {
192 #[doc = " A bit field of lock states which are currently active.\n\n Lock state reports whether the lock is active for the keys which have a lock\n state (need to be pressed once to activate, and one more time to deactivate).\n A set bit denotes active lock state.\n\n For example, when Caps Lock is active, i.e. pressing \'a\' produces the effect\n of \'A\' appearing on the screen, the `CAPS_LOCK` bit will be active.\n\n The bit values in `LockState` are chosen to correspond to the values in\n `Modifiers`, to the extent that this is doable in the long run.\n"]#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct LockState: u64 {
193 #[doc = " Applies when the `CAPS_LOCK` modifier is locked.\n\n Users should bear in mind that the effect of `CAPS_LOCK` is limited to\n alphabetic keys (not even *alphanumerics*) mainly.\n\n For example, pressing `a` on a US QWERTY keyboard while `CAPS_LOCK`\n state is locked results in the key meaning `A`, just as if the Shift modifier\n was used. However, pressing `[` when `CAPS_LOCK` is locked gives `[`,\n even though Shift+`[` gives `{`.\n\n The position of alphabetic keys may vary depending on the keymap in\n current use too.\n"]const CAPS_LOCK = 1;
194 #[doc = " Applies when the `NUM_LOCK` modifier is locked.\n"]const NUM_LOCK = 2;
195 #[doc = " Applies when the `SCROLL_LOCK` modifier is locked.\n"]const SCROLL_LOCK = 4;
196 #[doc = " Applies when the `FUNCTION` modifier is locked.\n"]const FUNCTION_LOCK = 8;
197 #[doc = " Applies when the `SYMBOL` modifier is locked.\n"]const SYMBOL_LOCK = 16;
198 const _ = !0;
199 }
200 }
201
202 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LockState, ___E> for LockState
203 where
204 ___E: ?Sized,
205 {
206 #[inline]
207 fn encode(
208 self,
209 encoder: &mut ___E,
210 out: &mut ::core::mem::MaybeUninit<crate::wire::LockState>,
211 _: (),
212 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
213 ::fidl_next::Encode::encode(&self, encoder, out, ())
214 }
215 }
216
217 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LockState, ___E> for &'a LockState
218 where
219 ___E: ?Sized,
220 {
221 #[inline]
222 fn encode(
223 self,
224 _: &mut ___E,
225 out: &mut ::core::mem::MaybeUninit<crate::wire::LockState>,
226 _: (),
227 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
228 ::fidl_next::munge!(let crate::wire::LockState { value } = out);
229
230 let _ = value.write(::fidl_next::wire::Uint64::from(self.bits()));
231 Ok(())
232 }
233 }
234
235 impl ::core::convert::From<crate::wire::LockState> for LockState {
236 fn from(wire: crate::wire::LockState) -> Self {
237 Self::from_bits_retain(u64::from(wire.value))
238 }
239 }
240
241 impl ::fidl_next::FromWire<crate::wire::LockState> for LockState {
242 #[inline]
243 fn from_wire(wire: crate::wire::LockState) -> Self {
244 Self::from(wire)
245 }
246 }
247
248 impl ::fidl_next::FromWireRef<crate::wire::LockState> for LockState {
249 #[inline]
250 fn from_wire_ref(wire: &crate::wire::LockState) -> Self {
251 Self::from(*wire)
252 }
253 }
254
255 #[doc = " NonPrintableKey represents the meaning of a non-symbolic key on a keyboard.\n\n The definition of each key is derived from [W3C named values of a key\n attribute][1].\n\n ## API version 9 and onwards\n\n Starting from API version 9, the enum value space is subdivided based on the\n subsection numbers of the section [Named Key Attribute Values][1], multiplied\n by 0x1000.\n\n For example, the keys from section [3.10 Multimedia keys][2] will be located\n at `0xa000`-`0xafff`. The values and reservations that were present\n in this enum prior to the introduction of the convention have not been moved,\n and values that go logically into pre-existing sections have been inserted\n into their logical place using the prior convention (see below). This allows\n us to extract the section ranges if this is for some reason useful to the\n application.\n\n ## Prior to API version 9\n\n The space of the nonprintable keys is subdivided roughly to correspond to the\n subsections of Section 3 of the document Named Key Attribute Values.\n The choice for the section values is arbitrary, so long as blocks of\n values are allocated at once, and the keys with similar purpose are kept\n together.\n\n ## Reserved ranges\n\n The space of possible values for [NonPrintableKey] is subdivided into a\n number of ranges, with the intention that the enum values are placed in\n the appropriate range when added.\n\n * Special keys: 0x00-0x10\n * Modifier keys: 0x11-0x30\n * Whitespace keys: 0x31-0x40\n * Navigation keys: 0x61-0x80\n * General-purpose function keys: 0x9000-0x9FFF\n\n [1]: https://www.w3.org/TR/uievents-key/#named-key-attribute-values\n [2]: https://www.w3.org/TR/uievents-key/#keys-multimedia\n"]
256 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
257 #[repr(u32)]
258 pub enum NonPrintableKey {
259 Unidentified = 0,
260 Alt = 17,
261 AltGraph = 18,
262 CapsLock = 19,
263 Control = 20,
264 Fn = 21,
265 FnLock = 22,
266 Meta = 23,
267 NumLock = 24,
268 ScrollLock = 25,
269 Shift = 26,
270 Symbol = 27,
271 SymbolLock = 28,
272 Hyper = 29,
273 Super = 30,
274 Enter = 49,
275 Tab = 50,
276 Backspace = 65,
277 Down = 97,
278 Left = 98,
279 Right = 99,
280 Up = 100,
281 End = 101,
282 Home = 102,
283 PageDown = 103,
284 PageUp = 104,
285 Escape = 24581,
286 Select = 24588,
287 BrightnessDown = 28672,
288 BrightnessUp = 28673,
289 F1 = 36865,
290 F2 = 36866,
291 F3 = 36867,
292 F4 = 36868,
293 F5 = 36869,
294 F6 = 36870,
295 F7 = 36871,
296 F8 = 36872,
297 F9 = 36873,
298 F10 = 36874,
299 F11 = 36875,
300 F12 = 36876,
301 Soft1 = 36881,
302 Soft2 = 36882,
303 Soft3 = 36883,
304 Soft4 = 36884,
305 MediaPlayPause = 40968,
306 AudioVolumeDown = 49162,
307 AudioVolumeUp = 49163,
308 AudioVolumeMute = 49164,
309 BrowserBack = 61440,
310 BrowserFavorites = 61441,
311 BrowserForward = 61442,
312 BrowserHome = 61443,
313 BrowserRefresh = 61444,
314 BrowserSearch = 61445,
315 BrowserStop = 61446,
316 ZoomToggle = 73799,
317 UnknownOrdinal_(u32) = 73800,
318 }
319 impl ::std::convert::From<u32> for NonPrintableKey {
320 fn from(value: u32) -> Self {
321 match value {
322 0 => Self::Unidentified,
323 17 => Self::Alt,
324 18 => Self::AltGraph,
325 19 => Self::CapsLock,
326 20 => Self::Control,
327 21 => Self::Fn,
328 22 => Self::FnLock,
329 23 => Self::Meta,
330 24 => Self::NumLock,
331 25 => Self::ScrollLock,
332 26 => Self::Shift,
333 27 => Self::Symbol,
334 28 => Self::SymbolLock,
335 29 => Self::Hyper,
336 30 => Self::Super,
337 49 => Self::Enter,
338 50 => Self::Tab,
339 65 => Self::Backspace,
340 97 => Self::Down,
341 98 => Self::Left,
342 99 => Self::Right,
343 100 => Self::Up,
344 101 => Self::End,
345 102 => Self::Home,
346 103 => Self::PageDown,
347 104 => Self::PageUp,
348 24581 => Self::Escape,
349 24588 => Self::Select,
350 28672 => Self::BrightnessDown,
351 28673 => Self::BrightnessUp,
352 36865 => Self::F1,
353 36866 => Self::F2,
354 36867 => Self::F3,
355 36868 => Self::F4,
356 36869 => Self::F5,
357 36870 => Self::F6,
358 36871 => Self::F7,
359 36872 => Self::F8,
360 36873 => Self::F9,
361 36874 => Self::F10,
362 36875 => Self::F11,
363 36876 => Self::F12,
364 36881 => Self::Soft1,
365 36882 => Self::Soft2,
366 36883 => Self::Soft3,
367 36884 => Self::Soft4,
368 40968 => Self::MediaPlayPause,
369 49162 => Self::AudioVolumeDown,
370 49163 => Self::AudioVolumeUp,
371 49164 => Self::AudioVolumeMute,
372 61440 => Self::BrowserBack,
373 61441 => Self::BrowserFavorites,
374 61442 => Self::BrowserForward,
375 61443 => Self::BrowserHome,
376 61444 => Self::BrowserRefresh,
377 61445 => Self::BrowserSearch,
378 61446 => Self::BrowserStop,
379 73799 => Self::ZoomToggle,
380
381 _ => Self::UnknownOrdinal_(value),
382 }
383 }
384 }
385
386 impl ::std::convert::From<NonPrintableKey> for u32 {
387 fn from(value: NonPrintableKey) -> Self {
388 match value {
389 NonPrintableKey::Unidentified => 0,
390 NonPrintableKey::Alt => 17,
391 NonPrintableKey::AltGraph => 18,
392 NonPrintableKey::CapsLock => 19,
393 NonPrintableKey::Control => 20,
394 NonPrintableKey::Fn => 21,
395 NonPrintableKey::FnLock => 22,
396 NonPrintableKey::Meta => 23,
397 NonPrintableKey::NumLock => 24,
398 NonPrintableKey::ScrollLock => 25,
399 NonPrintableKey::Shift => 26,
400 NonPrintableKey::Symbol => 27,
401 NonPrintableKey::SymbolLock => 28,
402 NonPrintableKey::Hyper => 29,
403 NonPrintableKey::Super => 30,
404 NonPrintableKey::Enter => 49,
405 NonPrintableKey::Tab => 50,
406 NonPrintableKey::Backspace => 65,
407 NonPrintableKey::Down => 97,
408 NonPrintableKey::Left => 98,
409 NonPrintableKey::Right => 99,
410 NonPrintableKey::Up => 100,
411 NonPrintableKey::End => 101,
412 NonPrintableKey::Home => 102,
413 NonPrintableKey::PageDown => 103,
414 NonPrintableKey::PageUp => 104,
415 NonPrintableKey::Escape => 24581,
416 NonPrintableKey::Select => 24588,
417 NonPrintableKey::BrightnessDown => 28672,
418 NonPrintableKey::BrightnessUp => 28673,
419 NonPrintableKey::F1 => 36865,
420 NonPrintableKey::F2 => 36866,
421 NonPrintableKey::F3 => 36867,
422 NonPrintableKey::F4 => 36868,
423 NonPrintableKey::F5 => 36869,
424 NonPrintableKey::F6 => 36870,
425 NonPrintableKey::F7 => 36871,
426 NonPrintableKey::F8 => 36872,
427 NonPrintableKey::F9 => 36873,
428 NonPrintableKey::F10 => 36874,
429 NonPrintableKey::F11 => 36875,
430 NonPrintableKey::F12 => 36876,
431 NonPrintableKey::Soft1 => 36881,
432 NonPrintableKey::Soft2 => 36882,
433 NonPrintableKey::Soft3 => 36883,
434 NonPrintableKey::Soft4 => 36884,
435 NonPrintableKey::MediaPlayPause => 40968,
436 NonPrintableKey::AudioVolumeDown => 49162,
437 NonPrintableKey::AudioVolumeUp => 49163,
438 NonPrintableKey::AudioVolumeMute => 49164,
439 NonPrintableKey::BrowserBack => 61440,
440 NonPrintableKey::BrowserFavorites => 61441,
441 NonPrintableKey::BrowserForward => 61442,
442 NonPrintableKey::BrowserHome => 61443,
443 NonPrintableKey::BrowserRefresh => 61444,
444 NonPrintableKey::BrowserSearch => 61445,
445 NonPrintableKey::BrowserStop => 61446,
446 NonPrintableKey::ZoomToggle => 73799,
447
448 NonPrintableKey::UnknownOrdinal_(value) => value,
449 }
450 }
451 }
452
453 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NonPrintableKey, ___E> for NonPrintableKey
454 where
455 ___E: ?Sized,
456 {
457 #[inline]
458 fn encode(
459 self,
460 encoder: &mut ___E,
461 out: &mut ::core::mem::MaybeUninit<crate::wire::NonPrintableKey>,
462 _: (),
463 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
464 ::fidl_next::Encode::encode(&self, encoder, out, ())
465 }
466 }
467
468 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NonPrintableKey, ___E>
469 for &'a NonPrintableKey
470 where
471 ___E: ?Sized,
472 {
473 #[inline]
474 fn encode(
475 self,
476 encoder: &mut ___E,
477 out: &mut ::core::mem::MaybeUninit<crate::wire::NonPrintableKey>,
478 _: (),
479 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
480 ::fidl_next::munge!(let crate::wire::NonPrintableKey { value } = out);
481 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
482 NonPrintableKey::Unidentified => 0,
483
484 NonPrintableKey::Alt => 17,
485
486 NonPrintableKey::AltGraph => 18,
487
488 NonPrintableKey::CapsLock => 19,
489
490 NonPrintableKey::Control => 20,
491
492 NonPrintableKey::Fn => 21,
493
494 NonPrintableKey::FnLock => 22,
495
496 NonPrintableKey::Meta => 23,
497
498 NonPrintableKey::NumLock => 24,
499
500 NonPrintableKey::ScrollLock => 25,
501
502 NonPrintableKey::Shift => 26,
503
504 NonPrintableKey::Symbol => 27,
505
506 NonPrintableKey::SymbolLock => 28,
507
508 NonPrintableKey::Hyper => 29,
509
510 NonPrintableKey::Super => 30,
511
512 NonPrintableKey::Enter => 49,
513
514 NonPrintableKey::Tab => 50,
515
516 NonPrintableKey::Backspace => 65,
517
518 NonPrintableKey::Down => 97,
519
520 NonPrintableKey::Left => 98,
521
522 NonPrintableKey::Right => 99,
523
524 NonPrintableKey::Up => 100,
525
526 NonPrintableKey::End => 101,
527
528 NonPrintableKey::Home => 102,
529
530 NonPrintableKey::PageDown => 103,
531
532 NonPrintableKey::PageUp => 104,
533
534 NonPrintableKey::Escape => 24581,
535
536 NonPrintableKey::Select => 24588,
537
538 NonPrintableKey::BrightnessDown => 28672,
539
540 NonPrintableKey::BrightnessUp => 28673,
541
542 NonPrintableKey::F1 => 36865,
543
544 NonPrintableKey::F2 => 36866,
545
546 NonPrintableKey::F3 => 36867,
547
548 NonPrintableKey::F4 => 36868,
549
550 NonPrintableKey::F5 => 36869,
551
552 NonPrintableKey::F6 => 36870,
553
554 NonPrintableKey::F7 => 36871,
555
556 NonPrintableKey::F8 => 36872,
557
558 NonPrintableKey::F9 => 36873,
559
560 NonPrintableKey::F10 => 36874,
561
562 NonPrintableKey::F11 => 36875,
563
564 NonPrintableKey::F12 => 36876,
565
566 NonPrintableKey::Soft1 => 36881,
567
568 NonPrintableKey::Soft2 => 36882,
569
570 NonPrintableKey::Soft3 => 36883,
571
572 NonPrintableKey::Soft4 => 36884,
573
574 NonPrintableKey::MediaPlayPause => 40968,
575
576 NonPrintableKey::AudioVolumeDown => 49162,
577
578 NonPrintableKey::AudioVolumeUp => 49163,
579
580 NonPrintableKey::AudioVolumeMute => 49164,
581
582 NonPrintableKey::BrowserBack => 61440,
583
584 NonPrintableKey::BrowserFavorites => 61441,
585
586 NonPrintableKey::BrowserForward => 61442,
587
588 NonPrintableKey::BrowserHome => 61443,
589
590 NonPrintableKey::BrowserRefresh => 61444,
591
592 NonPrintableKey::BrowserSearch => 61445,
593
594 NonPrintableKey::BrowserStop => 61446,
595
596 NonPrintableKey::ZoomToggle => 73799,
597
598 NonPrintableKey::UnknownOrdinal_(value) => value,
599 }));
600
601 Ok(())
602 }
603 }
604
605 impl ::core::convert::From<crate::wire::NonPrintableKey> for NonPrintableKey {
606 fn from(wire: crate::wire::NonPrintableKey) -> Self {
607 match u32::from(wire.value) {
608 0 => Self::Unidentified,
609
610 17 => Self::Alt,
611
612 18 => Self::AltGraph,
613
614 19 => Self::CapsLock,
615
616 20 => Self::Control,
617
618 21 => Self::Fn,
619
620 22 => Self::FnLock,
621
622 23 => Self::Meta,
623
624 24 => Self::NumLock,
625
626 25 => Self::ScrollLock,
627
628 26 => Self::Shift,
629
630 27 => Self::Symbol,
631
632 28 => Self::SymbolLock,
633
634 29 => Self::Hyper,
635
636 30 => Self::Super,
637
638 49 => Self::Enter,
639
640 50 => Self::Tab,
641
642 65 => Self::Backspace,
643
644 97 => Self::Down,
645
646 98 => Self::Left,
647
648 99 => Self::Right,
649
650 100 => Self::Up,
651
652 101 => Self::End,
653
654 102 => Self::Home,
655
656 103 => Self::PageDown,
657
658 104 => Self::PageUp,
659
660 24581 => Self::Escape,
661
662 24588 => Self::Select,
663
664 28672 => Self::BrightnessDown,
665
666 28673 => Self::BrightnessUp,
667
668 36865 => Self::F1,
669
670 36866 => Self::F2,
671
672 36867 => Self::F3,
673
674 36868 => Self::F4,
675
676 36869 => Self::F5,
677
678 36870 => Self::F6,
679
680 36871 => Self::F7,
681
682 36872 => Self::F8,
683
684 36873 => Self::F9,
685
686 36874 => Self::F10,
687
688 36875 => Self::F11,
689
690 36876 => Self::F12,
691
692 36881 => Self::Soft1,
693
694 36882 => Self::Soft2,
695
696 36883 => Self::Soft3,
697
698 36884 => Self::Soft4,
699
700 40968 => Self::MediaPlayPause,
701
702 49162 => Self::AudioVolumeDown,
703
704 49163 => Self::AudioVolumeUp,
705
706 49164 => Self::AudioVolumeMute,
707
708 61440 => Self::BrowserBack,
709
710 61441 => Self::BrowserFavorites,
711
712 61442 => Self::BrowserForward,
713
714 61443 => Self::BrowserHome,
715
716 61444 => Self::BrowserRefresh,
717
718 61445 => Self::BrowserSearch,
719
720 61446 => Self::BrowserStop,
721
722 73799 => Self::ZoomToggle,
723
724 value => Self::UnknownOrdinal_(value),
725 }
726 }
727 }
728
729 impl ::fidl_next::FromWire<crate::wire::NonPrintableKey> for NonPrintableKey {
730 #[inline]
731 fn from_wire(wire: crate::wire::NonPrintableKey) -> Self {
732 Self::from(wire)
733 }
734 }
735
736 impl ::fidl_next::FromWireRef<crate::wire::NonPrintableKey> for NonPrintableKey {
737 #[inline]
738 fn from_wire_ref(wire: &crate::wire::NonPrintableKey) -> Self {
739 Self::from(*wire)
740 }
741 }
742
743 #[doc = " The meaning of the key press. This is typically the Unicode codepoint inserted\n by this event, or an enum representing a key that corresponds to whitespace or\n is otherwise unprintable.\n"]
744 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
745 pub enum KeyMeaning {
746 Codepoint(u32),
747
748 NonPrintableKey(crate::natural::NonPrintableKey),
749 }
750
751 unsafe impl<___E> ::fidl_next::Encode<crate::wire::KeyMeaning, ___E> for KeyMeaning
752 where
753 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
754 {
755 #[inline]
756 fn encode(
757 self,
758 encoder: &mut ___E,
759 out: &mut ::core::mem::MaybeUninit<crate::wire::KeyMeaning>,
760 _: (),
761 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
762 ::fidl_next::munge!(let crate::wire::KeyMeaning { raw, _phantom: _ } = out);
763
764 match self {
765 Self::Codepoint(value) => ::fidl_next::wire::Union::encode_as_static::<
766 ___E,
767 ::fidl_next::wire::Uint32,
768 >(value, 1, encoder, raw, ())?,
769
770 Self::NonPrintableKey(value) => ::fidl_next::wire::Union::encode_as_static::<
771 ___E,
772 crate::wire::NonPrintableKey,
773 >(value, 2, encoder, raw, ())?,
774 }
775
776 Ok(())
777 }
778 }
779
780 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::KeyMeaning, ___E> for &'a KeyMeaning
781 where
782 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
783 {
784 #[inline]
785 fn encode(
786 self,
787 encoder: &mut ___E,
788 out: &mut ::core::mem::MaybeUninit<crate::wire::KeyMeaning>,
789 _: (),
790 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
791 ::fidl_next::munge!(let crate::wire::KeyMeaning { raw, _phantom: _ } = out);
792
793 match self {
794 KeyMeaning::Codepoint(value) => ::fidl_next::wire::Union::encode_as_static::<
795 ___E,
796 ::fidl_next::wire::Uint32,
797 >(value, 1, encoder, raw, ())?,
798
799 KeyMeaning::NonPrintableKey(value) => ::fidl_next::wire::Union::encode_as_static::<
800 ___E,
801 crate::wire::NonPrintableKey,
802 >(value, 2, encoder, raw, ())?,
803 }
804
805 Ok(())
806 }
807 }
808
809 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::KeyMeaning, ___E> for KeyMeaning
810 where
811 ___E: ?Sized,
812 KeyMeaning: ::fidl_next::Encode<crate::wire::KeyMeaning, ___E>,
813 {
814 #[inline]
815 fn encode_option(
816 this: ::core::option::Option<Self>,
817 encoder: &mut ___E,
818 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::KeyMeaning>,
819 _: (),
820 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
821 ::fidl_next::munge!(let crate::wire_optional::KeyMeaning { raw, _phantom: _ } = &mut *out);
822
823 if let Some(inner) = this {
824 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
825 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
826 } else {
827 ::fidl_next::wire::Union::encode_absent(raw);
828 }
829
830 Ok(())
831 }
832 }
833
834 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::KeyMeaning, ___E>
835 for &'a KeyMeaning
836 where
837 ___E: ?Sized,
838 &'a KeyMeaning: ::fidl_next::Encode<crate::wire::KeyMeaning, ___E>,
839 {
840 #[inline]
841 fn encode_option(
842 this: ::core::option::Option<Self>,
843 encoder: &mut ___E,
844 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::KeyMeaning>,
845 _: (),
846 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
847 ::fidl_next::munge!(let crate::wire_optional::KeyMeaning { raw, _phantom: _ } = &mut *out);
848
849 if let Some(inner) = this {
850 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
851 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
852 } else {
853 ::fidl_next::wire::Union::encode_absent(raw);
854 }
855
856 Ok(())
857 }
858 }
859
860 impl ::fidl_next::FromWire<crate::wire::KeyMeaning> for KeyMeaning {
861 #[inline]
862 fn from_wire(wire: crate::wire::KeyMeaning) -> Self {
863 let wire = ::core::mem::ManuallyDrop::new(wire);
864 match wire.raw.ordinal() {
865 1 => Self::Codepoint(::fidl_next::FromWire::from_wire(unsafe {
866 wire.raw.get().read_unchecked::<::fidl_next::wire::Uint32>()
867 })),
868
869 2 => Self::NonPrintableKey(::fidl_next::FromWire::from_wire(unsafe {
870 wire.raw.get().read_unchecked::<crate::wire::NonPrintableKey>()
871 })),
872
873 _ => unsafe { ::core::hint::unreachable_unchecked() },
874 }
875 }
876 }
877
878 impl ::fidl_next::FromWireRef<crate::wire::KeyMeaning> for KeyMeaning {
879 #[inline]
880 fn from_wire_ref(wire: &crate::wire::KeyMeaning) -> Self {
881 match wire.raw.ordinal() {
882 1 => Self::Codepoint(::fidl_next::FromWireRef::from_wire_ref(unsafe {
883 wire.raw.get().deref_unchecked::<::fidl_next::wire::Uint32>()
884 })),
885
886 2 => Self::NonPrintableKey(::fidl_next::FromWireRef::from_wire_ref(unsafe {
887 wire.raw.get().deref_unchecked::<crate::wire::NonPrintableKey>()
888 })),
889
890 _ => unsafe { ::core::hint::unreachable_unchecked() },
891 }
892 }
893 }
894
895 impl ::fidl_next::FromWireOption<crate::wire_optional::KeyMeaning> for KeyMeaning {
896 #[inline]
897 fn from_wire_option(
898 wire: crate::wire_optional::KeyMeaning,
899 ) -> ::core::option::Option<Self> {
900 if let Some(inner) = wire.into_option() {
901 Some(::fidl_next::FromWire::from_wire(inner))
902 } else {
903 None
904 }
905 }
906 }
907
908 impl ::fidl_next::FromWireOption<crate::wire_optional::KeyMeaning> for Box<KeyMeaning> {
909 #[inline]
910 fn from_wire_option(
911 wire: crate::wire_optional::KeyMeaning,
912 ) -> ::core::option::Option<Self> {
913 <
914 KeyMeaning as ::fidl_next::FromWireOption<crate::wire_optional::KeyMeaning>
915 >::from_wire_option(wire).map(Box::new)
916 }
917 }
918
919 impl ::fidl_next::FromWireOptionRef<crate::wire_optional::KeyMeaning> for Box<KeyMeaning> {
920 #[inline]
921 fn from_wire_option_ref(
922 wire: &crate::wire_optional::KeyMeaning,
923 ) -> ::core::option::Option<Self> {
924 if let Some(inner) = wire.as_ref() {
925 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
926 } else {
927 None
928 }
929 }
930 }
931
932 #[doc = " A Keyboard event generated to reflect key input. `timestamp` and `type` are required.\n At least one of `key` and `key_meaning` must be set for a valid event.\n"]
933 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
934 pub struct KeyEvent {
935 pub timestamp: ::core::option::Option<i64>,
936
937 pub type_: ::core::option::Option<crate::natural::KeyEventType>,
938
939 pub key: ::core::option::Option<::fidl_next_common_fuchsia_input::natural::Key>,
940
941 pub modifiers: ::core::option::Option<crate::natural::Modifiers>,
942
943 pub key_meaning: ::core::option::Option<crate::natural::KeyMeaning>,
944
945 pub repeat_sequence: ::core::option::Option<u32>,
946
947 pub lock_state: ::core::option::Option<crate::natural::LockState>,
948
949 pub device_id: ::core::option::Option<u32>,
950 }
951
952 impl KeyEvent {
953 fn __max_ordinal(&self) -> usize {
954 if self.device_id.is_some() {
955 return 8;
956 }
957
958 if self.lock_state.is_some() {
959 return 7;
960 }
961
962 if self.repeat_sequence.is_some() {
963 return 6;
964 }
965
966 if self.key_meaning.is_some() {
967 return 5;
968 }
969
970 if self.modifiers.is_some() {
971 return 4;
972 }
973
974 if self.key.is_some() {
975 return 3;
976 }
977
978 if self.type_.is_some() {
979 return 2;
980 }
981
982 if self.timestamp.is_some() {
983 return 1;
984 }
985
986 0
987 }
988 }
989
990 unsafe impl<___E> ::fidl_next::Encode<crate::wire::KeyEvent<'static>, ___E> for KeyEvent
991 where
992 ___E: ::fidl_next::Encoder + ?Sized,
993 {
994 #[inline]
995 fn encode(
996 mut self,
997 encoder: &mut ___E,
998 out: &mut ::core::mem::MaybeUninit<crate::wire::KeyEvent<'static>>,
999 _: (),
1000 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1001 ::fidl_next::munge!(let crate::wire::KeyEvent { table } = out);
1002
1003 let max_ord = self.__max_ordinal();
1004
1005 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1006 ::fidl_next::Wire::zero_padding(&mut out);
1007
1008 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1009 ::fidl_next::wire::Envelope,
1010 >(encoder, max_ord);
1011
1012 for i in 1..=max_ord {
1013 match i {
1014 8 => {
1015 if let Some(value) = self.device_id.take() {
1016 ::fidl_next::wire::Envelope::encode_value::<
1017 ::fidl_next::wire::Uint32,
1018 ___E,
1019 >(
1020 value, preallocated.encoder, &mut out, ()
1021 )?;
1022 } else {
1023 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1024 }
1025 }
1026
1027 7 => {
1028 if let Some(value) = self.lock_state.take() {
1029 ::fidl_next::wire::Envelope::encode_value::<
1030 crate::wire::LockState,
1031 ___E,
1032 >(
1033 value, preallocated.encoder, &mut out, ()
1034 )?;
1035 } else {
1036 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1037 }
1038 }
1039
1040 6 => {
1041 if let Some(value) = self.repeat_sequence.take() {
1042 ::fidl_next::wire::Envelope::encode_value::<
1043 ::fidl_next::wire::Uint32,
1044 ___E,
1045 >(
1046 value, preallocated.encoder, &mut out, ()
1047 )?;
1048 } else {
1049 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1050 }
1051 }
1052
1053 5 => {
1054 if let Some(value) = self.key_meaning.take() {
1055 ::fidl_next::wire::Envelope::encode_value::<
1056 crate::wire::KeyMeaning,
1057 ___E,
1058 >(
1059 value, preallocated.encoder, &mut out, ()
1060 )?;
1061 } else {
1062 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1063 }
1064 }
1065
1066 4 => {
1067 if let Some(value) = self.modifiers.take() {
1068 ::fidl_next::wire::Envelope::encode_value::<
1069 crate::wire::Modifiers,
1070 ___E,
1071 >(
1072 value, preallocated.encoder, &mut out, ()
1073 )?;
1074 } else {
1075 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1076 }
1077 }
1078
1079 3 => {
1080 if let Some(value) = self.key.take() {
1081 ::fidl_next::wire::Envelope::encode_value::<
1082 ::fidl_next_common_fuchsia_input::wire::Key,
1083 ___E,
1084 >(
1085 value, preallocated.encoder, &mut out, ()
1086 )?;
1087 } else {
1088 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1089 }
1090 }
1091
1092 2 => {
1093 if let Some(value) = self.type_.take() {
1094 ::fidl_next::wire::Envelope::encode_value::<
1095 crate::wire::KeyEventType,
1096 ___E,
1097 >(
1098 value, preallocated.encoder, &mut out, ()
1099 )?;
1100 } else {
1101 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1102 }
1103 }
1104
1105 1 => {
1106 if let Some(value) = self.timestamp.take() {
1107 ::fidl_next::wire::Envelope::encode_value::<
1108 ::fidl_next::wire::Int64,
1109 ___E,
1110 >(
1111 value, preallocated.encoder, &mut out, ()
1112 )?;
1113 } else {
1114 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1115 }
1116 }
1117
1118 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1119 }
1120 unsafe {
1121 preallocated.write_next(out.assume_init_ref());
1122 }
1123 }
1124
1125 ::fidl_next::wire::Table::encode_len(table, max_ord);
1126
1127 Ok(())
1128 }
1129 }
1130
1131 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::KeyEvent<'static>, ___E> for &'a KeyEvent
1132 where
1133 ___E: ::fidl_next::Encoder + ?Sized,
1134 {
1135 #[inline]
1136 fn encode(
1137 self,
1138 encoder: &mut ___E,
1139 out: &mut ::core::mem::MaybeUninit<crate::wire::KeyEvent<'static>>,
1140 _: (),
1141 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1142 ::fidl_next::munge!(let crate::wire::KeyEvent { table } = out);
1143
1144 let max_ord = self.__max_ordinal();
1145
1146 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1147 ::fidl_next::Wire::zero_padding(&mut out);
1148
1149 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1150 ::fidl_next::wire::Envelope,
1151 >(encoder, max_ord);
1152
1153 for i in 1..=max_ord {
1154 match i {
1155 8 => {
1156 if let Some(value) = &self.device_id {
1157 ::fidl_next::wire::Envelope::encode_value::<
1158 ::fidl_next::wire::Uint32,
1159 ___E,
1160 >(
1161 value, preallocated.encoder, &mut out, ()
1162 )?;
1163 } else {
1164 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1165 }
1166 }
1167
1168 7 => {
1169 if let Some(value) = &self.lock_state {
1170 ::fidl_next::wire::Envelope::encode_value::<
1171 crate::wire::LockState,
1172 ___E,
1173 >(
1174 value, preallocated.encoder, &mut out, ()
1175 )?;
1176 } else {
1177 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1178 }
1179 }
1180
1181 6 => {
1182 if let Some(value) = &self.repeat_sequence {
1183 ::fidl_next::wire::Envelope::encode_value::<
1184 ::fidl_next::wire::Uint32,
1185 ___E,
1186 >(
1187 value, preallocated.encoder, &mut out, ()
1188 )?;
1189 } else {
1190 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1191 }
1192 }
1193
1194 5 => {
1195 if let Some(value) = &self.key_meaning {
1196 ::fidl_next::wire::Envelope::encode_value::<
1197 crate::wire::KeyMeaning,
1198 ___E,
1199 >(
1200 value, preallocated.encoder, &mut out, ()
1201 )?;
1202 } else {
1203 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1204 }
1205 }
1206
1207 4 => {
1208 if let Some(value) = &self.modifiers {
1209 ::fidl_next::wire::Envelope::encode_value::<
1210 crate::wire::Modifiers,
1211 ___E,
1212 >(
1213 value, preallocated.encoder, &mut out, ()
1214 )?;
1215 } else {
1216 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1217 }
1218 }
1219
1220 3 => {
1221 if let Some(value) = &self.key {
1222 ::fidl_next::wire::Envelope::encode_value::<
1223 ::fidl_next_common_fuchsia_input::wire::Key,
1224 ___E,
1225 >(
1226 value, preallocated.encoder, &mut out, ()
1227 )?;
1228 } else {
1229 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1230 }
1231 }
1232
1233 2 => {
1234 if let Some(value) = &self.type_ {
1235 ::fidl_next::wire::Envelope::encode_value::<
1236 crate::wire::KeyEventType,
1237 ___E,
1238 >(
1239 value, preallocated.encoder, &mut out, ()
1240 )?;
1241 } else {
1242 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1243 }
1244 }
1245
1246 1 => {
1247 if let Some(value) = &self.timestamp {
1248 ::fidl_next::wire::Envelope::encode_value::<
1249 ::fidl_next::wire::Int64,
1250 ___E,
1251 >(
1252 value, preallocated.encoder, &mut out, ()
1253 )?;
1254 } else {
1255 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1256 }
1257 }
1258
1259 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1260 }
1261 unsafe {
1262 preallocated.write_next(out.assume_init_ref());
1263 }
1264 }
1265
1266 ::fidl_next::wire::Table::encode_len(table, max_ord);
1267
1268 Ok(())
1269 }
1270 }
1271
1272 impl<'de> ::fidl_next::FromWire<crate::wire::KeyEvent<'de>> for KeyEvent {
1273 #[inline]
1274 fn from_wire(wire_: crate::wire::KeyEvent<'de>) -> Self {
1275 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1276
1277 let timestamp = wire_.table.get(1);
1278
1279 let type_ = wire_.table.get(2);
1280
1281 let key = wire_.table.get(3);
1282
1283 let modifiers = wire_.table.get(4);
1284
1285 let key_meaning = wire_.table.get(5);
1286
1287 let repeat_sequence = wire_.table.get(6);
1288
1289 let lock_state = wire_.table.get(7);
1290
1291 let device_id = wire_.table.get(8);
1292
1293 Self {
1294 timestamp: timestamp.map(|envelope| {
1295 ::fidl_next::FromWire::from_wire(unsafe {
1296 envelope.read_unchecked::<::fidl_next::wire::Int64>()
1297 })
1298 }),
1299
1300 type_: type_.map(|envelope| {
1301 ::fidl_next::FromWire::from_wire(unsafe {
1302 envelope.read_unchecked::<crate::wire::KeyEventType>()
1303 })
1304 }),
1305
1306 key: key.map(|envelope| {
1307 ::fidl_next::FromWire::from_wire(unsafe {
1308 envelope.read_unchecked::<::fidl_next_common_fuchsia_input::wire::Key>()
1309 })
1310 }),
1311
1312 modifiers: modifiers.map(|envelope| {
1313 ::fidl_next::FromWire::from_wire(unsafe {
1314 envelope.read_unchecked::<crate::wire::Modifiers>()
1315 })
1316 }),
1317
1318 key_meaning: key_meaning.map(|envelope| {
1319 ::fidl_next::FromWire::from_wire(unsafe {
1320 envelope.read_unchecked::<crate::wire::KeyMeaning>()
1321 })
1322 }),
1323
1324 repeat_sequence: repeat_sequence.map(|envelope| {
1325 ::fidl_next::FromWire::from_wire(unsafe {
1326 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
1327 })
1328 }),
1329
1330 lock_state: lock_state.map(|envelope| {
1331 ::fidl_next::FromWire::from_wire(unsafe {
1332 envelope.read_unchecked::<crate::wire::LockState>()
1333 })
1334 }),
1335
1336 device_id: device_id.map(|envelope| {
1337 ::fidl_next::FromWire::from_wire(unsafe {
1338 envelope.read_unchecked::<::fidl_next::wire::Uint32>()
1339 })
1340 }),
1341 }
1342 }
1343 }
1344
1345 impl<'de> ::fidl_next::FromWireRef<crate::wire::KeyEvent<'de>> for KeyEvent {
1346 #[inline]
1347 fn from_wire_ref(wire: &crate::wire::KeyEvent<'de>) -> Self {
1348 Self {
1349 timestamp: wire.table.get(1).map(|envelope| {
1350 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1351 envelope.deref_unchecked::<::fidl_next::wire::Int64>()
1352 })
1353 }),
1354
1355 type_: wire.table.get(2).map(|envelope| {
1356 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1357 envelope.deref_unchecked::<crate::wire::KeyEventType>()
1358 })
1359 }),
1360
1361 key: wire.table.get(3).map(|envelope| {
1362 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1363 envelope.deref_unchecked::<::fidl_next_common_fuchsia_input::wire::Key>()
1364 })
1365 }),
1366
1367 modifiers: wire.table.get(4).map(|envelope| {
1368 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1369 envelope.deref_unchecked::<crate::wire::Modifiers>()
1370 })
1371 }),
1372
1373 key_meaning: wire.table.get(5).map(|envelope| {
1374 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1375 envelope.deref_unchecked::<crate::wire::KeyMeaning>()
1376 })
1377 }),
1378
1379 repeat_sequence: wire.table.get(6).map(|envelope| {
1380 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1381 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
1382 })
1383 }),
1384
1385 lock_state: wire.table.get(7).map(|envelope| {
1386 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1387 envelope.deref_unchecked::<crate::wire::LockState>()
1388 })
1389 }),
1390
1391 device_id: wire.table.get(8).map(|envelope| {
1392 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1393 envelope.deref_unchecked::<::fidl_next::wire::Uint32>()
1394 })
1395 }),
1396 }
1397 }
1398 }
1399
1400 #[doc = " Return type for clients key events listener.\n\n We do not expect new values to be added to this enum.\n"]
1401 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1402 #[repr(u32)]
1403 pub enum KeyEventStatus {
1404 Handled = 1,
1405 NotHandled = 2,
1406 }
1407 impl ::core::convert::TryFrom<u32> for KeyEventStatus {
1408 type Error = ::fidl_next::UnknownStrictEnumMemberError;
1409 fn try_from(
1410 value: u32,
1411 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
1412 match value {
1413 1 => Ok(Self::Handled),
1414 2 => Ok(Self::NotHandled),
1415
1416 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
1417 }
1418 }
1419 }
1420
1421 impl ::std::convert::From<KeyEventStatus> for u32 {
1422 fn from(value: KeyEventStatus) -> Self {
1423 match value {
1424 KeyEventStatus::Handled => 1,
1425 KeyEventStatus::NotHandled => 2,
1426 }
1427 }
1428 }
1429
1430 unsafe impl<___E> ::fidl_next::Encode<crate::wire::KeyEventStatus, ___E> for KeyEventStatus
1431 where
1432 ___E: ?Sized,
1433 {
1434 #[inline]
1435 fn encode(
1436 self,
1437 encoder: &mut ___E,
1438 out: &mut ::core::mem::MaybeUninit<crate::wire::KeyEventStatus>,
1439 _: (),
1440 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1441 ::fidl_next::Encode::encode(&self, encoder, out, ())
1442 }
1443 }
1444
1445 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::KeyEventStatus, ___E> for &'a KeyEventStatus
1446 where
1447 ___E: ?Sized,
1448 {
1449 #[inline]
1450 fn encode(
1451 self,
1452 encoder: &mut ___E,
1453 out: &mut ::core::mem::MaybeUninit<crate::wire::KeyEventStatus>,
1454 _: (),
1455 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1456 ::fidl_next::munge!(let crate::wire::KeyEventStatus { value } = out);
1457 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
1458 KeyEventStatus::Handled => 1,
1459
1460 KeyEventStatus::NotHandled => 2,
1461 }));
1462
1463 Ok(())
1464 }
1465 }
1466
1467 impl ::core::convert::From<crate::wire::KeyEventStatus> for KeyEventStatus {
1468 fn from(wire: crate::wire::KeyEventStatus) -> Self {
1469 match u32::from(wire.value) {
1470 1 => Self::Handled,
1471
1472 2 => Self::NotHandled,
1473
1474 _ => unsafe { ::core::hint::unreachable_unchecked() },
1475 }
1476 }
1477 }
1478
1479 impl ::fidl_next::FromWire<crate::wire::KeyEventStatus> for KeyEventStatus {
1480 #[inline]
1481 fn from_wire(wire: crate::wire::KeyEventStatus) -> Self {
1482 Self::from(wire)
1483 }
1484 }
1485
1486 impl ::fidl_next::FromWireRef<crate::wire::KeyEventStatus> for KeyEventStatus {
1487 #[inline]
1488 fn from_wire_ref(wire: &crate::wire::KeyEventStatus) -> Self {
1489 Self::from(*wire)
1490 }
1491 }
1492
1493 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1494 #[repr(C)]
1495 pub struct KeyEventInjectorInjectResponse {
1496 pub status: crate::natural::KeyEventStatus,
1497 }
1498
1499 unsafe impl<___E> ::fidl_next::Encode<crate::wire::KeyEventInjectorInjectResponse, ___E>
1500 for KeyEventInjectorInjectResponse
1501 where
1502 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1503 {
1504 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1505 Self,
1506 crate::wire::KeyEventInjectorInjectResponse,
1507 > = unsafe {
1508 ::fidl_next::CopyOptimization::enable_if(
1509 true && <crate::natural::KeyEventStatus as ::fidl_next::Encode<
1510 crate::wire::KeyEventStatus,
1511 ___E,
1512 >>::COPY_OPTIMIZATION
1513 .is_enabled(),
1514 )
1515 };
1516
1517 #[inline]
1518 fn encode(
1519 self,
1520 encoder_: &mut ___E,
1521 out_: &mut ::core::mem::MaybeUninit<crate::wire::KeyEventInjectorInjectResponse>,
1522 _: (),
1523 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1524 ::fidl_next::munge! {
1525 let crate::wire::KeyEventInjectorInjectResponse {
1526 status,
1527
1528 } = out_;
1529 }
1530
1531 ::fidl_next::Encode::encode(self.status, encoder_, status, ())?;
1532
1533 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(status.as_mut_ptr()) };
1534
1535 Ok(())
1536 }
1537 }
1538
1539 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::KeyEventInjectorInjectResponse, ___E>
1540 for &'a KeyEventInjectorInjectResponse
1541 where
1542 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1543 {
1544 #[inline]
1545 fn encode(
1546 self,
1547 encoder_: &mut ___E,
1548 out_: &mut ::core::mem::MaybeUninit<crate::wire::KeyEventInjectorInjectResponse>,
1549 _: (),
1550 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1551 ::fidl_next::munge! {
1552 let crate::wire::KeyEventInjectorInjectResponse {
1553 status,
1554
1555 } = out_;
1556 }
1557
1558 ::fidl_next::Encode::encode(&self.status, encoder_, status, ())?;
1559
1560 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(status.as_mut_ptr()) };
1561
1562 Ok(())
1563 }
1564 }
1565
1566 unsafe impl<___E>
1567 ::fidl_next::EncodeOption<
1568 ::fidl_next::wire::Box<'static, crate::wire::KeyEventInjectorInjectResponse>,
1569 ___E,
1570 > for KeyEventInjectorInjectResponse
1571 where
1572 ___E: ::fidl_next::Encoder + ?Sized,
1573 KeyEventInjectorInjectResponse:
1574 ::fidl_next::Encode<crate::wire::KeyEventInjectorInjectResponse, ___E>,
1575 {
1576 #[inline]
1577 fn encode_option(
1578 this: ::core::option::Option<Self>,
1579 encoder: &mut ___E,
1580 out: &mut ::core::mem::MaybeUninit<
1581 ::fidl_next::wire::Box<'static, crate::wire::KeyEventInjectorInjectResponse>,
1582 >,
1583 _: (),
1584 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1585 if let Some(inner) = this {
1586 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1587 ::fidl_next::wire::Box::encode_present(out);
1588 } else {
1589 ::fidl_next::wire::Box::encode_absent(out);
1590 }
1591
1592 Ok(())
1593 }
1594 }
1595
1596 unsafe impl<'a, ___E>
1597 ::fidl_next::EncodeOption<
1598 ::fidl_next::wire::Box<'static, crate::wire::KeyEventInjectorInjectResponse>,
1599 ___E,
1600 > for &'a KeyEventInjectorInjectResponse
1601 where
1602 ___E: ::fidl_next::Encoder + ?Sized,
1603 &'a KeyEventInjectorInjectResponse:
1604 ::fidl_next::Encode<crate::wire::KeyEventInjectorInjectResponse, ___E>,
1605 {
1606 #[inline]
1607 fn encode_option(
1608 this: ::core::option::Option<Self>,
1609 encoder: &mut ___E,
1610 out: &mut ::core::mem::MaybeUninit<
1611 ::fidl_next::wire::Box<'static, crate::wire::KeyEventInjectorInjectResponse>,
1612 >,
1613 _: (),
1614 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1615 if let Some(inner) = this {
1616 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1617 ::fidl_next::wire::Box::encode_present(out);
1618 } else {
1619 ::fidl_next::wire::Box::encode_absent(out);
1620 }
1621
1622 Ok(())
1623 }
1624 }
1625
1626 impl ::fidl_next::FromWire<crate::wire::KeyEventInjectorInjectResponse>
1627 for KeyEventInjectorInjectResponse
1628 {
1629 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1630 crate::wire::KeyEventInjectorInjectResponse,
1631 Self,
1632 > = unsafe {
1633 ::fidl_next::CopyOptimization::enable_if(
1634 true && <crate::natural::KeyEventStatus as ::fidl_next::FromWire<
1635 crate::wire::KeyEventStatus,
1636 >>::COPY_OPTIMIZATION
1637 .is_enabled(),
1638 )
1639 };
1640
1641 #[inline]
1642 fn from_wire(wire: crate::wire::KeyEventInjectorInjectResponse) -> Self {
1643 Self { status: ::fidl_next::FromWire::from_wire(wire.status) }
1644 }
1645 }
1646
1647 impl ::fidl_next::FromWireRef<crate::wire::KeyEventInjectorInjectResponse>
1648 for KeyEventInjectorInjectResponse
1649 {
1650 #[inline]
1651 fn from_wire_ref(wire: &crate::wire::KeyEventInjectorInjectResponse) -> Self {
1652 Self { status: ::fidl_next::FromWireRef::from_wire_ref(&wire.status) }
1653 }
1654 }
1655
1656 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1657 pub struct KeyEventInjectorInjectRequest {
1658 pub key_event: crate::natural::KeyEvent,
1659 }
1660
1661 unsafe impl<___E> ::fidl_next::Encode<crate::wire::KeyEventInjectorInjectRequest<'static>, ___E>
1662 for KeyEventInjectorInjectRequest
1663 where
1664 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1665 ___E: ::fidl_next::Encoder,
1666 {
1667 #[inline]
1668 fn encode(
1669 self,
1670 encoder_: &mut ___E,
1671 out_: &mut ::core::mem::MaybeUninit<
1672 crate::wire::KeyEventInjectorInjectRequest<'static>,
1673 >,
1674 _: (),
1675 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1676 ::fidl_next::munge! {
1677 let crate::wire::KeyEventInjectorInjectRequest {
1678 key_event,
1679
1680 } = out_;
1681 }
1682
1683 ::fidl_next::Encode::encode(self.key_event, encoder_, key_event, ())?;
1684
1685 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(key_event.as_mut_ptr()) };
1686
1687 Ok(())
1688 }
1689 }
1690
1691 unsafe impl<'a, ___E>
1692 ::fidl_next::Encode<crate::wire::KeyEventInjectorInjectRequest<'static>, ___E>
1693 for &'a KeyEventInjectorInjectRequest
1694 where
1695 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1696 ___E: ::fidl_next::Encoder,
1697 {
1698 #[inline]
1699 fn encode(
1700 self,
1701 encoder_: &mut ___E,
1702 out_: &mut ::core::mem::MaybeUninit<
1703 crate::wire::KeyEventInjectorInjectRequest<'static>,
1704 >,
1705 _: (),
1706 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1707 ::fidl_next::munge! {
1708 let crate::wire::KeyEventInjectorInjectRequest {
1709 key_event,
1710
1711 } = out_;
1712 }
1713
1714 ::fidl_next::Encode::encode(&self.key_event, encoder_, key_event, ())?;
1715
1716 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(key_event.as_mut_ptr()) };
1717
1718 Ok(())
1719 }
1720 }
1721
1722 unsafe impl<___E>
1723 ::fidl_next::EncodeOption<
1724 ::fidl_next::wire::Box<'static, crate::wire::KeyEventInjectorInjectRequest<'static>>,
1725 ___E,
1726 > for KeyEventInjectorInjectRequest
1727 where
1728 ___E: ::fidl_next::Encoder + ?Sized,
1729 KeyEventInjectorInjectRequest:
1730 ::fidl_next::Encode<crate::wire::KeyEventInjectorInjectRequest<'static>, ___E>,
1731 {
1732 #[inline]
1733 fn encode_option(
1734 this: ::core::option::Option<Self>,
1735 encoder: &mut ___E,
1736 out: &mut ::core::mem::MaybeUninit<
1737 ::fidl_next::wire::Box<
1738 'static,
1739 crate::wire::KeyEventInjectorInjectRequest<'static>,
1740 >,
1741 >,
1742 _: (),
1743 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1744 if let Some(inner) = this {
1745 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1746 ::fidl_next::wire::Box::encode_present(out);
1747 } else {
1748 ::fidl_next::wire::Box::encode_absent(out);
1749 }
1750
1751 Ok(())
1752 }
1753 }
1754
1755 unsafe impl<'a, ___E>
1756 ::fidl_next::EncodeOption<
1757 ::fidl_next::wire::Box<'static, crate::wire::KeyEventInjectorInjectRequest<'static>>,
1758 ___E,
1759 > for &'a KeyEventInjectorInjectRequest
1760 where
1761 ___E: ::fidl_next::Encoder + ?Sized,
1762 &'a KeyEventInjectorInjectRequest:
1763 ::fidl_next::Encode<crate::wire::KeyEventInjectorInjectRequest<'static>, ___E>,
1764 {
1765 #[inline]
1766 fn encode_option(
1767 this: ::core::option::Option<Self>,
1768 encoder: &mut ___E,
1769 out: &mut ::core::mem::MaybeUninit<
1770 ::fidl_next::wire::Box<
1771 'static,
1772 crate::wire::KeyEventInjectorInjectRequest<'static>,
1773 >,
1774 >,
1775 _: (),
1776 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1777 if let Some(inner) = this {
1778 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1779 ::fidl_next::wire::Box::encode_present(out);
1780 } else {
1781 ::fidl_next::wire::Box::encode_absent(out);
1782 }
1783
1784 Ok(())
1785 }
1786 }
1787
1788 impl<'de> ::fidl_next::FromWire<crate::wire::KeyEventInjectorInjectRequest<'de>>
1789 for KeyEventInjectorInjectRequest
1790 {
1791 #[inline]
1792 fn from_wire(wire: crate::wire::KeyEventInjectorInjectRequest<'de>) -> Self {
1793 Self { key_event: ::fidl_next::FromWire::from_wire(wire.key_event) }
1794 }
1795 }
1796
1797 impl<'de> ::fidl_next::FromWireRef<crate::wire::KeyEventInjectorInjectRequest<'de>>
1798 for KeyEventInjectorInjectRequest
1799 {
1800 #[inline]
1801 fn from_wire_ref(wire: &crate::wire::KeyEventInjectorInjectRequest<'de>) -> Self {
1802 Self { key_event: ::fidl_next::FromWireRef::from_wire_ref(&wire.key_event) }
1803 }
1804 }
1805
1806 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1807 #[repr(C)]
1808 pub struct KeyboardListenerOnKeyEventResponse {
1809 pub status: crate::natural::KeyEventStatus,
1810 }
1811
1812 unsafe impl<___E> ::fidl_next::Encode<crate::wire::KeyboardListenerOnKeyEventResponse, ___E>
1813 for KeyboardListenerOnKeyEventResponse
1814 where
1815 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1816 {
1817 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1818 Self,
1819 crate::wire::KeyboardListenerOnKeyEventResponse,
1820 > = unsafe {
1821 ::fidl_next::CopyOptimization::enable_if(
1822 true && <crate::natural::KeyEventStatus as ::fidl_next::Encode<
1823 crate::wire::KeyEventStatus,
1824 ___E,
1825 >>::COPY_OPTIMIZATION
1826 .is_enabled(),
1827 )
1828 };
1829
1830 #[inline]
1831 fn encode(
1832 self,
1833 encoder_: &mut ___E,
1834 out_: &mut ::core::mem::MaybeUninit<crate::wire::KeyboardListenerOnKeyEventResponse>,
1835 _: (),
1836 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1837 ::fidl_next::munge! {
1838 let crate::wire::KeyboardListenerOnKeyEventResponse {
1839 status,
1840
1841 } = out_;
1842 }
1843
1844 ::fidl_next::Encode::encode(self.status, encoder_, status, ())?;
1845
1846 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(status.as_mut_ptr()) };
1847
1848 Ok(())
1849 }
1850 }
1851
1852 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::KeyboardListenerOnKeyEventResponse, ___E>
1853 for &'a KeyboardListenerOnKeyEventResponse
1854 where
1855 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1856 {
1857 #[inline]
1858 fn encode(
1859 self,
1860 encoder_: &mut ___E,
1861 out_: &mut ::core::mem::MaybeUninit<crate::wire::KeyboardListenerOnKeyEventResponse>,
1862 _: (),
1863 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1864 ::fidl_next::munge! {
1865 let crate::wire::KeyboardListenerOnKeyEventResponse {
1866 status,
1867
1868 } = out_;
1869 }
1870
1871 ::fidl_next::Encode::encode(&self.status, encoder_, status, ())?;
1872
1873 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(status.as_mut_ptr()) };
1874
1875 Ok(())
1876 }
1877 }
1878
1879 unsafe impl<___E>
1880 ::fidl_next::EncodeOption<
1881 ::fidl_next::wire::Box<'static, crate::wire::KeyboardListenerOnKeyEventResponse>,
1882 ___E,
1883 > for KeyboardListenerOnKeyEventResponse
1884 where
1885 ___E: ::fidl_next::Encoder + ?Sized,
1886 KeyboardListenerOnKeyEventResponse:
1887 ::fidl_next::Encode<crate::wire::KeyboardListenerOnKeyEventResponse, ___E>,
1888 {
1889 #[inline]
1890 fn encode_option(
1891 this: ::core::option::Option<Self>,
1892 encoder: &mut ___E,
1893 out: &mut ::core::mem::MaybeUninit<
1894 ::fidl_next::wire::Box<'static, crate::wire::KeyboardListenerOnKeyEventResponse>,
1895 >,
1896 _: (),
1897 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1898 if let Some(inner) = this {
1899 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1900 ::fidl_next::wire::Box::encode_present(out);
1901 } else {
1902 ::fidl_next::wire::Box::encode_absent(out);
1903 }
1904
1905 Ok(())
1906 }
1907 }
1908
1909 unsafe impl<'a, ___E>
1910 ::fidl_next::EncodeOption<
1911 ::fidl_next::wire::Box<'static, crate::wire::KeyboardListenerOnKeyEventResponse>,
1912 ___E,
1913 > for &'a KeyboardListenerOnKeyEventResponse
1914 where
1915 ___E: ::fidl_next::Encoder + ?Sized,
1916 &'a KeyboardListenerOnKeyEventResponse:
1917 ::fidl_next::Encode<crate::wire::KeyboardListenerOnKeyEventResponse, ___E>,
1918 {
1919 #[inline]
1920 fn encode_option(
1921 this: ::core::option::Option<Self>,
1922 encoder: &mut ___E,
1923 out: &mut ::core::mem::MaybeUninit<
1924 ::fidl_next::wire::Box<'static, crate::wire::KeyboardListenerOnKeyEventResponse>,
1925 >,
1926 _: (),
1927 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1928 if let Some(inner) = this {
1929 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1930 ::fidl_next::wire::Box::encode_present(out);
1931 } else {
1932 ::fidl_next::wire::Box::encode_absent(out);
1933 }
1934
1935 Ok(())
1936 }
1937 }
1938
1939 impl ::fidl_next::FromWire<crate::wire::KeyboardListenerOnKeyEventResponse>
1940 for KeyboardListenerOnKeyEventResponse
1941 {
1942 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1943 crate::wire::KeyboardListenerOnKeyEventResponse,
1944 Self,
1945 > = unsafe {
1946 ::fidl_next::CopyOptimization::enable_if(
1947 true && <crate::natural::KeyEventStatus as ::fidl_next::FromWire<
1948 crate::wire::KeyEventStatus,
1949 >>::COPY_OPTIMIZATION
1950 .is_enabled(),
1951 )
1952 };
1953
1954 #[inline]
1955 fn from_wire(wire: crate::wire::KeyboardListenerOnKeyEventResponse) -> Self {
1956 Self { status: ::fidl_next::FromWire::from_wire(wire.status) }
1957 }
1958 }
1959
1960 impl ::fidl_next::FromWireRef<crate::wire::KeyboardListenerOnKeyEventResponse>
1961 for KeyboardListenerOnKeyEventResponse
1962 {
1963 #[inline]
1964 fn from_wire_ref(wire: &crate::wire::KeyboardListenerOnKeyEventResponse) -> Self {
1965 Self { status: ::fidl_next::FromWireRef::from_wire_ref(&wire.status) }
1966 }
1967 }
1968
1969 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1970 pub struct KeyboardListenerOnKeyEventRequest {
1971 pub event: crate::natural::KeyEvent,
1972 }
1973
1974 unsafe impl<___E>
1975 ::fidl_next::Encode<crate::wire::KeyboardListenerOnKeyEventRequest<'static>, ___E>
1976 for KeyboardListenerOnKeyEventRequest
1977 where
1978 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1979 ___E: ::fidl_next::Encoder,
1980 {
1981 #[inline]
1982 fn encode(
1983 self,
1984 encoder_: &mut ___E,
1985 out_: &mut ::core::mem::MaybeUninit<
1986 crate::wire::KeyboardListenerOnKeyEventRequest<'static>,
1987 >,
1988 _: (),
1989 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1990 ::fidl_next::munge! {
1991 let crate::wire::KeyboardListenerOnKeyEventRequest {
1992 event,
1993
1994 } = out_;
1995 }
1996
1997 ::fidl_next::Encode::encode(self.event, encoder_, event, ())?;
1998
1999 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(event.as_mut_ptr()) };
2000
2001 Ok(())
2002 }
2003 }
2004
2005 unsafe impl<'a, ___E>
2006 ::fidl_next::Encode<crate::wire::KeyboardListenerOnKeyEventRequest<'static>, ___E>
2007 for &'a KeyboardListenerOnKeyEventRequest
2008 where
2009 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2010 ___E: ::fidl_next::Encoder,
2011 {
2012 #[inline]
2013 fn encode(
2014 self,
2015 encoder_: &mut ___E,
2016 out_: &mut ::core::mem::MaybeUninit<
2017 crate::wire::KeyboardListenerOnKeyEventRequest<'static>,
2018 >,
2019 _: (),
2020 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2021 ::fidl_next::munge! {
2022 let crate::wire::KeyboardListenerOnKeyEventRequest {
2023 event,
2024
2025 } = out_;
2026 }
2027
2028 ::fidl_next::Encode::encode(&self.event, encoder_, event, ())?;
2029
2030 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(event.as_mut_ptr()) };
2031
2032 Ok(())
2033 }
2034 }
2035
2036 unsafe impl<___E>
2037 ::fidl_next::EncodeOption<
2038 ::fidl_next::wire::Box<
2039 'static,
2040 crate::wire::KeyboardListenerOnKeyEventRequest<'static>,
2041 >,
2042 ___E,
2043 > for KeyboardListenerOnKeyEventRequest
2044 where
2045 ___E: ::fidl_next::Encoder + ?Sized,
2046 KeyboardListenerOnKeyEventRequest:
2047 ::fidl_next::Encode<crate::wire::KeyboardListenerOnKeyEventRequest<'static>, ___E>,
2048 {
2049 #[inline]
2050 fn encode_option(
2051 this: ::core::option::Option<Self>,
2052 encoder: &mut ___E,
2053 out: &mut ::core::mem::MaybeUninit<
2054 ::fidl_next::wire::Box<
2055 'static,
2056 crate::wire::KeyboardListenerOnKeyEventRequest<'static>,
2057 >,
2058 >,
2059 _: (),
2060 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2061 if let Some(inner) = this {
2062 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2063 ::fidl_next::wire::Box::encode_present(out);
2064 } else {
2065 ::fidl_next::wire::Box::encode_absent(out);
2066 }
2067
2068 Ok(())
2069 }
2070 }
2071
2072 unsafe impl<'a, ___E>
2073 ::fidl_next::EncodeOption<
2074 ::fidl_next::wire::Box<
2075 'static,
2076 crate::wire::KeyboardListenerOnKeyEventRequest<'static>,
2077 >,
2078 ___E,
2079 > for &'a KeyboardListenerOnKeyEventRequest
2080 where
2081 ___E: ::fidl_next::Encoder + ?Sized,
2082 &'a KeyboardListenerOnKeyEventRequest:
2083 ::fidl_next::Encode<crate::wire::KeyboardListenerOnKeyEventRequest<'static>, ___E>,
2084 {
2085 #[inline]
2086 fn encode_option(
2087 this: ::core::option::Option<Self>,
2088 encoder: &mut ___E,
2089 out: &mut ::core::mem::MaybeUninit<
2090 ::fidl_next::wire::Box<
2091 'static,
2092 crate::wire::KeyboardListenerOnKeyEventRequest<'static>,
2093 >,
2094 >,
2095 _: (),
2096 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2097 if let Some(inner) = this {
2098 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2099 ::fidl_next::wire::Box::encode_present(out);
2100 } else {
2101 ::fidl_next::wire::Box::encode_absent(out);
2102 }
2103
2104 Ok(())
2105 }
2106 }
2107
2108 impl<'de> ::fidl_next::FromWire<crate::wire::KeyboardListenerOnKeyEventRequest<'de>>
2109 for KeyboardListenerOnKeyEventRequest
2110 {
2111 #[inline]
2112 fn from_wire(wire: crate::wire::KeyboardListenerOnKeyEventRequest<'de>) -> Self {
2113 Self { event: ::fidl_next::FromWire::from_wire(wire.event) }
2114 }
2115 }
2116
2117 impl<'de> ::fidl_next::FromWireRef<crate::wire::KeyboardListenerOnKeyEventRequest<'de>>
2118 for KeyboardListenerOnKeyEventRequest
2119 {
2120 #[inline]
2121 fn from_wire_ref(wire: &crate::wire::KeyboardListenerOnKeyEventRequest<'de>) -> Self {
2122 Self { event: ::fidl_next::FromWireRef::from_wire_ref(&wire.event) }
2123 }
2124 }
2125}
2126
2127pub mod wire {
2128
2129 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
2131 #[repr(transparent)]
2132 pub struct KeyEventType {
2133 pub(crate) value: ::fidl_next::wire::Uint32,
2134 }
2135
2136 impl ::fidl_next::Constrained for KeyEventType {
2137 type Constraint = ();
2138
2139 fn validate(
2140 _: ::fidl_next::Slot<'_, Self>,
2141 _: Self::Constraint,
2142 ) -> Result<(), ::fidl_next::ValidationError> {
2143 Ok(())
2144 }
2145 }
2146
2147 unsafe impl ::fidl_next::Wire for KeyEventType {
2148 type Narrowed<'de> = Self;
2149
2150 #[inline]
2151 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2152 }
2154 }
2155
2156 impl KeyEventType {
2157 pub const PRESSED: KeyEventType = KeyEventType { value: ::fidl_next::wire::Uint32(1) };
2158
2159 pub const RELEASED: KeyEventType = KeyEventType { value: ::fidl_next::wire::Uint32(2) };
2160
2161 pub const SYNC: KeyEventType = KeyEventType { value: ::fidl_next::wire::Uint32(3) };
2162
2163 pub const CANCEL: KeyEventType = KeyEventType { value: ::fidl_next::wire::Uint32(4) };
2164 }
2165
2166 unsafe impl<___D> ::fidl_next::Decode<___D> for KeyEventType
2167 where
2168 ___D: ?Sized,
2169 {
2170 fn decode(
2171 slot: ::fidl_next::Slot<'_, Self>,
2172 _: &mut ___D,
2173 _: (),
2174 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2175 ::fidl_next::munge!(let Self { value } = slot);
2176
2177 match u32::from(*value) {
2178 1 | 2 | 3 | 4 => (),
2179 unknown => {
2180 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
2181 }
2182 }
2183
2184 Ok(())
2185 }
2186 }
2187
2188 impl ::core::convert::From<crate::natural::KeyEventType> for KeyEventType {
2189 fn from(natural: crate::natural::KeyEventType) -> Self {
2190 match natural {
2191 crate::natural::KeyEventType::Pressed => KeyEventType::PRESSED,
2192
2193 crate::natural::KeyEventType::Released => KeyEventType::RELEASED,
2194
2195 crate::natural::KeyEventType::Sync => KeyEventType::SYNC,
2196
2197 crate::natural::KeyEventType::Cancel => KeyEventType::CANCEL,
2198 }
2199 }
2200 }
2201
2202 impl ::fidl_next::IntoNatural for KeyEventType {
2203 type Natural = crate::natural::KeyEventType;
2204 }
2205
2206 #[derive(Clone, Copy, Debug)]
2208 #[repr(transparent)]
2209 pub struct Modifiers {
2210 pub(crate) value: ::fidl_next::wire::Uint64,
2211 }
2212
2213 impl ::fidl_next::Constrained for Modifiers {
2214 type Constraint = ();
2215
2216 fn validate(
2217 _: ::fidl_next::Slot<'_, Self>,
2218 _: Self::Constraint,
2219 ) -> Result<(), ::fidl_next::ValidationError> {
2220 Ok(())
2221 }
2222 }
2223
2224 unsafe impl ::fidl_next::Wire for Modifiers {
2225 type Narrowed<'de> = Self;
2226
2227 #[inline]
2228 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2229 }
2231 }
2232
2233 unsafe impl<___D> ::fidl_next::Decode<___D> for Modifiers
2234 where
2235 ___D: ?Sized,
2236 {
2237 fn decode(
2238 slot: ::fidl_next::Slot<'_, Self>,
2239 _: &mut ___D,
2240 _: (),
2241 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2242 Ok(())
2243 }
2244 }
2245
2246 impl ::core::convert::From<crate::natural::Modifiers> for Modifiers {
2247 fn from(natural: crate::natural::Modifiers) -> Self {
2248 Self { value: ::fidl_next::wire::Uint64::from(natural.bits()) }
2249 }
2250 }
2251
2252 impl ::fidl_next::IntoNatural for Modifiers {
2253 type Natural = crate::natural::Modifiers;
2254 }
2255
2256 #[derive(Clone, Copy, Debug)]
2258 #[repr(transparent)]
2259 pub struct LockState {
2260 pub(crate) value: ::fidl_next::wire::Uint64,
2261 }
2262
2263 impl ::fidl_next::Constrained for LockState {
2264 type Constraint = ();
2265
2266 fn validate(
2267 _: ::fidl_next::Slot<'_, Self>,
2268 _: Self::Constraint,
2269 ) -> Result<(), ::fidl_next::ValidationError> {
2270 Ok(())
2271 }
2272 }
2273
2274 unsafe impl ::fidl_next::Wire for LockState {
2275 type Narrowed<'de> = Self;
2276
2277 #[inline]
2278 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2279 }
2281 }
2282
2283 unsafe impl<___D> ::fidl_next::Decode<___D> for LockState
2284 where
2285 ___D: ?Sized,
2286 {
2287 fn decode(
2288 slot: ::fidl_next::Slot<'_, Self>,
2289 _: &mut ___D,
2290 _: (),
2291 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2292 Ok(())
2293 }
2294 }
2295
2296 impl ::core::convert::From<crate::natural::LockState> for LockState {
2297 fn from(natural: crate::natural::LockState) -> Self {
2298 Self { value: ::fidl_next::wire::Uint64::from(natural.bits()) }
2299 }
2300 }
2301
2302 impl ::fidl_next::IntoNatural for LockState {
2303 type Natural = crate::natural::LockState;
2304 }
2305
2306 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
2308 #[repr(transparent)]
2309 pub struct NonPrintableKey {
2310 pub(crate) value: ::fidl_next::wire::Uint32,
2311 }
2312
2313 impl ::fidl_next::Constrained for NonPrintableKey {
2314 type Constraint = ();
2315
2316 fn validate(
2317 _: ::fidl_next::Slot<'_, Self>,
2318 _: Self::Constraint,
2319 ) -> Result<(), ::fidl_next::ValidationError> {
2320 Ok(())
2321 }
2322 }
2323
2324 unsafe impl ::fidl_next::Wire for NonPrintableKey {
2325 type Narrowed<'de> = Self;
2326
2327 #[inline]
2328 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
2329 }
2331 }
2332
2333 impl NonPrintableKey {
2334 pub const UNIDENTIFIED: NonPrintableKey =
2335 NonPrintableKey { value: ::fidl_next::wire::Uint32(0) };
2336
2337 pub const ALT: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(17) };
2338
2339 pub const ALT_GRAPH: NonPrintableKey =
2340 NonPrintableKey { value: ::fidl_next::wire::Uint32(18) };
2341
2342 pub const CAPS_LOCK: NonPrintableKey =
2343 NonPrintableKey { value: ::fidl_next::wire::Uint32(19) };
2344
2345 pub const CONTROL: NonPrintableKey =
2346 NonPrintableKey { value: ::fidl_next::wire::Uint32(20) };
2347
2348 pub const FN: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(21) };
2349
2350 pub const FN_LOCK: NonPrintableKey =
2351 NonPrintableKey { value: ::fidl_next::wire::Uint32(22) };
2352
2353 pub const META: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(23) };
2354
2355 pub const NUM_LOCK: NonPrintableKey =
2356 NonPrintableKey { value: ::fidl_next::wire::Uint32(24) };
2357
2358 pub const SCROLL_LOCK: NonPrintableKey =
2359 NonPrintableKey { value: ::fidl_next::wire::Uint32(25) };
2360
2361 pub const SHIFT: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(26) };
2362
2363 pub const SYMBOL: NonPrintableKey =
2364 NonPrintableKey { value: ::fidl_next::wire::Uint32(27) };
2365
2366 pub const SYMBOL_LOCK: NonPrintableKey =
2367 NonPrintableKey { value: ::fidl_next::wire::Uint32(28) };
2368
2369 pub const HYPER: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(29) };
2370
2371 pub const SUPER: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(30) };
2372
2373 pub const ENTER: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(49) };
2374
2375 pub const TAB: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(50) };
2376
2377 pub const BACKSPACE: NonPrintableKey =
2378 NonPrintableKey { value: ::fidl_next::wire::Uint32(65) };
2379
2380 pub const DOWN: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(97) };
2381
2382 pub const LEFT: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(98) };
2383
2384 pub const RIGHT: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(99) };
2385
2386 pub const UP: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(100) };
2387
2388 pub const END: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(101) };
2389
2390 pub const HOME: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(102) };
2391
2392 pub const PAGE_DOWN: NonPrintableKey =
2393 NonPrintableKey { value: ::fidl_next::wire::Uint32(103) };
2394
2395 pub const PAGE_UP: NonPrintableKey =
2396 NonPrintableKey { value: ::fidl_next::wire::Uint32(104) };
2397
2398 pub const ESCAPE: NonPrintableKey =
2399 NonPrintableKey { value: ::fidl_next::wire::Uint32(24581) };
2400
2401 pub const SELECT: NonPrintableKey =
2402 NonPrintableKey { value: ::fidl_next::wire::Uint32(24588) };
2403
2404 pub const BRIGHTNESS_DOWN: NonPrintableKey =
2405 NonPrintableKey { value: ::fidl_next::wire::Uint32(28672) };
2406
2407 pub const BRIGHTNESS_UP: NonPrintableKey =
2408 NonPrintableKey { value: ::fidl_next::wire::Uint32(28673) };
2409
2410 pub const F1: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(36865) };
2411
2412 pub const F2: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(36866) };
2413
2414 pub const F3: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(36867) };
2415
2416 pub const F4: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(36868) };
2417
2418 pub const F5: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(36869) };
2419
2420 pub const F6: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(36870) };
2421
2422 pub const F7: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(36871) };
2423
2424 pub const F8: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(36872) };
2425
2426 pub const F9: NonPrintableKey = NonPrintableKey { value: ::fidl_next::wire::Uint32(36873) };
2427
2428 pub const F10: NonPrintableKey =
2429 NonPrintableKey { value: ::fidl_next::wire::Uint32(36874) };
2430
2431 pub const F11: NonPrintableKey =
2432 NonPrintableKey { value: ::fidl_next::wire::Uint32(36875) };
2433
2434 pub const F12: NonPrintableKey =
2435 NonPrintableKey { value: ::fidl_next::wire::Uint32(36876) };
2436
2437 pub const SOFT_1: NonPrintableKey =
2438 NonPrintableKey { value: ::fidl_next::wire::Uint32(36881) };
2439
2440 pub const SOFT_2: NonPrintableKey =
2441 NonPrintableKey { value: ::fidl_next::wire::Uint32(36882) };
2442
2443 pub const SOFT_3: NonPrintableKey =
2444 NonPrintableKey { value: ::fidl_next::wire::Uint32(36883) };
2445
2446 pub const SOFT_4: NonPrintableKey =
2447 NonPrintableKey { value: ::fidl_next::wire::Uint32(36884) };
2448
2449 pub const MEDIA_PLAY_PAUSE: NonPrintableKey =
2450 NonPrintableKey { value: ::fidl_next::wire::Uint32(40968) };
2451
2452 pub const AUDIO_VOLUME_DOWN: NonPrintableKey =
2453 NonPrintableKey { value: ::fidl_next::wire::Uint32(49162) };
2454
2455 pub const AUDIO_VOLUME_UP: NonPrintableKey =
2456 NonPrintableKey { value: ::fidl_next::wire::Uint32(49163) };
2457
2458 pub const AUDIO_VOLUME_MUTE: NonPrintableKey =
2459 NonPrintableKey { value: ::fidl_next::wire::Uint32(49164) };
2460
2461 pub const BROWSER_BACK: NonPrintableKey =
2462 NonPrintableKey { value: ::fidl_next::wire::Uint32(61440) };
2463
2464 pub const BROWSER_FAVORITES: NonPrintableKey =
2465 NonPrintableKey { value: ::fidl_next::wire::Uint32(61441) };
2466
2467 pub const BROWSER_FORWARD: NonPrintableKey =
2468 NonPrintableKey { value: ::fidl_next::wire::Uint32(61442) };
2469
2470 pub const BROWSER_HOME: NonPrintableKey =
2471 NonPrintableKey { value: ::fidl_next::wire::Uint32(61443) };
2472
2473 pub const BROWSER_REFRESH: NonPrintableKey =
2474 NonPrintableKey { value: ::fidl_next::wire::Uint32(61444) };
2475
2476 pub const BROWSER_SEARCH: NonPrintableKey =
2477 NonPrintableKey { value: ::fidl_next::wire::Uint32(61445) };
2478
2479 pub const BROWSER_STOP: NonPrintableKey =
2480 NonPrintableKey { value: ::fidl_next::wire::Uint32(61446) };
2481
2482 pub const ZOOM_TOGGLE: NonPrintableKey =
2483 NonPrintableKey { value: ::fidl_next::wire::Uint32(73799) };
2484 }
2485
2486 unsafe impl<___D> ::fidl_next::Decode<___D> for NonPrintableKey
2487 where
2488 ___D: ?Sized,
2489 {
2490 fn decode(
2491 slot: ::fidl_next::Slot<'_, Self>,
2492 _: &mut ___D,
2493 _: (),
2494 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2495 Ok(())
2496 }
2497 }
2498
2499 impl ::core::convert::From<crate::natural::NonPrintableKey> for NonPrintableKey {
2500 fn from(natural: crate::natural::NonPrintableKey) -> Self {
2501 match natural {
2502 crate::natural::NonPrintableKey::Unidentified => NonPrintableKey::UNIDENTIFIED,
2503
2504 crate::natural::NonPrintableKey::Alt => NonPrintableKey::ALT,
2505
2506 crate::natural::NonPrintableKey::AltGraph => NonPrintableKey::ALT_GRAPH,
2507
2508 crate::natural::NonPrintableKey::CapsLock => NonPrintableKey::CAPS_LOCK,
2509
2510 crate::natural::NonPrintableKey::Control => NonPrintableKey::CONTROL,
2511
2512 crate::natural::NonPrintableKey::Fn => NonPrintableKey::FN,
2513
2514 crate::natural::NonPrintableKey::FnLock => NonPrintableKey::FN_LOCK,
2515
2516 crate::natural::NonPrintableKey::Meta => NonPrintableKey::META,
2517
2518 crate::natural::NonPrintableKey::NumLock => NonPrintableKey::NUM_LOCK,
2519
2520 crate::natural::NonPrintableKey::ScrollLock => NonPrintableKey::SCROLL_LOCK,
2521
2522 crate::natural::NonPrintableKey::Shift => NonPrintableKey::SHIFT,
2523
2524 crate::natural::NonPrintableKey::Symbol => NonPrintableKey::SYMBOL,
2525
2526 crate::natural::NonPrintableKey::SymbolLock => NonPrintableKey::SYMBOL_LOCK,
2527
2528 crate::natural::NonPrintableKey::Hyper => NonPrintableKey::HYPER,
2529
2530 crate::natural::NonPrintableKey::Super => NonPrintableKey::SUPER,
2531
2532 crate::natural::NonPrintableKey::Enter => NonPrintableKey::ENTER,
2533
2534 crate::natural::NonPrintableKey::Tab => NonPrintableKey::TAB,
2535
2536 crate::natural::NonPrintableKey::Backspace => NonPrintableKey::BACKSPACE,
2537
2538 crate::natural::NonPrintableKey::Down => NonPrintableKey::DOWN,
2539
2540 crate::natural::NonPrintableKey::Left => NonPrintableKey::LEFT,
2541
2542 crate::natural::NonPrintableKey::Right => NonPrintableKey::RIGHT,
2543
2544 crate::natural::NonPrintableKey::Up => NonPrintableKey::UP,
2545
2546 crate::natural::NonPrintableKey::End => NonPrintableKey::END,
2547
2548 crate::natural::NonPrintableKey::Home => NonPrintableKey::HOME,
2549
2550 crate::natural::NonPrintableKey::PageDown => NonPrintableKey::PAGE_DOWN,
2551
2552 crate::natural::NonPrintableKey::PageUp => NonPrintableKey::PAGE_UP,
2553
2554 crate::natural::NonPrintableKey::Escape => NonPrintableKey::ESCAPE,
2555
2556 crate::natural::NonPrintableKey::Select => NonPrintableKey::SELECT,
2557
2558 crate::natural::NonPrintableKey::BrightnessDown => NonPrintableKey::BRIGHTNESS_DOWN,
2559
2560 crate::natural::NonPrintableKey::BrightnessUp => NonPrintableKey::BRIGHTNESS_UP,
2561
2562 crate::natural::NonPrintableKey::F1 => NonPrintableKey::F1,
2563
2564 crate::natural::NonPrintableKey::F2 => NonPrintableKey::F2,
2565
2566 crate::natural::NonPrintableKey::F3 => NonPrintableKey::F3,
2567
2568 crate::natural::NonPrintableKey::F4 => NonPrintableKey::F4,
2569
2570 crate::natural::NonPrintableKey::F5 => NonPrintableKey::F5,
2571
2572 crate::natural::NonPrintableKey::F6 => NonPrintableKey::F6,
2573
2574 crate::natural::NonPrintableKey::F7 => NonPrintableKey::F7,
2575
2576 crate::natural::NonPrintableKey::F8 => NonPrintableKey::F8,
2577
2578 crate::natural::NonPrintableKey::F9 => NonPrintableKey::F9,
2579
2580 crate::natural::NonPrintableKey::F10 => NonPrintableKey::F10,
2581
2582 crate::natural::NonPrintableKey::F11 => NonPrintableKey::F11,
2583
2584 crate::natural::NonPrintableKey::F12 => NonPrintableKey::F12,
2585
2586 crate::natural::NonPrintableKey::Soft1 => NonPrintableKey::SOFT_1,
2587
2588 crate::natural::NonPrintableKey::Soft2 => NonPrintableKey::SOFT_2,
2589
2590 crate::natural::NonPrintableKey::Soft3 => NonPrintableKey::SOFT_3,
2591
2592 crate::natural::NonPrintableKey::Soft4 => NonPrintableKey::SOFT_4,
2593
2594 crate::natural::NonPrintableKey::MediaPlayPause => {
2595 NonPrintableKey::MEDIA_PLAY_PAUSE
2596 }
2597
2598 crate::natural::NonPrintableKey::AudioVolumeDown => {
2599 NonPrintableKey::AUDIO_VOLUME_DOWN
2600 }
2601
2602 crate::natural::NonPrintableKey::AudioVolumeUp => NonPrintableKey::AUDIO_VOLUME_UP,
2603
2604 crate::natural::NonPrintableKey::AudioVolumeMute => {
2605 NonPrintableKey::AUDIO_VOLUME_MUTE
2606 }
2607
2608 crate::natural::NonPrintableKey::BrowserBack => NonPrintableKey::BROWSER_BACK,
2609
2610 crate::natural::NonPrintableKey::BrowserFavorites => {
2611 NonPrintableKey::BROWSER_FAVORITES
2612 }
2613
2614 crate::natural::NonPrintableKey::BrowserForward => NonPrintableKey::BROWSER_FORWARD,
2615
2616 crate::natural::NonPrintableKey::BrowserHome => NonPrintableKey::BROWSER_HOME,
2617
2618 crate::natural::NonPrintableKey::BrowserRefresh => NonPrintableKey::BROWSER_REFRESH,
2619
2620 crate::natural::NonPrintableKey::BrowserSearch => NonPrintableKey::BROWSER_SEARCH,
2621
2622 crate::natural::NonPrintableKey::BrowserStop => NonPrintableKey::BROWSER_STOP,
2623
2624 crate::natural::NonPrintableKey::ZoomToggle => NonPrintableKey::ZOOM_TOGGLE,
2625
2626 crate::natural::NonPrintableKey::UnknownOrdinal_(value) => {
2627 NonPrintableKey { value: ::fidl_next::wire::Uint32::from(value) }
2628 }
2629 }
2630 }
2631 }
2632
2633 impl ::fidl_next::IntoNatural for NonPrintableKey {
2634 type Natural = crate::natural::NonPrintableKey;
2635 }
2636
2637 #[repr(transparent)]
2639 pub struct KeyMeaning {
2640 pub(crate) raw: ::fidl_next::wire::Union,
2641 pub(crate) _phantom: ::core::marker::PhantomData<()>,
2642 }
2643
2644 impl Drop for KeyMeaning {
2645 fn drop(&mut self) {
2646 match self.raw.ordinal() {
2647 1 => {
2648 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Uint32>() };
2649 }
2650
2651 2 => {
2652 let _ =
2653 unsafe { self.raw.get().read_unchecked::<crate::wire::NonPrintableKey>() };
2654 }
2655
2656 _ => unsafe { ::core::hint::unreachable_unchecked() },
2657 }
2658 }
2659 }
2660
2661 impl ::fidl_next::Constrained for KeyMeaning {
2662 type Constraint = ();
2663
2664 fn validate(
2665 _: ::fidl_next::Slot<'_, Self>,
2666 _: Self::Constraint,
2667 ) -> Result<(), ::fidl_next::ValidationError> {
2668 Ok(())
2669 }
2670 }
2671
2672 unsafe impl ::fidl_next::Wire for KeyMeaning {
2673 type Narrowed<'de> = KeyMeaning;
2674
2675 #[inline]
2676 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2677 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
2678 ::fidl_next::wire::Union::zero_padding(raw);
2679 }
2680 }
2681
2682 pub mod key_meaning {
2683 pub enum Ref<'de> {
2684 Codepoint(&'de ::fidl_next::wire::Uint32),
2685
2686 NonPrintableKey(&'de crate::wire::NonPrintableKey),
2687 }
2688
2689 pub enum Value {
2690 Codepoint(::fidl_next::wire::Uint32),
2691
2692 NonPrintableKey(crate::wire::NonPrintableKey),
2693 }
2694 }
2695
2696 impl KeyMeaning {
2697 pub fn as_ref(&self) -> crate::wire::key_meaning::Ref<'_> {
2698 match self.raw.ordinal() {
2699 1 => crate::wire::key_meaning::Ref::Codepoint(unsafe {
2700 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint32>()
2701 }),
2702
2703 2 => crate::wire::key_meaning::Ref::NonPrintableKey(unsafe {
2704 self.raw.get().deref_unchecked::<crate::wire::NonPrintableKey>()
2705 }),
2706
2707 _ => unsafe { ::core::hint::unreachable_unchecked() },
2708 }
2709 }
2710
2711 pub fn into_inner(self) -> crate::wire::key_meaning::Value {
2712 let this = ::core::mem::ManuallyDrop::new(self);
2713
2714 match this.raw.ordinal() {
2715 1 => crate::wire::key_meaning::Value::Codepoint(unsafe {
2716 this.raw.get().read_unchecked::<::fidl_next::wire::Uint32>()
2717 }),
2718
2719 2 => crate::wire::key_meaning::Value::NonPrintableKey(unsafe {
2720 this.raw.get().read_unchecked::<crate::wire::NonPrintableKey>()
2721 }),
2722
2723 _ => unsafe { ::core::hint::unreachable_unchecked() },
2724 }
2725 }
2726 }
2727
2728 impl Clone for KeyMeaning {
2729 fn clone(&self) -> Self {
2730 match self.raw.ordinal() {
2731 1 => Self {
2732 raw: unsafe { self.raw.clone_inline_unchecked::<::fidl_next::wire::Uint32>() },
2733 _phantom: ::core::marker::PhantomData,
2734 },
2735
2736 2 => Self {
2737 raw: unsafe {
2738 self.raw.clone_inline_unchecked::<crate::wire::NonPrintableKey>()
2739 },
2740 _phantom: ::core::marker::PhantomData,
2741 },
2742
2743 _ => unsafe { ::core::hint::unreachable_unchecked() },
2744 }
2745 }
2746 }
2747
2748 unsafe impl<___D> ::fidl_next::Decode<___D> for KeyMeaning
2749 where
2750 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2751 {
2752 fn decode(
2753 mut slot: ::fidl_next::Slot<'_, Self>,
2754 decoder: &mut ___D,
2755 _: (),
2756 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2757 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
2758 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
2759 1 => ::fidl_next::wire::Union::decode_as_static::<___D, ::fidl_next::wire::Uint32>(
2760 raw,
2761 decoder,
2762 (),
2763 )?,
2764
2765 2 => ::fidl_next::wire::Union::decode_as_static::<
2766 ___D,
2767 crate::wire::NonPrintableKey,
2768 >(raw, decoder, ())?,
2769
2770 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
2771 }
2772
2773 Ok(())
2774 }
2775 }
2776
2777 impl ::core::fmt::Debug for KeyMeaning {
2778 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
2779 match self.raw.ordinal() {
2780 1 => unsafe {
2781 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint32>().fmt(f)
2782 },
2783 2 => unsafe {
2784 self.raw.get().deref_unchecked::<crate::wire::NonPrintableKey>().fmt(f)
2785 },
2786 _ => unsafe { ::core::hint::unreachable_unchecked() },
2787 }
2788 }
2789 }
2790
2791 impl ::fidl_next::IntoNatural for KeyMeaning {
2792 type Natural = crate::natural::KeyMeaning;
2793 }
2794
2795 #[repr(C)]
2797 pub struct KeyEvent<'de> {
2798 pub(crate) table: ::fidl_next::wire::Table<'de>,
2799 }
2800
2801 impl<'de> Drop for KeyEvent<'de> {
2802 fn drop(&mut self) {
2803 let _ = self
2804 .table
2805 .get(1)
2806 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Int64>() });
2807
2808 let _ = self
2809 .table
2810 .get(2)
2811 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::KeyEventType>() });
2812
2813 let _ = self.table.get(3).map(|envelope| unsafe {
2814 envelope.read_unchecked::<::fidl_next_common_fuchsia_input::wire::Key>()
2815 });
2816
2817 let _ = self
2818 .table
2819 .get(4)
2820 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Modifiers>() });
2821
2822 let _ = self
2823 .table
2824 .get(5)
2825 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::KeyMeaning>() });
2826
2827 let _ = self
2828 .table
2829 .get(6)
2830 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
2831
2832 let _ = self
2833 .table
2834 .get(7)
2835 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::LockState>() });
2836
2837 let _ = self
2838 .table
2839 .get(8)
2840 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
2841 }
2842 }
2843
2844 impl ::fidl_next::Constrained for KeyEvent<'_> {
2845 type Constraint = ();
2846
2847 fn validate(
2848 _: ::fidl_next::Slot<'_, Self>,
2849 _: Self::Constraint,
2850 ) -> Result<(), ::fidl_next::ValidationError> {
2851 Ok(())
2852 }
2853 }
2854
2855 unsafe impl ::fidl_next::Wire for KeyEvent<'static> {
2856 type Narrowed<'de> = KeyEvent<'de>;
2857
2858 #[inline]
2859 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2860 ::fidl_next::munge!(let Self { table } = out);
2861 ::fidl_next::wire::Table::zero_padding(table);
2862 }
2863 }
2864
2865 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for KeyEvent<'de>
2866 where
2867 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2868 {
2869 fn decode(
2870 slot: ::fidl_next::Slot<'_, Self>,
2871 decoder: &mut ___D,
2872 _: (),
2873 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2874 ::fidl_next::munge!(let Self { table } = slot);
2875
2876 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2877 match ordinal {
2878 0 => unsafe { ::core::hint::unreachable_unchecked() },
2879
2880 1 => {
2881 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Int64>(
2882 slot.as_mut(),
2883 decoder,
2884 (),
2885 )?;
2886
2887 Ok(())
2888 }
2889
2890 2 => {
2891 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::KeyEventType>(
2892 slot.as_mut(),
2893 decoder,
2894 (),
2895 )?;
2896
2897 Ok(())
2898 }
2899
2900 3 => {
2901 ::fidl_next::wire::Envelope::decode_as::<
2902 ___D,
2903 ::fidl_next_common_fuchsia_input::wire::Key,
2904 >(slot.as_mut(), decoder, ())?;
2905
2906 Ok(())
2907 }
2908
2909 4 => {
2910 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Modifiers>(
2911 slot.as_mut(),
2912 decoder,
2913 (),
2914 )?;
2915
2916 Ok(())
2917 }
2918
2919 5 => {
2920 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::KeyMeaning>(
2921 slot.as_mut(),
2922 decoder,
2923 (),
2924 )?;
2925
2926 Ok(())
2927 }
2928
2929 6 => {
2930 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
2931 slot.as_mut(),
2932 decoder,
2933 (),
2934 )?;
2935
2936 Ok(())
2937 }
2938
2939 7 => {
2940 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::LockState>(
2941 slot.as_mut(),
2942 decoder,
2943 (),
2944 )?;
2945
2946 Ok(())
2947 }
2948
2949 8 => {
2950 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
2951 slot.as_mut(),
2952 decoder,
2953 (),
2954 )?;
2955
2956 Ok(())
2957 }
2958
2959 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2960 }
2961 })
2962 }
2963 }
2964
2965 impl<'de> KeyEvent<'de> {
2966 pub fn timestamp(&self) -> ::core::option::Option<&::fidl_next::wire::Int64> {
2967 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2968 }
2969
2970 pub fn take_timestamp(&mut self) -> ::core::option::Option<::fidl_next::wire::Int64> {
2971 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2972 }
2973
2974 pub fn type_(&self) -> ::core::option::Option<&crate::wire::KeyEventType> {
2975 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2976 }
2977
2978 pub fn take_type_(&mut self) -> ::core::option::Option<crate::wire::KeyEventType> {
2979 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
2980 }
2981
2982 pub fn key(&self) -> ::core::option::Option<&::fidl_next_common_fuchsia_input::wire::Key> {
2983 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2984 }
2985
2986 pub fn take_key(
2987 &mut self,
2988 ) -> ::core::option::Option<::fidl_next_common_fuchsia_input::wire::Key> {
2989 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
2990 }
2991
2992 pub fn modifiers(&self) -> ::core::option::Option<&crate::wire::Modifiers> {
2993 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
2994 }
2995
2996 pub fn take_modifiers(&mut self) -> ::core::option::Option<crate::wire::Modifiers> {
2997 unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
2998 }
2999
3000 pub fn key_meaning(&self) -> ::core::option::Option<&crate::wire::KeyMeaning> {
3001 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
3002 }
3003
3004 pub fn take_key_meaning(&mut self) -> ::core::option::Option<crate::wire::KeyMeaning> {
3005 unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
3006 }
3007
3008 pub fn repeat_sequence(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
3009 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
3010 }
3011
3012 pub fn take_repeat_sequence(
3013 &mut self,
3014 ) -> ::core::option::Option<::fidl_next::wire::Uint32> {
3015 unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
3016 }
3017
3018 pub fn lock_state(&self) -> ::core::option::Option<&crate::wire::LockState> {
3019 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
3020 }
3021
3022 pub fn take_lock_state(&mut self) -> ::core::option::Option<crate::wire::LockState> {
3023 unsafe { Some(self.table.get_mut(7)?.take_unchecked()) }
3024 }
3025
3026 pub fn device_id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
3027 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
3028 }
3029
3030 pub fn take_device_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
3031 unsafe { Some(self.table.get_mut(8)?.take_unchecked()) }
3032 }
3033 }
3034
3035 impl<'de> ::core::fmt::Debug for KeyEvent<'de> {
3036 fn fmt(
3037 &self,
3038 f: &mut ::core::fmt::Formatter<'_>,
3039 ) -> ::core::result::Result<(), ::core::fmt::Error> {
3040 f.debug_struct("KeyEvent")
3041 .field("timestamp", &self.timestamp())
3042 .field("type_", &self.type_())
3043 .field("key", &self.key())
3044 .field("modifiers", &self.modifiers())
3045 .field("key_meaning", &self.key_meaning())
3046 .field("repeat_sequence", &self.repeat_sequence())
3047 .field("lock_state", &self.lock_state())
3048 .field("device_id", &self.device_id())
3049 .finish()
3050 }
3051 }
3052
3053 impl<'de> ::fidl_next::IntoNatural for KeyEvent<'de> {
3054 type Natural = crate::natural::KeyEvent;
3055 }
3056
3057 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
3059 #[repr(transparent)]
3060 pub struct KeyEventStatus {
3061 pub(crate) value: ::fidl_next::wire::Uint32,
3062 }
3063
3064 impl ::fidl_next::Constrained for KeyEventStatus {
3065 type Constraint = ();
3066
3067 fn validate(
3068 _: ::fidl_next::Slot<'_, Self>,
3069 _: Self::Constraint,
3070 ) -> Result<(), ::fidl_next::ValidationError> {
3071 Ok(())
3072 }
3073 }
3074
3075 unsafe impl ::fidl_next::Wire for KeyEventStatus {
3076 type Narrowed<'de> = Self;
3077
3078 #[inline]
3079 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
3080 }
3082 }
3083
3084 impl KeyEventStatus {
3085 pub const HANDLED: KeyEventStatus = KeyEventStatus { value: ::fidl_next::wire::Uint32(1) };
3086
3087 pub const NOT_HANDLED: KeyEventStatus =
3088 KeyEventStatus { value: ::fidl_next::wire::Uint32(2) };
3089 }
3090
3091 unsafe impl<___D> ::fidl_next::Decode<___D> for KeyEventStatus
3092 where
3093 ___D: ?Sized,
3094 {
3095 fn decode(
3096 slot: ::fidl_next::Slot<'_, Self>,
3097 _: &mut ___D,
3098 _: (),
3099 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3100 ::fidl_next::munge!(let Self { value } = slot);
3101
3102 match u32::from(*value) {
3103 1 | 2 => (),
3104 unknown => {
3105 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
3106 }
3107 }
3108
3109 Ok(())
3110 }
3111 }
3112
3113 impl ::core::convert::From<crate::natural::KeyEventStatus> for KeyEventStatus {
3114 fn from(natural: crate::natural::KeyEventStatus) -> Self {
3115 match natural {
3116 crate::natural::KeyEventStatus::Handled => KeyEventStatus::HANDLED,
3117
3118 crate::natural::KeyEventStatus::NotHandled => KeyEventStatus::NOT_HANDLED,
3119 }
3120 }
3121 }
3122
3123 impl ::fidl_next::IntoNatural for KeyEventStatus {
3124 type Natural = crate::natural::KeyEventStatus;
3125 }
3126
3127 #[derive(Clone, Debug)]
3129 #[repr(C)]
3130 pub struct KeyEventInjectorInjectResponse {
3131 pub status: crate::wire::KeyEventStatus,
3132 }
3133
3134 static_assertions::const_assert_eq!(std::mem::size_of::<KeyEventInjectorInjectResponse>(), 4);
3135 static_assertions::const_assert_eq!(std::mem::align_of::<KeyEventInjectorInjectResponse>(), 4);
3136
3137 static_assertions::const_assert_eq!(
3138 std::mem::offset_of!(KeyEventInjectorInjectResponse, status),
3139 0
3140 );
3141
3142 impl ::fidl_next::Constrained for KeyEventInjectorInjectResponse {
3143 type Constraint = ();
3144
3145 fn validate(
3146 _: ::fidl_next::Slot<'_, Self>,
3147 _: Self::Constraint,
3148 ) -> Result<(), ::fidl_next::ValidationError> {
3149 Ok(())
3150 }
3151 }
3152
3153 unsafe impl ::fidl_next::Wire for KeyEventInjectorInjectResponse {
3154 type Narrowed<'de> = KeyEventInjectorInjectResponse;
3155
3156 #[inline]
3157 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3158 ::fidl_next::munge! {
3159 let Self {
3160 status,
3161
3162 } = &mut *out_;
3163 }
3164
3165 ::fidl_next::Wire::zero_padding(status);
3166 }
3167 }
3168
3169 unsafe impl<___D> ::fidl_next::Decode<___D> for KeyEventInjectorInjectResponse
3170 where
3171 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3172 {
3173 fn decode(
3174 slot_: ::fidl_next::Slot<'_, Self>,
3175 decoder_: &mut ___D,
3176 _: (),
3177 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3178 ::fidl_next::munge! {
3179 let Self {
3180 mut status,
3181
3182 } = slot_;
3183 }
3184
3185 let _field = status.as_mut();
3186
3187 ::fidl_next::Decode::decode(status.as_mut(), decoder_, ())?;
3188
3189 Ok(())
3190 }
3191 }
3192
3193 impl ::fidl_next::IntoNatural for KeyEventInjectorInjectResponse {
3194 type Natural = crate::natural::KeyEventInjectorInjectResponse;
3195 }
3196
3197 #[derive(Debug)]
3199 #[repr(C)]
3200 pub struct KeyEventInjectorInjectRequest<'de> {
3201 pub key_event: crate::wire::KeyEvent<'de>,
3202 }
3203
3204 static_assertions::const_assert_eq!(
3205 std::mem::size_of::<KeyEventInjectorInjectRequest<'_>>(),
3206 16
3207 );
3208 static_assertions::const_assert_eq!(
3209 std::mem::align_of::<KeyEventInjectorInjectRequest<'_>>(),
3210 8
3211 );
3212
3213 static_assertions::const_assert_eq!(
3214 std::mem::offset_of!(KeyEventInjectorInjectRequest<'_>, key_event),
3215 0
3216 );
3217
3218 impl ::fidl_next::Constrained for KeyEventInjectorInjectRequest<'_> {
3219 type Constraint = ();
3220
3221 fn validate(
3222 _: ::fidl_next::Slot<'_, Self>,
3223 _: Self::Constraint,
3224 ) -> Result<(), ::fidl_next::ValidationError> {
3225 Ok(())
3226 }
3227 }
3228
3229 unsafe impl ::fidl_next::Wire for KeyEventInjectorInjectRequest<'static> {
3230 type Narrowed<'de> = KeyEventInjectorInjectRequest<'de>;
3231
3232 #[inline]
3233 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3234 ::fidl_next::munge! {
3235 let Self {
3236 key_event,
3237
3238 } = &mut *out_;
3239 }
3240
3241 ::fidl_next::Wire::zero_padding(key_event);
3242 }
3243 }
3244
3245 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for KeyEventInjectorInjectRequest<'de>
3246 where
3247 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3248 ___D: ::fidl_next::Decoder<'de>,
3249 {
3250 fn decode(
3251 slot_: ::fidl_next::Slot<'_, Self>,
3252 decoder_: &mut ___D,
3253 _: (),
3254 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3255 ::fidl_next::munge! {
3256 let Self {
3257 mut key_event,
3258
3259 } = slot_;
3260 }
3261
3262 let _field = key_event.as_mut();
3263
3264 ::fidl_next::Decode::decode(key_event.as_mut(), decoder_, ())?;
3265
3266 Ok(())
3267 }
3268 }
3269
3270 impl<'de> ::fidl_next::IntoNatural for KeyEventInjectorInjectRequest<'de> {
3271 type Natural = crate::natural::KeyEventInjectorInjectRequest;
3272 }
3273
3274 #[derive(Clone, Debug)]
3276 #[repr(C)]
3277 pub struct KeyboardListenerOnKeyEventResponse {
3278 pub status: crate::wire::KeyEventStatus,
3279 }
3280
3281 static_assertions::const_assert_eq!(
3282 std::mem::size_of::<KeyboardListenerOnKeyEventResponse>(),
3283 4
3284 );
3285 static_assertions::const_assert_eq!(
3286 std::mem::align_of::<KeyboardListenerOnKeyEventResponse>(),
3287 4
3288 );
3289
3290 static_assertions::const_assert_eq!(
3291 std::mem::offset_of!(KeyboardListenerOnKeyEventResponse, status),
3292 0
3293 );
3294
3295 impl ::fidl_next::Constrained for KeyboardListenerOnKeyEventResponse {
3296 type Constraint = ();
3297
3298 fn validate(
3299 _: ::fidl_next::Slot<'_, Self>,
3300 _: Self::Constraint,
3301 ) -> Result<(), ::fidl_next::ValidationError> {
3302 Ok(())
3303 }
3304 }
3305
3306 unsafe impl ::fidl_next::Wire for KeyboardListenerOnKeyEventResponse {
3307 type Narrowed<'de> = KeyboardListenerOnKeyEventResponse;
3308
3309 #[inline]
3310 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3311 ::fidl_next::munge! {
3312 let Self {
3313 status,
3314
3315 } = &mut *out_;
3316 }
3317
3318 ::fidl_next::Wire::zero_padding(status);
3319 }
3320 }
3321
3322 unsafe impl<___D> ::fidl_next::Decode<___D> for KeyboardListenerOnKeyEventResponse
3323 where
3324 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3325 {
3326 fn decode(
3327 slot_: ::fidl_next::Slot<'_, Self>,
3328 decoder_: &mut ___D,
3329 _: (),
3330 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3331 ::fidl_next::munge! {
3332 let Self {
3333 mut status,
3334
3335 } = slot_;
3336 }
3337
3338 let _field = status.as_mut();
3339
3340 ::fidl_next::Decode::decode(status.as_mut(), decoder_, ())?;
3341
3342 Ok(())
3343 }
3344 }
3345
3346 impl ::fidl_next::IntoNatural for KeyboardListenerOnKeyEventResponse {
3347 type Natural = crate::natural::KeyboardListenerOnKeyEventResponse;
3348 }
3349
3350 #[derive(Debug)]
3352 #[repr(C)]
3353 pub struct KeyboardListenerOnKeyEventRequest<'de> {
3354 pub event: crate::wire::KeyEvent<'de>,
3355 }
3356
3357 static_assertions::const_assert_eq!(
3358 std::mem::size_of::<KeyboardListenerOnKeyEventRequest<'_>>(),
3359 16
3360 );
3361 static_assertions::const_assert_eq!(
3362 std::mem::align_of::<KeyboardListenerOnKeyEventRequest<'_>>(),
3363 8
3364 );
3365
3366 static_assertions::const_assert_eq!(
3367 std::mem::offset_of!(KeyboardListenerOnKeyEventRequest<'_>, event),
3368 0
3369 );
3370
3371 impl ::fidl_next::Constrained for KeyboardListenerOnKeyEventRequest<'_> {
3372 type Constraint = ();
3373
3374 fn validate(
3375 _: ::fidl_next::Slot<'_, Self>,
3376 _: Self::Constraint,
3377 ) -> Result<(), ::fidl_next::ValidationError> {
3378 Ok(())
3379 }
3380 }
3381
3382 unsafe impl ::fidl_next::Wire for KeyboardListenerOnKeyEventRequest<'static> {
3383 type Narrowed<'de> = KeyboardListenerOnKeyEventRequest<'de>;
3384
3385 #[inline]
3386 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3387 ::fidl_next::munge! {
3388 let Self {
3389 event,
3390
3391 } = &mut *out_;
3392 }
3393
3394 ::fidl_next::Wire::zero_padding(event);
3395 }
3396 }
3397
3398 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for KeyboardListenerOnKeyEventRequest<'de>
3399 where
3400 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3401 ___D: ::fidl_next::Decoder<'de>,
3402 {
3403 fn decode(
3404 slot_: ::fidl_next::Slot<'_, Self>,
3405 decoder_: &mut ___D,
3406 _: (),
3407 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3408 ::fidl_next::munge! {
3409 let Self {
3410 mut event,
3411
3412 } = slot_;
3413 }
3414
3415 let _field = event.as_mut();
3416
3417 ::fidl_next::Decode::decode(event.as_mut(), decoder_, ())?;
3418
3419 Ok(())
3420 }
3421 }
3422
3423 impl<'de> ::fidl_next::IntoNatural for KeyboardListenerOnKeyEventRequest<'de> {
3424 type Natural = crate::natural::KeyboardListenerOnKeyEventRequest;
3425 }
3426}
3427
3428pub mod wire_optional {
3429
3430 #[repr(transparent)]
3431 pub struct KeyMeaning {
3432 pub(crate) raw: ::fidl_next::wire::Union,
3433 pub(crate) _phantom: ::core::marker::PhantomData<()>,
3434 }
3435
3436 impl ::fidl_next::Constrained for KeyMeaning {
3437 type Constraint = ();
3438
3439 fn validate(
3440 _: ::fidl_next::Slot<'_, Self>,
3441 _: Self::Constraint,
3442 ) -> Result<(), ::fidl_next::ValidationError> {
3443 Ok(())
3444 }
3445 }
3446
3447 unsafe impl ::fidl_next::Wire for KeyMeaning {
3448 type Narrowed<'de> = KeyMeaning;
3449
3450 #[inline]
3451 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3452 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
3453 ::fidl_next::wire::Union::zero_padding(raw);
3454 }
3455 }
3456
3457 impl KeyMeaning {
3458 pub fn is_some(&self) -> bool {
3459 self.raw.is_some()
3460 }
3461
3462 pub fn is_none(&self) -> bool {
3463 self.raw.is_none()
3464 }
3465
3466 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::KeyMeaning> {
3467 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
3468 }
3469
3470 pub fn into_option(self) -> ::core::option::Option<crate::wire::KeyMeaning> {
3471 if self.is_some() {
3472 Some(crate::wire::KeyMeaning {
3473 raw: self.raw,
3474 _phantom: ::core::marker::PhantomData,
3475 })
3476 } else {
3477 None
3478 }
3479 }
3480 }
3481
3482 impl Clone for KeyMeaning {
3483 fn clone(&self) -> Self {
3484 if self.is_none() {
3485 return KeyMeaning {
3486 raw: ::fidl_next::wire::Union::absent(),
3487 _phantom: ::core::marker::PhantomData,
3488 };
3489 }
3490
3491 match self.raw.ordinal() {
3492 1 => Self {
3493 raw: unsafe { self.raw.clone_inline_unchecked::<::fidl_next::wire::Uint32>() },
3494 _phantom: ::core::marker::PhantomData,
3495 },
3496
3497 2 => Self {
3498 raw: unsafe {
3499 self.raw.clone_inline_unchecked::<crate::wire::NonPrintableKey>()
3500 },
3501 _phantom: ::core::marker::PhantomData,
3502 },
3503
3504 _ => unsafe { ::core::hint::unreachable_unchecked() },
3505 }
3506 }
3507 }
3508
3509 unsafe impl<___D> ::fidl_next::Decode<___D> for KeyMeaning
3510 where
3511 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3512 {
3513 fn decode(
3514 mut slot: ::fidl_next::Slot<'_, Self>,
3515 decoder: &mut ___D,
3516 _: (),
3517 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3518 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
3519 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
3520 1 => ::fidl_next::wire::Union::decode_as_static::<___D, ::fidl_next::wire::Uint32>(
3521 raw,
3522 decoder,
3523 (),
3524 )?,
3525
3526 2 => ::fidl_next::wire::Union::decode_as_static::<
3527 ___D,
3528 crate::wire::NonPrintableKey,
3529 >(raw, decoder, ())?,
3530
3531 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
3532 _ => ::fidl_next::wire::Union::decode_unknown_static(raw, decoder)?,
3533 }
3534
3535 Ok(())
3536 }
3537 }
3538
3539 impl ::core::fmt::Debug for KeyMeaning {
3540 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3541 self.as_ref().fmt(f)
3542 }
3543 }
3544
3545 impl ::fidl_next::IntoNatural for KeyMeaning {
3546 type Natural = ::core::option::Option<crate::natural::KeyMeaning>;
3547 }
3548}
3549
3550pub mod generic {
3551
3552 pub struct KeyEventInjectorInjectResponse<T0> {
3554 pub status: T0,
3555 }
3556
3557 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::KeyEventInjectorInjectResponse, ___E>
3558 for KeyEventInjectorInjectResponse<T0>
3559 where
3560 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3561 T0: ::fidl_next::Encode<crate::wire::KeyEventStatus, ___E>,
3562 {
3563 #[inline]
3564 fn encode(
3565 self,
3566 encoder_: &mut ___E,
3567 out_: &mut ::core::mem::MaybeUninit<crate::wire::KeyEventInjectorInjectResponse>,
3568 _: (),
3569 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3570 ::fidl_next::munge! {
3571 let crate::wire::KeyEventInjectorInjectResponse {
3572 status,
3573
3574 } = out_;
3575 }
3576
3577 ::fidl_next::Encode::encode(self.status, encoder_, status, ())?;
3578
3579 Ok(())
3580 }
3581 }
3582
3583 pub struct KeyEventInjectorInjectRequest<T0> {
3585 pub key_event: T0,
3586 }
3587
3588 unsafe impl<___E, T0>
3589 ::fidl_next::Encode<crate::wire::KeyEventInjectorInjectRequest<'static>, ___E>
3590 for KeyEventInjectorInjectRequest<T0>
3591 where
3592 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3593 ___E: ::fidl_next::Encoder,
3594 T0: ::fidl_next::Encode<crate::wire::KeyEvent<'static>, ___E>,
3595 {
3596 #[inline]
3597 fn encode(
3598 self,
3599 encoder_: &mut ___E,
3600 out_: &mut ::core::mem::MaybeUninit<
3601 crate::wire::KeyEventInjectorInjectRequest<'static>,
3602 >,
3603 _: (),
3604 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3605 ::fidl_next::munge! {
3606 let crate::wire::KeyEventInjectorInjectRequest {
3607 key_event,
3608
3609 } = out_;
3610 }
3611
3612 ::fidl_next::Encode::encode(self.key_event, encoder_, key_event, ())?;
3613
3614 Ok(())
3615 }
3616 }
3617
3618 pub struct KeyboardListenerOnKeyEventResponse<T0> {
3620 pub status: T0,
3621 }
3622
3623 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::KeyboardListenerOnKeyEventResponse, ___E>
3624 for KeyboardListenerOnKeyEventResponse<T0>
3625 where
3626 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3627 T0: ::fidl_next::Encode<crate::wire::KeyEventStatus, ___E>,
3628 {
3629 #[inline]
3630 fn encode(
3631 self,
3632 encoder_: &mut ___E,
3633 out_: &mut ::core::mem::MaybeUninit<crate::wire::KeyboardListenerOnKeyEventResponse>,
3634 _: (),
3635 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3636 ::fidl_next::munge! {
3637 let crate::wire::KeyboardListenerOnKeyEventResponse {
3638 status,
3639
3640 } = out_;
3641 }
3642
3643 ::fidl_next::Encode::encode(self.status, encoder_, status, ())?;
3644
3645 Ok(())
3646 }
3647 }
3648
3649 pub struct KeyboardListenerOnKeyEventRequest<T0> {
3651 pub event: T0,
3652 }
3653
3654 unsafe impl<___E, T0>
3655 ::fidl_next::Encode<crate::wire::KeyboardListenerOnKeyEventRequest<'static>, ___E>
3656 for KeyboardListenerOnKeyEventRequest<T0>
3657 where
3658 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3659 ___E: ::fidl_next::Encoder,
3660 T0: ::fidl_next::Encode<crate::wire::KeyEvent<'static>, ___E>,
3661 {
3662 #[inline]
3663 fn encode(
3664 self,
3665 encoder_: &mut ___E,
3666 out_: &mut ::core::mem::MaybeUninit<
3667 crate::wire::KeyboardListenerOnKeyEventRequest<'static>,
3668 >,
3669 _: (),
3670 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3671 ::fidl_next::munge! {
3672 let crate::wire::KeyboardListenerOnKeyEventRequest {
3673 event,
3674
3675 } = out_;
3676 }
3677
3678 ::fidl_next::Encode::encode(self.event, encoder_, event, ())?;
3679
3680 Ok(())
3681 }
3682 }
3683}
3684
3685pub use self::natural::*;
3686
3687#[doc = " Provides the ability to inject `KeyEvent`s into the keyboard subsystem.\n\n # Roles\n This protocol will typically be:\n * Implemented by platform components which process and deliver keyboard\n events.\n * Consumed by components which originiate keyboard events. E.g.\n an on-screen keyboard, or the Session Framework Input Pipeline.\n\n # Related protocols\n This protocol should be using in preference to legacy protocols which provide\n similar functionality. Specifically, this means this protocol should be preferred\n over\n * `fuchsia.ui.input.ImeService` which provides `InjectInput()`, `DispatchKey()`,\n and `DispatchKey3()`\n * `fuchsia.ui.input.InputMethodEditor`, which provides `InjectInput()` and\n `DispatchKey3()`\n\n # Notes\n Products should take care to limit access to this protocol, as events injected\n with this protocol are indistinguishable from those coming from physical devices.\n"]
3689#[derive(PartialEq, Debug)]
3690pub struct KeyEventInjector;
3691
3692impl ::fidl_next::Discoverable for KeyEventInjector {
3693 const PROTOCOL_NAME: &'static str = "fuchsia.ui.input3.KeyEventInjector";
3694}
3695
3696#[cfg(target_os = "fuchsia")]
3697impl ::fidl_next::HasTransport for KeyEventInjector {
3698 type Transport = ::fidl_next::fuchsia::zx::Channel;
3699}
3700
3701pub mod key_event_injector {
3702 pub mod prelude {
3703 pub use crate::{
3704 KeyEventInjector, KeyEventInjectorClientHandler, KeyEventInjectorLocalClientHandler,
3705 KeyEventInjectorLocalServerHandler, KeyEventInjectorServerHandler, key_event_injector,
3706 };
3707
3708 pub use crate::natural::KeyEventInjectorInjectRequest;
3709
3710 pub use crate::natural::KeyEventInjectorInjectResponse;
3711 }
3712
3713 pub struct Inject;
3714
3715 impl ::fidl_next::Method for Inject {
3716 const ORDINAL: u64 = 2212042399155652937;
3717 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3718 ::fidl_next::protocol::Flexibility::Strict;
3719
3720 type Protocol = crate::KeyEventInjector;
3721
3722 type Request = crate::wire::KeyEventInjectorInjectRequest<'static>;
3723 }
3724
3725 impl ::fidl_next::TwoWayMethod for Inject {
3726 type Response = ::fidl_next::wire::Strict<crate::wire::KeyEventInjectorInjectResponse>;
3727 }
3728
3729 impl<___R> ::fidl_next::Respond<___R> for Inject {
3730 type Output = ::fidl_next::Strict<crate::generic::KeyEventInjectorInjectResponse<___R>>;
3731
3732 fn respond(response: ___R) -> Self::Output {
3733 ::fidl_next::Strict(crate::generic::KeyEventInjectorInjectResponse { status: response })
3734 }
3735 }
3736
3737 mod ___detail {
3738 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::KeyEventInjector
3739 where
3740 ___T: ::fidl_next::Transport,
3741 {
3742 type Client = KeyEventInjectorClient<___T>;
3743 type Server = KeyEventInjectorServer<___T>;
3744 }
3745
3746 #[repr(transparent)]
3748 pub struct KeyEventInjectorClient<___T: ::fidl_next::Transport> {
3749 #[allow(dead_code)]
3750 client: ::fidl_next::protocol::Client<___T>,
3751 }
3752
3753 impl<___T> KeyEventInjectorClient<___T>
3754 where
3755 ___T: ::fidl_next::Transport,
3756 {
3757 #[doc = " Inject an event into the keyboard subsystem.\n\n # Returns\n * `HANDLED` if the keyboard subsystem delivered the event to a consumer,\n and the consumer reported that it `HANDLED` the event\n * `NOT_HANDLED` if the keyboard subsystem did not deliever the event to\n any consumers, or no consumer reported that it `HANDLED` the event.\n"]
3758 pub fn inject(
3759 &self,
3760
3761 key_event: impl ::fidl_next::Encode<
3762 crate::wire::KeyEvent<'static>,
3763 <___T as ::fidl_next::Transport>::SendBuffer,
3764 >,
3765 ) -> ::fidl_next::TwoWayFuture<'_, super::Inject, ___T>
3766 where
3767 <___T as ::fidl_next::Transport>::SendBuffer:
3768 ::fidl_next::encoder::InternalHandleEncoder,
3769 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3770 {
3771 self.inject_with(crate::generic::KeyEventInjectorInjectRequest { key_event })
3772 }
3773
3774 #[doc = " Inject an event into the keyboard subsystem.\n\n # Returns\n * `HANDLED` if the keyboard subsystem delivered the event to a consumer,\n and the consumer reported that it `HANDLED` the event\n * `NOT_HANDLED` if the keyboard subsystem did not deliever the event to\n any consumers, or no consumer reported that it `HANDLED` the event.\n"]
3775 pub fn inject_with<___R>(
3776 &self,
3777 request: ___R,
3778 ) -> ::fidl_next::TwoWayFuture<'_, super::Inject, ___T>
3779 where
3780 ___R: ::fidl_next::Encode<
3781 crate::wire::KeyEventInjectorInjectRequest<'static>,
3782 <___T as ::fidl_next::Transport>::SendBuffer,
3783 >,
3784 {
3785 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3786 2212042399155652937,
3787 <super::Inject as ::fidl_next::Method>::FLEXIBILITY,
3788 request,
3789 ))
3790 }
3791 }
3792
3793 #[repr(transparent)]
3795 pub struct KeyEventInjectorServer<___T: ::fidl_next::Transport> {
3796 server: ::fidl_next::protocol::Server<___T>,
3797 }
3798
3799 impl<___T> KeyEventInjectorServer<___T> where ___T: ::fidl_next::Transport {}
3800 }
3801}
3802
3803#[diagnostic::on_unimplemented(
3804 note = "If {Self} implements the non-local KeyEventInjectorClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3805)]
3806
3807pub trait KeyEventInjectorLocalClientHandler<
3811 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3812 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3813>
3814{
3815}
3816
3817impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for KeyEventInjector
3818where
3819 ___H: KeyEventInjectorLocalClientHandler<___T>,
3820 ___T: ::fidl_next::Transport,
3821{
3822 async fn on_event(
3823 handler: &mut ___H,
3824 mut message: ::fidl_next::Message<___T>,
3825 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3826 match *message.header().ordinal {
3827 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3828 }
3829 }
3830}
3831
3832#[diagnostic::on_unimplemented(
3833 note = "If {Self} implements the non-local KeyEventInjectorServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3834)]
3835
3836pub trait KeyEventInjectorLocalServerHandler<
3840 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3841 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3842>
3843{
3844 #[doc = " Inject an event into the keyboard subsystem.\n\n # Returns\n * `HANDLED` if the keyboard subsystem delivered the event to a consumer,\n and the consumer reported that it `HANDLED` the event\n * `NOT_HANDLED` if the keyboard subsystem did not deliever the event to\n any consumers, or no consumer reported that it `HANDLED` the event.\n"]
3845 fn inject(
3846 &mut self,
3847
3848 request: ::fidl_next::Request<key_event_injector::Inject, ___T>,
3849
3850 responder: ::fidl_next::Responder<key_event_injector::Inject, ___T>,
3851 ) -> impl ::core::future::Future<Output = ()>;
3852}
3853
3854impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for KeyEventInjector
3855where
3856 ___H: KeyEventInjectorLocalServerHandler<___T>,
3857 ___T: ::fidl_next::Transport,
3858 for<'de> crate::wire::KeyEventInjectorInjectRequest<'de>: ::fidl_next::Decode<
3859 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3860 Constraint = (),
3861 >,
3862{
3863 async fn on_one_way(
3864 handler: &mut ___H,
3865 mut message: ::fidl_next::Message<___T>,
3866 ) -> ::core::result::Result<
3867 (),
3868 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3869 > {
3870 match *message.header().ordinal {
3871 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3872 }
3873 }
3874
3875 async fn on_two_way(
3876 handler: &mut ___H,
3877 mut message: ::fidl_next::Message<___T>,
3878 responder: ::fidl_next::protocol::Responder<___T>,
3879 ) -> ::core::result::Result<
3880 (),
3881 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3882 > {
3883 match *message.header().ordinal {
3884 2212042399155652937 => {
3885 let responder = ::fidl_next::Responder::from_untyped(responder);
3886
3887 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3888 Ok(decoded) => {
3889 handler
3890 .inject(::fidl_next::Request::from_decoded(decoded), responder)
3891 .await;
3892 Ok(())
3893 }
3894 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3895 ordinal: 2212042399155652937,
3896 error,
3897 }),
3898 }
3899 }
3900
3901 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3902 }
3903 }
3904}
3905
3906pub trait KeyEventInjectorClientHandler<
3910 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3911 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3912>
3913{
3914}
3915
3916impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for KeyEventInjector
3917where
3918 ___H: KeyEventInjectorClientHandler<___T> + ::core::marker::Send,
3919 ___T: ::fidl_next::Transport,
3920{
3921 async fn on_event(
3922 handler: &mut ___H,
3923 mut message: ::fidl_next::Message<___T>,
3924 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3925 match *message.header().ordinal {
3926 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3927 }
3928 }
3929}
3930
3931pub trait KeyEventInjectorServerHandler<
3935 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3936 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3937>
3938{
3939 #[doc = " Inject an event into the keyboard subsystem.\n\n # Returns\n * `HANDLED` if the keyboard subsystem delivered the event to a consumer,\n and the consumer reported that it `HANDLED` the event\n * `NOT_HANDLED` if the keyboard subsystem did not deliever the event to\n any consumers, or no consumer reported that it `HANDLED` the event.\n"]
3940 fn inject(
3941 &mut self,
3942
3943 request: ::fidl_next::Request<key_event_injector::Inject, ___T>,
3944
3945 responder: ::fidl_next::Responder<key_event_injector::Inject, ___T>,
3946 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3947}
3948
3949impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for KeyEventInjector
3950where
3951 ___H: KeyEventInjectorServerHandler<___T> + ::core::marker::Send,
3952 ___T: ::fidl_next::Transport,
3953 for<'de> crate::wire::KeyEventInjectorInjectRequest<'de>: ::fidl_next::Decode<
3954 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3955 Constraint = (),
3956 >,
3957{
3958 async fn on_one_way(
3959 handler: &mut ___H,
3960 mut message: ::fidl_next::Message<___T>,
3961 ) -> ::core::result::Result<
3962 (),
3963 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3964 > {
3965 match *message.header().ordinal {
3966 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3967 }
3968 }
3969
3970 async fn on_two_way(
3971 handler: &mut ___H,
3972 mut message: ::fidl_next::Message<___T>,
3973 responder: ::fidl_next::protocol::Responder<___T>,
3974 ) -> ::core::result::Result<
3975 (),
3976 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3977 > {
3978 match *message.header().ordinal {
3979 2212042399155652937 => {
3980 let responder = ::fidl_next::Responder::from_untyped(responder);
3981
3982 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3983 Ok(decoded) => {
3984 handler
3985 .inject(::fidl_next::Request::from_decoded(decoded), responder)
3986 .await;
3987 Ok(())
3988 }
3989 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3990 ordinal: 2212042399155652937,
3991 error,
3992 }),
3993 }
3994 }
3995
3996 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3997 }
3998 }
3999}
4000
4001impl<___T> KeyEventInjectorClientHandler<___T> for ::fidl_next::IgnoreEvents where
4002 ___T: ::fidl_next::Transport
4003{
4004}
4005
4006impl<___H, ___T> KeyEventInjectorLocalClientHandler<___T> for ::fidl_next::Local<___H>
4007where
4008 ___H: KeyEventInjectorClientHandler<___T>,
4009 ___T: ::fidl_next::Transport,
4010{
4011}
4012
4013impl<___H, ___T> KeyEventInjectorLocalServerHandler<___T> for ::fidl_next::Local<___H>
4014where
4015 ___H: KeyEventInjectorServerHandler<___T>,
4016 ___T: ::fidl_next::Transport,
4017{
4018 async fn inject(
4019 &mut self,
4020
4021 request: ::fidl_next::Request<key_event_injector::Inject, ___T>,
4022
4023 responder: ::fidl_next::Responder<key_event_injector::Inject, ___T>,
4024 ) {
4025 ___H::inject(&mut self.0, request, responder).await
4026 }
4027}
4028
4029#[doc = " Client should implement this protocol to get notified of key events.\n"]
4031#[derive(PartialEq, Debug)]
4032pub struct KeyboardListener;
4033
4034#[cfg(target_os = "fuchsia")]
4035impl ::fidl_next::HasTransport for KeyboardListener {
4036 type Transport = ::fidl_next::fuchsia::zx::Channel;
4037}
4038
4039pub mod keyboard_listener {
4040 pub mod prelude {
4041 pub use crate::{
4042 KeyboardListener, KeyboardListenerClientHandler, KeyboardListenerLocalClientHandler,
4043 KeyboardListenerLocalServerHandler, KeyboardListenerServerHandler, keyboard_listener,
4044 };
4045
4046 pub use crate::natural::KeyboardListenerOnKeyEventRequest;
4047
4048 pub use crate::natural::KeyboardListenerOnKeyEventResponse;
4049 }
4050
4051 pub struct OnKeyEvent;
4052
4053 impl ::fidl_next::Method for OnKeyEvent {
4054 const ORDINAL: u64 = 3383028051256316051;
4055 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4056 ::fidl_next::protocol::Flexibility::Strict;
4057
4058 type Protocol = crate::KeyboardListener;
4059
4060 type Request = crate::wire::KeyboardListenerOnKeyEventRequest<'static>;
4061 }
4062
4063 impl ::fidl_next::TwoWayMethod for OnKeyEvent {
4064 type Response = ::fidl_next::wire::Strict<crate::wire::KeyboardListenerOnKeyEventResponse>;
4065 }
4066
4067 impl<___R> ::fidl_next::Respond<___R> for OnKeyEvent {
4068 type Output = ::fidl_next::Strict<crate::generic::KeyboardListenerOnKeyEventResponse<___R>>;
4069
4070 fn respond(response: ___R) -> Self::Output {
4071 ::fidl_next::Strict(crate::generic::KeyboardListenerOnKeyEventResponse {
4072 status: response,
4073 })
4074 }
4075 }
4076
4077 mod ___detail {
4078 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::KeyboardListener
4079 where
4080 ___T: ::fidl_next::Transport,
4081 {
4082 type Client = KeyboardListenerClient<___T>;
4083 type Server = KeyboardListenerServer<___T>;
4084 }
4085
4086 #[repr(transparent)]
4088 pub struct KeyboardListenerClient<___T: ::fidl_next::Transport> {
4089 #[allow(dead_code)]
4090 client: ::fidl_next::protocol::Client<___T>,
4091 }
4092
4093 impl<___T> KeyboardListenerClient<___T>
4094 where
4095 ___T: ::fidl_next::Transport,
4096 {
4097 #[doc = " Called when a key event takes place, such as key press or release.\n\n Protocol implementers must respond to acknowledge the event by returning Status\n in a timely manner, i.e. not introducing significant delays to the\n input pipeline (typically 10s of milliseconds).\n\n Returning `NOT_HANDLED` means the event may be offered to other\n clients of other related APIs.\n\n Clients that do not acknowledge their events will eventually be disconnected.\n\n Notification is only dispatched to a view that has focus. No other views,\n including parents or children, will get notified specifically via `OnKeyEvent`.\n"]
4098 pub fn on_key_event(
4099 &self,
4100
4101 event: impl ::fidl_next::Encode<
4102 crate::wire::KeyEvent<'static>,
4103 <___T as ::fidl_next::Transport>::SendBuffer,
4104 >,
4105 ) -> ::fidl_next::TwoWayFuture<'_, super::OnKeyEvent, ___T>
4106 where
4107 <___T as ::fidl_next::Transport>::SendBuffer:
4108 ::fidl_next::encoder::InternalHandleEncoder,
4109 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
4110 {
4111 self.on_key_event_with(crate::generic::KeyboardListenerOnKeyEventRequest { event })
4112 }
4113
4114 #[doc = " Called when a key event takes place, such as key press or release.\n\n Protocol implementers must respond to acknowledge the event by returning Status\n in a timely manner, i.e. not introducing significant delays to the\n input pipeline (typically 10s of milliseconds).\n\n Returning `NOT_HANDLED` means the event may be offered to other\n clients of other related APIs.\n\n Clients that do not acknowledge their events will eventually be disconnected.\n\n Notification is only dispatched to a view that has focus. No other views,\n including parents or children, will get notified specifically via `OnKeyEvent`.\n"]
4115 pub fn on_key_event_with<___R>(
4116 &self,
4117 request: ___R,
4118 ) -> ::fidl_next::TwoWayFuture<'_, super::OnKeyEvent, ___T>
4119 where
4120 ___R: ::fidl_next::Encode<
4121 crate::wire::KeyboardListenerOnKeyEventRequest<'static>,
4122 <___T as ::fidl_next::Transport>::SendBuffer,
4123 >,
4124 {
4125 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
4126 3383028051256316051,
4127 <super::OnKeyEvent as ::fidl_next::Method>::FLEXIBILITY,
4128 request,
4129 ))
4130 }
4131 }
4132
4133 #[repr(transparent)]
4135 pub struct KeyboardListenerServer<___T: ::fidl_next::Transport> {
4136 server: ::fidl_next::protocol::Server<___T>,
4137 }
4138
4139 impl<___T> KeyboardListenerServer<___T> where ___T: ::fidl_next::Transport {}
4140 }
4141}
4142
4143#[diagnostic::on_unimplemented(
4144 note = "If {Self} implements the non-local KeyboardListenerClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
4145)]
4146
4147pub trait KeyboardListenerLocalClientHandler<
4151 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4152 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4153>
4154{
4155}
4156
4157impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for KeyboardListener
4158where
4159 ___H: KeyboardListenerLocalClientHandler<___T>,
4160 ___T: ::fidl_next::Transport,
4161{
4162 async fn on_event(
4163 handler: &mut ___H,
4164 mut message: ::fidl_next::Message<___T>,
4165 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4166 match *message.header().ordinal {
4167 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4168 }
4169 }
4170}
4171
4172#[diagnostic::on_unimplemented(
4173 note = "If {Self} implements the non-local KeyboardListenerServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
4174)]
4175
4176pub trait KeyboardListenerLocalServerHandler<
4180 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4181 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4182>
4183{
4184 #[doc = " Called when a key event takes place, such as key press or release.\n\n Protocol implementers must respond to acknowledge the event by returning Status\n in a timely manner, i.e. not introducing significant delays to the\n input pipeline (typically 10s of milliseconds).\n\n Returning `NOT_HANDLED` means the event may be offered to other\n clients of other related APIs.\n\n Clients that do not acknowledge their events will eventually be disconnected.\n\n Notification is only dispatched to a view that has focus. No other views,\n including parents or children, will get notified specifically via `OnKeyEvent`.\n"]
4185 fn on_key_event(
4186 &mut self,
4187
4188 request: ::fidl_next::Request<keyboard_listener::OnKeyEvent, ___T>,
4189
4190 responder: ::fidl_next::Responder<keyboard_listener::OnKeyEvent, ___T>,
4191 ) -> impl ::core::future::Future<Output = ()>;
4192}
4193
4194impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for KeyboardListener
4195where
4196 ___H: KeyboardListenerLocalServerHandler<___T>,
4197 ___T: ::fidl_next::Transport,
4198 for<'de> crate::wire::KeyboardListenerOnKeyEventRequest<'de>: ::fidl_next::Decode<
4199 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4200 Constraint = (),
4201 >,
4202{
4203 async fn on_one_way(
4204 handler: &mut ___H,
4205 mut message: ::fidl_next::Message<___T>,
4206 ) -> ::core::result::Result<
4207 (),
4208 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4209 > {
4210 match *message.header().ordinal {
4211 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4212 }
4213 }
4214
4215 async fn on_two_way(
4216 handler: &mut ___H,
4217 mut message: ::fidl_next::Message<___T>,
4218 responder: ::fidl_next::protocol::Responder<___T>,
4219 ) -> ::core::result::Result<
4220 (),
4221 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4222 > {
4223 match *message.header().ordinal {
4224 3383028051256316051 => {
4225 let responder = ::fidl_next::Responder::from_untyped(responder);
4226
4227 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4228 Ok(decoded) => {
4229 handler
4230 .on_key_event(::fidl_next::Request::from_decoded(decoded), responder)
4231 .await;
4232 Ok(())
4233 }
4234 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4235 ordinal: 3383028051256316051,
4236 error,
4237 }),
4238 }
4239 }
4240
4241 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4242 }
4243 }
4244}
4245
4246pub trait KeyboardListenerClientHandler<
4250 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4251 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4252>
4253{
4254}
4255
4256impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for KeyboardListener
4257where
4258 ___H: KeyboardListenerClientHandler<___T> + ::core::marker::Send,
4259 ___T: ::fidl_next::Transport,
4260{
4261 async fn on_event(
4262 handler: &mut ___H,
4263 mut message: ::fidl_next::Message<___T>,
4264 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4265 match *message.header().ordinal {
4266 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4267 }
4268 }
4269}
4270
4271pub trait KeyboardListenerServerHandler<
4275 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4276 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4277>
4278{
4279 #[doc = " Called when a key event takes place, such as key press or release.\n\n Protocol implementers must respond to acknowledge the event by returning Status\n in a timely manner, i.e. not introducing significant delays to the\n input pipeline (typically 10s of milliseconds).\n\n Returning `NOT_HANDLED` means the event may be offered to other\n clients of other related APIs.\n\n Clients that do not acknowledge their events will eventually be disconnected.\n\n Notification is only dispatched to a view that has focus. No other views,\n including parents or children, will get notified specifically via `OnKeyEvent`.\n"]
4280 fn on_key_event(
4281 &mut self,
4282
4283 request: ::fidl_next::Request<keyboard_listener::OnKeyEvent, ___T>,
4284
4285 responder: ::fidl_next::Responder<keyboard_listener::OnKeyEvent, ___T>,
4286 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4287}
4288
4289impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for KeyboardListener
4290where
4291 ___H: KeyboardListenerServerHandler<___T> + ::core::marker::Send,
4292 ___T: ::fidl_next::Transport,
4293 for<'de> crate::wire::KeyboardListenerOnKeyEventRequest<'de>: ::fidl_next::Decode<
4294 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4295 Constraint = (),
4296 >,
4297{
4298 async fn on_one_way(
4299 handler: &mut ___H,
4300 mut message: ::fidl_next::Message<___T>,
4301 ) -> ::core::result::Result<
4302 (),
4303 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4304 > {
4305 match *message.header().ordinal {
4306 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4307 }
4308 }
4309
4310 async fn on_two_way(
4311 handler: &mut ___H,
4312 mut message: ::fidl_next::Message<___T>,
4313 responder: ::fidl_next::protocol::Responder<___T>,
4314 ) -> ::core::result::Result<
4315 (),
4316 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
4317 > {
4318 match *message.header().ordinal {
4319 3383028051256316051 => {
4320 let responder = ::fidl_next::Responder::from_untyped(responder);
4321
4322 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4323 Ok(decoded) => {
4324 handler
4325 .on_key_event(::fidl_next::Request::from_decoded(decoded), responder)
4326 .await;
4327 Ok(())
4328 }
4329 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4330 ordinal: 3383028051256316051,
4331 error,
4332 }),
4333 }
4334 }
4335
4336 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
4337 }
4338 }
4339}
4340
4341impl<___T> KeyboardListenerClientHandler<___T> for ::fidl_next::IgnoreEvents where
4342 ___T: ::fidl_next::Transport
4343{
4344}
4345
4346impl<___H, ___T> KeyboardListenerLocalClientHandler<___T> for ::fidl_next::Local<___H>
4347where
4348 ___H: KeyboardListenerClientHandler<___T>,
4349 ___T: ::fidl_next::Transport,
4350{
4351}
4352
4353impl<___H, ___T> KeyboardListenerLocalServerHandler<___T> for ::fidl_next::Local<___H>
4354where
4355 ___H: KeyboardListenerServerHandler<___T>,
4356 ___T: ::fidl_next::Transport,
4357{
4358 async fn on_key_event(
4359 &mut self,
4360
4361 request: ::fidl_next::Request<keyboard_listener::OnKeyEvent, ___T>,
4362
4363 responder: ::fidl_next::Responder<keyboard_listener::OnKeyEvent, ___T>,
4364 ) {
4365 ___H::on_key_event(&mut self.0, request, responder).await
4366 }
4367}