Skip to main content

fidl_next_fuchsia_ui_views/
fidl_next_fuchsia_ui_views.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_views::natural::*;
8
9    #[doc = " A ViewRef is a handle to a kernel object which identifies a unique View\n across the system. Two ViewRefs to the same View have the same KOID.\n\n Clients use a ViewRef to identify a View, to validate a View, and to\n receive a View invalidation signal.\n\n As part of View creation, the client creates a linked\n ViewRef/ViewRefControl pair and hands the pair to Scenic (ViewRefControl is\n described below).  The client must remove the ViewRef\'s signal\n capabilities; otherwise the View is not created.\n\n The client may freely clone its ViewRef and share it, even before sending\n it to Scenic.\n\n Example 1. Accessibility accepts a ViewRef from a client to group the\n semantic nodes, and semantic operations, associated with a client\'s View.\n It must validate a client\'s ViewRef with Scenic.\n\n Example 2. We use ViewRefs to create a FocusChain, which identifies Views\n considered as \"in-focus\" down the View hierarchy. When a View is destroyed,\n Scenic signals to all FocusChain holders that the ViewRef is now invalid.\n"]
10    #[derive(Debug, PartialEq)]
11    #[repr(C)]
12    pub struct ViewRef {
13        pub reference: ::fidl_next::fuchsia::zx::EventPair,
14    }
15
16    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ViewRef, ___E> for ViewRef
17    where
18        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19        ___E: ::fidl_next::fuchsia::HandleEncoder,
20    {
21        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, crate::wire::ViewRef> = unsafe {
22            ::fidl_next::CopyOptimization::enable_if(
23                true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::Encode<
24                    ::fidl_next::wire::fuchsia::EventPair,
25                    ___E,
26                >>::COPY_OPTIMIZATION
27                    .is_enabled(),
28            )
29        };
30
31        #[inline]
32        fn encode(
33            self,
34            encoder_: &mut ___E,
35            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewRef>,
36            _: (),
37        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
38            ::fidl_next::munge! {
39                let crate::wire::ViewRef {
40                    reference,
41
42                } = out_;
43            }
44
45            ::fidl_next::Encode::encode(self.reference, encoder_, reference, ())?;
46
47            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(reference.as_mut_ptr()) };
48
49            Ok(())
50        }
51    }
52
53    unsafe impl<___E>
54        ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::ViewRef>, ___E>
55        for ViewRef
56    where
57        ___E: ::fidl_next::Encoder + ?Sized,
58        ViewRef: ::fidl_next::Encode<crate::wire::ViewRef, ___E>,
59    {
60        #[inline]
61        fn encode_option(
62            this: ::core::option::Option<Self>,
63            encoder: &mut ___E,
64            out: &mut ::core::mem::MaybeUninit<
65                ::fidl_next::wire::Box<'static, crate::wire::ViewRef>,
66            >,
67            _: (),
68        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
69            if let Some(inner) = this {
70                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
71                ::fidl_next::wire::Box::encode_present(out);
72            } else {
73                ::fidl_next::wire::Box::encode_absent(out);
74            }
75
76            Ok(())
77        }
78    }
79
80    impl ::fidl_next::FromWire<crate::wire::ViewRef> for ViewRef {
81        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::ViewRef, Self> = unsafe {
82            ::fidl_next::CopyOptimization::enable_if(
83                true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::FromWire<
84                    ::fidl_next::wire::fuchsia::EventPair,
85                >>::COPY_OPTIMIZATION
86                    .is_enabled(),
87            )
88        };
89
90        #[inline]
91        fn from_wire(wire: crate::wire::ViewRef) -> Self {
92            Self { reference: ::fidl_next::FromWire::from_wire(wire.reference) }
93        }
94    }
95
96    #[derive(Debug, PartialEq)]
97    #[repr(C)]
98    pub struct FocuserRequestFocusRequest {
99        pub view_ref: crate::natural::ViewRef,
100    }
101
102    unsafe impl<___E> ::fidl_next::Encode<crate::wire::FocuserRequestFocusRequest, ___E>
103        for FocuserRequestFocusRequest
104    where
105        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
106        ___E: ::fidl_next::fuchsia::HandleEncoder,
107    {
108        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
109            Self,
110            crate::wire::FocuserRequestFocusRequest,
111        > = unsafe {
112            ::fidl_next::CopyOptimization::enable_if(
113                true && <crate::natural::ViewRef as ::fidl_next::Encode<
114                    crate::wire::ViewRef,
115                    ___E,
116                >>::COPY_OPTIMIZATION
117                    .is_enabled(),
118            )
119        };
120
121        #[inline]
122        fn encode(
123            self,
124            encoder_: &mut ___E,
125            out_: &mut ::core::mem::MaybeUninit<crate::wire::FocuserRequestFocusRequest>,
126            _: (),
127        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
128            ::fidl_next::munge! {
129                let crate::wire::FocuserRequestFocusRequest {
130                    view_ref,
131
132                } = out_;
133            }
134
135            ::fidl_next::Encode::encode(self.view_ref, encoder_, view_ref, ())?;
136
137            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(view_ref.as_mut_ptr()) };
138
139            Ok(())
140        }
141    }
142
143    unsafe impl<___E>
144        ::fidl_next::EncodeOption<
145            ::fidl_next::wire::Box<'static, crate::wire::FocuserRequestFocusRequest>,
146            ___E,
147        > for FocuserRequestFocusRequest
148    where
149        ___E: ::fidl_next::Encoder + ?Sized,
150        FocuserRequestFocusRequest:
151            ::fidl_next::Encode<crate::wire::FocuserRequestFocusRequest, ___E>,
152    {
153        #[inline]
154        fn encode_option(
155            this: ::core::option::Option<Self>,
156            encoder: &mut ___E,
157            out: &mut ::core::mem::MaybeUninit<
158                ::fidl_next::wire::Box<'static, crate::wire::FocuserRequestFocusRequest>,
159            >,
160            _: (),
161        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
162            if let Some(inner) = this {
163                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
164                ::fidl_next::wire::Box::encode_present(out);
165            } else {
166                ::fidl_next::wire::Box::encode_absent(out);
167            }
168
169            Ok(())
170        }
171    }
172
173    impl ::fidl_next::FromWire<crate::wire::FocuserRequestFocusRequest> for FocuserRequestFocusRequest {
174        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
175            crate::wire::FocuserRequestFocusRequest,
176            Self,
177        > =
178            unsafe {
179                ::fidl_next::CopyOptimization::enable_if(
180                    true && <crate::natural::ViewRef as ::fidl_next::FromWire<
181                        crate::wire::ViewRef,
182                    >>::COPY_OPTIMIZATION
183                        .is_enabled(),
184                )
185            };
186
187        #[inline]
188        fn from_wire(wire: crate::wire::FocuserRequestFocusRequest) -> Self {
189            Self { view_ref: ::fidl_next::FromWire::from_wire(wire.view_ref) }
190        }
191    }
192
193    #[derive(Debug, Default, PartialEq)]
194    pub struct FocuserSetAutoFocusRequest {
195        pub view_ref: ::core::option::Option<crate::natural::ViewRef>,
196    }
197
198    impl FocuserSetAutoFocusRequest {
199        fn __max_ordinal(&self) -> usize {
200            if self.view_ref.is_some() {
201                return 1;
202            }
203
204            0
205        }
206    }
207
208    unsafe impl<___E> ::fidl_next::Encode<crate::wire::FocuserSetAutoFocusRequest<'static>, ___E>
209        for FocuserSetAutoFocusRequest
210    where
211        ___E: ::fidl_next::Encoder + ?Sized,
212        ___E: ::fidl_next::fuchsia::HandleEncoder,
213    {
214        #[inline]
215        fn encode(
216            mut self,
217            encoder: &mut ___E,
218            out: &mut ::core::mem::MaybeUninit<crate::wire::FocuserSetAutoFocusRequest<'static>>,
219            _: (),
220        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
221            ::fidl_next::munge!(let crate::wire::FocuserSetAutoFocusRequest { table } = out);
222
223            let max_ord = self.__max_ordinal();
224
225            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
226            ::fidl_next::Wire::zero_padding(&mut out);
227
228            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
229                ::fidl_next::wire::Envelope,
230            >(encoder, max_ord);
231
232            for i in 1..=max_ord {
233                match i {
234                    1 => {
235                        if let Some(value) = self.view_ref.take() {
236                            ::fidl_next::wire::Envelope::encode_value::<crate::wire::ViewRef, ___E>(
237                                value,
238                                preallocated.encoder,
239                                &mut out,
240                                (),
241                            )?;
242                        } else {
243                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
244                        }
245                    }
246
247                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
248                }
249                unsafe {
250                    preallocated.write_next(out.assume_init_ref());
251                }
252            }
253
254            ::fidl_next::wire::Table::encode_len(table, max_ord);
255
256            Ok(())
257        }
258    }
259
260    impl<'de> ::fidl_next::FromWire<crate::wire::FocuserSetAutoFocusRequest<'de>>
261        for FocuserSetAutoFocusRequest
262    {
263        #[inline]
264        fn from_wire(wire_: crate::wire::FocuserSetAutoFocusRequest<'de>) -> Self {
265            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
266
267            let view_ref = wire_.table.get(1);
268
269            Self {
270                view_ref: view_ref.map(|envelope| {
271                    ::fidl_next::FromWire::from_wire(unsafe {
272                        envelope.read_unchecked::<crate::wire::ViewRef>()
273                    })
274                }),
275            }
276        }
277    }
278
279    #[doc = " Token that uniquely identifies a `View`, which is the root point for a\n subgraph in the global scene graph. Each `ViewToken` has exactly one\n corresponding `ViewHolderToken`.\n\n A Scenic client can have its contents referenced from another client by\n creating a `View` resource using this token.  The other client must also\n create a `ViewHolder` resource using the corresponding `ViewHolderToken`.\n"]
280    #[derive(Debug, PartialEq)]
281    #[repr(C)]
282    pub struct ViewToken {
283        pub value: ::fidl_next::fuchsia::zx::EventPair,
284    }
285
286    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ViewToken, ___E> for ViewToken
287    where
288        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
289        ___E: ::fidl_next::fuchsia::HandleEncoder,
290    {
291        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, crate::wire::ViewToken> = unsafe {
292            ::fidl_next::CopyOptimization::enable_if(
293                true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::Encode<
294                    ::fidl_next::wire::fuchsia::EventPair,
295                    ___E,
296                >>::COPY_OPTIMIZATION
297                    .is_enabled(),
298            )
299        };
300
301        #[inline]
302        fn encode(
303            self,
304            encoder_: &mut ___E,
305            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewToken>,
306            _: (),
307        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
308            ::fidl_next::munge! {
309                let crate::wire::ViewToken {
310                    value,
311
312                } = out_;
313            }
314
315            ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
316
317            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
318
319            Ok(())
320        }
321    }
322
323    unsafe impl<___E>
324        ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::ViewToken>, ___E>
325        for ViewToken
326    where
327        ___E: ::fidl_next::Encoder + ?Sized,
328        ViewToken: ::fidl_next::Encode<crate::wire::ViewToken, ___E>,
329    {
330        #[inline]
331        fn encode_option(
332            this: ::core::option::Option<Self>,
333            encoder: &mut ___E,
334            out: &mut ::core::mem::MaybeUninit<
335                ::fidl_next::wire::Box<'static, crate::wire::ViewToken>,
336            >,
337            _: (),
338        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
339            if let Some(inner) = this {
340                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
341                ::fidl_next::wire::Box::encode_present(out);
342            } else {
343                ::fidl_next::wire::Box::encode_absent(out);
344            }
345
346            Ok(())
347        }
348    }
349
350    impl ::fidl_next::FromWire<crate::wire::ViewToken> for ViewToken {
351        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::ViewToken, Self> = unsafe {
352            ::fidl_next::CopyOptimization::enable_if(
353                true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::FromWire<
354                    ::fidl_next::wire::fuchsia::EventPair,
355                >>::COPY_OPTIMIZATION
356                    .is_enabled(),
357            )
358        };
359
360        #[inline]
361        fn from_wire(wire: crate::wire::ViewToken) -> Self {
362            Self { value: ::fidl_next::FromWire::from_wire(wire.value) }
363        }
364    }
365
366    #[derive(Debug, PartialEq)]
367    #[repr(C)]
368    pub struct ViewPresentRequest {
369        pub view_token: crate::natural::ViewToken,
370    }
371
372    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ViewPresentRequest, ___E> for ViewPresentRequest
373    where
374        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
375        ___E: ::fidl_next::fuchsia::HandleEncoder,
376    {
377        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
378            Self,
379            crate::wire::ViewPresentRequest,
380        > = unsafe {
381            ::fidl_next::CopyOptimization::enable_if(
382                true && <crate::natural::ViewToken as ::fidl_next::Encode<
383                    crate::wire::ViewToken,
384                    ___E,
385                >>::COPY_OPTIMIZATION
386                    .is_enabled(),
387            )
388        };
389
390        #[inline]
391        fn encode(
392            self,
393            encoder_: &mut ___E,
394            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewPresentRequest>,
395            _: (),
396        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
397            ::fidl_next::munge! {
398                let crate::wire::ViewPresentRequest {
399                    view_token,
400
401                } = out_;
402            }
403
404            ::fidl_next::Encode::encode(self.view_token, encoder_, view_token, ())?;
405
406            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(view_token.as_mut_ptr()) };
407
408            Ok(())
409        }
410    }
411
412    unsafe impl<___E>
413        ::fidl_next::EncodeOption<
414            ::fidl_next::wire::Box<'static, crate::wire::ViewPresentRequest>,
415            ___E,
416        > for ViewPresentRequest
417    where
418        ___E: ::fidl_next::Encoder + ?Sized,
419        ViewPresentRequest: ::fidl_next::Encode<crate::wire::ViewPresentRequest, ___E>,
420    {
421        #[inline]
422        fn encode_option(
423            this: ::core::option::Option<Self>,
424            encoder: &mut ___E,
425            out: &mut ::core::mem::MaybeUninit<
426                ::fidl_next::wire::Box<'static, crate::wire::ViewPresentRequest>,
427            >,
428            _: (),
429        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
430            if let Some(inner) = this {
431                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
432                ::fidl_next::wire::Box::encode_present(out);
433            } else {
434                ::fidl_next::wire::Box::encode_absent(out);
435            }
436
437            Ok(())
438        }
439    }
440
441    impl ::fidl_next::FromWire<crate::wire::ViewPresentRequest> for ViewPresentRequest {
442        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
443            crate::wire::ViewPresentRequest,
444            Self,
445        > = unsafe {
446            ::fidl_next::CopyOptimization::enable_if(
447                true && <crate::natural::ViewToken as ::fidl_next::FromWire<
448                    crate::wire::ViewToken,
449                >>::COPY_OPTIMIZATION
450                    .is_enabled(),
451            )
452        };
453
454        #[inline]
455        fn from_wire(wire: crate::wire::ViewPresentRequest) -> Self {
456            Self { view_token: ::fidl_next::FromWire::from_wire(wire.view_token) }
457        }
458    }
459
460    #[doc = " Two Flatland instances may be connected in a parent-child relationship. The child endpoint is\n held in a View. This view is strongly associated with a ViewRef and other related protocols.\n\n ViewCreationToken is a typed wrapper for a channel, representing the child endpoint of the\n connection between two Flatland instances. No messages will be sent over this channel, because\n it is only used as an unclonable object with peer.\n"]
461    #[derive(Debug, PartialEq)]
462    #[repr(C)]
463    pub struct ViewCreationToken {
464        pub value: ::fidl_next::fuchsia::zx::Channel,
465    }
466
467    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ViewCreationToken, ___E> for ViewCreationToken
468    where
469        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
470        ___E: ::fidl_next::fuchsia::HandleEncoder,
471    {
472        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
473            Self,
474            crate::wire::ViewCreationToken,
475        > = unsafe {
476            ::fidl_next::CopyOptimization::enable_if(
477                true && <::fidl_next::fuchsia::zx::Channel as ::fidl_next::Encode<
478                    ::fidl_next::wire::fuchsia::Channel,
479                    ___E,
480                >>::COPY_OPTIMIZATION
481                    .is_enabled(),
482            )
483        };
484
485        #[inline]
486        fn encode(
487            self,
488            encoder_: &mut ___E,
489            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewCreationToken>,
490            _: (),
491        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
492            ::fidl_next::munge! {
493                let crate::wire::ViewCreationToken {
494                    value,
495
496                } = out_;
497            }
498
499            ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
500
501            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
502
503            Ok(())
504        }
505    }
506
507    unsafe impl<___E>
508        ::fidl_next::EncodeOption<
509            ::fidl_next::wire::Box<'static, crate::wire::ViewCreationToken>,
510            ___E,
511        > for ViewCreationToken
512    where
513        ___E: ::fidl_next::Encoder + ?Sized,
514        ViewCreationToken: ::fidl_next::Encode<crate::wire::ViewCreationToken, ___E>,
515    {
516        #[inline]
517        fn encode_option(
518            this: ::core::option::Option<Self>,
519            encoder: &mut ___E,
520            out: &mut ::core::mem::MaybeUninit<
521                ::fidl_next::wire::Box<'static, crate::wire::ViewCreationToken>,
522            >,
523            _: (),
524        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
525            if let Some(inner) = this {
526                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
527                ::fidl_next::wire::Box::encode_present(out);
528            } else {
529                ::fidl_next::wire::Box::encode_absent(out);
530            }
531
532            Ok(())
533        }
534    }
535
536    impl ::fidl_next::FromWire<crate::wire::ViewCreationToken> for ViewCreationToken {
537        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
538            crate::wire::ViewCreationToken,
539            Self,
540        > = unsafe {
541            ::fidl_next::CopyOptimization::enable_if(
542                true && <::fidl_next::fuchsia::zx::Channel as ::fidl_next::FromWire<
543                    ::fidl_next::wire::fuchsia::Channel,
544                >>::COPY_OPTIMIZATION
545                    .is_enabled(),
546            )
547        };
548
549        #[inline]
550        fn from_wire(wire: crate::wire::ViewCreationToken) -> Self {
551            Self { value: ::fidl_next::FromWire::from_wire(wire.value) }
552        }
553    }
554
555    #[doc = " Token that uniquely identifies an attachment point for a `View` in the\n global scene graph.  Each `ViewHolderToken` has exactly one corresponding\n `ViewToken`.\n\n A Scenic client can reference contents from another client by creating a\n `ViewHolder` resource using this token.  The other client must also create\n a `View` resource using the corresponding `ViewToken`.\n"]
556    #[derive(Debug, PartialEq)]
557    #[repr(C)]
558    pub struct ViewHolderToken {
559        pub value: ::fidl_next::fuchsia::zx::EventPair,
560    }
561
562    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ViewHolderToken, ___E> for ViewHolderToken
563    where
564        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
565        ___E: ::fidl_next::fuchsia::HandleEncoder,
566    {
567        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, crate::wire::ViewHolderToken> = unsafe {
568            ::fidl_next::CopyOptimization::enable_if(
569                true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::Encode<
570                    ::fidl_next::wire::fuchsia::EventPair,
571                    ___E,
572                >>::COPY_OPTIMIZATION
573                    .is_enabled(),
574            )
575        };
576
577        #[inline]
578        fn encode(
579            self,
580            encoder_: &mut ___E,
581            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewHolderToken>,
582            _: (),
583        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
584            ::fidl_next::munge! {
585                let crate::wire::ViewHolderToken {
586                    value,
587
588                } = out_;
589            }
590
591            ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
592
593            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
594
595            Ok(())
596        }
597    }
598
599    unsafe impl<___E>
600        ::fidl_next::EncodeOption<
601            ::fidl_next::wire::Box<'static, crate::wire::ViewHolderToken>,
602            ___E,
603        > for ViewHolderToken
604    where
605        ___E: ::fidl_next::Encoder + ?Sized,
606        ViewHolderToken: ::fidl_next::Encode<crate::wire::ViewHolderToken, ___E>,
607    {
608        #[inline]
609        fn encode_option(
610            this: ::core::option::Option<Self>,
611            encoder: &mut ___E,
612            out: &mut ::core::mem::MaybeUninit<
613                ::fidl_next::wire::Box<'static, crate::wire::ViewHolderToken>,
614            >,
615            _: (),
616        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
617            if let Some(inner) = this {
618                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
619                ::fidl_next::wire::Box::encode_present(out);
620            } else {
621                ::fidl_next::wire::Box::encode_absent(out);
622            }
623
624            Ok(())
625        }
626    }
627
628    impl ::fidl_next::FromWire<crate::wire::ViewHolderToken> for ViewHolderToken {
629        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::ViewHolderToken, Self> = unsafe {
630            ::fidl_next::CopyOptimization::enable_if(
631                true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::FromWire<
632                    ::fidl_next::wire::fuchsia::EventPair,
633                >>::COPY_OPTIMIZATION
634                    .is_enabled(),
635            )
636        };
637
638        #[inline]
639        fn from_wire(wire: crate::wire::ViewHolderToken) -> Self {
640            Self { value: ::fidl_next::FromWire::from_wire(wire.value) }
641        }
642    }
643
644    #[doc = " A ViewRefControl is the peer to a ViewRef. Their `reference`s are linked.\n\n Like ViewRef, a ViewRefControl is a typed handle to an eventpair.  Unlike\n ViewRef, a ViewRefControl\'s handle is unique. Scenic uses this property\n when it ties a ViewRefControl to a View, arranged to share fate.  When a\n View is destroyed, the associated destruction of its ViewRefControl\n triggers an automatic `ZX_EVENTPAIR_PEER_CLOSED` signal sent to all ViewRef\n holders; hence ViewRef holders may track View lifetime.\n\n As part of View creation, the client creates a linked\n ViewRef/ViewRefControl pair and hands the pair to Scenic (ViewRef is\n described above).  The client must not clone the ViewRefControl. It must\n not remove or modify the ViewRefControl\'s capabilities; otherwise the View\n is not created.\n"]
645    #[derive(Debug, PartialEq)]
646    #[repr(C)]
647    pub struct ViewRefControl {
648        pub reference: ::fidl_next::fuchsia::zx::EventPair,
649    }
650
651    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ViewRefControl, ___E> for ViewRefControl
652    where
653        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
654        ___E: ::fidl_next::fuchsia::HandleEncoder,
655    {
656        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, crate::wire::ViewRefControl> = unsafe {
657            ::fidl_next::CopyOptimization::enable_if(
658                true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::Encode<
659                    ::fidl_next::wire::fuchsia::EventPair,
660                    ___E,
661                >>::COPY_OPTIMIZATION
662                    .is_enabled(),
663            )
664        };
665
666        #[inline]
667        fn encode(
668            self,
669            encoder_: &mut ___E,
670            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewRefControl>,
671            _: (),
672        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
673            ::fidl_next::munge! {
674                let crate::wire::ViewRefControl {
675                    reference,
676
677                } = out_;
678            }
679
680            ::fidl_next::Encode::encode(self.reference, encoder_, reference, ())?;
681
682            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(reference.as_mut_ptr()) };
683
684            Ok(())
685        }
686    }
687
688    unsafe impl<___E>
689        ::fidl_next::EncodeOption<
690            ::fidl_next::wire::Box<'static, crate::wire::ViewRefControl>,
691            ___E,
692        > for ViewRefControl
693    where
694        ___E: ::fidl_next::Encoder + ?Sized,
695        ViewRefControl: ::fidl_next::Encode<crate::wire::ViewRefControl, ___E>,
696    {
697        #[inline]
698        fn encode_option(
699            this: ::core::option::Option<Self>,
700            encoder: &mut ___E,
701            out: &mut ::core::mem::MaybeUninit<
702                ::fidl_next::wire::Box<'static, crate::wire::ViewRefControl>,
703            >,
704            _: (),
705        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
706            if let Some(inner) = this {
707                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
708                ::fidl_next::wire::Box::encode_present(out);
709            } else {
710                ::fidl_next::wire::Box::encode_absent(out);
711            }
712
713            Ok(())
714        }
715    }
716
717    impl ::fidl_next::FromWire<crate::wire::ViewRefControl> for ViewRefControl {
718        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::ViewRefControl, Self> = unsafe {
719            ::fidl_next::CopyOptimization::enable_if(
720                true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::FromWire<
721                    ::fidl_next::wire::fuchsia::EventPair,
722                >>::COPY_OPTIMIZATION
723                    .is_enabled(),
724            )
725        };
726
727        #[inline]
728        fn from_wire(wire: crate::wire::ViewRefControl) -> Self {
729            Self { reference: ::fidl_next::FromWire::from_wire(wire.reference) }
730        }
731    }
732
733    #[doc = " Convenience data type to self-identify the view, during view creation.\n\n A ViewRef is used to identify the view, and can be freely cloned and\n distributed to other components.\n\n A ViewRefControl is used to implement lifecycle notification, and must not\n be cloned, and cannot be distributed to other components. Scenic binds the\n ViewRefControl object to the view, so when the view is destroyed, the\n destruction of the ViewRefControl triggers a `ZX_EVENTPAIR_PEER_CLOSED`\n signal to all ViewRef holders, thus notifying view death.\n\n Usage: When creating a view, place a ViewRef and ViewRefControl together in\n this struct, so that they travel as a unit to the destination component.\n This convenience struct allows a protocol author to describe this traveling\n pair as one argument. It improves readability and reduces mishandling.\n"]
734    #[derive(Debug, PartialEq)]
735    #[repr(C)]
736    pub struct ViewIdentityOnCreation {
737        pub view_ref: crate::natural::ViewRef,
738
739        pub view_ref_control: crate::natural::ViewRefControl,
740    }
741
742    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ViewIdentityOnCreation, ___E>
743        for ViewIdentityOnCreation
744    where
745        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
746        ___E: ::fidl_next::fuchsia::HandleEncoder,
747    {
748        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
749            Self,
750            crate::wire::ViewIdentityOnCreation,
751        > = unsafe {
752            ::fidl_next::CopyOptimization::enable_if(
753                true && <crate::natural::ViewRef as ::fidl_next::Encode<
754                    crate::wire::ViewRef,
755                    ___E,
756                >>::COPY_OPTIMIZATION
757                    .is_enabled()
758                    && <crate::natural::ViewRefControl as ::fidl_next::Encode<
759                        crate::wire::ViewRefControl,
760                        ___E,
761                    >>::COPY_OPTIMIZATION
762                        .is_enabled(),
763            )
764        };
765
766        #[inline]
767        fn encode(
768            self,
769            encoder_: &mut ___E,
770            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewIdentityOnCreation>,
771            _: (),
772        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
773            ::fidl_next::munge! {
774                let crate::wire::ViewIdentityOnCreation {
775                    view_ref,
776                    view_ref_control,
777
778                } = out_;
779            }
780
781            ::fidl_next::Encode::encode(self.view_ref, encoder_, view_ref, ())?;
782
783            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(view_ref.as_mut_ptr()) };
784
785            ::fidl_next::Encode::encode(self.view_ref_control, encoder_, view_ref_control, ())?;
786
787            let mut _field =
788                unsafe { ::fidl_next::Slot::new_unchecked(view_ref_control.as_mut_ptr()) };
789
790            Ok(())
791        }
792    }
793
794    unsafe impl<___E>
795        ::fidl_next::EncodeOption<
796            ::fidl_next::wire::Box<'static, crate::wire::ViewIdentityOnCreation>,
797            ___E,
798        > for ViewIdentityOnCreation
799    where
800        ___E: ::fidl_next::Encoder + ?Sized,
801        ViewIdentityOnCreation: ::fidl_next::Encode<crate::wire::ViewIdentityOnCreation, ___E>,
802    {
803        #[inline]
804        fn encode_option(
805            this: ::core::option::Option<Self>,
806            encoder: &mut ___E,
807            out: &mut ::core::mem::MaybeUninit<
808                ::fidl_next::wire::Box<'static, crate::wire::ViewIdentityOnCreation>,
809            >,
810            _: (),
811        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
812            if let Some(inner) = this {
813                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
814                ::fidl_next::wire::Box::encode_present(out);
815            } else {
816                ::fidl_next::wire::Box::encode_absent(out);
817            }
818
819            Ok(())
820        }
821    }
822
823    impl ::fidl_next::FromWire<crate::wire::ViewIdentityOnCreation> for ViewIdentityOnCreation {
824        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
825            crate::wire::ViewIdentityOnCreation,
826            Self,
827        > =
828            unsafe {
829                ::fidl_next::CopyOptimization::enable_if(
830                    true && <crate::natural::ViewRef as ::fidl_next::FromWire<
831                        crate::wire::ViewRef,
832                    >>::COPY_OPTIMIZATION
833                        .is_enabled()
834                        && <crate::natural::ViewRefControl as ::fidl_next::FromWire<
835                            crate::wire::ViewRefControl,
836                        >>::COPY_OPTIMIZATION
837                            .is_enabled(),
838                )
839            };
840
841        #[inline]
842        fn from_wire(wire: crate::wire::ViewIdentityOnCreation) -> Self {
843            Self {
844                view_ref: ::fidl_next::FromWire::from_wire(wire.view_ref),
845
846                view_ref_control: ::fidl_next::FromWire::from_wire(wire.view_ref_control),
847            }
848        }
849    }
850
851    #[derive(Debug, PartialEq)]
852    #[repr(C)]
853    pub struct ViewRefInstalledWatchRequest {
854        pub view_ref: crate::natural::ViewRef,
855    }
856
857    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ViewRefInstalledWatchRequest, ___E>
858        for ViewRefInstalledWatchRequest
859    where
860        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
861        ___E: ::fidl_next::fuchsia::HandleEncoder,
862    {
863        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
864            Self,
865            crate::wire::ViewRefInstalledWatchRequest,
866        > = unsafe {
867            ::fidl_next::CopyOptimization::enable_if(
868                true && <crate::natural::ViewRef as ::fidl_next::Encode<
869                    crate::wire::ViewRef,
870                    ___E,
871                >>::COPY_OPTIMIZATION
872                    .is_enabled(),
873            )
874        };
875
876        #[inline]
877        fn encode(
878            self,
879            encoder_: &mut ___E,
880            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewRefInstalledWatchRequest>,
881            _: (),
882        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
883            ::fidl_next::munge! {
884                let crate::wire::ViewRefInstalledWatchRequest {
885                    view_ref,
886
887                } = out_;
888            }
889
890            ::fidl_next::Encode::encode(self.view_ref, encoder_, view_ref, ())?;
891
892            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(view_ref.as_mut_ptr()) };
893
894            Ok(())
895        }
896    }
897
898    unsafe impl<___E>
899        ::fidl_next::EncodeOption<
900            ::fidl_next::wire::Box<'static, crate::wire::ViewRefInstalledWatchRequest>,
901            ___E,
902        > for ViewRefInstalledWatchRequest
903    where
904        ___E: ::fidl_next::Encoder + ?Sized,
905        ViewRefInstalledWatchRequest:
906            ::fidl_next::Encode<crate::wire::ViewRefInstalledWatchRequest, ___E>,
907    {
908        #[inline]
909        fn encode_option(
910            this: ::core::option::Option<Self>,
911            encoder: &mut ___E,
912            out: &mut ::core::mem::MaybeUninit<
913                ::fidl_next::wire::Box<'static, crate::wire::ViewRefInstalledWatchRequest>,
914            >,
915            _: (),
916        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
917            if let Some(inner) = this {
918                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
919                ::fidl_next::wire::Box::encode_present(out);
920            } else {
921                ::fidl_next::wire::Box::encode_absent(out);
922            }
923
924            Ok(())
925        }
926    }
927
928    impl ::fidl_next::FromWire<crate::wire::ViewRefInstalledWatchRequest>
929        for ViewRefInstalledWatchRequest
930    {
931        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
932            crate::wire::ViewRefInstalledWatchRequest,
933            Self,
934        > =
935            unsafe {
936                ::fidl_next::CopyOptimization::enable_if(
937                    true && <crate::natural::ViewRef as ::fidl_next::FromWire<
938                        crate::wire::ViewRef,
939                    >>::COPY_OPTIMIZATION
940                        .is_enabled(),
941                )
942            };
943
944        #[inline]
945        fn from_wire(wire: crate::wire::ViewRefInstalledWatchRequest) -> Self {
946            Self { view_ref: ::fidl_next::FromWire::from_wire(wire.view_ref) }
947        }
948    }
949
950    #[doc = " Two Flatland instances may be connected in a parent-child relationship. The parent endpoint is\n held in a Viewport.\n\n ViewportCreationToken is a typed wrapper for a channel, representing the parent endpoint of the\n connection between two Flatlands. No messages will be sent over this channel, because it is only\n used as an unclonable object with peer.\n"]
951    #[derive(Debug, PartialEq)]
952    #[repr(C)]
953    pub struct ViewportCreationToken {
954        pub value: ::fidl_next::fuchsia::zx::Channel,
955    }
956
957    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ViewportCreationToken, ___E>
958        for ViewportCreationToken
959    where
960        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
961        ___E: ::fidl_next::fuchsia::HandleEncoder,
962    {
963        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
964            Self,
965            crate::wire::ViewportCreationToken,
966        > = unsafe {
967            ::fidl_next::CopyOptimization::enable_if(
968                true && <::fidl_next::fuchsia::zx::Channel as ::fidl_next::Encode<
969                    ::fidl_next::wire::fuchsia::Channel,
970                    ___E,
971                >>::COPY_OPTIMIZATION
972                    .is_enabled(),
973            )
974        };
975
976        #[inline]
977        fn encode(
978            self,
979            encoder_: &mut ___E,
980            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewportCreationToken>,
981            _: (),
982        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
983            ::fidl_next::munge! {
984                let crate::wire::ViewportCreationToken {
985                    value,
986
987                } = out_;
988            }
989
990            ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
991
992            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
993
994            Ok(())
995        }
996    }
997
998    unsafe impl<___E>
999        ::fidl_next::EncodeOption<
1000            ::fidl_next::wire::Box<'static, crate::wire::ViewportCreationToken>,
1001            ___E,
1002        > for ViewportCreationToken
1003    where
1004        ___E: ::fidl_next::Encoder + ?Sized,
1005        ViewportCreationToken: ::fidl_next::Encode<crate::wire::ViewportCreationToken, ___E>,
1006    {
1007        #[inline]
1008        fn encode_option(
1009            this: ::core::option::Option<Self>,
1010            encoder: &mut ___E,
1011            out: &mut ::core::mem::MaybeUninit<
1012                ::fidl_next::wire::Box<'static, crate::wire::ViewportCreationToken>,
1013            >,
1014            _: (),
1015        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1016            if let Some(inner) = this {
1017                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1018                ::fidl_next::wire::Box::encode_present(out);
1019            } else {
1020                ::fidl_next::wire::Box::encode_absent(out);
1021            }
1022
1023            Ok(())
1024        }
1025    }
1026
1027    impl ::fidl_next::FromWire<crate::wire::ViewportCreationToken> for ViewportCreationToken {
1028        const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1029            crate::wire::ViewportCreationToken,
1030            Self,
1031        > = unsafe {
1032            ::fidl_next::CopyOptimization::enable_if(
1033                true && <::fidl_next::fuchsia::zx::Channel as ::fidl_next::FromWire<
1034                    ::fidl_next::wire::fuchsia::Channel,
1035                >>::COPY_OPTIMIZATION
1036                    .is_enabled(),
1037            )
1038        };
1039
1040        #[inline]
1041        fn from_wire(wire: crate::wire::ViewportCreationToken) -> Self {
1042            Self { value: ::fidl_next::FromWire::from_wire(wire.value) }
1043        }
1044    }
1045}
1046
1047pub mod wire {
1048
1049    pub use fidl_next_common_fuchsia_ui_views::wire::*;
1050
1051    /// The wire type corresponding to [`ViewRef`].
1052    #[derive(Debug)]
1053    #[repr(C)]
1054    pub struct ViewRef {
1055        pub reference: ::fidl_next::wire::fuchsia::EventPair,
1056    }
1057
1058    static_assertions::const_assert_eq!(std::mem::size_of::<ViewRef>(), 4);
1059    static_assertions::const_assert_eq!(std::mem::align_of::<ViewRef>(), 4);
1060
1061    static_assertions::const_assert_eq!(std::mem::offset_of!(ViewRef, reference), 0);
1062
1063    impl ::fidl_next::Constrained for ViewRef {
1064        type Constraint = ();
1065
1066        fn validate(
1067            _: ::fidl_next::Slot<'_, Self>,
1068            _: Self::Constraint,
1069        ) -> Result<(), ::fidl_next::ValidationError> {
1070            Ok(())
1071        }
1072    }
1073
1074    unsafe impl ::fidl_next::Wire for ViewRef {
1075        type Narrowed<'de> = ViewRef;
1076
1077        #[inline]
1078        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1079            ::fidl_next::munge! {
1080                let Self {
1081                    reference,
1082
1083                } = &mut *out_;
1084            }
1085
1086            ::fidl_next::Wire::zero_padding(reference);
1087        }
1088    }
1089
1090    unsafe impl<___D> ::fidl_next::Decode<___D> for ViewRef
1091    where
1092        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1093        ___D: ::fidl_next::fuchsia::HandleDecoder,
1094    {
1095        fn decode(
1096            slot_: ::fidl_next::Slot<'_, Self>,
1097            decoder_: &mut ___D,
1098            _: (),
1099        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1100            ::fidl_next::munge! {
1101                let Self {
1102                    mut reference,
1103
1104                } = slot_;
1105            }
1106
1107            let _field = reference.as_mut();
1108
1109            ::fidl_next::Decode::decode(reference.as_mut(), decoder_, ())?;
1110
1111            Ok(())
1112        }
1113    }
1114
1115    impl ::fidl_next::IntoNatural for ViewRef {
1116        type Natural = crate::natural::ViewRef;
1117    }
1118
1119    /// The wire type corresponding to [`FocuserRequestFocusRequest`].
1120    #[derive(Debug)]
1121    #[repr(C)]
1122    pub struct FocuserRequestFocusRequest {
1123        pub view_ref: crate::wire::ViewRef,
1124    }
1125
1126    static_assertions::const_assert_eq!(std::mem::size_of::<FocuserRequestFocusRequest>(), 4);
1127    static_assertions::const_assert_eq!(std::mem::align_of::<FocuserRequestFocusRequest>(), 4);
1128
1129    static_assertions::const_assert_eq!(
1130        std::mem::offset_of!(FocuserRequestFocusRequest, view_ref),
1131        0
1132    );
1133
1134    impl ::fidl_next::Constrained for FocuserRequestFocusRequest {
1135        type Constraint = ();
1136
1137        fn validate(
1138            _: ::fidl_next::Slot<'_, Self>,
1139            _: Self::Constraint,
1140        ) -> Result<(), ::fidl_next::ValidationError> {
1141            Ok(())
1142        }
1143    }
1144
1145    unsafe impl ::fidl_next::Wire for FocuserRequestFocusRequest {
1146        type Narrowed<'de> = FocuserRequestFocusRequest;
1147
1148        #[inline]
1149        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1150            ::fidl_next::munge! {
1151                let Self {
1152                    view_ref,
1153
1154                } = &mut *out_;
1155            }
1156
1157            ::fidl_next::Wire::zero_padding(view_ref);
1158        }
1159    }
1160
1161    unsafe impl<___D> ::fidl_next::Decode<___D> for FocuserRequestFocusRequest
1162    where
1163        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1164        ___D: ::fidl_next::fuchsia::HandleDecoder,
1165    {
1166        fn decode(
1167            slot_: ::fidl_next::Slot<'_, Self>,
1168            decoder_: &mut ___D,
1169            _: (),
1170        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1171            ::fidl_next::munge! {
1172                let Self {
1173                    mut view_ref,
1174
1175                } = slot_;
1176            }
1177
1178            let _field = view_ref.as_mut();
1179
1180            ::fidl_next::Decode::decode(view_ref.as_mut(), decoder_, ())?;
1181
1182            Ok(())
1183        }
1184    }
1185
1186    impl ::fidl_next::IntoNatural for FocuserRequestFocusRequest {
1187        type Natural = crate::natural::FocuserRequestFocusRequest;
1188    }
1189
1190    /// The wire type corresponding to [`FocuserSetAutoFocusRequest`].
1191    #[repr(C)]
1192    pub struct FocuserSetAutoFocusRequest<'de> {
1193        pub(crate) table: ::fidl_next::wire::Table<'de>,
1194    }
1195
1196    impl<'de> Drop for FocuserSetAutoFocusRequest<'de> {
1197        fn drop(&mut self) {
1198            let _ = self
1199                .table
1200                .get(1)
1201                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::ViewRef>() });
1202        }
1203    }
1204
1205    impl ::fidl_next::Constrained for FocuserSetAutoFocusRequest<'_> {
1206        type Constraint = ();
1207
1208        fn validate(
1209            _: ::fidl_next::Slot<'_, Self>,
1210            _: Self::Constraint,
1211        ) -> Result<(), ::fidl_next::ValidationError> {
1212            Ok(())
1213        }
1214    }
1215
1216    unsafe impl ::fidl_next::Wire for FocuserSetAutoFocusRequest<'static> {
1217        type Narrowed<'de> = FocuserSetAutoFocusRequest<'de>;
1218
1219        #[inline]
1220        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1221            ::fidl_next::munge!(let Self { table } = out);
1222            ::fidl_next::wire::Table::zero_padding(table);
1223        }
1224    }
1225
1226    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FocuserSetAutoFocusRequest<'de>
1227    where
1228        ___D: ::fidl_next::Decoder<'de> + ?Sized,
1229        ___D: ::fidl_next::fuchsia::HandleDecoder,
1230    {
1231        fn decode(
1232            slot: ::fidl_next::Slot<'_, Self>,
1233            decoder: &mut ___D,
1234            _: (),
1235        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1236            ::fidl_next::munge!(let Self { table } = slot);
1237
1238            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1239                match ordinal {
1240                    0 => unsafe { ::core::hint::unreachable_unchecked() },
1241
1242                    1 => {
1243                        ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::ViewRef>(
1244                            slot.as_mut(),
1245                            decoder,
1246                            (),
1247                        )?;
1248
1249                        Ok(())
1250                    }
1251
1252                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1253                }
1254            })
1255        }
1256    }
1257
1258    impl<'de> FocuserSetAutoFocusRequest<'de> {
1259        pub fn view_ref(&self) -> ::core::option::Option<&crate::wire::ViewRef> {
1260            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1261        }
1262
1263        pub fn take_view_ref(&mut self) -> ::core::option::Option<crate::wire::ViewRef> {
1264            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1265        }
1266    }
1267
1268    impl<'de> ::core::fmt::Debug for FocuserSetAutoFocusRequest<'de> {
1269        fn fmt(
1270            &self,
1271            f: &mut ::core::fmt::Formatter<'_>,
1272        ) -> ::core::result::Result<(), ::core::fmt::Error> {
1273            f.debug_struct("FocuserSetAutoFocusRequest")
1274                .field("view_ref", &self.view_ref())
1275                .finish()
1276        }
1277    }
1278
1279    impl<'de> ::fidl_next::IntoNatural for FocuserSetAutoFocusRequest<'de> {
1280        type Natural = crate::natural::FocuserSetAutoFocusRequest;
1281    }
1282
1283    /// The wire type corresponding to [`ViewToken`].
1284    #[derive(Debug)]
1285    #[repr(C)]
1286    pub struct ViewToken {
1287        pub value: ::fidl_next::wire::fuchsia::EventPair,
1288    }
1289
1290    static_assertions::const_assert_eq!(std::mem::size_of::<ViewToken>(), 4);
1291    static_assertions::const_assert_eq!(std::mem::align_of::<ViewToken>(), 4);
1292
1293    static_assertions::const_assert_eq!(std::mem::offset_of!(ViewToken, value), 0);
1294
1295    impl ::fidl_next::Constrained for ViewToken {
1296        type Constraint = ();
1297
1298        fn validate(
1299            _: ::fidl_next::Slot<'_, Self>,
1300            _: Self::Constraint,
1301        ) -> Result<(), ::fidl_next::ValidationError> {
1302            Ok(())
1303        }
1304    }
1305
1306    unsafe impl ::fidl_next::Wire for ViewToken {
1307        type Narrowed<'de> = ViewToken;
1308
1309        #[inline]
1310        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1311            ::fidl_next::munge! {
1312                let Self {
1313                    value,
1314
1315                } = &mut *out_;
1316            }
1317
1318            ::fidl_next::Wire::zero_padding(value);
1319        }
1320    }
1321
1322    unsafe impl<___D> ::fidl_next::Decode<___D> for ViewToken
1323    where
1324        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1325        ___D: ::fidl_next::fuchsia::HandleDecoder,
1326    {
1327        fn decode(
1328            slot_: ::fidl_next::Slot<'_, Self>,
1329            decoder_: &mut ___D,
1330            _: (),
1331        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1332            ::fidl_next::munge! {
1333                let Self {
1334                    mut value,
1335
1336                } = slot_;
1337            }
1338
1339            let _field = value.as_mut();
1340
1341            ::fidl_next::Decode::decode(value.as_mut(), decoder_, ())?;
1342
1343            Ok(())
1344        }
1345    }
1346
1347    impl ::fidl_next::IntoNatural for ViewToken {
1348        type Natural = crate::natural::ViewToken;
1349    }
1350
1351    /// The wire type corresponding to [`ViewPresentRequest`].
1352    #[derive(Debug)]
1353    #[repr(C)]
1354    pub struct ViewPresentRequest {
1355        pub view_token: crate::wire::ViewToken,
1356    }
1357
1358    static_assertions::const_assert_eq!(std::mem::size_of::<ViewPresentRequest>(), 4);
1359    static_assertions::const_assert_eq!(std::mem::align_of::<ViewPresentRequest>(), 4);
1360
1361    static_assertions::const_assert_eq!(std::mem::offset_of!(ViewPresentRequest, view_token), 0);
1362
1363    impl ::fidl_next::Constrained for ViewPresentRequest {
1364        type Constraint = ();
1365
1366        fn validate(
1367            _: ::fidl_next::Slot<'_, Self>,
1368            _: Self::Constraint,
1369        ) -> Result<(), ::fidl_next::ValidationError> {
1370            Ok(())
1371        }
1372    }
1373
1374    unsafe impl ::fidl_next::Wire for ViewPresentRequest {
1375        type Narrowed<'de> = ViewPresentRequest;
1376
1377        #[inline]
1378        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1379            ::fidl_next::munge! {
1380                let Self {
1381                    view_token,
1382
1383                } = &mut *out_;
1384            }
1385
1386            ::fidl_next::Wire::zero_padding(view_token);
1387        }
1388    }
1389
1390    unsafe impl<___D> ::fidl_next::Decode<___D> for ViewPresentRequest
1391    where
1392        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1393        ___D: ::fidl_next::fuchsia::HandleDecoder,
1394    {
1395        fn decode(
1396            slot_: ::fidl_next::Slot<'_, Self>,
1397            decoder_: &mut ___D,
1398            _: (),
1399        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1400            ::fidl_next::munge! {
1401                let Self {
1402                    mut view_token,
1403
1404                } = slot_;
1405            }
1406
1407            let _field = view_token.as_mut();
1408
1409            ::fidl_next::Decode::decode(view_token.as_mut(), decoder_, ())?;
1410
1411            Ok(())
1412        }
1413    }
1414
1415    impl ::fidl_next::IntoNatural for ViewPresentRequest {
1416        type Natural = crate::natural::ViewPresentRequest;
1417    }
1418
1419    /// The wire type corresponding to [`ViewCreationToken`].
1420    #[derive(Debug)]
1421    #[repr(C)]
1422    pub struct ViewCreationToken {
1423        pub value: ::fidl_next::wire::fuchsia::Channel,
1424    }
1425
1426    static_assertions::const_assert_eq!(std::mem::size_of::<ViewCreationToken>(), 4);
1427    static_assertions::const_assert_eq!(std::mem::align_of::<ViewCreationToken>(), 4);
1428
1429    static_assertions::const_assert_eq!(std::mem::offset_of!(ViewCreationToken, value), 0);
1430
1431    impl ::fidl_next::Constrained for ViewCreationToken {
1432        type Constraint = ();
1433
1434        fn validate(
1435            _: ::fidl_next::Slot<'_, Self>,
1436            _: Self::Constraint,
1437        ) -> Result<(), ::fidl_next::ValidationError> {
1438            Ok(())
1439        }
1440    }
1441
1442    unsafe impl ::fidl_next::Wire for ViewCreationToken {
1443        type Narrowed<'de> = ViewCreationToken;
1444
1445        #[inline]
1446        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1447            ::fidl_next::munge! {
1448                let Self {
1449                    value,
1450
1451                } = &mut *out_;
1452            }
1453
1454            ::fidl_next::Wire::zero_padding(value);
1455        }
1456    }
1457
1458    unsafe impl<___D> ::fidl_next::Decode<___D> for ViewCreationToken
1459    where
1460        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1461        ___D: ::fidl_next::fuchsia::HandleDecoder,
1462    {
1463        fn decode(
1464            slot_: ::fidl_next::Slot<'_, Self>,
1465            decoder_: &mut ___D,
1466            _: (),
1467        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1468            ::fidl_next::munge! {
1469                let Self {
1470                    mut value,
1471
1472                } = slot_;
1473            }
1474
1475            let _field = value.as_mut();
1476
1477            ::fidl_next::Decode::decode(value.as_mut(), decoder_, ())?;
1478
1479            Ok(())
1480        }
1481    }
1482
1483    impl ::fidl_next::IntoNatural for ViewCreationToken {
1484        type Natural = crate::natural::ViewCreationToken;
1485    }
1486
1487    /// The wire type corresponding to [`ViewHolderToken`].
1488    #[derive(Debug)]
1489    #[repr(C)]
1490    pub struct ViewHolderToken {
1491        pub value: ::fidl_next::wire::fuchsia::EventPair,
1492    }
1493
1494    static_assertions::const_assert_eq!(std::mem::size_of::<ViewHolderToken>(), 4);
1495    static_assertions::const_assert_eq!(std::mem::align_of::<ViewHolderToken>(), 4);
1496
1497    static_assertions::const_assert_eq!(std::mem::offset_of!(ViewHolderToken, value), 0);
1498
1499    impl ::fidl_next::Constrained for ViewHolderToken {
1500        type Constraint = ();
1501
1502        fn validate(
1503            _: ::fidl_next::Slot<'_, Self>,
1504            _: Self::Constraint,
1505        ) -> Result<(), ::fidl_next::ValidationError> {
1506            Ok(())
1507        }
1508    }
1509
1510    unsafe impl ::fidl_next::Wire for ViewHolderToken {
1511        type Narrowed<'de> = ViewHolderToken;
1512
1513        #[inline]
1514        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1515            ::fidl_next::munge! {
1516                let Self {
1517                    value,
1518
1519                } = &mut *out_;
1520            }
1521
1522            ::fidl_next::Wire::zero_padding(value);
1523        }
1524    }
1525
1526    unsafe impl<___D> ::fidl_next::Decode<___D> for ViewHolderToken
1527    where
1528        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1529        ___D: ::fidl_next::fuchsia::HandleDecoder,
1530    {
1531        fn decode(
1532            slot_: ::fidl_next::Slot<'_, Self>,
1533            decoder_: &mut ___D,
1534            _: (),
1535        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1536            ::fidl_next::munge! {
1537                let Self {
1538                    mut value,
1539
1540                } = slot_;
1541            }
1542
1543            let _field = value.as_mut();
1544
1545            ::fidl_next::Decode::decode(value.as_mut(), decoder_, ())?;
1546
1547            Ok(())
1548        }
1549    }
1550
1551    impl ::fidl_next::IntoNatural for ViewHolderToken {
1552        type Natural = crate::natural::ViewHolderToken;
1553    }
1554
1555    /// The wire type corresponding to [`ViewRefControl`].
1556    #[derive(Debug)]
1557    #[repr(C)]
1558    pub struct ViewRefControl {
1559        pub reference: ::fidl_next::wire::fuchsia::EventPair,
1560    }
1561
1562    static_assertions::const_assert_eq!(std::mem::size_of::<ViewRefControl>(), 4);
1563    static_assertions::const_assert_eq!(std::mem::align_of::<ViewRefControl>(), 4);
1564
1565    static_assertions::const_assert_eq!(std::mem::offset_of!(ViewRefControl, reference), 0);
1566
1567    impl ::fidl_next::Constrained for ViewRefControl {
1568        type Constraint = ();
1569
1570        fn validate(
1571            _: ::fidl_next::Slot<'_, Self>,
1572            _: Self::Constraint,
1573        ) -> Result<(), ::fidl_next::ValidationError> {
1574            Ok(())
1575        }
1576    }
1577
1578    unsafe impl ::fidl_next::Wire for ViewRefControl {
1579        type Narrowed<'de> = ViewRefControl;
1580
1581        #[inline]
1582        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1583            ::fidl_next::munge! {
1584                let Self {
1585                    reference,
1586
1587                } = &mut *out_;
1588            }
1589
1590            ::fidl_next::Wire::zero_padding(reference);
1591        }
1592    }
1593
1594    unsafe impl<___D> ::fidl_next::Decode<___D> for ViewRefControl
1595    where
1596        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1597        ___D: ::fidl_next::fuchsia::HandleDecoder,
1598    {
1599        fn decode(
1600            slot_: ::fidl_next::Slot<'_, Self>,
1601            decoder_: &mut ___D,
1602            _: (),
1603        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1604            ::fidl_next::munge! {
1605                let Self {
1606                    mut reference,
1607
1608                } = slot_;
1609            }
1610
1611            let _field = reference.as_mut();
1612
1613            ::fidl_next::Decode::decode(reference.as_mut(), decoder_, ())?;
1614
1615            Ok(())
1616        }
1617    }
1618
1619    impl ::fidl_next::IntoNatural for ViewRefControl {
1620        type Natural = crate::natural::ViewRefControl;
1621    }
1622
1623    /// The wire type corresponding to [`ViewIdentityOnCreation`].
1624    #[derive(Debug)]
1625    #[repr(C)]
1626    pub struct ViewIdentityOnCreation {
1627        pub view_ref: crate::wire::ViewRef,
1628
1629        pub view_ref_control: crate::wire::ViewRefControl,
1630    }
1631
1632    static_assertions::const_assert_eq!(std::mem::size_of::<ViewIdentityOnCreation>(), 8);
1633    static_assertions::const_assert_eq!(std::mem::align_of::<ViewIdentityOnCreation>(), 4);
1634
1635    static_assertions::const_assert_eq!(std::mem::offset_of!(ViewIdentityOnCreation, view_ref), 0);
1636
1637    static_assertions::const_assert_eq!(
1638        std::mem::offset_of!(ViewIdentityOnCreation, view_ref_control),
1639        4
1640    );
1641
1642    impl ::fidl_next::Constrained for ViewIdentityOnCreation {
1643        type Constraint = ();
1644
1645        fn validate(
1646            _: ::fidl_next::Slot<'_, Self>,
1647            _: Self::Constraint,
1648        ) -> Result<(), ::fidl_next::ValidationError> {
1649            Ok(())
1650        }
1651    }
1652
1653    unsafe impl ::fidl_next::Wire for ViewIdentityOnCreation {
1654        type Narrowed<'de> = ViewIdentityOnCreation;
1655
1656        #[inline]
1657        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1658            ::fidl_next::munge! {
1659                let Self {
1660                    view_ref,
1661                    view_ref_control,
1662
1663                } = &mut *out_;
1664            }
1665
1666            ::fidl_next::Wire::zero_padding(view_ref);
1667
1668            ::fidl_next::Wire::zero_padding(view_ref_control);
1669        }
1670    }
1671
1672    unsafe impl<___D> ::fidl_next::Decode<___D> for ViewIdentityOnCreation
1673    where
1674        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1675        ___D: ::fidl_next::fuchsia::HandleDecoder,
1676    {
1677        fn decode(
1678            slot_: ::fidl_next::Slot<'_, Self>,
1679            decoder_: &mut ___D,
1680            _: (),
1681        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1682            ::fidl_next::munge! {
1683                let Self {
1684                    mut view_ref,
1685                    mut view_ref_control,
1686
1687                } = slot_;
1688            }
1689
1690            let _field = view_ref.as_mut();
1691
1692            ::fidl_next::Decode::decode(view_ref.as_mut(), decoder_, ())?;
1693
1694            let _field = view_ref_control.as_mut();
1695
1696            ::fidl_next::Decode::decode(view_ref_control.as_mut(), decoder_, ())?;
1697
1698            Ok(())
1699        }
1700    }
1701
1702    impl ::fidl_next::IntoNatural for ViewIdentityOnCreation {
1703        type Natural = crate::natural::ViewIdentityOnCreation;
1704    }
1705
1706    /// The wire type corresponding to [`ViewRefInstalledWatchRequest`].
1707    #[derive(Debug)]
1708    #[repr(C)]
1709    pub struct ViewRefInstalledWatchRequest {
1710        pub view_ref: crate::wire::ViewRef,
1711    }
1712
1713    static_assertions::const_assert_eq!(std::mem::size_of::<ViewRefInstalledWatchRequest>(), 4);
1714    static_assertions::const_assert_eq!(std::mem::align_of::<ViewRefInstalledWatchRequest>(), 4);
1715
1716    static_assertions::const_assert_eq!(
1717        std::mem::offset_of!(ViewRefInstalledWatchRequest, view_ref),
1718        0
1719    );
1720
1721    impl ::fidl_next::Constrained for ViewRefInstalledWatchRequest {
1722        type Constraint = ();
1723
1724        fn validate(
1725            _: ::fidl_next::Slot<'_, Self>,
1726            _: Self::Constraint,
1727        ) -> Result<(), ::fidl_next::ValidationError> {
1728            Ok(())
1729        }
1730    }
1731
1732    unsafe impl ::fidl_next::Wire for ViewRefInstalledWatchRequest {
1733        type Narrowed<'de> = ViewRefInstalledWatchRequest;
1734
1735        #[inline]
1736        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1737            ::fidl_next::munge! {
1738                let Self {
1739                    view_ref,
1740
1741                } = &mut *out_;
1742            }
1743
1744            ::fidl_next::Wire::zero_padding(view_ref);
1745        }
1746    }
1747
1748    unsafe impl<___D> ::fidl_next::Decode<___D> for ViewRefInstalledWatchRequest
1749    where
1750        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1751        ___D: ::fidl_next::fuchsia::HandleDecoder,
1752    {
1753        fn decode(
1754            slot_: ::fidl_next::Slot<'_, Self>,
1755            decoder_: &mut ___D,
1756            _: (),
1757        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1758            ::fidl_next::munge! {
1759                let Self {
1760                    mut view_ref,
1761
1762                } = slot_;
1763            }
1764
1765            let _field = view_ref.as_mut();
1766
1767            ::fidl_next::Decode::decode(view_ref.as_mut(), decoder_, ())?;
1768
1769            Ok(())
1770        }
1771    }
1772
1773    impl ::fidl_next::IntoNatural for ViewRefInstalledWatchRequest {
1774        type Natural = crate::natural::ViewRefInstalledWatchRequest;
1775    }
1776
1777    /// The wire type corresponding to [`ViewportCreationToken`].
1778    #[derive(Debug)]
1779    #[repr(C)]
1780    pub struct ViewportCreationToken {
1781        pub value: ::fidl_next::wire::fuchsia::Channel,
1782    }
1783
1784    static_assertions::const_assert_eq!(std::mem::size_of::<ViewportCreationToken>(), 4);
1785    static_assertions::const_assert_eq!(std::mem::align_of::<ViewportCreationToken>(), 4);
1786
1787    static_assertions::const_assert_eq!(std::mem::offset_of!(ViewportCreationToken, value), 0);
1788
1789    impl ::fidl_next::Constrained for ViewportCreationToken {
1790        type Constraint = ();
1791
1792        fn validate(
1793            _: ::fidl_next::Slot<'_, Self>,
1794            _: Self::Constraint,
1795        ) -> Result<(), ::fidl_next::ValidationError> {
1796            Ok(())
1797        }
1798    }
1799
1800    unsafe impl ::fidl_next::Wire for ViewportCreationToken {
1801        type Narrowed<'de> = ViewportCreationToken;
1802
1803        #[inline]
1804        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1805            ::fidl_next::munge! {
1806                let Self {
1807                    value,
1808
1809                } = &mut *out_;
1810            }
1811
1812            ::fidl_next::Wire::zero_padding(value);
1813        }
1814    }
1815
1816    unsafe impl<___D> ::fidl_next::Decode<___D> for ViewportCreationToken
1817    where
1818        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1819        ___D: ::fidl_next::fuchsia::HandleDecoder,
1820    {
1821        fn decode(
1822            slot_: ::fidl_next::Slot<'_, Self>,
1823            decoder_: &mut ___D,
1824            _: (),
1825        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1826            ::fidl_next::munge! {
1827                let Self {
1828                    mut value,
1829
1830                } = slot_;
1831            }
1832
1833            let _field = value.as_mut();
1834
1835            ::fidl_next::Decode::decode(value.as_mut(), decoder_, ())?;
1836
1837            Ok(())
1838        }
1839    }
1840
1841    impl ::fidl_next::IntoNatural for ViewportCreationToken {
1842        type Natural = crate::natural::ViewportCreationToken;
1843    }
1844}
1845
1846pub mod wire_optional {
1847
1848    pub use fidl_next_common_fuchsia_ui_views::wire_optional::*;
1849}
1850
1851pub mod generic {
1852
1853    pub use fidl_next_common_fuchsia_ui_views::generic::*;
1854
1855    /// The generic type corresponding to [`ViewRef`].
1856    pub struct ViewRef<T0> {
1857        pub reference: T0,
1858    }
1859
1860    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ViewRef, ___E> for ViewRef<T0>
1861    where
1862        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1863        ___E: ::fidl_next::fuchsia::HandleEncoder,
1864        T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::EventPair, ___E>,
1865    {
1866        #[inline]
1867        fn encode(
1868            self,
1869            encoder_: &mut ___E,
1870            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewRef>,
1871            _: (),
1872        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1873            ::fidl_next::munge! {
1874                let crate::wire::ViewRef {
1875                    reference,
1876
1877                } = out_;
1878            }
1879
1880            ::fidl_next::Encode::encode(self.reference, encoder_, reference, ())?;
1881
1882            Ok(())
1883        }
1884    }
1885
1886    /// The generic type corresponding to [`FocuserRequestFocusRequest`].
1887    pub struct FocuserRequestFocusRequest<T0> {
1888        pub view_ref: T0,
1889    }
1890
1891    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::FocuserRequestFocusRequest, ___E>
1892        for FocuserRequestFocusRequest<T0>
1893    where
1894        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1895        ___E: ::fidl_next::fuchsia::HandleEncoder,
1896        T0: ::fidl_next::Encode<crate::wire::ViewRef, ___E>,
1897    {
1898        #[inline]
1899        fn encode(
1900            self,
1901            encoder_: &mut ___E,
1902            out_: &mut ::core::mem::MaybeUninit<crate::wire::FocuserRequestFocusRequest>,
1903            _: (),
1904        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1905            ::fidl_next::munge! {
1906                let crate::wire::FocuserRequestFocusRequest {
1907                    view_ref,
1908
1909                } = out_;
1910            }
1911
1912            ::fidl_next::Encode::encode(self.view_ref, encoder_, view_ref, ())?;
1913
1914            Ok(())
1915        }
1916    }
1917
1918    /// The generic type corresponding to [`ViewToken`].
1919    pub struct ViewToken<T0> {
1920        pub value: T0,
1921    }
1922
1923    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ViewToken, ___E> for ViewToken<T0>
1924    where
1925        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1926        ___E: ::fidl_next::fuchsia::HandleEncoder,
1927        T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::EventPair, ___E>,
1928    {
1929        #[inline]
1930        fn encode(
1931            self,
1932            encoder_: &mut ___E,
1933            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewToken>,
1934            _: (),
1935        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1936            ::fidl_next::munge! {
1937                let crate::wire::ViewToken {
1938                    value,
1939
1940                } = out_;
1941            }
1942
1943            ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
1944
1945            Ok(())
1946        }
1947    }
1948
1949    /// The generic type corresponding to [`ViewPresentRequest`].
1950    pub struct ViewPresentRequest<T0> {
1951        pub view_token: T0,
1952    }
1953
1954    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ViewPresentRequest, ___E>
1955        for ViewPresentRequest<T0>
1956    where
1957        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1958        ___E: ::fidl_next::fuchsia::HandleEncoder,
1959        T0: ::fidl_next::Encode<crate::wire::ViewToken, ___E>,
1960    {
1961        #[inline]
1962        fn encode(
1963            self,
1964            encoder_: &mut ___E,
1965            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewPresentRequest>,
1966            _: (),
1967        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1968            ::fidl_next::munge! {
1969                let crate::wire::ViewPresentRequest {
1970                    view_token,
1971
1972                } = out_;
1973            }
1974
1975            ::fidl_next::Encode::encode(self.view_token, encoder_, view_token, ())?;
1976
1977            Ok(())
1978        }
1979    }
1980
1981    /// The generic type corresponding to [`ViewCreationToken`].
1982    pub struct ViewCreationToken<T0> {
1983        pub value: T0,
1984    }
1985
1986    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ViewCreationToken, ___E>
1987        for ViewCreationToken<T0>
1988    where
1989        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1990        ___E: ::fidl_next::fuchsia::HandleEncoder,
1991        T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Channel, ___E>,
1992    {
1993        #[inline]
1994        fn encode(
1995            self,
1996            encoder_: &mut ___E,
1997            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewCreationToken>,
1998            _: (),
1999        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2000            ::fidl_next::munge! {
2001                let crate::wire::ViewCreationToken {
2002                    value,
2003
2004                } = out_;
2005            }
2006
2007            ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
2008
2009            Ok(())
2010        }
2011    }
2012
2013    /// The generic type corresponding to [`ViewHolderToken`].
2014    pub struct ViewHolderToken<T0> {
2015        pub value: T0,
2016    }
2017
2018    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ViewHolderToken, ___E>
2019        for ViewHolderToken<T0>
2020    where
2021        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2022        ___E: ::fidl_next::fuchsia::HandleEncoder,
2023        T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::EventPair, ___E>,
2024    {
2025        #[inline]
2026        fn encode(
2027            self,
2028            encoder_: &mut ___E,
2029            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewHolderToken>,
2030            _: (),
2031        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2032            ::fidl_next::munge! {
2033                let crate::wire::ViewHolderToken {
2034                    value,
2035
2036                } = out_;
2037            }
2038
2039            ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
2040
2041            Ok(())
2042        }
2043    }
2044
2045    /// The generic type corresponding to [`ViewRefControl`].
2046    pub struct ViewRefControl<T0> {
2047        pub reference: T0,
2048    }
2049
2050    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ViewRefControl, ___E> for ViewRefControl<T0>
2051    where
2052        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2053        ___E: ::fidl_next::fuchsia::HandleEncoder,
2054        T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::EventPair, ___E>,
2055    {
2056        #[inline]
2057        fn encode(
2058            self,
2059            encoder_: &mut ___E,
2060            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewRefControl>,
2061            _: (),
2062        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2063            ::fidl_next::munge! {
2064                let crate::wire::ViewRefControl {
2065                    reference,
2066
2067                } = out_;
2068            }
2069
2070            ::fidl_next::Encode::encode(self.reference, encoder_, reference, ())?;
2071
2072            Ok(())
2073        }
2074    }
2075
2076    /// The generic type corresponding to [`ViewIdentityOnCreation`].
2077    pub struct ViewIdentityOnCreation<T0, T1> {
2078        pub view_ref: T0,
2079
2080        pub view_ref_control: T1,
2081    }
2082
2083    unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::ViewIdentityOnCreation, ___E>
2084        for ViewIdentityOnCreation<T0, T1>
2085    where
2086        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2087        ___E: ::fidl_next::fuchsia::HandleEncoder,
2088        T0: ::fidl_next::Encode<crate::wire::ViewRef, ___E>,
2089        T1: ::fidl_next::Encode<crate::wire::ViewRefControl, ___E>,
2090    {
2091        #[inline]
2092        fn encode(
2093            self,
2094            encoder_: &mut ___E,
2095            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewIdentityOnCreation>,
2096            _: (),
2097        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2098            ::fidl_next::munge! {
2099                let crate::wire::ViewIdentityOnCreation {
2100                    view_ref,
2101                    view_ref_control,
2102
2103                } = out_;
2104            }
2105
2106            ::fidl_next::Encode::encode(self.view_ref, encoder_, view_ref, ())?;
2107
2108            ::fidl_next::Encode::encode(self.view_ref_control, encoder_, view_ref_control, ())?;
2109
2110            Ok(())
2111        }
2112    }
2113
2114    /// The generic type corresponding to [`ViewRefInstalledWatchRequest`].
2115    pub struct ViewRefInstalledWatchRequest<T0> {
2116        pub view_ref: T0,
2117    }
2118
2119    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ViewRefInstalledWatchRequest, ___E>
2120        for ViewRefInstalledWatchRequest<T0>
2121    where
2122        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2123        ___E: ::fidl_next::fuchsia::HandleEncoder,
2124        T0: ::fidl_next::Encode<crate::wire::ViewRef, ___E>,
2125    {
2126        #[inline]
2127        fn encode(
2128            self,
2129            encoder_: &mut ___E,
2130            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewRefInstalledWatchRequest>,
2131            _: (),
2132        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2133            ::fidl_next::munge! {
2134                let crate::wire::ViewRefInstalledWatchRequest {
2135                    view_ref,
2136
2137                } = out_;
2138            }
2139
2140            ::fidl_next::Encode::encode(self.view_ref, encoder_, view_ref, ())?;
2141
2142            Ok(())
2143        }
2144    }
2145
2146    /// The generic type corresponding to [`ViewportCreationToken`].
2147    pub struct ViewportCreationToken<T0> {
2148        pub value: T0,
2149    }
2150
2151    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ViewportCreationToken, ___E>
2152        for ViewportCreationToken<T0>
2153    where
2154        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2155        ___E: ::fidl_next::fuchsia::HandleEncoder,
2156        T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::Channel, ___E>,
2157    {
2158        #[inline]
2159        fn encode(
2160            self,
2161            encoder_: &mut ___E,
2162            out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewportCreationToken>,
2163            _: (),
2164        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2165            ::fidl_next::munge! {
2166                let crate::wire::ViewportCreationToken {
2167                    value,
2168
2169                } = out_;
2170            }
2171
2172            ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
2173
2174            Ok(())
2175        }
2176    }
2177}
2178
2179pub use self::natural::*;
2180
2181/// The type corresponding to the Focuser protocol.
2182#[doc = " A method of programmatically transferring View focus.\n\n The protocol client has implicit access to a requestor ViewRef, which is\n used as the basis for request authority.\n"]
2183#[derive(PartialEq, Debug)]
2184pub struct Focuser;
2185
2186#[cfg(target_os = "fuchsia")]
2187impl ::fidl_next::HasTransport for Focuser {
2188    type Transport = ::fidl_next::fuchsia::zx::Channel;
2189}
2190
2191pub mod focuser {
2192    pub mod prelude {
2193        pub use crate::{
2194            Focuser, FocuserClientHandler, FocuserLocalClientHandler, FocuserLocalServerHandler,
2195            FocuserServerHandler, focuser,
2196        };
2197
2198        pub use crate::natural::AutoFocusError;
2199
2200        pub use crate::natural::Error;
2201
2202        pub use crate::natural::FocuserRequestFocusRequest;
2203
2204        pub use crate::natural::FocuserSetAutoFocusRequest;
2205
2206        pub use crate::natural::FocuserRequestFocusResponse;
2207
2208        pub use crate::natural::FocuserSetAutoFocusResponse;
2209    }
2210
2211    pub struct RequestFocus;
2212
2213    impl ::fidl_next::Method for RequestFocus {
2214        const ORDINAL: u64 = 385346384312702933;
2215        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2216            ::fidl_next::protocol::Flexibility::Strict;
2217
2218        type Protocol = crate::Focuser;
2219
2220        type Request = crate::wire::FocuserRequestFocusRequest;
2221    }
2222
2223    impl ::fidl_next::TwoWayMethod for RequestFocus {
2224        type Response = ::fidl_next::wire::Result<
2225            'static,
2226            crate::wire::FocuserRequestFocusResponse,
2227            crate::wire::Error,
2228        >;
2229    }
2230
2231    impl<___R> ::fidl_next::Respond<___R> for RequestFocus {
2232        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
2233
2234        fn respond(response: ___R) -> Self::Output {
2235            ::core::result::Result::Ok(response)
2236        }
2237    }
2238
2239    impl<___R> ::fidl_next::RespondErr<___R> for RequestFocus {
2240        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2241
2242        fn respond_err(response: ___R) -> Self::Output {
2243            ::core::result::Result::Err(response)
2244        }
2245    }
2246
2247    pub struct SetAutoFocus;
2248
2249    impl ::fidl_next::Method for SetAutoFocus {
2250        const ORDINAL: u64 = 5192627660017276169;
2251        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2252            ::fidl_next::protocol::Flexibility::Strict;
2253
2254        type Protocol = crate::Focuser;
2255
2256        type Request = crate::wire::FocuserSetAutoFocusRequest<'static>;
2257    }
2258
2259    impl ::fidl_next::TwoWayMethod for SetAutoFocus {
2260        type Response = ::fidl_next::wire::Result<
2261            'static,
2262            crate::wire::FocuserSetAutoFocusResponse,
2263            crate::wire::AutoFocusError,
2264        >;
2265    }
2266
2267    impl<___R> ::fidl_next::Respond<___R> for SetAutoFocus {
2268        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
2269
2270        fn respond(response: ___R) -> Self::Output {
2271            ::core::result::Result::Ok(response)
2272        }
2273    }
2274
2275    impl<___R> ::fidl_next::RespondErr<___R> for SetAutoFocus {
2276        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2277
2278        fn respond_err(response: ___R) -> Self::Output {
2279            ::core::result::Result::Err(response)
2280        }
2281    }
2282
2283    mod ___detail {
2284        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Focuser
2285        where
2286            ___T: ::fidl_next::Transport,
2287        {
2288            type Client = FocuserClient<___T>;
2289            type Server = FocuserServer<___T>;
2290        }
2291
2292        /// The client for the `Focuser` protocol.
2293        #[repr(transparent)]
2294        pub struct FocuserClient<___T: ::fidl_next::Transport> {
2295            #[allow(dead_code)]
2296            client: ::fidl_next::protocol::Client<___T>,
2297        }
2298
2299        impl<___T> FocuserClient<___T>
2300        where
2301            ___T: ::fidl_next::Transport,
2302        {
2303            #[doc = " Asks the server to transfer focus to the View specified by `view_ref`,\n with the authority of the requestor ViewRef. Such a request may be\n honored or denied.\n\n If the request was honored, and it triggers a focus change, a FocusEvent\n (with focused=true) is issued to the newly-focused View, and a\n FocusEvent (with focused=false) is issued to the previous View.\n\n The result callback indicates that the request was received and honored.\n It does not guarantee that the requested View actually received a\n FocusEvent in time.\n\n The request may be denied for many reasons, for example:\n - if `view_ref` is invalid\n - if there is no View backed by `view_ref`\n - if there is no requestor ViewRef accessible to Focuser\n - if the requestor ViewRef lacks authority over `view_ref`\'s View\n - if `view_ref`\'s View is not hittable or may not receive focus\n etc. A denied request is indicated with a Error.\n"]
2304            pub fn request_focus(
2305                &self,
2306
2307                view_ref: impl ::fidl_next::Encode<
2308                    crate::wire::ViewRef,
2309                    <___T as ::fidl_next::Transport>::SendBuffer,
2310                >,
2311            ) -> ::fidl_next::TwoWayFuture<'_, super::RequestFocus, ___T>
2312            where
2313                <___T as ::fidl_next::Transport>::SendBuffer:
2314                    ::fidl_next::encoder::InternalHandleEncoder,
2315                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2316            {
2317                self.request_focus_with(crate::generic::FocuserRequestFocusRequest { view_ref })
2318            }
2319
2320            #[doc = " Asks the server to transfer focus to the View specified by `view_ref`,\n with the authority of the requestor ViewRef. Such a request may be\n honored or denied.\n\n If the request was honored, and it triggers a focus change, a FocusEvent\n (with focused=true) is issued to the newly-focused View, and a\n FocusEvent (with focused=false) is issued to the previous View.\n\n The result callback indicates that the request was received and honored.\n It does not guarantee that the requested View actually received a\n FocusEvent in time.\n\n The request may be denied for many reasons, for example:\n - if `view_ref` is invalid\n - if there is no View backed by `view_ref`\n - if there is no requestor ViewRef accessible to Focuser\n - if the requestor ViewRef lacks authority over `view_ref`\'s View\n - if `view_ref`\'s View is not hittable or may not receive focus\n etc. A denied request is indicated with a Error.\n"]
2321            pub fn request_focus_with<___R>(
2322                &self,
2323                request: ___R,
2324            ) -> ::fidl_next::TwoWayFuture<'_, super::RequestFocus, ___T>
2325            where
2326                ___R: ::fidl_next::Encode<
2327                        crate::wire::FocuserRequestFocusRequest,
2328                        <___T as ::fidl_next::Transport>::SendBuffer,
2329                    >,
2330            {
2331                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2332                    385346384312702933,
2333                    <super::RequestFocus as ::fidl_next::Method>::FLEXIBILITY,
2334                    request,
2335                ))
2336            }
2337
2338            #[doc = " Sets the auto focus target to the View specified by `view_ref`.\n To unset the target, pass in an empty table.\n\n If a target has been set, then whenever the caller\'s View would receive\n focus, an attempt is made to transfer focus immediately to the target\n instead. If the target is unfocusable, the new target is the first\n focusable ancestor of the target instead. Setting an auto focus target\n places no limitations on simultaneous use of RequestFocus().\n\n An auto focus target is \"valid\" only while it is a descendant of the\n caller\'s View in the ViewTree. Specifying an invalid auto focus target is\n allowed, since it may become valid later.\n It is the client\'s responsibility to ensure the target is a valid\n receiver of auto focus.\n\n If the target is invalid when the auto focus behavior would trigger, then\n the attempt to move focus will silently fail and focus will remain with\n the caller\'s View.\n A target may become invalid and then become valid again any number of\n times; auto focus will continue to function whenever the target is\n in a valid state, and will continue to ignore the target while it\'s in an\n invalid state.\n\n If the focus would by some further automatic mechanism return to the\n caller\'s View (e.g. if the target is unfocusable), then focus will\n remain with the caller\'s View.\n\n AutoFocusError is currently never returned, and is reserved for possible\n future use.\n"]
2339            pub fn set_auto_focus_with<___R>(
2340                &self,
2341                request: ___R,
2342            ) -> ::fidl_next::TwoWayFuture<'_, super::SetAutoFocus, ___T>
2343            where
2344                ___R: ::fidl_next::Encode<
2345                        crate::wire::FocuserSetAutoFocusRequest<'static>,
2346                        <___T as ::fidl_next::Transport>::SendBuffer,
2347                    >,
2348            {
2349                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2350                    5192627660017276169,
2351                    <super::SetAutoFocus as ::fidl_next::Method>::FLEXIBILITY,
2352                    request,
2353                ))
2354            }
2355        }
2356
2357        /// The server for the `Focuser` protocol.
2358        #[repr(transparent)]
2359        pub struct FocuserServer<___T: ::fidl_next::Transport> {
2360            server: ::fidl_next::protocol::Server<___T>,
2361        }
2362
2363        impl<___T> FocuserServer<___T> where ___T: ::fidl_next::Transport {}
2364    }
2365}
2366
2367#[diagnostic::on_unimplemented(
2368    note = "If {Self} implements the non-local FocuserClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2369)]
2370
2371/// A client handler for the Focuser protocol.
2372///
2373/// See [`Focuser`] for more details.
2374pub trait FocuserLocalClientHandler<
2375    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2376    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2377>
2378{
2379}
2380
2381impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Focuser
2382where
2383    ___H: FocuserLocalClientHandler<___T>,
2384    ___T: ::fidl_next::Transport,
2385{
2386    async fn on_event(
2387        handler: &mut ___H,
2388        mut message: ::fidl_next::Message<___T>,
2389    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2390        match *message.header().ordinal {
2391            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2392        }
2393    }
2394}
2395
2396#[diagnostic::on_unimplemented(
2397    note = "If {Self} implements the non-local FocuserServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2398)]
2399
2400/// A server handler for the Focuser protocol.
2401///
2402/// See [`Focuser`] for more details.
2403pub trait FocuserLocalServerHandler<
2404    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2405    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2406>
2407{
2408    #[doc = " Asks the server to transfer focus to the View specified by `view_ref`,\n with the authority of the requestor ViewRef. Such a request may be\n honored or denied.\n\n If the request was honored, and it triggers a focus change, a FocusEvent\n (with focused=true) is issued to the newly-focused View, and a\n FocusEvent (with focused=false) is issued to the previous View.\n\n The result callback indicates that the request was received and honored.\n It does not guarantee that the requested View actually received a\n FocusEvent in time.\n\n The request may be denied for many reasons, for example:\n - if `view_ref` is invalid\n - if there is no View backed by `view_ref`\n - if there is no requestor ViewRef accessible to Focuser\n - if the requestor ViewRef lacks authority over `view_ref`\'s View\n - if `view_ref`\'s View is not hittable or may not receive focus\n etc. A denied request is indicated with a Error.\n"]
2409    fn request_focus(
2410        &mut self,
2411
2412        request: ::fidl_next::Request<focuser::RequestFocus, ___T>,
2413
2414        responder: ::fidl_next::Responder<focuser::RequestFocus, ___T>,
2415    ) -> impl ::core::future::Future<Output = ()>;
2416
2417    #[doc = " Sets the auto focus target to the View specified by `view_ref`.\n To unset the target, pass in an empty table.\n\n If a target has been set, then whenever the caller\'s View would receive\n focus, an attempt is made to transfer focus immediately to the target\n instead. If the target is unfocusable, the new target is the first\n focusable ancestor of the target instead. Setting an auto focus target\n places no limitations on simultaneous use of RequestFocus().\n\n An auto focus target is \"valid\" only while it is a descendant of the\n caller\'s View in the ViewTree. Specifying an invalid auto focus target is\n allowed, since it may become valid later.\n It is the client\'s responsibility to ensure the target is a valid\n receiver of auto focus.\n\n If the target is invalid when the auto focus behavior would trigger, then\n the attempt to move focus will silently fail and focus will remain with\n the caller\'s View.\n A target may become invalid and then become valid again any number of\n times; auto focus will continue to function whenever the target is\n in a valid state, and will continue to ignore the target while it\'s in an\n invalid state.\n\n If the focus would by some further automatic mechanism return to the\n caller\'s View (e.g. if the target is unfocusable), then focus will\n remain with the caller\'s View.\n\n AutoFocusError is currently never returned, and is reserved for possible\n future use.\n"]
2418    fn set_auto_focus(
2419        &mut self,
2420
2421        request: ::fidl_next::Request<focuser::SetAutoFocus, ___T>,
2422
2423        responder: ::fidl_next::Responder<focuser::SetAutoFocus, ___T>,
2424    ) -> impl ::core::future::Future<Output = ()>;
2425}
2426
2427impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Focuser
2428where
2429    ___H: FocuserLocalServerHandler<___T>,
2430    ___T: ::fidl_next::Transport,
2431    for<'de> crate::wire::FocuserRequestFocusRequest: ::fidl_next::Decode<
2432            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2433            Constraint = (),
2434        >,
2435    for<'de> crate::wire::FocuserSetAutoFocusRequest<'de>: ::fidl_next::Decode<
2436            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2437            Constraint = (),
2438        >,
2439{
2440    async fn on_one_way(
2441        handler: &mut ___H,
2442        mut message: ::fidl_next::Message<___T>,
2443    ) -> ::core::result::Result<
2444        (),
2445        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2446    > {
2447        match *message.header().ordinal {
2448            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2449        }
2450    }
2451
2452    async fn on_two_way(
2453        handler: &mut ___H,
2454        mut message: ::fidl_next::Message<___T>,
2455        responder: ::fidl_next::protocol::Responder<___T>,
2456    ) -> ::core::result::Result<
2457        (),
2458        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2459    > {
2460        match *message.header().ordinal {
2461            385346384312702933 => {
2462                let responder = ::fidl_next::Responder::from_untyped(responder);
2463
2464                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2465                    Ok(decoded) => {
2466                        handler
2467                            .request_focus(::fidl_next::Request::from_decoded(decoded), responder)
2468                            .await;
2469                        Ok(())
2470                    }
2471                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2472                        ordinal: 385346384312702933,
2473                        error,
2474                    }),
2475                }
2476            }
2477
2478            5192627660017276169 => {
2479                let responder = ::fidl_next::Responder::from_untyped(responder);
2480
2481                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2482                    Ok(decoded) => {
2483                        handler
2484                            .set_auto_focus(::fidl_next::Request::from_decoded(decoded), responder)
2485                            .await;
2486                        Ok(())
2487                    }
2488                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2489                        ordinal: 5192627660017276169,
2490                        error,
2491                    }),
2492                }
2493            }
2494
2495            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2496        }
2497    }
2498}
2499
2500/// A client handler for the Focuser protocol.
2501///
2502/// See [`Focuser`] for more details.
2503pub trait FocuserClientHandler<
2504    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2505    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2506>
2507{
2508}
2509
2510impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Focuser
2511where
2512    ___H: FocuserClientHandler<___T> + ::core::marker::Send,
2513    ___T: ::fidl_next::Transport,
2514{
2515    async fn on_event(
2516        handler: &mut ___H,
2517        mut message: ::fidl_next::Message<___T>,
2518    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2519        match *message.header().ordinal {
2520            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2521        }
2522    }
2523}
2524
2525/// A server handler for the Focuser protocol.
2526///
2527/// See [`Focuser`] for more details.
2528pub trait FocuserServerHandler<
2529    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2530    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2531>
2532{
2533    #[doc = " Asks the server to transfer focus to the View specified by `view_ref`,\n with the authority of the requestor ViewRef. Such a request may be\n honored or denied.\n\n If the request was honored, and it triggers a focus change, a FocusEvent\n (with focused=true) is issued to the newly-focused View, and a\n FocusEvent (with focused=false) is issued to the previous View.\n\n The result callback indicates that the request was received and honored.\n It does not guarantee that the requested View actually received a\n FocusEvent in time.\n\n The request may be denied for many reasons, for example:\n - if `view_ref` is invalid\n - if there is no View backed by `view_ref`\n - if there is no requestor ViewRef accessible to Focuser\n - if the requestor ViewRef lacks authority over `view_ref`\'s View\n - if `view_ref`\'s View is not hittable or may not receive focus\n etc. A denied request is indicated with a Error.\n"]
2534    fn request_focus(
2535        &mut self,
2536
2537        request: ::fidl_next::Request<focuser::RequestFocus, ___T>,
2538
2539        responder: ::fidl_next::Responder<focuser::RequestFocus, ___T>,
2540    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2541
2542    #[doc = " Sets the auto focus target to the View specified by `view_ref`.\n To unset the target, pass in an empty table.\n\n If a target has been set, then whenever the caller\'s View would receive\n focus, an attempt is made to transfer focus immediately to the target\n instead. If the target is unfocusable, the new target is the first\n focusable ancestor of the target instead. Setting an auto focus target\n places no limitations on simultaneous use of RequestFocus().\n\n An auto focus target is \"valid\" only while it is a descendant of the\n caller\'s View in the ViewTree. Specifying an invalid auto focus target is\n allowed, since it may become valid later.\n It is the client\'s responsibility to ensure the target is a valid\n receiver of auto focus.\n\n If the target is invalid when the auto focus behavior would trigger, then\n the attempt to move focus will silently fail and focus will remain with\n the caller\'s View.\n A target may become invalid and then become valid again any number of\n times; auto focus will continue to function whenever the target is\n in a valid state, and will continue to ignore the target while it\'s in an\n invalid state.\n\n If the focus would by some further automatic mechanism return to the\n caller\'s View (e.g. if the target is unfocusable), then focus will\n remain with the caller\'s View.\n\n AutoFocusError is currently never returned, and is reserved for possible\n future use.\n"]
2543    fn set_auto_focus(
2544        &mut self,
2545
2546        request: ::fidl_next::Request<focuser::SetAutoFocus, ___T>,
2547
2548        responder: ::fidl_next::Responder<focuser::SetAutoFocus, ___T>,
2549    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2550}
2551
2552impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Focuser
2553where
2554    ___H: FocuserServerHandler<___T> + ::core::marker::Send,
2555    ___T: ::fidl_next::Transport,
2556    for<'de> crate::wire::FocuserRequestFocusRequest: ::fidl_next::Decode<
2557            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2558            Constraint = (),
2559        >,
2560    for<'de> crate::wire::FocuserSetAutoFocusRequest<'de>: ::fidl_next::Decode<
2561            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2562            Constraint = (),
2563        >,
2564{
2565    async fn on_one_way(
2566        handler: &mut ___H,
2567        mut message: ::fidl_next::Message<___T>,
2568    ) -> ::core::result::Result<
2569        (),
2570        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2571    > {
2572        match *message.header().ordinal {
2573            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2574        }
2575    }
2576
2577    async fn on_two_way(
2578        handler: &mut ___H,
2579        mut message: ::fidl_next::Message<___T>,
2580        responder: ::fidl_next::protocol::Responder<___T>,
2581    ) -> ::core::result::Result<
2582        (),
2583        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2584    > {
2585        match *message.header().ordinal {
2586            385346384312702933 => {
2587                let responder = ::fidl_next::Responder::from_untyped(responder);
2588
2589                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2590                    Ok(decoded) => {
2591                        handler
2592                            .request_focus(::fidl_next::Request::from_decoded(decoded), responder)
2593                            .await;
2594                        Ok(())
2595                    }
2596                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2597                        ordinal: 385346384312702933,
2598                        error,
2599                    }),
2600                }
2601            }
2602
2603            5192627660017276169 => {
2604                let responder = ::fidl_next::Responder::from_untyped(responder);
2605
2606                match ::fidl_next::AsDecoderExt::into_decoded(message) {
2607                    Ok(decoded) => {
2608                        handler
2609                            .set_auto_focus(::fidl_next::Request::from_decoded(decoded), responder)
2610                            .await;
2611                        Ok(())
2612                    }
2613                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2614                        ordinal: 5192627660017276169,
2615                        error,
2616                    }),
2617                }
2618            }
2619
2620            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2621        }
2622    }
2623}
2624
2625impl<___T> FocuserClientHandler<___T> for ::fidl_next::IgnoreEvents where
2626    ___T: ::fidl_next::Transport
2627{
2628}
2629
2630impl<___H, ___T> FocuserLocalClientHandler<___T> for ::fidl_next::Local<___H>
2631where
2632    ___H: FocuserClientHandler<___T>,
2633    ___T: ::fidl_next::Transport,
2634{
2635}
2636
2637impl<___H, ___T> FocuserLocalServerHandler<___T> for ::fidl_next::Local<___H>
2638where
2639    ___H: FocuserServerHandler<___T>,
2640    ___T: ::fidl_next::Transport,
2641{
2642    async fn request_focus(
2643        &mut self,
2644
2645        request: ::fidl_next::Request<focuser::RequestFocus, ___T>,
2646
2647        responder: ::fidl_next::Responder<focuser::RequestFocus, ___T>,
2648    ) {
2649        ___H::request_focus(&mut self.0, request, responder).await
2650    }
2651
2652    async fn set_auto_focus(
2653        &mut self,
2654
2655        request: ::fidl_next::Request<focuser::SetAutoFocus, ___T>,
2656
2657        responder: ::fidl_next::Responder<focuser::SetAutoFocus, ___T>,
2658    ) {
2659        ___H::set_auto_focus(&mut self.0, request, responder).await
2660    }
2661}
2662
2663/// The type corresponding to the View protocol.
2664#[doc = " Deprecated API for view creation. DO NOT USE.\n"]
2665#[derive(PartialEq, Debug)]
2666pub struct View;
2667
2668impl ::fidl_next::Discoverable for View {
2669    const PROTOCOL_NAME: &'static str = "fuchsia.ui.views.View";
2670}
2671
2672#[cfg(target_os = "fuchsia")]
2673impl ::fidl_next::HasTransport for View {
2674    type Transport = ::fidl_next::fuchsia::zx::Channel;
2675}
2676
2677pub mod view {
2678    pub mod prelude {
2679        pub use crate::{
2680            View, ViewClientHandler, ViewLocalClientHandler, ViewLocalServerHandler,
2681            ViewServerHandler, view,
2682        };
2683
2684        pub use crate::natural::ViewPresentRequest;
2685    }
2686
2687    pub struct Present;
2688
2689    impl ::fidl_next::Method for Present {
2690        const ORDINAL: u64 = 7969378779654942110;
2691        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2692            ::fidl_next::protocol::Flexibility::Strict;
2693
2694        type Protocol = crate::View;
2695
2696        type Request = crate::wire::ViewPresentRequest;
2697    }
2698
2699    mod ___detail {
2700        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::View
2701        where
2702            ___T: ::fidl_next::Transport,
2703        {
2704            type Client = ViewClient<___T>;
2705            type Server = ViewServer<___T>;
2706        }
2707
2708        /// The client for the `View` protocol.
2709        #[repr(transparent)]
2710        pub struct ViewClient<___T: ::fidl_next::Transport> {
2711            #[allow(dead_code)]
2712            client: ::fidl_next::protocol::Client<___T>,
2713        }
2714
2715        impl<___T> ViewClient<___T>
2716        where
2717            ___T: ::fidl_next::Transport,
2718        {
2719            #[doc = " Provides the View with an attachment point to Scenic\'s scene graph.\n\n When `Present()` is called the View\'s implementation should create a\n View resource within Scenic by providing it with the `view_token` (using\n a `fuchsia.ui.gfx.CreateResourceCmd` and `fuchsia.ui.gfx.ViewArgs`).\n\n Then the implementation should attach its graphical content to the\n newly-created View resource using a `fuchsia.ui.gfx.AddChildCmd`.\n\n If the implementation already owns a View resource (because `Present()`\n had already been called before), then it should terminate the connection\n with an error.\n\n TODO(https://fxbug.dev/42098670): Allow re-parenting `View`s with a new `Present()` call.\n"]
2720            pub fn present(
2721                &self,
2722
2723                view_token: impl ::fidl_next::Encode<
2724                    crate::wire::ViewToken,
2725                    <___T as ::fidl_next::Transport>::SendBuffer,
2726                >,
2727            ) -> ::fidl_next::SendFuture<'_, ___T>
2728            where
2729                <___T as ::fidl_next::Transport>::SendBuffer:
2730                    ::fidl_next::encoder::InternalHandleEncoder,
2731                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2732            {
2733                self.present_with(crate::generic::ViewPresentRequest { view_token })
2734            }
2735
2736            #[doc = " Provides the View with an attachment point to Scenic\'s scene graph.\n\n When `Present()` is called the View\'s implementation should create a\n View resource within Scenic by providing it with the `view_token` (using\n a `fuchsia.ui.gfx.CreateResourceCmd` and `fuchsia.ui.gfx.ViewArgs`).\n\n Then the implementation should attach its graphical content to the\n newly-created View resource using a `fuchsia.ui.gfx.AddChildCmd`.\n\n If the implementation already owns a View resource (because `Present()`\n had already been called before), then it should terminate the connection\n with an error.\n\n TODO(https://fxbug.dev/42098670): Allow re-parenting `View`s with a new `Present()` call.\n"]
2737            pub fn present_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
2738            where
2739                ___R: ::fidl_next::Encode<
2740                        crate::wire::ViewPresentRequest,
2741                        <___T as ::fidl_next::Transport>::SendBuffer,
2742                    >,
2743            {
2744                ::fidl_next::SendFuture::from_untyped(self.client.send_one_way(
2745                    7969378779654942110,
2746                    <super::Present as ::fidl_next::Method>::FLEXIBILITY,
2747                    request,
2748                ))
2749            }
2750        }
2751
2752        /// The server for the `View` protocol.
2753        #[repr(transparent)]
2754        pub struct ViewServer<___T: ::fidl_next::Transport> {
2755            server: ::fidl_next::protocol::Server<___T>,
2756        }
2757
2758        impl<___T> ViewServer<___T> where ___T: ::fidl_next::Transport {}
2759    }
2760}
2761
2762#[diagnostic::on_unimplemented(
2763    note = "If {Self} implements the non-local ViewClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2764)]
2765
2766/// A client handler for the View protocol.
2767///
2768/// See [`View`] for more details.
2769pub trait ViewLocalClientHandler<
2770    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2771    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2772>
2773{
2774}
2775
2776impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for View
2777where
2778    ___H: ViewLocalClientHandler<___T>,
2779    ___T: ::fidl_next::Transport,
2780{
2781    async fn on_event(
2782        handler: &mut ___H,
2783        mut message: ::fidl_next::Message<___T>,
2784    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2785        match *message.header().ordinal {
2786            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2787        }
2788    }
2789}
2790
2791#[diagnostic::on_unimplemented(
2792    note = "If {Self} implements the non-local ViewServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2793)]
2794
2795/// A server handler for the View protocol.
2796///
2797/// See [`View`] for more details.
2798pub trait ViewLocalServerHandler<
2799    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2800    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2801>
2802{
2803    #[doc = " Provides the View with an attachment point to Scenic\'s scene graph.\n\n When `Present()` is called the View\'s implementation should create a\n View resource within Scenic by providing it with the `view_token` (using\n a `fuchsia.ui.gfx.CreateResourceCmd` and `fuchsia.ui.gfx.ViewArgs`).\n\n Then the implementation should attach its graphical content to the\n newly-created View resource using a `fuchsia.ui.gfx.AddChildCmd`.\n\n If the implementation already owns a View resource (because `Present()`\n had already been called before), then it should terminate the connection\n with an error.\n\n TODO(https://fxbug.dev/42098670): Allow re-parenting `View`s with a new `Present()` call.\n"]
2804    fn present(
2805        &mut self,
2806
2807        request: ::fidl_next::Request<view::Present, ___T>,
2808    ) -> impl ::core::future::Future<Output = ()>;
2809}
2810
2811impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for View
2812where
2813    ___H: ViewLocalServerHandler<___T>,
2814    ___T: ::fidl_next::Transport,
2815    for<'de> crate::wire::ViewPresentRequest: ::fidl_next::Decode<
2816            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2817            Constraint = (),
2818        >,
2819{
2820    async fn on_one_way(
2821        handler: &mut ___H,
2822        mut message: ::fidl_next::Message<___T>,
2823    ) -> ::core::result::Result<
2824        (),
2825        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2826    > {
2827        match *message.header().ordinal {
2828            7969378779654942110 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
2829                Ok(decoded) => {
2830                    handler.present(::fidl_next::Request::from_decoded(decoded)).await;
2831                    Ok(())
2832                }
2833                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2834                    ordinal: 7969378779654942110,
2835                    error,
2836                }),
2837            },
2838
2839            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2840        }
2841    }
2842
2843    async fn on_two_way(
2844        handler: &mut ___H,
2845        mut message: ::fidl_next::Message<___T>,
2846        responder: ::fidl_next::protocol::Responder<___T>,
2847    ) -> ::core::result::Result<
2848        (),
2849        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2850    > {
2851        match *message.header().ordinal {
2852            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2853        }
2854    }
2855}
2856
2857/// A client handler for the View protocol.
2858///
2859/// See [`View`] for more details.
2860pub trait ViewClientHandler<
2861    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2862    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2863>
2864{
2865}
2866
2867impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for View
2868where
2869    ___H: ViewClientHandler<___T> + ::core::marker::Send,
2870    ___T: ::fidl_next::Transport,
2871{
2872    async fn on_event(
2873        handler: &mut ___H,
2874        mut message: ::fidl_next::Message<___T>,
2875    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2876        match *message.header().ordinal {
2877            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2878        }
2879    }
2880}
2881
2882/// A server handler for the View protocol.
2883///
2884/// See [`View`] for more details.
2885pub trait ViewServerHandler<
2886    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2887    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2888>
2889{
2890    #[doc = " Provides the View with an attachment point to Scenic\'s scene graph.\n\n When `Present()` is called the View\'s implementation should create a\n View resource within Scenic by providing it with the `view_token` (using\n a `fuchsia.ui.gfx.CreateResourceCmd` and `fuchsia.ui.gfx.ViewArgs`).\n\n Then the implementation should attach its graphical content to the\n newly-created View resource using a `fuchsia.ui.gfx.AddChildCmd`.\n\n If the implementation already owns a View resource (because `Present()`\n had already been called before), then it should terminate the connection\n with an error.\n\n TODO(https://fxbug.dev/42098670): Allow re-parenting `View`s with a new `Present()` call.\n"]
2891    fn present(
2892        &mut self,
2893
2894        request: ::fidl_next::Request<view::Present, ___T>,
2895    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2896}
2897
2898impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for View
2899where
2900    ___H: ViewServerHandler<___T> + ::core::marker::Send,
2901    ___T: ::fidl_next::Transport,
2902    for<'de> crate::wire::ViewPresentRequest: ::fidl_next::Decode<
2903            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
2904            Constraint = (),
2905        >,
2906{
2907    async fn on_one_way(
2908        handler: &mut ___H,
2909        mut message: ::fidl_next::Message<___T>,
2910    ) -> ::core::result::Result<
2911        (),
2912        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2913    > {
2914        match *message.header().ordinal {
2915            7969378779654942110 => match ::fidl_next::AsDecoderExt::into_decoded(message) {
2916                Ok(decoded) => {
2917                    handler.present(::fidl_next::Request::from_decoded(decoded)).await;
2918                    Ok(())
2919                }
2920                Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2921                    ordinal: 7969378779654942110,
2922                    error,
2923                }),
2924            },
2925
2926            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2927        }
2928    }
2929
2930    async fn on_two_way(
2931        handler: &mut ___H,
2932        mut message: ::fidl_next::Message<___T>,
2933        responder: ::fidl_next::protocol::Responder<___T>,
2934    ) -> ::core::result::Result<
2935        (),
2936        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2937    > {
2938        match *message.header().ordinal {
2939            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
2940        }
2941    }
2942}
2943
2944impl<___T> ViewClientHandler<___T> for ::fidl_next::IgnoreEvents where ___T: ::fidl_next::Transport {}
2945
2946impl<___H, ___T> ViewLocalClientHandler<___T> for ::fidl_next::Local<___H>
2947where
2948    ___H: ViewClientHandler<___T>,
2949    ___T: ::fidl_next::Transport,
2950{
2951}
2952
2953impl<___H, ___T> ViewLocalServerHandler<___T> for ::fidl_next::Local<___H>
2954where
2955    ___H: ViewServerHandler<___T>,
2956    ___T: ::fidl_next::Transport,
2957{
2958    async fn present(&mut self, request: ::fidl_next::Request<view::Present, ___T>) {
2959        ___H::present(&mut self.0, request).await
2960    }
2961}
2962
2963/// The type corresponding to the ViewRefInstalled protocol.
2964#[doc = " A method of enabling ViewRef holders to determine if a ViewRef has been\n \"installed\" in the view tree: the time it is first connected, transitively,\n to the root view.  Typically, after installation, view focus may be\n transferred to that ViewRef.\n\n Note: It\'s important to distinguish between a ViewRef\'s installed status and\n       current connected-to-view-tree status.  The former undergoes a state\n       change once, from \"no\" to \"yes\".  The latter may change continuously,\n       depending on view tree topology.  As such, \"installed\" cannot imply\n       \"currently connected to view tree\"; even a hypothetical\n       \"ViewRefConnected\" protocol is fundamentally racy.\n"]
2965#[derive(PartialEq, Debug)]
2966pub struct ViewRefInstalled;
2967
2968impl ::fidl_next::Discoverable for ViewRefInstalled {
2969    const PROTOCOL_NAME: &'static str = "fuchsia.ui.views.ViewRefInstalled";
2970}
2971
2972#[cfg(target_os = "fuchsia")]
2973impl ::fidl_next::HasTransport for ViewRefInstalled {
2974    type Transport = ::fidl_next::fuchsia::zx::Channel;
2975}
2976
2977pub mod view_ref_installed {
2978    pub mod prelude {
2979        pub use crate::{
2980            ViewRefInstalled, ViewRefInstalledClientHandler, ViewRefInstalledLocalClientHandler,
2981            ViewRefInstalledLocalServerHandler, ViewRefInstalledServerHandler, view_ref_installed,
2982        };
2983
2984        pub use crate::natural::ViewRefInstalledError;
2985
2986        pub use crate::natural::ViewRefInstalledWatchRequest;
2987
2988        pub use crate::natural::ViewRefInstalledWatchResponse;
2989    }
2990
2991    pub struct Watch;
2992
2993    impl ::fidl_next::Method for Watch {
2994        const ORDINAL: u64 = 9069901056194410865;
2995        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2996            ::fidl_next::protocol::Flexibility::Strict;
2997
2998        type Protocol = crate::ViewRefInstalled;
2999
3000        type Request = crate::wire::ViewRefInstalledWatchRequest;
3001    }
3002
3003    impl ::fidl_next::TwoWayMethod for Watch {
3004        type Response = ::fidl_next::wire::Result<
3005            'static,
3006            crate::wire::ViewRefInstalledWatchResponse,
3007            crate::wire::ViewRefInstalledError,
3008        >;
3009    }
3010
3011    impl<___R> ::fidl_next::Respond<___R> for Watch {
3012        type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
3013
3014        fn respond(response: ___R) -> Self::Output {
3015            ::core::result::Result::Ok(response)
3016        }
3017    }
3018
3019    impl<___R> ::fidl_next::RespondErr<___R> for Watch {
3020        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3021
3022        fn respond_err(response: ___R) -> Self::Output {
3023            ::core::result::Result::Err(response)
3024        }
3025    }
3026
3027    mod ___detail {
3028        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::ViewRefInstalled
3029        where
3030            ___T: ::fidl_next::Transport,
3031        {
3032            type Client = ViewRefInstalledClient<___T>;
3033            type Server = ViewRefInstalledServer<___T>;
3034        }
3035
3036        /// The client for the `ViewRefInstalled` protocol.
3037        #[repr(transparent)]
3038        pub struct ViewRefInstalledClient<___T: ::fidl_next::Transport> {
3039            #[allow(dead_code)]
3040            client: ::fidl_next::protocol::Client<___T>,
3041        }
3042
3043        impl<___T> ViewRefInstalledClient<___T>
3044        where
3045            ___T: ::fidl_next::Transport,
3046        {
3047            #[doc = " Sets up a callback to fire when the requested |view_ref| is installed.\n - If |view_ref| has not already been installed, the |Watch| response\n   will fire when it is.\n - If |view_ref| has already been installed, the |Watch| response will\n   fire immediately.\n - If |view_ref| is invalid, or becomes invalid (perhaps because the view\n   was destroyed), the |Watch| call returns with an error.  The error is\n   not guaranteed to be immediate, but a ViewRef holder can itself\n   determine ViewRef validity by listening for ZX_EVENTPAIR_PEER_CLOSED.\n\n Flow control: The caller is allowed multiple |Watch| calls on multiple\n ViewRefs. There is at most one response per call back to the client.\n\n Note: Prior to installation, this |Watch| call is kept alive as long as\n       the ViewRef is valid.\n"]
3048            pub fn watch(
3049                &self,
3050
3051                view_ref: impl ::fidl_next::Encode<
3052                    crate::wire::ViewRef,
3053                    <___T as ::fidl_next::Transport>::SendBuffer,
3054                >,
3055            ) -> ::fidl_next::TwoWayFuture<'_, super::Watch, ___T>
3056            where
3057                <___T as ::fidl_next::Transport>::SendBuffer:
3058                    ::fidl_next::encoder::InternalHandleEncoder,
3059                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3060            {
3061                self.watch_with(crate::generic::ViewRefInstalledWatchRequest { view_ref })
3062            }
3063
3064            #[doc = " Sets up a callback to fire when the requested |view_ref| is installed.\n - If |view_ref| has not already been installed, the |Watch| response\n   will fire when it is.\n - If |view_ref| has already been installed, the |Watch| response will\n   fire immediately.\n - If |view_ref| is invalid, or becomes invalid (perhaps because the view\n   was destroyed), the |Watch| call returns with an error.  The error is\n   not guaranteed to be immediate, but a ViewRef holder can itself\n   determine ViewRef validity by listening for ZX_EVENTPAIR_PEER_CLOSED.\n\n Flow control: The caller is allowed multiple |Watch| calls on multiple\n ViewRefs. There is at most one response per call back to the client.\n\n Note: Prior to installation, this |Watch| call is kept alive as long as\n       the ViewRef is valid.\n"]
3065            pub fn watch_with<___R>(
3066                &self,
3067                request: ___R,
3068            ) -> ::fidl_next::TwoWayFuture<'_, super::Watch, ___T>
3069            where
3070                ___R: ::fidl_next::Encode<
3071                        crate::wire::ViewRefInstalledWatchRequest,
3072                        <___T as ::fidl_next::Transport>::SendBuffer,
3073                    >,
3074            {
3075                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3076                    9069901056194410865,
3077                    <super::Watch as ::fidl_next::Method>::FLEXIBILITY,
3078                    request,
3079                ))
3080            }
3081        }
3082
3083        /// The server for the `ViewRefInstalled` protocol.
3084        #[repr(transparent)]
3085        pub struct ViewRefInstalledServer<___T: ::fidl_next::Transport> {
3086            server: ::fidl_next::protocol::Server<___T>,
3087        }
3088
3089        impl<___T> ViewRefInstalledServer<___T> where ___T: ::fidl_next::Transport {}
3090    }
3091}
3092
3093#[diagnostic::on_unimplemented(
3094    note = "If {Self} implements the non-local ViewRefInstalledClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3095)]
3096
3097/// A client handler for the ViewRefInstalled protocol.
3098///
3099/// See [`ViewRefInstalled`] for more details.
3100pub trait ViewRefInstalledLocalClientHandler<
3101    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3102    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3103>
3104{
3105}
3106
3107impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for ViewRefInstalled
3108where
3109    ___H: ViewRefInstalledLocalClientHandler<___T>,
3110    ___T: ::fidl_next::Transport,
3111{
3112    async fn on_event(
3113        handler: &mut ___H,
3114        mut message: ::fidl_next::Message<___T>,
3115    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3116        match *message.header().ordinal {
3117            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3118        }
3119    }
3120}
3121
3122#[diagnostic::on_unimplemented(
3123    note = "If {Self} implements the non-local ViewRefInstalledServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3124)]
3125
3126/// A server handler for the ViewRefInstalled protocol.
3127///
3128/// See [`ViewRefInstalled`] for more details.
3129pub trait ViewRefInstalledLocalServerHandler<
3130    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3131    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3132>
3133{
3134    #[doc = " Sets up a callback to fire when the requested |view_ref| is installed.\n - If |view_ref| has not already been installed, the |Watch| response\n   will fire when it is.\n - If |view_ref| has already been installed, the |Watch| response will\n   fire immediately.\n - If |view_ref| is invalid, or becomes invalid (perhaps because the view\n   was destroyed), the |Watch| call returns with an error.  The error is\n   not guaranteed to be immediate, but a ViewRef holder can itself\n   determine ViewRef validity by listening for ZX_EVENTPAIR_PEER_CLOSED.\n\n Flow control: The caller is allowed multiple |Watch| calls on multiple\n ViewRefs. There is at most one response per call back to the client.\n\n Note: Prior to installation, this |Watch| call is kept alive as long as\n       the ViewRef is valid.\n"]
3135    fn watch(
3136        &mut self,
3137
3138        request: ::fidl_next::Request<view_ref_installed::Watch, ___T>,
3139
3140        responder: ::fidl_next::Responder<view_ref_installed::Watch, ___T>,
3141    ) -> impl ::core::future::Future<Output = ()>;
3142}
3143
3144impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for ViewRefInstalled
3145where
3146    ___H: ViewRefInstalledLocalServerHandler<___T>,
3147    ___T: ::fidl_next::Transport,
3148    for<'de> crate::wire::ViewRefInstalledWatchRequest: ::fidl_next::Decode<
3149            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3150            Constraint = (),
3151        >,
3152{
3153    async fn on_one_way(
3154        handler: &mut ___H,
3155        mut message: ::fidl_next::Message<___T>,
3156    ) -> ::core::result::Result<
3157        (),
3158        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3159    > {
3160        match *message.header().ordinal {
3161            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3162        }
3163    }
3164
3165    async fn on_two_way(
3166        handler: &mut ___H,
3167        mut message: ::fidl_next::Message<___T>,
3168        responder: ::fidl_next::protocol::Responder<___T>,
3169    ) -> ::core::result::Result<
3170        (),
3171        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3172    > {
3173        match *message.header().ordinal {
3174            9069901056194410865 => {
3175                let responder = ::fidl_next::Responder::from_untyped(responder);
3176
3177                match ::fidl_next::AsDecoderExt::into_decoded(message) {
3178                    Ok(decoded) => {
3179                        handler.watch(::fidl_next::Request::from_decoded(decoded), responder).await;
3180                        Ok(())
3181                    }
3182                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3183                        ordinal: 9069901056194410865,
3184                        error,
3185                    }),
3186                }
3187            }
3188
3189            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3190        }
3191    }
3192}
3193
3194/// A client handler for the ViewRefInstalled protocol.
3195///
3196/// See [`ViewRefInstalled`] for more details.
3197pub trait ViewRefInstalledClientHandler<
3198    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3199    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3200>
3201{
3202}
3203
3204impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ViewRefInstalled
3205where
3206    ___H: ViewRefInstalledClientHandler<___T> + ::core::marker::Send,
3207    ___T: ::fidl_next::Transport,
3208{
3209    async fn on_event(
3210        handler: &mut ___H,
3211        mut message: ::fidl_next::Message<___T>,
3212    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3213        match *message.header().ordinal {
3214            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3215        }
3216    }
3217}
3218
3219/// A server handler for the ViewRefInstalled protocol.
3220///
3221/// See [`ViewRefInstalled`] for more details.
3222pub trait ViewRefInstalledServerHandler<
3223    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3224    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3225>
3226{
3227    #[doc = " Sets up a callback to fire when the requested |view_ref| is installed.\n - If |view_ref| has not already been installed, the |Watch| response\n   will fire when it is.\n - If |view_ref| has already been installed, the |Watch| response will\n   fire immediately.\n - If |view_ref| is invalid, or becomes invalid (perhaps because the view\n   was destroyed), the |Watch| call returns with an error.  The error is\n   not guaranteed to be immediate, but a ViewRef holder can itself\n   determine ViewRef validity by listening for ZX_EVENTPAIR_PEER_CLOSED.\n\n Flow control: The caller is allowed multiple |Watch| calls on multiple\n ViewRefs. There is at most one response per call back to the client.\n\n Note: Prior to installation, this |Watch| call is kept alive as long as\n       the ViewRef is valid.\n"]
3228    fn watch(
3229        &mut self,
3230
3231        request: ::fidl_next::Request<view_ref_installed::Watch, ___T>,
3232
3233        responder: ::fidl_next::Responder<view_ref_installed::Watch, ___T>,
3234    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3235}
3236
3237impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ViewRefInstalled
3238where
3239    ___H: ViewRefInstalledServerHandler<___T> + ::core::marker::Send,
3240    ___T: ::fidl_next::Transport,
3241    for<'de> crate::wire::ViewRefInstalledWatchRequest: ::fidl_next::Decode<
3242            <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3243            Constraint = (),
3244        >,
3245{
3246    async fn on_one_way(
3247        handler: &mut ___H,
3248        mut message: ::fidl_next::Message<___T>,
3249    ) -> ::core::result::Result<
3250        (),
3251        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3252    > {
3253        match *message.header().ordinal {
3254            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3255        }
3256    }
3257
3258    async fn on_two_way(
3259        handler: &mut ___H,
3260        mut message: ::fidl_next::Message<___T>,
3261        responder: ::fidl_next::protocol::Responder<___T>,
3262    ) -> ::core::result::Result<
3263        (),
3264        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3265    > {
3266        match *message.header().ordinal {
3267            9069901056194410865 => {
3268                let responder = ::fidl_next::Responder::from_untyped(responder);
3269
3270                match ::fidl_next::AsDecoderExt::into_decoded(message) {
3271                    Ok(decoded) => {
3272                        handler.watch(::fidl_next::Request::from_decoded(decoded), responder).await;
3273                        Ok(())
3274                    }
3275                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3276                        ordinal: 9069901056194410865,
3277                        error,
3278                    }),
3279                }
3280            }
3281
3282            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
3283        }
3284    }
3285}
3286
3287impl<___T> ViewRefInstalledClientHandler<___T> for ::fidl_next::IgnoreEvents where
3288    ___T: ::fidl_next::Transport
3289{
3290}
3291
3292impl<___H, ___T> ViewRefInstalledLocalClientHandler<___T> for ::fidl_next::Local<___H>
3293where
3294    ___H: ViewRefInstalledClientHandler<___T>,
3295    ___T: ::fidl_next::Transport,
3296{
3297}
3298
3299impl<___H, ___T> ViewRefInstalledLocalServerHandler<___T> for ::fidl_next::Local<___H>
3300where
3301    ___H: ViewRefInstalledServerHandler<___T>,
3302    ___T: ::fidl_next::Transport,
3303{
3304    async fn watch(
3305        &mut self,
3306
3307        request: ::fidl_next::Request<view_ref_installed::Watch, ___T>,
3308
3309        responder: ::fidl_next::Responder<view_ref_installed::Watch, ___T>,
3310    ) {
3311        ___H::watch(&mut self.0, request, responder).await
3312    }
3313}
3314
3315pub use fidl_next_common_fuchsia_ui_views::*;