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