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 pub struct Time {
9 pub seconds: u8,
10
11 pub minutes: u8,
12
13 pub hours: u8,
14
15 pub day: u8,
16
17 pub month: u8,
18
19 pub year: u16,
20 }
21
22 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Time, ___E> for Time
23 where
24 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
25 {
26 #[inline]
27 fn encode(
28 self,
29 encoder_: &mut ___E,
30 out_: &mut ::core::mem::MaybeUninit<crate::wire::Time>,
31 _: (),
32 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
33 ::fidl_next::munge! {
34 let crate::wire::Time {
35 seconds,
36 minutes,
37 hours,
38 day,
39 month,
40 year,
41
42 } = out_;
43 }
44
45 ::fidl_next::Encode::encode(self.seconds, encoder_, seconds, ())?;
46
47 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(seconds.as_mut_ptr()) };
48
49 ::fidl_next::Encode::encode(self.minutes, encoder_, minutes, ())?;
50
51 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(minutes.as_mut_ptr()) };
52
53 ::fidl_next::Encode::encode(self.hours, encoder_, hours, ())?;
54
55 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(hours.as_mut_ptr()) };
56
57 ::fidl_next::Encode::encode(self.day, encoder_, day, ())?;
58
59 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(day.as_mut_ptr()) };
60
61 ::fidl_next::Encode::encode(self.month, encoder_, month, ())?;
62
63 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(month.as_mut_ptr()) };
64
65 ::fidl_next::Encode::encode(self.year, encoder_, year, ())?;
66
67 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(year.as_mut_ptr()) };
68
69 Ok(())
70 }
71 }
72
73 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Time, ___E> for &'a Time
74 where
75 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
76 {
77 #[inline]
78 fn encode(
79 self,
80 encoder_: &mut ___E,
81 out_: &mut ::core::mem::MaybeUninit<crate::wire::Time>,
82 _: (),
83 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
84 ::fidl_next::munge! {
85 let crate::wire::Time {
86 seconds,
87 minutes,
88 hours,
89 day,
90 month,
91 year,
92
93 } = out_;
94 }
95
96 ::fidl_next::Encode::encode(&self.seconds, encoder_, seconds, ())?;
97
98 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(seconds.as_mut_ptr()) };
99
100 ::fidl_next::Encode::encode(&self.minutes, encoder_, minutes, ())?;
101
102 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(minutes.as_mut_ptr()) };
103
104 ::fidl_next::Encode::encode(&self.hours, encoder_, hours, ())?;
105
106 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(hours.as_mut_ptr()) };
107
108 ::fidl_next::Encode::encode(&self.day, encoder_, day, ())?;
109
110 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(day.as_mut_ptr()) };
111
112 ::fidl_next::Encode::encode(&self.month, encoder_, month, ())?;
113
114 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(month.as_mut_ptr()) };
115
116 ::fidl_next::Encode::encode(&self.year, encoder_, year, ())?;
117
118 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(year.as_mut_ptr()) };
119
120 Ok(())
121 }
122 }
123
124 unsafe impl<___E>
125 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::Time>, ___E> for Time
126 where
127 ___E: ::fidl_next::Encoder + ?Sized,
128 Time: ::fidl_next::Encode<crate::wire::Time, ___E>,
129 {
130 #[inline]
131 fn encode_option(
132 this: ::core::option::Option<Self>,
133 encoder: &mut ___E,
134 out: &mut ::core::mem::MaybeUninit<::fidl_next::wire::Box<'static, crate::wire::Time>>,
135 _: (),
136 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
137 if let Some(inner) = this {
138 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
139 ::fidl_next::wire::Box::encode_present(out);
140 } else {
141 ::fidl_next::wire::Box::encode_absent(out);
142 }
143
144 Ok(())
145 }
146 }
147
148 unsafe impl<'a, ___E>
149 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::Time>, ___E>
150 for &'a Time
151 where
152 ___E: ::fidl_next::Encoder + ?Sized,
153 &'a Time: ::fidl_next::Encode<crate::wire::Time, ___E>,
154 {
155 #[inline]
156 fn encode_option(
157 this: ::core::option::Option<Self>,
158 encoder: &mut ___E,
159 out: &mut ::core::mem::MaybeUninit<::fidl_next::wire::Box<'static, crate::wire::Time>>,
160 _: (),
161 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
162 if let Some(inner) = this {
163 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
164 ::fidl_next::wire::Box::encode_present(out);
165 } else {
166 ::fidl_next::wire::Box::encode_absent(out);
167 }
168
169 Ok(())
170 }
171 }
172
173 impl ::fidl_next::FromWire<crate::wire::Time> for Time {
174 #[inline]
175 fn from_wire(wire: crate::wire::Time) -> Self {
176 Self {
177 seconds: ::fidl_next::FromWire::from_wire(wire.seconds),
178
179 minutes: ::fidl_next::FromWire::from_wire(wire.minutes),
180
181 hours: ::fidl_next::FromWire::from_wire(wire.hours),
182
183 day: ::fidl_next::FromWire::from_wire(wire.day),
184
185 month: ::fidl_next::FromWire::from_wire(wire.month),
186
187 year: ::fidl_next::FromWire::from_wire(wire.year),
188 }
189 }
190 }
191
192 impl ::fidl_next::FromWireRef<crate::wire::Time> for Time {
193 #[inline]
194 fn from_wire_ref(wire: &crate::wire::Time) -> Self {
195 Self {
196 seconds: ::fidl_next::FromWireRef::from_wire_ref(&wire.seconds),
197
198 minutes: ::fidl_next::FromWireRef::from_wire_ref(&wire.minutes),
199
200 hours: ::fidl_next::FromWireRef::from_wire_ref(&wire.hours),
201
202 day: ::fidl_next::FromWireRef::from_wire_ref(&wire.day),
203
204 month: ::fidl_next::FromWireRef::from_wire_ref(&wire.month),
205
206 year: ::fidl_next::FromWireRef::from_wire_ref(&wire.year),
207 }
208 }
209 }
210
211 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
212 pub struct DeviceGetResponse {
213 pub rtc: crate::natural::Time,
214 }
215
216 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceGetResponse, ___E> for DeviceGetResponse
217 where
218 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
219 {
220 #[inline]
221 fn encode(
222 self,
223 encoder_: &mut ___E,
224 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetResponse>,
225 _: (),
226 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
227 ::fidl_next::munge! {
228 let crate::wire::DeviceGetResponse {
229 rtc,
230
231 } = out_;
232 }
233
234 ::fidl_next::Encode::encode(self.rtc, encoder_, rtc, ())?;
235
236 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(rtc.as_mut_ptr()) };
237
238 Ok(())
239 }
240 }
241
242 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceGetResponse, ___E>
243 for &'a DeviceGetResponse
244 where
245 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
246 {
247 #[inline]
248 fn encode(
249 self,
250 encoder_: &mut ___E,
251 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetResponse>,
252 _: (),
253 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
254 ::fidl_next::munge! {
255 let crate::wire::DeviceGetResponse {
256 rtc,
257
258 } = out_;
259 }
260
261 ::fidl_next::Encode::encode(&self.rtc, encoder_, rtc, ())?;
262
263 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(rtc.as_mut_ptr()) };
264
265 Ok(())
266 }
267 }
268
269 unsafe impl<___E>
270 ::fidl_next::EncodeOption<
271 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetResponse>,
272 ___E,
273 > for DeviceGetResponse
274 where
275 ___E: ::fidl_next::Encoder + ?Sized,
276 DeviceGetResponse: ::fidl_next::Encode<crate::wire::DeviceGetResponse, ___E>,
277 {
278 #[inline]
279 fn encode_option(
280 this: ::core::option::Option<Self>,
281 encoder: &mut ___E,
282 out: &mut ::core::mem::MaybeUninit<
283 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetResponse>,
284 >,
285 _: (),
286 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
287 if let Some(inner) = this {
288 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
289 ::fidl_next::wire::Box::encode_present(out);
290 } else {
291 ::fidl_next::wire::Box::encode_absent(out);
292 }
293
294 Ok(())
295 }
296 }
297
298 unsafe impl<'a, ___E>
299 ::fidl_next::EncodeOption<
300 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetResponse>,
301 ___E,
302 > for &'a DeviceGetResponse
303 where
304 ___E: ::fidl_next::Encoder + ?Sized,
305 &'a DeviceGetResponse: ::fidl_next::Encode<crate::wire::DeviceGetResponse, ___E>,
306 {
307 #[inline]
308 fn encode_option(
309 this: ::core::option::Option<Self>,
310 encoder: &mut ___E,
311 out: &mut ::core::mem::MaybeUninit<
312 ::fidl_next::wire::Box<'static, crate::wire::DeviceGetResponse>,
313 >,
314 _: (),
315 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
316 if let Some(inner) = this {
317 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
318 ::fidl_next::wire::Box::encode_present(out);
319 } else {
320 ::fidl_next::wire::Box::encode_absent(out);
321 }
322
323 Ok(())
324 }
325 }
326
327 impl ::fidl_next::FromWire<crate::wire::DeviceGetResponse> for DeviceGetResponse {
328 #[inline]
329 fn from_wire(wire: crate::wire::DeviceGetResponse) -> Self {
330 Self { rtc: ::fidl_next::FromWire::from_wire(wire.rtc) }
331 }
332 }
333
334 impl ::fidl_next::FromWireRef<crate::wire::DeviceGetResponse> for DeviceGetResponse {
335 #[inline]
336 fn from_wire_ref(wire: &crate::wire::DeviceGetResponse) -> Self {
337 Self { rtc: ::fidl_next::FromWireRef::from_wire_ref(&wire.rtc) }
338 }
339 }
340
341 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
342 pub struct DeviceSet2Request {
343 pub rtc: crate::natural::Time,
344 }
345
346 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeviceSet2Request, ___E> for DeviceSet2Request
347 where
348 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
349 {
350 #[inline]
351 fn encode(
352 self,
353 encoder_: &mut ___E,
354 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceSet2Request>,
355 _: (),
356 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
357 ::fidl_next::munge! {
358 let crate::wire::DeviceSet2Request {
359 rtc,
360
361 } = out_;
362 }
363
364 ::fidl_next::Encode::encode(self.rtc, encoder_, rtc, ())?;
365
366 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(rtc.as_mut_ptr()) };
367
368 Ok(())
369 }
370 }
371
372 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeviceSet2Request, ___E>
373 for &'a DeviceSet2Request
374 where
375 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
376 {
377 #[inline]
378 fn encode(
379 self,
380 encoder_: &mut ___E,
381 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceSet2Request>,
382 _: (),
383 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
384 ::fidl_next::munge! {
385 let crate::wire::DeviceSet2Request {
386 rtc,
387
388 } = out_;
389 }
390
391 ::fidl_next::Encode::encode(&self.rtc, encoder_, rtc, ())?;
392
393 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(rtc.as_mut_ptr()) };
394
395 Ok(())
396 }
397 }
398
399 unsafe impl<___E>
400 ::fidl_next::EncodeOption<
401 ::fidl_next::wire::Box<'static, crate::wire::DeviceSet2Request>,
402 ___E,
403 > for DeviceSet2Request
404 where
405 ___E: ::fidl_next::Encoder + ?Sized,
406 DeviceSet2Request: ::fidl_next::Encode<crate::wire::DeviceSet2Request, ___E>,
407 {
408 #[inline]
409 fn encode_option(
410 this: ::core::option::Option<Self>,
411 encoder: &mut ___E,
412 out: &mut ::core::mem::MaybeUninit<
413 ::fidl_next::wire::Box<'static, crate::wire::DeviceSet2Request>,
414 >,
415 _: (),
416 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
417 if let Some(inner) = this {
418 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
419 ::fidl_next::wire::Box::encode_present(out);
420 } else {
421 ::fidl_next::wire::Box::encode_absent(out);
422 }
423
424 Ok(())
425 }
426 }
427
428 unsafe impl<'a, ___E>
429 ::fidl_next::EncodeOption<
430 ::fidl_next::wire::Box<'static, crate::wire::DeviceSet2Request>,
431 ___E,
432 > for &'a DeviceSet2Request
433 where
434 ___E: ::fidl_next::Encoder + ?Sized,
435 &'a DeviceSet2Request: ::fidl_next::Encode<crate::wire::DeviceSet2Request, ___E>,
436 {
437 #[inline]
438 fn encode_option(
439 this: ::core::option::Option<Self>,
440 encoder: &mut ___E,
441 out: &mut ::core::mem::MaybeUninit<
442 ::fidl_next::wire::Box<'static, crate::wire::DeviceSet2Request>,
443 >,
444 _: (),
445 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
446 if let Some(inner) = this {
447 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
448 ::fidl_next::wire::Box::encode_present(out);
449 } else {
450 ::fidl_next::wire::Box::encode_absent(out);
451 }
452
453 Ok(())
454 }
455 }
456
457 impl ::fidl_next::FromWire<crate::wire::DeviceSet2Request> for DeviceSet2Request {
458 #[inline]
459 fn from_wire(wire: crate::wire::DeviceSet2Request) -> Self {
460 Self { rtc: ::fidl_next::FromWire::from_wire(wire.rtc) }
461 }
462 }
463
464 impl ::fidl_next::FromWireRef<crate::wire::DeviceSet2Request> for DeviceSet2Request {
465 #[inline]
466 fn from_wire_ref(wire: &crate::wire::DeviceSet2Request) -> Self {
467 Self { rtc: ::fidl_next::FromWireRef::from_wire_ref(&wire.rtc) }
468 }
469 }
470
471 pub type DeviceSet2Response = ();
472}
473
474pub mod wire {
475
476 #[derive(Clone, Debug)]
478 #[repr(C)]
479 pub struct Time {
480 pub seconds: u8,
481
482 pub minutes: u8,
483
484 pub hours: u8,
485
486 pub day: u8,
487
488 pub month: u8,
489
490 pub year: ::fidl_next::wire::Uint16,
491 }
492
493 static_assertions::const_assert_eq!(std::mem::size_of::<Time>(), 8);
494 static_assertions::const_assert_eq!(std::mem::align_of::<Time>(), 2);
495
496 static_assertions::const_assert_eq!(std::mem::offset_of!(Time, seconds), 0);
497
498 static_assertions::const_assert_eq!(std::mem::offset_of!(Time, minutes), 1);
499
500 static_assertions::const_assert_eq!(std::mem::offset_of!(Time, hours), 2);
501
502 static_assertions::const_assert_eq!(std::mem::offset_of!(Time, day), 3);
503
504 static_assertions::const_assert_eq!(std::mem::offset_of!(Time, month), 4);
505
506 static_assertions::const_assert_eq!(std::mem::offset_of!(Time, year), 6);
507
508 impl ::fidl_next::Constrained for Time {
509 type Constraint = ();
510
511 fn validate(
512 _: ::fidl_next::Slot<'_, Self>,
513 _: Self::Constraint,
514 ) -> Result<(), ::fidl_next::ValidationError> {
515 Ok(())
516 }
517 }
518
519 unsafe impl ::fidl_next::Wire for Time {
520 type Narrowed<'de> = Time;
521
522 #[inline]
523 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
524 ::fidl_next::munge! {
525 let Self {
526 seconds,
527 minutes,
528 hours,
529 day,
530 month,
531 year,
532
533 } = &mut *out_;
534 }
535
536 ::fidl_next::Wire::zero_padding(seconds);
537
538 ::fidl_next::Wire::zero_padding(minutes);
539
540 ::fidl_next::Wire::zero_padding(hours);
541
542 ::fidl_next::Wire::zero_padding(day);
543
544 ::fidl_next::Wire::zero_padding(month);
545
546 ::fidl_next::Wire::zero_padding(year);
547
548 unsafe {
549 out_.as_mut_ptr().cast::<u8>().add(5).write_bytes(0, 1);
550 }
551 }
552 }
553
554 unsafe impl<___D> ::fidl_next::Decode<___D> for Time
555 where
556 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
557 {
558 fn decode(
559 slot_: ::fidl_next::Slot<'_, Self>,
560 decoder_: &mut ___D,
561 _: (),
562 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
563 if slot_.as_bytes()[5..6] != [0u8; 1] {
564 return Err(::fidl_next::DecodeError::InvalidPadding);
565 }
566
567 ::fidl_next::munge! {
568 let Self {
569 mut seconds,
570 mut minutes,
571 mut hours,
572 mut day,
573 mut month,
574 mut year,
575
576 } = slot_;
577 }
578
579 let _field = seconds.as_mut();
580
581 ::fidl_next::Decode::decode(seconds.as_mut(), decoder_, ())?;
582
583 let _field = minutes.as_mut();
584
585 ::fidl_next::Decode::decode(minutes.as_mut(), decoder_, ())?;
586
587 let _field = hours.as_mut();
588
589 ::fidl_next::Decode::decode(hours.as_mut(), decoder_, ())?;
590
591 let _field = day.as_mut();
592
593 ::fidl_next::Decode::decode(day.as_mut(), decoder_, ())?;
594
595 let _field = month.as_mut();
596
597 ::fidl_next::Decode::decode(month.as_mut(), decoder_, ())?;
598
599 let _field = year.as_mut();
600
601 ::fidl_next::Decode::decode(year.as_mut(), decoder_, ())?;
602
603 Ok(())
604 }
605 }
606
607 impl ::fidl_next::IntoNatural for Time {
608 type Natural = crate::natural::Time;
609 }
610
611 #[derive(Clone, Debug)]
613 #[repr(C)]
614 pub struct DeviceGetResponse {
615 pub rtc: crate::wire::Time,
616 }
617
618 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceGetResponse>(), 8);
619 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceGetResponse>(), 2);
620
621 static_assertions::const_assert_eq!(std::mem::offset_of!(DeviceGetResponse, rtc), 0);
622
623 impl ::fidl_next::Constrained for DeviceGetResponse {
624 type Constraint = ();
625
626 fn validate(
627 _: ::fidl_next::Slot<'_, Self>,
628 _: Self::Constraint,
629 ) -> Result<(), ::fidl_next::ValidationError> {
630 Ok(())
631 }
632 }
633
634 unsafe impl ::fidl_next::Wire for DeviceGetResponse {
635 type Narrowed<'de> = DeviceGetResponse;
636
637 #[inline]
638 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
639 ::fidl_next::munge! {
640 let Self {
641 rtc,
642
643 } = &mut *out_;
644 }
645
646 ::fidl_next::Wire::zero_padding(rtc);
647 }
648 }
649
650 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceGetResponse
651 where
652 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
653 {
654 fn decode(
655 slot_: ::fidl_next::Slot<'_, Self>,
656 decoder_: &mut ___D,
657 _: (),
658 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
659 ::fidl_next::munge! {
660 let Self {
661 mut rtc,
662
663 } = slot_;
664 }
665
666 let _field = rtc.as_mut();
667
668 ::fidl_next::Decode::decode(rtc.as_mut(), decoder_, ())?;
669
670 Ok(())
671 }
672 }
673
674 impl ::fidl_next::IntoNatural for DeviceGetResponse {
675 type Natural = crate::natural::DeviceGetResponse;
676 }
677
678 #[derive(Clone, Debug)]
680 #[repr(C)]
681 pub struct DeviceSet2Request {
682 pub rtc: crate::wire::Time,
683 }
684
685 static_assertions::const_assert_eq!(std::mem::size_of::<DeviceSet2Request>(), 8);
686 static_assertions::const_assert_eq!(std::mem::align_of::<DeviceSet2Request>(), 2);
687
688 static_assertions::const_assert_eq!(std::mem::offset_of!(DeviceSet2Request, rtc), 0);
689
690 impl ::fidl_next::Constrained for DeviceSet2Request {
691 type Constraint = ();
692
693 fn validate(
694 _: ::fidl_next::Slot<'_, Self>,
695 _: Self::Constraint,
696 ) -> Result<(), ::fidl_next::ValidationError> {
697 Ok(())
698 }
699 }
700
701 unsafe impl ::fidl_next::Wire for DeviceSet2Request {
702 type Narrowed<'de> = DeviceSet2Request;
703
704 #[inline]
705 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
706 ::fidl_next::munge! {
707 let Self {
708 rtc,
709
710 } = &mut *out_;
711 }
712
713 ::fidl_next::Wire::zero_padding(rtc);
714 }
715 }
716
717 unsafe impl<___D> ::fidl_next::Decode<___D> for DeviceSet2Request
718 where
719 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
720 {
721 fn decode(
722 slot_: ::fidl_next::Slot<'_, Self>,
723 decoder_: &mut ___D,
724 _: (),
725 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
726 ::fidl_next::munge! {
727 let Self {
728 mut rtc,
729
730 } = slot_;
731 }
732
733 let _field = rtc.as_mut();
734
735 ::fidl_next::Decode::decode(rtc.as_mut(), decoder_, ())?;
736
737 Ok(())
738 }
739 }
740
741 impl ::fidl_next::IntoNatural for DeviceSet2Request {
742 type Natural = crate::natural::DeviceSet2Request;
743 }
744
745 pub type DeviceSet2Response = ::fidl_next::wire::Unit;
747}
748
749pub mod wire_optional {}
750
751pub mod generic {
752
753 pub struct Time<T0, T1, T2, T3, T4, T5> {
755 pub seconds: T0,
756
757 pub minutes: T1,
758
759 pub hours: T2,
760
761 pub day: T3,
762
763 pub month: T4,
764
765 pub year: T5,
766 }
767
768 unsafe impl<___E, T0, T1, T2, T3, T4, T5> ::fidl_next::Encode<crate::wire::Time, ___E>
769 for Time<T0, T1, T2, T3, T4, T5>
770 where
771 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
772 T0: ::fidl_next::Encode<u8, ___E>,
773 T1: ::fidl_next::Encode<u8, ___E>,
774 T2: ::fidl_next::Encode<u8, ___E>,
775 T3: ::fidl_next::Encode<u8, ___E>,
776 T4: ::fidl_next::Encode<u8, ___E>,
777 T5: ::fidl_next::Encode<::fidl_next::wire::Uint16, ___E>,
778 {
779 #[inline]
780 fn encode(
781 self,
782 encoder_: &mut ___E,
783 out_: &mut ::core::mem::MaybeUninit<crate::wire::Time>,
784 _: (),
785 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
786 ::fidl_next::munge! {
787 let crate::wire::Time {
788 seconds,
789 minutes,
790 hours,
791 day,
792 month,
793 year,
794
795 } = out_;
796 }
797
798 ::fidl_next::Encode::encode(self.seconds, encoder_, seconds, ())?;
799
800 ::fidl_next::Encode::encode(self.minutes, encoder_, minutes, ())?;
801
802 ::fidl_next::Encode::encode(self.hours, encoder_, hours, ())?;
803
804 ::fidl_next::Encode::encode(self.day, encoder_, day, ())?;
805
806 ::fidl_next::Encode::encode(self.month, encoder_, month, ())?;
807
808 ::fidl_next::Encode::encode(self.year, encoder_, year, ())?;
809
810 Ok(())
811 }
812 }
813
814 unsafe impl<'a, ___E, T0, T1, T2, T3, T4, T5> ::fidl_next::Encode<crate::wire::Time, ___E>
815 for &'a Time<T0, T1, T2, T3, T4, T5>
816 where
817 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
818 &'a T0: ::fidl_next::Encode<u8, ___E>,
819 &'a T1: ::fidl_next::Encode<u8, ___E>,
820 &'a T2: ::fidl_next::Encode<u8, ___E>,
821 &'a T3: ::fidl_next::Encode<u8, ___E>,
822 &'a T4: ::fidl_next::Encode<u8, ___E>,
823 &'a T5: ::fidl_next::Encode<::fidl_next::wire::Uint16, ___E>,
824 {
825 #[inline]
826 fn encode(
827 self,
828 encoder_: &mut ___E,
829 out_: &mut ::core::mem::MaybeUninit<crate::wire::Time>,
830 _: (),
831 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
832 ::fidl_next::munge! {
833 let crate::wire::Time {
834 seconds,
835 minutes,
836 hours,
837 day,
838 month,
839 year,
840
841 } = out_;
842 }
843
844 ::fidl_next::Encode::encode(&self.seconds, encoder_, seconds, ())?;
845
846 ::fidl_next::Encode::encode(&self.minutes, encoder_, minutes, ())?;
847
848 ::fidl_next::Encode::encode(&self.hours, encoder_, hours, ())?;
849
850 ::fidl_next::Encode::encode(&self.day, encoder_, day, ())?;
851
852 ::fidl_next::Encode::encode(&self.month, encoder_, month, ())?;
853
854 ::fidl_next::Encode::encode(&self.year, encoder_, year, ())?;
855
856 Ok(())
857 }
858 }
859
860 pub struct DeviceGetResponse<T0> {
862 pub rtc: T0,
863 }
864
865 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceGetResponse, ___E>
866 for DeviceGetResponse<T0>
867 where
868 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
869 T0: ::fidl_next::Encode<crate::wire::Time, ___E>,
870 {
871 #[inline]
872 fn encode(
873 self,
874 encoder_: &mut ___E,
875 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetResponse>,
876 _: (),
877 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
878 ::fidl_next::munge! {
879 let crate::wire::DeviceGetResponse {
880 rtc,
881
882 } = out_;
883 }
884
885 ::fidl_next::Encode::encode(self.rtc, encoder_, rtc, ())?;
886
887 Ok(())
888 }
889 }
890
891 unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::DeviceGetResponse, ___E>
892 for &'a DeviceGetResponse<T0>
893 where
894 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
895 &'a T0: ::fidl_next::Encode<crate::wire::Time, ___E>,
896 {
897 #[inline]
898 fn encode(
899 self,
900 encoder_: &mut ___E,
901 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceGetResponse>,
902 _: (),
903 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
904 ::fidl_next::munge! {
905 let crate::wire::DeviceGetResponse {
906 rtc,
907
908 } = out_;
909 }
910
911 ::fidl_next::Encode::encode(&self.rtc, encoder_, rtc, ())?;
912
913 Ok(())
914 }
915 }
916
917 pub struct DeviceSet2Request<T0> {
919 pub rtc: T0,
920 }
921
922 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::DeviceSet2Request, ___E>
923 for DeviceSet2Request<T0>
924 where
925 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
926 T0: ::fidl_next::Encode<crate::wire::Time, ___E>,
927 {
928 #[inline]
929 fn encode(
930 self,
931 encoder_: &mut ___E,
932 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceSet2Request>,
933 _: (),
934 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
935 ::fidl_next::munge! {
936 let crate::wire::DeviceSet2Request {
937 rtc,
938
939 } = out_;
940 }
941
942 ::fidl_next::Encode::encode(self.rtc, encoder_, rtc, ())?;
943
944 Ok(())
945 }
946 }
947
948 unsafe impl<'a, ___E, T0> ::fidl_next::Encode<crate::wire::DeviceSet2Request, ___E>
949 for &'a DeviceSet2Request<T0>
950 where
951 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
952 &'a T0: ::fidl_next::Encode<crate::wire::Time, ___E>,
953 {
954 #[inline]
955 fn encode(
956 self,
957 encoder_: &mut ___E,
958 out_: &mut ::core::mem::MaybeUninit<crate::wire::DeviceSet2Request>,
959 _: (),
960 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
961 ::fidl_next::munge! {
962 let crate::wire::DeviceSet2Request {
963 rtc,
964
965 } = out_;
966 }
967
968 ::fidl_next::Encode::encode(&self.rtc, encoder_, rtc, ())?;
969
970 Ok(())
971 }
972 }
973
974 pub type DeviceSet2Response = ();
976}
977
978pub use self::natural::*;
979
980#[derive(PartialEq, Debug)]
982pub struct Device;
983
984impl ::fidl_next::Discoverable for Device {
985 const PROTOCOL_NAME: &'static str = "fuchsia.hardware.rtc.Device";
986}
987
988#[cfg(target_os = "fuchsia")]
989impl ::fidl_next::HasTransport for Device {
990 type Transport = ::fidl_next::fuchsia::zx::Channel;
991}
992
993pub mod device {
994 pub mod prelude {
995 pub use crate::{
996 Device, DeviceClientHandler, DeviceLocalClientHandler, DeviceLocalServerHandler,
997 DeviceServerHandler, device,
998 };
999
1000 pub use crate::natural::DeviceSet2Request;
1001
1002 pub use crate::natural::DeviceGetResponse;
1003
1004 pub use crate::natural::DeviceSet2Response;
1005 }
1006
1007 pub struct Get;
1008
1009 impl ::fidl_next::Method for Get {
1010 const ORDINAL: u64 = 2881649623829671924;
1011 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1012 ::fidl_next::protocol::Flexibility::Flexible;
1013
1014 type Protocol = crate::Device;
1015
1016 type Request = ::fidl_next::wire::EmptyMessageBody;
1017 }
1018
1019 impl ::fidl_next::TwoWayMethod for Get {
1020 type Response = ::fidl_next::wire::Result<
1021 'static,
1022 crate::wire::DeviceGetResponse,
1023 ::fidl_next::wire::fuchsia::Status,
1024 >;
1025 }
1026
1027 impl<___R> ::fidl_next::Respond<___R> for Get {
1028 type Output = ::core::result::Result<
1029 crate::generic::DeviceGetResponse<___R>,
1030 ::fidl_next::never::Never,
1031 >;
1032
1033 fn respond(response: ___R) -> Self::Output {
1034 ::core::result::Result::Ok(crate::generic::DeviceGetResponse { rtc: response })
1035 }
1036 }
1037
1038 impl<___R> ::fidl_next::RespondErr<___R> for Get {
1039 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1040
1041 fn respond_err(response: ___R) -> Self::Output {
1042 ::core::result::Result::Err(response)
1043 }
1044 }
1045
1046 pub struct Set2;
1047
1048 impl ::fidl_next::Method for Set2 {
1049 const ORDINAL: u64 = 1614978035535395557;
1050 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1051 ::fidl_next::protocol::Flexibility::Flexible;
1052
1053 type Protocol = crate::Device;
1054
1055 type Request = crate::wire::DeviceSet2Request;
1056 }
1057
1058 impl ::fidl_next::TwoWayMethod for Set2 {
1059 type Response = ::fidl_next::wire::Result<
1060 'static,
1061 crate::wire::DeviceSet2Response,
1062 ::fidl_next::wire::fuchsia::Status,
1063 >;
1064 }
1065
1066 impl<___R> ::fidl_next::Respond<___R> for Set2 {
1067 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
1068
1069 fn respond(response: ___R) -> Self::Output {
1070 ::core::result::Result::Ok(response)
1071 }
1072 }
1073
1074 impl<___R> ::fidl_next::RespondErr<___R> for Set2 {
1075 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1076
1077 fn respond_err(response: ___R) -> Self::Output {
1078 ::core::result::Result::Err(response)
1079 }
1080 }
1081
1082 mod ___detail {
1083 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Device
1084 where
1085 ___T: ::fidl_next::Transport,
1086 {
1087 type Client = DeviceClient<___T>;
1088 type Server = DeviceServer<___T>;
1089 }
1090
1091 #[repr(transparent)]
1093 pub struct DeviceClient<___T: ::fidl_next::Transport> {
1094 #[allow(dead_code)]
1095 client: ::fidl_next::protocol::Client<___T>,
1096 }
1097
1098 impl<___T> DeviceClient<___T>
1099 where
1100 ___T: ::fidl_next::Transport,
1101 {
1102 #[doc = " Get the current RTC time.\n If the driver detects that it does not have a valid time to report, then it will return an\n `ZX_ERR_INTERNAL` error.\n"]
1103 pub fn get(&self) -> ::fidl_next::TwoWayFuture<'_, super::Get, ___T> {
1104 ::fidl_next::TwoWayFuture::from_untyped(
1105 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
1106 2881649623829671924,
1107 <super::Get as ::fidl_next::Method>::FLEXIBILITY,
1108 (),
1109 ),
1110 )
1111 }
1112
1113 #[doc = " Set the RTC time.\n If the RTC time is not valid, the driver will return an `ZX_ERR_OUT_OF_RANGE` error.\n"]
1114 pub fn set2(
1115 &self,
1116
1117 rtc: impl ::fidl_next::Encode<
1118 crate::wire::Time,
1119 <___T as ::fidl_next::Transport>::SendBuffer,
1120 >,
1121 ) -> ::fidl_next::TwoWayFuture<'_, super::Set2, ___T>
1122 where
1123 <___T as ::fidl_next::Transport>::SendBuffer:
1124 ::fidl_next::encoder::InternalHandleEncoder,
1125 {
1126 self.set2_with(crate::generic::DeviceSet2Request { rtc })
1127 }
1128
1129 #[doc = " Set the RTC time.\n If the RTC time is not valid, the driver will return an `ZX_ERR_OUT_OF_RANGE` error.\n"]
1130 pub fn set2_with<___R>(
1131 &self,
1132 request: ___R,
1133 ) -> ::fidl_next::TwoWayFuture<'_, super::Set2, ___T>
1134 where
1135 ___R: ::fidl_next::Encode<
1136 crate::wire::DeviceSet2Request,
1137 <___T as ::fidl_next::Transport>::SendBuffer,
1138 >,
1139 {
1140 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1141 1614978035535395557,
1142 <super::Set2 as ::fidl_next::Method>::FLEXIBILITY,
1143 request,
1144 ))
1145 }
1146 }
1147
1148 #[repr(transparent)]
1150 pub struct DeviceServer<___T: ::fidl_next::Transport> {
1151 server: ::fidl_next::protocol::Server<___T>,
1152 }
1153
1154 impl<___T> DeviceServer<___T> where ___T: ::fidl_next::Transport {}
1155 }
1156}
1157
1158#[diagnostic::on_unimplemented(
1159 note = "If {Self} implements the non-local DeviceClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
1160)]
1161
1162pub trait DeviceLocalClientHandler<
1166 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1167 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1168>
1169{
1170 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1171 ::core::future::ready(())
1172 }
1173}
1174
1175impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Device
1176where
1177 ___H: DeviceLocalClientHandler<___T>,
1178 ___T: ::fidl_next::Transport,
1179{
1180 async fn on_event(
1181 handler: &mut ___H,
1182 mut message: ::fidl_next::Message<___T>,
1183 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1184 match *message.header().ordinal {
1185 ordinal => {
1186 handler.on_unknown_interaction(ordinal).await;
1187 if ::core::matches!(
1188 message.header().flexibility(),
1189 ::fidl_next::protocol::Flexibility::Strict
1190 ) {
1191 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1192 } else {
1193 Ok(())
1194 }
1195 }
1196 }
1197 }
1198}
1199
1200#[diagnostic::on_unimplemented(
1201 note = "If {Self} implements the non-local DeviceServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
1202)]
1203
1204pub trait DeviceLocalServerHandler<
1208 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1209 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1210>
1211{
1212 #[doc = " Get the current RTC time.\n If the driver detects that it does not have a valid time to report, then it will return an\n `ZX_ERR_INTERNAL` error.\n"]
1213 fn get(
1214 &mut self,
1215
1216 responder: ::fidl_next::Responder<device::Get, ___T>,
1217 ) -> impl ::core::future::Future<Output = ()>;
1218
1219 #[doc = " Set the RTC time.\n If the RTC time is not valid, the driver will return an `ZX_ERR_OUT_OF_RANGE` error.\n"]
1220 fn set2(
1221 &mut self,
1222
1223 request: ::fidl_next::Request<device::Set2, ___T>,
1224
1225 responder: ::fidl_next::Responder<device::Set2, ___T>,
1226 ) -> impl ::core::future::Future<Output = ()>;
1227
1228 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1229 ::core::future::ready(())
1230 }
1231}
1232
1233impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Device
1234where
1235 ___H: DeviceLocalServerHandler<___T>,
1236 ___T: ::fidl_next::Transport,
1237 for<'de> crate::wire::DeviceSet2Request: ::fidl_next::Decode<
1238 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1239 Constraint = (),
1240 >,
1241{
1242 async fn on_one_way(
1243 handler: &mut ___H,
1244 mut message: ::fidl_next::Message<___T>,
1245 ) -> ::core::result::Result<
1246 (),
1247 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1248 > {
1249 match *message.header().ordinal {
1250 ordinal => {
1251 handler.on_unknown_interaction(ordinal).await;
1252 if ::core::matches!(
1253 message.header().flexibility(),
1254 ::fidl_next::protocol::Flexibility::Strict
1255 ) {
1256 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1257 } else {
1258 Ok(())
1259 }
1260 }
1261 }
1262 }
1263
1264 async fn on_two_way(
1265 handler: &mut ___H,
1266 mut message: ::fidl_next::Message<___T>,
1267 responder: ::fidl_next::protocol::Responder<___T>,
1268 ) -> ::core::result::Result<
1269 (),
1270 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1271 > {
1272 match *message.header().ordinal {
1273 2881649623829671924 => {
1274 let responder = ::fidl_next::Responder::from_untyped(responder);
1275
1276 handler.get(responder).await;
1277 Ok(())
1278 }
1279
1280 1614978035535395557 => {
1281 let responder = ::fidl_next::Responder::from_untyped(responder);
1282
1283 match ::fidl_next::AsDecoderExt::into_decoded(message) {
1284 Ok(decoded) => {
1285 handler.set2(::fidl_next::Request::from_decoded(decoded), responder).await;
1286 Ok(())
1287 }
1288 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1289 ordinal: 1614978035535395557,
1290 error,
1291 }),
1292 }
1293 }
1294
1295 ordinal => {
1296 handler.on_unknown_interaction(ordinal).await;
1297 if ::core::matches!(
1298 message.header().flexibility(),
1299 ::fidl_next::protocol::Flexibility::Strict
1300 ) {
1301 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1302 } else {
1303 responder
1304 .respond_framework_error(
1305 ordinal,
1306 ::fidl_next::FrameworkError::UnknownMethod,
1307 )
1308 .expect("encoding a framework error should never fail")
1309 .await?;
1310 Ok(())
1311 }
1312 }
1313 }
1314 }
1315}
1316
1317pub trait DeviceClientHandler<
1321 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1322 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1323>
1324{
1325 fn on_unknown_interaction(
1326 &mut self,
1327 ordinal: u64,
1328 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1329 ::core::future::ready(())
1330 }
1331}
1332
1333impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Device
1334where
1335 ___H: DeviceClientHandler<___T> + ::core::marker::Send,
1336 ___T: ::fidl_next::Transport,
1337{
1338 async fn on_event(
1339 handler: &mut ___H,
1340 mut message: ::fidl_next::Message<___T>,
1341 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1342 match *message.header().ordinal {
1343 ordinal => {
1344 handler.on_unknown_interaction(ordinal).await;
1345 if ::core::matches!(
1346 message.header().flexibility(),
1347 ::fidl_next::protocol::Flexibility::Strict
1348 ) {
1349 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1350 } else {
1351 Ok(())
1352 }
1353 }
1354 }
1355 }
1356}
1357
1358pub trait DeviceServerHandler<
1362 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1363 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1364>
1365{
1366 #[doc = " Get the current RTC time.\n If the driver detects that it does not have a valid time to report, then it will return an\n `ZX_ERR_INTERNAL` error.\n"]
1367 fn get(
1368 &mut self,
1369
1370 responder: ::fidl_next::Responder<device::Get, ___T>,
1371 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1372
1373 #[doc = " Set the RTC time.\n If the RTC time is not valid, the driver will return an `ZX_ERR_OUT_OF_RANGE` error.\n"]
1374 fn set2(
1375 &mut self,
1376
1377 request: ::fidl_next::Request<device::Set2, ___T>,
1378
1379 responder: ::fidl_next::Responder<device::Set2, ___T>,
1380 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1381
1382 fn on_unknown_interaction(
1383 &mut self,
1384 ordinal: u64,
1385 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1386 ::core::future::ready(())
1387 }
1388}
1389
1390impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Device
1391where
1392 ___H: DeviceServerHandler<___T> + ::core::marker::Send,
1393 ___T: ::fidl_next::Transport,
1394 for<'de> crate::wire::DeviceSet2Request: ::fidl_next::Decode<
1395 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1396 Constraint = (),
1397 >,
1398{
1399 async fn on_one_way(
1400 handler: &mut ___H,
1401 mut message: ::fidl_next::Message<___T>,
1402 ) -> ::core::result::Result<
1403 (),
1404 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1405 > {
1406 match *message.header().ordinal {
1407 ordinal => {
1408 handler.on_unknown_interaction(ordinal).await;
1409 if ::core::matches!(
1410 message.header().flexibility(),
1411 ::fidl_next::protocol::Flexibility::Strict
1412 ) {
1413 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1414 } else {
1415 Ok(())
1416 }
1417 }
1418 }
1419 }
1420
1421 async fn on_two_way(
1422 handler: &mut ___H,
1423 mut message: ::fidl_next::Message<___T>,
1424 responder: ::fidl_next::protocol::Responder<___T>,
1425 ) -> ::core::result::Result<
1426 (),
1427 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1428 > {
1429 match *message.header().ordinal {
1430 2881649623829671924 => {
1431 let responder = ::fidl_next::Responder::from_untyped(responder);
1432
1433 handler.get(responder).await;
1434 Ok(())
1435 }
1436
1437 1614978035535395557 => {
1438 let responder = ::fidl_next::Responder::from_untyped(responder);
1439
1440 match ::fidl_next::AsDecoderExt::into_decoded(message) {
1441 Ok(decoded) => {
1442 handler.set2(::fidl_next::Request::from_decoded(decoded), responder).await;
1443 Ok(())
1444 }
1445 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1446 ordinal: 1614978035535395557,
1447 error,
1448 }),
1449 }
1450 }
1451
1452 ordinal => {
1453 handler.on_unknown_interaction(ordinal).await;
1454 if ::core::matches!(
1455 message.header().flexibility(),
1456 ::fidl_next::protocol::Flexibility::Strict
1457 ) {
1458 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1459 } else {
1460 responder
1461 .respond_framework_error(
1462 ordinal,
1463 ::fidl_next::FrameworkError::UnknownMethod,
1464 )
1465 .expect("encoding a framework error should never fail")
1466 .await?;
1467 Ok(())
1468 }
1469 }
1470 }
1471 }
1472}
1473
1474impl<___T> DeviceClientHandler<___T> for ::fidl_next::IgnoreEvents
1475where
1476 ___T: ::fidl_next::Transport,
1477{
1478 async fn on_unknown_interaction(&mut self, _: u64) {}
1479}
1480
1481impl<___H, ___T> DeviceLocalClientHandler<___T> for ::fidl_next::Local<___H>
1482where
1483 ___H: DeviceClientHandler<___T>,
1484 ___T: ::fidl_next::Transport,
1485{
1486 async fn on_unknown_interaction(&mut self, ordinal: u64) {
1487 ___H::on_unknown_interaction(&mut self.0, ordinal).await
1488 }
1489}
1490
1491impl<___H, ___T> DeviceLocalServerHandler<___T> for ::fidl_next::Local<___H>
1492where
1493 ___H: DeviceServerHandler<___T>,
1494 ___T: ::fidl_next::Transport,
1495{
1496 async fn get(&mut self, responder: ::fidl_next::Responder<device::Get, ___T>) {
1497 ___H::get(&mut self.0, responder).await
1498 }
1499
1500 async fn set2(
1501 &mut self,
1502
1503 request: ::fidl_next::Request<device::Set2, ___T>,
1504
1505 responder: ::fidl_next::Responder<device::Set2, ___T>,
1506 ) {
1507 ___H::set2(&mut self.0, request, responder).await
1508 }
1509
1510 async fn on_unknown_interaction(&mut self, ordinal: u64) {
1511 ___H::on_unknown_interaction(&mut self.0, ordinal).await
1512 }
1513}