1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8 #[repr(u32)]
9 pub enum AutoFocusError {
10 UnknownOrdinal_(u32) = 0,
11 }
12 impl ::std::convert::From<u32> for AutoFocusError {
13 fn from(value: u32) -> Self {
14 match value {
15 _ => Self::UnknownOrdinal_(value),
16 }
17 }
18 }
19
20 unsafe impl<___E> ::fidl_next::Encode<crate::wire::AutoFocusError, ___E> for AutoFocusError
21 where
22 ___E: ?Sized,
23 {
24 #[inline]
25 fn encode(
26 self,
27 encoder: &mut ___E,
28 out: &mut ::core::mem::MaybeUninit<crate::wire::AutoFocusError>,
29 _: (),
30 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
31 ::fidl_next::Encode::encode(&self, encoder, out, ())
32 }
33 }
34
35 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::AutoFocusError, ___E> for &'a AutoFocusError
36 where
37 ___E: ?Sized,
38 {
39 #[inline]
40 fn encode(
41 self,
42 encoder: &mut ___E,
43 out: &mut ::core::mem::MaybeUninit<crate::wire::AutoFocusError>,
44 _: (),
45 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
46 ::fidl_next::munge!(let crate::wire::AutoFocusError { value } = out);
47 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
48 AutoFocusError::UnknownOrdinal_(value) => value,
49 }));
50
51 Ok(())
52 }
53 }
54
55 impl ::core::convert::From<crate::wire::AutoFocusError> for AutoFocusError {
56 fn from(wire: crate::wire::AutoFocusError) -> Self {
57 match u32::from(wire.value) {
58 value => Self::UnknownOrdinal_(value),
59 }
60 }
61 }
62
63 impl ::fidl_next::FromWire<crate::wire::AutoFocusError> for AutoFocusError {
64 #[inline]
65 fn from_wire(wire: crate::wire::AutoFocusError) -> Self {
66 Self::from(wire)
67 }
68 }
69
70 impl ::fidl_next::FromWireRef<crate::wire::AutoFocusError> for AutoFocusError {
71 #[inline]
72 fn from_wire_ref(wire: &crate::wire::AutoFocusError) -> Self {
73 Self::from(*wire)
74 }
75 }
76
77 #[doc = " DO NOT USE - Retained for ABI stability in fuchsia.ui.scenic.Command\n"]
78 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
79 pub enum Command {
80 Empty(i32),
81 }
82
83 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Command, ___E> for Command
84 where
85 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
86 {
87 #[inline]
88 fn encode(
89 self,
90 encoder: &mut ___E,
91 out: &mut ::core::mem::MaybeUninit<crate::wire::Command>,
92 _: (),
93 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
94 ::fidl_next::munge!(let crate::wire::Command { raw, _phantom: _ } = out);
95
96 match self {
97 Self::Empty(value) => ::fidl_next::wire::Union::encode_as_static::<
98 ___E,
99 ::fidl_next::wire::Int32,
100 >(value, 1, encoder, raw, ())?,
101 }
102
103 Ok(())
104 }
105 }
106
107 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Command, ___E> for &'a Command
108 where
109 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
110 {
111 #[inline]
112 fn encode(
113 self,
114 encoder: &mut ___E,
115 out: &mut ::core::mem::MaybeUninit<crate::wire::Command>,
116 _: (),
117 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
118 ::fidl_next::munge!(let crate::wire::Command { raw, _phantom: _ } = out);
119
120 match self {
121 Command::Empty(value) => ::fidl_next::wire::Union::encode_as_static::<
122 ___E,
123 ::fidl_next::wire::Int32,
124 >(value, 1, encoder, raw, ())?,
125 }
126
127 Ok(())
128 }
129 }
130
131 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::Command, ___E> for Command
132 where
133 ___E: ?Sized,
134 Command: ::fidl_next::Encode<crate::wire::Command, ___E>,
135 {
136 #[inline]
137 fn encode_option(
138 this: ::core::option::Option<Self>,
139 encoder: &mut ___E,
140 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Command>,
141 _: (),
142 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
143 ::fidl_next::munge!(let crate::wire_optional::Command { raw, _phantom: _ } = &mut *out);
144
145 if let Some(inner) = this {
146 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
147 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
148 } else {
149 ::fidl_next::wire::Union::encode_absent(raw);
150 }
151
152 Ok(())
153 }
154 }
155
156 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::Command, ___E> for &'a Command
157 where
158 ___E: ?Sized,
159 &'a Command: ::fidl_next::Encode<crate::wire::Command, ___E>,
160 {
161 #[inline]
162 fn encode_option(
163 this: ::core::option::Option<Self>,
164 encoder: &mut ___E,
165 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Command>,
166 _: (),
167 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
168 ::fidl_next::munge!(let crate::wire_optional::Command { raw, _phantom: _ } = &mut *out);
169
170 if let Some(inner) = this {
171 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
172 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
173 } else {
174 ::fidl_next::wire::Union::encode_absent(raw);
175 }
176
177 Ok(())
178 }
179 }
180
181 impl ::fidl_next::FromWire<crate::wire::Command> for Command {
182 #[inline]
183 fn from_wire(wire: crate::wire::Command) -> Self {
184 let wire = ::core::mem::ManuallyDrop::new(wire);
185 match wire.raw.ordinal() {
186 1 => Self::Empty(::fidl_next::FromWire::from_wire(unsafe {
187 wire.raw.get().read_unchecked::<::fidl_next::wire::Int32>()
188 })),
189
190 _ => unsafe { ::core::hint::unreachable_unchecked() },
191 }
192 }
193 }
194
195 impl ::fidl_next::FromWireRef<crate::wire::Command> for Command {
196 #[inline]
197 fn from_wire_ref(wire: &crate::wire::Command) -> Self {
198 match wire.raw.ordinal() {
199 1 => Self::Empty(::fidl_next::FromWireRef::from_wire_ref(unsafe {
200 wire.raw.get().deref_unchecked::<::fidl_next::wire::Int32>()
201 })),
202
203 _ => unsafe { ::core::hint::unreachable_unchecked() },
204 }
205 }
206 }
207
208 impl ::fidl_next::FromWireOption<crate::wire_optional::Command> for Command {
209 #[inline]
210 fn from_wire_option(wire: crate::wire_optional::Command) -> ::core::option::Option<Self> {
211 if let Some(inner) = wire.into_option() {
212 Some(::fidl_next::FromWire::from_wire(inner))
213 } else {
214 None
215 }
216 }
217 }
218
219 impl ::fidl_next::FromWireOption<crate::wire_optional::Command> for Box<Command> {
220 #[inline]
221 fn from_wire_option(wire: crate::wire_optional::Command) -> ::core::option::Option<Self> {
222 <
223 Command as ::fidl_next::FromWireOption<crate::wire_optional::Command>
224 >::from_wire_option(wire).map(Box::new)
225 }
226 }
227
228 impl ::fidl_next::FromWireOptionRef<crate::wire_optional::Command> for Box<Command> {
229 #[inline]
230 fn from_wire_option_ref(
231 wire: &crate::wire_optional::Command,
232 ) -> ::core::option::Option<Self> {
233 if let Some(inner) = wire.as_ref() {
234 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
235 } else {
236 None
237 }
238 }
239 }
240
241 #[doc = " Problematic situations that occur on Focuser.RequestFocus.\n"]
242 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
243 #[repr(u32)]
244 pub enum Error {
245 Denied = 1,
246 }
247 impl ::core::convert::TryFrom<u32> for Error {
248 type Error = ::fidl_next::UnknownStrictEnumMemberError;
249 fn try_from(
250 value: u32,
251 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
252 match value {
253 1 => Ok(Self::Denied),
254
255 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
256 }
257 }
258 }
259
260 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Error, ___E> for Error
261 where
262 ___E: ?Sized,
263 {
264 #[inline]
265 fn encode(
266 self,
267 encoder: &mut ___E,
268 out: &mut ::core::mem::MaybeUninit<crate::wire::Error>,
269 _: (),
270 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
271 ::fidl_next::Encode::encode(&self, encoder, out, ())
272 }
273 }
274
275 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Error, ___E> for &'a Error
276 where
277 ___E: ?Sized,
278 {
279 #[inline]
280 fn encode(
281 self,
282 encoder: &mut ___E,
283 out: &mut ::core::mem::MaybeUninit<crate::wire::Error>,
284 _: (),
285 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
286 ::fidl_next::munge!(let crate::wire::Error { value } = out);
287 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
288 Error::Denied => 1,
289 }));
290
291 Ok(())
292 }
293 }
294
295 impl ::core::convert::From<crate::wire::Error> for Error {
296 fn from(wire: crate::wire::Error) -> Self {
297 match u32::from(wire.value) {
298 1 => Self::Denied,
299
300 _ => unsafe { ::core::hint::unreachable_unchecked() },
301 }
302 }
303 }
304
305 impl ::fidl_next::FromWire<crate::wire::Error> for Error {
306 #[inline]
307 fn from_wire(wire: crate::wire::Error) -> Self {
308 Self::from(wire)
309 }
310 }
311
312 impl ::fidl_next::FromWireRef<crate::wire::Error> for Error {
313 #[inline]
314 fn from_wire_ref(wire: &crate::wire::Error) -> Self {
315 Self::from(*wire)
316 }
317 }
318
319 #[doc = " A ViewRef\'s state of focus.\n"]
320 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
321 pub struct FocusState {
322 pub focused: ::core::option::Option<bool>,
323 }
324
325 impl FocusState {
326 fn __max_ordinal(&self) -> usize {
327 if self.focused.is_some() {
328 return 1;
329 }
330
331 0
332 }
333 }
334
335 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FocusState<'static>, ___E> for FocusState
336 where
337 ___E: ::fidl_next::Encoder + ?Sized,
338 {
339 #[inline]
340 fn encode(
341 mut self,
342 encoder: &mut ___E,
343 out: &mut ::core::mem::MaybeUninit<crate::wire::FocusState<'static>>,
344 _: (),
345 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
346 ::fidl_next::munge!(let crate::wire::FocusState { table } = out);
347
348 let max_ord = self.__max_ordinal();
349
350 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
351 ::fidl_next::Wire::zero_padding(&mut out);
352
353 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
354 ::fidl_next::wire::Envelope,
355 >(encoder, max_ord);
356
357 for i in 1..=max_ord {
358 match i {
359 1 => {
360 if let Some(value) = self.focused.take() {
361 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
362 value,
363 preallocated.encoder,
364 &mut out,
365 (),
366 )?;
367 } else {
368 ::fidl_next::wire::Envelope::encode_zero(&mut out)
369 }
370 }
371
372 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
373 }
374 unsafe {
375 preallocated.write_next(out.assume_init_ref());
376 }
377 }
378
379 ::fidl_next::wire::Table::encode_len(table, max_ord);
380
381 Ok(())
382 }
383 }
384
385 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FocusState<'static>, ___E> for &'a FocusState
386 where
387 ___E: ::fidl_next::Encoder + ?Sized,
388 {
389 #[inline]
390 fn encode(
391 self,
392 encoder: &mut ___E,
393 out: &mut ::core::mem::MaybeUninit<crate::wire::FocusState<'static>>,
394 _: (),
395 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
396 ::fidl_next::munge!(let crate::wire::FocusState { table } = out);
397
398 let max_ord = self.__max_ordinal();
399
400 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
401 ::fidl_next::Wire::zero_padding(&mut out);
402
403 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
404 ::fidl_next::wire::Envelope,
405 >(encoder, max_ord);
406
407 for i in 1..=max_ord {
408 match i {
409 1 => {
410 if let Some(value) = &self.focused {
411 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
412 value,
413 preallocated.encoder,
414 &mut out,
415 (),
416 )?;
417 } else {
418 ::fidl_next::wire::Envelope::encode_zero(&mut out)
419 }
420 }
421
422 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
423 }
424 unsafe {
425 preallocated.write_next(out.assume_init_ref());
426 }
427 }
428
429 ::fidl_next::wire::Table::encode_len(table, max_ord);
430
431 Ok(())
432 }
433 }
434
435 impl<'de> ::fidl_next::FromWire<crate::wire::FocusState<'de>> for FocusState {
436 #[inline]
437 fn from_wire(wire_: crate::wire::FocusState<'de>) -> Self {
438 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
439
440 let focused = wire_.table.get(1);
441
442 Self {
443 focused: focused.map(|envelope| {
444 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
445 }),
446 }
447 }
448 }
449
450 impl<'de> ::fidl_next::FromWireRef<crate::wire::FocusState<'de>> for FocusState {
451 #[inline]
452 fn from_wire_ref(wire: &crate::wire::FocusState<'de>) -> Self {
453 Self {
454 focused: wire.table.get(1).map(|envelope| {
455 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
456 envelope.deref_unchecked::<bool>()
457 })
458 }),
459 }
460 }
461 }
462
463 pub type FocuserRequestFocusResponse = ();
464
465 pub type FocuserSetAutoFocusResponse = ();
466
467 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
468 pub struct ViewRefFocusedWatchResponse {
469 pub state: crate::natural::FocusState,
470 }
471
472 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ViewRefFocusedWatchResponse<'static>, ___E>
473 for ViewRefFocusedWatchResponse
474 where
475 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
476 ___E: ::fidl_next::Encoder,
477 {
478 #[inline]
479 fn encode(
480 self,
481 encoder_: &mut ___E,
482 out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewRefFocusedWatchResponse<'static>>,
483 _: (),
484 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
485 ::fidl_next::munge! {
486 let crate::wire::ViewRefFocusedWatchResponse {
487 state,
488
489 } = out_;
490 }
491
492 ::fidl_next::Encode::encode(self.state, encoder_, state, ())?;
493
494 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(state.as_mut_ptr()) };
495
496 Ok(())
497 }
498 }
499
500 unsafe impl<'a, ___E>
501 ::fidl_next::Encode<crate::wire::ViewRefFocusedWatchResponse<'static>, ___E>
502 for &'a ViewRefFocusedWatchResponse
503 where
504 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
505 ___E: ::fidl_next::Encoder,
506 {
507 #[inline]
508 fn encode(
509 self,
510 encoder_: &mut ___E,
511 out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewRefFocusedWatchResponse<'static>>,
512 _: (),
513 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
514 ::fidl_next::munge! {
515 let crate::wire::ViewRefFocusedWatchResponse {
516 state,
517
518 } = out_;
519 }
520
521 ::fidl_next::Encode::encode(&self.state, encoder_, state, ())?;
522
523 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(state.as_mut_ptr()) };
524
525 Ok(())
526 }
527 }
528
529 unsafe impl<___E>
530 ::fidl_next::EncodeOption<
531 ::fidl_next::wire::Box<'static, crate::wire::ViewRefFocusedWatchResponse<'static>>,
532 ___E,
533 > for ViewRefFocusedWatchResponse
534 where
535 ___E: ::fidl_next::Encoder + ?Sized,
536 ViewRefFocusedWatchResponse:
537 ::fidl_next::Encode<crate::wire::ViewRefFocusedWatchResponse<'static>, ___E>,
538 {
539 #[inline]
540 fn encode_option(
541 this: ::core::option::Option<Self>,
542 encoder: &mut ___E,
543 out: &mut ::core::mem::MaybeUninit<
544 ::fidl_next::wire::Box<'static, crate::wire::ViewRefFocusedWatchResponse<'static>>,
545 >,
546 _: (),
547 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
548 if let Some(inner) = this {
549 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
550 ::fidl_next::wire::Box::encode_present(out);
551 } else {
552 ::fidl_next::wire::Box::encode_absent(out);
553 }
554
555 Ok(())
556 }
557 }
558
559 unsafe impl<'a, ___E>
560 ::fidl_next::EncodeOption<
561 ::fidl_next::wire::Box<'static, crate::wire::ViewRefFocusedWatchResponse<'static>>,
562 ___E,
563 > for &'a ViewRefFocusedWatchResponse
564 where
565 ___E: ::fidl_next::Encoder + ?Sized,
566 &'a ViewRefFocusedWatchResponse:
567 ::fidl_next::Encode<crate::wire::ViewRefFocusedWatchResponse<'static>, ___E>,
568 {
569 #[inline]
570 fn encode_option(
571 this: ::core::option::Option<Self>,
572 encoder: &mut ___E,
573 out: &mut ::core::mem::MaybeUninit<
574 ::fidl_next::wire::Box<'static, crate::wire::ViewRefFocusedWatchResponse<'static>>,
575 >,
576 _: (),
577 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
578 if let Some(inner) = this {
579 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
580 ::fidl_next::wire::Box::encode_present(out);
581 } else {
582 ::fidl_next::wire::Box::encode_absent(out);
583 }
584
585 Ok(())
586 }
587 }
588
589 impl<'de> ::fidl_next::FromWire<crate::wire::ViewRefFocusedWatchResponse<'de>>
590 for ViewRefFocusedWatchResponse
591 {
592 #[inline]
593 fn from_wire(wire: crate::wire::ViewRefFocusedWatchResponse<'de>) -> Self {
594 Self { state: ::fidl_next::FromWire::from_wire(wire.state) }
595 }
596 }
597
598 impl<'de> ::fidl_next::FromWireRef<crate::wire::ViewRefFocusedWatchResponse<'de>>
599 for ViewRefFocusedWatchResponse
600 {
601 #[inline]
602 fn from_wire_ref(wire: &crate::wire::ViewRefFocusedWatchResponse<'de>) -> Self {
603 Self { state: ::fidl_next::FromWireRef::from_wire_ref(&wire.state) }
604 }
605 }
606
607 pub type ViewRefInstalledWatchResponse = ();
608
609 #[doc = " A collection of error codes related to |ViewRefInstalled|.\n"]
610 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
611 #[repr(u32)]
612 pub enum ViewRefInstalledError {
613 InvalidViewRef = 1,
614 }
615 impl ::core::convert::TryFrom<u32> for ViewRefInstalledError {
616 type Error = ::fidl_next::UnknownStrictEnumMemberError;
617 fn try_from(
618 value: u32,
619 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
620 match value {
621 1 => Ok(Self::InvalidViewRef),
622
623 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
624 }
625 }
626 }
627
628 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ViewRefInstalledError, ___E>
629 for ViewRefInstalledError
630 where
631 ___E: ?Sized,
632 {
633 #[inline]
634 fn encode(
635 self,
636 encoder: &mut ___E,
637 out: &mut ::core::mem::MaybeUninit<crate::wire::ViewRefInstalledError>,
638 _: (),
639 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
640 ::fidl_next::Encode::encode(&self, encoder, out, ())
641 }
642 }
643
644 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ViewRefInstalledError, ___E>
645 for &'a ViewRefInstalledError
646 where
647 ___E: ?Sized,
648 {
649 #[inline]
650 fn encode(
651 self,
652 encoder: &mut ___E,
653 out: &mut ::core::mem::MaybeUninit<crate::wire::ViewRefInstalledError>,
654 _: (),
655 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
656 ::fidl_next::munge!(let crate::wire::ViewRefInstalledError { value } = out);
657 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
658 ViewRefInstalledError::InvalidViewRef => 1,
659 }));
660
661 Ok(())
662 }
663 }
664
665 impl ::core::convert::From<crate::wire::ViewRefInstalledError> for ViewRefInstalledError {
666 fn from(wire: crate::wire::ViewRefInstalledError) -> Self {
667 match u32::from(wire.value) {
668 1 => Self::InvalidViewRef,
669
670 _ => unsafe { ::core::hint::unreachable_unchecked() },
671 }
672 }
673 }
674
675 impl ::fidl_next::FromWire<crate::wire::ViewRefInstalledError> for ViewRefInstalledError {
676 #[inline]
677 fn from_wire(wire: crate::wire::ViewRefInstalledError) -> Self {
678 Self::from(wire)
679 }
680 }
681
682 impl ::fidl_next::FromWireRef<crate::wire::ViewRefInstalledError> for ViewRefInstalledError {
683 #[inline]
684 fn from_wire_ref(wire: &crate::wire::ViewRefInstalledError) -> Self {
685 Self::from(*wire)
686 }
687 }
688}
689
690pub mod wire {
691
692 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
694 #[repr(transparent)]
695 pub struct AutoFocusError {
696 pub(crate) value: ::fidl_next::wire::Uint32,
697 }
698
699 impl ::fidl_next::Constrained for AutoFocusError {
700 type Constraint = ();
701
702 fn validate(
703 _: ::fidl_next::Slot<'_, Self>,
704 _: Self::Constraint,
705 ) -> Result<(), ::fidl_next::ValidationError> {
706 Ok(())
707 }
708 }
709
710 unsafe impl ::fidl_next::Wire for AutoFocusError {
711 type Narrowed<'de> = Self;
712
713 #[inline]
714 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
715 }
717 }
718
719 impl AutoFocusError {}
720
721 unsafe impl<___D> ::fidl_next::Decode<___D> for AutoFocusError
722 where
723 ___D: ?Sized,
724 {
725 fn decode(
726 slot: ::fidl_next::Slot<'_, Self>,
727 _: &mut ___D,
728 _: (),
729 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
730 Ok(())
731 }
732 }
733
734 impl ::core::convert::From<crate::natural::AutoFocusError> for AutoFocusError {
735 fn from(natural: crate::natural::AutoFocusError) -> Self {
736 match natural {
737 crate::natural::AutoFocusError::UnknownOrdinal_(value) => {
738 AutoFocusError { value: ::fidl_next::wire::Uint32::from(value) }
739 }
740 }
741 }
742 }
743
744 impl ::fidl_next::IntoNatural for AutoFocusError {
745 type Natural = crate::natural::AutoFocusError;
746 }
747
748 #[repr(transparent)]
750 pub struct Command {
751 pub(crate) raw: ::fidl_next::wire::Union,
752 pub(crate) _phantom: ::core::marker::PhantomData<()>,
753 }
754
755 impl Drop for Command {
756 fn drop(&mut self) {
757 match self.raw.ordinal() {
758 1 => {
759 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Int32>() };
760 }
761
762 _ => unsafe { ::core::hint::unreachable_unchecked() },
763 }
764 }
765 }
766
767 impl ::fidl_next::Constrained for Command {
768 type Constraint = ();
769
770 fn validate(
771 _: ::fidl_next::Slot<'_, Self>,
772 _: Self::Constraint,
773 ) -> Result<(), ::fidl_next::ValidationError> {
774 Ok(())
775 }
776 }
777
778 unsafe impl ::fidl_next::Wire for Command {
779 type Narrowed<'de> = Command;
780
781 #[inline]
782 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
783 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
784 ::fidl_next::wire::Union::zero_padding(raw);
785 }
786 }
787
788 pub mod command {
789 pub enum Ref<'de> {
790 Empty(&'de ::fidl_next::wire::Int32),
791 }
792
793 pub enum Value {
794 Empty(::fidl_next::wire::Int32),
795 }
796 }
797
798 impl Command {
799 pub fn as_ref(&self) -> crate::wire::command::Ref<'_> {
800 match self.raw.ordinal() {
801 1 => crate::wire::command::Ref::Empty(unsafe {
802 self.raw.get().deref_unchecked::<::fidl_next::wire::Int32>()
803 }),
804
805 _ => unsafe { ::core::hint::unreachable_unchecked() },
806 }
807 }
808
809 pub fn into_inner(self) -> crate::wire::command::Value {
810 let this = ::core::mem::ManuallyDrop::new(self);
811
812 match this.raw.ordinal() {
813 1 => crate::wire::command::Value::Empty(unsafe {
814 this.raw.get().read_unchecked::<::fidl_next::wire::Int32>()
815 }),
816
817 _ => unsafe { ::core::hint::unreachable_unchecked() },
818 }
819 }
820 }
821
822 impl Clone for Command {
823 fn clone(&self) -> Self {
824 match self.raw.ordinal() {
825 1 => Self {
826 raw: unsafe { self.raw.clone_inline_unchecked::<::fidl_next::wire::Int32>() },
827 _phantom: ::core::marker::PhantomData,
828 },
829
830 _ => unsafe { ::core::hint::unreachable_unchecked() },
831 }
832 }
833 }
834
835 unsafe impl<___D> ::fidl_next::Decode<___D> for Command
836 where
837 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
838 {
839 fn decode(
840 mut slot: ::fidl_next::Slot<'_, Self>,
841 decoder: &mut ___D,
842 _: (),
843 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
844 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
845 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
846 1 => ::fidl_next::wire::Union::decode_as_static::<___D, ::fidl_next::wire::Int32>(
847 raw,
848 decoder,
849 (),
850 )?,
851
852 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
853 }
854
855 Ok(())
856 }
857 }
858
859 impl ::core::fmt::Debug for Command {
860 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
861 match self.raw.ordinal() {
862 1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::wire::Int32>().fmt(f) },
863 _ => unsafe { ::core::hint::unreachable_unchecked() },
864 }
865 }
866 }
867
868 impl ::fidl_next::IntoNatural for Command {
869 type Natural = crate::natural::Command;
870 }
871
872 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
874 #[repr(transparent)]
875 pub struct Error {
876 pub(crate) value: ::fidl_next::wire::Uint32,
877 }
878
879 impl ::fidl_next::Constrained for Error {
880 type Constraint = ();
881
882 fn validate(
883 _: ::fidl_next::Slot<'_, Self>,
884 _: Self::Constraint,
885 ) -> Result<(), ::fidl_next::ValidationError> {
886 Ok(())
887 }
888 }
889
890 unsafe impl ::fidl_next::Wire for Error {
891 type Narrowed<'de> = Self;
892
893 #[inline]
894 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
895 }
897 }
898
899 impl Error {
900 pub const DENIED: Error = Error { value: ::fidl_next::wire::Uint32(1) };
901 }
902
903 unsafe impl<___D> ::fidl_next::Decode<___D> for Error
904 where
905 ___D: ?Sized,
906 {
907 fn decode(
908 slot: ::fidl_next::Slot<'_, Self>,
909 _: &mut ___D,
910 _: (),
911 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
912 ::fidl_next::munge!(let Self { value } = slot);
913
914 match u32::from(*value) {
915 1 => (),
916 unknown => {
917 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
918 }
919 }
920
921 Ok(())
922 }
923 }
924
925 impl ::core::convert::From<crate::natural::Error> for Error {
926 fn from(natural: crate::natural::Error) -> Self {
927 match natural {
928 crate::natural::Error::Denied => Error::DENIED,
929 }
930 }
931 }
932
933 impl ::fidl_next::IntoNatural for Error {
934 type Natural = crate::natural::Error;
935 }
936
937 #[repr(C)]
939 pub struct FocusState<'de> {
940 pub(crate) table: ::fidl_next::wire::Table<'de>,
941 }
942
943 impl<'de> Drop for FocusState<'de> {
944 fn drop(&mut self) {
945 let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
946 }
947 }
948
949 impl ::fidl_next::Constrained for FocusState<'_> {
950 type Constraint = ();
951
952 fn validate(
953 _: ::fidl_next::Slot<'_, Self>,
954 _: Self::Constraint,
955 ) -> Result<(), ::fidl_next::ValidationError> {
956 Ok(())
957 }
958 }
959
960 unsafe impl ::fidl_next::Wire for FocusState<'static> {
961 type Narrowed<'de> = FocusState<'de>;
962
963 #[inline]
964 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
965 ::fidl_next::munge!(let Self { table } = out);
966 ::fidl_next::wire::Table::zero_padding(table);
967 }
968 }
969
970 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FocusState<'de>
971 where
972 ___D: ::fidl_next::Decoder<'de> + ?Sized,
973 {
974 fn decode(
975 slot: ::fidl_next::Slot<'_, Self>,
976 decoder: &mut ___D,
977 _: (),
978 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
979 ::fidl_next::munge!(let Self { table } = slot);
980
981 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
982 match ordinal {
983 0 => unsafe { ::core::hint::unreachable_unchecked() },
984
985 1 => {
986 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
987 slot.as_mut(),
988 decoder,
989 (),
990 )?;
991
992 Ok(())
993 }
994
995 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
996 }
997 })
998 }
999 }
1000
1001 impl<'de> FocusState<'de> {
1002 pub fn focused(&self) -> ::core::option::Option<&bool> {
1003 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1004 }
1005
1006 pub fn take_focused(&mut self) -> ::core::option::Option<bool> {
1007 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1008 }
1009 }
1010
1011 impl<'de> ::core::fmt::Debug for FocusState<'de> {
1012 fn fmt(
1013 &self,
1014 f: &mut ::core::fmt::Formatter<'_>,
1015 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1016 f.debug_struct("FocusState").field("focused", &self.focused()).finish()
1017 }
1018 }
1019
1020 impl<'de> ::fidl_next::IntoNatural for FocusState<'de> {
1021 type Natural = crate::natural::FocusState;
1022 }
1023
1024 pub type FocuserRequestFocusResponse = ::fidl_next::wire::Unit;
1026
1027 pub type FocuserSetAutoFocusResponse = ::fidl_next::wire::Unit;
1029
1030 #[derive(Debug)]
1032 #[repr(C)]
1033 pub struct ViewRefFocusedWatchResponse<'de> {
1034 pub state: crate::wire::FocusState<'de>,
1035 }
1036
1037 static_assertions::const_assert_eq!(std::mem::size_of::<ViewRefFocusedWatchResponse<'_>>(), 16);
1038 static_assertions::const_assert_eq!(std::mem::align_of::<ViewRefFocusedWatchResponse<'_>>(), 8);
1039
1040 static_assertions::const_assert_eq!(
1041 std::mem::offset_of!(ViewRefFocusedWatchResponse<'_>, state),
1042 0
1043 );
1044
1045 impl ::fidl_next::Constrained for ViewRefFocusedWatchResponse<'_> {
1046 type Constraint = ();
1047
1048 fn validate(
1049 _: ::fidl_next::Slot<'_, Self>,
1050 _: Self::Constraint,
1051 ) -> Result<(), ::fidl_next::ValidationError> {
1052 Ok(())
1053 }
1054 }
1055
1056 unsafe impl ::fidl_next::Wire for ViewRefFocusedWatchResponse<'static> {
1057 type Narrowed<'de> = ViewRefFocusedWatchResponse<'de>;
1058
1059 #[inline]
1060 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1061 ::fidl_next::munge! {
1062 let Self {
1063 state,
1064
1065 } = &mut *out_;
1066 }
1067
1068 ::fidl_next::Wire::zero_padding(state);
1069 }
1070 }
1071
1072 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ViewRefFocusedWatchResponse<'de>
1073 where
1074 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1075 ___D: ::fidl_next::Decoder<'de>,
1076 {
1077 fn decode(
1078 slot_: ::fidl_next::Slot<'_, Self>,
1079 decoder_: &mut ___D,
1080 _: (),
1081 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1082 ::fidl_next::munge! {
1083 let Self {
1084 mut state,
1085
1086 } = slot_;
1087 }
1088
1089 let _field = state.as_mut();
1090
1091 ::fidl_next::Decode::decode(state.as_mut(), decoder_, ())?;
1092
1093 Ok(())
1094 }
1095 }
1096
1097 impl<'de> ::fidl_next::IntoNatural for ViewRefFocusedWatchResponse<'de> {
1098 type Natural = crate::natural::ViewRefFocusedWatchResponse;
1099 }
1100
1101 pub type ViewRefInstalledWatchResponse = ::fidl_next::wire::Unit;
1103
1104 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1106 #[repr(transparent)]
1107 pub struct ViewRefInstalledError {
1108 pub(crate) value: ::fidl_next::wire::Uint32,
1109 }
1110
1111 impl ::fidl_next::Constrained for ViewRefInstalledError {
1112 type Constraint = ();
1113
1114 fn validate(
1115 _: ::fidl_next::Slot<'_, Self>,
1116 _: Self::Constraint,
1117 ) -> Result<(), ::fidl_next::ValidationError> {
1118 Ok(())
1119 }
1120 }
1121
1122 unsafe impl ::fidl_next::Wire for ViewRefInstalledError {
1123 type Narrowed<'de> = Self;
1124
1125 #[inline]
1126 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1127 }
1129 }
1130
1131 impl ViewRefInstalledError {
1132 pub const INVALID_VIEW_REF: ViewRefInstalledError =
1133 ViewRefInstalledError { value: ::fidl_next::wire::Uint32(1) };
1134 }
1135
1136 unsafe impl<___D> ::fidl_next::Decode<___D> for ViewRefInstalledError
1137 where
1138 ___D: ?Sized,
1139 {
1140 fn decode(
1141 slot: ::fidl_next::Slot<'_, Self>,
1142 _: &mut ___D,
1143 _: (),
1144 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1145 ::fidl_next::munge!(let Self { value } = slot);
1146
1147 match u32::from(*value) {
1148 1 => (),
1149 unknown => {
1150 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
1151 }
1152 }
1153
1154 Ok(())
1155 }
1156 }
1157
1158 impl ::core::convert::From<crate::natural::ViewRefInstalledError> for ViewRefInstalledError {
1159 fn from(natural: crate::natural::ViewRefInstalledError) -> Self {
1160 match natural {
1161 crate::natural::ViewRefInstalledError::InvalidViewRef => {
1162 ViewRefInstalledError::INVALID_VIEW_REF
1163 }
1164 }
1165 }
1166 }
1167
1168 impl ::fidl_next::IntoNatural for ViewRefInstalledError {
1169 type Natural = crate::natural::ViewRefInstalledError;
1170 }
1171}
1172
1173pub mod wire_optional {
1174
1175 #[repr(transparent)]
1176 pub struct Command {
1177 pub(crate) raw: ::fidl_next::wire::Union,
1178 pub(crate) _phantom: ::core::marker::PhantomData<()>,
1179 }
1180
1181 impl ::fidl_next::Constrained for Command {
1182 type Constraint = ();
1183
1184 fn validate(
1185 _: ::fidl_next::Slot<'_, Self>,
1186 _: Self::Constraint,
1187 ) -> Result<(), ::fidl_next::ValidationError> {
1188 Ok(())
1189 }
1190 }
1191
1192 unsafe impl ::fidl_next::Wire for Command {
1193 type Narrowed<'de> = Command;
1194
1195 #[inline]
1196 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1197 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1198 ::fidl_next::wire::Union::zero_padding(raw);
1199 }
1200 }
1201
1202 impl Command {
1203 pub fn is_some(&self) -> bool {
1204 self.raw.is_some()
1205 }
1206
1207 pub fn is_none(&self) -> bool {
1208 self.raw.is_none()
1209 }
1210
1211 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Command> {
1212 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
1213 }
1214
1215 pub fn into_option(self) -> ::core::option::Option<crate::wire::Command> {
1216 if self.is_some() {
1217 Some(crate::wire::Command { raw: self.raw, _phantom: ::core::marker::PhantomData })
1218 } else {
1219 None
1220 }
1221 }
1222 }
1223
1224 impl Clone for Command {
1225 fn clone(&self) -> Self {
1226 if self.is_none() {
1227 return Command {
1228 raw: ::fidl_next::wire::Union::absent(),
1229 _phantom: ::core::marker::PhantomData,
1230 };
1231 }
1232
1233 match self.raw.ordinal() {
1234 1 => Self {
1235 raw: unsafe { self.raw.clone_inline_unchecked::<::fidl_next::wire::Int32>() },
1236 _phantom: ::core::marker::PhantomData,
1237 },
1238
1239 _ => unsafe { ::core::hint::unreachable_unchecked() },
1240 }
1241 }
1242 }
1243
1244 unsafe impl<___D> ::fidl_next::Decode<___D> for Command
1245 where
1246 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1247 {
1248 fn decode(
1249 mut slot: ::fidl_next::Slot<'_, Self>,
1250 decoder: &mut ___D,
1251 _: (),
1252 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1253 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1254 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
1255 1 => ::fidl_next::wire::Union::decode_as_static::<___D, ::fidl_next::wire::Int32>(
1256 raw,
1257 decoder,
1258 (),
1259 )?,
1260
1261 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
1262 _ => ::fidl_next::wire::Union::decode_unknown_static(raw, decoder)?,
1263 }
1264
1265 Ok(())
1266 }
1267 }
1268
1269 impl ::core::fmt::Debug for Command {
1270 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1271 self.as_ref().fmt(f)
1272 }
1273 }
1274
1275 impl ::fidl_next::IntoNatural for Command {
1276 type Natural = ::core::option::Option<crate::natural::Command>;
1277 }
1278}
1279
1280pub mod generic {
1281
1282 pub type FocuserRequestFocusResponse = ();
1284
1285 pub type FocuserSetAutoFocusResponse = ();
1287
1288 pub struct ViewRefFocusedWatchResponse<T0> {
1290 pub state: T0,
1291 }
1292
1293 unsafe impl<___E, T0>
1294 ::fidl_next::Encode<crate::wire::ViewRefFocusedWatchResponse<'static>, ___E>
1295 for ViewRefFocusedWatchResponse<T0>
1296 where
1297 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1298 ___E: ::fidl_next::Encoder,
1299 T0: ::fidl_next::Encode<crate::wire::FocusState<'static>, ___E>,
1300 {
1301 #[inline]
1302 fn encode(
1303 self,
1304 encoder_: &mut ___E,
1305 out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewRefFocusedWatchResponse<'static>>,
1306 _: (),
1307 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1308 ::fidl_next::munge! {
1309 let crate::wire::ViewRefFocusedWatchResponse {
1310 state,
1311
1312 } = out_;
1313 }
1314
1315 ::fidl_next::Encode::encode(self.state, encoder_, state, ())?;
1316
1317 Ok(())
1318 }
1319 }
1320
1321 pub type ViewRefInstalledWatchResponse = ();
1323}
1324
1325pub use self::natural::*;
1326
1327#[doc = " A method of enabling a ViewRef creator to determine if its ViewRef has\n gained or lost focus in the view tree.\n\n The protocol client has implicit access to the ViewRef it created; the\n protocol itself does not accept a ViewRef parameter. Clients, both trusted\n or otherwise, need access to view-focus state, so the protocol is\n deliberately minimal. Possession of a ViewRef (and this protocol) does not\n grant the power to learn about a ViewRef\'s focus state.\n"]
1329#[derive(PartialEq, Debug)]
1330pub struct ViewRefFocused;
1331
1332#[cfg(target_os = "fuchsia")]
1333impl ::fidl_next::HasTransport for ViewRefFocused {
1334 type Transport = ::fidl_next::fuchsia::zx::Channel;
1335}
1336
1337pub mod view_ref_focused {
1338 pub mod prelude {
1339 pub use crate::{
1340 ViewRefFocused, ViewRefFocusedClientHandler, ViewRefFocusedLocalClientHandler,
1341 ViewRefFocusedLocalServerHandler, ViewRefFocusedServerHandler, view_ref_focused,
1342 };
1343
1344 pub use crate::natural::ViewRefFocusedWatchResponse;
1345 }
1346
1347 pub struct Watch;
1348
1349 impl ::fidl_next::Method for Watch {
1350 const ORDINAL: u64 = 4350003391021357493;
1351 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1352 ::fidl_next::protocol::Flexibility::Strict;
1353
1354 type Protocol = crate::ViewRefFocused;
1355
1356 type Request = ::fidl_next::wire::EmptyMessageBody;
1357 }
1358
1359 impl ::fidl_next::TwoWayMethod for Watch {
1360 type Response =
1361 ::fidl_next::wire::Strict<crate::wire::ViewRefFocusedWatchResponse<'static>>;
1362 }
1363
1364 impl<___R> ::fidl_next::Respond<___R> for Watch {
1365 type Output = ::fidl_next::Strict<crate::generic::ViewRefFocusedWatchResponse<___R>>;
1366
1367 fn respond(response: ___R) -> Self::Output {
1368 ::fidl_next::Strict(crate::generic::ViewRefFocusedWatchResponse { state: response })
1369 }
1370 }
1371
1372 mod ___detail {
1373 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::ViewRefFocused
1374 where
1375 ___T: ::fidl_next::Transport,
1376 {
1377 type Client = ViewRefFocusedClient<___T>;
1378 type Server = ViewRefFocusedServer<___T>;
1379 }
1380
1381 #[repr(transparent)]
1383 pub struct ViewRefFocusedClient<___T: ::fidl_next::Transport> {
1384 #[allow(dead_code)]
1385 client: ::fidl_next::protocol::Client<___T>,
1386 }
1387
1388 impl<___T> ViewRefFocusedClient<___T>
1389 where
1390 ___T: ::fidl_next::Transport,
1391 {
1392 #[doc = " Sets up a callback to fire when the implicit ViewRef has gained or lost\n focus. Typically, focus changes happen at a slow pace, such that every\n transition is captured by the callback. However, focus changes can\n happen rapidly, so the callback may \"compress\" focus change history into\n just the latest known focus state.\n\n The callback reports the last focus change spanning the duration from\n its issuance to the previous callback\'s issuance. The client may observe\n any of the following four transitions:\n - true -> true: The ViewRef has lost focus at least once, and has gained\n focus by the time of callback issuance.\n - true -> false: The ViewRef has lost focus at least once, and has lost\n focus by the time of callback issuance.\n - false -> true: The ViewRef has gained focus at least once, and has\n gained focus by the time of callback issuance.\n - false -> false: The ViewRef has gained focus at least once, and has\n lost focus by the time of callback issuance.\n\n The client avoids \"focus flapping\" and always sees the latest state.\n Every callback issuance is meaningful, and the client should renegotiate\n focus-related services appropriately, such as IME.\n\n Flow control: The caller is allowed at most one in-flight |Watch| call\n at at time: subsequent |Watch| calls must wait until the acknowledgment\n returns. Non-compliance results in channel closure.\n"]
1393 pub fn watch(&self) -> ::fidl_next::TwoWayFuture<'_, super::Watch, ___T> {
1394 ::fidl_next::TwoWayFuture::from_untyped(
1395 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
1396 4350003391021357493,
1397 <super::Watch as ::fidl_next::Method>::FLEXIBILITY,
1398 (),
1399 ),
1400 )
1401 }
1402 }
1403
1404 #[repr(transparent)]
1406 pub struct ViewRefFocusedServer<___T: ::fidl_next::Transport> {
1407 server: ::fidl_next::protocol::Server<___T>,
1408 }
1409
1410 impl<___T> ViewRefFocusedServer<___T> where ___T: ::fidl_next::Transport {}
1411 }
1412}
1413
1414#[diagnostic::on_unimplemented(
1415 note = "If {Self} implements the non-local ViewRefFocusedClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
1416)]
1417
1418pub trait ViewRefFocusedLocalClientHandler<
1422 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1423 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1424>
1425{
1426}
1427
1428impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for ViewRefFocused
1429where
1430 ___H: ViewRefFocusedLocalClientHandler<___T>,
1431 ___T: ::fidl_next::Transport,
1432{
1433 async fn on_event(
1434 handler: &mut ___H,
1435 mut message: ::fidl_next::Message<___T>,
1436 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1437 match *message.header().ordinal {
1438 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1439 }
1440 }
1441}
1442
1443#[diagnostic::on_unimplemented(
1444 note = "If {Self} implements the non-local ViewRefFocusedServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
1445)]
1446
1447pub trait ViewRefFocusedLocalServerHandler<
1451 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1452 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1453>
1454{
1455 #[doc = " Sets up a callback to fire when the implicit ViewRef has gained or lost\n focus. Typically, focus changes happen at a slow pace, such that every\n transition is captured by the callback. However, focus changes can\n happen rapidly, so the callback may \"compress\" focus change history into\n just the latest known focus state.\n\n The callback reports the last focus change spanning the duration from\n its issuance to the previous callback\'s issuance. The client may observe\n any of the following four transitions:\n - true -> true: The ViewRef has lost focus at least once, and has gained\n focus by the time of callback issuance.\n - true -> false: The ViewRef has lost focus at least once, and has lost\n focus by the time of callback issuance.\n - false -> true: The ViewRef has gained focus at least once, and has\n gained focus by the time of callback issuance.\n - false -> false: The ViewRef has gained focus at least once, and has\n lost focus by the time of callback issuance.\n\n The client avoids \"focus flapping\" and always sees the latest state.\n Every callback issuance is meaningful, and the client should renegotiate\n focus-related services appropriately, such as IME.\n\n Flow control: The caller is allowed at most one in-flight |Watch| call\n at at time: subsequent |Watch| calls must wait until the acknowledgment\n returns. Non-compliance results in channel closure.\n"]
1456 fn watch(
1457 &mut self,
1458
1459 responder: ::fidl_next::Responder<view_ref_focused::Watch, ___T>,
1460 ) -> impl ::core::future::Future<Output = ()>;
1461}
1462
1463impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for ViewRefFocused
1464where
1465 ___H: ViewRefFocusedLocalServerHandler<___T>,
1466 ___T: ::fidl_next::Transport,
1467{
1468 async fn on_one_way(
1469 handler: &mut ___H,
1470 mut message: ::fidl_next::Message<___T>,
1471 ) -> ::core::result::Result<
1472 (),
1473 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1474 > {
1475 match *message.header().ordinal {
1476 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1477 }
1478 }
1479
1480 async fn on_two_way(
1481 handler: &mut ___H,
1482 mut message: ::fidl_next::Message<___T>,
1483 responder: ::fidl_next::protocol::Responder<___T>,
1484 ) -> ::core::result::Result<
1485 (),
1486 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1487 > {
1488 match *message.header().ordinal {
1489 4350003391021357493 => {
1490 let responder = ::fidl_next::Responder::from_untyped(responder);
1491
1492 handler.watch(responder).await;
1493 Ok(())
1494 }
1495
1496 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1497 }
1498 }
1499}
1500
1501pub trait ViewRefFocusedClientHandler<
1505 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1506 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1507>
1508{
1509}
1510
1511impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ViewRefFocused
1512where
1513 ___H: ViewRefFocusedClientHandler<___T> + ::core::marker::Send,
1514 ___T: ::fidl_next::Transport,
1515{
1516 async fn on_event(
1517 handler: &mut ___H,
1518 mut message: ::fidl_next::Message<___T>,
1519 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1520 match *message.header().ordinal {
1521 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1522 }
1523 }
1524}
1525
1526pub trait ViewRefFocusedServerHandler<
1530 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1531 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1532>
1533{
1534 #[doc = " Sets up a callback to fire when the implicit ViewRef has gained or lost\n focus. Typically, focus changes happen at a slow pace, such that every\n transition is captured by the callback. However, focus changes can\n happen rapidly, so the callback may \"compress\" focus change history into\n just the latest known focus state.\n\n The callback reports the last focus change spanning the duration from\n its issuance to the previous callback\'s issuance. The client may observe\n any of the following four transitions:\n - true -> true: The ViewRef has lost focus at least once, and has gained\n focus by the time of callback issuance.\n - true -> false: The ViewRef has lost focus at least once, and has lost\n focus by the time of callback issuance.\n - false -> true: The ViewRef has gained focus at least once, and has\n gained focus by the time of callback issuance.\n - false -> false: The ViewRef has gained focus at least once, and has\n lost focus by the time of callback issuance.\n\n The client avoids \"focus flapping\" and always sees the latest state.\n Every callback issuance is meaningful, and the client should renegotiate\n focus-related services appropriately, such as IME.\n\n Flow control: The caller is allowed at most one in-flight |Watch| call\n at at time: subsequent |Watch| calls must wait until the acknowledgment\n returns. Non-compliance results in channel closure.\n"]
1535 fn watch(
1536 &mut self,
1537
1538 responder: ::fidl_next::Responder<view_ref_focused::Watch, ___T>,
1539 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1540}
1541
1542impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ViewRefFocused
1543where
1544 ___H: ViewRefFocusedServerHandler<___T> + ::core::marker::Send,
1545 ___T: ::fidl_next::Transport,
1546{
1547 async fn on_one_way(
1548 handler: &mut ___H,
1549 mut message: ::fidl_next::Message<___T>,
1550 ) -> ::core::result::Result<
1551 (),
1552 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1553 > {
1554 match *message.header().ordinal {
1555 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1556 }
1557 }
1558
1559 async fn on_two_way(
1560 handler: &mut ___H,
1561 mut message: ::fidl_next::Message<___T>,
1562 responder: ::fidl_next::protocol::Responder<___T>,
1563 ) -> ::core::result::Result<
1564 (),
1565 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1566 > {
1567 match *message.header().ordinal {
1568 4350003391021357493 => {
1569 let responder = ::fidl_next::Responder::from_untyped(responder);
1570
1571 handler.watch(responder).await;
1572 Ok(())
1573 }
1574
1575 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1576 }
1577 }
1578}
1579
1580impl<___T> ViewRefFocusedClientHandler<___T> for ::fidl_next::IgnoreEvents where
1581 ___T: ::fidl_next::Transport
1582{
1583}
1584
1585impl<___H, ___T> ViewRefFocusedLocalClientHandler<___T> for ::fidl_next::Local<___H>
1586where
1587 ___H: ViewRefFocusedClientHandler<___T>,
1588 ___T: ::fidl_next::Transport,
1589{
1590}
1591
1592impl<___H, ___T> ViewRefFocusedLocalServerHandler<___T> for ::fidl_next::Local<___H>
1593where
1594 ___H: ViewRefFocusedServerHandler<___T>,
1595 ___T: ::fidl_next::Transport,
1596{
1597 async fn watch(&mut self, responder: ::fidl_next::Responder<view_ref_focused::Watch, ___T>) {
1598 ___H::watch(&mut self.0, responder).await
1599 }
1600}