1#![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#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
15pub enum AcquireWakeLeaseError {
16 Internal,
18 InvalidName,
20 #[doc(hidden)]
21 __SourceBreaking { unknown_ordinal: u32 },
22}
23
24#[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#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
77pub enum AddExecutionStateDependencyError {
78 InvalidArgs,
80 BadState,
82 #[doc(hidden)]
83 __SourceBreaking { unknown_ordinal: u32 },
84}
85
86#[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#[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#[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#[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#[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#[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#[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#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
344pub enum RegisterSuspendBlockerError {
345 Internal,
347 InvalidArgs,
349 #[doc(hidden)]
350 __SourceBreaking { unknown_ordinal: u32 },
351}
352
353#[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 ActivityGovernorAcquireUnmonitoredWakeLeaseRequest {
405 pub name: String,
409}
410
411impl fidl::Persistable for ActivityGovernorAcquireUnmonitoredWakeLeaseRequest {}
412
413#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
414pub struct ActivityGovernorAcquireWakeLeaseRequest {
415 pub name: String,
419}
420
421impl fidl::Persistable for ActivityGovernorAcquireWakeLeaseRequest {}
422
423#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
424pub struct ActivityGovernorTakeApplicationActivityLeaseRequest {
425 pub name: String,
429}
430
431impl fidl::Persistable for ActivityGovernorTakeApplicationActivityLeaseRequest {}
432
433pub mod activity_governor_ordinals {
434 pub const GET_POWER_ELEMENTS: u64 = 0x798003259dfb5672;
435 pub const ACQUIRE_WAKE_LEASE: u64 = 0x2de25abd8fa7c103;
436 pub const ACQUIRE_UNMONITORED_WAKE_LEASE: u64 = 0x5f7007d6b0786da9;
437 pub const ACQUIRE_WAKE_LEASE_WITH_TOKEN: u64 = 0x1cdd2ea3bee46f51;
438 pub const TAKE_APPLICATION_ACTIVITY_LEASE: u64 = 0x37cd5364de7ada14;
439 pub const REGISTER_SUSPEND_BLOCKER: u64 = 0x34ef55b180feef01;
440}
441
442pub mod boot_control_ordinals {
443 pub const SET_BOOT_COMPLETE: u64 = 0x3c9b9f24ad3ca2b5;
444}
445
446pub mod cpu_element_manager_ordinals {
447 pub const GET_CPU_DEPENDENCY_TOKEN: u64 = 0x2c43645ed70344ba;
448 pub const ADD_EXECUTION_STATE_DEPENDENCY: u64 = 0xdf2f5ea2af76234;
449}
450
451pub mod suspend_blocker_ordinals {
452 pub const BEFORE_SUSPEND: u64 = 0x6b569393a01a6d80;
453 pub const AFTER_RESUME: u64 = 0x6a329cfcc73f2dea;
454}
455
456mod internal {
457 use super::*;
458 unsafe impl fidl::encoding::TypeMarker for AcquireWakeLeaseError {
459 type Owned = Self;
460
461 #[inline(always)]
462 fn inline_align(_context: fidl::encoding::Context) -> usize {
463 std::mem::align_of::<u32>()
464 }
465
466 #[inline(always)]
467 fn inline_size(_context: fidl::encoding::Context) -> usize {
468 std::mem::size_of::<u32>()
469 }
470
471 #[inline(always)]
472 fn encode_is_copy() -> bool {
473 false
474 }
475
476 #[inline(always)]
477 fn decode_is_copy() -> bool {
478 false
479 }
480 }
481
482 impl fidl::encoding::ValueTypeMarker for AcquireWakeLeaseError {
483 type Borrowed<'a> = Self;
484 #[inline(always)]
485 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
486 *value
487 }
488 }
489
490 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
491 for AcquireWakeLeaseError
492 {
493 #[inline]
494 unsafe fn encode(
495 self,
496 encoder: &mut fidl::encoding::Encoder<'_, D>,
497 offset: usize,
498 _depth: fidl::encoding::Depth,
499 ) -> fidl::Result<()> {
500 encoder.debug_check_bounds::<Self>(offset);
501 encoder.write_num(self.into_primitive(), offset);
502 Ok(())
503 }
504 }
505
506 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AcquireWakeLeaseError {
507 #[inline(always)]
508 fn new_empty() -> Self {
509 Self::unknown()
510 }
511
512 #[inline]
513 unsafe fn decode(
514 &mut self,
515 decoder: &mut fidl::encoding::Decoder<'_, D>,
516 offset: usize,
517 _depth: fidl::encoding::Depth,
518 ) -> fidl::Result<()> {
519 decoder.debug_check_bounds::<Self>(offset);
520 let prim = decoder.read_num::<u32>(offset);
521
522 *self = Self::from_primitive_allow_unknown(prim);
523 Ok(())
524 }
525 }
526 unsafe impl fidl::encoding::TypeMarker for AddExecutionStateDependencyError {
527 type Owned = Self;
528
529 #[inline(always)]
530 fn inline_align(_context: fidl::encoding::Context) -> usize {
531 std::mem::align_of::<u32>()
532 }
533
534 #[inline(always)]
535 fn inline_size(_context: fidl::encoding::Context) -> usize {
536 std::mem::size_of::<u32>()
537 }
538
539 #[inline(always)]
540 fn encode_is_copy() -> bool {
541 false
542 }
543
544 #[inline(always)]
545 fn decode_is_copy() -> bool {
546 false
547 }
548 }
549
550 impl fidl::encoding::ValueTypeMarker for AddExecutionStateDependencyError {
551 type Borrowed<'a> = Self;
552 #[inline(always)]
553 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
554 *value
555 }
556 }
557
558 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
559 for AddExecutionStateDependencyError
560 {
561 #[inline]
562 unsafe fn encode(
563 self,
564 encoder: &mut fidl::encoding::Encoder<'_, D>,
565 offset: usize,
566 _depth: fidl::encoding::Depth,
567 ) -> fidl::Result<()> {
568 encoder.debug_check_bounds::<Self>(offset);
569 encoder.write_num(self.into_primitive(), offset);
570 Ok(())
571 }
572 }
573
574 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
575 for AddExecutionStateDependencyError
576 {
577 #[inline(always)]
578 fn new_empty() -> Self {
579 Self::unknown()
580 }
581
582 #[inline]
583 unsafe fn decode(
584 &mut self,
585 decoder: &mut fidl::encoding::Decoder<'_, D>,
586 offset: usize,
587 _depth: fidl::encoding::Depth,
588 ) -> fidl::Result<()> {
589 decoder.debug_check_bounds::<Self>(offset);
590 let prim = decoder.read_num::<u32>(offset);
591
592 *self = Self::from_primitive_allow_unknown(prim);
593 Ok(())
594 }
595 }
596 unsafe impl fidl::encoding::TypeMarker for ApplicationActivityLevel {
597 type Owned = Self;
598
599 #[inline(always)]
600 fn inline_align(_context: fidl::encoding::Context) -> usize {
601 std::mem::align_of::<u8>()
602 }
603
604 #[inline(always)]
605 fn inline_size(_context: fidl::encoding::Context) -> usize {
606 std::mem::size_of::<u8>()
607 }
608
609 #[inline(always)]
610 fn encode_is_copy() -> bool {
611 false
612 }
613
614 #[inline(always)]
615 fn decode_is_copy() -> bool {
616 false
617 }
618 }
619
620 impl fidl::encoding::ValueTypeMarker for ApplicationActivityLevel {
621 type Borrowed<'a> = Self;
622 #[inline(always)]
623 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
624 *value
625 }
626 }
627
628 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
629 for ApplicationActivityLevel
630 {
631 #[inline]
632 unsafe fn encode(
633 self,
634 encoder: &mut fidl::encoding::Encoder<'_, D>,
635 offset: usize,
636 _depth: fidl::encoding::Depth,
637 ) -> fidl::Result<()> {
638 encoder.debug_check_bounds::<Self>(offset);
639 encoder.write_num(self.into_primitive(), offset);
640 Ok(())
641 }
642 }
643
644 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
645 for ApplicationActivityLevel
646 {
647 #[inline(always)]
648 fn new_empty() -> Self {
649 Self::unknown()
650 }
651
652 #[inline]
653 unsafe fn decode(
654 &mut self,
655 decoder: &mut fidl::encoding::Decoder<'_, D>,
656 offset: usize,
657 _depth: fidl::encoding::Depth,
658 ) -> fidl::Result<()> {
659 decoder.debug_check_bounds::<Self>(offset);
660 let prim = decoder.read_num::<u8>(offset);
661
662 *self = Self::from_primitive_allow_unknown(prim);
663 Ok(())
664 }
665 }
666 unsafe impl fidl::encoding::TypeMarker for CpuLevel {
667 type Owned = Self;
668
669 #[inline(always)]
670 fn inline_align(_context: fidl::encoding::Context) -> usize {
671 std::mem::align_of::<u8>()
672 }
673
674 #[inline(always)]
675 fn inline_size(_context: fidl::encoding::Context) -> usize {
676 std::mem::size_of::<u8>()
677 }
678
679 #[inline(always)]
680 fn encode_is_copy() -> bool {
681 false
682 }
683
684 #[inline(always)]
685 fn decode_is_copy() -> bool {
686 false
687 }
688 }
689
690 impl fidl::encoding::ValueTypeMarker for CpuLevel {
691 type Borrowed<'a> = Self;
692 #[inline(always)]
693 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
694 *value
695 }
696 }
697
698 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CpuLevel {
699 #[inline]
700 unsafe fn encode(
701 self,
702 encoder: &mut fidl::encoding::Encoder<'_, D>,
703 offset: usize,
704 _depth: fidl::encoding::Depth,
705 ) -> fidl::Result<()> {
706 encoder.debug_check_bounds::<Self>(offset);
707 encoder.write_num(self.into_primitive(), offset);
708 Ok(())
709 }
710 }
711
712 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CpuLevel {
713 #[inline(always)]
714 fn new_empty() -> Self {
715 Self::unknown()
716 }
717
718 #[inline]
719 unsafe fn decode(
720 &mut self,
721 decoder: &mut fidl::encoding::Decoder<'_, D>,
722 offset: usize,
723 _depth: fidl::encoding::Depth,
724 ) -> fidl::Result<()> {
725 decoder.debug_check_bounds::<Self>(offset);
726 let prim = decoder.read_num::<u8>(offset);
727
728 *self = Self::from_primitive_allow_unknown(prim);
729 Ok(())
730 }
731 }
732 unsafe impl fidl::encoding::TypeMarker for ExecutionStateLevel {
733 type Owned = Self;
734
735 #[inline(always)]
736 fn inline_align(_context: fidl::encoding::Context) -> usize {
737 std::mem::align_of::<u8>()
738 }
739
740 #[inline(always)]
741 fn inline_size(_context: fidl::encoding::Context) -> usize {
742 std::mem::size_of::<u8>()
743 }
744
745 #[inline(always)]
746 fn encode_is_copy() -> bool {
747 false
748 }
749
750 #[inline(always)]
751 fn decode_is_copy() -> bool {
752 false
753 }
754 }
755
756 impl fidl::encoding::ValueTypeMarker for ExecutionStateLevel {
757 type Borrowed<'a> = Self;
758 #[inline(always)]
759 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
760 *value
761 }
762 }
763
764 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
765 for ExecutionStateLevel
766 {
767 #[inline]
768 unsafe fn encode(
769 self,
770 encoder: &mut fidl::encoding::Encoder<'_, D>,
771 offset: usize,
772 _depth: fidl::encoding::Depth,
773 ) -> fidl::Result<()> {
774 encoder.debug_check_bounds::<Self>(offset);
775 encoder.write_num(self.into_primitive(), offset);
776 Ok(())
777 }
778 }
779
780 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ExecutionStateLevel {
781 #[inline(always)]
782 fn new_empty() -> Self {
783 Self::unknown()
784 }
785
786 #[inline]
787 unsafe fn decode(
788 &mut self,
789 decoder: &mut fidl::encoding::Decoder<'_, D>,
790 offset: usize,
791 _depth: fidl::encoding::Depth,
792 ) -> fidl::Result<()> {
793 decoder.debug_check_bounds::<Self>(offset);
794 let prim = decoder.read_num::<u8>(offset);
795
796 *self = Self::from_primitive_allow_unknown(prim);
797 Ok(())
798 }
799 }
800 unsafe impl fidl::encoding::TypeMarker for RegisterSuspendBlockerError {
801 type Owned = Self;
802
803 #[inline(always)]
804 fn inline_align(_context: fidl::encoding::Context) -> usize {
805 std::mem::align_of::<u32>()
806 }
807
808 #[inline(always)]
809 fn inline_size(_context: fidl::encoding::Context) -> usize {
810 std::mem::size_of::<u32>()
811 }
812
813 #[inline(always)]
814 fn encode_is_copy() -> bool {
815 false
816 }
817
818 #[inline(always)]
819 fn decode_is_copy() -> bool {
820 false
821 }
822 }
823
824 impl fidl::encoding::ValueTypeMarker for RegisterSuspendBlockerError {
825 type Borrowed<'a> = Self;
826 #[inline(always)]
827 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
828 *value
829 }
830 }
831
832 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
833 for RegisterSuspendBlockerError
834 {
835 #[inline]
836 unsafe fn encode(
837 self,
838 encoder: &mut fidl::encoding::Encoder<'_, D>,
839 offset: usize,
840 _depth: fidl::encoding::Depth,
841 ) -> fidl::Result<()> {
842 encoder.debug_check_bounds::<Self>(offset);
843 encoder.write_num(self.into_primitive(), offset);
844 Ok(())
845 }
846 }
847
848 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
849 for RegisterSuspendBlockerError
850 {
851 #[inline(always)]
852 fn new_empty() -> Self {
853 Self::unknown()
854 }
855
856 #[inline]
857 unsafe fn decode(
858 &mut self,
859 decoder: &mut fidl::encoding::Decoder<'_, D>,
860 offset: usize,
861 _depth: fidl::encoding::Depth,
862 ) -> fidl::Result<()> {
863 decoder.debug_check_bounds::<Self>(offset);
864 let prim = decoder.read_num::<u32>(offset);
865
866 *self = Self::from_primitive_allow_unknown(prim);
867 Ok(())
868 }
869 }
870
871 impl fidl::encoding::ValueTypeMarker for ActivityGovernorAcquireUnmonitoredWakeLeaseRequest {
872 type Borrowed<'a> = &'a Self;
873 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
874 value
875 }
876 }
877
878 unsafe impl fidl::encoding::TypeMarker for ActivityGovernorAcquireUnmonitoredWakeLeaseRequest {
879 type Owned = Self;
880
881 #[inline(always)]
882 fn inline_align(_context: fidl::encoding::Context) -> usize {
883 8
884 }
885
886 #[inline(always)]
887 fn inline_size(_context: fidl::encoding::Context) -> usize {
888 16
889 }
890 }
891
892 unsafe impl<D: fidl::encoding::ResourceDialect>
893 fidl::encoding::Encode<ActivityGovernorAcquireUnmonitoredWakeLeaseRequest, D>
894 for &ActivityGovernorAcquireUnmonitoredWakeLeaseRequest
895 {
896 #[inline]
897 unsafe fn encode(
898 self,
899 encoder: &mut fidl::encoding::Encoder<'_, D>,
900 offset: usize,
901 _depth: fidl::encoding::Depth,
902 ) -> fidl::Result<()> {
903 encoder
904 .debug_check_bounds::<ActivityGovernorAcquireUnmonitoredWakeLeaseRequest>(offset);
905 fidl::encoding::Encode::<ActivityGovernorAcquireUnmonitoredWakeLeaseRequest, D>::encode(
907 (<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
908 &self.name,
909 ),),
910 encoder,
911 offset,
912 _depth,
913 )
914 }
915 }
916 unsafe impl<
917 D: fidl::encoding::ResourceDialect,
918 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
919 > fidl::encoding::Encode<ActivityGovernorAcquireUnmonitoredWakeLeaseRequest, D> for (T0,)
920 {
921 #[inline]
922 unsafe fn encode(
923 self,
924 encoder: &mut fidl::encoding::Encoder<'_, D>,
925 offset: usize,
926 depth: fidl::encoding::Depth,
927 ) -> fidl::Result<()> {
928 encoder
929 .debug_check_bounds::<ActivityGovernorAcquireUnmonitoredWakeLeaseRequest>(offset);
930 self.0.encode(encoder, offset + 0, depth)?;
934 Ok(())
935 }
936 }
937
938 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
939 for ActivityGovernorAcquireUnmonitoredWakeLeaseRequest
940 {
941 #[inline(always)]
942 fn new_empty() -> Self {
943 Self { name: fidl::new_empty!(fidl::encoding::BoundedString<64>, D) }
944 }
945
946 #[inline]
947 unsafe fn decode(
948 &mut self,
949 decoder: &mut fidl::encoding::Decoder<'_, D>,
950 offset: usize,
951 _depth: fidl::encoding::Depth,
952 ) -> fidl::Result<()> {
953 decoder.debug_check_bounds::<Self>(offset);
954 fidl::decode!(
956 fidl::encoding::BoundedString<64>,
957 D,
958 &mut self.name,
959 decoder,
960 offset + 0,
961 _depth
962 )?;
963 Ok(())
964 }
965 }
966
967 impl fidl::encoding::ValueTypeMarker for ActivityGovernorAcquireWakeLeaseRequest {
968 type Borrowed<'a> = &'a Self;
969 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
970 value
971 }
972 }
973
974 unsafe impl fidl::encoding::TypeMarker for ActivityGovernorAcquireWakeLeaseRequest {
975 type Owned = Self;
976
977 #[inline(always)]
978 fn inline_align(_context: fidl::encoding::Context) -> usize {
979 8
980 }
981
982 #[inline(always)]
983 fn inline_size(_context: fidl::encoding::Context) -> usize {
984 16
985 }
986 }
987
988 unsafe impl<D: fidl::encoding::ResourceDialect>
989 fidl::encoding::Encode<ActivityGovernorAcquireWakeLeaseRequest, D>
990 for &ActivityGovernorAcquireWakeLeaseRequest
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.debug_check_bounds::<ActivityGovernorAcquireWakeLeaseRequest>(offset);
1000 fidl::encoding::Encode::<ActivityGovernorAcquireWakeLeaseRequest, D>::encode(
1002 (<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
1003 &self.name,
1004 ),),
1005 encoder,
1006 offset,
1007 _depth,
1008 )
1009 }
1010 }
1011 unsafe impl<
1012 D: fidl::encoding::ResourceDialect,
1013 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
1014 > fidl::encoding::Encode<ActivityGovernorAcquireWakeLeaseRequest, D> for (T0,)
1015 {
1016 #[inline]
1017 unsafe fn encode(
1018 self,
1019 encoder: &mut fidl::encoding::Encoder<'_, D>,
1020 offset: usize,
1021 depth: fidl::encoding::Depth,
1022 ) -> fidl::Result<()> {
1023 encoder.debug_check_bounds::<ActivityGovernorAcquireWakeLeaseRequest>(offset);
1024 self.0.encode(encoder, offset + 0, depth)?;
1028 Ok(())
1029 }
1030 }
1031
1032 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1033 for ActivityGovernorAcquireWakeLeaseRequest
1034 {
1035 #[inline(always)]
1036 fn new_empty() -> Self {
1037 Self { name: fidl::new_empty!(fidl::encoding::BoundedString<64>, D) }
1038 }
1039
1040 #[inline]
1041 unsafe fn decode(
1042 &mut self,
1043 decoder: &mut fidl::encoding::Decoder<'_, D>,
1044 offset: usize,
1045 _depth: fidl::encoding::Depth,
1046 ) -> fidl::Result<()> {
1047 decoder.debug_check_bounds::<Self>(offset);
1048 fidl::decode!(
1050 fidl::encoding::BoundedString<64>,
1051 D,
1052 &mut self.name,
1053 decoder,
1054 offset + 0,
1055 _depth
1056 )?;
1057 Ok(())
1058 }
1059 }
1060
1061 impl fidl::encoding::ValueTypeMarker for ActivityGovernorTakeApplicationActivityLeaseRequest {
1062 type Borrowed<'a> = &'a Self;
1063 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1064 value
1065 }
1066 }
1067
1068 unsafe impl fidl::encoding::TypeMarker for ActivityGovernorTakeApplicationActivityLeaseRequest {
1069 type Owned = Self;
1070
1071 #[inline(always)]
1072 fn inline_align(_context: fidl::encoding::Context) -> usize {
1073 8
1074 }
1075
1076 #[inline(always)]
1077 fn inline_size(_context: fidl::encoding::Context) -> usize {
1078 16
1079 }
1080 }
1081
1082 unsafe impl<D: fidl::encoding::ResourceDialect>
1083 fidl::encoding::Encode<ActivityGovernorTakeApplicationActivityLeaseRequest, D>
1084 for &ActivityGovernorTakeApplicationActivityLeaseRequest
1085 {
1086 #[inline]
1087 unsafe fn encode(
1088 self,
1089 encoder: &mut fidl::encoding::Encoder<'_, D>,
1090 offset: usize,
1091 _depth: fidl::encoding::Depth,
1092 ) -> fidl::Result<()> {
1093 encoder
1094 .debug_check_bounds::<ActivityGovernorTakeApplicationActivityLeaseRequest>(offset);
1095 fidl::encoding::Encode::<ActivityGovernorTakeApplicationActivityLeaseRequest, D>::encode(
1097 (<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
1098 &self.name,
1099 ),),
1100 encoder,
1101 offset,
1102 _depth,
1103 )
1104 }
1105 }
1106 unsafe impl<
1107 D: fidl::encoding::ResourceDialect,
1108 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
1109 > fidl::encoding::Encode<ActivityGovernorTakeApplicationActivityLeaseRequest, D> for (T0,)
1110 {
1111 #[inline]
1112 unsafe fn encode(
1113 self,
1114 encoder: &mut fidl::encoding::Encoder<'_, D>,
1115 offset: usize,
1116 depth: fidl::encoding::Depth,
1117 ) -> fidl::Result<()> {
1118 encoder
1119 .debug_check_bounds::<ActivityGovernorTakeApplicationActivityLeaseRequest>(offset);
1120 self.0.encode(encoder, offset + 0, depth)?;
1124 Ok(())
1125 }
1126 }
1127
1128 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1129 for ActivityGovernorTakeApplicationActivityLeaseRequest
1130 {
1131 #[inline(always)]
1132 fn new_empty() -> Self {
1133 Self { name: fidl::new_empty!(fidl::encoding::BoundedString<64>, D) }
1134 }
1135
1136 #[inline]
1137 unsafe fn decode(
1138 &mut self,
1139 decoder: &mut fidl::encoding::Decoder<'_, D>,
1140 offset: usize,
1141 _depth: fidl::encoding::Depth,
1142 ) -> fidl::Result<()> {
1143 decoder.debug_check_bounds::<Self>(offset);
1144 fidl::decode!(
1146 fidl::encoding::BoundedString<64>,
1147 D,
1148 &mut self.name,
1149 decoder,
1150 offset + 0,
1151 _depth
1152 )?;
1153 Ok(())
1154 }
1155 }
1156}