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