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