Skip to main content

fidl_next_common_fuchsia_power_system/
fidl_next_common_fuchsia_power_system.rs

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