Skip to main content

fidl_next_fuchsia_ui_pointerinjector/
fidl_next_fuchsia_ui_pointerinjector.rs

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