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        pub enum Value {
896            View(::fidl_next_fuchsia_ui_views::wire::ViewRef),
897        }
898    }
899
900    impl Context {
901        pub fn as_ref(&self) -> crate::wire::context::Ref<'_> {
902            match self.raw.ordinal() {
903                1 => crate::wire::context::Ref::View(unsafe {
904                    self.raw.get().deref_unchecked::<::fidl_next_fuchsia_ui_views::wire::ViewRef>()
905                }),
906
907                _ => unsafe { ::core::hint::unreachable_unchecked() },
908            }
909        }
910
911        pub fn into_inner(self) -> crate::wire::context::Value {
912            let this = ::core::mem::ManuallyDrop::new(self);
913
914            match this.raw.ordinal() {
915                1 => crate::wire::context::Value::View(unsafe {
916                    this.raw.get().read_unchecked::<::fidl_next_fuchsia_ui_views::wire::ViewRef>()
917                }),
918
919                _ => unsafe { ::core::hint::unreachable_unchecked() },
920            }
921        }
922    }
923
924    unsafe impl<___D> ::fidl_next::Decode<___D> for Context
925    where
926        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
927        ___D: ::fidl_next::fuchsia::HandleDecoder,
928    {
929        fn decode(
930            mut slot: ::fidl_next::Slot<'_, Self>,
931            decoder: &mut ___D,
932            _: (),
933        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
934            ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
935            match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
936                1 => ::fidl_next::wire::Union::decode_as_static::<
937                    ___D,
938                    ::fidl_next_fuchsia_ui_views::wire::ViewRef,
939                >(raw, decoder, ())?,
940
941                ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
942            }
943
944            Ok(())
945        }
946    }
947
948    impl ::core::fmt::Debug for Context {
949        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
950            match self.raw.ordinal() {
951                1 => unsafe {
952                    self.raw
953                        .get()
954                        .deref_unchecked::<::fidl_next_fuchsia_ui_views::wire::ViewRef>()
955                        .fmt(f)
956                },
957                _ => unsafe { ::core::hint::unreachable_unchecked() },
958            }
959        }
960    }
961
962    impl ::fidl_next::IntoNatural for Context {
963        type Natural = crate::natural::Context;
964    }
965
966    /// The wire type corresponding to [`Target`].
967    #[repr(transparent)]
968    pub struct Target {
969        pub(crate) raw: ::fidl_next::wire::Union,
970        pub(crate) _phantom: ::core::marker::PhantomData<()>,
971    }
972
973    impl Drop for Target {
974        fn drop(&mut self) {
975            match self.raw.ordinal() {
976                1 => {
977                    let _ = unsafe {
978                        self.raw
979                            .get()
980                            .read_unchecked::<::fidl_next_fuchsia_ui_views::wire::ViewRef>()
981                    };
982                }
983
984                _ => unsafe { ::core::hint::unreachable_unchecked() },
985            }
986        }
987    }
988
989    impl ::fidl_next::Constrained for Target {
990        type Constraint = ();
991
992        fn validate(
993            _: ::fidl_next::Slot<'_, Self>,
994            _: Self::Constraint,
995        ) -> Result<(), ::fidl_next::ValidationError> {
996            Ok(())
997        }
998    }
999
1000    unsafe impl ::fidl_next::Wire for Target {
1001        type Narrowed<'de> = Target;
1002
1003        #[inline]
1004        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1005            ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1006            ::fidl_next::wire::Union::zero_padding(raw);
1007        }
1008    }
1009
1010    pub mod target {
1011        pub enum Ref<'de> {
1012            View(&'de ::fidl_next_fuchsia_ui_views::wire::ViewRef),
1013        }
1014
1015        pub enum Value {
1016            View(::fidl_next_fuchsia_ui_views::wire::ViewRef),
1017        }
1018    }
1019
1020    impl Target {
1021        pub fn as_ref(&self) -> crate::wire::target::Ref<'_> {
1022            match self.raw.ordinal() {
1023                1 => crate::wire::target::Ref::View(unsafe {
1024                    self.raw.get().deref_unchecked::<::fidl_next_fuchsia_ui_views::wire::ViewRef>()
1025                }),
1026
1027                _ => unsafe { ::core::hint::unreachable_unchecked() },
1028            }
1029        }
1030
1031        pub fn into_inner(self) -> crate::wire::target::Value {
1032            let this = ::core::mem::ManuallyDrop::new(self);
1033
1034            match this.raw.ordinal() {
1035                1 => crate::wire::target::Value::View(unsafe {
1036                    this.raw.get().read_unchecked::<::fidl_next_fuchsia_ui_views::wire::ViewRef>()
1037                }),
1038
1039                _ => unsafe { ::core::hint::unreachable_unchecked() },
1040            }
1041        }
1042    }
1043
1044    unsafe impl<___D> ::fidl_next::Decode<___D> for Target
1045    where
1046        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1047        ___D: ::fidl_next::fuchsia::HandleDecoder,
1048    {
1049        fn decode(
1050            mut slot: ::fidl_next::Slot<'_, Self>,
1051            decoder: &mut ___D,
1052            _: (),
1053        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1054            ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1055            match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
1056                1 => ::fidl_next::wire::Union::decode_as_static::<
1057                    ___D,
1058                    ::fidl_next_fuchsia_ui_views::wire::ViewRef,
1059                >(raw, decoder, ())?,
1060
1061                ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
1062            }
1063
1064            Ok(())
1065        }
1066    }
1067
1068    impl ::core::fmt::Debug for Target {
1069        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1070            match self.raw.ordinal() {
1071                1 => unsafe {
1072                    self.raw
1073                        .get()
1074                        .deref_unchecked::<::fidl_next_fuchsia_ui_views::wire::ViewRef>()
1075                        .fmt(f)
1076                },
1077                _ => unsafe { ::core::hint::unreachable_unchecked() },
1078            }
1079        }
1080    }
1081
1082    impl ::fidl_next::IntoNatural for Target {
1083        type Natural = crate::natural::Target;
1084    }
1085
1086    /// The wire type corresponding to [`RelativeMotionRange`](crate::natural::RelativeMotionRange).
1087    pub type RelativeMotionRange = [::fidl_next_fuchsia_input_report::wire::Axis; 2];
1088
1089    /// The wire type corresponding to [`Config`].
1090    #[repr(C)]
1091    pub struct Config<'de> {
1092        pub(crate) table: ::fidl_next::wire::Table<'de>,
1093    }
1094
1095    impl<'de> Drop for Config<'de> {
1096        fn drop(&mut self) {
1097            let _ = self
1098                .table
1099                .get(1)
1100                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
1101
1102            let _ = self
1103                .table
1104                .get(2)
1105                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::DeviceType>() });
1106
1107            let _ = self
1108                .table
1109                .get(3)
1110                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Context>() });
1111
1112            let _ = self
1113                .table
1114                .get(4)
1115                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Target>() });
1116
1117            let _ = self
1118                .table
1119                .get(5)
1120                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Viewport<'de>>() });
1121
1122            let _ = self.table.get(6).map(|envelope| unsafe {
1123                envelope.read_unchecked::<crate::wire::DispatchPolicy>()
1124            });
1125
1126            let _ = self.table.get(7).map(|envelope| unsafe {
1127                envelope.read_unchecked::<::fidl_next_fuchsia_input_report::wire::Axis>()
1128            });
1129
1130            let _ = self.table.get(8).map(|envelope| unsafe {
1131                envelope.read_unchecked::<::fidl_next_fuchsia_input_report::wire::Axis>()
1132            });
1133
1134            let _ = self.table.get(9).map(|envelope| unsafe {
1135                envelope.read_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
1136            });
1137
1138            let _ = self.table.get(10).map(|envelope| unsafe {
1139                envelope.read_unchecked::<[::fidl_next_fuchsia_input_report::wire::Axis; 2]>()
1140            });
1141        }
1142    }
1143
1144    impl ::fidl_next::Constrained for Config<'_> {
1145        type Constraint = ();
1146
1147        fn validate(
1148            _: ::fidl_next::Slot<'_, Self>,
1149            _: Self::Constraint,
1150        ) -> Result<(), ::fidl_next::ValidationError> {
1151            Ok(())
1152        }
1153    }
1154
1155    unsafe impl ::fidl_next::Wire for Config<'static> {
1156        type Narrowed<'de> = Config<'de>;
1157
1158        #[inline]
1159        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1160            ::fidl_next::munge!(let Self { table } = out);
1161            ::fidl_next::wire::Table::zero_padding(table);
1162        }
1163    }
1164
1165    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Config<'de>
1166    where
1167        ___D: ::fidl_next::Decoder<'de> + ?Sized,
1168        ___D: ::fidl_next::fuchsia::HandleDecoder,
1169    {
1170        fn decode(
1171            slot: ::fidl_next::Slot<'_, Self>,
1172            decoder: &mut ___D,
1173            _: (),
1174        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1175            ::fidl_next::munge!(let Self { table } = slot);
1176
1177            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1178                match ordinal {
1179                    0 => unsafe { ::core::hint::unreachable_unchecked() },
1180
1181                    1 => {
1182                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
1183                            slot.as_mut(),
1184                            decoder,
1185                            (),
1186                        )?;
1187
1188                        Ok(())
1189                    }
1190
1191                    2 => {
1192                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DeviceType>(
1193                            slot.as_mut(),
1194                            decoder,
1195                            (),
1196                        )?;
1197
1198                        Ok(())
1199                    }
1200
1201                    3 => {
1202                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Context>(
1203                            slot.as_mut(),
1204                            decoder,
1205                            (),
1206                        )?;
1207
1208                        Ok(())
1209                    }
1210
1211                    4 => {
1212                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Target>(
1213                            slot.as_mut(),
1214                            decoder,
1215                            (),
1216                        )?;
1217
1218                        Ok(())
1219                    }
1220
1221                    5 => {
1222                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Viewport<'de>>(
1223                            slot.as_mut(),
1224                            decoder,
1225                            (),
1226                        )?;
1227
1228                        Ok(())
1229                    }
1230
1231                    6 => {
1232                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DispatchPolicy>(
1233                            slot.as_mut(),
1234                            decoder,
1235                            (),
1236                        )?;
1237
1238                        Ok(())
1239                    }
1240
1241                    7 => {
1242                        ::fidl_next::wire::Envelope::decode_as::<
1243                            ___D,
1244                            ::fidl_next_fuchsia_input_report::wire::Axis,
1245                        >(slot.as_mut(), decoder, ())?;
1246
1247                        Ok(())
1248                    }
1249
1250                    8 => {
1251                        ::fidl_next::wire::Envelope::decode_as::<
1252                            ___D,
1253                            ::fidl_next_fuchsia_input_report::wire::Axis,
1254                        >(slot.as_mut(), decoder, ())?;
1255
1256                        Ok(())
1257                    }
1258
1259                    9 => {
1260                        ::fidl_next::wire::Envelope::decode_as::<
1261                            ___D,
1262                            ::fidl_next::wire::Vector<'de, u8>,
1263                        >(slot.as_mut(), decoder, (32, ()))?;
1264
1265                        let value = unsafe {
1266                            slot.deref_unchecked()
1267                                .deref_unchecked::<::fidl_next::wire::Vector<'_, u8>>()
1268                        };
1269
1270                        if value.len() > 32 {
1271                            return Err(::fidl_next::DecodeError::VectorTooLong {
1272                                size: value.len() as u64,
1273                                limit: 32,
1274                            });
1275                        }
1276
1277                        Ok(())
1278                    }
1279
1280                    10 => {
1281                        ::fidl_next::wire::Envelope::decode_as::<
1282                            ___D,
1283                            [::fidl_next_fuchsia_input_report::wire::Axis; 2],
1284                        >(slot.as_mut(), decoder, ())?;
1285
1286                        Ok(())
1287                    }
1288
1289                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1290                }
1291            })
1292        }
1293    }
1294
1295    impl<'de> Config<'de> {
1296        pub fn device_id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
1297            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1298        }
1299
1300        pub fn take_device_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint32> {
1301            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1302        }
1303
1304        pub fn device_type(&self) -> ::core::option::Option<&crate::wire::DeviceType> {
1305            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1306        }
1307
1308        pub fn take_device_type(&mut self) -> ::core::option::Option<crate::wire::DeviceType> {
1309            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
1310        }
1311
1312        pub fn context(&self) -> ::core::option::Option<&crate::wire::Context> {
1313            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
1314        }
1315
1316        pub fn take_context(&mut self) -> ::core::option::Option<crate::wire::Context> {
1317            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
1318        }
1319
1320        pub fn target(&self) -> ::core::option::Option<&crate::wire::Target> {
1321            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
1322        }
1323
1324        pub fn take_target(&mut self) -> ::core::option::Option<crate::wire::Target> {
1325            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
1326        }
1327
1328        pub fn viewport(&self) -> ::core::option::Option<&crate::wire::Viewport<'de>> {
1329            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
1330        }
1331
1332        pub fn take_viewport(&mut self) -> ::core::option::Option<crate::wire::Viewport<'de>> {
1333            unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
1334        }
1335
1336        pub fn dispatch_policy(&self) -> ::core::option::Option<&crate::wire::DispatchPolicy> {
1337            unsafe { Some(self.table.get(6)?.deref_unchecked()) }
1338        }
1339
1340        pub fn take_dispatch_policy(
1341            &mut self,
1342        ) -> ::core::option::Option<crate::wire::DispatchPolicy> {
1343            unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
1344        }
1345
1346        pub fn scroll_v_range(
1347            &self,
1348        ) -> ::core::option::Option<&::fidl_next_fuchsia_input_report::wire::Axis> {
1349            unsafe { Some(self.table.get(7)?.deref_unchecked()) }
1350        }
1351
1352        pub fn take_scroll_v_range(
1353            &mut self,
1354        ) -> ::core::option::Option<::fidl_next_fuchsia_input_report::wire::Axis> {
1355            unsafe { Some(self.table.get_mut(7)?.take_unchecked()) }
1356        }
1357
1358        pub fn scroll_h_range(
1359            &self,
1360        ) -> ::core::option::Option<&::fidl_next_fuchsia_input_report::wire::Axis> {
1361            unsafe { Some(self.table.get(8)?.deref_unchecked()) }
1362        }
1363
1364        pub fn take_scroll_h_range(
1365            &mut self,
1366        ) -> ::core::option::Option<::fidl_next_fuchsia_input_report::wire::Axis> {
1367            unsafe { Some(self.table.get_mut(8)?.take_unchecked()) }
1368        }
1369
1370        pub fn buttons(&self) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, u8>> {
1371            unsafe { Some(self.table.get(9)?.deref_unchecked()) }
1372        }
1373
1374        pub fn take_buttons(
1375            &mut self,
1376        ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, u8>> {
1377            unsafe { Some(self.table.get_mut(9)?.take_unchecked()) }
1378        }
1379
1380        pub fn relative_motion_range(
1381            &self,
1382        ) -> ::core::option::Option<&[::fidl_next_fuchsia_input_report::wire::Axis; 2]> {
1383            unsafe { Some(self.table.get(10)?.deref_unchecked()) }
1384        }
1385
1386        pub fn take_relative_motion_range(
1387            &mut self,
1388        ) -> ::core::option::Option<[::fidl_next_fuchsia_input_report::wire::Axis; 2]> {
1389            unsafe { Some(self.table.get_mut(10)?.take_unchecked()) }
1390        }
1391    }
1392
1393    impl<'de> ::core::fmt::Debug for Config<'de> {
1394        fn fmt(
1395            &self,
1396            f: &mut ::core::fmt::Formatter<'_>,
1397        ) -> ::core::result::Result<(), ::core::fmt::Error> {
1398            f.debug_struct("Config")
1399                .field("device_id", &self.device_id())
1400                .field("device_type", &self.device_type())
1401                .field("context", &self.context())
1402                .field("target", &self.target())
1403                .field("viewport", &self.viewport())
1404                .field("dispatch_policy", &self.dispatch_policy())
1405                .field("scroll_v_range", &self.scroll_v_range())
1406                .field("scroll_h_range", &self.scroll_h_range())
1407                .field("buttons", &self.buttons())
1408                .field("relative_motion_range", &self.relative_motion_range())
1409                .finish()
1410        }
1411    }
1412
1413    impl<'de> ::fidl_next::IntoNatural for Config<'de> {
1414        type Natural = crate::natural::Config;
1415    }
1416
1417    /// The wire type corresponding to [`Event`].
1418    #[repr(C)]
1419    pub struct Event<'de> {
1420        pub(crate) table: ::fidl_next::wire::Table<'de>,
1421    }
1422
1423    impl<'de> Drop for Event<'de> {
1424        fn drop(&mut self) {
1425            let _ = self
1426                .table
1427                .get(1)
1428                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Int64>() });
1429
1430            let _ = self
1431                .table
1432                .get(2)
1433                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Data<'de>>() });
1434
1435            let _ = self
1436                .table
1437                .get(3)
1438                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
1439
1440            let _ = self.table.get(4).map(|envelope| unsafe {
1441                envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
1442            });
1443        }
1444    }
1445
1446    impl ::fidl_next::Constrained for Event<'_> {
1447        type Constraint = ();
1448
1449        fn validate(
1450            _: ::fidl_next::Slot<'_, Self>,
1451            _: Self::Constraint,
1452        ) -> Result<(), ::fidl_next::ValidationError> {
1453            Ok(())
1454        }
1455    }
1456
1457    unsafe impl ::fidl_next::Wire for Event<'static> {
1458        type Narrowed<'de> = Event<'de>;
1459
1460        #[inline]
1461        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1462            ::fidl_next::munge!(let Self { table } = out);
1463            ::fidl_next::wire::Table::zero_padding(table);
1464        }
1465    }
1466
1467    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Event<'de>
1468    where
1469        ___D: ::fidl_next::Decoder<'de> + ?Sized,
1470        ___D: ::fidl_next::fuchsia::HandleDecoder,
1471    {
1472        fn decode(
1473            slot: ::fidl_next::Slot<'_, Self>,
1474            decoder: &mut ___D,
1475            _: (),
1476        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1477            ::fidl_next::munge!(let Self { table } = slot);
1478
1479            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1480                match ordinal {
1481                    0 => unsafe { ::core::hint::unreachable_unchecked() },
1482
1483                    1 => {
1484                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Int64>(
1485                            slot.as_mut(),
1486                            decoder,
1487                            (),
1488                        )?;
1489
1490                        Ok(())
1491                    }
1492
1493                    2 => {
1494                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Data<'de>>(
1495                            slot.as_mut(),
1496                            decoder,
1497                            (),
1498                        )?;
1499
1500                        Ok(())
1501                    }
1502
1503                    3 => {
1504                        ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
1505                            slot.as_mut(),
1506                            decoder,
1507                            (),
1508                        )?;
1509
1510                        Ok(())
1511                    }
1512
1513                    4 => {
1514                        ::fidl_next::wire::Envelope::decode_as::<
1515                            ___D,
1516                            ::fidl_next::wire::fuchsia::EventPair,
1517                        >(slot.as_mut(), decoder, ())?;
1518
1519                        Ok(())
1520                    }
1521
1522                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1523                }
1524            })
1525        }
1526    }
1527
1528    impl<'de> Event<'de> {
1529        pub fn timestamp(&self) -> ::core::option::Option<&::fidl_next::wire::Int64> {
1530            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1531        }
1532
1533        pub fn take_timestamp(&mut self) -> ::core::option::Option<::fidl_next::wire::Int64> {
1534            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1535        }
1536
1537        pub fn data(&self) -> ::core::option::Option<&crate::wire::Data<'de>> {
1538            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1539        }
1540
1541        pub fn take_data(&mut self) -> ::core::option::Option<crate::wire::Data<'de>> {
1542            unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
1543        }
1544
1545        pub fn trace_flow_id(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
1546            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
1547        }
1548
1549        pub fn take_trace_flow_id(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
1550            unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
1551        }
1552
1553        pub fn wake_lease(&self) -> ::core::option::Option<&::fidl_next::wire::fuchsia::EventPair> {
1554            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
1555        }
1556
1557        pub fn take_wake_lease(
1558            &mut self,
1559        ) -> ::core::option::Option<::fidl_next::wire::fuchsia::EventPair> {
1560            unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
1561        }
1562    }
1563
1564    impl<'de> ::core::fmt::Debug for Event<'de> {
1565        fn fmt(
1566            &self,
1567            f: &mut ::core::fmt::Formatter<'_>,
1568        ) -> ::core::result::Result<(), ::core::fmt::Error> {
1569            f.debug_struct("Event")
1570                .field("timestamp", &self.timestamp())
1571                .field("data", &self.data())
1572                .field("trace_flow_id", &self.trace_flow_id())
1573                .field("wake_lease", &self.wake_lease())
1574                .finish()
1575        }
1576    }
1577
1578    impl<'de> ::fidl_next::IntoNatural for Event<'de> {
1579        type Natural = crate::natural::Event;
1580    }
1581
1582    /// The wire type corresponding to [`DeviceInjectRequest`].
1583    #[derive(Debug)]
1584    #[repr(C)]
1585    pub struct DeviceInjectRequest<'de> {
1586        pub events: ::fidl_next::wire::Vector<'de, crate::wire::Event<'de>>,
1587    }
1588
1589    static_assertions::const_assert_eq!(std::mem::size_of::<DeviceInjectRequest<'_>>(), 16);
1590    static_assertions::const_assert_eq!(std::mem::align_of::<DeviceInjectRequest<'_>>(), 8);
1591
1592    static_assertions::const_assert_eq!(std::mem::offset_of!(DeviceInjectRequest<'_>, events), 0);
1593
1594    impl ::fidl_next::Constrained for DeviceInjectRequest<'_> {
1595        type Constraint = ();
1596
1597        fn validate(
1598            _: ::fidl_next::Slot<'_, Self>,
1599            _: Self::Constraint,
1600        ) -> Result<(), ::fidl_next::ValidationError> {
1601            Ok(())
1602        }
1603    }
1604
1605    unsafe impl ::fidl_next::Wire for DeviceInjectRequest<'static> {
1606        type Narrowed<'de> = DeviceInjectRequest<'de>;
1607
1608        #[inline]
1609        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1610            ::fidl_next::munge! {
1611                let Self {
1612                    events,
1613
1614                } = &mut *out_;
1615            }
1616
1617            ::fidl_next::Wire::zero_padding(events);
1618        }
1619    }
1620
1621    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DeviceInjectRequest<'de>
1622    where
1623        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1624        ___D: ::fidl_next::Decoder<'de>,
1625        ___D: ::fidl_next::fuchsia::HandleDecoder,
1626    {
1627        fn decode(
1628            slot_: ::fidl_next::Slot<'_, Self>,
1629            decoder_: &mut ___D,
1630            _: (),
1631        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1632            ::fidl_next::munge! {
1633                let Self {
1634                    mut events,
1635
1636                } = slot_;
1637            }
1638
1639            let _field = events.as_mut();
1640            ::fidl_next::Constrained::validate(_field, (128, ()))?;
1641            ::fidl_next::Decode::decode(events.as_mut(), decoder_, (128, ()))?;
1642
1643            let events = unsafe { events.deref_unchecked() };
1644
1645            if events.len() > 128 {
1646                return Err(::fidl_next::DecodeError::VectorTooLong {
1647                    size: events.len() as u64,
1648                    limit: 128,
1649                });
1650            }
1651
1652            Ok(())
1653        }
1654    }
1655
1656    impl<'de> ::fidl_next::IntoNatural for DeviceInjectRequest<'de> {
1657        type Natural = crate::natural::DeviceInjectRequest;
1658    }
1659
1660    /// The wire type corresponding to [`RegistryRegisterRequest`].
1661    #[derive(Debug)]
1662    #[repr(C)]
1663    pub struct RegistryRegisterRequest<'de> {
1664        pub config: crate::wire::Config<'de>,
1665
1666        pub injector: ::fidl_next::ServerEnd<crate::Device, ::fidl_next::wire::fuchsia::Channel>,
1667    }
1668
1669    static_assertions::const_assert_eq!(std::mem::size_of::<RegistryRegisterRequest<'_>>(), 24);
1670    static_assertions::const_assert_eq!(std::mem::align_of::<RegistryRegisterRequest<'_>>(), 8);
1671
1672    static_assertions::const_assert_eq!(
1673        std::mem::offset_of!(RegistryRegisterRequest<'_>, config),
1674        0
1675    );
1676
1677    static_assertions::const_assert_eq!(
1678        std::mem::offset_of!(RegistryRegisterRequest<'_>, injector),
1679        16
1680    );
1681
1682    impl ::fidl_next::Constrained for RegistryRegisterRequest<'_> {
1683        type Constraint = ();
1684
1685        fn validate(
1686            _: ::fidl_next::Slot<'_, Self>,
1687            _: Self::Constraint,
1688        ) -> Result<(), ::fidl_next::ValidationError> {
1689            Ok(())
1690        }
1691    }
1692
1693    unsafe impl ::fidl_next::Wire for RegistryRegisterRequest<'static> {
1694        type Narrowed<'de> = RegistryRegisterRequest<'de>;
1695
1696        #[inline]
1697        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1698            ::fidl_next::munge! {
1699                let Self {
1700                    config,
1701                    injector,
1702
1703                } = &mut *out_;
1704            }
1705
1706            ::fidl_next::Wire::zero_padding(config);
1707
1708            ::fidl_next::Wire::zero_padding(injector);
1709
1710            unsafe {
1711                out_.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
1712            }
1713        }
1714    }
1715
1716    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for RegistryRegisterRequest<'de>
1717    where
1718        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1719        ___D: ::fidl_next::Decoder<'de>,
1720        ___D: ::fidl_next::fuchsia::HandleDecoder,
1721    {
1722        fn decode(
1723            slot_: ::fidl_next::Slot<'_, Self>,
1724            decoder_: &mut ___D,
1725            _: (),
1726        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1727            if slot_.as_bytes()[20..24] != [0u8; 4] {
1728                return Err(::fidl_next::DecodeError::InvalidPadding);
1729            }
1730
1731            ::fidl_next::munge! {
1732                let Self {
1733                    mut config,
1734                    mut injector,
1735
1736                } = slot_;
1737            }
1738
1739            let _field = config.as_mut();
1740
1741            ::fidl_next::Decode::decode(config.as_mut(), decoder_, ())?;
1742
1743            let _field = injector.as_mut();
1744
1745            ::fidl_next::Decode::decode(injector.as_mut(), decoder_, ())?;
1746
1747            Ok(())
1748        }
1749    }
1750
1751    impl<'de> ::fidl_next::IntoNatural for RegistryRegisterRequest<'de> {
1752        type Natural = crate::natural::RegistryRegisterRequest;
1753    }
1754}
1755
1756pub mod wire_optional {
1757
1758    pub use fidl_next_common_fuchsia_ui_pointerinjector::wire_optional::*;
1759
1760    #[repr(transparent)]
1761    pub struct Context {
1762        pub(crate) raw: ::fidl_next::wire::Union,
1763        pub(crate) _phantom: ::core::marker::PhantomData<()>,
1764    }
1765
1766    impl ::fidl_next::Constrained for Context {
1767        type Constraint = ();
1768
1769        fn validate(
1770            _: ::fidl_next::Slot<'_, Self>,
1771            _: Self::Constraint,
1772        ) -> Result<(), ::fidl_next::ValidationError> {
1773            Ok(())
1774        }
1775    }
1776
1777    unsafe impl ::fidl_next::Wire for Context {
1778        type Narrowed<'de> = Context;
1779
1780        #[inline]
1781        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1782            ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1783            ::fidl_next::wire::Union::zero_padding(raw);
1784        }
1785    }
1786
1787    impl Context {
1788        pub fn is_some(&self) -> bool {
1789            self.raw.is_some()
1790        }
1791
1792        pub fn is_none(&self) -> bool {
1793            self.raw.is_none()
1794        }
1795
1796        pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Context> {
1797            if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
1798        }
1799
1800        pub fn into_option(self) -> ::core::option::Option<crate::wire::Context> {
1801            if self.is_some() {
1802                Some(crate::wire::Context { raw: self.raw, _phantom: ::core::marker::PhantomData })
1803            } else {
1804                None
1805            }
1806        }
1807    }
1808
1809    unsafe impl<___D> ::fidl_next::Decode<___D> for Context
1810    where
1811        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1812        ___D: ::fidl_next::fuchsia::HandleDecoder,
1813    {
1814        fn decode(
1815            mut slot: ::fidl_next::Slot<'_, Self>,
1816            decoder: &mut ___D,
1817            _: (),
1818        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1819            ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1820            match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
1821                1 => ::fidl_next::wire::Union::decode_as_static::<
1822                    ___D,
1823                    ::fidl_next_fuchsia_ui_views::wire::ViewRef,
1824                >(raw, decoder, ())?,
1825
1826                0 => ::fidl_next::wire::Union::decode_absent(raw)?,
1827                _ => ::fidl_next::wire::Union::decode_unknown_static(raw, decoder)?,
1828            }
1829
1830            Ok(())
1831        }
1832    }
1833
1834    impl ::core::fmt::Debug for Context {
1835        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1836            self.as_ref().fmt(f)
1837        }
1838    }
1839
1840    impl ::fidl_next::IntoNatural for Context {
1841        type Natural = ::core::option::Option<crate::natural::Context>;
1842    }
1843
1844    #[repr(transparent)]
1845    pub struct Target {
1846        pub(crate) raw: ::fidl_next::wire::Union,
1847        pub(crate) _phantom: ::core::marker::PhantomData<()>,
1848    }
1849
1850    impl ::fidl_next::Constrained for Target {
1851        type Constraint = ();
1852
1853        fn validate(
1854            _: ::fidl_next::Slot<'_, Self>,
1855            _: Self::Constraint,
1856        ) -> Result<(), ::fidl_next::ValidationError> {
1857            Ok(())
1858        }
1859    }
1860
1861    unsafe impl ::fidl_next::Wire for Target {
1862        type Narrowed<'de> = Target;
1863
1864        #[inline]
1865        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1866            ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1867            ::fidl_next::wire::Union::zero_padding(raw);
1868        }
1869    }
1870
1871    impl Target {
1872        pub fn is_some(&self) -> bool {
1873            self.raw.is_some()
1874        }
1875
1876        pub fn is_none(&self) -> bool {
1877            self.raw.is_none()
1878        }
1879
1880        pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Target> {
1881            if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
1882        }
1883
1884        pub fn into_option(self) -> ::core::option::Option<crate::wire::Target> {
1885            if self.is_some() {
1886                Some(crate::wire::Target { raw: self.raw, _phantom: ::core::marker::PhantomData })
1887            } else {
1888                None
1889            }
1890        }
1891    }
1892
1893    unsafe impl<___D> ::fidl_next::Decode<___D> for Target
1894    where
1895        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1896        ___D: ::fidl_next::fuchsia::HandleDecoder,
1897    {
1898        fn decode(
1899            mut slot: ::fidl_next::Slot<'_, Self>,
1900            decoder: &mut ___D,
1901            _: (),
1902        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1903            ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1904            match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
1905                1 => ::fidl_next::wire::Union::decode_as_static::<
1906                    ___D,
1907                    ::fidl_next_fuchsia_ui_views::wire::ViewRef,
1908                >(raw, decoder, ())?,
1909
1910                0 => ::fidl_next::wire::Union::decode_absent(raw)?,
1911                _ => ::fidl_next::wire::Union::decode_unknown_static(raw, decoder)?,
1912            }
1913
1914            Ok(())
1915        }
1916    }
1917
1918    impl ::core::fmt::Debug for Target {
1919        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1920            self.as_ref().fmt(f)
1921        }
1922    }
1923
1924    impl ::fidl_next::IntoNatural for Target {
1925        type Natural = ::core::option::Option<crate::natural::Target>;
1926    }
1927}
1928
1929pub mod generic {
1930
1931    pub use fidl_next_common_fuchsia_ui_pointerinjector::generic::*;
1932
1933    /// The generic type corresponding to [`DeviceInjectRequest`].
1934    pub struct DeviceInjectRequest<T0> {
1935        pub events: T0,
1936    }
1937
1938    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceInjectRequest<'static>, ___E>
1939        for DeviceInjectRequest<T0>
1940    where
1941        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1942        ___E: ::fidl_next::Encoder,
1943        ___E: ::fidl_next::fuchsia::HandleEncoder,
1944        T0: ::fidl_next::Encode<
1945                ::fidl_next::wire::Vector<'static, crate::wire::Event<'static>>,
1946                ___E,
1947            >,
1948    {
1949        #[inline]
1950        fn encode(
1951            self,
1952            encoder_: &mut ___E,
1953            out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceInjectRequest<'static>>,
1954            _: (),
1955        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1956            ::fidl_next::munge! {
1957                let crate::wire::DeviceInjectRequest {
1958                    events,
1959
1960                } = out_;
1961            }
1962
1963            ::fidl_next::Encode::encode(self.events, encoder_, events, (128, ()))?;
1964
1965            Ok(())
1966        }
1967    }
1968
1969    /// The generic type corresponding to [`RegistryRegisterRequest`].
1970    pub struct RegistryRegisterRequest<T0, T1> {
1971        pub config: T0,
1972
1973        pub injector: T1,
1974    }
1975
1976    unsafe impl<___E, T0, T1>
1977        ::fidl_next::Encode<crate::wire::RegistryRegisterRequest<'static>, ___E>
1978        for RegistryRegisterRequest<T0, T1>
1979    where
1980        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1981        ___E: ::fidl_next::Encoder,
1982        ___E: ::fidl_next::fuchsia::HandleEncoder,
1983        T0: ::fidl_next::Encode<crate::wire::Config<'static>, ___E>,
1984        T1: ::fidl_next::Encode<
1985                ::fidl_next::ServerEnd<crate::Device, ::fidl_next::wire::fuchsia::Channel>,
1986                ___E,
1987            >,
1988    {
1989        #[inline]
1990        fn encode(
1991            self,
1992            encoder_: &mut ___E,
1993            out_: &mut ::core::mem::MaybeUninit<crate::wire::RegistryRegisterRequest<'static>>,
1994            _: (),
1995        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1996            ::fidl_next::munge! {
1997                let crate::wire::RegistryRegisterRequest {
1998                    config,
1999                    injector,
2000
2001                } = out_;
2002            }
2003
2004            ::fidl_next::Encode::encode(self.config, encoder_, config, ())?;
2005
2006            ::fidl_next::Encode::encode(self.injector, encoder_, injector, ())?;
2007
2008            Ok(())
2009        }
2010    }
2011}
2012
2013pub use self::natural::*;
2014
2015/// The type corresponding to the Device protocol.
2016#[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"]
2017#[derive(PartialEq, Debug)]
2018pub struct Device;
2019
2020impl ::fidl_next::Discoverable for Device {
2021    const PROTOCOL_NAME: &'static str = "fuchsia.ui.pointerinjector.Device";
2022}
2023
2024#[cfg(target_os = "fuchsia")]
2025impl ::fidl_next::HasTransport for Device {
2026    type Transport = ::fidl_next::fuchsia::zx::Channel;
2027}
2028
2029pub mod device {
2030    pub mod prelude {
2031        pub use crate::{
2032            Device, DeviceClientHandler, DeviceLocalClientHandler, DeviceLocalServerHandler,
2033            DeviceServerHandler, device,
2034        };
2035
2036        pub use crate::natural::DeviceInjectRequest;
2037    }
2038
2039    pub struct Inject;
2040
2041    impl ::fidl_next::Method for Inject {
2042        const ORDINAL: u64 = 82058939547254592;
2043        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2044            ::fidl_next::protocol::Flexibility::Strict;
2045
2046        type Protocol = crate::Device;
2047
2048        type Request = crate::wire::DeviceInjectRequest<'static>;
2049    }
2050
2051    impl ::fidl_next::TwoWayMethod for Inject {
2052        type Response = ::fidl_next::wire::Strict<::fidl_next::wire::EmptyMessageBody>;
2053    }
2054
2055    impl<___R> ::fidl_next::Respond<___R> for Inject {
2056        type Output = ::fidl_next::Strict<___R>;
2057
2058        fn respond(response: ___R) -> Self::Output {
2059            ::fidl_next::Strict(response)
2060        }
2061    }
2062
2063    pub struct InjectEvents;
2064
2065    impl ::fidl_next::Method for InjectEvents {
2066        const ORDINAL: u64 = 6172664453086451255;
2067        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2068            ::fidl_next::protocol::Flexibility::Strict;
2069
2070        type Protocol = crate::Device;
2071
2072        type Request = crate::wire::DeviceInjectRequest<'static>;
2073    }
2074
2075    mod ___detail {
2076        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Device
2077        where
2078            ___T: ::fidl_next::Transport,
2079        {
2080            type Client = DeviceClient<___T>;
2081            type Server = DeviceServer<___T>;
2082        }
2083
2084        /// The client for the `Device` protocol.
2085        #[repr(transparent)]
2086        pub struct DeviceClient<___T: ::fidl_next::Transport> {
2087            #[allow(dead_code)]
2088            client: ::fidl_next::protocol::Client<___T>,
2089        }
2090
2091        impl<___T> DeviceClient<___T>
2092        where
2093            ___T: ::fidl_next::Transport,
2094        {
2095            #[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"]
2096            pub fn inject(
2097                &self,
2098
2099                events: impl ::fidl_next::Encode<
2100                    ::fidl_next::wire::Vector<'static, crate::wire::Event<'static>>,
2101                    <___T as ::fidl_next::Transport>::SendBuffer,
2102                >,
2103            ) -> ::fidl_next::TwoWayFuture<'_, super::Inject, ___T>
2104            where
2105                <___T as ::fidl_next::Transport>::SendBuffer:
2106                    ::fidl_next::encoder::InternalHandleEncoder,
2107                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2108                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2109            {
2110                self.inject_with(crate::generic::DeviceInjectRequest { events })
2111            }
2112
2113            #[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"]
2114            pub fn inject_with<___R>(
2115                &self,
2116                request: ___R,
2117            ) -> ::fidl_next::TwoWayFuture<'_, super::Inject, ___T>
2118            where
2119                ___R: ::fidl_next::Encode<
2120                        crate::wire::DeviceInjectRequest<'static>,
2121                        <___T as ::fidl_next::Transport>::SendBuffer,
2122                    >,
2123            {
2124                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2125                    82058939547254592,
2126                    <super::Inject as ::fidl_next::Method>::FLEXIBILITY,
2127                    request,
2128                ))
2129            }
2130
2131            #[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"]
2132            pub fn inject_events(
2133                &self,
2134
2135                events: impl ::fidl_next::Encode<
2136                    ::fidl_next::wire::Vector<'static, crate::wire::Event<'static>>,
2137                    <___T as ::fidl_next::Transport>::SendBuffer,
2138                >,
2139            ) -> ::fidl_next::SendFuture<'_, ___T>
2140            where
2141                <___T as ::fidl_next::Transport>::SendBuffer:
2142                    ::fidl_next::encoder::InternalHandleEncoder,
2143                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2144                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2145            {
2146                self.inject_events_with(crate::generic::DeviceInjectRequest { events })
2147            }
2148
2149            #[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"]
2150            pub fn inject_events_with<___R>(
2151                &self,
2152                request: ___R,
2153            ) -> ::fidl_next::SendFuture<'_, ___T>
2154            where
2155                ___R: ::fidl_next::Encode<
2156                        crate::wire::DeviceInjectRequest<'static>,
2157                        <___T as ::fidl_next::Transport>::SendBuffer,
2158                    >,
2159            {
2160                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
2161                    6172664453086451255,
2162                    <super::InjectEvents as ::fidl_next::Method>::FLEXIBILITY,
2163                    request,
2164                ))
2165            }
2166        }
2167
2168        /// The server for the `Device` protocol.
2169        #[repr(transparent)]
2170        pub struct DeviceServer<___T: ::fidl_next::Transport> {
2171            server: ::fidl_next::protocol::Server<___T>,
2172        }
2173
2174        impl<___T> DeviceServer<___T> where ___T: ::fidl_next::Transport {}
2175    }
2176}
2177
2178#[diagnostic::on_unimplemented(
2179    note = "If {Self} implements the non-local DeviceClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2180)]
2181
2182/// A client handler for the Device protocol.
2183///
2184/// See [`Device`] for more details.
2185pub trait DeviceLocalClientHandler<
2186    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2187    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2188>
2189{
2190}
2191
2192impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Device
2193where
2194    ___H: DeviceLocalClientHandler<___T>,
2195    ___T: ::fidl_next::Transport,
2196{
2197    async fn on_event(
2198        handler: &mut ___H,
2199        mut message: ::fidl_next::Message<___T>,
2200    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2201        match *message.header().ordinal {
2202            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2203        }
2204    }
2205}
2206
2207#[diagnostic::on_unimplemented(
2208    note = "If {Self} implements the non-local DeviceServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2209)]
2210
2211/// A server handler for the Device protocol.
2212///
2213/// See [`Device`] for more details.
2214pub trait DeviceLocalServerHandler<
2215    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2216    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2217>
2218{
2219    #[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"]
2220    fn inject(
2221        &mut self,
2222
2223        request: ::fidl_next::Request<device::Inject, ___T>,
2224
2225        responder: ::fidl_next::Responder<device::Inject, ___T>,
2226    ) -> impl ::core::future::Future<Output = ()>;
2227
2228    #[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"]
2229    fn inject_events(
2230        &mut self,
2231
2232        request: ::fidl_next::Request<device::InjectEvents, ___T>,
2233    ) -> impl ::core::future::Future<Output = ()>;
2234}
2235
2236impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Device
2237where
2238    ___H: DeviceLocalServerHandler<___T>,
2239    ___T: ::fidl_next::Transport,
2240    for<'de> crate::wire::DeviceInjectRequest<'de>: ::fidl_next::Decode<
2241            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2242            Constraint = (),
2243        >,
2244    for<'de> crate::wire::DeviceInjectRequest<'de>: ::fidl_next::Decode<
2245            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2246            Constraint = (),
2247        >,
2248{
2249    async fn on_one_way(
2250        handler: &mut ___H,
2251        mut message: ::fidl_next::Message<___T>,
2252    ) -> ::core::result::Result<
2253        (),
2254        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2255    > {
2256        match *message.header().ordinal {
2257            6172664453086451255 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
2258                Ok(decoded) => {
2259                    handler.inject_events(::fidl_next::Request::from_decoded(decoded)).await;
2260                    Ok(())
2261                }
2262                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2263                    ordinal: 6172664453086451255,
2264                    error,
2265                }),
2266            },
2267
2268            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2269        }
2270    }
2271
2272    async fn on_two_way(
2273        handler: &mut ___H,
2274        mut message: ::fidl_next::Message<___T>,
2275        responder: ::fidl_next::protocol::Responder<___T>,
2276    ) -> ::core::result::Result<
2277        (),
2278        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2279    > {
2280        match *message.header().ordinal {
2281            82058939547254592 => {
2282                let responder = ::fidl_next::Responder::from_untyped(responder);
2283
2284                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2285                    Ok(decoded) => {
2286                        handler
2287                            .inject(::fidl_next::Request::from_decoded(decoded), responder)
2288                            .await;
2289                        Ok(())
2290                    }
2291                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2292                        ordinal: 82058939547254592,
2293                        error,
2294                    }),
2295                }
2296            }
2297
2298            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2299        }
2300    }
2301}
2302
2303/// A client handler for the Device protocol.
2304///
2305/// See [`Device`] for more details.
2306pub trait DeviceClientHandler<
2307    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2308    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2309>
2310{
2311}
2312
2313impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Device
2314where
2315    ___H: DeviceClientHandler<___T> + ::core::marker::Send,
2316    ___T: ::fidl_next::Transport,
2317{
2318    async fn on_event(
2319        handler: &mut ___H,
2320        mut message: ::fidl_next::Message<___T>,
2321    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2322        match *message.header().ordinal {
2323            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2324        }
2325    }
2326}
2327
2328/// A server handler for the Device protocol.
2329///
2330/// See [`Device`] for more details.
2331pub trait DeviceServerHandler<
2332    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2333    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2334>
2335{
2336    #[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"]
2337    fn inject(
2338        &mut self,
2339
2340        request: ::fidl_next::Request<device::Inject, ___T>,
2341
2342        responder: ::fidl_next::Responder<device::Inject, ___T>,
2343    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2344
2345    #[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"]
2346    fn inject_events(
2347        &mut self,
2348
2349        request: ::fidl_next::Request<device::InjectEvents, ___T>,
2350    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2351}
2352
2353impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Device
2354where
2355    ___H: DeviceServerHandler<___T> + ::core::marker::Send,
2356    ___T: ::fidl_next::Transport,
2357    for<'de> crate::wire::DeviceInjectRequest<'de>: ::fidl_next::Decode<
2358            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2359            Constraint = (),
2360        >,
2361    for<'de> crate::wire::DeviceInjectRequest<'de>: ::fidl_next::Decode<
2362            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2363            Constraint = (),
2364        >,
2365{
2366    async fn on_one_way(
2367        handler: &mut ___H,
2368        mut message: ::fidl_next::Message<___T>,
2369    ) -> ::core::result::Result<
2370        (),
2371        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2372    > {
2373        match *message.header().ordinal {
2374            6172664453086451255 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
2375                Ok(decoded) => {
2376                    handler.inject_events(::fidl_next::Request::from_decoded(decoded)).await;
2377                    Ok(())
2378                }
2379                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2380                    ordinal: 6172664453086451255,
2381                    error,
2382                }),
2383            },
2384
2385            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2386        }
2387    }
2388
2389    async fn on_two_way(
2390        handler: &mut ___H,
2391        mut message: ::fidl_next::Message<___T>,
2392        responder: ::fidl_next::protocol::Responder<___T>,
2393    ) -> ::core::result::Result<
2394        (),
2395        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2396    > {
2397        match *message.header().ordinal {
2398            82058939547254592 => {
2399                let responder = ::fidl_next::Responder::from_untyped(responder);
2400
2401                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2402                    Ok(decoded) => {
2403                        handler
2404                            .inject(::fidl_next::Request::from_decoded(decoded), responder)
2405                            .await;
2406                        Ok(())
2407                    }
2408                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2409                        ordinal: 82058939547254592,
2410                        error,
2411                    }),
2412                }
2413            }
2414
2415            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2416        }
2417    }
2418}
2419
2420impl<___T> DeviceClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport
2421{}
2422
2423impl<___H, ___T> DeviceLocalClientHandler<___T> for ::fidl_next::Local<___H>
2424where
2425    ___H: DeviceClientHandler<___T>,
2426    ___T: ::fidl_next::Transport,
2427{
2428}
2429
2430impl<___H, ___T> DeviceLocalServerHandler<___T> for ::fidl_next::Local<___H>
2431where
2432    ___H: DeviceServerHandler<___T>,
2433    ___T: ::fidl_next::Transport,
2434{
2435    async fn inject(
2436        &mut self,
2437
2438        request: ::fidl_next::Request<device::Inject, ___T>,
2439
2440        responder: ::fidl_next::Responder<device::Inject, ___T>,
2441    ) {
2442        ___H::inject(&mut self.0, request, responder).await
2443    }
2444
2445    async fn inject_events(&mut self, request: ::fidl_next::Request<device::InjectEvents, ___T>) {
2446        ___H::inject_events(&mut self.0, request).await
2447    }
2448}
2449
2450/// The type corresponding to the Registry protocol.
2451#[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"]
2452#[derive(PartialEq, Debug)]
2453pub struct Registry;
2454
2455impl ::fidl_next::Discoverable for Registry {
2456    const PROTOCOL_NAME: &'static str = "fuchsia.ui.pointerinjector.Registry";
2457}
2458
2459#[cfg(target_os = "fuchsia")]
2460impl ::fidl_next::HasTransport for Registry {
2461    type Transport = ::fidl_next::fuchsia::zx::Channel;
2462}
2463
2464pub mod registry {
2465    pub mod prelude {
2466        pub use crate::{
2467            Registry, RegistryClientHandler, RegistryLocalClientHandler,
2468            RegistryLocalServerHandler, RegistryServerHandler, registry,
2469        };
2470
2471        pub use crate::natural::RegistryRegisterRequest;
2472    }
2473
2474    pub struct Register;
2475
2476    impl ::fidl_next::Method for Register {
2477        const ORDINAL: u64 = 718395677124749824;
2478        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2479            ::fidl_next::protocol::Flexibility::Strict;
2480
2481        type Protocol = crate::Registry;
2482
2483        type Request = crate::wire::RegistryRegisterRequest<'static>;
2484    }
2485
2486    impl ::fidl_next::TwoWayMethod for Register {
2487        type Response = ::fidl_next::wire::Strict<::fidl_next::wire::EmptyMessageBody>;
2488    }
2489
2490    impl<___R> ::fidl_next::Respond<___R> for Register {
2491        type Output = ::fidl_next::Strict<___R>;
2492
2493        fn respond(response: ___R) -> Self::Output {
2494            ::fidl_next::Strict(response)
2495        }
2496    }
2497
2498    mod ___detail {
2499        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Registry
2500        where
2501            ___T: ::fidl_next::Transport,
2502        {
2503            type Client = RegistryClient<___T>;
2504            type Server = RegistryServer<___T>;
2505        }
2506
2507        /// The client for the `Registry` protocol.
2508        #[repr(transparent)]
2509        pub struct RegistryClient<___T: ::fidl_next::Transport> {
2510            #[allow(dead_code)]
2511            client: ::fidl_next::protocol::Client<___T>,
2512        }
2513
2514        impl<___T> RegistryClient<___T>
2515        where
2516            ___T: ::fidl_next::Transport,
2517        {
2518            #[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"]
2519            pub fn register(
2520                &self,
2521
2522                config: impl ::fidl_next::Encode<
2523                    crate::wire::Config<'static>,
2524                    <___T as ::fidl_next::Transport>::SendBuffer,
2525                >,
2526
2527                injector: impl ::fidl_next::Encode<
2528                    ::fidl_next::ServerEnd<crate::Device, ::fidl_next::wire::fuchsia::Channel>,
2529                    <___T as ::fidl_next::Transport>::SendBuffer,
2530                >,
2531            ) -> ::fidl_next::TwoWayFuture<'_, super::Register, ___T>
2532            where
2533                <___T as ::fidl_next::Transport>::SendBuffer:
2534                    ::fidl_next::encoder::InternalHandleEncoder,
2535                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2536                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2537            {
2538                self.register_with(crate::generic::RegistryRegisterRequest { config, injector })
2539            }
2540
2541            #[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"]
2542            pub fn register_with<___R>(
2543                &self,
2544                request: ___R,
2545            ) -> ::fidl_next::TwoWayFuture<'_, super::Register, ___T>
2546            where
2547                ___R: ::fidl_next::Encode<
2548                        crate::wire::RegistryRegisterRequest<'static>,
2549                        <___T as ::fidl_next::Transport>::SendBuffer,
2550                    >,
2551            {
2552                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2553                    718395677124749824,
2554                    <super::Register as ::fidl_next::Method>::FLEXIBILITY,
2555                    request,
2556                ))
2557            }
2558        }
2559
2560        /// The server for the `Registry` protocol.
2561        #[repr(transparent)]
2562        pub struct RegistryServer<___T: ::fidl_next::Transport> {
2563            server: ::fidl_next::protocol::Server<___T>,
2564        }
2565
2566        impl<___T> RegistryServer<___T> where ___T: ::fidl_next::Transport {}
2567    }
2568}
2569
2570#[diagnostic::on_unimplemented(
2571    note = "If {Self} implements the non-local RegistryClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2572)]
2573
2574/// A client handler for the Registry protocol.
2575///
2576/// See [`Registry`] for more details.
2577pub trait RegistryLocalClientHandler<
2578    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2579    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2580>
2581{
2582}
2583
2584impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Registry
2585where
2586    ___H: RegistryLocalClientHandler<___T>,
2587    ___T: ::fidl_next::Transport,
2588{
2589    async fn on_event(
2590        handler: &mut ___H,
2591        mut message: ::fidl_next::Message<___T>,
2592    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2593        match *message.header().ordinal {
2594            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2595        }
2596    }
2597}
2598
2599#[diagnostic::on_unimplemented(
2600    note = "If {Self} implements the non-local RegistryServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2601)]
2602
2603/// A server handler for the Registry protocol.
2604///
2605/// See [`Registry`] for more details.
2606pub trait RegistryLocalServerHandler<
2607    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2608    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2609>
2610{
2611    #[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"]
2612    fn register(
2613        &mut self,
2614
2615        request: ::fidl_next::Request<registry::Register, ___T>,
2616
2617        responder: ::fidl_next::Responder<registry::Register, ___T>,
2618    ) -> impl ::core::future::Future<Output = ()>;
2619}
2620
2621impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Registry
2622where
2623    ___H: RegistryLocalServerHandler<___T>,
2624    ___T: ::fidl_next::Transport,
2625    for<'de> crate::wire::RegistryRegisterRequest<'de>: ::fidl_next::Decode<
2626            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2627            Constraint = (),
2628        >,
2629{
2630    async fn on_one_way(
2631        handler: &mut ___H,
2632        mut message: ::fidl_next::Message<___T>,
2633    ) -> ::core::result::Result<
2634        (),
2635        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2636    > {
2637        match *message.header().ordinal {
2638            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2639        }
2640    }
2641
2642    async fn on_two_way(
2643        handler: &mut ___H,
2644        mut message: ::fidl_next::Message<___T>,
2645        responder: ::fidl_next::protocol::Responder<___T>,
2646    ) -> ::core::result::Result<
2647        (),
2648        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2649    > {
2650        match *message.header().ordinal {
2651            718395677124749824 => {
2652                let responder = ::fidl_next::Responder::from_untyped(responder);
2653
2654                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2655                    Ok(decoded) => {
2656                        handler
2657                            .register(::fidl_next::Request::from_decoded(decoded), responder)
2658                            .await;
2659                        Ok(())
2660                    }
2661                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2662                        ordinal: 718395677124749824,
2663                        error,
2664                    }),
2665                }
2666            }
2667
2668            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2669        }
2670    }
2671}
2672
2673/// A client handler for the Registry protocol.
2674///
2675/// See [`Registry`] for more details.
2676pub trait RegistryClientHandler<
2677    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2678    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2679>
2680{
2681}
2682
2683impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Registry
2684where
2685    ___H: RegistryClientHandler<___T> + ::core::marker::Send,
2686    ___T: ::fidl_next::Transport,
2687{
2688    async fn on_event(
2689        handler: &mut ___H,
2690        mut message: ::fidl_next::Message<___T>,
2691    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2692        match *message.header().ordinal {
2693            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2694        }
2695    }
2696}
2697
2698/// A server handler for the Registry protocol.
2699///
2700/// See [`Registry`] for more details.
2701pub trait RegistryServerHandler<
2702    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2703    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2704>
2705{
2706    #[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"]
2707    fn register(
2708        &mut self,
2709
2710        request: ::fidl_next::Request<registry::Register, ___T>,
2711
2712        responder: ::fidl_next::Responder<registry::Register, ___T>,
2713    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2714}
2715
2716impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Registry
2717where
2718    ___H: RegistryServerHandler<___T> + ::core::marker::Send,
2719    ___T: ::fidl_next::Transport,
2720    for<'de> crate::wire::RegistryRegisterRequest<'de>: ::fidl_next::Decode<
2721            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2722            Constraint = (),
2723        >,
2724{
2725    async fn on_one_way(
2726        handler: &mut ___H,
2727        mut message: ::fidl_next::Message<___T>,
2728    ) -> ::core::result::Result<
2729        (),
2730        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2731    > {
2732        match *message.header().ordinal {
2733            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2734        }
2735    }
2736
2737    async fn on_two_way(
2738        handler: &mut ___H,
2739        mut message: ::fidl_next::Message<___T>,
2740        responder: ::fidl_next::protocol::Responder<___T>,
2741    ) -> ::core::result::Result<
2742        (),
2743        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2744    > {
2745        match *message.header().ordinal {
2746            718395677124749824 => {
2747                let responder = ::fidl_next::Responder::from_untyped(responder);
2748
2749                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2750                    Ok(decoded) => {
2751                        handler
2752                            .register(::fidl_next::Request::from_decoded(decoded), responder)
2753                            .await;
2754                        Ok(())
2755                    }
2756                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2757                        ordinal: 718395677124749824,
2758                        error,
2759                    }),
2760                }
2761            }
2762
2763            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2764        }
2765    }
2766}
2767
2768impl<___T> RegistryClientHandler<___T> for ::fidl_next::IgnoreEvents where
2769    ___T: ::fidl_next::Transport
2770{
2771}
2772
2773impl<___H, ___T> RegistryLocalClientHandler<___T> for ::fidl_next::Local<___H>
2774where
2775    ___H: RegistryClientHandler<___T>,
2776    ___T: ::fidl_next::Transport,
2777{
2778}
2779
2780impl<___H, ___T> RegistryLocalServerHandler<___T> for ::fidl_next::Local<___H>
2781where
2782    ___H: RegistryServerHandler<___T>,
2783    ___T: ::fidl_next::Transport,
2784{
2785    async fn register(
2786        &mut self,
2787
2788        request: ::fidl_next::Request<registry::Register, ___T>,
2789
2790        responder: ::fidl_next::Responder<registry::Register, ___T>,
2791    ) {
2792        ___H::register(&mut self.0, request, responder).await
2793    }
2794}
2795
2796pub use fidl_next_common_fuchsia_ui_pointerinjector::*;