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