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