1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 pub type ClockEnableResponse = ();
8
9 pub type ClockDisableResponse = ();
10
11 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
12 #[repr(C)]
13 pub struct ClockIsEnabledResponse {
14 pub enabled: bool,
15 }
16
17 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ClockIsEnabledResponse, ___E>
18 for ClockIsEnabledResponse
19 where
20 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21 {
22 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
23 Self,
24 crate::wire::ClockIsEnabledResponse,
25 > = unsafe {
26 ::fidl_next::CopyOptimization::enable_if(
27 true && <bool as ::fidl_next::Encode<bool, ___E>>::COPY_OPTIMIZATION.is_enabled(),
28 )
29 };
30
31 #[inline]
32 fn encode(
33 self,
34 encoder_: &mut ___E,
35 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockIsEnabledResponse>,
36 _: (),
37 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
38 ::fidl_next::munge! {
39 let crate::wire::ClockIsEnabledResponse {
40 enabled,
41
42 } = out_;
43 }
44
45 ::fidl_next::Encode::encode(self.enabled, encoder_, enabled, ())?;
46
47 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(enabled.as_mut_ptr()) };
48
49 Ok(())
50 }
51 }
52
53 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ClockIsEnabledResponse, ___E>
54 for &'a ClockIsEnabledResponse
55 where
56 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
57 {
58 #[inline]
59 fn encode(
60 self,
61 encoder_: &mut ___E,
62 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockIsEnabledResponse>,
63 _: (),
64 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
65 ::fidl_next::munge! {
66 let crate::wire::ClockIsEnabledResponse {
67 enabled,
68
69 } = out_;
70 }
71
72 ::fidl_next::Encode::encode(&self.enabled, encoder_, enabled, ())?;
73
74 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(enabled.as_mut_ptr()) };
75
76 Ok(())
77 }
78 }
79
80 unsafe impl<___E>
81 ::fidl_next::EncodeOption<
82 ::fidl_next::wire::Box<'static, crate::wire::ClockIsEnabledResponse>,
83 ___E,
84 > for ClockIsEnabledResponse
85 where
86 ___E: ::fidl_next::Encoder + ?Sized,
87 ClockIsEnabledResponse: ::fidl_next::Encode<crate::wire::ClockIsEnabledResponse, ___E>,
88 {
89 #[inline]
90 fn encode_option(
91 this: ::core::option::Option<Self>,
92 encoder: &mut ___E,
93 out: &mut ::core::mem::MaybeUninit<
94 ::fidl_next::wire::Box<'static, crate::wire::ClockIsEnabledResponse>,
95 >,
96 _: (),
97 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
98 if let Some(inner) = this {
99 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
100 ::fidl_next::wire::Box::encode_present(out);
101 } else {
102 ::fidl_next::wire::Box::encode_absent(out);
103 }
104
105 Ok(())
106 }
107 }
108
109 unsafe impl<'a, ___E>
110 ::fidl_next::EncodeOption<
111 ::fidl_next::wire::Box<'static, crate::wire::ClockIsEnabledResponse>,
112 ___E,
113 > for &'a ClockIsEnabledResponse
114 where
115 ___E: ::fidl_next::Encoder + ?Sized,
116 &'a ClockIsEnabledResponse: ::fidl_next::Encode<crate::wire::ClockIsEnabledResponse, ___E>,
117 {
118 #[inline]
119 fn encode_option(
120 this: ::core::option::Option<Self>,
121 encoder: &mut ___E,
122 out: &mut ::core::mem::MaybeUninit<
123 ::fidl_next::wire::Box<'static, crate::wire::ClockIsEnabledResponse>,
124 >,
125 _: (),
126 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
127 if let Some(inner) = this {
128 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
129 ::fidl_next::wire::Box::encode_present(out);
130 } else {
131 ::fidl_next::wire::Box::encode_absent(out);
132 }
133
134 Ok(())
135 }
136 }
137
138 impl ::fidl_next::FromWire<crate::wire::ClockIsEnabledResponse> for ClockIsEnabledResponse {
139 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
140 crate::wire::ClockIsEnabledResponse,
141 Self,
142 > = unsafe {
143 ::fidl_next::CopyOptimization::enable_if(
144 true && <bool as ::fidl_next::FromWire<bool>>::COPY_OPTIMIZATION.is_enabled(),
145 )
146 };
147
148 #[inline]
149 fn from_wire(wire: crate::wire::ClockIsEnabledResponse) -> Self {
150 Self { enabled: ::fidl_next::FromWire::from_wire(wire.enabled) }
151 }
152 }
153
154 impl ::fidl_next::FromWireRef<crate::wire::ClockIsEnabledResponse> for ClockIsEnabledResponse {
155 #[inline]
156 fn from_wire_ref(wire: &crate::wire::ClockIsEnabledResponse) -> Self {
157 Self { enabled: ::fidl_next::FromWireRef::from_wire_ref(&wire.enabled) }
158 }
159 }
160
161 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
162 #[repr(C)]
163 pub struct ClockSetRateRequest {
164 pub hz: u64,
165 }
166
167 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ClockSetRateRequest, ___E>
168 for ClockSetRateRequest
169 where
170 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
171 {
172 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
173 Self,
174 crate::wire::ClockSetRateRequest,
175 > = unsafe {
176 ::fidl_next::CopyOptimization::enable_if(
177 true
178
179 && <
180 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
181 >::COPY_OPTIMIZATION.is_enabled()
182
183 )
184 };
185
186 #[inline]
187 fn encode(
188 self,
189 encoder_: &mut ___E,
190 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockSetRateRequest>,
191 _: (),
192 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
193 ::fidl_next::munge! {
194 let crate::wire::ClockSetRateRequest {
195 hz,
196
197 } = out_;
198 }
199
200 ::fidl_next::Encode::encode(self.hz, encoder_, hz, ())?;
201
202 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(hz.as_mut_ptr()) };
203
204 Ok(())
205 }
206 }
207
208 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ClockSetRateRequest, ___E>
209 for &'a ClockSetRateRequest
210 where
211 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
212 {
213 #[inline]
214 fn encode(
215 self,
216 encoder_: &mut ___E,
217 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockSetRateRequest>,
218 _: (),
219 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
220 ::fidl_next::munge! {
221 let crate::wire::ClockSetRateRequest {
222 hz,
223
224 } = out_;
225 }
226
227 ::fidl_next::Encode::encode(&self.hz, encoder_, hz, ())?;
228
229 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(hz.as_mut_ptr()) };
230
231 Ok(())
232 }
233 }
234
235 unsafe impl<___E>
236 ::fidl_next::EncodeOption<
237 ::fidl_next::wire::Box<'static, crate::wire::ClockSetRateRequest>,
238 ___E,
239 > for ClockSetRateRequest
240 where
241 ___E: ::fidl_next::Encoder + ?Sized,
242 ClockSetRateRequest: ::fidl_next::Encode<crate::wire::ClockSetRateRequest, ___E>,
243 {
244 #[inline]
245 fn encode_option(
246 this: ::core::option::Option<Self>,
247 encoder: &mut ___E,
248 out: &mut ::core::mem::MaybeUninit<
249 ::fidl_next::wire::Box<'static, crate::wire::ClockSetRateRequest>,
250 >,
251 _: (),
252 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
253 if let Some(inner) = this {
254 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
255 ::fidl_next::wire::Box::encode_present(out);
256 } else {
257 ::fidl_next::wire::Box::encode_absent(out);
258 }
259
260 Ok(())
261 }
262 }
263
264 unsafe impl<'a, ___E>
265 ::fidl_next::EncodeOption<
266 ::fidl_next::wire::Box<'static, crate::wire::ClockSetRateRequest>,
267 ___E,
268 > for &'a ClockSetRateRequest
269 where
270 ___E: ::fidl_next::Encoder + ?Sized,
271 &'a ClockSetRateRequest: ::fidl_next::Encode<crate::wire::ClockSetRateRequest, ___E>,
272 {
273 #[inline]
274 fn encode_option(
275 this: ::core::option::Option<Self>,
276 encoder: &mut ___E,
277 out: &mut ::core::mem::MaybeUninit<
278 ::fidl_next::wire::Box<'static, crate::wire::ClockSetRateRequest>,
279 >,
280 _: (),
281 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
282 if let Some(inner) = this {
283 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
284 ::fidl_next::wire::Box::encode_present(out);
285 } else {
286 ::fidl_next::wire::Box::encode_absent(out);
287 }
288
289 Ok(())
290 }
291 }
292
293 impl ::fidl_next::FromWire<crate::wire::ClockSetRateRequest> for ClockSetRateRequest {
294 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
295 crate::wire::ClockSetRateRequest,
296 Self,
297 > = unsafe {
298 ::fidl_next::CopyOptimization::enable_if(
299 true
300 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
301 .is_enabled(),
302 )
303 };
304
305 #[inline]
306 fn from_wire(wire: crate::wire::ClockSetRateRequest) -> Self {
307 Self { hz: ::fidl_next::FromWire::from_wire(wire.hz) }
308 }
309 }
310
311 impl ::fidl_next::FromWireRef<crate::wire::ClockSetRateRequest> for ClockSetRateRequest {
312 #[inline]
313 fn from_wire_ref(wire: &crate::wire::ClockSetRateRequest) -> Self {
314 Self { hz: ::fidl_next::FromWireRef::from_wire_ref(&wire.hz) }
315 }
316 }
317
318 pub type ClockSetRateResponse = ();
319
320 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
321 #[repr(C)]
322 pub struct ClockQuerySupportedRateRequest {
323 pub hz_in: u64,
324 }
325
326 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ClockQuerySupportedRateRequest, ___E>
327 for ClockQuerySupportedRateRequest
328 where
329 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
330 {
331 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
332 Self,
333 crate::wire::ClockQuerySupportedRateRequest,
334 > = unsafe {
335 ::fidl_next::CopyOptimization::enable_if(
336 true
337
338 && <
339 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
340 >::COPY_OPTIMIZATION.is_enabled()
341
342 )
343 };
344
345 #[inline]
346 fn encode(
347 self,
348 encoder_: &mut ___E,
349 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockQuerySupportedRateRequest>,
350 _: (),
351 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
352 ::fidl_next::munge! {
353 let crate::wire::ClockQuerySupportedRateRequest {
354 hz_in,
355
356 } = out_;
357 }
358
359 ::fidl_next::Encode::encode(self.hz_in, encoder_, hz_in, ())?;
360
361 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(hz_in.as_mut_ptr()) };
362
363 Ok(())
364 }
365 }
366
367 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ClockQuerySupportedRateRequest, ___E>
368 for &'a ClockQuerySupportedRateRequest
369 where
370 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
371 {
372 #[inline]
373 fn encode(
374 self,
375 encoder_: &mut ___E,
376 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockQuerySupportedRateRequest>,
377 _: (),
378 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
379 ::fidl_next::munge! {
380 let crate::wire::ClockQuerySupportedRateRequest {
381 hz_in,
382
383 } = out_;
384 }
385
386 ::fidl_next::Encode::encode(&self.hz_in, encoder_, hz_in, ())?;
387
388 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(hz_in.as_mut_ptr()) };
389
390 Ok(())
391 }
392 }
393
394 unsafe impl<___E>
395 ::fidl_next::EncodeOption<
396 ::fidl_next::wire::Box<'static, crate::wire::ClockQuerySupportedRateRequest>,
397 ___E,
398 > for ClockQuerySupportedRateRequest
399 where
400 ___E: ::fidl_next::Encoder + ?Sized,
401 ClockQuerySupportedRateRequest:
402 ::fidl_next::Encode<crate::wire::ClockQuerySupportedRateRequest, ___E>,
403 {
404 #[inline]
405 fn encode_option(
406 this: ::core::option::Option<Self>,
407 encoder: &mut ___E,
408 out: &mut ::core::mem::MaybeUninit<
409 ::fidl_next::wire::Box<'static, crate::wire::ClockQuerySupportedRateRequest>,
410 >,
411 _: (),
412 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
413 if let Some(inner) = this {
414 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
415 ::fidl_next::wire::Box::encode_present(out);
416 } else {
417 ::fidl_next::wire::Box::encode_absent(out);
418 }
419
420 Ok(())
421 }
422 }
423
424 unsafe impl<'a, ___E>
425 ::fidl_next::EncodeOption<
426 ::fidl_next::wire::Box<'static, crate::wire::ClockQuerySupportedRateRequest>,
427 ___E,
428 > for &'a ClockQuerySupportedRateRequest
429 where
430 ___E: ::fidl_next::Encoder + ?Sized,
431 &'a ClockQuerySupportedRateRequest:
432 ::fidl_next::Encode<crate::wire::ClockQuerySupportedRateRequest, ___E>,
433 {
434 #[inline]
435 fn encode_option(
436 this: ::core::option::Option<Self>,
437 encoder: &mut ___E,
438 out: &mut ::core::mem::MaybeUninit<
439 ::fidl_next::wire::Box<'static, crate::wire::ClockQuerySupportedRateRequest>,
440 >,
441 _: (),
442 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
443 if let Some(inner) = this {
444 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
445 ::fidl_next::wire::Box::encode_present(out);
446 } else {
447 ::fidl_next::wire::Box::encode_absent(out);
448 }
449
450 Ok(())
451 }
452 }
453
454 impl ::fidl_next::FromWire<crate::wire::ClockQuerySupportedRateRequest>
455 for ClockQuerySupportedRateRequest
456 {
457 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
458 crate::wire::ClockQuerySupportedRateRequest,
459 Self,
460 > = unsafe {
461 ::fidl_next::CopyOptimization::enable_if(
462 true
463 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
464 .is_enabled(),
465 )
466 };
467
468 #[inline]
469 fn from_wire(wire: crate::wire::ClockQuerySupportedRateRequest) -> Self {
470 Self { hz_in: ::fidl_next::FromWire::from_wire(wire.hz_in) }
471 }
472 }
473
474 impl ::fidl_next::FromWireRef<crate::wire::ClockQuerySupportedRateRequest>
475 for ClockQuerySupportedRateRequest
476 {
477 #[inline]
478 fn from_wire_ref(wire: &crate::wire::ClockQuerySupportedRateRequest) -> Self {
479 Self { hz_in: ::fidl_next::FromWireRef::from_wire_ref(&wire.hz_in) }
480 }
481 }
482
483 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
484 #[repr(C)]
485 pub struct ClockQuerySupportedRateResponse {
486 pub hz_out: u64,
487 }
488
489 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ClockQuerySupportedRateResponse, ___E>
490 for ClockQuerySupportedRateResponse
491 where
492 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
493 {
494 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
495 Self,
496 crate::wire::ClockQuerySupportedRateResponse,
497 > = unsafe {
498 ::fidl_next::CopyOptimization::enable_if(
499 true
500
501 && <
502 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
503 >::COPY_OPTIMIZATION.is_enabled()
504
505 )
506 };
507
508 #[inline]
509 fn encode(
510 self,
511 encoder_: &mut ___E,
512 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockQuerySupportedRateResponse>,
513 _: (),
514 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
515 ::fidl_next::munge! {
516 let crate::wire::ClockQuerySupportedRateResponse {
517 hz_out,
518
519 } = out_;
520 }
521
522 ::fidl_next::Encode::encode(self.hz_out, encoder_, hz_out, ())?;
523
524 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(hz_out.as_mut_ptr()) };
525
526 Ok(())
527 }
528 }
529
530 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ClockQuerySupportedRateResponse, ___E>
531 for &'a ClockQuerySupportedRateResponse
532 where
533 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
534 {
535 #[inline]
536 fn encode(
537 self,
538 encoder_: &mut ___E,
539 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockQuerySupportedRateResponse>,
540 _: (),
541 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
542 ::fidl_next::munge! {
543 let crate::wire::ClockQuerySupportedRateResponse {
544 hz_out,
545
546 } = out_;
547 }
548
549 ::fidl_next::Encode::encode(&self.hz_out, encoder_, hz_out, ())?;
550
551 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(hz_out.as_mut_ptr()) };
552
553 Ok(())
554 }
555 }
556
557 unsafe impl<___E>
558 ::fidl_next::EncodeOption<
559 ::fidl_next::wire::Box<'static, crate::wire::ClockQuerySupportedRateResponse>,
560 ___E,
561 > for ClockQuerySupportedRateResponse
562 where
563 ___E: ::fidl_next::Encoder + ?Sized,
564 ClockQuerySupportedRateResponse:
565 ::fidl_next::Encode<crate::wire::ClockQuerySupportedRateResponse, ___E>,
566 {
567 #[inline]
568 fn encode_option(
569 this: ::core::option::Option<Self>,
570 encoder: &mut ___E,
571 out: &mut ::core::mem::MaybeUninit<
572 ::fidl_next::wire::Box<'static, crate::wire::ClockQuerySupportedRateResponse>,
573 >,
574 _: (),
575 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
576 if let Some(inner) = this {
577 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
578 ::fidl_next::wire::Box::encode_present(out);
579 } else {
580 ::fidl_next::wire::Box::encode_absent(out);
581 }
582
583 Ok(())
584 }
585 }
586
587 unsafe impl<'a, ___E>
588 ::fidl_next::EncodeOption<
589 ::fidl_next::wire::Box<'static, crate::wire::ClockQuerySupportedRateResponse>,
590 ___E,
591 > for &'a ClockQuerySupportedRateResponse
592 where
593 ___E: ::fidl_next::Encoder + ?Sized,
594 &'a ClockQuerySupportedRateResponse:
595 ::fidl_next::Encode<crate::wire::ClockQuerySupportedRateResponse, ___E>,
596 {
597 #[inline]
598 fn encode_option(
599 this: ::core::option::Option<Self>,
600 encoder: &mut ___E,
601 out: &mut ::core::mem::MaybeUninit<
602 ::fidl_next::wire::Box<'static, crate::wire::ClockQuerySupportedRateResponse>,
603 >,
604 _: (),
605 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
606 if let Some(inner) = this {
607 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
608 ::fidl_next::wire::Box::encode_present(out);
609 } else {
610 ::fidl_next::wire::Box::encode_absent(out);
611 }
612
613 Ok(())
614 }
615 }
616
617 impl ::fidl_next::FromWire<crate::wire::ClockQuerySupportedRateResponse>
618 for ClockQuerySupportedRateResponse
619 {
620 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
621 crate::wire::ClockQuerySupportedRateResponse,
622 Self,
623 > = unsafe {
624 ::fidl_next::CopyOptimization::enable_if(
625 true
626 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
627 .is_enabled(),
628 )
629 };
630
631 #[inline]
632 fn from_wire(wire: crate::wire::ClockQuerySupportedRateResponse) -> Self {
633 Self { hz_out: ::fidl_next::FromWire::from_wire(wire.hz_out) }
634 }
635 }
636
637 impl ::fidl_next::FromWireRef<crate::wire::ClockQuerySupportedRateResponse>
638 for ClockQuerySupportedRateResponse
639 {
640 #[inline]
641 fn from_wire_ref(wire: &crate::wire::ClockQuerySupportedRateResponse) -> Self {
642 Self { hz_out: ::fidl_next::FromWireRef::from_wire_ref(&wire.hz_out) }
643 }
644 }
645
646 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
647 #[repr(C)]
648 pub struct ClockGetRateResponse {
649 pub hz: u64,
650 }
651
652 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ClockGetRateResponse, ___E>
653 for ClockGetRateResponse
654 where
655 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
656 {
657 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
658 Self,
659 crate::wire::ClockGetRateResponse,
660 > = unsafe {
661 ::fidl_next::CopyOptimization::enable_if(
662 true
663
664 && <
665 u64 as ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>
666 >::COPY_OPTIMIZATION.is_enabled()
667
668 )
669 };
670
671 #[inline]
672 fn encode(
673 self,
674 encoder_: &mut ___E,
675 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockGetRateResponse>,
676 _: (),
677 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
678 ::fidl_next::munge! {
679 let crate::wire::ClockGetRateResponse {
680 hz,
681
682 } = out_;
683 }
684
685 ::fidl_next::Encode::encode(self.hz, encoder_, hz, ())?;
686
687 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(hz.as_mut_ptr()) };
688
689 Ok(())
690 }
691 }
692
693 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ClockGetRateResponse, ___E>
694 for &'a ClockGetRateResponse
695 where
696 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
697 {
698 #[inline]
699 fn encode(
700 self,
701 encoder_: &mut ___E,
702 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockGetRateResponse>,
703 _: (),
704 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
705 ::fidl_next::munge! {
706 let crate::wire::ClockGetRateResponse {
707 hz,
708
709 } = out_;
710 }
711
712 ::fidl_next::Encode::encode(&self.hz, encoder_, hz, ())?;
713
714 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(hz.as_mut_ptr()) };
715
716 Ok(())
717 }
718 }
719
720 unsafe impl<___E>
721 ::fidl_next::EncodeOption<
722 ::fidl_next::wire::Box<'static, crate::wire::ClockGetRateResponse>,
723 ___E,
724 > for ClockGetRateResponse
725 where
726 ___E: ::fidl_next::Encoder + ?Sized,
727 ClockGetRateResponse: ::fidl_next::Encode<crate::wire::ClockGetRateResponse, ___E>,
728 {
729 #[inline]
730 fn encode_option(
731 this: ::core::option::Option<Self>,
732 encoder: &mut ___E,
733 out: &mut ::core::mem::MaybeUninit<
734 ::fidl_next::wire::Box<'static, crate::wire::ClockGetRateResponse>,
735 >,
736 _: (),
737 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
738 if let Some(inner) = this {
739 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
740 ::fidl_next::wire::Box::encode_present(out);
741 } else {
742 ::fidl_next::wire::Box::encode_absent(out);
743 }
744
745 Ok(())
746 }
747 }
748
749 unsafe impl<'a, ___E>
750 ::fidl_next::EncodeOption<
751 ::fidl_next::wire::Box<'static, crate::wire::ClockGetRateResponse>,
752 ___E,
753 > for &'a ClockGetRateResponse
754 where
755 ___E: ::fidl_next::Encoder + ?Sized,
756 &'a ClockGetRateResponse: ::fidl_next::Encode<crate::wire::ClockGetRateResponse, ___E>,
757 {
758 #[inline]
759 fn encode_option(
760 this: ::core::option::Option<Self>,
761 encoder: &mut ___E,
762 out: &mut ::core::mem::MaybeUninit<
763 ::fidl_next::wire::Box<'static, crate::wire::ClockGetRateResponse>,
764 >,
765 _: (),
766 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
767 if let Some(inner) = this {
768 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
769 ::fidl_next::wire::Box::encode_present(out);
770 } else {
771 ::fidl_next::wire::Box::encode_absent(out);
772 }
773
774 Ok(())
775 }
776 }
777
778 impl ::fidl_next::FromWire<crate::wire::ClockGetRateResponse> for ClockGetRateResponse {
779 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
780 crate::wire::ClockGetRateResponse,
781 Self,
782 > = unsafe {
783 ::fidl_next::CopyOptimization::enable_if(
784 true
785 && <u64 as ::fidl_next::FromWire<::fidl_next::wire::Uint64>>::COPY_OPTIMIZATION
786 .is_enabled(),
787 )
788 };
789
790 #[inline]
791 fn from_wire(wire: crate::wire::ClockGetRateResponse) -> Self {
792 Self { hz: ::fidl_next::FromWire::from_wire(wire.hz) }
793 }
794 }
795
796 impl ::fidl_next::FromWireRef<crate::wire::ClockGetRateResponse> for ClockGetRateResponse {
797 #[inline]
798 fn from_wire_ref(wire: &crate::wire::ClockGetRateResponse) -> Self {
799 Self { hz: ::fidl_next::FromWireRef::from_wire_ref(&wire.hz) }
800 }
801 }
802
803 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
804 #[repr(C)]
805 pub struct ClockSetInputRequest {
806 pub idx: u32,
807 }
808
809 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ClockSetInputRequest, ___E>
810 for ClockSetInputRequest
811 where
812 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
813 {
814 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
815 Self,
816 crate::wire::ClockSetInputRequest,
817 > = unsafe {
818 ::fidl_next::CopyOptimization::enable_if(
819 true
820
821 && <
822 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
823 >::COPY_OPTIMIZATION.is_enabled()
824
825 )
826 };
827
828 #[inline]
829 fn encode(
830 self,
831 encoder_: &mut ___E,
832 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockSetInputRequest>,
833 _: (),
834 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
835 ::fidl_next::munge! {
836 let crate::wire::ClockSetInputRequest {
837 idx,
838
839 } = out_;
840 }
841
842 ::fidl_next::Encode::encode(self.idx, encoder_, idx, ())?;
843
844 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(idx.as_mut_ptr()) };
845
846 Ok(())
847 }
848 }
849
850 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ClockSetInputRequest, ___E>
851 for &'a ClockSetInputRequest
852 where
853 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
854 {
855 #[inline]
856 fn encode(
857 self,
858 encoder_: &mut ___E,
859 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockSetInputRequest>,
860 _: (),
861 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
862 ::fidl_next::munge! {
863 let crate::wire::ClockSetInputRequest {
864 idx,
865
866 } = out_;
867 }
868
869 ::fidl_next::Encode::encode(&self.idx, encoder_, idx, ())?;
870
871 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(idx.as_mut_ptr()) };
872
873 Ok(())
874 }
875 }
876
877 unsafe impl<___E>
878 ::fidl_next::EncodeOption<
879 ::fidl_next::wire::Box<'static, crate::wire::ClockSetInputRequest>,
880 ___E,
881 > for ClockSetInputRequest
882 where
883 ___E: ::fidl_next::Encoder + ?Sized,
884 ClockSetInputRequest: ::fidl_next::Encode<crate::wire::ClockSetInputRequest, ___E>,
885 {
886 #[inline]
887 fn encode_option(
888 this: ::core::option::Option<Self>,
889 encoder: &mut ___E,
890 out: &mut ::core::mem::MaybeUninit<
891 ::fidl_next::wire::Box<'static, crate::wire::ClockSetInputRequest>,
892 >,
893 _: (),
894 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
895 if let Some(inner) = this {
896 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
897 ::fidl_next::wire::Box::encode_present(out);
898 } else {
899 ::fidl_next::wire::Box::encode_absent(out);
900 }
901
902 Ok(())
903 }
904 }
905
906 unsafe impl<'a, ___E>
907 ::fidl_next::EncodeOption<
908 ::fidl_next::wire::Box<'static, crate::wire::ClockSetInputRequest>,
909 ___E,
910 > for &'a ClockSetInputRequest
911 where
912 ___E: ::fidl_next::Encoder + ?Sized,
913 &'a ClockSetInputRequest: ::fidl_next::Encode<crate::wire::ClockSetInputRequest, ___E>,
914 {
915 #[inline]
916 fn encode_option(
917 this: ::core::option::Option<Self>,
918 encoder: &mut ___E,
919 out: &mut ::core::mem::MaybeUninit<
920 ::fidl_next::wire::Box<'static, crate::wire::ClockSetInputRequest>,
921 >,
922 _: (),
923 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
924 if let Some(inner) = this {
925 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
926 ::fidl_next::wire::Box::encode_present(out);
927 } else {
928 ::fidl_next::wire::Box::encode_absent(out);
929 }
930
931 Ok(())
932 }
933 }
934
935 impl ::fidl_next::FromWire<crate::wire::ClockSetInputRequest> for ClockSetInputRequest {
936 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
937 crate::wire::ClockSetInputRequest,
938 Self,
939 > = unsafe {
940 ::fidl_next::CopyOptimization::enable_if(
941 true
942 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
943 .is_enabled(),
944 )
945 };
946
947 #[inline]
948 fn from_wire(wire: crate::wire::ClockSetInputRequest) -> Self {
949 Self { idx: ::fidl_next::FromWire::from_wire(wire.idx) }
950 }
951 }
952
953 impl ::fidl_next::FromWireRef<crate::wire::ClockSetInputRequest> for ClockSetInputRequest {
954 #[inline]
955 fn from_wire_ref(wire: &crate::wire::ClockSetInputRequest) -> Self {
956 Self { idx: ::fidl_next::FromWireRef::from_wire_ref(&wire.idx) }
957 }
958 }
959
960 pub type ClockSetInputResponse = ();
961
962 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
963 #[repr(C)]
964 pub struct ClockGetNumInputsResponse {
965 pub n: u32,
966 }
967
968 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ClockGetNumInputsResponse, ___E>
969 for ClockGetNumInputsResponse
970 where
971 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
972 {
973 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
974 Self,
975 crate::wire::ClockGetNumInputsResponse,
976 > = unsafe {
977 ::fidl_next::CopyOptimization::enable_if(
978 true
979
980 && <
981 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
982 >::COPY_OPTIMIZATION.is_enabled()
983
984 )
985 };
986
987 #[inline]
988 fn encode(
989 self,
990 encoder_: &mut ___E,
991 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockGetNumInputsResponse>,
992 _: (),
993 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
994 ::fidl_next::munge! {
995 let crate::wire::ClockGetNumInputsResponse {
996 n,
997
998 } = out_;
999 }
1000
1001 ::fidl_next::Encode::encode(self.n, encoder_, n, ())?;
1002
1003 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(n.as_mut_ptr()) };
1004
1005 Ok(())
1006 }
1007 }
1008
1009 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ClockGetNumInputsResponse, ___E>
1010 for &'a ClockGetNumInputsResponse
1011 where
1012 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1013 {
1014 #[inline]
1015 fn encode(
1016 self,
1017 encoder_: &mut ___E,
1018 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockGetNumInputsResponse>,
1019 _: (),
1020 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1021 ::fidl_next::munge! {
1022 let crate::wire::ClockGetNumInputsResponse {
1023 n,
1024
1025 } = out_;
1026 }
1027
1028 ::fidl_next::Encode::encode(&self.n, encoder_, n, ())?;
1029
1030 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(n.as_mut_ptr()) };
1031
1032 Ok(())
1033 }
1034 }
1035
1036 unsafe impl<___E>
1037 ::fidl_next::EncodeOption<
1038 ::fidl_next::wire::Box<'static, crate::wire::ClockGetNumInputsResponse>,
1039 ___E,
1040 > for ClockGetNumInputsResponse
1041 where
1042 ___E: ::fidl_next::Encoder + ?Sized,
1043 ClockGetNumInputsResponse:
1044 ::fidl_next::Encode<crate::wire::ClockGetNumInputsResponse, ___E>,
1045 {
1046 #[inline]
1047 fn encode_option(
1048 this: ::core::option::Option<Self>,
1049 encoder: &mut ___E,
1050 out: &mut ::core::mem::MaybeUninit<
1051 ::fidl_next::wire::Box<'static, crate::wire::ClockGetNumInputsResponse>,
1052 >,
1053 _: (),
1054 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1055 if let Some(inner) = this {
1056 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1057 ::fidl_next::wire::Box::encode_present(out);
1058 } else {
1059 ::fidl_next::wire::Box::encode_absent(out);
1060 }
1061
1062 Ok(())
1063 }
1064 }
1065
1066 unsafe impl<'a, ___E>
1067 ::fidl_next::EncodeOption<
1068 ::fidl_next::wire::Box<'static, crate::wire::ClockGetNumInputsResponse>,
1069 ___E,
1070 > for &'a ClockGetNumInputsResponse
1071 where
1072 ___E: ::fidl_next::Encoder + ?Sized,
1073 &'a ClockGetNumInputsResponse:
1074 ::fidl_next::Encode<crate::wire::ClockGetNumInputsResponse, ___E>,
1075 {
1076 #[inline]
1077 fn encode_option(
1078 this: ::core::option::Option<Self>,
1079 encoder: &mut ___E,
1080 out: &mut ::core::mem::MaybeUninit<
1081 ::fidl_next::wire::Box<'static, crate::wire::ClockGetNumInputsResponse>,
1082 >,
1083 _: (),
1084 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1085 if let Some(inner) = this {
1086 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1087 ::fidl_next::wire::Box::encode_present(out);
1088 } else {
1089 ::fidl_next::wire::Box::encode_absent(out);
1090 }
1091
1092 Ok(())
1093 }
1094 }
1095
1096 impl ::fidl_next::FromWire<crate::wire::ClockGetNumInputsResponse> for ClockGetNumInputsResponse {
1097 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1098 crate::wire::ClockGetNumInputsResponse,
1099 Self,
1100 > = unsafe {
1101 ::fidl_next::CopyOptimization::enable_if(
1102 true
1103 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
1104 .is_enabled(),
1105 )
1106 };
1107
1108 #[inline]
1109 fn from_wire(wire: crate::wire::ClockGetNumInputsResponse) -> Self {
1110 Self { n: ::fidl_next::FromWire::from_wire(wire.n) }
1111 }
1112 }
1113
1114 impl ::fidl_next::FromWireRef<crate::wire::ClockGetNumInputsResponse>
1115 for ClockGetNumInputsResponse
1116 {
1117 #[inline]
1118 fn from_wire_ref(wire: &crate::wire::ClockGetNumInputsResponse) -> Self {
1119 Self { n: ::fidl_next::FromWireRef::from_wire_ref(&wire.n) }
1120 }
1121 }
1122
1123 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1124 #[repr(C)]
1125 pub struct ClockGetInputResponse {
1126 pub index: u32,
1127 }
1128
1129 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ClockGetInputResponse, ___E>
1130 for ClockGetInputResponse
1131 where
1132 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1133 {
1134 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1135 Self,
1136 crate::wire::ClockGetInputResponse,
1137 > = unsafe {
1138 ::fidl_next::CopyOptimization::enable_if(
1139 true
1140
1141 && <
1142 u32 as ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>
1143 >::COPY_OPTIMIZATION.is_enabled()
1144
1145 )
1146 };
1147
1148 #[inline]
1149 fn encode(
1150 self,
1151 encoder_: &mut ___E,
1152 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockGetInputResponse>,
1153 _: (),
1154 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1155 ::fidl_next::munge! {
1156 let crate::wire::ClockGetInputResponse {
1157 index,
1158
1159 } = out_;
1160 }
1161
1162 ::fidl_next::Encode::encode(self.index, encoder_, index, ())?;
1163
1164 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(index.as_mut_ptr()) };
1165
1166 Ok(())
1167 }
1168 }
1169
1170 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ClockGetInputResponse, ___E>
1171 for &'a ClockGetInputResponse
1172 where
1173 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1174 {
1175 #[inline]
1176 fn encode(
1177 self,
1178 encoder_: &mut ___E,
1179 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockGetInputResponse>,
1180 _: (),
1181 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1182 ::fidl_next::munge! {
1183 let crate::wire::ClockGetInputResponse {
1184 index,
1185
1186 } = out_;
1187 }
1188
1189 ::fidl_next::Encode::encode(&self.index, encoder_, index, ())?;
1190
1191 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(index.as_mut_ptr()) };
1192
1193 Ok(())
1194 }
1195 }
1196
1197 unsafe impl<___E>
1198 ::fidl_next::EncodeOption<
1199 ::fidl_next::wire::Box<'static, crate::wire::ClockGetInputResponse>,
1200 ___E,
1201 > for ClockGetInputResponse
1202 where
1203 ___E: ::fidl_next::Encoder + ?Sized,
1204 ClockGetInputResponse: ::fidl_next::Encode<crate::wire::ClockGetInputResponse, ___E>,
1205 {
1206 #[inline]
1207 fn encode_option(
1208 this: ::core::option::Option<Self>,
1209 encoder: &mut ___E,
1210 out: &mut ::core::mem::MaybeUninit<
1211 ::fidl_next::wire::Box<'static, crate::wire::ClockGetInputResponse>,
1212 >,
1213 _: (),
1214 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1215 if let Some(inner) = this {
1216 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1217 ::fidl_next::wire::Box::encode_present(out);
1218 } else {
1219 ::fidl_next::wire::Box::encode_absent(out);
1220 }
1221
1222 Ok(())
1223 }
1224 }
1225
1226 unsafe impl<'a, ___E>
1227 ::fidl_next::EncodeOption<
1228 ::fidl_next::wire::Box<'static, crate::wire::ClockGetInputResponse>,
1229 ___E,
1230 > for &'a ClockGetInputResponse
1231 where
1232 ___E: ::fidl_next::Encoder + ?Sized,
1233 &'a ClockGetInputResponse: ::fidl_next::Encode<crate::wire::ClockGetInputResponse, ___E>,
1234 {
1235 #[inline]
1236 fn encode_option(
1237 this: ::core::option::Option<Self>,
1238 encoder: &mut ___E,
1239 out: &mut ::core::mem::MaybeUninit<
1240 ::fidl_next::wire::Box<'static, crate::wire::ClockGetInputResponse>,
1241 >,
1242 _: (),
1243 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1244 if let Some(inner) = this {
1245 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1246 ::fidl_next::wire::Box::encode_present(out);
1247 } else {
1248 ::fidl_next::wire::Box::encode_absent(out);
1249 }
1250
1251 Ok(())
1252 }
1253 }
1254
1255 impl ::fidl_next::FromWire<crate::wire::ClockGetInputResponse> for ClockGetInputResponse {
1256 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1257 crate::wire::ClockGetInputResponse,
1258 Self,
1259 > = unsafe {
1260 ::fidl_next::CopyOptimization::enable_if(
1261 true
1262 && <u32 as ::fidl_next::FromWire<::fidl_next::wire::Uint32>>::COPY_OPTIMIZATION
1263 .is_enabled(),
1264 )
1265 };
1266
1267 #[inline]
1268 fn from_wire(wire: crate::wire::ClockGetInputResponse) -> Self {
1269 Self { index: ::fidl_next::FromWire::from_wire(wire.index) }
1270 }
1271 }
1272
1273 impl ::fidl_next::FromWireRef<crate::wire::ClockGetInputResponse> for ClockGetInputResponse {
1274 #[inline]
1275 fn from_wire_ref(wire: &crate::wire::ClockGetInputResponse) -> Self {
1276 Self { index: ::fidl_next::FromWireRef::from_wire_ref(&wire.index) }
1277 }
1278 }
1279
1280 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1281 pub struct ClockGetPropertiesResponse {
1282 pub id: u32,
1283
1284 pub name: ::std::string::String,
1285 }
1286
1287 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ClockGetPropertiesResponse<'static>, ___E>
1288 for ClockGetPropertiesResponse
1289 where
1290 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1291 ___E: ::fidl_next::Encoder,
1292 {
1293 #[inline]
1294 fn encode(
1295 self,
1296 encoder_: &mut ___E,
1297 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockGetPropertiesResponse<'static>>,
1298 _: (),
1299 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1300 ::fidl_next::munge! {
1301 let crate::wire::ClockGetPropertiesResponse {
1302 id,
1303 name,
1304
1305 } = out_;
1306 }
1307
1308 ::fidl_next::Encode::encode(self.id, encoder_, id, ())?;
1309
1310 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(id.as_mut_ptr()) };
1311
1312 ::fidl_next::Encode::encode(self.name, encoder_, name, 256)?;
1313
1314 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
1315 ::fidl_next::Constrained::validate(_field, 256)?;
1316
1317 Ok(())
1318 }
1319 }
1320
1321 unsafe impl<'a, ___E>
1322 ::fidl_next::Encode<crate::wire::ClockGetPropertiesResponse<'static>, ___E>
1323 for &'a ClockGetPropertiesResponse
1324 where
1325 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1326 ___E: ::fidl_next::Encoder,
1327 {
1328 #[inline]
1329 fn encode(
1330 self,
1331 encoder_: &mut ___E,
1332 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockGetPropertiesResponse<'static>>,
1333 _: (),
1334 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1335 ::fidl_next::munge! {
1336 let crate::wire::ClockGetPropertiesResponse {
1337 id,
1338 name,
1339
1340 } = out_;
1341 }
1342
1343 ::fidl_next::Encode::encode(&self.id, encoder_, id, ())?;
1344
1345 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(id.as_mut_ptr()) };
1346
1347 ::fidl_next::Encode::encode(&self.name, encoder_, name, 256)?;
1348
1349 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
1350 ::fidl_next::Constrained::validate(_field, 256)?;
1351
1352 Ok(())
1353 }
1354 }
1355
1356 unsafe impl<___E>
1357 ::fidl_next::EncodeOption<
1358 ::fidl_next::wire::Box<'static, crate::wire::ClockGetPropertiesResponse<'static>>,
1359 ___E,
1360 > for ClockGetPropertiesResponse
1361 where
1362 ___E: ::fidl_next::Encoder + ?Sized,
1363 ClockGetPropertiesResponse:
1364 ::fidl_next::Encode<crate::wire::ClockGetPropertiesResponse<'static>, ___E>,
1365 {
1366 #[inline]
1367 fn encode_option(
1368 this: ::core::option::Option<Self>,
1369 encoder: &mut ___E,
1370 out: &mut ::core::mem::MaybeUninit<
1371 ::fidl_next::wire::Box<'static, crate::wire::ClockGetPropertiesResponse<'static>>,
1372 >,
1373 _: (),
1374 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1375 if let Some(inner) = this {
1376 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1377 ::fidl_next::wire::Box::encode_present(out);
1378 } else {
1379 ::fidl_next::wire::Box::encode_absent(out);
1380 }
1381
1382 Ok(())
1383 }
1384 }
1385
1386 unsafe impl<'a, ___E>
1387 ::fidl_next::EncodeOption<
1388 ::fidl_next::wire::Box<'static, crate::wire::ClockGetPropertiesResponse<'static>>,
1389 ___E,
1390 > for &'a ClockGetPropertiesResponse
1391 where
1392 ___E: ::fidl_next::Encoder + ?Sized,
1393 &'a ClockGetPropertiesResponse:
1394 ::fidl_next::Encode<crate::wire::ClockGetPropertiesResponse<'static>, ___E>,
1395 {
1396 #[inline]
1397 fn encode_option(
1398 this: ::core::option::Option<Self>,
1399 encoder: &mut ___E,
1400 out: &mut ::core::mem::MaybeUninit<
1401 ::fidl_next::wire::Box<'static, crate::wire::ClockGetPropertiesResponse<'static>>,
1402 >,
1403 _: (),
1404 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1405 if let Some(inner) = this {
1406 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1407 ::fidl_next::wire::Box::encode_present(out);
1408 } else {
1409 ::fidl_next::wire::Box::encode_absent(out);
1410 }
1411
1412 Ok(())
1413 }
1414 }
1415
1416 impl<'de> ::fidl_next::FromWire<crate::wire::ClockGetPropertiesResponse<'de>>
1417 for ClockGetPropertiesResponse
1418 {
1419 #[inline]
1420 fn from_wire(wire: crate::wire::ClockGetPropertiesResponse<'de>) -> Self {
1421 Self {
1422 id: ::fidl_next::FromWire::from_wire(wire.id),
1423
1424 name: ::fidl_next::FromWire::from_wire(wire.name),
1425 }
1426 }
1427 }
1428
1429 impl<'de> ::fidl_next::FromWireRef<crate::wire::ClockGetPropertiesResponse<'de>>
1430 for ClockGetPropertiesResponse
1431 {
1432 #[inline]
1433 fn from_wire_ref(wire: &crate::wire::ClockGetPropertiesResponse<'de>) -> Self {
1434 Self {
1435 id: ::fidl_next::FromWireRef::from_wire_ref(&wire.id),
1436
1437 name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
1438 }
1439 }
1440 }
1441}
1442
1443pub mod wire {
1444
1445 pub type ClockEnableResponse = ::fidl_next::wire::Unit;
1447
1448 pub type ClockDisableResponse = ::fidl_next::wire::Unit;
1450
1451 #[derive(Clone, Debug)]
1453 #[repr(C)]
1454 pub struct ClockIsEnabledResponse {
1455 pub enabled: bool,
1456 }
1457
1458 static_assertions::const_assert_eq!(std::mem::size_of::<ClockIsEnabledResponse>(), 1);
1459 static_assertions::const_assert_eq!(std::mem::align_of::<ClockIsEnabledResponse>(), 1);
1460
1461 static_assertions::const_assert_eq!(std::mem::offset_of!(ClockIsEnabledResponse, enabled), 0);
1462
1463 impl ::fidl_next::Constrained for ClockIsEnabledResponse {
1464 type Constraint = ();
1465
1466 fn validate(
1467 _: ::fidl_next::Slot<'_, Self>,
1468 _: Self::Constraint,
1469 ) -> Result<(), ::fidl_next::ValidationError> {
1470 Ok(())
1471 }
1472 }
1473
1474 unsafe impl ::fidl_next::Wire for ClockIsEnabledResponse {
1475 type Narrowed<'de> = ClockIsEnabledResponse;
1476
1477 #[inline]
1478 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1479 ::fidl_next::munge! {
1480 let Self {
1481 enabled,
1482
1483 } = &mut *out_;
1484 }
1485
1486 ::fidl_next::Wire::zero_padding(enabled);
1487 }
1488 }
1489
1490 unsafe impl<___D> ::fidl_next::Decode<___D> for ClockIsEnabledResponse
1491 where
1492 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1493 {
1494 fn decode(
1495 slot_: ::fidl_next::Slot<'_, Self>,
1496 decoder_: &mut ___D,
1497 _: (),
1498 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1499 ::fidl_next::munge! {
1500 let Self {
1501 mut enabled,
1502
1503 } = slot_;
1504 }
1505
1506 let _field = enabled.as_mut();
1507
1508 ::fidl_next::Decode::decode(enabled.as_mut(), decoder_, ())?;
1509
1510 Ok(())
1511 }
1512 }
1513
1514 impl ::fidl_next::IntoNatural for ClockIsEnabledResponse {
1515 type Natural = crate::natural::ClockIsEnabledResponse;
1516 }
1517
1518 #[derive(Clone, Debug)]
1520 #[repr(C)]
1521 pub struct ClockSetRateRequest {
1522 pub hz: ::fidl_next::wire::Uint64,
1523 }
1524
1525 static_assertions::const_assert_eq!(std::mem::size_of::<ClockSetRateRequest>(), 8);
1526 static_assertions::const_assert_eq!(std::mem::align_of::<ClockSetRateRequest>(), 8);
1527
1528 static_assertions::const_assert_eq!(std::mem::offset_of!(ClockSetRateRequest, hz), 0);
1529
1530 impl ::fidl_next::Constrained for ClockSetRateRequest {
1531 type Constraint = ();
1532
1533 fn validate(
1534 _: ::fidl_next::Slot<'_, Self>,
1535 _: Self::Constraint,
1536 ) -> Result<(), ::fidl_next::ValidationError> {
1537 Ok(())
1538 }
1539 }
1540
1541 unsafe impl ::fidl_next::Wire for ClockSetRateRequest {
1542 type Narrowed<'de> = ClockSetRateRequest;
1543
1544 #[inline]
1545 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1546 ::fidl_next::munge! {
1547 let Self {
1548 hz,
1549
1550 } = &mut *out_;
1551 }
1552
1553 ::fidl_next::Wire::zero_padding(hz);
1554 }
1555 }
1556
1557 unsafe impl<___D> ::fidl_next::Decode<___D> for ClockSetRateRequest
1558 where
1559 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1560 {
1561 fn decode(
1562 slot_: ::fidl_next::Slot<'_, Self>,
1563 decoder_: &mut ___D,
1564 _: (),
1565 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1566 ::fidl_next::munge! {
1567 let Self {
1568 mut hz,
1569
1570 } = slot_;
1571 }
1572
1573 let _field = hz.as_mut();
1574
1575 ::fidl_next::Decode::decode(hz.as_mut(), decoder_, ())?;
1576
1577 Ok(())
1578 }
1579 }
1580
1581 impl ::fidl_next::IntoNatural for ClockSetRateRequest {
1582 type Natural = crate::natural::ClockSetRateRequest;
1583 }
1584
1585 pub type ClockSetRateResponse = ::fidl_next::wire::Unit;
1587
1588 #[derive(Clone, Debug)]
1590 #[repr(C)]
1591 pub struct ClockQuerySupportedRateRequest {
1592 pub hz_in: ::fidl_next::wire::Uint64,
1593 }
1594
1595 static_assertions::const_assert_eq!(std::mem::size_of::<ClockQuerySupportedRateRequest>(), 8);
1596 static_assertions::const_assert_eq!(std::mem::align_of::<ClockQuerySupportedRateRequest>(), 8);
1597
1598 static_assertions::const_assert_eq!(
1599 std::mem::offset_of!(ClockQuerySupportedRateRequest, hz_in),
1600 0
1601 );
1602
1603 impl ::fidl_next::Constrained for ClockQuerySupportedRateRequest {
1604 type Constraint = ();
1605
1606 fn validate(
1607 _: ::fidl_next::Slot<'_, Self>,
1608 _: Self::Constraint,
1609 ) -> Result<(), ::fidl_next::ValidationError> {
1610 Ok(())
1611 }
1612 }
1613
1614 unsafe impl ::fidl_next::Wire for ClockQuerySupportedRateRequest {
1615 type Narrowed<'de> = ClockQuerySupportedRateRequest;
1616
1617 #[inline]
1618 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1619 ::fidl_next::munge! {
1620 let Self {
1621 hz_in,
1622
1623 } = &mut *out_;
1624 }
1625
1626 ::fidl_next::Wire::zero_padding(hz_in);
1627 }
1628 }
1629
1630 unsafe impl<___D> ::fidl_next::Decode<___D> for ClockQuerySupportedRateRequest
1631 where
1632 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1633 {
1634 fn decode(
1635 slot_: ::fidl_next::Slot<'_, Self>,
1636 decoder_: &mut ___D,
1637 _: (),
1638 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1639 ::fidl_next::munge! {
1640 let Self {
1641 mut hz_in,
1642
1643 } = slot_;
1644 }
1645
1646 let _field = hz_in.as_mut();
1647
1648 ::fidl_next::Decode::decode(hz_in.as_mut(), decoder_, ())?;
1649
1650 Ok(())
1651 }
1652 }
1653
1654 impl ::fidl_next::IntoNatural for ClockQuerySupportedRateRequest {
1655 type Natural = crate::natural::ClockQuerySupportedRateRequest;
1656 }
1657
1658 #[derive(Clone, Debug)]
1660 #[repr(C)]
1661 pub struct ClockQuerySupportedRateResponse {
1662 pub hz_out: ::fidl_next::wire::Uint64,
1663 }
1664
1665 static_assertions::const_assert_eq!(std::mem::size_of::<ClockQuerySupportedRateResponse>(), 8);
1666 static_assertions::const_assert_eq!(std::mem::align_of::<ClockQuerySupportedRateResponse>(), 8);
1667
1668 static_assertions::const_assert_eq!(
1669 std::mem::offset_of!(ClockQuerySupportedRateResponse, hz_out),
1670 0
1671 );
1672
1673 impl ::fidl_next::Constrained for ClockQuerySupportedRateResponse {
1674 type Constraint = ();
1675
1676 fn validate(
1677 _: ::fidl_next::Slot<'_, Self>,
1678 _: Self::Constraint,
1679 ) -> Result<(), ::fidl_next::ValidationError> {
1680 Ok(())
1681 }
1682 }
1683
1684 unsafe impl ::fidl_next::Wire for ClockQuerySupportedRateResponse {
1685 type Narrowed<'de> = ClockQuerySupportedRateResponse;
1686
1687 #[inline]
1688 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1689 ::fidl_next::munge! {
1690 let Self {
1691 hz_out,
1692
1693 } = &mut *out_;
1694 }
1695
1696 ::fidl_next::Wire::zero_padding(hz_out);
1697 }
1698 }
1699
1700 unsafe impl<___D> ::fidl_next::Decode<___D> for ClockQuerySupportedRateResponse
1701 where
1702 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1703 {
1704 fn decode(
1705 slot_: ::fidl_next::Slot<'_, Self>,
1706 decoder_: &mut ___D,
1707 _: (),
1708 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1709 ::fidl_next::munge! {
1710 let Self {
1711 mut hz_out,
1712
1713 } = slot_;
1714 }
1715
1716 let _field = hz_out.as_mut();
1717
1718 ::fidl_next::Decode::decode(hz_out.as_mut(), decoder_, ())?;
1719
1720 Ok(())
1721 }
1722 }
1723
1724 impl ::fidl_next::IntoNatural for ClockQuerySupportedRateResponse {
1725 type Natural = crate::natural::ClockQuerySupportedRateResponse;
1726 }
1727
1728 #[derive(Clone, Debug)]
1730 #[repr(C)]
1731 pub struct ClockGetRateResponse {
1732 pub hz: ::fidl_next::wire::Uint64,
1733 }
1734
1735 static_assertions::const_assert_eq!(std::mem::size_of::<ClockGetRateResponse>(), 8);
1736 static_assertions::const_assert_eq!(std::mem::align_of::<ClockGetRateResponse>(), 8);
1737
1738 static_assertions::const_assert_eq!(std::mem::offset_of!(ClockGetRateResponse, hz), 0);
1739
1740 impl ::fidl_next::Constrained for ClockGetRateResponse {
1741 type Constraint = ();
1742
1743 fn validate(
1744 _: ::fidl_next::Slot<'_, Self>,
1745 _: Self::Constraint,
1746 ) -> Result<(), ::fidl_next::ValidationError> {
1747 Ok(())
1748 }
1749 }
1750
1751 unsafe impl ::fidl_next::Wire for ClockGetRateResponse {
1752 type Narrowed<'de> = ClockGetRateResponse;
1753
1754 #[inline]
1755 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1756 ::fidl_next::munge! {
1757 let Self {
1758 hz,
1759
1760 } = &mut *out_;
1761 }
1762
1763 ::fidl_next::Wire::zero_padding(hz);
1764 }
1765 }
1766
1767 unsafe impl<___D> ::fidl_next::Decode<___D> for ClockGetRateResponse
1768 where
1769 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1770 {
1771 fn decode(
1772 slot_: ::fidl_next::Slot<'_, Self>,
1773 decoder_: &mut ___D,
1774 _: (),
1775 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1776 ::fidl_next::munge! {
1777 let Self {
1778 mut hz,
1779
1780 } = slot_;
1781 }
1782
1783 let _field = hz.as_mut();
1784
1785 ::fidl_next::Decode::decode(hz.as_mut(), decoder_, ())?;
1786
1787 Ok(())
1788 }
1789 }
1790
1791 impl ::fidl_next::IntoNatural for ClockGetRateResponse {
1792 type Natural = crate::natural::ClockGetRateResponse;
1793 }
1794
1795 #[derive(Clone, Debug)]
1797 #[repr(C)]
1798 pub struct ClockSetInputRequest {
1799 pub idx: ::fidl_next::wire::Uint32,
1800 }
1801
1802 static_assertions::const_assert_eq!(std::mem::size_of::<ClockSetInputRequest>(), 4);
1803 static_assertions::const_assert_eq!(std::mem::align_of::<ClockSetInputRequest>(), 4);
1804
1805 static_assertions::const_assert_eq!(std::mem::offset_of!(ClockSetInputRequest, idx), 0);
1806
1807 impl ::fidl_next::Constrained for ClockSetInputRequest {
1808 type Constraint = ();
1809
1810 fn validate(
1811 _: ::fidl_next::Slot<'_, Self>,
1812 _: Self::Constraint,
1813 ) -> Result<(), ::fidl_next::ValidationError> {
1814 Ok(())
1815 }
1816 }
1817
1818 unsafe impl ::fidl_next::Wire for ClockSetInputRequest {
1819 type Narrowed<'de> = ClockSetInputRequest;
1820
1821 #[inline]
1822 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1823 ::fidl_next::munge! {
1824 let Self {
1825 idx,
1826
1827 } = &mut *out_;
1828 }
1829
1830 ::fidl_next::Wire::zero_padding(idx);
1831 }
1832 }
1833
1834 unsafe impl<___D> ::fidl_next::Decode<___D> for ClockSetInputRequest
1835 where
1836 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1837 {
1838 fn decode(
1839 slot_: ::fidl_next::Slot<'_, Self>,
1840 decoder_: &mut ___D,
1841 _: (),
1842 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1843 ::fidl_next::munge! {
1844 let Self {
1845 mut idx,
1846
1847 } = slot_;
1848 }
1849
1850 let _field = idx.as_mut();
1851
1852 ::fidl_next::Decode::decode(idx.as_mut(), decoder_, ())?;
1853
1854 Ok(())
1855 }
1856 }
1857
1858 impl ::fidl_next::IntoNatural for ClockSetInputRequest {
1859 type Natural = crate::natural::ClockSetInputRequest;
1860 }
1861
1862 pub type ClockSetInputResponse = ::fidl_next::wire::Unit;
1864
1865 #[derive(Clone, Debug)]
1867 #[repr(C)]
1868 pub struct ClockGetNumInputsResponse {
1869 pub n: ::fidl_next::wire::Uint32,
1870 }
1871
1872 static_assertions::const_assert_eq!(std::mem::size_of::<ClockGetNumInputsResponse>(), 4);
1873 static_assertions::const_assert_eq!(std::mem::align_of::<ClockGetNumInputsResponse>(), 4);
1874
1875 static_assertions::const_assert_eq!(std::mem::offset_of!(ClockGetNumInputsResponse, n), 0);
1876
1877 impl ::fidl_next::Constrained for ClockGetNumInputsResponse {
1878 type Constraint = ();
1879
1880 fn validate(
1881 _: ::fidl_next::Slot<'_, Self>,
1882 _: Self::Constraint,
1883 ) -> Result<(), ::fidl_next::ValidationError> {
1884 Ok(())
1885 }
1886 }
1887
1888 unsafe impl ::fidl_next::Wire for ClockGetNumInputsResponse {
1889 type Narrowed<'de> = ClockGetNumInputsResponse;
1890
1891 #[inline]
1892 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1893 ::fidl_next::munge! {
1894 let Self {
1895 n,
1896
1897 } = &mut *out_;
1898 }
1899
1900 ::fidl_next::Wire::zero_padding(n);
1901 }
1902 }
1903
1904 unsafe impl<___D> ::fidl_next::Decode<___D> for ClockGetNumInputsResponse
1905 where
1906 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1907 {
1908 fn decode(
1909 slot_: ::fidl_next::Slot<'_, Self>,
1910 decoder_: &mut ___D,
1911 _: (),
1912 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1913 ::fidl_next::munge! {
1914 let Self {
1915 mut n,
1916
1917 } = slot_;
1918 }
1919
1920 let _field = n.as_mut();
1921
1922 ::fidl_next::Decode::decode(n.as_mut(), decoder_, ())?;
1923
1924 Ok(())
1925 }
1926 }
1927
1928 impl ::fidl_next::IntoNatural for ClockGetNumInputsResponse {
1929 type Natural = crate::natural::ClockGetNumInputsResponse;
1930 }
1931
1932 #[derive(Clone, Debug)]
1934 #[repr(C)]
1935 pub struct ClockGetInputResponse {
1936 pub index: ::fidl_next::wire::Uint32,
1937 }
1938
1939 static_assertions::const_assert_eq!(std::mem::size_of::<ClockGetInputResponse>(), 4);
1940 static_assertions::const_assert_eq!(std::mem::align_of::<ClockGetInputResponse>(), 4);
1941
1942 static_assertions::const_assert_eq!(std::mem::offset_of!(ClockGetInputResponse, index), 0);
1943
1944 impl ::fidl_next::Constrained for ClockGetInputResponse {
1945 type Constraint = ();
1946
1947 fn validate(
1948 _: ::fidl_next::Slot<'_, Self>,
1949 _: Self::Constraint,
1950 ) -> Result<(), ::fidl_next::ValidationError> {
1951 Ok(())
1952 }
1953 }
1954
1955 unsafe impl ::fidl_next::Wire for ClockGetInputResponse {
1956 type Narrowed<'de> = ClockGetInputResponse;
1957
1958 #[inline]
1959 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1960 ::fidl_next::munge! {
1961 let Self {
1962 index,
1963
1964 } = &mut *out_;
1965 }
1966
1967 ::fidl_next::Wire::zero_padding(index);
1968 }
1969 }
1970
1971 unsafe impl<___D> ::fidl_next::Decode<___D> for ClockGetInputResponse
1972 where
1973 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1974 {
1975 fn decode(
1976 slot_: ::fidl_next::Slot<'_, Self>,
1977 decoder_: &mut ___D,
1978 _: (),
1979 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1980 ::fidl_next::munge! {
1981 let Self {
1982 mut index,
1983
1984 } = slot_;
1985 }
1986
1987 let _field = index.as_mut();
1988
1989 ::fidl_next::Decode::decode(index.as_mut(), decoder_, ())?;
1990
1991 Ok(())
1992 }
1993 }
1994
1995 impl ::fidl_next::IntoNatural for ClockGetInputResponse {
1996 type Natural = crate::natural::ClockGetInputResponse;
1997 }
1998
1999 #[derive(Debug)]
2001 #[repr(C)]
2002 pub struct ClockGetPropertiesResponse<'de> {
2003 pub id: ::fidl_next::wire::Uint32,
2004
2005 pub name: ::fidl_next::wire::String<'de>,
2006 }
2007
2008 static_assertions::const_assert_eq!(std::mem::size_of::<ClockGetPropertiesResponse<'_>>(), 24);
2009 static_assertions::const_assert_eq!(std::mem::align_of::<ClockGetPropertiesResponse<'_>>(), 8);
2010
2011 static_assertions::const_assert_eq!(
2012 std::mem::offset_of!(ClockGetPropertiesResponse<'_>, id),
2013 0
2014 );
2015
2016 static_assertions::const_assert_eq!(
2017 std::mem::offset_of!(ClockGetPropertiesResponse<'_>, name),
2018 8
2019 );
2020
2021 impl ::fidl_next::Constrained for ClockGetPropertiesResponse<'_> {
2022 type Constraint = ();
2023
2024 fn validate(
2025 _: ::fidl_next::Slot<'_, Self>,
2026 _: Self::Constraint,
2027 ) -> Result<(), ::fidl_next::ValidationError> {
2028 Ok(())
2029 }
2030 }
2031
2032 unsafe impl ::fidl_next::Wire for ClockGetPropertiesResponse<'static> {
2033 type Narrowed<'de> = ClockGetPropertiesResponse<'de>;
2034
2035 #[inline]
2036 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2037 ::fidl_next::munge! {
2038 let Self {
2039 id,
2040 name,
2041
2042 } = &mut *out_;
2043 }
2044
2045 ::fidl_next::Wire::zero_padding(id);
2046
2047 ::fidl_next::Wire::zero_padding(name);
2048
2049 unsafe {
2050 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
2051 }
2052 }
2053 }
2054
2055 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ClockGetPropertiesResponse<'de>
2056 where
2057 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2058 ___D: ::fidl_next::Decoder<'de>,
2059 {
2060 fn decode(
2061 slot_: ::fidl_next::Slot<'_, Self>,
2062 decoder_: &mut ___D,
2063 _: (),
2064 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2065 if slot_.as_bytes()[4..8] != [0u8; 4] {
2066 return Err(::fidl_next::DecodeError::InvalidPadding);
2067 }
2068
2069 ::fidl_next::munge! {
2070 let Self {
2071 mut id,
2072 mut name,
2073
2074 } = slot_;
2075 }
2076
2077 let _field = id.as_mut();
2078
2079 ::fidl_next::Decode::decode(id.as_mut(), decoder_, ())?;
2080
2081 let _field = name.as_mut();
2082 ::fidl_next::Constrained::validate(_field, 256)?;
2083 ::fidl_next::Decode::decode(name.as_mut(), decoder_, 256)?;
2084
2085 let name = unsafe { name.deref_unchecked() };
2086
2087 if name.len() > 256 {
2088 return Err(::fidl_next::DecodeError::VectorTooLong {
2089 size: name.len() as u64,
2090 limit: 256,
2091 });
2092 }
2093
2094 Ok(())
2095 }
2096 }
2097
2098 impl<'de> ::fidl_next::IntoNatural for ClockGetPropertiesResponse<'de> {
2099 type Natural = crate::natural::ClockGetPropertiesResponse;
2100 }
2101}
2102
2103pub mod wire_optional {}
2104
2105pub mod generic {
2106
2107 pub type ClockEnableResponse = ();
2109
2110 pub type ClockDisableResponse = ();
2112
2113 pub struct ClockIsEnabledResponse<T0> {
2115 pub enabled: T0,
2116 }
2117
2118 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ClockIsEnabledResponse, ___E>
2119 for ClockIsEnabledResponse<T0>
2120 where
2121 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2122 T0: ::fidl_next::Encode<bool, ___E>,
2123 {
2124 #[inline]
2125 fn encode(
2126 self,
2127 encoder_: &mut ___E,
2128 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockIsEnabledResponse>,
2129 _: (),
2130 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2131 ::fidl_next::munge! {
2132 let crate::wire::ClockIsEnabledResponse {
2133 enabled,
2134
2135 } = out_;
2136 }
2137
2138 ::fidl_next::Encode::encode(self.enabled, encoder_, enabled, ())?;
2139
2140 Ok(())
2141 }
2142 }
2143
2144 pub struct ClockSetRateRequest<T0> {
2146 pub hz: T0,
2147 }
2148
2149 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ClockSetRateRequest, ___E>
2150 for ClockSetRateRequest<T0>
2151 where
2152 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2153 T0: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
2154 {
2155 #[inline]
2156 fn encode(
2157 self,
2158 encoder_: &mut ___E,
2159 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockSetRateRequest>,
2160 _: (),
2161 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2162 ::fidl_next::munge! {
2163 let crate::wire::ClockSetRateRequest {
2164 hz,
2165
2166 } = out_;
2167 }
2168
2169 ::fidl_next::Encode::encode(self.hz, encoder_, hz, ())?;
2170
2171 Ok(())
2172 }
2173 }
2174
2175 pub type ClockSetRateResponse = ();
2177
2178 pub struct ClockQuerySupportedRateRequest<T0> {
2180 pub hz_in: T0,
2181 }
2182
2183 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ClockQuerySupportedRateRequest, ___E>
2184 for ClockQuerySupportedRateRequest<T0>
2185 where
2186 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2187 T0: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
2188 {
2189 #[inline]
2190 fn encode(
2191 self,
2192 encoder_: &mut ___E,
2193 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockQuerySupportedRateRequest>,
2194 _: (),
2195 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2196 ::fidl_next::munge! {
2197 let crate::wire::ClockQuerySupportedRateRequest {
2198 hz_in,
2199
2200 } = out_;
2201 }
2202
2203 ::fidl_next::Encode::encode(self.hz_in, encoder_, hz_in, ())?;
2204
2205 Ok(())
2206 }
2207 }
2208
2209 pub struct ClockQuerySupportedRateResponse<T0> {
2211 pub hz_out: T0,
2212 }
2213
2214 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ClockQuerySupportedRateResponse, ___E>
2215 for ClockQuerySupportedRateResponse<T0>
2216 where
2217 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2218 T0: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
2219 {
2220 #[inline]
2221 fn encode(
2222 self,
2223 encoder_: &mut ___E,
2224 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockQuerySupportedRateResponse>,
2225 _: (),
2226 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2227 ::fidl_next::munge! {
2228 let crate::wire::ClockQuerySupportedRateResponse {
2229 hz_out,
2230
2231 } = out_;
2232 }
2233
2234 ::fidl_next::Encode::encode(self.hz_out, encoder_, hz_out, ())?;
2235
2236 Ok(())
2237 }
2238 }
2239
2240 pub struct ClockGetRateResponse<T0> {
2242 pub hz: T0,
2243 }
2244
2245 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ClockGetRateResponse, ___E>
2246 for ClockGetRateResponse<T0>
2247 where
2248 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2249 T0: ::fidl_next::Encode<::fidl_next::wire::Uint64, ___E>,
2250 {
2251 #[inline]
2252 fn encode(
2253 self,
2254 encoder_: &mut ___E,
2255 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockGetRateResponse>,
2256 _: (),
2257 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2258 ::fidl_next::munge! {
2259 let crate::wire::ClockGetRateResponse {
2260 hz,
2261
2262 } = out_;
2263 }
2264
2265 ::fidl_next::Encode::encode(self.hz, encoder_, hz, ())?;
2266
2267 Ok(())
2268 }
2269 }
2270
2271 pub struct ClockSetInputRequest<T0> {
2273 pub idx: T0,
2274 }
2275
2276 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ClockSetInputRequest, ___E>
2277 for ClockSetInputRequest<T0>
2278 where
2279 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2280 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
2281 {
2282 #[inline]
2283 fn encode(
2284 self,
2285 encoder_: &mut ___E,
2286 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockSetInputRequest>,
2287 _: (),
2288 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2289 ::fidl_next::munge! {
2290 let crate::wire::ClockSetInputRequest {
2291 idx,
2292
2293 } = out_;
2294 }
2295
2296 ::fidl_next::Encode::encode(self.idx, encoder_, idx, ())?;
2297
2298 Ok(())
2299 }
2300 }
2301
2302 pub type ClockSetInputResponse = ();
2304
2305 pub struct ClockGetNumInputsResponse<T0> {
2307 pub n: T0,
2308 }
2309
2310 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ClockGetNumInputsResponse, ___E>
2311 for ClockGetNumInputsResponse<T0>
2312 where
2313 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2314 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
2315 {
2316 #[inline]
2317 fn encode(
2318 self,
2319 encoder_: &mut ___E,
2320 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockGetNumInputsResponse>,
2321 _: (),
2322 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2323 ::fidl_next::munge! {
2324 let crate::wire::ClockGetNumInputsResponse {
2325 n,
2326
2327 } = out_;
2328 }
2329
2330 ::fidl_next::Encode::encode(self.n, encoder_, n, ())?;
2331
2332 Ok(())
2333 }
2334 }
2335
2336 pub struct ClockGetInputResponse<T0> {
2338 pub index: T0,
2339 }
2340
2341 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ClockGetInputResponse, ___E>
2342 for ClockGetInputResponse<T0>
2343 where
2344 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2345 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
2346 {
2347 #[inline]
2348 fn encode(
2349 self,
2350 encoder_: &mut ___E,
2351 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockGetInputResponse>,
2352 _: (),
2353 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2354 ::fidl_next::munge! {
2355 let crate::wire::ClockGetInputResponse {
2356 index,
2357
2358 } = out_;
2359 }
2360
2361 ::fidl_next::Encode::encode(self.index, encoder_, index, ())?;
2362
2363 Ok(())
2364 }
2365 }
2366
2367 pub struct ClockGetPropertiesResponse<T0, T1> {
2369 pub id: T0,
2370
2371 pub name: T1,
2372 }
2373
2374 unsafe impl<___E, T0, T1>
2375 ::fidl_next::Encode<crate::wire::ClockGetPropertiesResponse<'static>, ___E>
2376 for ClockGetPropertiesResponse<T0, T1>
2377 where
2378 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2379 ___E: ::fidl_next::Encoder,
2380 T0: ::fidl_next::Encode<::fidl_next::wire::Uint32, ___E>,
2381 T1: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
2382 {
2383 #[inline]
2384 fn encode(
2385 self,
2386 encoder_: &mut ___E,
2387 out_: &mut ::core::mem::MaybeUninit<crate::wire::ClockGetPropertiesResponse<'static>>,
2388 _: (),
2389 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2390 ::fidl_next::munge! {
2391 let crate::wire::ClockGetPropertiesResponse {
2392 id,
2393 name,
2394
2395 } = out_;
2396 }
2397
2398 ::fidl_next::Encode::encode(self.id, encoder_, id, ())?;
2399
2400 ::fidl_next::Encode::encode(self.name, encoder_, name, 256)?;
2401
2402 Ok(())
2403 }
2404 }
2405}
2406
2407pub use self::natural::*;
2408
2409#[doc = " Maximum length of the clock name.\n"]
2410pub const MAX_CLOCK_NAME_LEN: u32 = 256 as u32;
2411
2412#[doc = " Used for driver-to-driver communication.\n"]
2414#[derive(PartialEq, Debug)]
2415pub struct Clock;
2416
2417impl ::fidl_next::Discoverable for Clock {
2418 const PROTOCOL_NAME: &'static str = "fuchsia.hardware.clock.Clock";
2419}
2420
2421#[cfg(target_os = "fuchsia")]
2422impl ::fidl_next::HasTransport for Clock {
2423 type Transport = ::fidl_next::fuchsia::zx::Channel;
2424}
2425
2426pub mod clock {
2427 pub mod prelude {
2428 pub use crate::{
2429 Clock, ClockClientHandler, ClockLocalClientHandler, ClockLocalServerHandler,
2430 ClockServerHandler, clock,
2431 };
2432
2433 pub use crate::natural::ClockQuerySupportedRateRequest;
2434
2435 pub use crate::natural::ClockSetInputRequest;
2436
2437 pub use crate::natural::ClockSetRateRequest;
2438
2439 pub use crate::natural::ClockDisableResponse;
2440
2441 pub use crate::natural::ClockEnableResponse;
2442
2443 pub use crate::natural::ClockGetInputResponse;
2444
2445 pub use crate::natural::ClockGetNumInputsResponse;
2446
2447 pub use crate::natural::ClockGetPropertiesResponse;
2448
2449 pub use crate::natural::ClockGetRateResponse;
2450
2451 pub use crate::natural::ClockIsEnabledResponse;
2452
2453 pub use crate::natural::ClockQuerySupportedRateResponse;
2454
2455 pub use crate::natural::ClockSetInputResponse;
2456
2457 pub use crate::natural::ClockSetRateResponse;
2458 }
2459
2460 pub struct Enable;
2461
2462 impl ::fidl_next::Method for Enable {
2463 const ORDINAL: u64 = 6784697999065719342;
2464 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2465 ::fidl_next::protocol::Flexibility::Flexible;
2466
2467 type Protocol = crate::Clock;
2468
2469 type Request = ::fidl_next::wire::EmptyMessageBody;
2470 }
2471
2472 impl ::fidl_next::TwoWayMethod for Enable {
2473 type Response = ::fidl_next::wire::Result<
2474 'static,
2475 crate::wire::ClockEnableResponse,
2476 ::fidl_next::wire::fuchsia::Status,
2477 >;
2478 }
2479
2480 impl<___R> ::fidl_next::Respond<___R> for Enable {
2481 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
2482
2483 fn respond(response: ___R) -> Self::Output {
2484 ::core::result::Result::Ok(response)
2485 }
2486 }
2487
2488 impl<___R> ::fidl_next::RespondErr<___R> for Enable {
2489 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2490
2491 fn respond_err(response: ___R) -> Self::Output {
2492 ::core::result::Result::Err(response)
2493 }
2494 }
2495
2496 pub struct Disable;
2497
2498 impl ::fidl_next::Method for Disable {
2499 const ORDINAL: u64 = 547375520742554393;
2500 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2501 ::fidl_next::protocol::Flexibility::Flexible;
2502
2503 type Protocol = crate::Clock;
2504
2505 type Request = ::fidl_next::wire::EmptyMessageBody;
2506 }
2507
2508 impl ::fidl_next::TwoWayMethod for Disable {
2509 type Response = ::fidl_next::wire::Result<
2510 'static,
2511 crate::wire::ClockDisableResponse,
2512 ::fidl_next::wire::fuchsia::Status,
2513 >;
2514 }
2515
2516 impl<___R> ::fidl_next::Respond<___R> for Disable {
2517 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
2518
2519 fn respond(response: ___R) -> Self::Output {
2520 ::core::result::Result::Ok(response)
2521 }
2522 }
2523
2524 impl<___R> ::fidl_next::RespondErr<___R> for Disable {
2525 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2526
2527 fn respond_err(response: ___R) -> Self::Output {
2528 ::core::result::Result::Err(response)
2529 }
2530 }
2531
2532 pub struct IsEnabled;
2533
2534 impl ::fidl_next::Method for IsEnabled {
2535 const ORDINAL: u64 = 933050423591341447;
2536 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2537 ::fidl_next::protocol::Flexibility::Flexible;
2538
2539 type Protocol = crate::Clock;
2540
2541 type Request = ::fidl_next::wire::EmptyMessageBody;
2542 }
2543
2544 impl ::fidl_next::TwoWayMethod for IsEnabled {
2545 type Response = ::fidl_next::wire::Result<
2546 'static,
2547 crate::wire::ClockIsEnabledResponse,
2548 ::fidl_next::wire::fuchsia::Status,
2549 >;
2550 }
2551
2552 impl<___R> ::fidl_next::Respond<___R> for IsEnabled {
2553 type Output = ::core::result::Result<
2554 crate::generic::ClockIsEnabledResponse<___R>,
2555 ::fidl_next::never::Never,
2556 >;
2557
2558 fn respond(response: ___R) -> Self::Output {
2559 ::core::result::Result::Ok(crate::generic::ClockIsEnabledResponse { enabled: response })
2560 }
2561 }
2562
2563 impl<___R> ::fidl_next::RespondErr<___R> for IsEnabled {
2564 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2565
2566 fn respond_err(response: ___R) -> Self::Output {
2567 ::core::result::Result::Err(response)
2568 }
2569 }
2570
2571 pub struct SetRate;
2572
2573 impl ::fidl_next::Method for SetRate {
2574 const ORDINAL: u64 = 1032981018767748612;
2575 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2576 ::fidl_next::protocol::Flexibility::Flexible;
2577
2578 type Protocol = crate::Clock;
2579
2580 type Request = crate::wire::ClockSetRateRequest;
2581 }
2582
2583 impl ::fidl_next::TwoWayMethod for SetRate {
2584 type Response = ::fidl_next::wire::Result<
2585 'static,
2586 crate::wire::ClockSetRateResponse,
2587 ::fidl_next::wire::fuchsia::Status,
2588 >;
2589 }
2590
2591 impl<___R> ::fidl_next::Respond<___R> for SetRate {
2592 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
2593
2594 fn respond(response: ___R) -> Self::Output {
2595 ::core::result::Result::Ok(response)
2596 }
2597 }
2598
2599 impl<___R> ::fidl_next::RespondErr<___R> for SetRate {
2600 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2601
2602 fn respond_err(response: ___R) -> Self::Output {
2603 ::core::result::Result::Err(response)
2604 }
2605 }
2606
2607 pub struct QuerySupportedRate;
2608
2609 impl ::fidl_next::Method for QuerySupportedRate {
2610 const ORDINAL: u64 = 4342302280982685137;
2611 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2612 ::fidl_next::protocol::Flexibility::Flexible;
2613
2614 type Protocol = crate::Clock;
2615
2616 type Request = crate::wire::ClockQuerySupportedRateRequest;
2617 }
2618
2619 impl ::fidl_next::TwoWayMethod for QuerySupportedRate {
2620 type Response = ::fidl_next::wire::Result<
2621 'static,
2622 crate::wire::ClockQuerySupportedRateResponse,
2623 ::fidl_next::wire::fuchsia::Status,
2624 >;
2625 }
2626
2627 impl<___R> ::fidl_next::Respond<___R> for QuerySupportedRate {
2628 type Output = ::core::result::Result<
2629 crate::generic::ClockQuerySupportedRateResponse<___R>,
2630 ::fidl_next::never::Never,
2631 >;
2632
2633 fn respond(response: ___R) -> Self::Output {
2634 ::core::result::Result::Ok(crate::generic::ClockQuerySupportedRateResponse {
2635 hz_out: response,
2636 })
2637 }
2638 }
2639
2640 impl<___R> ::fidl_next::RespondErr<___R> for QuerySupportedRate {
2641 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2642
2643 fn respond_err(response: ___R) -> Self::Output {
2644 ::core::result::Result::Err(response)
2645 }
2646 }
2647
2648 pub struct GetRate;
2649
2650 impl ::fidl_next::Method for GetRate {
2651 const ORDINAL: u64 = 1121163806855671421;
2652 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2653 ::fidl_next::protocol::Flexibility::Flexible;
2654
2655 type Protocol = crate::Clock;
2656
2657 type Request = ::fidl_next::wire::EmptyMessageBody;
2658 }
2659
2660 impl ::fidl_next::TwoWayMethod for GetRate {
2661 type Response = ::fidl_next::wire::Result<
2662 'static,
2663 crate::wire::ClockGetRateResponse,
2664 ::fidl_next::wire::fuchsia::Status,
2665 >;
2666 }
2667
2668 impl<___R> ::fidl_next::Respond<___R> for GetRate {
2669 type Output = ::core::result::Result<
2670 crate::generic::ClockGetRateResponse<___R>,
2671 ::fidl_next::never::Never,
2672 >;
2673
2674 fn respond(response: ___R) -> Self::Output {
2675 ::core::result::Result::Ok(crate::generic::ClockGetRateResponse { hz: response })
2676 }
2677 }
2678
2679 impl<___R> ::fidl_next::RespondErr<___R> for GetRate {
2680 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2681
2682 fn respond_err(response: ___R) -> Self::Output {
2683 ::core::result::Result::Err(response)
2684 }
2685 }
2686
2687 pub struct SetInput;
2688
2689 impl ::fidl_next::Method for SetInput {
2690 const ORDINAL: u64 = 5218173341159048288;
2691 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2692 ::fidl_next::protocol::Flexibility::Flexible;
2693
2694 type Protocol = crate::Clock;
2695
2696 type Request = crate::wire::ClockSetInputRequest;
2697 }
2698
2699 impl ::fidl_next::TwoWayMethod for SetInput {
2700 type Response = ::fidl_next::wire::Result<
2701 'static,
2702 crate::wire::ClockSetInputResponse,
2703 ::fidl_next::wire::fuchsia::Status,
2704 >;
2705 }
2706
2707 impl<___R> ::fidl_next::Respond<___R> for SetInput {
2708 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
2709
2710 fn respond(response: ___R) -> Self::Output {
2711 ::core::result::Result::Ok(response)
2712 }
2713 }
2714
2715 impl<___R> ::fidl_next::RespondErr<___R> for SetInput {
2716 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2717
2718 fn respond_err(response: ___R) -> Self::Output {
2719 ::core::result::Result::Err(response)
2720 }
2721 }
2722
2723 pub struct GetNumInputs;
2724
2725 impl ::fidl_next::Method for GetNumInputs {
2726 const ORDINAL: u64 = 8531740354274582083;
2727 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2728 ::fidl_next::protocol::Flexibility::Flexible;
2729
2730 type Protocol = crate::Clock;
2731
2732 type Request = ::fidl_next::wire::EmptyMessageBody;
2733 }
2734
2735 impl ::fidl_next::TwoWayMethod for GetNumInputs {
2736 type Response = ::fidl_next::wire::Result<
2737 'static,
2738 crate::wire::ClockGetNumInputsResponse,
2739 ::fidl_next::wire::fuchsia::Status,
2740 >;
2741 }
2742
2743 impl<___R> ::fidl_next::Respond<___R> for GetNumInputs {
2744 type Output = ::core::result::Result<
2745 crate::generic::ClockGetNumInputsResponse<___R>,
2746 ::fidl_next::never::Never,
2747 >;
2748
2749 fn respond(response: ___R) -> Self::Output {
2750 ::core::result::Result::Ok(crate::generic::ClockGetNumInputsResponse { n: response })
2751 }
2752 }
2753
2754 impl<___R> ::fidl_next::RespondErr<___R> for GetNumInputs {
2755 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2756
2757 fn respond_err(response: ___R) -> Self::Output {
2758 ::core::result::Result::Err(response)
2759 }
2760 }
2761
2762 pub struct GetInput;
2763
2764 impl ::fidl_next::Method for GetInput {
2765 const ORDINAL: u64 = 2584673235362685201;
2766 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2767 ::fidl_next::protocol::Flexibility::Flexible;
2768
2769 type Protocol = crate::Clock;
2770
2771 type Request = ::fidl_next::wire::EmptyMessageBody;
2772 }
2773
2774 impl ::fidl_next::TwoWayMethod for GetInput {
2775 type Response = ::fidl_next::wire::Result<
2776 'static,
2777 crate::wire::ClockGetInputResponse,
2778 ::fidl_next::wire::fuchsia::Status,
2779 >;
2780 }
2781
2782 impl<___R> ::fidl_next::Respond<___R> for GetInput {
2783 type Output = ::core::result::Result<
2784 crate::generic::ClockGetInputResponse<___R>,
2785 ::fidl_next::never::Never,
2786 >;
2787
2788 fn respond(response: ___R) -> Self::Output {
2789 ::core::result::Result::Ok(crate::generic::ClockGetInputResponse { index: response })
2790 }
2791 }
2792
2793 impl<___R> ::fidl_next::RespondErr<___R> for GetInput {
2794 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
2795
2796 fn respond_err(response: ___R) -> Self::Output {
2797 ::core::result::Result::Err(response)
2798 }
2799 }
2800
2801 pub struct GetProperties;
2802
2803 impl ::fidl_next::Method for GetProperties {
2804 const ORDINAL: u64 = 2758748715462866138;
2805 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2806 ::fidl_next::protocol::Flexibility::Flexible;
2807
2808 type Protocol = crate::Clock;
2809
2810 type Request = ::fidl_next::wire::EmptyMessageBody;
2811 }
2812
2813 impl ::fidl_next::TwoWayMethod for GetProperties {
2814 type Response =
2815 ::fidl_next::wire::Flexible<'static, crate::wire::ClockGetPropertiesResponse<'static>>;
2816 }
2817
2818 impl<___R> ::fidl_next::Respond<___R> for GetProperties {
2819 type Output = ::fidl_next::Flexible<___R>;
2820
2821 fn respond(response: ___R) -> Self::Output {
2822 ::fidl_next::Flexible(response)
2823 }
2824 }
2825
2826 mod ___detail {
2827 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Clock
2828 where
2829 ___T: ::fidl_next::Transport,
2830 {
2831 type Client = ClockClient<___T>;
2832 type Server = ClockServer<___T>;
2833 }
2834
2835 #[repr(transparent)]
2837 pub struct ClockClient<___T: ::fidl_next::Transport> {
2838 #[allow(dead_code)]
2839 client: ::fidl_next::protocol::Client<___T>,
2840 }
2841
2842 impl<___T> ClockClient<___T>
2843 where
2844 ___T: ::fidl_next::Transport,
2845 {
2846 #[doc = " Enables (ungates) this clock.\n Drivers *must* call enable on all clocks they depend upon.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `Enable`.\n Returns `ZX_ERR_TIMED_OUT` if an operation timed out (for instance, a PLL was unable to lock).\n Returns `ZX_ERR_INTERNAL` if the operation failed for any other reason.\n"]
2847 pub fn enable(&self) -> ::fidl_next::TwoWayFuture<'_, super::Enable, ___T> {
2848 ::fidl_next::TwoWayFuture::from_untyped(
2849 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
2850 6784697999065719342,
2851 <super::Enable as ::fidl_next::Method>::FLEXIBILITY,
2852 (),
2853 ),
2854 )
2855 }
2856
2857 #[doc = " Disables (gates) this clock.\n Drivers should call this method to indicate to the clock subsystem that\n a particular clock signal is no longer necessary.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `Disable`\n Returns `ZX_ERR_INTERNAL` if the operation failed for any other reason.\n"]
2858 pub fn disable(&self) -> ::fidl_next::TwoWayFuture<'_, super::Disable, ___T> {
2859 ::fidl_next::TwoWayFuture::from_untyped(
2860 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
2861 547375520742554393,
2862 <super::Disable as ::fidl_next::Method>::FLEXIBILITY,
2863 (),
2864 ),
2865 )
2866 }
2867
2868 #[doc = " Returns `true` if a given clock is running.\n May query the hardware or return a cached value.\n IsEnabled shall not alter the state of the clock tree in any way.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `IsEnabled`.\n"]
2869 pub fn is_enabled(&self) -> ::fidl_next::TwoWayFuture<'_, super::IsEnabled, ___T> {
2870 ::fidl_next::TwoWayFuture::from_untyped(
2871 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
2872 933050423591341447,
2873 <super::IsEnabled as ::fidl_next::Method>::FLEXIBILITY,
2874 (),
2875 ),
2876 )
2877 }
2878
2879 #[doc = " Attempt to set the rate of the clock provider.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `SetRate`\n Returns `ZX_ERR_INVALID_ARGS` if the requested rate is not one that is reported as supported by `QuerySupportedRate`.\n Returns `ZX_ERR_TIMED_OUT` if an operation timed out (for instance, a PLL was unable to lock).\n Returns `ZX_ERR_INTERNAL` if the operation failed for any other reason.\n"]
2880 pub fn set_rate(
2881 &self,
2882
2883 hz: impl ::fidl_next::Encode<
2884 ::fidl_next::wire::Uint64,
2885 <___T as ::fidl_next::Transport>::SendBuffer,
2886 >,
2887 ) -> ::fidl_next::TwoWayFuture<'_, super::SetRate, ___T>
2888 where
2889 <___T as ::fidl_next::Transport>::SendBuffer:
2890 ::fidl_next::encoder::InternalHandleEncoder,
2891 {
2892 self.set_rate_with(crate::generic::ClockSetRateRequest { hz })
2893 }
2894
2895 #[doc = " Attempt to set the rate of the clock provider.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `SetRate`\n Returns `ZX_ERR_INVALID_ARGS` if the requested rate is not one that is reported as supported by `QuerySupportedRate`.\n Returns `ZX_ERR_TIMED_OUT` if an operation timed out (for instance, a PLL was unable to lock).\n Returns `ZX_ERR_INTERNAL` if the operation failed for any other reason.\n"]
2896 pub fn set_rate_with<___R>(
2897 &self,
2898 request: ___R,
2899 ) -> ::fidl_next::TwoWayFuture<'_, super::SetRate, ___T>
2900 where
2901 ___R: ::fidl_next::Encode<
2902 crate::wire::ClockSetRateRequest,
2903 <___T as ::fidl_next::Transport>::SendBuffer,
2904 >,
2905 {
2906 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2907 1032981018767748612,
2908 <super::SetRate as ::fidl_next::Method>::FLEXIBILITY,
2909 request,
2910 ))
2911 }
2912
2913 #[doc = " Query the hardware for the highest supported rate that does not\n exceed hz_in.\n `QuerySupportedRate` shall not alter the state of the clock tree in any way.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `QuerySupportedRate`.\n Returns `ZX_ERR_OUT_OF_RANGE` if a suitable rate could not be found.\n"]
2914 pub fn query_supported_rate(
2915 &self,
2916
2917 hz_in: impl ::fidl_next::Encode<
2918 ::fidl_next::wire::Uint64,
2919 <___T as ::fidl_next::Transport>::SendBuffer,
2920 >,
2921 ) -> ::fidl_next::TwoWayFuture<'_, super::QuerySupportedRate, ___T>
2922 where
2923 <___T as ::fidl_next::Transport>::SendBuffer:
2924 ::fidl_next::encoder::InternalHandleEncoder,
2925 {
2926 self.query_supported_rate_with(crate::generic::ClockQuerySupportedRateRequest {
2927 hz_in,
2928 })
2929 }
2930
2931 #[doc = " Query the hardware for the highest supported rate that does not\n exceed hz_in.\n `QuerySupportedRate` shall not alter the state of the clock tree in any way.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `QuerySupportedRate`.\n Returns `ZX_ERR_OUT_OF_RANGE` if a suitable rate could not be found.\n"]
2932 pub fn query_supported_rate_with<___R>(
2933 &self,
2934 request: ___R,
2935 ) -> ::fidl_next::TwoWayFuture<'_, super::QuerySupportedRate, ___T>
2936 where
2937 ___R: ::fidl_next::Encode<
2938 crate::wire::ClockQuerySupportedRateRequest,
2939 <___T as ::fidl_next::Transport>::SendBuffer,
2940 >,
2941 {
2942 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2943 4342302280982685137,
2944 <super::QuerySupportedRate as ::fidl_next::Method>::FLEXIBILITY,
2945 request,
2946 ))
2947 }
2948
2949 #[doc = " Returns the current rate that a given clock is running at.\n GetRate shall not alter the state of the clock tree in any way.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `GetRate `.\n"]
2950 pub fn get_rate(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetRate, ___T> {
2951 ::fidl_next::TwoWayFuture::from_untyped(
2952 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
2953 1121163806855671421,
2954 <super::GetRate as ::fidl_next::Method>::FLEXIBILITY,
2955 (),
2956 ),
2957 )
2958 }
2959
2960 #[doc = " Sets the input of this clock by index. I.e. by selecting a mux.\n This clock has N inputs defined 0 through N-1, which are valid arguemts\n as the index to SetInput.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `SetInput`\n Returns `ZX_ERR_OUT_OF_RANGE` if `idx` is outside of the range supplied by `GetNumInputs`.\n Returns `ZX_ERR_INTERNAL` if the operation failed for any other reason.\n"]
2961 pub fn set_input(
2962 &self,
2963
2964 idx: impl ::fidl_next::Encode<
2965 ::fidl_next::wire::Uint32,
2966 <___T as ::fidl_next::Transport>::SendBuffer,
2967 >,
2968 ) -> ::fidl_next::TwoWayFuture<'_, super::SetInput, ___T>
2969 where
2970 <___T as ::fidl_next::Transport>::SendBuffer:
2971 ::fidl_next::encoder::InternalHandleEncoder,
2972 {
2973 self.set_input_with(crate::generic::ClockSetInputRequest { idx })
2974 }
2975
2976 #[doc = " Sets the input of this clock by index. I.e. by selecting a mux.\n This clock has N inputs defined 0 through N-1, which are valid arguemts\n as the index to SetInput.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `SetInput`\n Returns `ZX_ERR_OUT_OF_RANGE` if `idx` is outside of the range supplied by `GetNumInputs`.\n Returns `ZX_ERR_INTERNAL` if the operation failed for any other reason.\n"]
2977 pub fn set_input_with<___R>(
2978 &self,
2979 request: ___R,
2980 ) -> ::fidl_next::TwoWayFuture<'_, super::SetInput, ___T>
2981 where
2982 ___R: ::fidl_next::Encode<
2983 crate::wire::ClockSetInputRequest,
2984 <___T as ::fidl_next::Transport>::SendBuffer,
2985 >,
2986 {
2987 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2988 5218173341159048288,
2989 <super::SetInput as ::fidl_next::Method>::FLEXIBILITY,
2990 request,
2991 ))
2992 }
2993
2994 #[doc = " Returns the number of inputs this clock has.\n Any value between 0 and UINT32_MAX is a valid return for this method.\n A Root Oscillator may return 0 for instance, if it has no inputs.\n GetNumInputs shall not alter the state of the clock tree in any way.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `GetNumInputs`.\n"]
2995 pub fn get_num_inputs(
2996 &self,
2997 ) -> ::fidl_next::TwoWayFuture<'_, super::GetNumInputs, ___T> {
2998 ::fidl_next::TwoWayFuture::from_untyped(
2999 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
3000 8531740354274582083,
3001 <super::GetNumInputs as ::fidl_next::Method>::FLEXIBILITY,
3002 (),
3003 ),
3004 )
3005 }
3006
3007 #[doc = " Returns the index of the current input of this clock.\n GetInput shall not alter the state of the clock tree in any way.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `GetInput`.\n"]
3008 pub fn get_input(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetInput, ___T> {
3009 ::fidl_next::TwoWayFuture::from_untyped(
3010 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
3011 2584673235362685201,
3012 <super::GetInput as ::fidl_next::Method>::FLEXIBILITY,
3013 (),
3014 ),
3015 )
3016 }
3017
3018 #[doc = " Returns the static properties of a clock.\n"]
3019 pub fn get_properties(
3020 &self,
3021 ) -> ::fidl_next::TwoWayFuture<'_, super::GetProperties, ___T> {
3022 ::fidl_next::TwoWayFuture::from_untyped(
3023 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
3024 2758748715462866138,
3025 <super::GetProperties as ::fidl_next::Method>::FLEXIBILITY,
3026 (),
3027 ),
3028 )
3029 }
3030 }
3031
3032 #[repr(transparent)]
3034 pub struct ClockServer<___T: ::fidl_next::Transport> {
3035 server: ::fidl_next::protocol::Server<___T>,
3036 }
3037
3038 impl<___T> ClockServer<___T> where ___T: ::fidl_next::Transport {}
3039 }
3040}
3041
3042#[diagnostic::on_unimplemented(
3043 note = "If {Self} implements the non-local ClockClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3044)]
3045
3046pub trait ClockLocalClientHandler<
3050 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3051 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3052>
3053{
3054 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3055 ::core::future::ready(())
3056 }
3057}
3058
3059impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Clock
3060where
3061 ___H: ClockLocalClientHandler<___T>,
3062 ___T: ::fidl_next::Transport,
3063{
3064 async fn on_event(
3065 handler: &mut ___H,
3066 mut message: ::fidl_next::Message<___T>,
3067 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3068 match *message.header().ordinal {
3069 ordinal => {
3070 handler.on_unknown_interaction(ordinal).await;
3071 if ::core::matches!(
3072 message.header().flexibility(),
3073 ::fidl_next::protocol::Flexibility::Strict
3074 ) {
3075 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3076 } else {
3077 Ok(())
3078 }
3079 }
3080 }
3081 }
3082}
3083
3084#[diagnostic::on_unimplemented(
3085 note = "If {Self} implements the non-local ClockServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3086)]
3087
3088pub trait ClockLocalServerHandler<
3092 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3093 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3094>
3095{
3096 #[doc = " Enables (ungates) this clock.\n Drivers *must* call enable on all clocks they depend upon.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `Enable`.\n Returns `ZX_ERR_TIMED_OUT` if an operation timed out (for instance, a PLL was unable to lock).\n Returns `ZX_ERR_INTERNAL` if the operation failed for any other reason.\n"]
3097 fn enable(
3098 &mut self,
3099
3100 responder: ::fidl_next::Responder<clock::Enable, ___T>,
3101 ) -> impl ::core::future::Future<Output = ()>;
3102
3103 #[doc = " Disables (gates) this clock.\n Drivers should call this method to indicate to the clock subsystem that\n a particular clock signal is no longer necessary.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `Disable`\n Returns `ZX_ERR_INTERNAL` if the operation failed for any other reason.\n"]
3104 fn disable(
3105 &mut self,
3106
3107 responder: ::fidl_next::Responder<clock::Disable, ___T>,
3108 ) -> impl ::core::future::Future<Output = ()>;
3109
3110 #[doc = " Returns `true` if a given clock is running.\n May query the hardware or return a cached value.\n IsEnabled shall not alter the state of the clock tree in any way.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `IsEnabled`.\n"]
3111 fn is_enabled(
3112 &mut self,
3113
3114 responder: ::fidl_next::Responder<clock::IsEnabled, ___T>,
3115 ) -> impl ::core::future::Future<Output = ()>;
3116
3117 #[doc = " Attempt to set the rate of the clock provider.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `SetRate`\n Returns `ZX_ERR_INVALID_ARGS` if the requested rate is not one that is reported as supported by `QuerySupportedRate`.\n Returns `ZX_ERR_TIMED_OUT` if an operation timed out (for instance, a PLL was unable to lock).\n Returns `ZX_ERR_INTERNAL` if the operation failed for any other reason.\n"]
3118 fn set_rate(
3119 &mut self,
3120
3121 request: ::fidl_next::Request<clock::SetRate, ___T>,
3122
3123 responder: ::fidl_next::Responder<clock::SetRate, ___T>,
3124 ) -> impl ::core::future::Future<Output = ()>;
3125
3126 #[doc = " Query the hardware for the highest supported rate that does not\n exceed hz_in.\n `QuerySupportedRate` shall not alter the state of the clock tree in any way.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `QuerySupportedRate`.\n Returns `ZX_ERR_OUT_OF_RANGE` if a suitable rate could not be found.\n"]
3127 fn query_supported_rate(
3128 &mut self,
3129
3130 request: ::fidl_next::Request<clock::QuerySupportedRate, ___T>,
3131
3132 responder: ::fidl_next::Responder<clock::QuerySupportedRate, ___T>,
3133 ) -> impl ::core::future::Future<Output = ()>;
3134
3135 #[doc = " Returns the current rate that a given clock is running at.\n GetRate shall not alter the state of the clock tree in any way.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `GetRate `.\n"]
3136 fn get_rate(
3137 &mut self,
3138
3139 responder: ::fidl_next::Responder<clock::GetRate, ___T>,
3140 ) -> impl ::core::future::Future<Output = ()>;
3141
3142 #[doc = " Sets the input of this clock by index. I.e. by selecting a mux.\n This clock has N inputs defined 0 through N-1, which are valid arguemts\n as the index to SetInput.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `SetInput`\n Returns `ZX_ERR_OUT_OF_RANGE` if `idx` is outside of the range supplied by `GetNumInputs`.\n Returns `ZX_ERR_INTERNAL` if the operation failed for any other reason.\n"]
3143 fn set_input(
3144 &mut self,
3145
3146 request: ::fidl_next::Request<clock::SetInput, ___T>,
3147
3148 responder: ::fidl_next::Responder<clock::SetInput, ___T>,
3149 ) -> impl ::core::future::Future<Output = ()>;
3150
3151 #[doc = " Returns the number of inputs this clock has.\n Any value between 0 and UINT32_MAX is a valid return for this method.\n A Root Oscillator may return 0 for instance, if it has no inputs.\n GetNumInputs shall not alter the state of the clock tree in any way.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `GetNumInputs`.\n"]
3152 fn get_num_inputs(
3153 &mut self,
3154
3155 responder: ::fidl_next::Responder<clock::GetNumInputs, ___T>,
3156 ) -> impl ::core::future::Future<Output = ()>;
3157
3158 #[doc = " Returns the index of the current input of this clock.\n GetInput shall not alter the state of the clock tree in any way.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `GetInput`.\n"]
3159 fn get_input(
3160 &mut self,
3161
3162 responder: ::fidl_next::Responder<clock::GetInput, ___T>,
3163 ) -> impl ::core::future::Future<Output = ()>;
3164
3165 #[doc = " Returns the static properties of a clock.\n"]
3166 fn get_properties(
3167 &mut self,
3168
3169 responder: ::fidl_next::Responder<clock::GetProperties, ___T>,
3170 ) -> impl ::core::future::Future<Output = ()>;
3171
3172 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3173 ::core::future::ready(())
3174 }
3175}
3176
3177impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Clock
3178where
3179 ___H: ClockLocalServerHandler<___T>,
3180 ___T: ::fidl_next::Transport,
3181 for<'de> crate::wire::ClockSetRateRequest: ::fidl_next::Decode<
3182 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3183 Constraint = (),
3184 >,
3185 for<'de> crate::wire::ClockQuerySupportedRateRequest: ::fidl_next::Decode<
3186 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3187 Constraint = (),
3188 >,
3189 for<'de> crate::wire::ClockSetInputRequest: ::fidl_next::Decode<
3190 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3191 Constraint = (),
3192 >,
3193{
3194 async fn on_one_way(
3195 handler: &mut ___H,
3196 mut message: ::fidl_next::Message<___T>,
3197 ) -> ::core::result::Result<
3198 (),
3199 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3200 > {
3201 match *message.header().ordinal {
3202 ordinal => {
3203 handler.on_unknown_interaction(ordinal).await;
3204 if ::core::matches!(
3205 message.header().flexibility(),
3206 ::fidl_next::protocol::Flexibility::Strict
3207 ) {
3208 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3209 } else {
3210 Ok(())
3211 }
3212 }
3213 }
3214 }
3215
3216 async fn on_two_way(
3217 handler: &mut ___H,
3218 mut message: ::fidl_next::Message<___T>,
3219 responder: ::fidl_next::protocol::Responder<___T>,
3220 ) -> ::core::result::Result<
3221 (),
3222 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3223 > {
3224 match *message.header().ordinal {
3225 6784697999065719342 => {
3226 let responder = ::fidl_next::Responder::from_untyped(responder);
3227
3228 handler.enable(responder).await;
3229 Ok(())
3230 }
3231
3232 547375520742554393 => {
3233 let responder = ::fidl_next::Responder::from_untyped(responder);
3234
3235 handler.disable(responder).await;
3236 Ok(())
3237 }
3238
3239 933050423591341447 => {
3240 let responder = ::fidl_next::Responder::from_untyped(responder);
3241
3242 handler.is_enabled(responder).await;
3243 Ok(())
3244 }
3245
3246 1032981018767748612 => {
3247 let responder = ::fidl_next::Responder::from_untyped(responder);
3248
3249 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3250 Ok(decoded) => {
3251 handler
3252 .set_rate(::fidl_next::Request::from_decoded(decoded), responder)
3253 .await;
3254 Ok(())
3255 }
3256 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3257 ordinal: 1032981018767748612,
3258 error,
3259 }),
3260 }
3261 }
3262
3263 4342302280982685137 => {
3264 let responder = ::fidl_next::Responder::from_untyped(responder);
3265
3266 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3267 Ok(decoded) => {
3268 handler
3269 .query_supported_rate(
3270 ::fidl_next::Request::from_decoded(decoded),
3271 responder,
3272 )
3273 .await;
3274 Ok(())
3275 }
3276 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3277 ordinal: 4342302280982685137,
3278 error,
3279 }),
3280 }
3281 }
3282
3283 1121163806855671421 => {
3284 let responder = ::fidl_next::Responder::from_untyped(responder);
3285
3286 handler.get_rate(responder).await;
3287 Ok(())
3288 }
3289
3290 5218173341159048288 => {
3291 let responder = ::fidl_next::Responder::from_untyped(responder);
3292
3293 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3294 Ok(decoded) => {
3295 handler
3296 .set_input(::fidl_next::Request::from_decoded(decoded), responder)
3297 .await;
3298 Ok(())
3299 }
3300 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3301 ordinal: 5218173341159048288,
3302 error,
3303 }),
3304 }
3305 }
3306
3307 8531740354274582083 => {
3308 let responder = ::fidl_next::Responder::from_untyped(responder);
3309
3310 handler.get_num_inputs(responder).await;
3311 Ok(())
3312 }
3313
3314 2584673235362685201 => {
3315 let responder = ::fidl_next::Responder::from_untyped(responder);
3316
3317 handler.get_input(responder).await;
3318 Ok(())
3319 }
3320
3321 2758748715462866138 => {
3322 let responder = ::fidl_next::Responder::from_untyped(responder);
3323
3324 handler.get_properties(responder).await;
3325 Ok(())
3326 }
3327
3328 ordinal => {
3329 handler.on_unknown_interaction(ordinal).await;
3330 if ::core::matches!(
3331 message.header().flexibility(),
3332 ::fidl_next::protocol::Flexibility::Strict
3333 ) {
3334 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3335 } else {
3336 responder
3337 .respond_framework_error(
3338 ordinal,
3339 ::fidl_next::FrameworkError::UnknownMethod,
3340 )
3341 .expect("encoding a framework error should never fail")
3342 .await?;
3343 Ok(())
3344 }
3345 }
3346 }
3347 }
3348}
3349
3350pub trait ClockClientHandler<
3354 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3355 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3356>
3357{
3358 fn on_unknown_interaction(
3359 &mut self,
3360 ordinal: u64,
3361 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3362 ::core::future::ready(())
3363 }
3364}
3365
3366impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Clock
3367where
3368 ___H: ClockClientHandler<___T> + ::core::marker::Send,
3369 ___T: ::fidl_next::Transport,
3370{
3371 async fn on_event(
3372 handler: &mut ___H,
3373 mut message: ::fidl_next::Message<___T>,
3374 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3375 match *message.header().ordinal {
3376 ordinal => {
3377 handler.on_unknown_interaction(ordinal).await;
3378 if ::core::matches!(
3379 message.header().flexibility(),
3380 ::fidl_next::protocol::Flexibility::Strict
3381 ) {
3382 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3383 } else {
3384 Ok(())
3385 }
3386 }
3387 }
3388 }
3389}
3390
3391pub trait ClockServerHandler<
3395 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3396 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3397>
3398{
3399 #[doc = " Enables (ungates) this clock.\n Drivers *must* call enable on all clocks they depend upon.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `Enable`.\n Returns `ZX_ERR_TIMED_OUT` if an operation timed out (for instance, a PLL was unable to lock).\n Returns `ZX_ERR_INTERNAL` if the operation failed for any other reason.\n"]
3400 fn enable(
3401 &mut self,
3402
3403 responder: ::fidl_next::Responder<clock::Enable, ___T>,
3404 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3405
3406 #[doc = " Disables (gates) this clock.\n Drivers should call this method to indicate to the clock subsystem that\n a particular clock signal is no longer necessary.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `Disable`\n Returns `ZX_ERR_INTERNAL` if the operation failed for any other reason.\n"]
3407 fn disable(
3408 &mut self,
3409
3410 responder: ::fidl_next::Responder<clock::Disable, ___T>,
3411 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3412
3413 #[doc = " Returns `true` if a given clock is running.\n May query the hardware or return a cached value.\n IsEnabled shall not alter the state of the clock tree in any way.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `IsEnabled`.\n"]
3414 fn is_enabled(
3415 &mut self,
3416
3417 responder: ::fidl_next::Responder<clock::IsEnabled, ___T>,
3418 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3419
3420 #[doc = " Attempt to set the rate of the clock provider.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `SetRate`\n Returns `ZX_ERR_INVALID_ARGS` if the requested rate is not one that is reported as supported by `QuerySupportedRate`.\n Returns `ZX_ERR_TIMED_OUT` if an operation timed out (for instance, a PLL was unable to lock).\n Returns `ZX_ERR_INTERNAL` if the operation failed for any other reason.\n"]
3421 fn set_rate(
3422 &mut self,
3423
3424 request: ::fidl_next::Request<clock::SetRate, ___T>,
3425
3426 responder: ::fidl_next::Responder<clock::SetRate, ___T>,
3427 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3428
3429 #[doc = " Query the hardware for the highest supported rate that does not\n exceed hz_in.\n `QuerySupportedRate` shall not alter the state of the clock tree in any way.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `QuerySupportedRate`.\n Returns `ZX_ERR_OUT_OF_RANGE` if a suitable rate could not be found.\n"]
3430 fn query_supported_rate(
3431 &mut self,
3432
3433 request: ::fidl_next::Request<clock::QuerySupportedRate, ___T>,
3434
3435 responder: ::fidl_next::Responder<clock::QuerySupportedRate, ___T>,
3436 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3437
3438 #[doc = " Returns the current rate that a given clock is running at.\n GetRate shall not alter the state of the clock tree in any way.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `GetRate `.\n"]
3439 fn get_rate(
3440 &mut self,
3441
3442 responder: ::fidl_next::Responder<clock::GetRate, ___T>,
3443 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3444
3445 #[doc = " Sets the input of this clock by index. I.e. by selecting a mux.\n This clock has N inputs defined 0 through N-1, which are valid arguemts\n as the index to SetInput.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `SetInput`\n Returns `ZX_ERR_OUT_OF_RANGE` if `idx` is outside of the range supplied by `GetNumInputs`.\n Returns `ZX_ERR_INTERNAL` if the operation failed for any other reason.\n"]
3446 fn set_input(
3447 &mut self,
3448
3449 request: ::fidl_next::Request<clock::SetInput, ___T>,
3450
3451 responder: ::fidl_next::Responder<clock::SetInput, ___T>,
3452 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3453
3454 #[doc = " Returns the number of inputs this clock has.\n Any value between 0 and UINT32_MAX is a valid return for this method.\n A Root Oscillator may return 0 for instance, if it has no inputs.\n GetNumInputs shall not alter the state of the clock tree in any way.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `GetNumInputs`.\n"]
3455 fn get_num_inputs(
3456 &mut self,
3457
3458 responder: ::fidl_next::Responder<clock::GetNumInputs, ___T>,
3459 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3460
3461 #[doc = " Returns the index of the current input of this clock.\n GetInput shall not alter the state of the clock tree in any way.\n Returns `ZX_ERR_NOT_SUPPORTED` if this clock type does not support `GetInput`.\n"]
3462 fn get_input(
3463 &mut self,
3464
3465 responder: ::fidl_next::Responder<clock::GetInput, ___T>,
3466 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3467
3468 #[doc = " Returns the static properties of a clock.\n"]
3469 fn get_properties(
3470 &mut self,
3471
3472 responder: ::fidl_next::Responder<clock::GetProperties, ___T>,
3473 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3474
3475 fn on_unknown_interaction(
3476 &mut self,
3477 ordinal: u64,
3478 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3479 ::core::future::ready(())
3480 }
3481}
3482
3483impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Clock
3484where
3485 ___H: ClockServerHandler<___T> + ::core::marker::Send,
3486 ___T: ::fidl_next::Transport,
3487 for<'de> crate::wire::ClockSetRateRequest: ::fidl_next::Decode<
3488 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3489 Constraint = (),
3490 >,
3491 for<'de> crate::wire::ClockQuerySupportedRateRequest: ::fidl_next::Decode<
3492 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3493 Constraint = (),
3494 >,
3495 for<'de> crate::wire::ClockSetInputRequest: ::fidl_next::Decode<
3496 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3497 Constraint = (),
3498 >,
3499{
3500 async fn on_one_way(
3501 handler: &mut ___H,
3502 mut message: ::fidl_next::Message<___T>,
3503 ) -> ::core::result::Result<
3504 (),
3505 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3506 > {
3507 match *message.header().ordinal {
3508 ordinal => {
3509 handler.on_unknown_interaction(ordinal).await;
3510 if ::core::matches!(
3511 message.header().flexibility(),
3512 ::fidl_next::protocol::Flexibility::Strict
3513 ) {
3514 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3515 } else {
3516 Ok(())
3517 }
3518 }
3519 }
3520 }
3521
3522 async fn on_two_way(
3523 handler: &mut ___H,
3524 mut message: ::fidl_next::Message<___T>,
3525 responder: ::fidl_next::protocol::Responder<___T>,
3526 ) -> ::core::result::Result<
3527 (),
3528 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3529 > {
3530 match *message.header().ordinal {
3531 6784697999065719342 => {
3532 let responder = ::fidl_next::Responder::from_untyped(responder);
3533
3534 handler.enable(responder).await;
3535 Ok(())
3536 }
3537
3538 547375520742554393 => {
3539 let responder = ::fidl_next::Responder::from_untyped(responder);
3540
3541 handler.disable(responder).await;
3542 Ok(())
3543 }
3544
3545 933050423591341447 => {
3546 let responder = ::fidl_next::Responder::from_untyped(responder);
3547
3548 handler.is_enabled(responder).await;
3549 Ok(())
3550 }
3551
3552 1032981018767748612 => {
3553 let responder = ::fidl_next::Responder::from_untyped(responder);
3554
3555 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3556 Ok(decoded) => {
3557 handler
3558 .set_rate(::fidl_next::Request::from_decoded(decoded), responder)
3559 .await;
3560 Ok(())
3561 }
3562 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3563 ordinal: 1032981018767748612,
3564 error,
3565 }),
3566 }
3567 }
3568
3569 4342302280982685137 => {
3570 let responder = ::fidl_next::Responder::from_untyped(responder);
3571
3572 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3573 Ok(decoded) => {
3574 handler
3575 .query_supported_rate(
3576 ::fidl_next::Request::from_decoded(decoded),
3577 responder,
3578 )
3579 .await;
3580 Ok(())
3581 }
3582 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3583 ordinal: 4342302280982685137,
3584 error,
3585 }),
3586 }
3587 }
3588
3589 1121163806855671421 => {
3590 let responder = ::fidl_next::Responder::from_untyped(responder);
3591
3592 handler.get_rate(responder).await;
3593 Ok(())
3594 }
3595
3596 5218173341159048288 => {
3597 let responder = ::fidl_next::Responder::from_untyped(responder);
3598
3599 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3600 Ok(decoded) => {
3601 handler
3602 .set_input(::fidl_next::Request::from_decoded(decoded), responder)
3603 .await;
3604 Ok(())
3605 }
3606 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3607 ordinal: 5218173341159048288,
3608 error,
3609 }),
3610 }
3611 }
3612
3613 8531740354274582083 => {
3614 let responder = ::fidl_next::Responder::from_untyped(responder);
3615
3616 handler.get_num_inputs(responder).await;
3617 Ok(())
3618 }
3619
3620 2584673235362685201 => {
3621 let responder = ::fidl_next::Responder::from_untyped(responder);
3622
3623 handler.get_input(responder).await;
3624 Ok(())
3625 }
3626
3627 2758748715462866138 => {
3628 let responder = ::fidl_next::Responder::from_untyped(responder);
3629
3630 handler.get_properties(responder).await;
3631 Ok(())
3632 }
3633
3634 ordinal => {
3635 handler.on_unknown_interaction(ordinal).await;
3636 if ::core::matches!(
3637 message.header().flexibility(),
3638 ::fidl_next::protocol::Flexibility::Strict
3639 ) {
3640 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3641 } else {
3642 responder
3643 .respond_framework_error(
3644 ordinal,
3645 ::fidl_next::FrameworkError::UnknownMethod,
3646 )
3647 .expect("encoding a framework error should never fail")
3648 .await?;
3649 Ok(())
3650 }
3651 }
3652 }
3653 }
3654}
3655
3656impl<___T> ClockClientHandler<___T> for ::fidl_next::IgnoreEvents
3657where
3658 ___T: ::fidl_next::Transport,
3659{
3660 async fn on_unknown_interaction(&mut self, _: u64) {}
3661}
3662
3663impl<___H, ___T> ClockLocalClientHandler<___T> for ::fidl_next::Local<___H>
3664where
3665 ___H: ClockClientHandler<___T>,
3666 ___T: ::fidl_next::Transport,
3667{
3668 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3669 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3670 }
3671}
3672
3673impl<___H, ___T> ClockLocalServerHandler<___T> for ::fidl_next::Local<___H>
3674where
3675 ___H: ClockServerHandler<___T>,
3676 ___T: ::fidl_next::Transport,
3677{
3678 async fn enable(&mut self, responder: ::fidl_next::Responder<clock::Enable, ___T>) {
3679 ___H::enable(&mut self.0, responder).await
3680 }
3681
3682 async fn disable(&mut self, responder: ::fidl_next::Responder<clock::Disable, ___T>) {
3683 ___H::disable(&mut self.0, responder).await
3684 }
3685
3686 async fn is_enabled(&mut self, responder: ::fidl_next::Responder<clock::IsEnabled, ___T>) {
3687 ___H::is_enabled(&mut self.0, responder).await
3688 }
3689
3690 async fn set_rate(
3691 &mut self,
3692
3693 request: ::fidl_next::Request<clock::SetRate, ___T>,
3694
3695 responder: ::fidl_next::Responder<clock::SetRate, ___T>,
3696 ) {
3697 ___H::set_rate(&mut self.0, request, responder).await
3698 }
3699
3700 async fn query_supported_rate(
3701 &mut self,
3702
3703 request: ::fidl_next::Request<clock::QuerySupportedRate, ___T>,
3704
3705 responder: ::fidl_next::Responder<clock::QuerySupportedRate, ___T>,
3706 ) {
3707 ___H::query_supported_rate(&mut self.0, request, responder).await
3708 }
3709
3710 async fn get_rate(&mut self, responder: ::fidl_next::Responder<clock::GetRate, ___T>) {
3711 ___H::get_rate(&mut self.0, responder).await
3712 }
3713
3714 async fn set_input(
3715 &mut self,
3716
3717 request: ::fidl_next::Request<clock::SetInput, ___T>,
3718
3719 responder: ::fidl_next::Responder<clock::SetInput, ___T>,
3720 ) {
3721 ___H::set_input(&mut self.0, request, responder).await
3722 }
3723
3724 async fn get_num_inputs(
3725 &mut self,
3726
3727 responder: ::fidl_next::Responder<clock::GetNumInputs, ___T>,
3728 ) {
3729 ___H::get_num_inputs(&mut self.0, responder).await
3730 }
3731
3732 async fn get_input(&mut self, responder: ::fidl_next::Responder<clock::GetInput, ___T>) {
3733 ___H::get_input(&mut self.0, responder).await
3734 }
3735
3736 async fn get_properties(
3737 &mut self,
3738
3739 responder: ::fidl_next::Responder<clock::GetProperties, ___T>,
3740 ) {
3741 ___H::get_properties(&mut self.0, responder).await
3742 }
3743
3744 async fn on_unknown_interaction(&mut self, ordinal: u64) {
3745 ___H::on_unknown_interaction(&mut self.0, ordinal).await
3746 }
3747}