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
794 impl Command {
795 pub fn as_ref(&self) -> crate::wire::command::Ref<'_> {
796 match self.raw.ordinal() {
797 1 => crate::wire::command::Ref::Empty(unsafe {
798 self.raw.get().deref_unchecked::<::fidl_next::wire::Int32>()
799 }),
800
801 _ => unsafe { ::core::hint::unreachable_unchecked() },
802 }
803 }
804 }
805
806 impl Clone for Command {
807 fn clone(&self) -> Self {
808 match self.raw.ordinal() {
809 1 => Self {
810 raw: unsafe { self.raw.clone_inline_unchecked::<::fidl_next::wire::Int32>() },
811 _phantom: ::core::marker::PhantomData,
812 },
813
814 _ => unsafe { ::core::hint::unreachable_unchecked() },
815 }
816 }
817 }
818
819 unsafe impl<___D> ::fidl_next::Decode<___D> for Command
820 where
821 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
822 {
823 fn decode(
824 mut slot: ::fidl_next::Slot<'_, Self>,
825 decoder: &mut ___D,
826 _: (),
827 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
828 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
829 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
830 1 => ::fidl_next::wire::Union::decode_as_static::<___D, ::fidl_next::wire::Int32>(
831 raw,
832 decoder,
833 (),
834 )?,
835
836 ord => return Err(::fidl_next::DecodeError::InvalidUnionOrdinal(ord as usize)),
837 }
838
839 Ok(())
840 }
841 }
842
843 impl ::core::fmt::Debug for Command {
844 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
845 match self.raw.ordinal() {
846 1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::wire::Int32>().fmt(f) },
847 _ => unsafe { ::core::hint::unreachable_unchecked() },
848 }
849 }
850 }
851
852 impl ::fidl_next::IntoNatural for Command {
853 type Natural = crate::natural::Command;
854 }
855
856 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
858 #[repr(transparent)]
859 pub struct Error {
860 pub(crate) value: ::fidl_next::wire::Uint32,
861 }
862
863 impl ::fidl_next::Constrained for Error {
864 type Constraint = ();
865
866 fn validate(
867 _: ::fidl_next::Slot<'_, Self>,
868 _: Self::Constraint,
869 ) -> Result<(), ::fidl_next::ValidationError> {
870 Ok(())
871 }
872 }
873
874 unsafe impl ::fidl_next::Wire for Error {
875 type Narrowed<'de> = Self;
876
877 #[inline]
878 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
879 }
881 }
882
883 impl Error {
884 pub const DENIED: Error = Error { value: ::fidl_next::wire::Uint32(1) };
885 }
886
887 unsafe impl<___D> ::fidl_next::Decode<___D> for Error
888 where
889 ___D: ?Sized,
890 {
891 fn decode(
892 slot: ::fidl_next::Slot<'_, Self>,
893 _: &mut ___D,
894 _: (),
895 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
896 ::fidl_next::munge!(let Self { value } = slot);
897
898 match u32::from(*value) {
899 1 => (),
900 unknown => {
901 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
902 }
903 }
904
905 Ok(())
906 }
907 }
908
909 impl ::core::convert::From<crate::natural::Error> for Error {
910 fn from(natural: crate::natural::Error) -> Self {
911 match natural {
912 crate::natural::Error::Denied => Error::DENIED,
913 }
914 }
915 }
916
917 impl ::fidl_next::IntoNatural for Error {
918 type Natural = crate::natural::Error;
919 }
920
921 #[repr(C)]
923 pub struct FocusState<'de> {
924 pub(crate) table: ::fidl_next::wire::Table<'de>,
925 }
926
927 impl<'de> Drop for FocusState<'de> {
928 fn drop(&mut self) {
929 let _ = self.table.get(1).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
930 }
931 }
932
933 impl ::fidl_next::Constrained for FocusState<'_> {
934 type Constraint = ();
935
936 fn validate(
937 _: ::fidl_next::Slot<'_, Self>,
938 _: Self::Constraint,
939 ) -> Result<(), ::fidl_next::ValidationError> {
940 Ok(())
941 }
942 }
943
944 unsafe impl ::fidl_next::Wire for FocusState<'static> {
945 type Narrowed<'de> = FocusState<'de>;
946
947 #[inline]
948 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
949 ::fidl_next::munge!(let Self { table } = out);
950 ::fidl_next::wire::Table::zero_padding(table);
951 }
952 }
953
954 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for FocusState<'de>
955 where
956 ___D: ::fidl_next::Decoder<'de> + ?Sized,
957 {
958 fn decode(
959 slot: ::fidl_next::Slot<'_, Self>,
960 decoder: &mut ___D,
961 _: (),
962 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
963 ::fidl_next::munge!(let Self { table } = slot);
964
965 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
966 match ordinal {
967 0 => unsafe { ::core::hint::unreachable_unchecked() },
968
969 1 => {
970 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
971 slot.as_mut(),
972 decoder,
973 (),
974 )?;
975
976 Ok(())
977 }
978
979 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
980 }
981 })
982 }
983 }
984
985 impl<'de> FocusState<'de> {
986 pub fn focused(&self) -> ::core::option::Option<&bool> {
987 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
988 }
989 }
990
991 impl<'de> ::core::fmt::Debug for FocusState<'de> {
992 fn fmt(
993 &self,
994 f: &mut ::core::fmt::Formatter<'_>,
995 ) -> ::core::result::Result<(), ::core::fmt::Error> {
996 f.debug_struct("FocusState").field("focused", &self.focused()).finish()
997 }
998 }
999
1000 impl<'de> ::fidl_next::IntoNatural for FocusState<'de> {
1001 type Natural = crate::natural::FocusState;
1002 }
1003
1004 pub type FocuserRequestFocusResponse = ::fidl_next::wire::Unit;
1006
1007 pub type FocuserSetAutoFocusResponse = ::fidl_next::wire::Unit;
1009
1010 #[derive(Debug)]
1012 #[repr(C)]
1013 pub struct ViewRefFocusedWatchResponse<'de> {
1014 pub state: crate::wire::FocusState<'de>,
1015 }
1016
1017 static_assertions::const_assert_eq!(std::mem::size_of::<ViewRefFocusedWatchResponse<'_>>(), 16);
1018 static_assertions::const_assert_eq!(std::mem::align_of::<ViewRefFocusedWatchResponse<'_>>(), 8);
1019
1020 static_assertions::const_assert_eq!(
1021 std::mem::offset_of!(ViewRefFocusedWatchResponse<'_>, state),
1022 0
1023 );
1024
1025 impl ::fidl_next::Constrained for ViewRefFocusedWatchResponse<'_> {
1026 type Constraint = ();
1027
1028 fn validate(
1029 _: ::fidl_next::Slot<'_, Self>,
1030 _: Self::Constraint,
1031 ) -> Result<(), ::fidl_next::ValidationError> {
1032 Ok(())
1033 }
1034 }
1035
1036 unsafe impl ::fidl_next::Wire for ViewRefFocusedWatchResponse<'static> {
1037 type Narrowed<'de> = ViewRefFocusedWatchResponse<'de>;
1038
1039 #[inline]
1040 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1041 ::fidl_next::munge! {
1042 let Self {
1043 state,
1044
1045 } = &mut *out_;
1046 }
1047
1048 ::fidl_next::Wire::zero_padding(state);
1049 }
1050 }
1051
1052 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ViewRefFocusedWatchResponse<'de>
1053 where
1054 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1055 ___D: ::fidl_next::Decoder<'de>,
1056 {
1057 fn decode(
1058 slot_: ::fidl_next::Slot<'_, Self>,
1059 decoder_: &mut ___D,
1060 _: (),
1061 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1062 ::fidl_next::munge! {
1063 let Self {
1064 mut state,
1065
1066 } = slot_;
1067 }
1068
1069 let _field = state.as_mut();
1070
1071 ::fidl_next::Decode::decode(state.as_mut(), decoder_, ())?;
1072
1073 Ok(())
1074 }
1075 }
1076
1077 impl<'de> ::fidl_next::IntoNatural for ViewRefFocusedWatchResponse<'de> {
1078 type Natural = crate::natural::ViewRefFocusedWatchResponse;
1079 }
1080
1081 pub type ViewRefInstalledWatchResponse = ::fidl_next::wire::Unit;
1083
1084 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1086 #[repr(transparent)]
1087 pub struct ViewRefInstalledError {
1088 pub(crate) value: ::fidl_next::wire::Uint32,
1089 }
1090
1091 impl ::fidl_next::Constrained for ViewRefInstalledError {
1092 type Constraint = ();
1093
1094 fn validate(
1095 _: ::fidl_next::Slot<'_, Self>,
1096 _: Self::Constraint,
1097 ) -> Result<(), ::fidl_next::ValidationError> {
1098 Ok(())
1099 }
1100 }
1101
1102 unsafe impl ::fidl_next::Wire for ViewRefInstalledError {
1103 type Narrowed<'de> = Self;
1104
1105 #[inline]
1106 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1107 }
1109 }
1110
1111 impl ViewRefInstalledError {
1112 pub const INVALID_VIEW_REF: ViewRefInstalledError =
1113 ViewRefInstalledError { value: ::fidl_next::wire::Uint32(1) };
1114 }
1115
1116 unsafe impl<___D> ::fidl_next::Decode<___D> for ViewRefInstalledError
1117 where
1118 ___D: ?Sized,
1119 {
1120 fn decode(
1121 slot: ::fidl_next::Slot<'_, Self>,
1122 _: &mut ___D,
1123 _: (),
1124 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1125 ::fidl_next::munge!(let Self { value } = slot);
1126
1127 match u32::from(*value) {
1128 1 => (),
1129 unknown => {
1130 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
1131 }
1132 }
1133
1134 Ok(())
1135 }
1136 }
1137
1138 impl ::core::convert::From<crate::natural::ViewRefInstalledError> for ViewRefInstalledError {
1139 fn from(natural: crate::natural::ViewRefInstalledError) -> Self {
1140 match natural {
1141 crate::natural::ViewRefInstalledError::InvalidViewRef => {
1142 ViewRefInstalledError::INVALID_VIEW_REF
1143 }
1144 }
1145 }
1146 }
1147
1148 impl ::fidl_next::IntoNatural for ViewRefInstalledError {
1149 type Natural = crate::natural::ViewRefInstalledError;
1150 }
1151}
1152
1153pub mod wire_optional {
1154
1155 #[repr(transparent)]
1156 pub struct Command {
1157 pub(crate) raw: ::fidl_next::wire::Union,
1158 pub(crate) _phantom: ::core::marker::PhantomData<()>,
1159 }
1160
1161 impl ::fidl_next::Constrained for Command {
1162 type Constraint = ();
1163
1164 fn validate(
1165 _: ::fidl_next::Slot<'_, Self>,
1166 _: Self::Constraint,
1167 ) -> Result<(), ::fidl_next::ValidationError> {
1168 Ok(())
1169 }
1170 }
1171
1172 unsafe impl ::fidl_next::Wire for Command {
1173 type Narrowed<'de> = Command;
1174
1175 #[inline]
1176 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1177 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1178 ::fidl_next::wire::Union::zero_padding(raw);
1179 }
1180 }
1181
1182 impl Command {
1183 pub fn is_some(&self) -> bool {
1184 self.raw.is_some()
1185 }
1186
1187 pub fn is_none(&self) -> bool {
1188 self.raw.is_none()
1189 }
1190
1191 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Command> {
1192 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
1193 }
1194
1195 pub fn into_option(self) -> ::core::option::Option<crate::wire::Command> {
1196 if self.is_some() {
1197 Some(crate::wire::Command { raw: self.raw, _phantom: ::core::marker::PhantomData })
1198 } else {
1199 None
1200 }
1201 }
1202 }
1203
1204 impl Clone for Command {
1205 fn clone(&self) -> Self {
1206 if self.is_none() {
1207 return Command {
1208 raw: ::fidl_next::wire::Union::absent(),
1209 _phantom: ::core::marker::PhantomData,
1210 };
1211 }
1212
1213 match self.raw.ordinal() {
1214 1 => Self {
1215 raw: unsafe { self.raw.clone_inline_unchecked::<::fidl_next::wire::Int32>() },
1216 _phantom: ::core::marker::PhantomData,
1217 },
1218
1219 _ => unsafe { ::core::hint::unreachable_unchecked() },
1220 }
1221 }
1222 }
1223
1224 unsafe impl<___D> ::fidl_next::Decode<___D> for Command
1225 where
1226 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1227 {
1228 fn decode(
1229 mut slot: ::fidl_next::Slot<'_, Self>,
1230 decoder: &mut ___D,
1231 _: (),
1232 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1233 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1234 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
1235 1 => ::fidl_next::wire::Union::decode_as_static::<___D, ::fidl_next::wire::Int32>(
1236 raw,
1237 decoder,
1238 (),
1239 )?,
1240
1241 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
1242 _ => ::fidl_next::wire::Union::decode_unknown_static(raw, decoder)?,
1243 }
1244
1245 Ok(())
1246 }
1247 }
1248
1249 impl ::core::fmt::Debug for Command {
1250 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1251 self.as_ref().fmt(f)
1252 }
1253 }
1254
1255 impl ::fidl_next::IntoNatural for Command {
1256 type Natural = ::core::option::Option<crate::natural::Command>;
1257 }
1258}
1259
1260pub mod generic {
1261
1262 pub type FocuserRequestFocusResponse = ();
1264
1265 pub type FocuserSetAutoFocusResponse = ();
1267
1268 pub struct ViewRefFocusedWatchResponse<T0> {
1270 pub state: T0,
1271 }
1272
1273 unsafe impl<___E, T0>
1274 ::fidl_next::Encode<crate::wire::ViewRefFocusedWatchResponse<'static>, ___E>
1275 for ViewRefFocusedWatchResponse<T0>
1276 where
1277 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1278 ___E: ::fidl_next::Encoder,
1279 T0: ::fidl_next::Encode<crate::wire::FocusState<'static>, ___E>,
1280 {
1281 #[inline]
1282 fn encode(
1283 self,
1284 encoder_: &mut ___E,
1285 out_: &mut ::core::mem::MaybeUninit<crate::wire::ViewRefFocusedWatchResponse<'static>>,
1286 _: (),
1287 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1288 ::fidl_next::munge! {
1289 let crate::wire::ViewRefFocusedWatchResponse {
1290 state,
1291
1292 } = out_;
1293 }
1294
1295 ::fidl_next::Encode::encode(self.state, encoder_, state, ())?;
1296
1297 Ok(())
1298 }
1299 }
1300
1301 pub type ViewRefInstalledWatchResponse = ();
1303}
1304
1305pub use self::natural::*;
1306
1307#[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"]
1309#[derive(PartialEq, Debug)]
1310pub struct ViewRefFocused;
1311
1312#[cfg(target_os = "fuchsia")]
1313impl ::fidl_next::HasTransport for ViewRefFocused {
1314 type Transport = ::fidl_next::fuchsia::zx::Channel;
1315}
1316
1317pub mod view_ref_focused {
1318 pub mod prelude {
1319 pub use crate::{
1320 ViewRefFocused, ViewRefFocusedClientHandler, ViewRefFocusedLocalClientHandler,
1321 ViewRefFocusedLocalServerHandler, ViewRefFocusedServerHandler, view_ref_focused,
1322 };
1323
1324 pub use crate::natural::ViewRefFocusedWatchResponse;
1325 }
1326
1327 pub struct Watch;
1328
1329 impl ::fidl_next::Method for Watch {
1330 const ORDINAL: u64 = 4350003391021357493;
1331 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1332 ::fidl_next::protocol::Flexibility::Strict;
1333
1334 type Protocol = crate::ViewRefFocused;
1335
1336 type Request = ::fidl_next::wire::EmptyMessageBody;
1337 }
1338
1339 impl ::fidl_next::TwoWayMethod for Watch {
1340 type Response = crate::wire::ViewRefFocusedWatchResponse<'static>;
1341 }
1342
1343 impl<___R> ::fidl_next::Respond<___R> for Watch {
1344 type Output = crate::generic::ViewRefFocusedWatchResponse<___R>;
1345
1346 fn respond(response: ___R) -> Self::Output {
1347 crate::generic::ViewRefFocusedWatchResponse { state: response }
1348 }
1349 }
1350
1351 mod ___detail {
1352 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::ViewRefFocused
1353 where
1354 ___T: ::fidl_next::Transport,
1355 {
1356 type Client = ViewRefFocusedClient<___T>;
1357 type Server = ViewRefFocusedServer<___T>;
1358 }
1359
1360 #[repr(transparent)]
1362 pub struct ViewRefFocusedClient<___T: ::fidl_next::Transport> {
1363 #[allow(dead_code)]
1364 client: ::fidl_next::protocol::Client<___T>,
1365 }
1366
1367 impl<___T> ViewRefFocusedClient<___T>
1368 where
1369 ___T: ::fidl_next::Transport,
1370 {
1371 #[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"]
1372 pub fn watch(&self) -> ::fidl_next::TwoWayFuture<'_, super::Watch, ___T> {
1373 ::fidl_next::TwoWayFuture::from_untyped(
1374 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
1375 4350003391021357493,
1376 <super::Watch as ::fidl_next::Method>::FLEXIBILITY,
1377 (),
1378 ),
1379 )
1380 }
1381 }
1382
1383 #[repr(transparent)]
1385 pub struct ViewRefFocusedServer<___T: ::fidl_next::Transport> {
1386 server: ::fidl_next::protocol::Server<___T>,
1387 }
1388
1389 impl<___T> ViewRefFocusedServer<___T> where ___T: ::fidl_next::Transport {}
1390 }
1391}
1392
1393#[diagnostic::on_unimplemented(
1394 note = "If {Self} implements the non-local ViewRefFocusedClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
1395)]
1396
1397pub trait ViewRefFocusedLocalClientHandler<
1401 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1402 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1403>
1404{
1405}
1406
1407impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for ViewRefFocused
1408where
1409 ___H: ViewRefFocusedLocalClientHandler<___T>,
1410 ___T: ::fidl_next::Transport,
1411{
1412 async fn on_event(
1413 handler: &mut ___H,
1414 ordinal: u64,
1415 flexibility: ::fidl_next::protocol::Flexibility,
1416 body: ::fidl_next::Body<___T>,
1417 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1418 match ordinal {
1419 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1420 }
1421 }
1422}
1423
1424#[diagnostic::on_unimplemented(
1425 note = "If {Self} implements the non-local ViewRefFocusedServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
1426)]
1427
1428pub trait ViewRefFocusedLocalServerHandler<
1432 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1433 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1434>
1435{
1436 #[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"]
1437 fn watch(
1438 &mut self,
1439
1440 responder: ::fidl_next::Responder<view_ref_focused::Watch, ___T>,
1441 ) -> impl ::core::future::Future<Output = ()>;
1442}
1443
1444impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for ViewRefFocused
1445where
1446 ___H: ViewRefFocusedLocalServerHandler<___T>,
1447 ___T: ::fidl_next::Transport,
1448{
1449 async fn on_one_way(
1450 handler: &mut ___H,
1451 ordinal: u64,
1452 flexibility: ::fidl_next::protocol::Flexibility,
1453 body: ::fidl_next::Body<___T>,
1454 ) -> ::core::result::Result<
1455 (),
1456 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1457 > {
1458 match ordinal {
1459 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1460 }
1461 }
1462
1463 async fn on_two_way(
1464 handler: &mut ___H,
1465 ordinal: u64,
1466 flexibility: ::fidl_next::protocol::Flexibility,
1467 body: ::fidl_next::Body<___T>,
1468 responder: ::fidl_next::protocol::Responder<___T>,
1469 ) -> ::core::result::Result<
1470 (),
1471 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1472 > {
1473 match ordinal {
1474 4350003391021357493 => {
1475 let responder = ::fidl_next::Responder::from_untyped(responder);
1476
1477 handler.watch(responder).await;
1478 Ok(())
1479 }
1480
1481 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1482 }
1483 }
1484}
1485
1486pub trait ViewRefFocusedClientHandler<
1490 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1491 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1492>
1493{
1494}
1495
1496impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ViewRefFocused
1497where
1498 ___H: ViewRefFocusedClientHandler<___T> + ::core::marker::Send,
1499 ___T: ::fidl_next::Transport,
1500{
1501 async fn on_event(
1502 handler: &mut ___H,
1503 ordinal: u64,
1504 flexibility: ::fidl_next::protocol::Flexibility,
1505 body: ::fidl_next::Body<___T>,
1506 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1507 match ordinal {
1508 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1509 }
1510 }
1511}
1512
1513pub trait ViewRefFocusedServerHandler<
1517 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1518 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1519>
1520{
1521 #[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"]
1522 fn watch(
1523 &mut self,
1524
1525 responder: ::fidl_next::Responder<view_ref_focused::Watch, ___T>,
1526 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1527}
1528
1529impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ViewRefFocused
1530where
1531 ___H: ViewRefFocusedServerHandler<___T> + ::core::marker::Send,
1532 ___T: ::fidl_next::Transport,
1533{
1534 async fn on_one_way(
1535 handler: &mut ___H,
1536 ordinal: u64,
1537 flexibility: ::fidl_next::protocol::Flexibility,
1538 body: ::fidl_next::Body<___T>,
1539 ) -> ::core::result::Result<
1540 (),
1541 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1542 > {
1543 match ordinal {
1544 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1545 }
1546 }
1547
1548 async fn on_two_way(
1549 handler: &mut ___H,
1550 ordinal: u64,
1551 flexibility: ::fidl_next::protocol::Flexibility,
1552 body: ::fidl_next::Body<___T>,
1553 responder: ::fidl_next::protocol::Responder<___T>,
1554 ) -> ::core::result::Result<
1555 (),
1556 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1557 > {
1558 match ordinal {
1559 4350003391021357493 => {
1560 let responder = ::fidl_next::Responder::from_untyped(responder);
1561
1562 handler.watch(responder).await;
1563 Ok(())
1564 }
1565
1566 ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1567 }
1568 }
1569}
1570
1571impl<___T> ViewRefFocusedClientHandler<___T> for ::fidl_next::IgnoreEvents where
1572 ___T: ::fidl_next::Transport
1573{
1574}
1575
1576impl<___H, ___T> ViewRefFocusedLocalClientHandler<___T> for ::fidl_next::Local<___H>
1577where
1578 ___H: ViewRefFocusedClientHandler<___T>,
1579 ___T: ::fidl_next::Transport,
1580{
1581}
1582
1583impl<___H, ___T> ViewRefFocusedLocalServerHandler<___T> for ::fidl_next::Local<___H>
1584where
1585 ___H: ViewRefFocusedServerHandler<___T>,
1586 ___T: ::fidl_next::Transport,
1587{
1588 async fn watch(&mut self, responder: ::fidl_next::Responder<view_ref_focused::Watch, ___T>) {
1589 ___H::watch(&mut self.0, responder).await
1590 }
1591}