1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 #[doc = " Errors returned by `ActivityGovernor/AcquireWakeLease`.\n"]
8 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9 #[repr(u32)]
10 pub enum AcquireWakeLeaseError {
11 Internal = 1,
12 InvalidName = 2,
13 UnknownOrdinal_(u32) = 3,
14 }
15 impl ::std::convert::From<u32> for AcquireWakeLeaseError {
16 fn from(value: u32) -> Self {
17 match value {
18 1 => Self::Internal,
19 2 => Self::InvalidName,
20
21 _ => Self::UnknownOrdinal_(value),
22 }
23 }
24 }
25
26 unsafe impl<___E> ::fidl_next::Encode<crate::wire::AcquireWakeLeaseError, ___E>
27 for AcquireWakeLeaseError
28 where
29 ___E: ?Sized,
30 {
31 #[inline]
32 fn encode(
33 self,
34 encoder: &mut ___E,
35 out: &mut ::core::mem::MaybeUninit<crate::wire::AcquireWakeLeaseError>,
36 _: (),
37 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
38 ::fidl_next::Encode::encode(&self, encoder, out, ())
39 }
40 }
41
42 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::AcquireWakeLeaseError, ___E>
43 for &'a AcquireWakeLeaseError
44 where
45 ___E: ?Sized,
46 {
47 #[inline]
48 fn encode(
49 self,
50 encoder: &mut ___E,
51 out: &mut ::core::mem::MaybeUninit<crate::wire::AcquireWakeLeaseError>,
52 _: (),
53 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
54 ::fidl_next::munge!(let crate::wire::AcquireWakeLeaseError { value } = out);
55 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
56 AcquireWakeLeaseError::Internal => 1,
57
58 AcquireWakeLeaseError::InvalidName => 2,
59
60 AcquireWakeLeaseError::UnknownOrdinal_(value) => value,
61 }));
62
63 Ok(())
64 }
65 }
66
67 impl ::core::convert::From<crate::wire::AcquireWakeLeaseError> for AcquireWakeLeaseError {
68 fn from(wire: crate::wire::AcquireWakeLeaseError) -> Self {
69 match u32::from(wire.value) {
70 1 => Self::Internal,
71
72 2 => Self::InvalidName,
73
74 value => Self::UnknownOrdinal_(value),
75 }
76 }
77 }
78
79 impl ::fidl_next::FromWire<crate::wire::AcquireWakeLeaseError> for AcquireWakeLeaseError {
80 #[inline]
81 fn from_wire(wire: crate::wire::AcquireWakeLeaseError) -> Self {
82 Self::from(wire)
83 }
84 }
85
86 impl ::fidl_next::FromWireRef<crate::wire::AcquireWakeLeaseError> for AcquireWakeLeaseError {
87 #[inline]
88 fn from_wire_ref(wire: &crate::wire::AcquireWakeLeaseError) -> Self {
89 Self::from(*wire)
90 }
91 }
92
93 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
94 pub struct ActivityGovernorAcquireWakeLeaseRequest {
95 pub name: ::std::string::String,
96 }
97
98 unsafe impl<___E>
99 ::fidl_next::Encode<crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'static>, ___E>
100 for ActivityGovernorAcquireWakeLeaseRequest
101 where
102 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
103 ___E: ::fidl_next::Encoder,
104 {
105 #[inline]
106 fn encode(
107 self,
108 encoder_: &mut ___E,
109 out_: &mut ::core::mem::MaybeUninit<
110 crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'static>,
111 >,
112 _: (),
113 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
114 ::fidl_next::munge! {
115 let crate::wire::ActivityGovernorAcquireWakeLeaseRequest {
116 name,
117
118 } = out_;
119 }
120
121 ::fidl_next::Encode::encode(self.name, encoder_, name, 64)?;
122
123 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
124 ::fidl_next::Constrained::validate(_field, 64)?;
125
126 Ok(())
127 }
128 }
129
130 unsafe impl<'a, ___E>
131 ::fidl_next::Encode<crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'static>, ___E>
132 for &'a ActivityGovernorAcquireWakeLeaseRequest
133 where
134 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
135 ___E: ::fidl_next::Encoder,
136 {
137 #[inline]
138 fn encode(
139 self,
140 encoder_: &mut ___E,
141 out_: &mut ::core::mem::MaybeUninit<
142 crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'static>,
143 >,
144 _: (),
145 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
146 ::fidl_next::munge! {
147 let crate::wire::ActivityGovernorAcquireWakeLeaseRequest {
148 name,
149
150 } = out_;
151 }
152
153 ::fidl_next::Encode::encode(&self.name, encoder_, name, 64)?;
154
155 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
156 ::fidl_next::Constrained::validate(_field, 64)?;
157
158 Ok(())
159 }
160 }
161
162 unsafe impl<___E>
163 ::fidl_next::EncodeOption<
164 ::fidl_next::wire::Box<
165 'static,
166 crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'static>,
167 >,
168 ___E,
169 > for ActivityGovernorAcquireWakeLeaseRequest
170 where
171 ___E: ::fidl_next::Encoder + ?Sized,
172 ActivityGovernorAcquireWakeLeaseRequest: ::fidl_next::Encode<crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'static>, ___E>,
173 {
174 #[inline]
175 fn encode_option(
176 this: ::core::option::Option<Self>,
177 encoder: &mut ___E,
178 out: &mut ::core::mem::MaybeUninit<
179 ::fidl_next::wire::Box<
180 'static,
181 crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'static>,
182 >,
183 >,
184 _: (),
185 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
186 if let Some(inner) = this {
187 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
188 ::fidl_next::wire::Box::encode_present(out);
189 } else {
190 ::fidl_next::wire::Box::encode_absent(out);
191 }
192
193 Ok(())
194 }
195 }
196
197 unsafe impl<'a, ___E>
198 ::fidl_next::EncodeOption<
199 ::fidl_next::wire::Box<
200 'static,
201 crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'static>,
202 >,
203 ___E,
204 > for &'a ActivityGovernorAcquireWakeLeaseRequest
205 where
206 ___E: ::fidl_next::Encoder + ?Sized,
207 &'a ActivityGovernorAcquireWakeLeaseRequest: ::fidl_next::Encode<crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'static>, ___E>,
208 {
209 #[inline]
210 fn encode_option(
211 this: ::core::option::Option<Self>,
212 encoder: &mut ___E,
213 out: &mut ::core::mem::MaybeUninit<
214 ::fidl_next::wire::Box<
215 'static,
216 crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'static>,
217 >,
218 >,
219 _: (),
220 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
221 if let Some(inner) = this {
222 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
223 ::fidl_next::wire::Box::encode_present(out);
224 } else {
225 ::fidl_next::wire::Box::encode_absent(out);
226 }
227
228 Ok(())
229 }
230 }
231
232 impl<'de> ::fidl_next::FromWire<crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'de>>
233 for ActivityGovernorAcquireWakeLeaseRequest
234 {
235 #[inline]
236 fn from_wire(wire: crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'de>) -> Self {
237 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
238 }
239 }
240
241 impl<'de> ::fidl_next::FromWireRef<crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'de>>
242 for ActivityGovernorAcquireWakeLeaseRequest
243 {
244 #[inline]
245 fn from_wire_ref(wire: &crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'de>) -> Self {
246 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
247 }
248 }
249
250 #[doc = " Error codes for responses from `RegisterSuspendBlocker` in\n [`fuchsia.power.system/ActivityGovernor`].\n"]
251 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
252 #[repr(u32)]
253 pub enum RegisterSuspendBlockerError {
254 Internal = 1,
255 InvalidArgs = 2,
256 UnknownOrdinal_(u32) = 3,
257 }
258 impl ::std::convert::From<u32> for RegisterSuspendBlockerError {
259 fn from(value: u32) -> Self {
260 match value {
261 1 => Self::Internal,
262 2 => Self::InvalidArgs,
263
264 _ => Self::UnknownOrdinal_(value),
265 }
266 }
267 }
268
269 unsafe impl<___E> ::fidl_next::Encode<crate::wire::RegisterSuspendBlockerError, ___E>
270 for RegisterSuspendBlockerError
271 where
272 ___E: ?Sized,
273 {
274 #[inline]
275 fn encode(
276 self,
277 encoder: &mut ___E,
278 out: &mut ::core::mem::MaybeUninit<crate::wire::RegisterSuspendBlockerError>,
279 _: (),
280 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
281 ::fidl_next::Encode::encode(&self, encoder, out, ())
282 }
283 }
284
285 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::RegisterSuspendBlockerError, ___E>
286 for &'a RegisterSuspendBlockerError
287 where
288 ___E: ?Sized,
289 {
290 #[inline]
291 fn encode(
292 self,
293 encoder: &mut ___E,
294 out: &mut ::core::mem::MaybeUninit<crate::wire::RegisterSuspendBlockerError>,
295 _: (),
296 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
297 ::fidl_next::munge!(let crate::wire::RegisterSuspendBlockerError { value } = out);
298 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
299 RegisterSuspendBlockerError::Internal => 1,
300
301 RegisterSuspendBlockerError::InvalidArgs => 2,
302
303 RegisterSuspendBlockerError::UnknownOrdinal_(value) => value,
304 }));
305
306 Ok(())
307 }
308 }
309
310 impl ::core::convert::From<crate::wire::RegisterSuspendBlockerError>
311 for RegisterSuspendBlockerError
312 {
313 fn from(wire: crate::wire::RegisterSuspendBlockerError) -> Self {
314 match u32::from(wire.value) {
315 1 => Self::Internal,
316
317 2 => Self::InvalidArgs,
318
319 value => Self::UnknownOrdinal_(value),
320 }
321 }
322 }
323
324 impl ::fidl_next::FromWire<crate::wire::RegisterSuspendBlockerError>
325 for RegisterSuspendBlockerError
326 {
327 #[inline]
328 fn from_wire(wire: crate::wire::RegisterSuspendBlockerError) -> Self {
329 Self::from(wire)
330 }
331 }
332
333 impl ::fidl_next::FromWireRef<crate::wire::RegisterSuspendBlockerError>
334 for RegisterSuspendBlockerError
335 {
336 #[inline]
337 fn from_wire_ref(wire: &crate::wire::RegisterSuspendBlockerError) -> Self {
338 Self::from(*wire)
339 }
340 }
341
342 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
343 pub struct ActivityGovernorAcquireUnmonitoredWakeLeaseRequest {
344 pub name: ::std::string::String,
345 }
346
347 unsafe impl<___E>
348 ::fidl_next::Encode<
349 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'static>,
350 ___E,
351 > for ActivityGovernorAcquireUnmonitoredWakeLeaseRequest
352 where
353 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
354 ___E: ::fidl_next::Encoder,
355 {
356 #[inline]
357 fn encode(
358 self,
359 encoder_: &mut ___E,
360 out_: &mut ::core::mem::MaybeUninit<
361 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'static>,
362 >,
363 _: (),
364 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
365 ::fidl_next::munge! {
366 let crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest {
367 name,
368
369 } = out_;
370 }
371
372 ::fidl_next::Encode::encode(self.name, encoder_, name, 64)?;
373
374 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
375 ::fidl_next::Constrained::validate(_field, 64)?;
376
377 Ok(())
378 }
379 }
380
381 unsafe impl<'a, ___E>
382 ::fidl_next::Encode<
383 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'static>,
384 ___E,
385 > for &'a ActivityGovernorAcquireUnmonitoredWakeLeaseRequest
386 where
387 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
388 ___E: ::fidl_next::Encoder,
389 {
390 #[inline]
391 fn encode(
392 self,
393 encoder_: &mut ___E,
394 out_: &mut ::core::mem::MaybeUninit<
395 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'static>,
396 >,
397 _: (),
398 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
399 ::fidl_next::munge! {
400 let crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest {
401 name,
402
403 } = out_;
404 }
405
406 ::fidl_next::Encode::encode(&self.name, encoder_, name, 64)?;
407
408 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
409 ::fidl_next::Constrained::validate(_field, 64)?;
410
411 Ok(())
412 }
413 }
414
415 unsafe impl<___E>
416 ::fidl_next::EncodeOption<
417 ::fidl_next::wire::Box<
418 'static,
419 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'static>,
420 >,
421 ___E,
422 > for ActivityGovernorAcquireUnmonitoredWakeLeaseRequest
423 where
424 ___E: ::fidl_next::Encoder + ?Sized,
425 ActivityGovernorAcquireUnmonitoredWakeLeaseRequest: ::fidl_next::Encode<
426 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'static>,
427 ___E,
428 >,
429 {
430 #[inline]
431 fn encode_option(
432 this: ::core::option::Option<Self>,
433 encoder: &mut ___E,
434 out: &mut ::core::mem::MaybeUninit<
435 ::fidl_next::wire::Box<
436 'static,
437 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'static>,
438 >,
439 >,
440 _: (),
441 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
442 if let Some(inner) = this {
443 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
444 ::fidl_next::wire::Box::encode_present(out);
445 } else {
446 ::fidl_next::wire::Box::encode_absent(out);
447 }
448
449 Ok(())
450 }
451 }
452
453 unsafe impl<'a, ___E>
454 ::fidl_next::EncodeOption<
455 ::fidl_next::wire::Box<
456 'static,
457 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'static>,
458 >,
459 ___E,
460 > for &'a ActivityGovernorAcquireUnmonitoredWakeLeaseRequest
461 where
462 ___E: ::fidl_next::Encoder + ?Sized,
463 &'a ActivityGovernorAcquireUnmonitoredWakeLeaseRequest: ::fidl_next::Encode<
464 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'static>,
465 ___E,
466 >,
467 {
468 #[inline]
469 fn encode_option(
470 this: ::core::option::Option<Self>,
471 encoder: &mut ___E,
472 out: &mut ::core::mem::MaybeUninit<
473 ::fidl_next::wire::Box<
474 'static,
475 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'static>,
476 >,
477 >,
478 _: (),
479 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
480 if let Some(inner) = this {
481 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
482 ::fidl_next::wire::Box::encode_present(out);
483 } else {
484 ::fidl_next::wire::Box::encode_absent(out);
485 }
486
487 Ok(())
488 }
489 }
490
491 impl<'de>
492 ::fidl_next::FromWire<crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'de>>
493 for ActivityGovernorAcquireUnmonitoredWakeLeaseRequest
494 {
495 #[inline]
496 fn from_wire(
497 wire: crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'de>,
498 ) -> Self {
499 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
500 }
501 }
502
503 impl<'de>
504 ::fidl_next::FromWireRef<
505 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'de>,
506 > for ActivityGovernorAcquireUnmonitoredWakeLeaseRequest
507 {
508 #[inline]
509 fn from_wire_ref(
510 wire: &crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'de>,
511 ) -> Self {
512 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
513 }
514 }
515
516 pub type ActivityGovernorAcquireWakeLeaseWithTokenResponse = ();
517
518 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
519 pub struct ActivityGovernorTakeApplicationActivityLeaseRequest {
520 pub name: ::std::string::String,
521 }
522
523 unsafe impl<___E>
524 ::fidl_next::Encode<
525 crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'static>,
526 ___E,
527 > for ActivityGovernorTakeApplicationActivityLeaseRequest
528 where
529 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
530 ___E: ::fidl_next::Encoder,
531 {
532 #[inline]
533 fn encode(
534 self,
535 encoder_: &mut ___E,
536 out_: &mut ::core::mem::MaybeUninit<
537 crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'static>,
538 >,
539 _: (),
540 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
541 ::fidl_next::munge! {
542 let crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest {
543 name,
544
545 } = out_;
546 }
547
548 ::fidl_next::Encode::encode(self.name, encoder_, name, 64)?;
549
550 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
551 ::fidl_next::Constrained::validate(_field, 64)?;
552
553 Ok(())
554 }
555 }
556
557 unsafe impl<'a, ___E>
558 ::fidl_next::Encode<
559 crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'static>,
560 ___E,
561 > for &'a ActivityGovernorTakeApplicationActivityLeaseRequest
562 where
563 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
564 ___E: ::fidl_next::Encoder,
565 {
566 #[inline]
567 fn encode(
568 self,
569 encoder_: &mut ___E,
570 out_: &mut ::core::mem::MaybeUninit<
571 crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'static>,
572 >,
573 _: (),
574 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
575 ::fidl_next::munge! {
576 let crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest {
577 name,
578
579 } = out_;
580 }
581
582 ::fidl_next::Encode::encode(&self.name, encoder_, name, 64)?;
583
584 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
585 ::fidl_next::Constrained::validate(_field, 64)?;
586
587 Ok(())
588 }
589 }
590
591 unsafe impl<___E>
592 ::fidl_next::EncodeOption<
593 ::fidl_next::wire::Box<
594 'static,
595 crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'static>,
596 >,
597 ___E,
598 > for ActivityGovernorTakeApplicationActivityLeaseRequest
599 where
600 ___E: ::fidl_next::Encoder + ?Sized,
601 ActivityGovernorTakeApplicationActivityLeaseRequest: ::fidl_next::Encode<
602 crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'static>,
603 ___E,
604 >,
605 {
606 #[inline]
607 fn encode_option(
608 this: ::core::option::Option<Self>,
609 encoder: &mut ___E,
610 out: &mut ::core::mem::MaybeUninit<
611 ::fidl_next::wire::Box<
612 'static,
613 crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'static>,
614 >,
615 >,
616 _: (),
617 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
618 if let Some(inner) = this {
619 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
620 ::fidl_next::wire::Box::encode_present(out);
621 } else {
622 ::fidl_next::wire::Box::encode_absent(out);
623 }
624
625 Ok(())
626 }
627 }
628
629 unsafe impl<'a, ___E>
630 ::fidl_next::EncodeOption<
631 ::fidl_next::wire::Box<
632 'static,
633 crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'static>,
634 >,
635 ___E,
636 > for &'a ActivityGovernorTakeApplicationActivityLeaseRequest
637 where
638 ___E: ::fidl_next::Encoder + ?Sized,
639 &'a ActivityGovernorTakeApplicationActivityLeaseRequest: ::fidl_next::Encode<
640 crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'static>,
641 ___E,
642 >,
643 {
644 #[inline]
645 fn encode_option(
646 this: ::core::option::Option<Self>,
647 encoder: &mut ___E,
648 out: &mut ::core::mem::MaybeUninit<
649 ::fidl_next::wire::Box<
650 'static,
651 crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'static>,
652 >,
653 >,
654 _: (),
655 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
656 if let Some(inner) = this {
657 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
658 ::fidl_next::wire::Box::encode_present(out);
659 } else {
660 ::fidl_next::wire::Box::encode_absent(out);
661 }
662
663 Ok(())
664 }
665 }
666
667 impl<'de>
668 ::fidl_next::FromWire<crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'de>>
669 for ActivityGovernorTakeApplicationActivityLeaseRequest
670 {
671 #[inline]
672 fn from_wire(
673 wire: crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'de>,
674 ) -> Self {
675 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
676 }
677 }
678
679 impl<'de>
680 ::fidl_next::FromWireRef<
681 crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'de>,
682 > for ActivityGovernorTakeApplicationActivityLeaseRequest
683 {
684 #[inline]
685 fn from_wire_ref(
686 wire: &crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'de>,
687 ) -> Self {
688 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
689 }
690 }
691
692 #[doc = " Error codes for responses from `AddApplicationActivityDependency` in\n [`fuchsia.power.system/ActivityGovernor`].\n"]
693 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
694 #[repr(u32)]
695 pub enum AddApplicationActivityDependencyError {
696 AlreadyExists = 1,
697 Invalid = 2,
698 Internal = 3,
699 UnknownOrdinal_(u32) = 4,
700 }
701 impl ::std::convert::From<u32> for AddApplicationActivityDependencyError {
702 fn from(value: u32) -> Self {
703 match value {
704 1 => Self::AlreadyExists,
705 2 => Self::Invalid,
706 3 => Self::Internal,
707
708 _ => Self::UnknownOrdinal_(value),
709 }
710 }
711 }
712
713 unsafe impl<___E> ::fidl_next::Encode<crate::wire::AddApplicationActivityDependencyError, ___E>
714 for AddApplicationActivityDependencyError
715 where
716 ___E: ?Sized,
717 {
718 #[inline]
719 fn encode(
720 self,
721 encoder: &mut ___E,
722 out: &mut ::core::mem::MaybeUninit<crate::wire::AddApplicationActivityDependencyError>,
723 _: (),
724 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
725 ::fidl_next::Encode::encode(&self, encoder, out, ())
726 }
727 }
728
729 unsafe impl<'a, ___E>
730 ::fidl_next::Encode<crate::wire::AddApplicationActivityDependencyError, ___E>
731 for &'a AddApplicationActivityDependencyError
732 where
733 ___E: ?Sized,
734 {
735 #[inline]
736 fn encode(
737 self,
738 encoder: &mut ___E,
739 out: &mut ::core::mem::MaybeUninit<crate::wire::AddApplicationActivityDependencyError>,
740 _: (),
741 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
742 ::fidl_next::munge!(let crate::wire::AddApplicationActivityDependencyError { value } = out);
743 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
744 AddApplicationActivityDependencyError::AlreadyExists => 1,
745
746 AddApplicationActivityDependencyError::Invalid => 2,
747
748 AddApplicationActivityDependencyError::Internal => 3,
749
750 AddApplicationActivityDependencyError::UnknownOrdinal_(value) => value,
751 }));
752
753 Ok(())
754 }
755 }
756
757 impl ::core::convert::From<crate::wire::AddApplicationActivityDependencyError>
758 for AddApplicationActivityDependencyError
759 {
760 fn from(wire: crate::wire::AddApplicationActivityDependencyError) -> Self {
761 match u32::from(wire.value) {
762 1 => Self::AlreadyExists,
763
764 2 => Self::Invalid,
765
766 3 => Self::Internal,
767
768 value => Self::UnknownOrdinal_(value),
769 }
770 }
771 }
772
773 impl ::fidl_next::FromWire<crate::wire::AddApplicationActivityDependencyError>
774 for AddApplicationActivityDependencyError
775 {
776 #[inline]
777 fn from_wire(wire: crate::wire::AddApplicationActivityDependencyError) -> Self {
778 Self::from(wire)
779 }
780 }
781
782 impl ::fidl_next::FromWireRef<crate::wire::AddApplicationActivityDependencyError>
783 for AddApplicationActivityDependencyError
784 {
785 #[inline]
786 fn from_wire_ref(wire: &crate::wire::AddApplicationActivityDependencyError) -> Self {
787 Self::from(*wire)
788 }
789 }
790
791 #[doc = " Error codes for responses from `AddExecutionStateDependency` in\n [`fuchsia.power.system/CpuElementManager`].\n"]
792 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
793 #[repr(u32)]
794 pub enum AddExecutionStateDependencyError {
795 InvalidArgs = 1,
796 BadState = 2,
797 UnknownOrdinal_(u32) = 3,
798 }
799 impl ::std::convert::From<u32> for AddExecutionStateDependencyError {
800 fn from(value: u32) -> Self {
801 match value {
802 1 => Self::InvalidArgs,
803 2 => Self::BadState,
804
805 _ => Self::UnknownOrdinal_(value),
806 }
807 }
808 }
809
810 unsafe impl<___E> ::fidl_next::Encode<crate::wire::AddExecutionStateDependencyError, ___E>
811 for AddExecutionStateDependencyError
812 where
813 ___E: ?Sized,
814 {
815 #[inline]
816 fn encode(
817 self,
818 encoder: &mut ___E,
819 out: &mut ::core::mem::MaybeUninit<crate::wire::AddExecutionStateDependencyError>,
820 _: (),
821 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
822 ::fidl_next::Encode::encode(&self, encoder, out, ())
823 }
824 }
825
826 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::AddExecutionStateDependencyError, ___E>
827 for &'a AddExecutionStateDependencyError
828 where
829 ___E: ?Sized,
830 {
831 #[inline]
832 fn encode(
833 self,
834 encoder: &mut ___E,
835 out: &mut ::core::mem::MaybeUninit<crate::wire::AddExecutionStateDependencyError>,
836 _: (),
837 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
838 ::fidl_next::munge!(let crate::wire::AddExecutionStateDependencyError { value } = out);
839 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
840 AddExecutionStateDependencyError::InvalidArgs => 1,
841
842 AddExecutionStateDependencyError::BadState => 2,
843
844 AddExecutionStateDependencyError::UnknownOrdinal_(value) => value,
845 }));
846
847 Ok(())
848 }
849 }
850
851 impl ::core::convert::From<crate::wire::AddExecutionStateDependencyError>
852 for AddExecutionStateDependencyError
853 {
854 fn from(wire: crate::wire::AddExecutionStateDependencyError) -> Self {
855 match u32::from(wire.value) {
856 1 => Self::InvalidArgs,
857
858 2 => Self::BadState,
859
860 value => Self::UnknownOrdinal_(value),
861 }
862 }
863 }
864
865 impl ::fidl_next::FromWire<crate::wire::AddExecutionStateDependencyError>
866 for AddExecutionStateDependencyError
867 {
868 #[inline]
869 fn from_wire(wire: crate::wire::AddExecutionStateDependencyError) -> Self {
870 Self::from(wire)
871 }
872 }
873
874 impl ::fidl_next::FromWireRef<crate::wire::AddExecutionStateDependencyError>
875 for AddExecutionStateDependencyError
876 {
877 #[inline]
878 fn from_wire_ref(wire: &crate::wire::AddExecutionStateDependencyError) -> Self {
879 Self::from(*wire)
880 }
881 }
882
883 #[doc = " Application activity power levels\n\n Elements that need to keep the system from suspending should take an assertive\n dependency on `ApplicationActivityLevel::ACTIVE`. When these components are\n performing work, they should request a lease to ensure the system remains\n active, and drop the lease when they are done.\n"]
884 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
885 #[repr(u8)]
886 pub enum ApplicationActivityLevel {
887 Inactive = 0,
888 Active = 1,
889 UnknownOrdinal_(u8) = 2,
890 }
891 impl ::std::convert::From<u8> for ApplicationActivityLevel {
892 fn from(value: u8) -> Self {
893 match value {
894 0 => Self::Inactive,
895 1 => Self::Active,
896
897 _ => Self::UnknownOrdinal_(value),
898 }
899 }
900 }
901
902 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ApplicationActivityLevel, ___E>
903 for ApplicationActivityLevel
904 where
905 ___E: ?Sized,
906 {
907 #[inline]
908 fn encode(
909 self,
910 encoder: &mut ___E,
911 out: &mut ::core::mem::MaybeUninit<crate::wire::ApplicationActivityLevel>,
912 _: (),
913 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
914 ::fidl_next::Encode::encode(&self, encoder, out, ())
915 }
916 }
917
918 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ApplicationActivityLevel, ___E>
919 for &'a ApplicationActivityLevel
920 where
921 ___E: ?Sized,
922 {
923 #[inline]
924 fn encode(
925 self,
926 encoder: &mut ___E,
927 out: &mut ::core::mem::MaybeUninit<crate::wire::ApplicationActivityLevel>,
928 _: (),
929 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
930 ::fidl_next::munge!(let crate::wire::ApplicationActivityLevel { value } = out);
931 let _ = value.write(u8::from(match *self {
932 ApplicationActivityLevel::Inactive => 0,
933
934 ApplicationActivityLevel::Active => 1,
935
936 ApplicationActivityLevel::UnknownOrdinal_(value) => value,
937 }));
938
939 Ok(())
940 }
941 }
942
943 impl ::core::convert::From<crate::wire::ApplicationActivityLevel> for ApplicationActivityLevel {
944 fn from(wire: crate::wire::ApplicationActivityLevel) -> Self {
945 match u8::from(wire.value) {
946 0 => Self::Inactive,
947
948 1 => Self::Active,
949
950 value => Self::UnknownOrdinal_(value),
951 }
952 }
953 }
954
955 impl ::fidl_next::FromWire<crate::wire::ApplicationActivityLevel> for ApplicationActivityLevel {
956 #[inline]
957 fn from_wire(wire: crate::wire::ApplicationActivityLevel) -> Self {
958 Self::from(wire)
959 }
960 }
961
962 impl ::fidl_next::FromWireRef<crate::wire::ApplicationActivityLevel> for ApplicationActivityLevel {
963 #[inline]
964 fn from_wire_ref(wire: &crate::wire::ApplicationActivityLevel) -> Self {
965 Self::from(*wire)
966 }
967 }
968
969 pub type BootControlSetBootCompleteResponse = ();
970
971 pub type CpuElementManagerAddExecutionStateDependencyResponse = ();
972
973 #[doc = " CPU power levels\n\n Elements should take an assertive dependency on `CpuLevel::ACTIVE`\n to ensure that the element will be suspended before the CPU suspends.\n"]
974 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
975 #[repr(u8)]
976 pub enum CpuLevel {
977 Inactive = 0,
978 Active = 1,
979 UnknownOrdinal_(u8) = 2,
980 }
981 impl ::std::convert::From<u8> for CpuLevel {
982 fn from(value: u8) -> Self {
983 match value {
984 0 => Self::Inactive,
985 1 => Self::Active,
986
987 _ => Self::UnknownOrdinal_(value),
988 }
989 }
990 }
991
992 unsafe impl<___E> ::fidl_next::Encode<crate::wire::CpuLevel, ___E> for CpuLevel
993 where
994 ___E: ?Sized,
995 {
996 #[inline]
997 fn encode(
998 self,
999 encoder: &mut ___E,
1000 out: &mut ::core::mem::MaybeUninit<crate::wire::CpuLevel>,
1001 _: (),
1002 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1003 ::fidl_next::Encode::encode(&self, encoder, out, ())
1004 }
1005 }
1006
1007 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::CpuLevel, ___E> for &'a CpuLevel
1008 where
1009 ___E: ?Sized,
1010 {
1011 #[inline]
1012 fn encode(
1013 self,
1014 encoder: &mut ___E,
1015 out: &mut ::core::mem::MaybeUninit<crate::wire::CpuLevel>,
1016 _: (),
1017 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1018 ::fidl_next::munge!(let crate::wire::CpuLevel { value } = out);
1019 let _ = value.write(u8::from(match *self {
1020 CpuLevel::Inactive => 0,
1021
1022 CpuLevel::Active => 1,
1023
1024 CpuLevel::UnknownOrdinal_(value) => value,
1025 }));
1026
1027 Ok(())
1028 }
1029 }
1030
1031 impl ::core::convert::From<crate::wire::CpuLevel> for CpuLevel {
1032 fn from(wire: crate::wire::CpuLevel) -> Self {
1033 match u8::from(wire.value) {
1034 0 => Self::Inactive,
1035
1036 1 => Self::Active,
1037
1038 value => Self::UnknownOrdinal_(value),
1039 }
1040 }
1041 }
1042
1043 impl ::fidl_next::FromWire<crate::wire::CpuLevel> for CpuLevel {
1044 #[inline]
1045 fn from_wire(wire: crate::wire::CpuLevel) -> Self {
1046 Self::from(wire)
1047 }
1048 }
1049
1050 impl ::fidl_next::FromWireRef<crate::wire::CpuLevel> for CpuLevel {
1051 #[inline]
1052 fn from_wire_ref(wire: &crate::wire::CpuLevel) -> Self {
1053 Self::from(*wire)
1054 }
1055 }
1056
1057 #[doc = " Execution state power levels\n\n Elements should take an opportunistic dependency on `ExecutionStateLevel::ACTIVE`\n to ensure that the element will be suspended when the rest of the system\n suspends.\n\n Drivers can take an opportunistic dependency on either\n `ExecutionStateLevel::SUSPENDING` or `ExecutionStateLevel::ACTIVE` and\n request a persistent lease on this state to ensure that their element\'s\n power level is always activated when the system comes out of a suspend\n state.\n"]
1058 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1059 #[repr(u8)]
1060 pub enum ExecutionStateLevel {
1061 Inactive = 0,
1062 Suspending = 1,
1063 Active = 2,
1064 UnknownOrdinal_(u8) = 3,
1065 }
1066 impl ::std::convert::From<u8> for ExecutionStateLevel {
1067 fn from(value: u8) -> Self {
1068 match value {
1069 0 => Self::Inactive,
1070 1 => Self::Suspending,
1071 2 => Self::Active,
1072
1073 _ => Self::UnknownOrdinal_(value),
1074 }
1075 }
1076 }
1077
1078 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExecutionStateLevel, ___E>
1079 for ExecutionStateLevel
1080 where
1081 ___E: ?Sized,
1082 {
1083 #[inline]
1084 fn encode(
1085 self,
1086 encoder: &mut ___E,
1087 out: &mut ::core::mem::MaybeUninit<crate::wire::ExecutionStateLevel>,
1088 _: (),
1089 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1090 ::fidl_next::Encode::encode(&self, encoder, out, ())
1091 }
1092 }
1093
1094 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExecutionStateLevel, ___E>
1095 for &'a ExecutionStateLevel
1096 where
1097 ___E: ?Sized,
1098 {
1099 #[inline]
1100 fn encode(
1101 self,
1102 encoder: &mut ___E,
1103 out: &mut ::core::mem::MaybeUninit<crate::wire::ExecutionStateLevel>,
1104 _: (),
1105 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1106 ::fidl_next::munge!(let crate::wire::ExecutionStateLevel { value } = out);
1107 let _ = value.write(u8::from(match *self {
1108 ExecutionStateLevel::Inactive => 0,
1109
1110 ExecutionStateLevel::Suspending => 1,
1111
1112 ExecutionStateLevel::Active => 2,
1113
1114 ExecutionStateLevel::UnknownOrdinal_(value) => value,
1115 }));
1116
1117 Ok(())
1118 }
1119 }
1120
1121 impl ::core::convert::From<crate::wire::ExecutionStateLevel> for ExecutionStateLevel {
1122 fn from(wire: crate::wire::ExecutionStateLevel) -> Self {
1123 match u8::from(wire.value) {
1124 0 => Self::Inactive,
1125
1126 1 => Self::Suspending,
1127
1128 2 => Self::Active,
1129
1130 value => Self::UnknownOrdinal_(value),
1131 }
1132 }
1133 }
1134
1135 impl ::fidl_next::FromWire<crate::wire::ExecutionStateLevel> for ExecutionStateLevel {
1136 #[inline]
1137 fn from_wire(wire: crate::wire::ExecutionStateLevel) -> Self {
1138 Self::from(wire)
1139 }
1140 }
1141
1142 impl ::fidl_next::FromWireRef<crate::wire::ExecutionStateLevel> for ExecutionStateLevel {
1143 #[inline]
1144 fn from_wire_ref(wire: &crate::wire::ExecutionStateLevel) -> Self {
1145 Self::from(*wire)
1146 }
1147 }
1148
1149 pub type ExecutionStateManagerAddApplicationActivityDependencyResponse = ();
1150
1151 pub type SuspendBlockerBeforeSuspendResponse = ();
1152
1153 pub type SuspendBlockerAfterResumeResponse = ();
1154}
1155
1156pub mod wire {
1157
1158 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1160 #[repr(transparent)]
1161 pub struct AcquireWakeLeaseError {
1162 pub(crate) value: ::fidl_next::wire::Uint32,
1163 }
1164
1165 impl ::fidl_next::Constrained for AcquireWakeLeaseError {
1166 type Constraint = ();
1167
1168 fn validate(
1169 _: ::fidl_next::Slot<'_, Self>,
1170 _: Self::Constraint,
1171 ) -> Result<(), ::fidl_next::ValidationError> {
1172 Ok(())
1173 }
1174 }
1175
1176 unsafe impl ::fidl_next::Wire for AcquireWakeLeaseError {
1177 type Narrowed<'de> = Self;
1178
1179 #[inline]
1180 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1181 }
1183 }
1184
1185 impl AcquireWakeLeaseError {
1186 pub const INTERNAL: AcquireWakeLeaseError =
1187 AcquireWakeLeaseError { value: ::fidl_next::wire::Uint32(1) };
1188
1189 pub const INVALID_NAME: AcquireWakeLeaseError =
1190 AcquireWakeLeaseError { value: ::fidl_next::wire::Uint32(2) };
1191 }
1192
1193 unsafe impl<___D> ::fidl_next::Decode<___D> for AcquireWakeLeaseError
1194 where
1195 ___D: ?Sized,
1196 {
1197 fn decode(
1198 slot: ::fidl_next::Slot<'_, Self>,
1199 _: &mut ___D,
1200 _: (),
1201 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1202 Ok(())
1203 }
1204 }
1205
1206 impl ::core::convert::From<crate::natural::AcquireWakeLeaseError> for AcquireWakeLeaseError {
1207 fn from(natural: crate::natural::AcquireWakeLeaseError) -> Self {
1208 match natural {
1209 crate::natural::AcquireWakeLeaseError::Internal => AcquireWakeLeaseError::INTERNAL,
1210
1211 crate::natural::AcquireWakeLeaseError::InvalidName => {
1212 AcquireWakeLeaseError::INVALID_NAME
1213 }
1214
1215 crate::natural::AcquireWakeLeaseError::UnknownOrdinal_(value) => {
1216 AcquireWakeLeaseError { value: ::fidl_next::wire::Uint32::from(value) }
1217 }
1218 }
1219 }
1220 }
1221
1222 impl ::fidl_next::IntoNatural for AcquireWakeLeaseError {
1223 type Natural = crate::natural::AcquireWakeLeaseError;
1224 }
1225
1226 #[derive(Debug)]
1228 #[repr(C)]
1229 pub struct ActivityGovernorAcquireWakeLeaseRequest<'de> {
1230 pub name: ::fidl_next::wire::String<'de>,
1231 }
1232
1233 static_assertions::const_assert_eq!(
1234 std::mem::size_of::<ActivityGovernorAcquireWakeLeaseRequest<'_>>(),
1235 16
1236 );
1237 static_assertions::const_assert_eq!(
1238 std::mem::align_of::<ActivityGovernorAcquireWakeLeaseRequest<'_>>(),
1239 8
1240 );
1241
1242 static_assertions::const_assert_eq!(
1243 std::mem::offset_of!(ActivityGovernorAcquireWakeLeaseRequest<'_>, name),
1244 0
1245 );
1246
1247 impl ::fidl_next::Constrained for ActivityGovernorAcquireWakeLeaseRequest<'_> {
1248 type Constraint = ();
1249
1250 fn validate(
1251 _: ::fidl_next::Slot<'_, Self>,
1252 _: Self::Constraint,
1253 ) -> Result<(), ::fidl_next::ValidationError> {
1254 Ok(())
1255 }
1256 }
1257
1258 unsafe impl ::fidl_next::Wire for ActivityGovernorAcquireWakeLeaseRequest<'static> {
1259 type Narrowed<'de> = ActivityGovernorAcquireWakeLeaseRequest<'de>;
1260
1261 #[inline]
1262 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1263 ::fidl_next::munge! {
1264 let Self {
1265 name,
1266
1267 } = &mut *out_;
1268 }
1269
1270 ::fidl_next::Wire::zero_padding(name);
1271 }
1272 }
1273
1274 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ActivityGovernorAcquireWakeLeaseRequest<'de>
1275 where
1276 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1277 ___D: ::fidl_next::Decoder<'de>,
1278 {
1279 fn decode(
1280 slot_: ::fidl_next::Slot<'_, Self>,
1281 decoder_: &mut ___D,
1282 _: (),
1283 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1284 ::fidl_next::munge! {
1285 let Self {
1286 mut name,
1287
1288 } = slot_;
1289 }
1290
1291 let _field = name.as_mut();
1292 ::fidl_next::Constrained::validate(_field, 64)?;
1293 ::fidl_next::Decode::decode(name.as_mut(), decoder_, 64)?;
1294
1295 let name = unsafe { name.deref_unchecked() };
1296
1297 if name.len() > 64 {
1298 return Err(::fidl_next::DecodeError::VectorTooLong {
1299 size: name.len() as u64,
1300 limit: 64,
1301 });
1302 }
1303
1304 Ok(())
1305 }
1306 }
1307
1308 impl<'de> ::fidl_next::IntoNatural for ActivityGovernorAcquireWakeLeaseRequest<'de> {
1309 type Natural = crate::natural::ActivityGovernorAcquireWakeLeaseRequest;
1310 }
1311
1312 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1314 #[repr(transparent)]
1315 pub struct RegisterSuspendBlockerError {
1316 pub(crate) value: ::fidl_next::wire::Uint32,
1317 }
1318
1319 impl ::fidl_next::Constrained for RegisterSuspendBlockerError {
1320 type Constraint = ();
1321
1322 fn validate(
1323 _: ::fidl_next::Slot<'_, Self>,
1324 _: Self::Constraint,
1325 ) -> Result<(), ::fidl_next::ValidationError> {
1326 Ok(())
1327 }
1328 }
1329
1330 unsafe impl ::fidl_next::Wire for RegisterSuspendBlockerError {
1331 type Narrowed<'de> = Self;
1332
1333 #[inline]
1334 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1335 }
1337 }
1338
1339 impl RegisterSuspendBlockerError {
1340 pub const INTERNAL: RegisterSuspendBlockerError =
1341 RegisterSuspendBlockerError { value: ::fidl_next::wire::Uint32(1) };
1342
1343 pub const INVALID_ARGS: RegisterSuspendBlockerError =
1344 RegisterSuspendBlockerError { value: ::fidl_next::wire::Uint32(2) };
1345 }
1346
1347 unsafe impl<___D> ::fidl_next::Decode<___D> for RegisterSuspendBlockerError
1348 where
1349 ___D: ?Sized,
1350 {
1351 fn decode(
1352 slot: ::fidl_next::Slot<'_, Self>,
1353 _: &mut ___D,
1354 _: (),
1355 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1356 Ok(())
1357 }
1358 }
1359
1360 impl ::core::convert::From<crate::natural::RegisterSuspendBlockerError>
1361 for RegisterSuspendBlockerError
1362 {
1363 fn from(natural: crate::natural::RegisterSuspendBlockerError) -> Self {
1364 match natural {
1365 crate::natural::RegisterSuspendBlockerError::Internal => {
1366 RegisterSuspendBlockerError::INTERNAL
1367 }
1368
1369 crate::natural::RegisterSuspendBlockerError::InvalidArgs => {
1370 RegisterSuspendBlockerError::INVALID_ARGS
1371 }
1372
1373 crate::natural::RegisterSuspendBlockerError::UnknownOrdinal_(value) => {
1374 RegisterSuspendBlockerError { value: ::fidl_next::wire::Uint32::from(value) }
1375 }
1376 }
1377 }
1378 }
1379
1380 impl ::fidl_next::IntoNatural for RegisterSuspendBlockerError {
1381 type Natural = crate::natural::RegisterSuspendBlockerError;
1382 }
1383
1384 #[derive(Debug)]
1386 #[repr(C)]
1387 pub struct ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'de> {
1388 pub name: ::fidl_next::wire::String<'de>,
1389 }
1390
1391 static_assertions::const_assert_eq!(
1392 std::mem::size_of::<ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'_>>(),
1393 16
1394 );
1395 static_assertions::const_assert_eq!(
1396 std::mem::align_of::<ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'_>>(),
1397 8
1398 );
1399
1400 static_assertions::const_assert_eq!(
1401 std::mem::offset_of!(ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'_>, name),
1402 0
1403 );
1404
1405 impl ::fidl_next::Constrained for ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'_> {
1406 type Constraint = ();
1407
1408 fn validate(
1409 _: ::fidl_next::Slot<'_, Self>,
1410 _: Self::Constraint,
1411 ) -> Result<(), ::fidl_next::ValidationError> {
1412 Ok(())
1413 }
1414 }
1415
1416 unsafe impl ::fidl_next::Wire for ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'static> {
1417 type Narrowed<'de> = ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'de>;
1418
1419 #[inline]
1420 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1421 ::fidl_next::munge! {
1422 let Self {
1423 name,
1424
1425 } = &mut *out_;
1426 }
1427
1428 ::fidl_next::Wire::zero_padding(name);
1429 }
1430 }
1431
1432 unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
1433 for ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'de>
1434 where
1435 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1436 ___D: ::fidl_next::Decoder<'de>,
1437 {
1438 fn decode(
1439 slot_: ::fidl_next::Slot<'_, Self>,
1440 decoder_: &mut ___D,
1441 _: (),
1442 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1443 ::fidl_next::munge! {
1444 let Self {
1445 mut name,
1446
1447 } = slot_;
1448 }
1449
1450 let _field = name.as_mut();
1451 ::fidl_next::Constrained::validate(_field, 64)?;
1452 ::fidl_next::Decode::decode(name.as_mut(), decoder_, 64)?;
1453
1454 let name = unsafe { name.deref_unchecked() };
1455
1456 if name.len() > 64 {
1457 return Err(::fidl_next::DecodeError::VectorTooLong {
1458 size: name.len() as u64,
1459 limit: 64,
1460 });
1461 }
1462
1463 Ok(())
1464 }
1465 }
1466
1467 impl<'de> ::fidl_next::IntoNatural for ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'de> {
1468 type Natural = crate::natural::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest;
1469 }
1470
1471 pub type ActivityGovernorAcquireWakeLeaseWithTokenResponse = ::fidl_next::wire::Unit;
1473
1474 #[derive(Debug)]
1476 #[repr(C)]
1477 pub struct ActivityGovernorTakeApplicationActivityLeaseRequest<'de> {
1478 pub name: ::fidl_next::wire::String<'de>,
1479 }
1480
1481 static_assertions::const_assert_eq!(
1482 std::mem::size_of::<ActivityGovernorTakeApplicationActivityLeaseRequest<'_>>(),
1483 16
1484 );
1485 static_assertions::const_assert_eq!(
1486 std::mem::align_of::<ActivityGovernorTakeApplicationActivityLeaseRequest<'_>>(),
1487 8
1488 );
1489
1490 static_assertions::const_assert_eq!(
1491 std::mem::offset_of!(ActivityGovernorTakeApplicationActivityLeaseRequest<'_>, name),
1492 0
1493 );
1494
1495 impl ::fidl_next::Constrained for ActivityGovernorTakeApplicationActivityLeaseRequest<'_> {
1496 type Constraint = ();
1497
1498 fn validate(
1499 _: ::fidl_next::Slot<'_, Self>,
1500 _: Self::Constraint,
1501 ) -> Result<(), ::fidl_next::ValidationError> {
1502 Ok(())
1503 }
1504 }
1505
1506 unsafe impl ::fidl_next::Wire for ActivityGovernorTakeApplicationActivityLeaseRequest<'static> {
1507 type Narrowed<'de> = ActivityGovernorTakeApplicationActivityLeaseRequest<'de>;
1508
1509 #[inline]
1510 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1511 ::fidl_next::munge! {
1512 let Self {
1513 name,
1514
1515 } = &mut *out_;
1516 }
1517
1518 ::fidl_next::Wire::zero_padding(name);
1519 }
1520 }
1521
1522 unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
1523 for ActivityGovernorTakeApplicationActivityLeaseRequest<'de>
1524 where
1525 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1526 ___D: ::fidl_next::Decoder<'de>,
1527 {
1528 fn decode(
1529 slot_: ::fidl_next::Slot<'_, Self>,
1530 decoder_: &mut ___D,
1531 _: (),
1532 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1533 ::fidl_next::munge! {
1534 let Self {
1535 mut name,
1536
1537 } = slot_;
1538 }
1539
1540 let _field = name.as_mut();
1541 ::fidl_next::Constrained::validate(_field, 64)?;
1542 ::fidl_next::Decode::decode(name.as_mut(), decoder_, 64)?;
1543
1544 let name = unsafe { name.deref_unchecked() };
1545
1546 if name.len() > 64 {
1547 return Err(::fidl_next::DecodeError::VectorTooLong {
1548 size: name.len() as u64,
1549 limit: 64,
1550 });
1551 }
1552
1553 Ok(())
1554 }
1555 }
1556
1557 impl<'de> ::fidl_next::IntoNatural for ActivityGovernorTakeApplicationActivityLeaseRequest<'de> {
1558 type Natural = crate::natural::ActivityGovernorTakeApplicationActivityLeaseRequest;
1559 }
1560
1561 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1563 #[repr(transparent)]
1564 pub struct AddApplicationActivityDependencyError {
1565 pub(crate) value: ::fidl_next::wire::Uint32,
1566 }
1567
1568 impl ::fidl_next::Constrained for AddApplicationActivityDependencyError {
1569 type Constraint = ();
1570
1571 fn validate(
1572 _: ::fidl_next::Slot<'_, Self>,
1573 _: Self::Constraint,
1574 ) -> Result<(), ::fidl_next::ValidationError> {
1575 Ok(())
1576 }
1577 }
1578
1579 unsafe impl ::fidl_next::Wire for AddApplicationActivityDependencyError {
1580 type Narrowed<'de> = Self;
1581
1582 #[inline]
1583 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1584 }
1586 }
1587
1588 impl AddApplicationActivityDependencyError {
1589 pub const ALREADY_EXISTS: AddApplicationActivityDependencyError =
1590 AddApplicationActivityDependencyError { value: ::fidl_next::wire::Uint32(1) };
1591
1592 pub const INVALID: AddApplicationActivityDependencyError =
1593 AddApplicationActivityDependencyError { value: ::fidl_next::wire::Uint32(2) };
1594
1595 pub const INTERNAL: AddApplicationActivityDependencyError =
1596 AddApplicationActivityDependencyError { value: ::fidl_next::wire::Uint32(3) };
1597 }
1598
1599 unsafe impl<___D> ::fidl_next::Decode<___D> for AddApplicationActivityDependencyError
1600 where
1601 ___D: ?Sized,
1602 {
1603 fn decode(
1604 slot: ::fidl_next::Slot<'_, Self>,
1605 _: &mut ___D,
1606 _: (),
1607 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1608 Ok(())
1609 }
1610 }
1611
1612 impl ::core::convert::From<crate::natural::AddApplicationActivityDependencyError>
1613 for AddApplicationActivityDependencyError
1614 {
1615 fn from(natural: crate::natural::AddApplicationActivityDependencyError) -> Self {
1616 match natural {
1617 crate::natural::AddApplicationActivityDependencyError::AlreadyExists => {
1618 AddApplicationActivityDependencyError::ALREADY_EXISTS
1619 }
1620
1621 crate::natural::AddApplicationActivityDependencyError::Invalid => {
1622 AddApplicationActivityDependencyError::INVALID
1623 }
1624
1625 crate::natural::AddApplicationActivityDependencyError::Internal => {
1626 AddApplicationActivityDependencyError::INTERNAL
1627 }
1628
1629 crate::natural::AddApplicationActivityDependencyError::UnknownOrdinal_(value) => {
1630 AddApplicationActivityDependencyError {
1631 value: ::fidl_next::wire::Uint32::from(value),
1632 }
1633 }
1634 }
1635 }
1636 }
1637
1638 impl ::fidl_next::IntoNatural for AddApplicationActivityDependencyError {
1639 type Natural = crate::natural::AddApplicationActivityDependencyError;
1640 }
1641
1642 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1644 #[repr(transparent)]
1645 pub struct AddExecutionStateDependencyError {
1646 pub(crate) value: ::fidl_next::wire::Uint32,
1647 }
1648
1649 impl ::fidl_next::Constrained for AddExecutionStateDependencyError {
1650 type Constraint = ();
1651
1652 fn validate(
1653 _: ::fidl_next::Slot<'_, Self>,
1654 _: Self::Constraint,
1655 ) -> Result<(), ::fidl_next::ValidationError> {
1656 Ok(())
1657 }
1658 }
1659
1660 unsafe impl ::fidl_next::Wire for AddExecutionStateDependencyError {
1661 type Narrowed<'de> = Self;
1662
1663 #[inline]
1664 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1665 }
1667 }
1668
1669 impl AddExecutionStateDependencyError {
1670 pub const INVALID_ARGS: AddExecutionStateDependencyError =
1671 AddExecutionStateDependencyError { value: ::fidl_next::wire::Uint32(1) };
1672
1673 pub const BAD_STATE: AddExecutionStateDependencyError =
1674 AddExecutionStateDependencyError { value: ::fidl_next::wire::Uint32(2) };
1675 }
1676
1677 unsafe impl<___D> ::fidl_next::Decode<___D> for AddExecutionStateDependencyError
1678 where
1679 ___D: ?Sized,
1680 {
1681 fn decode(
1682 slot: ::fidl_next::Slot<'_, Self>,
1683 _: &mut ___D,
1684 _: (),
1685 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1686 Ok(())
1687 }
1688 }
1689
1690 impl ::core::convert::From<crate::natural::AddExecutionStateDependencyError>
1691 for AddExecutionStateDependencyError
1692 {
1693 fn from(natural: crate::natural::AddExecutionStateDependencyError) -> Self {
1694 match natural {
1695 crate::natural::AddExecutionStateDependencyError::InvalidArgs => {
1696 AddExecutionStateDependencyError::INVALID_ARGS
1697 }
1698
1699 crate::natural::AddExecutionStateDependencyError::BadState => {
1700 AddExecutionStateDependencyError::BAD_STATE
1701 }
1702
1703 crate::natural::AddExecutionStateDependencyError::UnknownOrdinal_(value) => {
1704 AddExecutionStateDependencyError {
1705 value: ::fidl_next::wire::Uint32::from(value),
1706 }
1707 }
1708 }
1709 }
1710 }
1711
1712 impl ::fidl_next::IntoNatural for AddExecutionStateDependencyError {
1713 type Natural = crate::natural::AddExecutionStateDependencyError;
1714 }
1715
1716 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1718 #[repr(transparent)]
1719 pub struct ApplicationActivityLevel {
1720 pub(crate) value: u8,
1721 }
1722
1723 impl ::fidl_next::Constrained for ApplicationActivityLevel {
1724 type Constraint = ();
1725
1726 fn validate(
1727 _: ::fidl_next::Slot<'_, Self>,
1728 _: Self::Constraint,
1729 ) -> Result<(), ::fidl_next::ValidationError> {
1730 Ok(())
1731 }
1732 }
1733
1734 unsafe impl ::fidl_next::Wire for ApplicationActivityLevel {
1735 type Narrowed<'de> = Self;
1736
1737 #[inline]
1738 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1739 }
1741 }
1742
1743 impl ApplicationActivityLevel {
1744 pub const INACTIVE: ApplicationActivityLevel = ApplicationActivityLevel { value: 0 };
1745
1746 pub const ACTIVE: ApplicationActivityLevel = ApplicationActivityLevel { value: 1 };
1747 }
1748
1749 unsafe impl<___D> ::fidl_next::Decode<___D> for ApplicationActivityLevel
1750 where
1751 ___D: ?Sized,
1752 {
1753 fn decode(
1754 slot: ::fidl_next::Slot<'_, Self>,
1755 _: &mut ___D,
1756 _: (),
1757 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1758 Ok(())
1759 }
1760 }
1761
1762 impl ::core::convert::From<crate::natural::ApplicationActivityLevel> for ApplicationActivityLevel {
1763 fn from(natural: crate::natural::ApplicationActivityLevel) -> Self {
1764 match natural {
1765 crate::natural::ApplicationActivityLevel::Inactive => {
1766 ApplicationActivityLevel::INACTIVE
1767 }
1768
1769 crate::natural::ApplicationActivityLevel::Active => {
1770 ApplicationActivityLevel::ACTIVE
1771 }
1772
1773 crate::natural::ApplicationActivityLevel::UnknownOrdinal_(value) => {
1774 ApplicationActivityLevel { value: u8::from(value) }
1775 }
1776 }
1777 }
1778 }
1779
1780 impl ::fidl_next::IntoNatural for ApplicationActivityLevel {
1781 type Natural = crate::natural::ApplicationActivityLevel;
1782 }
1783
1784 pub type BootControlSetBootCompleteResponse = ::fidl_next::wire::Unit;
1786
1787 pub type CpuElementManagerAddExecutionStateDependencyResponse = ::fidl_next::wire::Unit;
1789
1790 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1792 #[repr(transparent)]
1793 pub struct CpuLevel {
1794 pub(crate) value: u8,
1795 }
1796
1797 impl ::fidl_next::Constrained for CpuLevel {
1798 type Constraint = ();
1799
1800 fn validate(
1801 _: ::fidl_next::Slot<'_, Self>,
1802 _: Self::Constraint,
1803 ) -> Result<(), ::fidl_next::ValidationError> {
1804 Ok(())
1805 }
1806 }
1807
1808 unsafe impl ::fidl_next::Wire for CpuLevel {
1809 type Narrowed<'de> = Self;
1810
1811 #[inline]
1812 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1813 }
1815 }
1816
1817 impl CpuLevel {
1818 pub const INACTIVE: CpuLevel = CpuLevel { value: 0 };
1819
1820 pub const ACTIVE: CpuLevel = CpuLevel { value: 1 };
1821 }
1822
1823 unsafe impl<___D> ::fidl_next::Decode<___D> for CpuLevel
1824 where
1825 ___D: ?Sized,
1826 {
1827 fn decode(
1828 slot: ::fidl_next::Slot<'_, Self>,
1829 _: &mut ___D,
1830 _: (),
1831 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1832 Ok(())
1833 }
1834 }
1835
1836 impl ::core::convert::From<crate::natural::CpuLevel> for CpuLevel {
1837 fn from(natural: crate::natural::CpuLevel) -> Self {
1838 match natural {
1839 crate::natural::CpuLevel::Inactive => CpuLevel::INACTIVE,
1840
1841 crate::natural::CpuLevel::Active => CpuLevel::ACTIVE,
1842
1843 crate::natural::CpuLevel::UnknownOrdinal_(value) => {
1844 CpuLevel { value: u8::from(value) }
1845 }
1846 }
1847 }
1848 }
1849
1850 impl ::fidl_next::IntoNatural for CpuLevel {
1851 type Natural = crate::natural::CpuLevel;
1852 }
1853
1854 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1856 #[repr(transparent)]
1857 pub struct ExecutionStateLevel {
1858 pub(crate) value: u8,
1859 }
1860
1861 impl ::fidl_next::Constrained for ExecutionStateLevel {
1862 type Constraint = ();
1863
1864 fn validate(
1865 _: ::fidl_next::Slot<'_, Self>,
1866 _: Self::Constraint,
1867 ) -> Result<(), ::fidl_next::ValidationError> {
1868 Ok(())
1869 }
1870 }
1871
1872 unsafe impl ::fidl_next::Wire for ExecutionStateLevel {
1873 type Narrowed<'de> = Self;
1874
1875 #[inline]
1876 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1877 }
1879 }
1880
1881 impl ExecutionStateLevel {
1882 pub const INACTIVE: ExecutionStateLevel = ExecutionStateLevel { value: 0 };
1883
1884 pub const SUSPENDING: ExecutionStateLevel = ExecutionStateLevel { value: 1 };
1885
1886 pub const ACTIVE: ExecutionStateLevel = ExecutionStateLevel { value: 2 };
1887 }
1888
1889 unsafe impl<___D> ::fidl_next::Decode<___D> for ExecutionStateLevel
1890 where
1891 ___D: ?Sized,
1892 {
1893 fn decode(
1894 slot: ::fidl_next::Slot<'_, Self>,
1895 _: &mut ___D,
1896 _: (),
1897 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1898 Ok(())
1899 }
1900 }
1901
1902 impl ::core::convert::From<crate::natural::ExecutionStateLevel> for ExecutionStateLevel {
1903 fn from(natural: crate::natural::ExecutionStateLevel) -> Self {
1904 match natural {
1905 crate::natural::ExecutionStateLevel::Inactive => ExecutionStateLevel::INACTIVE,
1906
1907 crate::natural::ExecutionStateLevel::Suspending => ExecutionStateLevel::SUSPENDING,
1908
1909 crate::natural::ExecutionStateLevel::Active => ExecutionStateLevel::ACTIVE,
1910
1911 crate::natural::ExecutionStateLevel::UnknownOrdinal_(value) => {
1912 ExecutionStateLevel { value: u8::from(value) }
1913 }
1914 }
1915 }
1916 }
1917
1918 impl ::fidl_next::IntoNatural for ExecutionStateLevel {
1919 type Natural = crate::natural::ExecutionStateLevel;
1920 }
1921
1922 pub type ExecutionStateManagerAddApplicationActivityDependencyResponse =
1924 ::fidl_next::wire::Unit;
1925
1926 pub type SuspendBlockerBeforeSuspendResponse = ::fidl_next::wire::Unit;
1928
1929 pub type SuspendBlockerAfterResumeResponse = ::fidl_next::wire::Unit;
1931}
1932
1933pub mod wire_optional {}
1934
1935pub mod generic {
1936
1937 pub struct ActivityGovernorAcquireWakeLeaseRequest<T0> {
1939 pub name: T0,
1940 }
1941
1942 unsafe impl<___E, T0>
1943 ::fidl_next::Encode<crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'static>, ___E>
1944 for ActivityGovernorAcquireWakeLeaseRequest<T0>
1945 where
1946 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1947 ___E: ::fidl_next::Encoder,
1948 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
1949 {
1950 #[inline]
1951 fn encode(
1952 self,
1953 encoder_: &mut ___E,
1954 out_: &mut ::core::mem::MaybeUninit<
1955 crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'static>,
1956 >,
1957 _: (),
1958 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1959 ::fidl_next::munge! {
1960 let crate::wire::ActivityGovernorAcquireWakeLeaseRequest {
1961 name,
1962
1963 } = out_;
1964 }
1965
1966 ::fidl_next::Encode::encode(self.name, encoder_, name, 64)?;
1967
1968 Ok(())
1969 }
1970 }
1971
1972 pub struct ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<T0> {
1974 pub name: T0,
1975 }
1976
1977 unsafe impl<___E, T0>
1978 ::fidl_next::Encode<
1979 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'static>,
1980 ___E,
1981 > for ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<T0>
1982 where
1983 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1984 ___E: ::fidl_next::Encoder,
1985 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
1986 {
1987 #[inline]
1988 fn encode(
1989 self,
1990 encoder_: &mut ___E,
1991 out_: &mut ::core::mem::MaybeUninit<
1992 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'static>,
1993 >,
1994 _: (),
1995 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1996 ::fidl_next::munge! {
1997 let crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest {
1998 name,
1999
2000 } = out_;
2001 }
2002
2003 ::fidl_next::Encode::encode(self.name, encoder_, name, 64)?;
2004
2005 Ok(())
2006 }
2007 }
2008
2009 pub type ActivityGovernorAcquireWakeLeaseWithTokenResponse = ();
2011
2012 pub struct ActivityGovernorTakeApplicationActivityLeaseRequest<T0> {
2014 pub name: T0,
2015 }
2016
2017 unsafe impl<___E, T0>
2018 ::fidl_next::Encode<
2019 crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'static>,
2020 ___E,
2021 > for ActivityGovernorTakeApplicationActivityLeaseRequest<T0>
2022 where
2023 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2024 ___E: ::fidl_next::Encoder,
2025 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
2026 {
2027 #[inline]
2028 fn encode(
2029 self,
2030 encoder_: &mut ___E,
2031 out_: &mut ::core::mem::MaybeUninit<
2032 crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'static>,
2033 >,
2034 _: (),
2035 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2036 ::fidl_next::munge! {
2037 let crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest {
2038 name,
2039
2040 } = out_;
2041 }
2042
2043 ::fidl_next::Encode::encode(self.name, encoder_, name, 64)?;
2044
2045 Ok(())
2046 }
2047 }
2048
2049 pub type BootControlSetBootCompleteResponse = ();
2051
2052 pub type CpuElementManagerAddExecutionStateDependencyResponse = ();
2054
2055 pub type ExecutionStateManagerAddApplicationActivityDependencyResponse = ();
2057
2058 pub type SuspendBlockerBeforeSuspendResponse = ();
2060
2061 pub type SuspendBlockerAfterResumeResponse = ();
2063}
2064
2065pub use self::natural::*;
2066
2067pub const MAX_ELEMENT_NAME_LEN: u8 = 64 as u8;
2068
2069#[doc = " A service that processes notification about the system boot state.\n"]
2071#[derive(PartialEq, Debug)]
2072pub struct BootControl;
2073
2074impl ::fidl_next::Discoverable for BootControl {
2075 const PROTOCOL_NAME: &'static str = "fuchsia.power.system.BootControl";
2076}
2077
2078#[cfg(target_os = "fuchsia")]
2079impl ::fidl_next::HasTransport for BootControl {
2080 type Transport = ::fidl_next::fuchsia::zx::Channel;
2081}
2082
2083pub mod boot_control {
2084 pub mod prelude {
2085 pub use crate::{
2086 BootControl, BootControlClientHandler, BootControlLocalClientHandler,
2087 BootControlLocalServerHandler, BootControlServerHandler, boot_control,
2088 };
2089
2090 pub use crate::natural::BootControlSetBootCompleteResponse;
2091 }
2092
2093 pub struct SetBootComplete;
2094
2095 impl ::fidl_next::Method for SetBootComplete {
2096 const ORDINAL: u64 = 4367259243539899061;
2097 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2098 ::fidl_next::protocol::Flexibility::Flexible;
2099
2100 type Protocol = crate::BootControl;
2101
2102 type Request = ::fidl_next::wire::EmptyMessageBody;
2103 }
2104
2105 impl ::fidl_next::TwoWayMethod for SetBootComplete {
2106 type Response =
2107 ::fidl_next::wire::Flexible<'static, crate::wire::BootControlSetBootCompleteResponse>;
2108 }
2109
2110 impl<___R> ::fidl_next::Respond<___R> for SetBootComplete {
2111 type Output = ::fidl_next::Flexible<___R>;
2112
2113 fn respond(response: ___R) -> Self::Output {
2114 ::fidl_next::Flexible(response)
2115 }
2116 }
2117
2118 mod ___detail {
2119 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::BootControl
2120 where
2121 ___T: ::fidl_next::Transport,
2122 {
2123 type Client = BootControlClient<___T>;
2124 type Server = BootControlServer<___T>;
2125 }
2126
2127 #[repr(transparent)]
2129 pub struct BootControlClient<___T: ::fidl_next::Transport> {
2130 #[allow(dead_code)]
2131 client: ::fidl_next::protocol::Client<___T>,
2132 }
2133
2134 impl<___T> BootControlClient<___T>
2135 where
2136 ___T: ::fidl_next::Transport,
2137 {
2138 #[doc = " Notify the SAG that the system has booted. SAG will not suspend the\n hardware platform until this method is called at least once per boot.\n"]
2139 pub fn set_boot_complete(
2140 &self,
2141 ) -> ::fidl_next::TwoWayFuture<'_, super::SetBootComplete, ___T> {
2142 ::fidl_next::TwoWayFuture::from_untyped(
2143 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
2144 4367259243539899061,
2145 <super::SetBootComplete as ::fidl_next::Method>::FLEXIBILITY,
2146 (),
2147 ),
2148 )
2149 }
2150 }
2151
2152 #[repr(transparent)]
2154 pub struct BootControlServer<___T: ::fidl_next::Transport> {
2155 server: ::fidl_next::protocol::Server<___T>,
2156 }
2157
2158 impl<___T> BootControlServer<___T> where ___T: ::fidl_next::Transport {}
2159 }
2160}
2161
2162#[diagnostic::on_unimplemented(
2163 note = "If {Self} implements the non-local BootControlClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2164)]
2165
2166pub trait BootControlLocalClientHandler<
2170 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2171 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2172>
2173{
2174 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2175 ::core::future::ready(())
2176 }
2177}
2178
2179impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for BootControl
2180where
2181 ___H: BootControlLocalClientHandler<___T>,
2182 ___T: ::fidl_next::Transport,
2183{
2184 async fn on_event(
2185 handler: &mut ___H,
2186 mut message: ::fidl_next::Message<___T>,
2187 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2188 match *message.header().ordinal {
2189 ordinal => {
2190 handler.on_unknown_interaction(ordinal).await;
2191 if ::core::matches!(
2192 message.header().flexibility(),
2193 ::fidl_next::protocol::Flexibility::Strict
2194 ) {
2195 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2196 } else {
2197 Ok(())
2198 }
2199 }
2200 }
2201 }
2202}
2203
2204#[diagnostic::on_unimplemented(
2205 note = "If {Self} implements the non-local BootControlServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2206)]
2207
2208pub trait BootControlLocalServerHandler<
2212 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2213 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2214>
2215{
2216 #[doc = " Notify the SAG that the system has booted. SAG will not suspend the\n hardware platform until this method is called at least once per boot.\n"]
2217 fn set_boot_complete(
2218 &mut self,
2219
2220 responder: ::fidl_next::Responder<boot_control::SetBootComplete, ___T>,
2221 ) -> impl ::core::future::Future<Output = ()>;
2222
2223 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2224 ::core::future::ready(())
2225 }
2226}
2227
2228impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for BootControl
2229where
2230 ___H: BootControlLocalServerHandler<___T>,
2231 ___T: ::fidl_next::Transport,
2232{
2233 async fn on_one_way(
2234 handler: &mut ___H,
2235 mut message: ::fidl_next::Message<___T>,
2236 ) -> ::core::result::Result<
2237 (),
2238 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2239 > {
2240 match *message.header().ordinal {
2241 ordinal => {
2242 handler.on_unknown_interaction(ordinal).await;
2243 if ::core::matches!(
2244 message.header().flexibility(),
2245 ::fidl_next::protocol::Flexibility::Strict
2246 ) {
2247 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2248 } else {
2249 Ok(())
2250 }
2251 }
2252 }
2253 }
2254
2255 async fn on_two_way(
2256 handler: &mut ___H,
2257 mut message: ::fidl_next::Message<___T>,
2258 responder: ::fidl_next::protocol::Responder<___T>,
2259 ) -> ::core::result::Result<
2260 (),
2261 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2262 > {
2263 match *message.header().ordinal {
2264 4367259243539899061 => {
2265 let responder = ::fidl_next::Responder::from_untyped(responder);
2266
2267 handler.set_boot_complete(responder).await;
2268 Ok(())
2269 }
2270
2271 ordinal => {
2272 handler.on_unknown_interaction(ordinal).await;
2273 if ::core::matches!(
2274 message.header().flexibility(),
2275 ::fidl_next::protocol::Flexibility::Strict
2276 ) {
2277 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2278 } else {
2279 responder
2280 .respond_framework_error(
2281 ordinal,
2282 ::fidl_next::FrameworkError::UnknownMethod,
2283 )
2284 .expect("encoding a framework error should never fail")
2285 .await?;
2286 Ok(())
2287 }
2288 }
2289 }
2290 }
2291}
2292
2293pub trait BootControlClientHandler<
2297 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2298 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2299>
2300{
2301 fn on_unknown_interaction(
2302 &mut self,
2303 ordinal: u64,
2304 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2305 ::core::future::ready(())
2306 }
2307}
2308
2309impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for BootControl
2310where
2311 ___H: BootControlClientHandler<___T> + ::core::marker::Send,
2312 ___T: ::fidl_next::Transport,
2313{
2314 async fn on_event(
2315 handler: &mut ___H,
2316 mut message: ::fidl_next::Message<___T>,
2317 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2318 match *message.header().ordinal {
2319 ordinal => {
2320 handler.on_unknown_interaction(ordinal).await;
2321 if ::core::matches!(
2322 message.header().flexibility(),
2323 ::fidl_next::protocol::Flexibility::Strict
2324 ) {
2325 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2326 } else {
2327 Ok(())
2328 }
2329 }
2330 }
2331 }
2332}
2333
2334pub trait BootControlServerHandler<
2338 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2339 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2340>
2341{
2342 #[doc = " Notify the SAG that the system has booted. SAG will not suspend the\n hardware platform until this method is called at least once per boot.\n"]
2343 fn set_boot_complete(
2344 &mut self,
2345
2346 responder: ::fidl_next::Responder<boot_control::SetBootComplete, ___T>,
2347 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2348
2349 fn on_unknown_interaction(
2350 &mut self,
2351 ordinal: u64,
2352 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2353 ::core::future::ready(())
2354 }
2355}
2356
2357impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for BootControl
2358where
2359 ___H: BootControlServerHandler<___T> + ::core::marker::Send,
2360 ___T: ::fidl_next::Transport,
2361{
2362 async fn on_one_way(
2363 handler: &mut ___H,
2364 mut message: ::fidl_next::Message<___T>,
2365 ) -> ::core::result::Result<
2366 (),
2367 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2368 > {
2369 match *message.header().ordinal {
2370 ordinal => {
2371 handler.on_unknown_interaction(ordinal).await;
2372 if ::core::matches!(
2373 message.header().flexibility(),
2374 ::fidl_next::protocol::Flexibility::Strict
2375 ) {
2376 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2377 } else {
2378 Ok(())
2379 }
2380 }
2381 }
2382 }
2383
2384 async fn on_two_way(
2385 handler: &mut ___H,
2386 mut message: ::fidl_next::Message<___T>,
2387 responder: ::fidl_next::protocol::Responder<___T>,
2388 ) -> ::core::result::Result<
2389 (),
2390 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2391 > {
2392 match *message.header().ordinal {
2393 4367259243539899061 => {
2394 let responder = ::fidl_next::Responder::from_untyped(responder);
2395
2396 handler.set_boot_complete(responder).await;
2397 Ok(())
2398 }
2399
2400 ordinal => {
2401 handler.on_unknown_interaction(ordinal).await;
2402 if ::core::matches!(
2403 message.header().flexibility(),
2404 ::fidl_next::protocol::Flexibility::Strict
2405 ) {
2406 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2407 } else {
2408 responder
2409 .respond_framework_error(
2410 ordinal,
2411 ::fidl_next::FrameworkError::UnknownMethod,
2412 )
2413 .expect("encoding a framework error should never fail")
2414 .await?;
2415 Ok(())
2416 }
2417 }
2418 }
2419 }
2420}
2421
2422impl<___T> BootControlClientHandler<___T> for ::fidl_next::IgnoreEvents
2423where
2424 ___T: ::fidl_next::Transport,
2425{
2426 async fn on_unknown_interaction(&mut self, _: u64) {}
2427}
2428
2429impl<___H, ___T> BootControlLocalClientHandler<___T> for ::fidl_next::Local<___H>
2430where
2431 ___H: BootControlClientHandler<___T>,
2432 ___T: ::fidl_next::Transport,
2433{
2434 async fn on_unknown_interaction(&mut self, ordinal: u64) {
2435 ___H::on_unknown_interaction(&mut self.0, ordinal).await
2436 }
2437}
2438
2439impl<___H, ___T> BootControlLocalServerHandler<___T> for ::fidl_next::Local<___H>
2440where
2441 ___H: BootControlServerHandler<___T>,
2442 ___T: ::fidl_next::Transport,
2443{
2444 async fn set_boot_complete(
2445 &mut self,
2446
2447 responder: ::fidl_next::Responder<boot_control::SetBootComplete, ___T>,
2448 ) {
2449 ___H::set_boot_complete(&mut self.0, responder).await
2450 }
2451
2452 async fn on_unknown_interaction(&mut self, ordinal: u64) {
2453 ___H::on_unknown_interaction(&mut self.0, ordinal).await
2454 }
2455}
2456
2457#[doc = " An entity that blocks suspend until it handles transitions across hardware\n platform suspend and resume.\n"]
2459#[derive(PartialEq, Debug)]
2460pub struct SuspendBlocker;
2461
2462#[cfg(target_os = "fuchsia")]
2463impl ::fidl_next::HasTransport for SuspendBlocker {
2464 type Transport = ::fidl_next::fuchsia::zx::Channel;
2465}
2466
2467pub mod suspend_blocker {
2468 pub mod prelude {
2469 pub use crate::{
2470 SuspendBlocker, SuspendBlockerClientHandler, SuspendBlockerLocalClientHandler,
2471 SuspendBlockerLocalServerHandler, SuspendBlockerServerHandler, suspend_blocker,
2472 };
2473
2474 pub use crate::natural::SuspendBlockerAfterResumeResponse;
2475
2476 pub use crate::natural::SuspendBlockerBeforeSuspendResponse;
2477 }
2478
2479 pub struct BeforeSuspend;
2480
2481 impl ::fidl_next::Method for BeforeSuspend {
2482 const ORDINAL: u64 = 7734531672310967680;
2483 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2484 ::fidl_next::protocol::Flexibility::Flexible;
2485
2486 type Protocol = crate::SuspendBlocker;
2487
2488 type Request = ::fidl_next::wire::EmptyMessageBody;
2489 }
2490
2491 impl ::fidl_next::TwoWayMethod for BeforeSuspend {
2492 type Response =
2493 ::fidl_next::wire::Flexible<'static, crate::wire::SuspendBlockerBeforeSuspendResponse>;
2494 }
2495
2496 impl<___R> ::fidl_next::Respond<___R> for BeforeSuspend {
2497 type Output = ::fidl_next::Flexible<___R>;
2498
2499 fn respond(response: ___R) -> Self::Output {
2500 ::fidl_next::Flexible(response)
2501 }
2502 }
2503
2504 pub struct AfterResume;
2505
2506 impl ::fidl_next::Method for AfterResume {
2507 const ORDINAL: u64 = 7652351326344392170;
2508 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2509 ::fidl_next::protocol::Flexibility::Flexible;
2510
2511 type Protocol = crate::SuspendBlocker;
2512
2513 type Request = ::fidl_next::wire::EmptyMessageBody;
2514 }
2515
2516 impl ::fidl_next::TwoWayMethod for AfterResume {
2517 type Response =
2518 ::fidl_next::wire::Flexible<'static, crate::wire::SuspendBlockerAfterResumeResponse>;
2519 }
2520
2521 impl<___R> ::fidl_next::Respond<___R> for AfterResume {
2522 type Output = ::fidl_next::Flexible<___R>;
2523
2524 fn respond(response: ___R) -> Self::Output {
2525 ::fidl_next::Flexible(response)
2526 }
2527 }
2528
2529 mod ___detail {
2530 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::SuspendBlocker
2531 where
2532 ___T: ::fidl_next::Transport,
2533 {
2534 type Client = SuspendBlockerClient<___T>;
2535 type Server = SuspendBlockerServer<___T>;
2536 }
2537
2538 #[repr(transparent)]
2540 pub struct SuspendBlockerClient<___T: ::fidl_next::Transport> {
2541 #[allow(dead_code)]
2542 client: ::fidl_next::protocol::Client<___T>,
2543 }
2544
2545 impl<___T> SuspendBlockerClient<___T>
2546 where
2547 ___T: ::fidl_next::Transport,
2548 {
2549 #[doc = " Called after system activity governor begins operations to suspend the\n hardware platform.\n\n The server is expected to respond once it has performed the operations\n it needs to prepare itself for suspend, if any. All dependencies of\n `ExecutionStateLevel::SUSPENDING` are guaranteed to be satisified for\n the duration of this call and may be revoked once the server replies.\n\n Operations to suspend the hardware platform may vary between different\n hardware platforms and product configurations. At a minimum, the client\n and server MUST assume that general code execution continues\n until a reply to this call is received by the client. If the\n SuspendBlocker wants to preempt suspend operations, it MUST call\n `ActivityGovernor.AcquireWakeLease` before replying to this call.\n\n ExecutionState will be at its SUSPENDING level for the duration of this\n call. Consequently, a SuspendBlocker MUST NOT call\n `ActivityGovernor.TakeApplicationActivityLease` nor perform any other\n action that blocks on Execution State reaching a level other than\n INACTIVE. Doing so will result in a deadlock. (However, AcquireWakeLease\n does _not_ block in this way and is safe to call.)\n"]
2550 pub fn before_suspend(
2551 &self,
2552 ) -> ::fidl_next::TwoWayFuture<'_, super::BeforeSuspend, ___T> {
2553 ::fidl_next::TwoWayFuture::from_untyped(
2554 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
2555 7734531672310967680,
2556 <super::BeforeSuspend as ::fidl_next::Method>::FLEXIBILITY,
2557 (),
2558 ),
2559 )
2560 }
2561
2562 #[doc = " Called after system activity governor is aware that the hardware\n platform has resumed.\n\n For the duration of this call, ExecutionState is at level INACTIVE,\n but all dependencies of `ExecutionStateLevel::SUSPENDING` are guaranteed\n be satisified.\n\n Consequently, a SuspendBlocker MUST NOT call\n `ActivityGovernor.TakeApplicationActivityLease` nor perform any other\n action that blocks on Execution State reaching a level other than\n INACTIVE. Doing so will result in a deadlock. (However, AcquireWakeLease\n does _not_ block in this way and is safe to call.)\n"]
2563 pub fn after_resume(&self) -> ::fidl_next::TwoWayFuture<'_, super::AfterResume, ___T> {
2564 ::fidl_next::TwoWayFuture::from_untyped(
2565 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
2566 7652351326344392170,
2567 <super::AfterResume as ::fidl_next::Method>::FLEXIBILITY,
2568 (),
2569 ),
2570 )
2571 }
2572 }
2573
2574 #[repr(transparent)]
2576 pub struct SuspendBlockerServer<___T: ::fidl_next::Transport> {
2577 server: ::fidl_next::protocol::Server<___T>,
2578 }
2579
2580 impl<___T> SuspendBlockerServer<___T> where ___T: ::fidl_next::Transport {}
2581 }
2582}
2583
2584#[diagnostic::on_unimplemented(
2585 note = "If {Self} implements the non-local SuspendBlockerClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
2586)]
2587
2588pub trait SuspendBlockerLocalClientHandler<
2592 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2593 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2594>
2595{
2596 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2597 ::core::future::ready(())
2598 }
2599}
2600
2601impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for SuspendBlocker
2602where
2603 ___H: SuspendBlockerLocalClientHandler<___T>,
2604 ___T: ::fidl_next::Transport,
2605{
2606 async fn on_event(
2607 handler: &mut ___H,
2608 mut message: ::fidl_next::Message<___T>,
2609 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2610 match *message.header().ordinal {
2611 ordinal => {
2612 handler.on_unknown_interaction(ordinal).await;
2613 if ::core::matches!(
2614 message.header().flexibility(),
2615 ::fidl_next::protocol::Flexibility::Strict
2616 ) {
2617 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2618 } else {
2619 Ok(())
2620 }
2621 }
2622 }
2623 }
2624}
2625
2626#[diagnostic::on_unimplemented(
2627 note = "If {Self} implements the non-local SuspendBlockerServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
2628)]
2629
2630pub trait SuspendBlockerLocalServerHandler<
2634 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2635 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2636>
2637{
2638 #[doc = " Called after system activity governor begins operations to suspend the\n hardware platform.\n\n The server is expected to respond once it has performed the operations\n it needs to prepare itself for suspend, if any. All dependencies of\n `ExecutionStateLevel::SUSPENDING` are guaranteed to be satisified for\n the duration of this call and may be revoked once the server replies.\n\n Operations to suspend the hardware platform may vary between different\n hardware platforms and product configurations. At a minimum, the client\n and server MUST assume that general code execution continues\n until a reply to this call is received by the client. If the\n SuspendBlocker wants to preempt suspend operations, it MUST call\n `ActivityGovernor.AcquireWakeLease` before replying to this call.\n\n ExecutionState will be at its SUSPENDING level for the duration of this\n call. Consequently, a SuspendBlocker MUST NOT call\n `ActivityGovernor.TakeApplicationActivityLease` nor perform any other\n action that blocks on Execution State reaching a level other than\n INACTIVE. Doing so will result in a deadlock. (However, AcquireWakeLease\n does _not_ block in this way and is safe to call.)\n"]
2639 fn before_suspend(
2640 &mut self,
2641
2642 responder: ::fidl_next::Responder<suspend_blocker::BeforeSuspend, ___T>,
2643 ) -> impl ::core::future::Future<Output = ()>;
2644
2645 #[doc = " Called after system activity governor is aware that the hardware\n platform has resumed.\n\n For the duration of this call, ExecutionState is at level INACTIVE,\n but all dependencies of `ExecutionStateLevel::SUSPENDING` are guaranteed\n be satisified.\n\n Consequently, a SuspendBlocker MUST NOT call\n `ActivityGovernor.TakeApplicationActivityLease` nor perform any other\n action that blocks on Execution State reaching a level other than\n INACTIVE. Doing so will result in a deadlock. (However, AcquireWakeLease\n does _not_ block in this way and is safe to call.)\n"]
2646 fn after_resume(
2647 &mut self,
2648
2649 responder: ::fidl_next::Responder<suspend_blocker::AfterResume, ___T>,
2650 ) -> impl ::core::future::Future<Output = ()>;
2651
2652 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
2653 ::core::future::ready(())
2654 }
2655}
2656
2657impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for SuspendBlocker
2658where
2659 ___H: SuspendBlockerLocalServerHandler<___T>,
2660 ___T: ::fidl_next::Transport,
2661{
2662 async fn on_one_way(
2663 handler: &mut ___H,
2664 mut message: ::fidl_next::Message<___T>,
2665 ) -> ::core::result::Result<
2666 (),
2667 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2668 > {
2669 match *message.header().ordinal {
2670 ordinal => {
2671 handler.on_unknown_interaction(ordinal).await;
2672 if ::core::matches!(
2673 message.header().flexibility(),
2674 ::fidl_next::protocol::Flexibility::Strict
2675 ) {
2676 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2677 } else {
2678 Ok(())
2679 }
2680 }
2681 }
2682 }
2683
2684 async fn on_two_way(
2685 handler: &mut ___H,
2686 mut message: ::fidl_next::Message<___T>,
2687 responder: ::fidl_next::protocol::Responder<___T>,
2688 ) -> ::core::result::Result<
2689 (),
2690 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2691 > {
2692 match *message.header().ordinal {
2693 7734531672310967680 => {
2694 let responder = ::fidl_next::Responder::from_untyped(responder);
2695
2696 handler.before_suspend(responder).await;
2697 Ok(())
2698 }
2699
2700 7652351326344392170 => {
2701 let responder = ::fidl_next::Responder::from_untyped(responder);
2702
2703 handler.after_resume(responder).await;
2704 Ok(())
2705 }
2706
2707 ordinal => {
2708 handler.on_unknown_interaction(ordinal).await;
2709 if ::core::matches!(
2710 message.header().flexibility(),
2711 ::fidl_next::protocol::Flexibility::Strict
2712 ) {
2713 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2714 } else {
2715 responder
2716 .respond_framework_error(
2717 ordinal,
2718 ::fidl_next::FrameworkError::UnknownMethod,
2719 )
2720 .expect("encoding a framework error should never fail")
2721 .await?;
2722 Ok(())
2723 }
2724 }
2725 }
2726 }
2727}
2728
2729pub trait SuspendBlockerClientHandler<
2733 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2734 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2735>
2736{
2737 fn on_unknown_interaction(
2738 &mut self,
2739 ordinal: u64,
2740 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2741 ::core::future::ready(())
2742 }
2743}
2744
2745impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for SuspendBlocker
2746where
2747 ___H: SuspendBlockerClientHandler<___T> + ::core::marker::Send,
2748 ___T: ::fidl_next::Transport,
2749{
2750 async fn on_event(
2751 handler: &mut ___H,
2752 mut message: ::fidl_next::Message<___T>,
2753 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2754 match *message.header().ordinal {
2755 ordinal => {
2756 handler.on_unknown_interaction(ordinal).await;
2757 if ::core::matches!(
2758 message.header().flexibility(),
2759 ::fidl_next::protocol::Flexibility::Strict
2760 ) {
2761 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2762 } else {
2763 Ok(())
2764 }
2765 }
2766 }
2767 }
2768}
2769
2770pub trait SuspendBlockerServerHandler<
2774 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2775 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2776>
2777{
2778 #[doc = " Called after system activity governor begins operations to suspend the\n hardware platform.\n\n The server is expected to respond once it has performed the operations\n it needs to prepare itself for suspend, if any. All dependencies of\n `ExecutionStateLevel::SUSPENDING` are guaranteed to be satisified for\n the duration of this call and may be revoked once the server replies.\n\n Operations to suspend the hardware platform may vary between different\n hardware platforms and product configurations. At a minimum, the client\n and server MUST assume that general code execution continues\n until a reply to this call is received by the client. If the\n SuspendBlocker wants to preempt suspend operations, it MUST call\n `ActivityGovernor.AcquireWakeLease` before replying to this call.\n\n ExecutionState will be at its SUSPENDING level for the duration of this\n call. Consequently, a SuspendBlocker MUST NOT call\n `ActivityGovernor.TakeApplicationActivityLease` nor perform any other\n action that blocks on Execution State reaching a level other than\n INACTIVE. Doing so will result in a deadlock. (However, AcquireWakeLease\n does _not_ block in this way and is safe to call.)\n"]
2779 fn before_suspend(
2780 &mut self,
2781
2782 responder: ::fidl_next::Responder<suspend_blocker::BeforeSuspend, ___T>,
2783 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2784
2785 #[doc = " Called after system activity governor is aware that the hardware\n platform has resumed.\n\n For the duration of this call, ExecutionState is at level INACTIVE,\n but all dependencies of `ExecutionStateLevel::SUSPENDING` are guaranteed\n be satisified.\n\n Consequently, a SuspendBlocker MUST NOT call\n `ActivityGovernor.TakeApplicationActivityLease` nor perform any other\n action that blocks on Execution State reaching a level other than\n INACTIVE. Doing so will result in a deadlock. (However, AcquireWakeLease\n does _not_ block in this way and is safe to call.)\n"]
2786 fn after_resume(
2787 &mut self,
2788
2789 responder: ::fidl_next::Responder<suspend_blocker::AfterResume, ___T>,
2790 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2791
2792 fn on_unknown_interaction(
2793 &mut self,
2794 ordinal: u64,
2795 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2796 ::core::future::ready(())
2797 }
2798}
2799
2800impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for SuspendBlocker
2801where
2802 ___H: SuspendBlockerServerHandler<___T> + ::core::marker::Send,
2803 ___T: ::fidl_next::Transport,
2804{
2805 async fn on_one_way(
2806 handler: &mut ___H,
2807 mut message: ::fidl_next::Message<___T>,
2808 ) -> ::core::result::Result<
2809 (),
2810 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2811 > {
2812 match *message.header().ordinal {
2813 ordinal => {
2814 handler.on_unknown_interaction(ordinal).await;
2815 if ::core::matches!(
2816 message.header().flexibility(),
2817 ::fidl_next::protocol::Flexibility::Strict
2818 ) {
2819 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2820 } else {
2821 Ok(())
2822 }
2823 }
2824 }
2825 }
2826
2827 async fn on_two_way(
2828 handler: &mut ___H,
2829 mut message: ::fidl_next::Message<___T>,
2830 responder: ::fidl_next::protocol::Responder<___T>,
2831 ) -> ::core::result::Result<
2832 (),
2833 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2834 > {
2835 match *message.header().ordinal {
2836 7734531672310967680 => {
2837 let responder = ::fidl_next::Responder::from_untyped(responder);
2838
2839 handler.before_suspend(responder).await;
2840 Ok(())
2841 }
2842
2843 7652351326344392170 => {
2844 let responder = ::fidl_next::Responder::from_untyped(responder);
2845
2846 handler.after_resume(responder).await;
2847 Ok(())
2848 }
2849
2850 ordinal => {
2851 handler.on_unknown_interaction(ordinal).await;
2852 if ::core::matches!(
2853 message.header().flexibility(),
2854 ::fidl_next::protocol::Flexibility::Strict
2855 ) {
2856 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2857 } else {
2858 responder
2859 .respond_framework_error(
2860 ordinal,
2861 ::fidl_next::FrameworkError::UnknownMethod,
2862 )
2863 .expect("encoding a framework error should never fail")
2864 .await?;
2865 Ok(())
2866 }
2867 }
2868 }
2869 }
2870}
2871
2872impl<___T> SuspendBlockerClientHandler<___T> for ::fidl_next::IgnoreEvents
2873where
2874 ___T: ::fidl_next::Transport,
2875{
2876 async fn on_unknown_interaction(&mut self, _: u64) {}
2877}
2878
2879impl<___H, ___T> SuspendBlockerLocalClientHandler<___T> for ::fidl_next::Local<___H>
2880where
2881 ___H: SuspendBlockerClientHandler<___T>,
2882 ___T: ::fidl_next::Transport,
2883{
2884 async fn on_unknown_interaction(&mut self, ordinal: u64) {
2885 ___H::on_unknown_interaction(&mut self.0, ordinal).await
2886 }
2887}
2888
2889impl<___H, ___T> SuspendBlockerLocalServerHandler<___T> for ::fidl_next::Local<___H>
2890where
2891 ___H: SuspendBlockerServerHandler<___T>,
2892 ___T: ::fidl_next::Transport,
2893{
2894 async fn before_suspend(
2895 &mut self,
2896
2897 responder: ::fidl_next::Responder<suspend_blocker::BeforeSuspend, ___T>,
2898 ) {
2899 ___H::before_suspend(&mut self.0, responder).await
2900 }
2901
2902 async fn after_resume(
2903 &mut self,
2904
2905 responder: ::fidl_next::Responder<suspend_blocker::AfterResume, ___T>,
2906 ) {
2907 ___H::after_resume(&mut self.0, responder).await
2908 }
2909
2910 async fn on_unknown_interaction(&mut self, ordinal: u64) {
2911 ___H::on_unknown_interaction(&mut self.0, ordinal).await
2912 }
2913}