fidl_fuchsia_power_system__common/
fidl_fuchsia_power_system__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const MAX_ELEMENT_NAME_LEN: u8 = 64;
12
13/// Errors returned by `ActivityGovernor/AcquireWakeLease`.
14#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
15pub enum AcquireWakeLeaseError {
16    /// The service encountered an error while attempting to issue a wake lease.
17    Internal,
18    /// The name for the wake lease is empty or invalid.
19    InvalidName,
20    #[doc(hidden)]
21    __SourceBreaking { unknown_ordinal: u32 },
22}
23
24/// Pattern that matches an unknown `AcquireWakeLeaseError` member.
25#[macro_export]
26macro_rules! AcquireWakeLeaseErrorUnknown {
27    () => {
28        _
29    };
30}
31
32impl AcquireWakeLeaseError {
33    #[inline]
34    pub fn from_primitive(prim: u32) -> Option<Self> {
35        match prim {
36            1 => Some(Self::Internal),
37            2 => Some(Self::InvalidName),
38            _ => None,
39        }
40    }
41
42    #[inline]
43    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
44        match prim {
45            1 => Self::Internal,
46            2 => Self::InvalidName,
47            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
48        }
49    }
50
51    #[inline]
52    pub fn unknown() -> Self {
53        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
54    }
55
56    #[inline]
57    pub const fn into_primitive(self) -> u32 {
58        match self {
59            Self::Internal => 1,
60            Self::InvalidName => 2,
61            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
62        }
63    }
64
65    #[inline]
66    pub fn is_unknown(&self) -> bool {
67        match self {
68            Self::__SourceBreaking { unknown_ordinal: _ } => true,
69            _ => false,
70        }
71    }
72}
73
74/// Error codes for responses from `AddExecutionStateDependency` in
75/// [`fuchsia.power.system/CpuElementManager`].
76#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
77pub enum AddExecutionStateDependencyError {
78    /// Required arguments are either not given or are not valid.
79    InvalidArgs,
80    /// The server is not in a state to handle the request.
81    BadState,
82    #[doc(hidden)]
83    __SourceBreaking { unknown_ordinal: u32 },
84}
85
86/// Pattern that matches an unknown `AddExecutionStateDependencyError` member.
87#[macro_export]
88macro_rules! AddExecutionStateDependencyErrorUnknown {
89    () => {
90        _
91    };
92}
93
94impl AddExecutionStateDependencyError {
95    #[inline]
96    pub fn from_primitive(prim: u32) -> Option<Self> {
97        match prim {
98            1 => Some(Self::InvalidArgs),
99            2 => Some(Self::BadState),
100            _ => None,
101        }
102    }
103
104    #[inline]
105    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
106        match prim {
107            1 => Self::InvalidArgs,
108            2 => Self::BadState,
109            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
110        }
111    }
112
113    #[inline]
114    pub fn unknown() -> Self {
115        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
116    }
117
118    #[inline]
119    pub const fn into_primitive(self) -> u32 {
120        match self {
121            Self::InvalidArgs => 1,
122            Self::BadState => 2,
123            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
124        }
125    }
126
127    #[inline]
128    pub fn is_unknown(&self) -> bool {
129        match self {
130            Self::__SourceBreaking { unknown_ordinal: _ } => true,
131            _ => false,
132        }
133    }
134}
135
136/// Application activity power levels
137///
138/// Elements that need to keep the system from suspending should take an assertive
139/// dependency on `ApplicationActivityLevel::ACTIVE`. When these components are
140/// performing work, they should request a lease to ensure the system remains
141/// active, and drop the lease when they are done.
142#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
143pub enum ApplicationActivityLevel {
144    Inactive,
145    Active,
146    #[doc(hidden)]
147    __SourceBreaking {
148        unknown_ordinal: u8,
149    },
150}
151
152/// Pattern that matches an unknown `ApplicationActivityLevel` member.
153#[macro_export]
154macro_rules! ApplicationActivityLevelUnknown {
155    () => {
156        _
157    };
158}
159
160impl ApplicationActivityLevel {
161    #[inline]
162    pub fn from_primitive(prim: u8) -> Option<Self> {
163        match prim {
164            0 => Some(Self::Inactive),
165            1 => Some(Self::Active),
166            _ => None,
167        }
168    }
169
170    #[inline]
171    pub fn from_primitive_allow_unknown(prim: u8) -> Self {
172        match prim {
173            0 => Self::Inactive,
174            1 => Self::Active,
175            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
176        }
177    }
178
179    #[inline]
180    pub fn unknown() -> Self {
181        Self::__SourceBreaking { unknown_ordinal: 0xff }
182    }
183
184    #[inline]
185    pub const fn into_primitive(self) -> u8 {
186        match self {
187            Self::Inactive => 0,
188            Self::Active => 1,
189            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
190        }
191    }
192
193    #[inline]
194    pub fn is_unknown(&self) -> bool {
195        match self {
196            Self::__SourceBreaking { unknown_ordinal: _ } => true,
197            _ => false,
198        }
199    }
200}
201
202/// CPU power levels
203///
204/// Elements should take an assertive dependency on `CpuLevel::ACTIVE`
205/// to ensure that the element will be suspended before the CPU suspends.
206#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
207pub enum CpuLevel {
208    Inactive,
209    Active,
210    #[doc(hidden)]
211    __SourceBreaking {
212        unknown_ordinal: u8,
213    },
214}
215
216/// Pattern that matches an unknown `CpuLevel` member.
217#[macro_export]
218macro_rules! CpuLevelUnknown {
219    () => {
220        _
221    };
222}
223
224impl CpuLevel {
225    #[inline]
226    pub fn from_primitive(prim: u8) -> Option<Self> {
227        match prim {
228            0 => Some(Self::Inactive),
229            1 => Some(Self::Active),
230            _ => None,
231        }
232    }
233
234    #[inline]
235    pub fn from_primitive_allow_unknown(prim: u8) -> Self {
236        match prim {
237            0 => Self::Inactive,
238            1 => Self::Active,
239            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
240        }
241    }
242
243    #[inline]
244    pub fn unknown() -> Self {
245        Self::__SourceBreaking { unknown_ordinal: 0xff }
246    }
247
248    #[inline]
249    pub const fn into_primitive(self) -> u8 {
250        match self {
251            Self::Inactive => 0,
252            Self::Active => 1,
253            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
254        }
255    }
256
257    #[inline]
258    pub fn is_unknown(&self) -> bool {
259        match self {
260            Self::__SourceBreaking { unknown_ordinal: _ } => true,
261            _ => false,
262        }
263    }
264}
265
266/// Execution state power levels
267///
268/// Elements should take an opportunistic dependency on `ExecutionStateLevel::ACTIVE`
269/// to ensure that the element will be suspended when the rest of the system
270/// suspends.
271///
272/// Drivers can take an opportunistic dependency on either
273/// `ExecutionStateLevel::SUSPENDING` or `ExecutionStateLevel::ACTIVE` and
274/// request a persistent lease on this state to ensure that their element's
275/// power level is always activated when the system comes out of a suspend
276/// state.
277#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
278pub enum ExecutionStateLevel {
279    Inactive,
280    Suspending,
281    Active,
282    #[doc(hidden)]
283    __SourceBreaking {
284        unknown_ordinal: u8,
285    },
286}
287
288/// Pattern that matches an unknown `ExecutionStateLevel` member.
289#[macro_export]
290macro_rules! ExecutionStateLevelUnknown {
291    () => {
292        _
293    };
294}
295
296impl ExecutionStateLevel {
297    #[inline]
298    pub fn from_primitive(prim: u8) -> Option<Self> {
299        match prim {
300            0 => Some(Self::Inactive),
301            1 => Some(Self::Suspending),
302            2 => Some(Self::Active),
303            _ => None,
304        }
305    }
306
307    #[inline]
308    pub fn from_primitive_allow_unknown(prim: u8) -> Self {
309        match prim {
310            0 => Self::Inactive,
311            1 => Self::Suspending,
312            2 => Self::Active,
313            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
314        }
315    }
316
317    #[inline]
318    pub fn unknown() -> Self {
319        Self::__SourceBreaking { unknown_ordinal: 0xff }
320    }
321
322    #[inline]
323    pub const fn into_primitive(self) -> u8 {
324        match self {
325            Self::Inactive => 0,
326            Self::Suspending => 1,
327            Self::Active => 2,
328            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
329        }
330    }
331
332    #[inline]
333    pub fn is_unknown(&self) -> bool {
334        match self {
335            Self::__SourceBreaking { unknown_ordinal: _ } => true,
336            _ => false,
337        }
338    }
339}
340
341/// Error codes for responses from `RegisterSuspendBlocker` in
342/// [`fuchsia.power.system/ActivityGovernor`].
343#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
344pub enum RegisterSuspendBlockerError {
345    /// The service encountered an error while attempting to issue a wake lease.
346    Internal,
347    /// Required arguments are either not given or are not valid.
348    InvalidArgs,
349    #[doc(hidden)]
350    __SourceBreaking { unknown_ordinal: u32 },
351}
352
353/// Pattern that matches an unknown `RegisterSuspendBlockerError` member.
354#[macro_export]
355macro_rules! RegisterSuspendBlockerErrorUnknown {
356    () => {
357        _
358    };
359}
360
361impl RegisterSuspendBlockerError {
362    #[inline]
363    pub fn from_primitive(prim: u32) -> Option<Self> {
364        match prim {
365            1 => Some(Self::Internal),
366            2 => Some(Self::InvalidArgs),
367            _ => None,
368        }
369    }
370
371    #[inline]
372    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
373        match prim {
374            1 => Self::Internal,
375            2 => Self::InvalidArgs,
376            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
377        }
378    }
379
380    #[inline]
381    pub fn unknown() -> Self {
382        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
383    }
384
385    #[inline]
386    pub const fn into_primitive(self) -> u32 {
387        match self {
388            Self::Internal => 1,
389            Self::InvalidArgs => 2,
390            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
391        }
392    }
393
394    #[inline]
395    pub fn is_unknown(&self) -> bool {
396        match self {
397            Self::__SourceBreaking { unknown_ordinal: _ } => true,
398            _ => false,
399        }
400    }
401}
402
403#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
404pub struct ActivityGovernorAcquireWakeLeaseRequest {
405    /// The name of the lease.
406    ///
407    /// The name cannot be empty but is not required to be globally unique.
408    pub name: String,
409}
410
411impl fidl::Persistable for ActivityGovernorAcquireWakeLeaseRequest {}
412
413#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
414pub struct ActivityGovernorTakeApplicationActivityLeaseRequest {
415    /// The name of the lease.
416    ///
417    /// The name is not required to be globally unique.
418    pub name: String,
419}
420
421impl fidl::Persistable for ActivityGovernorTakeApplicationActivityLeaseRequest {}
422
423#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
424pub struct ActivityGovernorTakeWakeLeaseRequest {
425    /// The name of the lease.
426    ///
427    /// The name is not required to be globally unique.
428    pub name: String,
429}
430
431impl fidl::Persistable for ActivityGovernorTakeWakeLeaseRequest {}
432
433mod internal {
434    use super::*;
435    unsafe impl fidl::encoding::TypeMarker for AcquireWakeLeaseError {
436        type Owned = Self;
437
438        #[inline(always)]
439        fn inline_align(_context: fidl::encoding::Context) -> usize {
440            std::mem::align_of::<u32>()
441        }
442
443        #[inline(always)]
444        fn inline_size(_context: fidl::encoding::Context) -> usize {
445            std::mem::size_of::<u32>()
446        }
447
448        #[inline(always)]
449        fn encode_is_copy() -> bool {
450            false
451        }
452
453        #[inline(always)]
454        fn decode_is_copy() -> bool {
455            false
456        }
457    }
458
459    impl fidl::encoding::ValueTypeMarker for AcquireWakeLeaseError {
460        type Borrowed<'a> = Self;
461        #[inline(always)]
462        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
463            *value
464        }
465    }
466
467    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
468        for AcquireWakeLeaseError
469    {
470        #[inline]
471        unsafe fn encode(
472            self,
473            encoder: &mut fidl::encoding::Encoder<'_, D>,
474            offset: usize,
475            _depth: fidl::encoding::Depth,
476        ) -> fidl::Result<()> {
477            encoder.debug_check_bounds::<Self>(offset);
478            encoder.write_num(self.into_primitive(), offset);
479            Ok(())
480        }
481    }
482
483    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AcquireWakeLeaseError {
484        #[inline(always)]
485        fn new_empty() -> Self {
486            Self::unknown()
487        }
488
489        #[inline]
490        unsafe fn decode(
491            &mut self,
492            decoder: &mut fidl::encoding::Decoder<'_, D>,
493            offset: usize,
494            _depth: fidl::encoding::Depth,
495        ) -> fidl::Result<()> {
496            decoder.debug_check_bounds::<Self>(offset);
497            let prim = decoder.read_num::<u32>(offset);
498
499            *self = Self::from_primitive_allow_unknown(prim);
500            Ok(())
501        }
502    }
503    unsafe impl fidl::encoding::TypeMarker for AddExecutionStateDependencyError {
504        type Owned = Self;
505
506        #[inline(always)]
507        fn inline_align(_context: fidl::encoding::Context) -> usize {
508            std::mem::align_of::<u32>()
509        }
510
511        #[inline(always)]
512        fn inline_size(_context: fidl::encoding::Context) -> usize {
513            std::mem::size_of::<u32>()
514        }
515
516        #[inline(always)]
517        fn encode_is_copy() -> bool {
518            false
519        }
520
521        #[inline(always)]
522        fn decode_is_copy() -> bool {
523            false
524        }
525    }
526
527    impl fidl::encoding::ValueTypeMarker for AddExecutionStateDependencyError {
528        type Borrowed<'a> = Self;
529        #[inline(always)]
530        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
531            *value
532        }
533    }
534
535    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
536        for AddExecutionStateDependencyError
537    {
538        #[inline]
539        unsafe fn encode(
540            self,
541            encoder: &mut fidl::encoding::Encoder<'_, D>,
542            offset: usize,
543            _depth: fidl::encoding::Depth,
544        ) -> fidl::Result<()> {
545            encoder.debug_check_bounds::<Self>(offset);
546            encoder.write_num(self.into_primitive(), offset);
547            Ok(())
548        }
549    }
550
551    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
552        for AddExecutionStateDependencyError
553    {
554        #[inline(always)]
555        fn new_empty() -> Self {
556            Self::unknown()
557        }
558
559        #[inline]
560        unsafe fn decode(
561            &mut self,
562            decoder: &mut fidl::encoding::Decoder<'_, D>,
563            offset: usize,
564            _depth: fidl::encoding::Depth,
565        ) -> fidl::Result<()> {
566            decoder.debug_check_bounds::<Self>(offset);
567            let prim = decoder.read_num::<u32>(offset);
568
569            *self = Self::from_primitive_allow_unknown(prim);
570            Ok(())
571        }
572    }
573    unsafe impl fidl::encoding::TypeMarker for ApplicationActivityLevel {
574        type Owned = Self;
575
576        #[inline(always)]
577        fn inline_align(_context: fidl::encoding::Context) -> usize {
578            std::mem::align_of::<u8>()
579        }
580
581        #[inline(always)]
582        fn inline_size(_context: fidl::encoding::Context) -> usize {
583            std::mem::size_of::<u8>()
584        }
585
586        #[inline(always)]
587        fn encode_is_copy() -> bool {
588            false
589        }
590
591        #[inline(always)]
592        fn decode_is_copy() -> bool {
593            false
594        }
595    }
596
597    impl fidl::encoding::ValueTypeMarker for ApplicationActivityLevel {
598        type Borrowed<'a> = Self;
599        #[inline(always)]
600        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
601            *value
602        }
603    }
604
605    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
606        for ApplicationActivityLevel
607    {
608        #[inline]
609        unsafe fn encode(
610            self,
611            encoder: &mut fidl::encoding::Encoder<'_, D>,
612            offset: usize,
613            _depth: fidl::encoding::Depth,
614        ) -> fidl::Result<()> {
615            encoder.debug_check_bounds::<Self>(offset);
616            encoder.write_num(self.into_primitive(), offset);
617            Ok(())
618        }
619    }
620
621    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
622        for ApplicationActivityLevel
623    {
624        #[inline(always)]
625        fn new_empty() -> Self {
626            Self::unknown()
627        }
628
629        #[inline]
630        unsafe fn decode(
631            &mut self,
632            decoder: &mut fidl::encoding::Decoder<'_, D>,
633            offset: usize,
634            _depth: fidl::encoding::Depth,
635        ) -> fidl::Result<()> {
636            decoder.debug_check_bounds::<Self>(offset);
637            let prim = decoder.read_num::<u8>(offset);
638
639            *self = Self::from_primitive_allow_unknown(prim);
640            Ok(())
641        }
642    }
643    unsafe impl fidl::encoding::TypeMarker for CpuLevel {
644        type Owned = Self;
645
646        #[inline(always)]
647        fn inline_align(_context: fidl::encoding::Context) -> usize {
648            std::mem::align_of::<u8>()
649        }
650
651        #[inline(always)]
652        fn inline_size(_context: fidl::encoding::Context) -> usize {
653            std::mem::size_of::<u8>()
654        }
655
656        #[inline(always)]
657        fn encode_is_copy() -> bool {
658            false
659        }
660
661        #[inline(always)]
662        fn decode_is_copy() -> bool {
663            false
664        }
665    }
666
667    impl fidl::encoding::ValueTypeMarker for CpuLevel {
668        type Borrowed<'a> = Self;
669        #[inline(always)]
670        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
671            *value
672        }
673    }
674
675    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CpuLevel {
676        #[inline]
677        unsafe fn encode(
678            self,
679            encoder: &mut fidl::encoding::Encoder<'_, D>,
680            offset: usize,
681            _depth: fidl::encoding::Depth,
682        ) -> fidl::Result<()> {
683            encoder.debug_check_bounds::<Self>(offset);
684            encoder.write_num(self.into_primitive(), offset);
685            Ok(())
686        }
687    }
688
689    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CpuLevel {
690        #[inline(always)]
691        fn new_empty() -> Self {
692            Self::unknown()
693        }
694
695        #[inline]
696        unsafe fn decode(
697            &mut self,
698            decoder: &mut fidl::encoding::Decoder<'_, D>,
699            offset: usize,
700            _depth: fidl::encoding::Depth,
701        ) -> fidl::Result<()> {
702            decoder.debug_check_bounds::<Self>(offset);
703            let prim = decoder.read_num::<u8>(offset);
704
705            *self = Self::from_primitive_allow_unknown(prim);
706            Ok(())
707        }
708    }
709    unsafe impl fidl::encoding::TypeMarker for ExecutionStateLevel {
710        type Owned = Self;
711
712        #[inline(always)]
713        fn inline_align(_context: fidl::encoding::Context) -> usize {
714            std::mem::align_of::<u8>()
715        }
716
717        #[inline(always)]
718        fn inline_size(_context: fidl::encoding::Context) -> usize {
719            std::mem::size_of::<u8>()
720        }
721
722        #[inline(always)]
723        fn encode_is_copy() -> bool {
724            false
725        }
726
727        #[inline(always)]
728        fn decode_is_copy() -> bool {
729            false
730        }
731    }
732
733    impl fidl::encoding::ValueTypeMarker for ExecutionStateLevel {
734        type Borrowed<'a> = Self;
735        #[inline(always)]
736        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
737            *value
738        }
739    }
740
741    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
742        for ExecutionStateLevel
743    {
744        #[inline]
745        unsafe fn encode(
746            self,
747            encoder: &mut fidl::encoding::Encoder<'_, D>,
748            offset: usize,
749            _depth: fidl::encoding::Depth,
750        ) -> fidl::Result<()> {
751            encoder.debug_check_bounds::<Self>(offset);
752            encoder.write_num(self.into_primitive(), offset);
753            Ok(())
754        }
755    }
756
757    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ExecutionStateLevel {
758        #[inline(always)]
759        fn new_empty() -> Self {
760            Self::unknown()
761        }
762
763        #[inline]
764        unsafe fn decode(
765            &mut self,
766            decoder: &mut fidl::encoding::Decoder<'_, D>,
767            offset: usize,
768            _depth: fidl::encoding::Depth,
769        ) -> fidl::Result<()> {
770            decoder.debug_check_bounds::<Self>(offset);
771            let prim = decoder.read_num::<u8>(offset);
772
773            *self = Self::from_primitive_allow_unknown(prim);
774            Ok(())
775        }
776    }
777    unsafe impl fidl::encoding::TypeMarker for RegisterSuspendBlockerError {
778        type Owned = Self;
779
780        #[inline(always)]
781        fn inline_align(_context: fidl::encoding::Context) -> usize {
782            std::mem::align_of::<u32>()
783        }
784
785        #[inline(always)]
786        fn inline_size(_context: fidl::encoding::Context) -> usize {
787            std::mem::size_of::<u32>()
788        }
789
790        #[inline(always)]
791        fn encode_is_copy() -> bool {
792            false
793        }
794
795        #[inline(always)]
796        fn decode_is_copy() -> bool {
797            false
798        }
799    }
800
801    impl fidl::encoding::ValueTypeMarker for RegisterSuspendBlockerError {
802        type Borrowed<'a> = Self;
803        #[inline(always)]
804        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
805            *value
806        }
807    }
808
809    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
810        for RegisterSuspendBlockerError
811    {
812        #[inline]
813        unsafe fn encode(
814            self,
815            encoder: &mut fidl::encoding::Encoder<'_, D>,
816            offset: usize,
817            _depth: fidl::encoding::Depth,
818        ) -> fidl::Result<()> {
819            encoder.debug_check_bounds::<Self>(offset);
820            encoder.write_num(self.into_primitive(), offset);
821            Ok(())
822        }
823    }
824
825    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
826        for RegisterSuspendBlockerError
827    {
828        #[inline(always)]
829        fn new_empty() -> Self {
830            Self::unknown()
831        }
832
833        #[inline]
834        unsafe fn decode(
835            &mut self,
836            decoder: &mut fidl::encoding::Decoder<'_, D>,
837            offset: usize,
838            _depth: fidl::encoding::Depth,
839        ) -> fidl::Result<()> {
840            decoder.debug_check_bounds::<Self>(offset);
841            let prim = decoder.read_num::<u32>(offset);
842
843            *self = Self::from_primitive_allow_unknown(prim);
844            Ok(())
845        }
846    }
847
848    impl fidl::encoding::ValueTypeMarker for ActivityGovernorAcquireWakeLeaseRequest {
849        type Borrowed<'a> = &'a Self;
850        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
851            value
852        }
853    }
854
855    unsafe impl fidl::encoding::TypeMarker for ActivityGovernorAcquireWakeLeaseRequest {
856        type Owned = Self;
857
858        #[inline(always)]
859        fn inline_align(_context: fidl::encoding::Context) -> usize {
860            8
861        }
862
863        #[inline(always)]
864        fn inline_size(_context: fidl::encoding::Context) -> usize {
865            16
866        }
867    }
868
869    unsafe impl<D: fidl::encoding::ResourceDialect>
870        fidl::encoding::Encode<ActivityGovernorAcquireWakeLeaseRequest, D>
871        for &ActivityGovernorAcquireWakeLeaseRequest
872    {
873        #[inline]
874        unsafe fn encode(
875            self,
876            encoder: &mut fidl::encoding::Encoder<'_, D>,
877            offset: usize,
878            _depth: fidl::encoding::Depth,
879        ) -> fidl::Result<()> {
880            encoder.debug_check_bounds::<ActivityGovernorAcquireWakeLeaseRequest>(offset);
881            // Delegate to tuple encoding.
882            fidl::encoding::Encode::<ActivityGovernorAcquireWakeLeaseRequest, D>::encode(
883                (<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
884                    &self.name,
885                ),),
886                encoder,
887                offset,
888                _depth,
889            )
890        }
891    }
892    unsafe impl<
893            D: fidl::encoding::ResourceDialect,
894            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
895        > fidl::encoding::Encode<ActivityGovernorAcquireWakeLeaseRequest, D> for (T0,)
896    {
897        #[inline]
898        unsafe fn encode(
899            self,
900            encoder: &mut fidl::encoding::Encoder<'_, D>,
901            offset: usize,
902            depth: fidl::encoding::Depth,
903        ) -> fidl::Result<()> {
904            encoder.debug_check_bounds::<ActivityGovernorAcquireWakeLeaseRequest>(offset);
905            // Zero out padding regions. There's no need to apply masks
906            // because the unmasked parts will be overwritten by fields.
907            // Write the fields.
908            self.0.encode(encoder, offset + 0, depth)?;
909            Ok(())
910        }
911    }
912
913    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
914        for ActivityGovernorAcquireWakeLeaseRequest
915    {
916        #[inline(always)]
917        fn new_empty() -> Self {
918            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<64>, D) }
919        }
920
921        #[inline]
922        unsafe fn decode(
923            &mut self,
924            decoder: &mut fidl::encoding::Decoder<'_, D>,
925            offset: usize,
926            _depth: fidl::encoding::Depth,
927        ) -> fidl::Result<()> {
928            decoder.debug_check_bounds::<Self>(offset);
929            // Verify that padding bytes are zero.
930            fidl::decode!(
931                fidl::encoding::BoundedString<64>,
932                D,
933                &mut self.name,
934                decoder,
935                offset + 0,
936                _depth
937            )?;
938            Ok(())
939        }
940    }
941
942    impl fidl::encoding::ValueTypeMarker for ActivityGovernorTakeApplicationActivityLeaseRequest {
943        type Borrowed<'a> = &'a Self;
944        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
945            value
946        }
947    }
948
949    unsafe impl fidl::encoding::TypeMarker for ActivityGovernorTakeApplicationActivityLeaseRequest {
950        type Owned = Self;
951
952        #[inline(always)]
953        fn inline_align(_context: fidl::encoding::Context) -> usize {
954            8
955        }
956
957        #[inline(always)]
958        fn inline_size(_context: fidl::encoding::Context) -> usize {
959            16
960        }
961    }
962
963    unsafe impl<D: fidl::encoding::ResourceDialect>
964        fidl::encoding::Encode<ActivityGovernorTakeApplicationActivityLeaseRequest, D>
965        for &ActivityGovernorTakeApplicationActivityLeaseRequest
966    {
967        #[inline]
968        unsafe fn encode(
969            self,
970            encoder: &mut fidl::encoding::Encoder<'_, D>,
971            offset: usize,
972            _depth: fidl::encoding::Depth,
973        ) -> fidl::Result<()> {
974            encoder
975                .debug_check_bounds::<ActivityGovernorTakeApplicationActivityLeaseRequest>(offset);
976            // Delegate to tuple encoding.
977            fidl::encoding::Encode::<ActivityGovernorTakeApplicationActivityLeaseRequest, D>::encode(
978                (<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
979                    &self.name,
980                ),),
981                encoder,
982                offset,
983                _depth,
984            )
985        }
986    }
987    unsafe impl<
988            D: fidl::encoding::ResourceDialect,
989            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
990        > fidl::encoding::Encode<ActivityGovernorTakeApplicationActivityLeaseRequest, D> for (T0,)
991    {
992        #[inline]
993        unsafe fn encode(
994            self,
995            encoder: &mut fidl::encoding::Encoder<'_, D>,
996            offset: usize,
997            depth: fidl::encoding::Depth,
998        ) -> fidl::Result<()> {
999            encoder
1000                .debug_check_bounds::<ActivityGovernorTakeApplicationActivityLeaseRequest>(offset);
1001            // Zero out padding regions. There's no need to apply masks
1002            // because the unmasked parts will be overwritten by fields.
1003            // Write the fields.
1004            self.0.encode(encoder, offset + 0, depth)?;
1005            Ok(())
1006        }
1007    }
1008
1009    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1010        for ActivityGovernorTakeApplicationActivityLeaseRequest
1011    {
1012        #[inline(always)]
1013        fn new_empty() -> Self {
1014            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<64>, D) }
1015        }
1016
1017        #[inline]
1018        unsafe fn decode(
1019            &mut self,
1020            decoder: &mut fidl::encoding::Decoder<'_, D>,
1021            offset: usize,
1022            _depth: fidl::encoding::Depth,
1023        ) -> fidl::Result<()> {
1024            decoder.debug_check_bounds::<Self>(offset);
1025            // Verify that padding bytes are zero.
1026            fidl::decode!(
1027                fidl::encoding::BoundedString<64>,
1028                D,
1029                &mut self.name,
1030                decoder,
1031                offset + 0,
1032                _depth
1033            )?;
1034            Ok(())
1035        }
1036    }
1037
1038    impl fidl::encoding::ValueTypeMarker for ActivityGovernorTakeWakeLeaseRequest {
1039        type Borrowed<'a> = &'a Self;
1040        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1041            value
1042        }
1043    }
1044
1045    unsafe impl fidl::encoding::TypeMarker for ActivityGovernorTakeWakeLeaseRequest {
1046        type Owned = Self;
1047
1048        #[inline(always)]
1049        fn inline_align(_context: fidl::encoding::Context) -> usize {
1050            8
1051        }
1052
1053        #[inline(always)]
1054        fn inline_size(_context: fidl::encoding::Context) -> usize {
1055            16
1056        }
1057    }
1058
1059    unsafe impl<D: fidl::encoding::ResourceDialect>
1060        fidl::encoding::Encode<ActivityGovernorTakeWakeLeaseRequest, D>
1061        for &ActivityGovernorTakeWakeLeaseRequest
1062    {
1063        #[inline]
1064        unsafe fn encode(
1065            self,
1066            encoder: &mut fidl::encoding::Encoder<'_, D>,
1067            offset: usize,
1068            _depth: fidl::encoding::Depth,
1069        ) -> fidl::Result<()> {
1070            encoder.debug_check_bounds::<ActivityGovernorTakeWakeLeaseRequest>(offset);
1071            // Delegate to tuple encoding.
1072            fidl::encoding::Encode::<ActivityGovernorTakeWakeLeaseRequest, D>::encode(
1073                (<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
1074                    &self.name,
1075                ),),
1076                encoder,
1077                offset,
1078                _depth,
1079            )
1080        }
1081    }
1082    unsafe impl<
1083            D: fidl::encoding::ResourceDialect,
1084            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
1085        > fidl::encoding::Encode<ActivityGovernorTakeWakeLeaseRequest, D> for (T0,)
1086    {
1087        #[inline]
1088        unsafe fn encode(
1089            self,
1090            encoder: &mut fidl::encoding::Encoder<'_, D>,
1091            offset: usize,
1092            depth: fidl::encoding::Depth,
1093        ) -> fidl::Result<()> {
1094            encoder.debug_check_bounds::<ActivityGovernorTakeWakeLeaseRequest>(offset);
1095            // Zero out padding regions. There's no need to apply masks
1096            // because the unmasked parts will be overwritten by fields.
1097            // Write the fields.
1098            self.0.encode(encoder, offset + 0, depth)?;
1099            Ok(())
1100        }
1101    }
1102
1103    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1104        for ActivityGovernorTakeWakeLeaseRequest
1105    {
1106        #[inline(always)]
1107        fn new_empty() -> Self {
1108            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<64>, D) }
1109        }
1110
1111        #[inline]
1112        unsafe fn decode(
1113            &mut self,
1114            decoder: &mut fidl::encoding::Decoder<'_, D>,
1115            offset: usize,
1116            _depth: fidl::encoding::Depth,
1117        ) -> fidl::Result<()> {
1118            decoder.debug_check_bounds::<Self>(offset);
1119            // Verify that padding bytes are zero.
1120            fidl::decode!(
1121                fidl::encoding::BoundedString<64>,
1122                D,
1123                &mut self.name,
1124                decoder,
1125                offset + 0,
1126                _depth
1127            )?;
1128            Ok(())
1129        }
1130    }
1131}