1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 pub use fidl_next_common_fuchsia_power_system::natural::*;
8
9 pub type LeaseToken = ::fidl_next::fuchsia::zx::EventPair;
10
11 #[derive(Debug, PartialEq)]
12 #[repr(C)]
13 pub struct ActivityGovernorAcquireWakeLeaseResponse {
14 pub token: ::fidl_next::fuchsia::zx::EventPair,
15 }
16
17 unsafe impl<___E>
18 ::fidl_next::Encode<crate::wire::ActivityGovernorAcquireWakeLeaseResponse, ___E>
19 for ActivityGovernorAcquireWakeLeaseResponse
20 where
21 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
22 ___E: ::fidl_next::fuchsia::HandleEncoder,
23 {
24 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
25 Self,
26 crate::wire::ActivityGovernorAcquireWakeLeaseResponse,
27 > = unsafe {
28 ::fidl_next::CopyOptimization::enable_if(
29 true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::Encode<
30 ::fidl_next::wire::fuchsia::EventPair,
31 ___E,
32 >>::COPY_OPTIMIZATION
33 .is_enabled(),
34 )
35 };
36
37 #[inline]
38 fn encode(
39 self,
40 encoder_: &mut ___E,
41 out_: &mut ::core::mem::MaybeUninit<
42 crate::wire::ActivityGovernorAcquireWakeLeaseResponse,
43 >,
44 _: (),
45 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
46 ::fidl_next::munge! {
47 let crate::wire::ActivityGovernorAcquireWakeLeaseResponse {
48 token,
49
50 } = out_;
51 }
52
53 ::fidl_next::Encode::encode(self.token, encoder_, token, ())?;
54
55 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(token.as_mut_ptr()) };
56
57 Ok(())
58 }
59 }
60
61 unsafe impl<___E>
62 ::fidl_next::EncodeOption<
63 ::fidl_next::wire::Box<'static, crate::wire::ActivityGovernorAcquireWakeLeaseResponse>,
64 ___E,
65 > for ActivityGovernorAcquireWakeLeaseResponse
66 where
67 ___E: ::fidl_next::Encoder + ?Sized,
68 ActivityGovernorAcquireWakeLeaseResponse:
69 ::fidl_next::Encode<crate::wire::ActivityGovernorAcquireWakeLeaseResponse, ___E>,
70 {
71 #[inline]
72 fn encode_option(
73 this: ::core::option::Option<Self>,
74 encoder: &mut ___E,
75 out: &mut ::core::mem::MaybeUninit<
76 ::fidl_next::wire::Box<
77 'static,
78 crate::wire::ActivityGovernorAcquireWakeLeaseResponse,
79 >,
80 >,
81 _: (),
82 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
83 if let Some(inner) = this {
84 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
85 ::fidl_next::wire::Box::encode_present(out);
86 } else {
87 ::fidl_next::wire::Box::encode_absent(out);
88 }
89
90 Ok(())
91 }
92 }
93
94 impl ::fidl_next::FromWire<crate::wire::ActivityGovernorAcquireWakeLeaseResponse>
95 for ActivityGovernorAcquireWakeLeaseResponse
96 {
97 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
98 crate::wire::ActivityGovernorAcquireWakeLeaseResponse,
99 Self,
100 > = unsafe {
101 ::fidl_next::CopyOptimization::enable_if(
102 true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::FromWire<
103 ::fidl_next::wire::fuchsia::EventPair,
104 >>::COPY_OPTIMIZATION
105 .is_enabled(),
106 )
107 };
108
109 #[inline]
110 fn from_wire(wire: crate::wire::ActivityGovernorAcquireWakeLeaseResponse) -> Self {
111 Self { token: ::fidl_next::FromWire::from_wire(wire.token) }
112 }
113 }
114
115 #[derive(Debug, Default, PartialEq)]
116 pub struct ActivityGovernorRegisterSuspendBlockerRequest {
117 pub suspend_blocker: ::core::option::Option<
118 ::fidl_next::ClientEnd<crate::SuspendBlocker, ::fidl_next::fuchsia::zx::Channel>,
119 >,
120
121 pub name: ::core::option::Option<::std::string::String>,
122 }
123
124 impl ActivityGovernorRegisterSuspendBlockerRequest {
125 fn __max_ordinal(&self) -> usize {
126 if self.name.is_some() {
127 return 2;
128 }
129
130 if self.suspend_blocker.is_some() {
131 return 1;
132 }
133
134 0
135 }
136 }
137
138 unsafe impl<___E>
139 ::fidl_next::Encode<
140 crate::wire::ActivityGovernorRegisterSuspendBlockerRequest<'static>,
141 ___E,
142 > for ActivityGovernorRegisterSuspendBlockerRequest
143 where
144 ___E: ::fidl_next::Encoder + ?Sized,
145 ___E: ::fidl_next::fuchsia::HandleEncoder,
146 {
147 #[inline]
148 fn encode(
149 mut self,
150 encoder: &mut ___E,
151 out: &mut ::core::mem::MaybeUninit<
152 crate::wire::ActivityGovernorRegisterSuspendBlockerRequest<'static>,
153 >,
154 _: (),
155 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
156 ::fidl_next::munge!(let crate::wire::ActivityGovernorRegisterSuspendBlockerRequest { table } = out);
157
158 let max_ord = self.__max_ordinal();
159
160 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
161 ::fidl_next::Wire::zero_padding(&mut out);
162
163 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
164 ::fidl_next::wire::Envelope,
165 >(encoder, max_ord);
166
167 for i in 1..=max_ord {
168 match i {
169 2 => {
170 if let Some(value) = self.name.take() {
171 ::fidl_next::wire::Envelope::encode_value::<
172 ::fidl_next::wire::String<'static>,
173 ___E,
174 >(
175 value, preallocated.encoder, &mut out, 64
176 )?;
177 } else {
178 ::fidl_next::wire::Envelope::encode_zero(&mut out)
179 }
180 }
181
182 1 => {
183 if let Some(value) = self.suspend_blocker.take() {
184 ::fidl_next::wire::Envelope::encode_value::<
185 ::fidl_next::ClientEnd<
186 crate::SuspendBlocker,
187 ::fidl_next::wire::fuchsia::Channel,
188 >,
189 ___E,
190 >(
191 value, preallocated.encoder, &mut out, ()
192 )?;
193 } else {
194 ::fidl_next::wire::Envelope::encode_zero(&mut out)
195 }
196 }
197
198 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
199 }
200 unsafe {
201 preallocated.write_next(out.assume_init_ref());
202 }
203 }
204
205 ::fidl_next::wire::Table::encode_len(table, max_ord);
206
207 Ok(())
208 }
209 }
210
211 impl<'de> ::fidl_next::FromWire<crate::wire::ActivityGovernorRegisterSuspendBlockerRequest<'de>>
212 for ActivityGovernorRegisterSuspendBlockerRequest
213 {
214 #[inline]
215 fn from_wire(
216 wire_: crate::wire::ActivityGovernorRegisterSuspendBlockerRequest<'de>,
217 ) -> Self {
218 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
219
220 let suspend_blocker = wire_.table.get(1);
221
222 let name = wire_.table.get(2);
223
224 Self {
225 suspend_blocker: suspend_blocker.map(|envelope| {
226 ::fidl_next::FromWire::from_wire(unsafe {
227 envelope.read_unchecked::<::fidl_next::ClientEnd<
228 crate::SuspendBlocker,
229 ::fidl_next::wire::fuchsia::Channel,
230 >>()
231 })
232 }),
233
234 name: name.map(|envelope| {
235 ::fidl_next::FromWire::from_wire(unsafe {
236 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
237 })
238 }),
239 }
240 }
241 }
242
243 #[derive(Debug, PartialEq)]
244 #[repr(C)]
245 pub struct ActivityGovernorRegisterSuspendBlockerResponse {
246 pub token: ::fidl_next::fuchsia::zx::EventPair,
247 }
248
249 unsafe impl<___E>
250 ::fidl_next::Encode<crate::wire::ActivityGovernorRegisterSuspendBlockerResponse, ___E>
251 for ActivityGovernorRegisterSuspendBlockerResponse
252 where
253 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
254 ___E: ::fidl_next::fuchsia::HandleEncoder,
255 {
256 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
257 Self,
258 crate::wire::ActivityGovernorRegisterSuspendBlockerResponse,
259 > = unsafe {
260 ::fidl_next::CopyOptimization::enable_if(
261 true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::Encode<
262 ::fidl_next::wire::fuchsia::EventPair,
263 ___E,
264 >>::COPY_OPTIMIZATION
265 .is_enabled(),
266 )
267 };
268
269 #[inline]
270 fn encode(
271 self,
272 encoder_: &mut ___E,
273 out_: &mut ::core::mem::MaybeUninit<
274 crate::wire::ActivityGovernorRegisterSuspendBlockerResponse,
275 >,
276 _: (),
277 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
278 ::fidl_next::munge! {
279 let crate::wire::ActivityGovernorRegisterSuspendBlockerResponse {
280 token,
281
282 } = out_;
283 }
284
285 ::fidl_next::Encode::encode(self.token, encoder_, token, ())?;
286
287 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(token.as_mut_ptr()) };
288
289 Ok(())
290 }
291 }
292
293 unsafe impl<___E>
294 ::fidl_next::EncodeOption<
295 ::fidl_next::wire::Box<
296 'static,
297 crate::wire::ActivityGovernorRegisterSuspendBlockerResponse,
298 >,
299 ___E,
300 > for ActivityGovernorRegisterSuspendBlockerResponse
301 where
302 ___E: ::fidl_next::Encoder + ?Sized,
303 ActivityGovernorRegisterSuspendBlockerResponse:
304 ::fidl_next::Encode<crate::wire::ActivityGovernorRegisterSuspendBlockerResponse, ___E>,
305 {
306 #[inline]
307 fn encode_option(
308 this: ::core::option::Option<Self>,
309 encoder: &mut ___E,
310 out: &mut ::core::mem::MaybeUninit<
311 ::fidl_next::wire::Box<
312 'static,
313 crate::wire::ActivityGovernorRegisterSuspendBlockerResponse,
314 >,
315 >,
316 _: (),
317 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
318 if let Some(inner) = this {
319 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
320 ::fidl_next::wire::Box::encode_present(out);
321 } else {
322 ::fidl_next::wire::Box::encode_absent(out);
323 }
324
325 Ok(())
326 }
327 }
328
329 impl ::fidl_next::FromWire<crate::wire::ActivityGovernorRegisterSuspendBlockerResponse>
330 for ActivityGovernorRegisterSuspendBlockerResponse
331 {
332 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
333 crate::wire::ActivityGovernorRegisterSuspendBlockerResponse,
334 Self,
335 > = unsafe {
336 ::fidl_next::CopyOptimization::enable_if(
337 true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::FromWire<
338 ::fidl_next::wire::fuchsia::EventPair,
339 >>::COPY_OPTIMIZATION
340 .is_enabled(),
341 )
342 };
343
344 #[inline]
345 fn from_wire(wire: crate::wire::ActivityGovernorRegisterSuspendBlockerResponse) -> Self {
346 Self { token: ::fidl_next::FromWire::from_wire(wire.token) }
347 }
348 }
349
350 #[doc = " Holds tokens to the application activity power element.\n\n [`fuchsia.power.system/ApplicationActivityLevel`] defines the power levels supported by this power element.\n"]
351 #[derive(Debug, Default, PartialEq)]
352 pub struct ApplicationActivity {
353 pub assertive_dependency_token: ::core::option::Option<::fidl_next::fuchsia::zx::Event>,
354 }
355
356 impl ApplicationActivity {
357 fn __max_ordinal(&self) -> usize {
358 if self.assertive_dependency_token.is_some() {
359 return 1;
360 }
361
362 0
363 }
364 }
365
366 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ApplicationActivity<'static>, ___E>
367 for ApplicationActivity
368 where
369 ___E: ::fidl_next::Encoder + ?Sized,
370 ___E: ::fidl_next::fuchsia::HandleEncoder,
371 {
372 #[inline]
373 fn encode(
374 mut self,
375 encoder: &mut ___E,
376 out: &mut ::core::mem::MaybeUninit<crate::wire::ApplicationActivity<'static>>,
377 _: (),
378 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
379 ::fidl_next::munge!(let crate::wire::ApplicationActivity { table } = out);
380
381 let max_ord = self.__max_ordinal();
382
383 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
384 ::fidl_next::Wire::zero_padding(&mut out);
385
386 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
387 ::fidl_next::wire::Envelope,
388 >(encoder, max_ord);
389
390 for i in 1..=max_ord {
391 match i {
392 1 => {
393 if let Some(value) = self.assertive_dependency_token.take() {
394 ::fidl_next::wire::Envelope::encode_value::<
395 ::fidl_next::wire::fuchsia::Event,
396 ___E,
397 >(
398 value, preallocated.encoder, &mut out, ()
399 )?;
400 } else {
401 ::fidl_next::wire::Envelope::encode_zero(&mut out)
402 }
403 }
404
405 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
406 }
407 unsafe {
408 preallocated.write_next(out.assume_init_ref());
409 }
410 }
411
412 ::fidl_next::wire::Table::encode_len(table, max_ord);
413
414 Ok(())
415 }
416 }
417
418 impl<'de> ::fidl_next::FromWire<crate::wire::ApplicationActivity<'de>> for ApplicationActivity {
419 #[inline]
420 fn from_wire(wire_: crate::wire::ApplicationActivity<'de>) -> Self {
421 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
422
423 let assertive_dependency_token = wire_.table.get(1);
424
425 Self {
426 assertive_dependency_token: assertive_dependency_token.map(|envelope| {
427 ::fidl_next::FromWire::from_wire(unsafe {
428 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Event>()
429 })
430 }),
431 }
432 }
433 }
434
435 #[doc = " A collection of power elements that are managed by the activity governor.\n"]
436 #[derive(Debug, Default, PartialEq)]
437 pub struct PowerElements {
438 pub application_activity: ::core::option::Option<crate::natural::ApplicationActivity>,
439 }
440
441 impl PowerElements {
442 fn __max_ordinal(&self) -> usize {
443 if self.application_activity.is_some() {
444 return 3;
445 }
446
447 0
448 }
449 }
450
451 unsafe impl<___E> ::fidl_next::Encode<crate::wire::PowerElements<'static>, ___E> for PowerElements
452 where
453 ___E: ::fidl_next::Encoder + ?Sized,
454 ___E: ::fidl_next::fuchsia::HandleEncoder,
455 {
456 #[inline]
457 fn encode(
458 mut self,
459 encoder: &mut ___E,
460 out: &mut ::core::mem::MaybeUninit<crate::wire::PowerElements<'static>>,
461 _: (),
462 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
463 ::fidl_next::munge!(let crate::wire::PowerElements { table } = out);
464
465 let max_ord = self.__max_ordinal();
466
467 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
468 ::fidl_next::Wire::zero_padding(&mut out);
469
470 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
471 ::fidl_next::wire::Envelope,
472 >(encoder, max_ord);
473
474 for i in 1..=max_ord {
475 match i {
476 3 => {
477 if let Some(value) = self.application_activity.take() {
478 ::fidl_next::wire::Envelope::encode_value::<
479 crate::wire::ApplicationActivity<'static>,
480 ___E,
481 >(
482 value, preallocated.encoder, &mut out, ()
483 )?;
484 } else {
485 ::fidl_next::wire::Envelope::encode_zero(&mut out)
486 }
487 }
488
489 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
490 }
491 unsafe {
492 preallocated.write_next(out.assume_init_ref());
493 }
494 }
495
496 ::fidl_next::wire::Table::encode_len(table, max_ord);
497
498 Ok(())
499 }
500 }
501
502 impl<'de> ::fidl_next::FromWire<crate::wire::PowerElements<'de>> for PowerElements {
503 #[inline]
504 fn from_wire(wire_: crate::wire::PowerElements<'de>) -> Self {
505 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
506
507 let application_activity = wire_.table.get(3);
508
509 Self {
510 application_activity: application_activity.map(|envelope| {
511 ::fidl_next::FromWire::from_wire(unsafe {
512 envelope.read_unchecked::<crate::wire::ApplicationActivity<'de>>()
513 })
514 }),
515 }
516 }
517 }
518
519 #[derive(Debug, PartialEq)]
520 #[repr(C)]
521 pub struct ActivityGovernorAcquireUnmonitoredWakeLeaseResponse {
522 pub token: ::fidl_next::fuchsia::zx::EventPair,
523 }
524
525 unsafe impl<___E>
526 ::fidl_next::Encode<crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse, ___E>
527 for ActivityGovernorAcquireUnmonitoredWakeLeaseResponse
528 where
529 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
530 ___E: ::fidl_next::fuchsia::HandleEncoder,
531 {
532 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
533 Self,
534 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse,
535 > = unsafe {
536 ::fidl_next::CopyOptimization::enable_if(
537 true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::Encode<
538 ::fidl_next::wire::fuchsia::EventPair,
539 ___E,
540 >>::COPY_OPTIMIZATION
541 .is_enabled(),
542 )
543 };
544
545 #[inline]
546 fn encode(
547 self,
548 encoder_: &mut ___E,
549 out_: &mut ::core::mem::MaybeUninit<
550 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse,
551 >,
552 _: (),
553 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
554 ::fidl_next::munge! {
555 let crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse {
556 token,
557
558 } = out_;
559 }
560
561 ::fidl_next::Encode::encode(self.token, encoder_, token, ())?;
562
563 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(token.as_mut_ptr()) };
564
565 Ok(())
566 }
567 }
568
569 unsafe impl<___E>
570 ::fidl_next::EncodeOption<
571 ::fidl_next::wire::Box<
572 'static,
573 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse,
574 >,
575 ___E,
576 > for ActivityGovernorAcquireUnmonitoredWakeLeaseResponse
577 where
578 ___E: ::fidl_next::Encoder + ?Sized,
579 ActivityGovernorAcquireUnmonitoredWakeLeaseResponse: ::fidl_next::Encode<
580 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse,
581 ___E,
582 >,
583 {
584 #[inline]
585 fn encode_option(
586 this: ::core::option::Option<Self>,
587 encoder: &mut ___E,
588 out: &mut ::core::mem::MaybeUninit<
589 ::fidl_next::wire::Box<
590 'static,
591 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse,
592 >,
593 >,
594 _: (),
595 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
596 if let Some(inner) = this {
597 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
598 ::fidl_next::wire::Box::encode_present(out);
599 } else {
600 ::fidl_next::wire::Box::encode_absent(out);
601 }
602
603 Ok(())
604 }
605 }
606
607 impl ::fidl_next::FromWire<crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse>
608 for ActivityGovernorAcquireUnmonitoredWakeLeaseResponse
609 {
610 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
611 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse,
612 Self,
613 > = unsafe {
614 ::fidl_next::CopyOptimization::enable_if(
615 true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::FromWire<
616 ::fidl_next::wire::fuchsia::EventPair,
617 >>::COPY_OPTIMIZATION
618 .is_enabled(),
619 )
620 };
621
622 #[inline]
623 fn from_wire(
624 wire: crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse,
625 ) -> Self {
626 Self { token: ::fidl_next::FromWire::from_wire(wire.token) }
627 }
628 }
629
630 #[derive(Debug, PartialEq)]
631 pub struct ActivityGovernorAcquireWakeLeaseWithTokenRequest {
632 pub name: ::std::string::String,
633
634 pub server_token: ::fidl_next::fuchsia::zx::EventPair,
635 }
636
637 unsafe impl<___E>
638 ::fidl_next::Encode<
639 crate::wire::ActivityGovernorAcquireWakeLeaseWithTokenRequest<'static>,
640 ___E,
641 > for ActivityGovernorAcquireWakeLeaseWithTokenRequest
642 where
643 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
644 ___E: ::fidl_next::Encoder,
645 ___E: ::fidl_next::fuchsia::HandleEncoder,
646 {
647 #[inline]
648 fn encode(
649 self,
650 encoder_: &mut ___E,
651 out_: &mut ::core::mem::MaybeUninit<
652 crate::wire::ActivityGovernorAcquireWakeLeaseWithTokenRequest<'static>,
653 >,
654 _: (),
655 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
656 ::fidl_next::munge! {
657 let crate::wire::ActivityGovernorAcquireWakeLeaseWithTokenRequest {
658 name,
659 server_token,
660
661 } = out_;
662 }
663
664 ::fidl_next::Encode::encode(self.name, encoder_, name, 64)?;
665
666 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
667 ::fidl_next::Constrained::validate(_field, 64)?;
668
669 ::fidl_next::Encode::encode(self.server_token, encoder_, server_token, ())?;
670
671 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(server_token.as_mut_ptr()) };
672
673 Ok(())
674 }
675 }
676
677 unsafe impl<___E>
678 ::fidl_next::EncodeOption<
679 ::fidl_next::wire::Box<
680 'static,
681 crate::wire::ActivityGovernorAcquireWakeLeaseWithTokenRequest<'static>,
682 >,
683 ___E,
684 > for ActivityGovernorAcquireWakeLeaseWithTokenRequest
685 where
686 ___E: ::fidl_next::Encoder + ?Sized,
687 ActivityGovernorAcquireWakeLeaseWithTokenRequest: ::fidl_next::Encode<
688 crate::wire::ActivityGovernorAcquireWakeLeaseWithTokenRequest<'static>,
689 ___E,
690 >,
691 {
692 #[inline]
693 fn encode_option(
694 this: ::core::option::Option<Self>,
695 encoder: &mut ___E,
696 out: &mut ::core::mem::MaybeUninit<
697 ::fidl_next::wire::Box<
698 'static,
699 crate::wire::ActivityGovernorAcquireWakeLeaseWithTokenRequest<'static>,
700 >,
701 >,
702 _: (),
703 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
704 if let Some(inner) = this {
705 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
706 ::fidl_next::wire::Box::encode_present(out);
707 } else {
708 ::fidl_next::wire::Box::encode_absent(out);
709 }
710
711 Ok(())
712 }
713 }
714
715 impl<'de>
716 ::fidl_next::FromWire<crate::wire::ActivityGovernorAcquireWakeLeaseWithTokenRequest<'de>>
717 for ActivityGovernorAcquireWakeLeaseWithTokenRequest
718 {
719 #[inline]
720 fn from_wire(
721 wire: crate::wire::ActivityGovernorAcquireWakeLeaseWithTokenRequest<'de>,
722 ) -> Self {
723 Self {
724 name: ::fidl_next::FromWire::from_wire(wire.name),
725
726 server_token: ::fidl_next::FromWire::from_wire(wire.server_token),
727 }
728 }
729 }
730
731 #[derive(Debug, Default, PartialEq)]
732 pub struct ActivityGovernorAcquireWakeLease2Request {
733 pub name: ::core::option::Option<::std::string::String>,
734
735 pub server_token: ::core::option::Option<::fidl_next::fuchsia::zx::EventPair>,
736
737 pub previous_client_token: ::core::option::Option<::fidl_next::fuchsia::zx::EventPair>,
738
739 pub unmonitored: ::core::option::Option<bool>,
740 }
741
742 impl ActivityGovernorAcquireWakeLease2Request {
743 fn __max_ordinal(&self) -> usize {
744 if self.unmonitored.is_some() {
745 return 4;
746 }
747
748 if self.previous_client_token.is_some() {
749 return 3;
750 }
751
752 if self.server_token.is_some() {
753 return 2;
754 }
755
756 if self.name.is_some() {
757 return 1;
758 }
759
760 0
761 }
762 }
763
764 unsafe impl<___E>
765 ::fidl_next::Encode<crate::wire::ActivityGovernorAcquireWakeLease2Request<'static>, ___E>
766 for ActivityGovernorAcquireWakeLease2Request
767 where
768 ___E: ::fidl_next::Encoder + ?Sized,
769 ___E: ::fidl_next::fuchsia::HandleEncoder,
770 {
771 #[inline]
772 fn encode(
773 mut self,
774 encoder: &mut ___E,
775 out: &mut ::core::mem::MaybeUninit<
776 crate::wire::ActivityGovernorAcquireWakeLease2Request<'static>,
777 >,
778 _: (),
779 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
780 ::fidl_next::munge!(let crate::wire::ActivityGovernorAcquireWakeLease2Request { table } = out);
781
782 let max_ord = self.__max_ordinal();
783
784 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
785 ::fidl_next::Wire::zero_padding(&mut out);
786
787 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
788 ::fidl_next::wire::Envelope,
789 >(encoder, max_ord);
790
791 for i in 1..=max_ord {
792 match i {
793 4 => {
794 if let Some(value) = self.unmonitored.take() {
795 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
796 value,
797 preallocated.encoder,
798 &mut out,
799 (),
800 )?;
801 } else {
802 ::fidl_next::wire::Envelope::encode_zero(&mut out)
803 }
804 }
805
806 3 => {
807 if let Some(value) = self.previous_client_token.take() {
808 ::fidl_next::wire::Envelope::encode_value::<
809 ::fidl_next::wire::fuchsia::EventPair,
810 ___E,
811 >(
812 value, preallocated.encoder, &mut out, ()
813 )?;
814 } else {
815 ::fidl_next::wire::Envelope::encode_zero(&mut out)
816 }
817 }
818
819 2 => {
820 if let Some(value) = self.server_token.take() {
821 ::fidl_next::wire::Envelope::encode_value::<
822 ::fidl_next::wire::fuchsia::EventPair,
823 ___E,
824 >(
825 value, preallocated.encoder, &mut out, ()
826 )?;
827 } else {
828 ::fidl_next::wire::Envelope::encode_zero(&mut out)
829 }
830 }
831
832 1 => {
833 if let Some(value) = self.name.take() {
834 ::fidl_next::wire::Envelope::encode_value::<
835 ::fidl_next::wire::String<'static>,
836 ___E,
837 >(
838 value, preallocated.encoder, &mut out, 64
839 )?;
840 } else {
841 ::fidl_next::wire::Envelope::encode_zero(&mut out)
842 }
843 }
844
845 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
846 }
847 unsafe {
848 preallocated.write_next(out.assume_init_ref());
849 }
850 }
851
852 ::fidl_next::wire::Table::encode_len(table, max_ord);
853
854 Ok(())
855 }
856 }
857
858 impl<'de> ::fidl_next::FromWire<crate::wire::ActivityGovernorAcquireWakeLease2Request<'de>>
859 for ActivityGovernorAcquireWakeLease2Request
860 {
861 #[inline]
862 fn from_wire(wire_: crate::wire::ActivityGovernorAcquireWakeLease2Request<'de>) -> Self {
863 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
864
865 let name = wire_.table.get(1);
866
867 let server_token = wire_.table.get(2);
868
869 let previous_client_token = wire_.table.get(3);
870
871 let unmonitored = wire_.table.get(4);
872
873 Self {
874 name: name.map(|envelope| {
875 ::fidl_next::FromWire::from_wire(unsafe {
876 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
877 })
878 }),
879
880 server_token: server_token.map(|envelope| {
881 ::fidl_next::FromWire::from_wire(unsafe {
882 envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
883 })
884 }),
885
886 previous_client_token: previous_client_token.map(|envelope| {
887 ::fidl_next::FromWire::from_wire(unsafe {
888 envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
889 })
890 }),
891
892 unmonitored: unmonitored.map(|envelope| {
893 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
894 }),
895 }
896 }
897 }
898
899 #[derive(Debug, PartialEq)]
900 #[repr(C)]
901 pub struct ActivityGovernorTakeApplicationActivityLeaseResponse {
902 pub token: ::fidl_next::fuchsia::zx::EventPair,
903 }
904
905 unsafe impl<___E>
906 ::fidl_next::Encode<crate::wire::ActivityGovernorTakeApplicationActivityLeaseResponse, ___E>
907 for ActivityGovernorTakeApplicationActivityLeaseResponse
908 where
909 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
910 ___E: ::fidl_next::fuchsia::HandleEncoder,
911 {
912 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
913 Self,
914 crate::wire::ActivityGovernorTakeApplicationActivityLeaseResponse,
915 > = unsafe {
916 ::fidl_next::CopyOptimization::enable_if(
917 true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::Encode<
918 ::fidl_next::wire::fuchsia::EventPair,
919 ___E,
920 >>::COPY_OPTIMIZATION
921 .is_enabled(),
922 )
923 };
924
925 #[inline]
926 fn encode(
927 self,
928 encoder_: &mut ___E,
929 out_: &mut ::core::mem::MaybeUninit<
930 crate::wire::ActivityGovernorTakeApplicationActivityLeaseResponse,
931 >,
932 _: (),
933 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
934 ::fidl_next::munge! {
935 let crate::wire::ActivityGovernorTakeApplicationActivityLeaseResponse {
936 token,
937
938 } = out_;
939 }
940
941 ::fidl_next::Encode::encode(self.token, encoder_, token, ())?;
942
943 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(token.as_mut_ptr()) };
944
945 Ok(())
946 }
947 }
948
949 unsafe impl<___E>
950 ::fidl_next::EncodeOption<
951 ::fidl_next::wire::Box<
952 'static,
953 crate::wire::ActivityGovernorTakeApplicationActivityLeaseResponse,
954 >,
955 ___E,
956 > for ActivityGovernorTakeApplicationActivityLeaseResponse
957 where
958 ___E: ::fidl_next::Encoder + ?Sized,
959 ActivityGovernorTakeApplicationActivityLeaseResponse: ::fidl_next::Encode<
960 crate::wire::ActivityGovernorTakeApplicationActivityLeaseResponse,
961 ___E,
962 >,
963 {
964 #[inline]
965 fn encode_option(
966 this: ::core::option::Option<Self>,
967 encoder: &mut ___E,
968 out: &mut ::core::mem::MaybeUninit<
969 ::fidl_next::wire::Box<
970 'static,
971 crate::wire::ActivityGovernorTakeApplicationActivityLeaseResponse,
972 >,
973 >,
974 _: (),
975 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
976 if let Some(inner) = this {
977 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
978 ::fidl_next::wire::Box::encode_present(out);
979 } else {
980 ::fidl_next::wire::Box::encode_absent(out);
981 }
982
983 Ok(())
984 }
985 }
986
987 impl ::fidl_next::FromWire<crate::wire::ActivityGovernorTakeApplicationActivityLeaseResponse>
988 for ActivityGovernorTakeApplicationActivityLeaseResponse
989 {
990 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
991 crate::wire::ActivityGovernorTakeApplicationActivityLeaseResponse,
992 Self,
993 > = unsafe {
994 ::fidl_next::CopyOptimization::enable_if(
995 true && <::fidl_next::fuchsia::zx::EventPair as ::fidl_next::FromWire<
996 ::fidl_next::wire::fuchsia::EventPair,
997 >>::COPY_OPTIMIZATION
998 .is_enabled(),
999 )
1000 };
1001
1002 #[inline]
1003 fn from_wire(
1004 wire: crate::wire::ActivityGovernorTakeApplicationActivityLeaseResponse,
1005 ) -> Self {
1006 Self { token: ::fidl_next::FromWire::from_wire(wire.token) }
1007 }
1008 }
1009
1010 #[doc = " Holds tokens to the CPU power element.\n\n [`fuchsia.power.system/CpuLevel`] defines the power levels supported by this power element.\n"]
1011 #[derive(Debug, Default, PartialEq)]
1012 pub struct Cpu {
1013 pub assertive_dependency_token: ::core::option::Option<::fidl_next::fuchsia::zx::Event>,
1014 }
1015
1016 impl Cpu {
1017 fn __max_ordinal(&self) -> usize {
1018 if self.assertive_dependency_token.is_some() {
1019 return 1;
1020 }
1021
1022 0
1023 }
1024 }
1025
1026 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Cpu<'static>, ___E> for Cpu
1027 where
1028 ___E: ::fidl_next::Encoder + ?Sized,
1029 ___E: ::fidl_next::fuchsia::HandleEncoder,
1030 {
1031 #[inline]
1032 fn encode(
1033 mut self,
1034 encoder: &mut ___E,
1035 out: &mut ::core::mem::MaybeUninit<crate::wire::Cpu<'static>>,
1036 _: (),
1037 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1038 ::fidl_next::munge!(let crate::wire::Cpu { table } = out);
1039
1040 let max_ord = self.__max_ordinal();
1041
1042 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1043 ::fidl_next::Wire::zero_padding(&mut out);
1044
1045 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1046 ::fidl_next::wire::Envelope,
1047 >(encoder, max_ord);
1048
1049 for i in 1..=max_ord {
1050 match i {
1051 1 => {
1052 if let Some(value) = self.assertive_dependency_token.take() {
1053 ::fidl_next::wire::Envelope::encode_value::<
1054 ::fidl_next::wire::fuchsia::Event,
1055 ___E,
1056 >(
1057 value, preallocated.encoder, &mut out, ()
1058 )?;
1059 } else {
1060 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1061 }
1062 }
1063
1064 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1065 }
1066 unsafe {
1067 preallocated.write_next(out.assume_init_ref());
1068 }
1069 }
1070
1071 ::fidl_next::wire::Table::encode_len(table, max_ord);
1072
1073 Ok(())
1074 }
1075 }
1076
1077 impl<'de> ::fidl_next::FromWire<crate::wire::Cpu<'de>> for Cpu {
1078 #[inline]
1079 fn from_wire(wire_: crate::wire::Cpu<'de>) -> Self {
1080 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1081
1082 let assertive_dependency_token = wire_.table.get(1);
1083
1084 Self {
1085 assertive_dependency_token: assertive_dependency_token.map(|envelope| {
1086 ::fidl_next::FromWire::from_wire(unsafe {
1087 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Event>()
1088 })
1089 }),
1090 }
1091 }
1092 }
1093
1094 #[derive(Debug, Default, PartialEq)]
1095 pub struct CpuElementManagerAddExecutionStateDependencyRequest {
1096 pub dependency_token: ::core::option::Option<::fidl_next::fuchsia::zx::Event>,
1097
1098 pub power_level: ::core::option::Option<u8>,
1099 }
1100
1101 impl CpuElementManagerAddExecutionStateDependencyRequest {
1102 fn __max_ordinal(&self) -> usize {
1103 if self.power_level.is_some() {
1104 return 2;
1105 }
1106
1107 if self.dependency_token.is_some() {
1108 return 1;
1109 }
1110
1111 0
1112 }
1113 }
1114
1115 unsafe impl<___E>
1116 ::fidl_next::Encode<
1117 crate::wire::CpuElementManagerAddExecutionStateDependencyRequest<'static>,
1118 ___E,
1119 > for CpuElementManagerAddExecutionStateDependencyRequest
1120 where
1121 ___E: ::fidl_next::Encoder + ?Sized,
1122 ___E: ::fidl_next::fuchsia::HandleEncoder,
1123 {
1124 #[inline]
1125 fn encode(
1126 mut self,
1127 encoder: &mut ___E,
1128 out: &mut ::core::mem::MaybeUninit<
1129 crate::wire::CpuElementManagerAddExecutionStateDependencyRequest<'static>,
1130 >,
1131 _: (),
1132 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1133 ::fidl_next::munge!(let crate::wire::CpuElementManagerAddExecutionStateDependencyRequest { table } = out);
1134
1135 let max_ord = self.__max_ordinal();
1136
1137 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1138 ::fidl_next::Wire::zero_padding(&mut out);
1139
1140 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1141 ::fidl_next::wire::Envelope,
1142 >(encoder, max_ord);
1143
1144 for i in 1..=max_ord {
1145 match i {
1146 2 => {
1147 if let Some(value) = self.power_level.take() {
1148 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
1149 value,
1150 preallocated.encoder,
1151 &mut out,
1152 (),
1153 )?;
1154 } else {
1155 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1156 }
1157 }
1158
1159 1 => {
1160 if let Some(value) = self.dependency_token.take() {
1161 ::fidl_next::wire::Envelope::encode_value::<
1162 ::fidl_next::wire::fuchsia::Event,
1163 ___E,
1164 >(
1165 value, preallocated.encoder, &mut out, ()
1166 )?;
1167 } else {
1168 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1169 }
1170 }
1171
1172 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1173 }
1174 unsafe {
1175 preallocated.write_next(out.assume_init_ref());
1176 }
1177 }
1178
1179 ::fidl_next::wire::Table::encode_len(table, max_ord);
1180
1181 Ok(())
1182 }
1183 }
1184
1185 impl<'de>
1186 ::fidl_next::FromWire<crate::wire::CpuElementManagerAddExecutionStateDependencyRequest<'de>>
1187 for CpuElementManagerAddExecutionStateDependencyRequest
1188 {
1189 #[inline]
1190 fn from_wire(
1191 wire_: crate::wire::CpuElementManagerAddExecutionStateDependencyRequest<'de>,
1192 ) -> Self {
1193 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1194
1195 let dependency_token = wire_.table.get(1);
1196
1197 let power_level = wire_.table.get(2);
1198
1199 Self {
1200 dependency_token: dependency_token.map(|envelope| {
1201 ::fidl_next::FromWire::from_wire(unsafe {
1202 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Event>()
1203 })
1204 }),
1205
1206 power_level: power_level.map(|envelope| {
1207 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<u8>() })
1208 }),
1209 }
1210 }
1211 }
1212
1213 #[doc = " Holds the dependency token for the Execution State power element.\n"]
1214 #[derive(Debug, Default, PartialEq)]
1215 pub struct ExecutionState {
1216 pub dependency_token: ::core::option::Option<::fidl_next::fuchsia::zx::Event>,
1217 }
1218
1219 impl ExecutionState {
1220 fn __max_ordinal(&self) -> usize {
1221 if self.dependency_token.is_some() {
1222 return 1;
1223 }
1224
1225 0
1226 }
1227 }
1228
1229 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExecutionState<'static>, ___E> for ExecutionState
1230 where
1231 ___E: ::fidl_next::Encoder + ?Sized,
1232 ___E: ::fidl_next::fuchsia::HandleEncoder,
1233 {
1234 #[inline]
1235 fn encode(
1236 mut self,
1237 encoder: &mut ___E,
1238 out: &mut ::core::mem::MaybeUninit<crate::wire::ExecutionState<'static>>,
1239 _: (),
1240 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1241 ::fidl_next::munge!(let crate::wire::ExecutionState { table } = out);
1242
1243 let max_ord = self.__max_ordinal();
1244
1245 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1246 ::fidl_next::Wire::zero_padding(&mut out);
1247
1248 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1249 ::fidl_next::wire::Envelope,
1250 >(encoder, max_ord);
1251
1252 for i in 1..=max_ord {
1253 match i {
1254 1 => {
1255 if let Some(value) = self.dependency_token.take() {
1256 ::fidl_next::wire::Envelope::encode_value::<
1257 ::fidl_next::wire::fuchsia::Event,
1258 ___E,
1259 >(
1260 value, preallocated.encoder, &mut out, ()
1261 )?;
1262 } else {
1263 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1264 }
1265 }
1266
1267 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1268 }
1269 unsafe {
1270 preallocated.write_next(out.assume_init_ref());
1271 }
1272 }
1273
1274 ::fidl_next::wire::Table::encode_len(table, max_ord);
1275
1276 Ok(())
1277 }
1278 }
1279
1280 impl<'de> ::fidl_next::FromWire<crate::wire::ExecutionState<'de>> for ExecutionState {
1281 #[inline]
1282 fn from_wire(wire_: crate::wire::ExecutionState<'de>) -> Self {
1283 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1284
1285 let dependency_token = wire_.table.get(1);
1286
1287 Self {
1288 dependency_token: dependency_token.map(|envelope| {
1289 ::fidl_next::FromWire::from_wire(unsafe {
1290 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Event>()
1291 })
1292 }),
1293 }
1294 }
1295 }
1296
1297 #[derive(Debug, Default, PartialEq)]
1298 pub struct ExecutionStateManagerAddApplicationActivityDependencyRequest {
1299 pub dependency_token: ::core::option::Option<::fidl_next::fuchsia::zx::Event>,
1300
1301 pub power_level: ::core::option::Option<u8>,
1302 }
1303
1304 impl ExecutionStateManagerAddApplicationActivityDependencyRequest {
1305 fn __max_ordinal(&self) -> usize {
1306 if self.power_level.is_some() {
1307 return 2;
1308 }
1309
1310 if self.dependency_token.is_some() {
1311 return 1;
1312 }
1313
1314 0
1315 }
1316 }
1317
1318 unsafe impl<___E>
1319 ::fidl_next::Encode<
1320 crate::wire::ExecutionStateManagerAddApplicationActivityDependencyRequest<'static>,
1321 ___E,
1322 > for ExecutionStateManagerAddApplicationActivityDependencyRequest
1323 where
1324 ___E: ::fidl_next::Encoder + ?Sized,
1325 ___E: ::fidl_next::fuchsia::HandleEncoder,
1326 {
1327 #[inline]
1328 fn encode(
1329 mut self,
1330 encoder: &mut ___E,
1331 out: &mut ::core::mem::MaybeUninit<
1332 crate::wire::ExecutionStateManagerAddApplicationActivityDependencyRequest<'static>,
1333 >,
1334 _: (),
1335 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1336 ::fidl_next::munge!(let crate::wire::ExecutionStateManagerAddApplicationActivityDependencyRequest { table } = out);
1337
1338 let max_ord = self.__max_ordinal();
1339
1340 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1341 ::fidl_next::Wire::zero_padding(&mut out);
1342
1343 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1344 ::fidl_next::wire::Envelope,
1345 >(encoder, max_ord);
1346
1347 for i in 1..=max_ord {
1348 match i {
1349 2 => {
1350 if let Some(value) = self.power_level.take() {
1351 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
1352 value,
1353 preallocated.encoder,
1354 &mut out,
1355 (),
1356 )?;
1357 } else {
1358 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1359 }
1360 }
1361
1362 1 => {
1363 if let Some(value) = self.dependency_token.take() {
1364 ::fidl_next::wire::Envelope::encode_value::<
1365 ::fidl_next::wire::fuchsia::Event,
1366 ___E,
1367 >(
1368 value, preallocated.encoder, &mut out, ()
1369 )?;
1370 } else {
1371 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1372 }
1373 }
1374
1375 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1376 }
1377 unsafe {
1378 preallocated.write_next(out.assume_init_ref());
1379 }
1380 }
1381
1382 ::fidl_next::wire::Table::encode_len(table, max_ord);
1383
1384 Ok(())
1385 }
1386 }
1387
1388 impl<'de>
1389 ::fidl_next::FromWire<
1390 crate::wire::ExecutionStateManagerAddApplicationActivityDependencyRequest<'de>,
1391 > for ExecutionStateManagerAddApplicationActivityDependencyRequest
1392 {
1393 #[inline]
1394 fn from_wire(
1395 wire_: crate::wire::ExecutionStateManagerAddApplicationActivityDependencyRequest<'de>,
1396 ) -> Self {
1397 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1398
1399 let dependency_token = wire_.table.get(1);
1400
1401 let power_level = wire_.table.get(2);
1402
1403 Self {
1404 dependency_token: dependency_token.map(|envelope| {
1405 ::fidl_next::FromWire::from_wire(unsafe {
1406 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Event>()
1407 })
1408 }),
1409
1410 power_level: power_level.map(|envelope| {
1411 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<u8>() })
1412 }),
1413 }
1414 }
1415 }
1416}
1417
1418pub mod wire {
1419
1420 pub use fidl_next_common_fuchsia_power_system::wire::*;
1421
1422 pub type LeaseToken = ::fidl_next::wire::fuchsia::EventPair;
1424
1425 #[derive(Debug)]
1427 #[repr(C)]
1428 pub struct ActivityGovernorAcquireWakeLeaseResponse {
1429 pub token: ::fidl_next::wire::fuchsia::EventPair,
1430 }
1431
1432 static_assertions::const_assert_eq!(
1433 std::mem::size_of::<ActivityGovernorAcquireWakeLeaseResponse>(),
1434 4
1435 );
1436 static_assertions::const_assert_eq!(
1437 std::mem::align_of::<ActivityGovernorAcquireWakeLeaseResponse>(),
1438 4
1439 );
1440
1441 static_assertions::const_assert_eq!(
1442 std::mem::offset_of!(ActivityGovernorAcquireWakeLeaseResponse, token),
1443 0
1444 );
1445
1446 impl ::fidl_next::Constrained for ActivityGovernorAcquireWakeLeaseResponse {
1447 type Constraint = ();
1448
1449 fn validate(
1450 _: ::fidl_next::Slot<'_, Self>,
1451 _: Self::Constraint,
1452 ) -> Result<(), ::fidl_next::ValidationError> {
1453 Ok(())
1454 }
1455 }
1456
1457 unsafe impl ::fidl_next::Wire for ActivityGovernorAcquireWakeLeaseResponse {
1458 type Narrowed<'de> = ActivityGovernorAcquireWakeLeaseResponse;
1459
1460 #[inline]
1461 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1462 ::fidl_next::munge! {
1463 let Self {
1464 token,
1465
1466 } = &mut *out_;
1467 }
1468
1469 ::fidl_next::Wire::zero_padding(token);
1470 }
1471 }
1472
1473 unsafe impl<___D> ::fidl_next::Decode<___D> for ActivityGovernorAcquireWakeLeaseResponse
1474 where
1475 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1476 ___D: ::fidl_next::fuchsia::HandleDecoder,
1477 {
1478 fn decode(
1479 slot_: ::fidl_next::Slot<'_, Self>,
1480 decoder_: &mut ___D,
1481 _: (),
1482 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1483 ::fidl_next::munge! {
1484 let Self {
1485 mut token,
1486
1487 } = slot_;
1488 }
1489
1490 let _field = token.as_mut();
1491
1492 ::fidl_next::Decode::decode(token.as_mut(), decoder_, ())?;
1493
1494 Ok(())
1495 }
1496 }
1497
1498 impl ::fidl_next::IntoNatural for ActivityGovernorAcquireWakeLeaseResponse {
1499 type Natural = crate::natural::ActivityGovernorAcquireWakeLeaseResponse;
1500 }
1501
1502 #[repr(C)]
1504 pub struct ActivityGovernorRegisterSuspendBlockerRequest<'de> {
1505 pub(crate) table: ::fidl_next::wire::Table<'de>,
1506 }
1507
1508 impl<'de> Drop for ActivityGovernorRegisterSuspendBlockerRequest<'de> {
1509 fn drop(&mut self) {
1510 let _ = self.table.get(1).map(|envelope| unsafe {
1511 envelope.read_unchecked::<::fidl_next::ClientEnd<
1512 crate::SuspendBlocker,
1513 ::fidl_next::wire::fuchsia::Channel,
1514 >>()
1515 });
1516
1517 let _ = self.table.get(2).map(|envelope| unsafe {
1518 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
1519 });
1520 }
1521 }
1522
1523 impl ::fidl_next::Constrained for ActivityGovernorRegisterSuspendBlockerRequest<'_> {
1524 type Constraint = ();
1525
1526 fn validate(
1527 _: ::fidl_next::Slot<'_, Self>,
1528 _: Self::Constraint,
1529 ) -> Result<(), ::fidl_next::ValidationError> {
1530 Ok(())
1531 }
1532 }
1533
1534 unsafe impl ::fidl_next::Wire for ActivityGovernorRegisterSuspendBlockerRequest<'static> {
1535 type Narrowed<'de> = ActivityGovernorRegisterSuspendBlockerRequest<'de>;
1536
1537 #[inline]
1538 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1539 ::fidl_next::munge!(let Self { table } = out);
1540 ::fidl_next::wire::Table::zero_padding(table);
1541 }
1542 }
1543
1544 unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
1545 for ActivityGovernorRegisterSuspendBlockerRequest<'de>
1546 where
1547 ___D: ::fidl_next::Decoder<'de> + ?Sized,
1548 ___D: ::fidl_next::fuchsia::HandleDecoder,
1549 {
1550 fn decode(
1551 slot: ::fidl_next::Slot<'_, Self>,
1552 decoder: &mut ___D,
1553 _: (),
1554 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1555 ::fidl_next::munge!(let Self { table } = slot);
1556
1557 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1558 match ordinal {
1559 0 => unsafe { ::core::hint::unreachable_unchecked() },
1560
1561 1 => {
1562 ::fidl_next::wire::Envelope::decode_as::<
1563 ___D,
1564 ::fidl_next::ClientEnd<
1565 crate::SuspendBlocker,
1566 ::fidl_next::wire::fuchsia::Channel,
1567 >,
1568 >(slot.as_mut(), decoder, ())?;
1569
1570 Ok(())
1571 }
1572
1573 2 => {
1574 ::fidl_next::wire::Envelope::decode_as::<
1575 ___D,
1576 ::fidl_next::wire::String<'de>,
1577 >(slot.as_mut(), decoder, 64)?;
1578
1579 let value = unsafe {
1580 slot.deref_unchecked()
1581 .deref_unchecked::<::fidl_next::wire::String<'_>>()
1582 };
1583
1584 if value.len() > 64 {
1585 return Err(::fidl_next::DecodeError::VectorTooLong {
1586 size: value.len() as u64,
1587 limit: 64,
1588 });
1589 }
1590
1591 Ok(())
1592 }
1593
1594 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1595 }
1596 })
1597 }
1598 }
1599
1600 impl<'de> ActivityGovernorRegisterSuspendBlockerRequest<'de> {
1601 pub fn suspend_blocker(
1602 &self,
1603 ) -> ::core::option::Option<
1604 &::fidl_next::ClientEnd<crate::SuspendBlocker, ::fidl_next::wire::fuchsia::Channel>,
1605 > {
1606 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1607 }
1608
1609 pub fn take_suspend_blocker(
1610 &mut self,
1611 ) -> ::core::option::Option<
1612 ::fidl_next::ClientEnd<crate::SuspendBlocker, ::fidl_next::wire::fuchsia::Channel>,
1613 > {
1614 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1615 }
1616
1617 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
1618 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1619 }
1620
1621 pub fn take_name(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
1622 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
1623 }
1624 }
1625
1626 impl<'de> ::core::fmt::Debug for ActivityGovernorRegisterSuspendBlockerRequest<'de> {
1627 fn fmt(
1628 &self,
1629 f: &mut ::core::fmt::Formatter<'_>,
1630 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1631 f.debug_struct("ActivityGovernorRegisterSuspendBlockerRequest")
1632 .field("suspend_blocker", &self.suspend_blocker())
1633 .field("name", &self.name())
1634 .finish()
1635 }
1636 }
1637
1638 impl<'de> ::fidl_next::IntoNatural for ActivityGovernorRegisterSuspendBlockerRequest<'de> {
1639 type Natural = crate::natural::ActivityGovernorRegisterSuspendBlockerRequest;
1640 }
1641
1642 #[derive(Debug)]
1644 #[repr(C)]
1645 pub struct ActivityGovernorRegisterSuspendBlockerResponse {
1646 pub token: ::fidl_next::wire::fuchsia::EventPair,
1647 }
1648
1649 static_assertions::const_assert_eq!(
1650 std::mem::size_of::<ActivityGovernorRegisterSuspendBlockerResponse>(),
1651 4
1652 );
1653 static_assertions::const_assert_eq!(
1654 std::mem::align_of::<ActivityGovernorRegisterSuspendBlockerResponse>(),
1655 4
1656 );
1657
1658 static_assertions::const_assert_eq!(
1659 std::mem::offset_of!(ActivityGovernorRegisterSuspendBlockerResponse, token),
1660 0
1661 );
1662
1663 impl ::fidl_next::Constrained for ActivityGovernorRegisterSuspendBlockerResponse {
1664 type Constraint = ();
1665
1666 fn validate(
1667 _: ::fidl_next::Slot<'_, Self>,
1668 _: Self::Constraint,
1669 ) -> Result<(), ::fidl_next::ValidationError> {
1670 Ok(())
1671 }
1672 }
1673
1674 unsafe impl ::fidl_next::Wire for ActivityGovernorRegisterSuspendBlockerResponse {
1675 type Narrowed<'de> = ActivityGovernorRegisterSuspendBlockerResponse;
1676
1677 #[inline]
1678 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1679 ::fidl_next::munge! {
1680 let Self {
1681 token,
1682
1683 } = &mut *out_;
1684 }
1685
1686 ::fidl_next::Wire::zero_padding(token);
1687 }
1688 }
1689
1690 unsafe impl<___D> ::fidl_next::Decode<___D> for ActivityGovernorRegisterSuspendBlockerResponse
1691 where
1692 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1693 ___D: ::fidl_next::fuchsia::HandleDecoder,
1694 {
1695 fn decode(
1696 slot_: ::fidl_next::Slot<'_, Self>,
1697 decoder_: &mut ___D,
1698 _: (),
1699 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1700 ::fidl_next::munge! {
1701 let Self {
1702 mut token,
1703
1704 } = slot_;
1705 }
1706
1707 let _field = token.as_mut();
1708
1709 ::fidl_next::Decode::decode(token.as_mut(), decoder_, ())?;
1710
1711 Ok(())
1712 }
1713 }
1714
1715 impl ::fidl_next::IntoNatural for ActivityGovernorRegisterSuspendBlockerResponse {
1716 type Natural = crate::natural::ActivityGovernorRegisterSuspendBlockerResponse;
1717 }
1718
1719 #[repr(C)]
1721 pub struct ApplicationActivity<'de> {
1722 pub(crate) table: ::fidl_next::wire::Table<'de>,
1723 }
1724
1725 impl<'de> Drop for ApplicationActivity<'de> {
1726 fn drop(&mut self) {
1727 let _ = self.table.get(1).map(|envelope| unsafe {
1728 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Event>()
1729 });
1730 }
1731 }
1732
1733 impl ::fidl_next::Constrained for ApplicationActivity<'_> {
1734 type Constraint = ();
1735
1736 fn validate(
1737 _: ::fidl_next::Slot<'_, Self>,
1738 _: Self::Constraint,
1739 ) -> Result<(), ::fidl_next::ValidationError> {
1740 Ok(())
1741 }
1742 }
1743
1744 unsafe impl ::fidl_next::Wire for ApplicationActivity<'static> {
1745 type Narrowed<'de> = ApplicationActivity<'de>;
1746
1747 #[inline]
1748 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1749 ::fidl_next::munge!(let Self { table } = out);
1750 ::fidl_next::wire::Table::zero_padding(table);
1751 }
1752 }
1753
1754 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ApplicationActivity<'de>
1755 where
1756 ___D: ::fidl_next::Decoder<'de> + ?Sized,
1757 ___D: ::fidl_next::fuchsia::HandleDecoder,
1758 {
1759 fn decode(
1760 slot: ::fidl_next::Slot<'_, Self>,
1761 decoder: &mut ___D,
1762 _: (),
1763 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1764 ::fidl_next::munge!(let Self { table } = slot);
1765
1766 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1767 match ordinal {
1768 0 => unsafe { ::core::hint::unreachable_unchecked() },
1769
1770 1 => {
1771 ::fidl_next::wire::Envelope::decode_as::<
1772 ___D,
1773 ::fidl_next::wire::fuchsia::Event,
1774 >(slot.as_mut(), decoder, ())?;
1775
1776 Ok(())
1777 }
1778
1779 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1780 }
1781 })
1782 }
1783 }
1784
1785 impl<'de> ApplicationActivity<'de> {
1786 pub fn assertive_dependency_token(
1787 &self,
1788 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::Event> {
1789 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1790 }
1791
1792 pub fn take_assertive_dependency_token(
1793 &mut self,
1794 ) -> ::core::option::Option<::fidl_next::wire::fuchsia::Event> {
1795 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1796 }
1797 }
1798
1799 impl<'de> ::core::fmt::Debug for ApplicationActivity<'de> {
1800 fn fmt(
1801 &self,
1802 f: &mut ::core::fmt::Formatter<'_>,
1803 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1804 f.debug_struct("ApplicationActivity")
1805 .field("assertive_dependency_token", &self.assertive_dependency_token())
1806 .finish()
1807 }
1808 }
1809
1810 impl<'de> ::fidl_next::IntoNatural for ApplicationActivity<'de> {
1811 type Natural = crate::natural::ApplicationActivity;
1812 }
1813
1814 #[repr(C)]
1816 pub struct PowerElements<'de> {
1817 pub(crate) table: ::fidl_next::wire::Table<'de>,
1818 }
1819
1820 impl<'de> Drop for PowerElements<'de> {
1821 fn drop(&mut self) {
1822 let _ = self.table.get(3).map(|envelope| unsafe {
1823 envelope.read_unchecked::<crate::wire::ApplicationActivity<'de>>()
1824 });
1825 }
1826 }
1827
1828 impl ::fidl_next::Constrained for PowerElements<'_> {
1829 type Constraint = ();
1830
1831 fn validate(
1832 _: ::fidl_next::Slot<'_, Self>,
1833 _: Self::Constraint,
1834 ) -> Result<(), ::fidl_next::ValidationError> {
1835 Ok(())
1836 }
1837 }
1838
1839 unsafe impl ::fidl_next::Wire for PowerElements<'static> {
1840 type Narrowed<'de> = PowerElements<'de>;
1841
1842 #[inline]
1843 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1844 ::fidl_next::munge!(let Self { table } = out);
1845 ::fidl_next::wire::Table::zero_padding(table);
1846 }
1847 }
1848
1849 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for PowerElements<'de>
1850 where
1851 ___D: ::fidl_next::Decoder<'de> + ?Sized,
1852 ___D: ::fidl_next::fuchsia::HandleDecoder,
1853 {
1854 fn decode(
1855 slot: ::fidl_next::Slot<'_, Self>,
1856 decoder: &mut ___D,
1857 _: (),
1858 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1859 ::fidl_next::munge!(let Self { table } = slot);
1860
1861 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1862 match ordinal {
1863 0 => unsafe { ::core::hint::unreachable_unchecked() },
1864
1865 3 => {
1866 ::fidl_next::wire::Envelope::decode_as::<
1867 ___D,
1868 crate::wire::ApplicationActivity<'de>,
1869 >(slot.as_mut(), decoder, ())?;
1870
1871 Ok(())
1872 }
1873
1874 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1875 }
1876 })
1877 }
1878 }
1879
1880 impl<'de> PowerElements<'de> {
1881 pub fn application_activity(
1882 &self,
1883 ) -> ::core::option::Option<&crate::wire::ApplicationActivity<'de>> {
1884 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
1885 }
1886
1887 pub fn take_application_activity(
1888 &mut self,
1889 ) -> ::core::option::Option<crate::wire::ApplicationActivity<'de>> {
1890 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
1891 }
1892 }
1893
1894 impl<'de> ::core::fmt::Debug for PowerElements<'de> {
1895 fn fmt(
1896 &self,
1897 f: &mut ::core::fmt::Formatter<'_>,
1898 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1899 f.debug_struct("PowerElements")
1900 .field("application_activity", &self.application_activity())
1901 .finish()
1902 }
1903 }
1904
1905 impl<'de> ::fidl_next::IntoNatural for PowerElements<'de> {
1906 type Natural = crate::natural::PowerElements;
1907 }
1908
1909 #[derive(Debug)]
1911 #[repr(C)]
1912 pub struct ActivityGovernorAcquireUnmonitoredWakeLeaseResponse {
1913 pub token: ::fidl_next::wire::fuchsia::EventPair,
1914 }
1915
1916 static_assertions::const_assert_eq!(
1917 std::mem::size_of::<ActivityGovernorAcquireUnmonitoredWakeLeaseResponse>(),
1918 4
1919 );
1920 static_assertions::const_assert_eq!(
1921 std::mem::align_of::<ActivityGovernorAcquireUnmonitoredWakeLeaseResponse>(),
1922 4
1923 );
1924
1925 static_assertions::const_assert_eq!(
1926 std::mem::offset_of!(ActivityGovernorAcquireUnmonitoredWakeLeaseResponse, token),
1927 0
1928 );
1929
1930 impl ::fidl_next::Constrained for ActivityGovernorAcquireUnmonitoredWakeLeaseResponse {
1931 type Constraint = ();
1932
1933 fn validate(
1934 _: ::fidl_next::Slot<'_, Self>,
1935 _: Self::Constraint,
1936 ) -> Result<(), ::fidl_next::ValidationError> {
1937 Ok(())
1938 }
1939 }
1940
1941 unsafe impl ::fidl_next::Wire for ActivityGovernorAcquireUnmonitoredWakeLeaseResponse {
1942 type Narrowed<'de> = ActivityGovernorAcquireUnmonitoredWakeLeaseResponse;
1943
1944 #[inline]
1945 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1946 ::fidl_next::munge! {
1947 let Self {
1948 token,
1949
1950 } = &mut *out_;
1951 }
1952
1953 ::fidl_next::Wire::zero_padding(token);
1954 }
1955 }
1956
1957 unsafe impl<___D> ::fidl_next::Decode<___D> for ActivityGovernorAcquireUnmonitoredWakeLeaseResponse
1958 where
1959 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1960 ___D: ::fidl_next::fuchsia::HandleDecoder,
1961 {
1962 fn decode(
1963 slot_: ::fidl_next::Slot<'_, Self>,
1964 decoder_: &mut ___D,
1965 _: (),
1966 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1967 ::fidl_next::munge! {
1968 let Self {
1969 mut token,
1970
1971 } = slot_;
1972 }
1973
1974 let _field = token.as_mut();
1975
1976 ::fidl_next::Decode::decode(token.as_mut(), decoder_, ())?;
1977
1978 Ok(())
1979 }
1980 }
1981
1982 impl ::fidl_next::IntoNatural for ActivityGovernorAcquireUnmonitoredWakeLeaseResponse {
1983 type Natural = crate::natural::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse;
1984 }
1985
1986 #[derive(Debug)]
1988 #[repr(C)]
1989 pub struct ActivityGovernorAcquireWakeLeaseWithTokenRequest<'de> {
1990 pub name: ::fidl_next::wire::String<'de>,
1991
1992 pub server_token: ::fidl_next::wire::fuchsia::EventPair,
1993 }
1994
1995 static_assertions::const_assert_eq!(
1996 std::mem::size_of::<ActivityGovernorAcquireWakeLeaseWithTokenRequest<'_>>(),
1997 24
1998 );
1999 static_assertions::const_assert_eq!(
2000 std::mem::align_of::<ActivityGovernorAcquireWakeLeaseWithTokenRequest<'_>>(),
2001 8
2002 );
2003
2004 static_assertions::const_assert_eq!(
2005 std::mem::offset_of!(ActivityGovernorAcquireWakeLeaseWithTokenRequest<'_>, name),
2006 0
2007 );
2008
2009 static_assertions::const_assert_eq!(
2010 std::mem::offset_of!(ActivityGovernorAcquireWakeLeaseWithTokenRequest<'_>, server_token),
2011 16
2012 );
2013
2014 impl ::fidl_next::Constrained for ActivityGovernorAcquireWakeLeaseWithTokenRequest<'_> {
2015 type Constraint = ();
2016
2017 fn validate(
2018 _: ::fidl_next::Slot<'_, Self>,
2019 _: Self::Constraint,
2020 ) -> Result<(), ::fidl_next::ValidationError> {
2021 Ok(())
2022 }
2023 }
2024
2025 unsafe impl ::fidl_next::Wire for ActivityGovernorAcquireWakeLeaseWithTokenRequest<'static> {
2026 type Narrowed<'de> = ActivityGovernorAcquireWakeLeaseWithTokenRequest<'de>;
2027
2028 #[inline]
2029 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2030 ::fidl_next::munge! {
2031 let Self {
2032 name,
2033 server_token,
2034
2035 } = &mut *out_;
2036 }
2037
2038 ::fidl_next::Wire::zero_padding(name);
2039
2040 ::fidl_next::Wire::zero_padding(server_token);
2041
2042 unsafe {
2043 out_.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
2044 }
2045 }
2046 }
2047
2048 unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
2049 for ActivityGovernorAcquireWakeLeaseWithTokenRequest<'de>
2050 where
2051 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2052 ___D: ::fidl_next::Decoder<'de>,
2053 ___D: ::fidl_next::fuchsia::HandleDecoder,
2054 {
2055 fn decode(
2056 slot_: ::fidl_next::Slot<'_, Self>,
2057 decoder_: &mut ___D,
2058 _: (),
2059 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2060 if slot_.as_bytes()[20..24] != [0u8; 4] {
2061 return Err(::fidl_next::DecodeError::InvalidPadding);
2062 }
2063
2064 ::fidl_next::munge! {
2065 let Self {
2066 mut name,
2067 mut server_token,
2068
2069 } = slot_;
2070 }
2071
2072 let _field = name.as_mut();
2073 ::fidl_next::Constrained::validate(_field, 64)?;
2074 ::fidl_next::Decode::decode(name.as_mut(), decoder_, 64)?;
2075
2076 let name = unsafe { name.deref_unchecked() };
2077
2078 if name.len() > 64 {
2079 return Err(::fidl_next::DecodeError::VectorTooLong {
2080 size: name.len() as u64,
2081 limit: 64,
2082 });
2083 }
2084
2085 let _field = server_token.as_mut();
2086
2087 ::fidl_next::Decode::decode(server_token.as_mut(), decoder_, ())?;
2088
2089 Ok(())
2090 }
2091 }
2092
2093 impl<'de> ::fidl_next::IntoNatural for ActivityGovernorAcquireWakeLeaseWithTokenRequest<'de> {
2094 type Natural = crate::natural::ActivityGovernorAcquireWakeLeaseWithTokenRequest;
2095 }
2096
2097 #[repr(C)]
2099 pub struct ActivityGovernorAcquireWakeLease2Request<'de> {
2100 pub(crate) table: ::fidl_next::wire::Table<'de>,
2101 }
2102
2103 impl<'de> Drop for ActivityGovernorAcquireWakeLease2Request<'de> {
2104 fn drop(&mut self) {
2105 let _ = self.table.get(1).map(|envelope| unsafe {
2106 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2107 });
2108
2109 let _ = self.table.get(2).map(|envelope| unsafe {
2110 envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
2111 });
2112
2113 let _ = self.table.get(3).map(|envelope| unsafe {
2114 envelope.read_unchecked::<::fidl_next::wire::fuchsia::EventPair>()
2115 });
2116
2117 let _ = self.table.get(4).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
2118 }
2119 }
2120
2121 impl ::fidl_next::Constrained for ActivityGovernorAcquireWakeLease2Request<'_> {
2122 type Constraint = ();
2123
2124 fn validate(
2125 _: ::fidl_next::Slot<'_, Self>,
2126 _: Self::Constraint,
2127 ) -> Result<(), ::fidl_next::ValidationError> {
2128 Ok(())
2129 }
2130 }
2131
2132 unsafe impl ::fidl_next::Wire for ActivityGovernorAcquireWakeLease2Request<'static> {
2133 type Narrowed<'de> = ActivityGovernorAcquireWakeLease2Request<'de>;
2134
2135 #[inline]
2136 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2137 ::fidl_next::munge!(let Self { table } = out);
2138 ::fidl_next::wire::Table::zero_padding(table);
2139 }
2140 }
2141
2142 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ActivityGovernorAcquireWakeLease2Request<'de>
2143 where
2144 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2145 ___D: ::fidl_next::fuchsia::HandleDecoder,
2146 {
2147 fn decode(
2148 slot: ::fidl_next::Slot<'_, Self>,
2149 decoder: &mut ___D,
2150 _: (),
2151 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2152 ::fidl_next::munge!(let Self { table } = slot);
2153
2154 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2155 match ordinal {
2156 0 => unsafe { ::core::hint::unreachable_unchecked() },
2157
2158 1 => {
2159 ::fidl_next::wire::Envelope::decode_as::<
2160 ___D,
2161 ::fidl_next::wire::String<'de>,
2162 >(slot.as_mut(), decoder, 64)?;
2163
2164 let value = unsafe {
2165 slot.deref_unchecked()
2166 .deref_unchecked::<::fidl_next::wire::String<'_>>()
2167 };
2168
2169 if value.len() > 64 {
2170 return Err(::fidl_next::DecodeError::VectorTooLong {
2171 size: value.len() as u64,
2172 limit: 64,
2173 });
2174 }
2175
2176 Ok(())
2177 }
2178
2179 2 => {
2180 ::fidl_next::wire::Envelope::decode_as::<
2181 ___D,
2182 ::fidl_next::wire::fuchsia::EventPair,
2183 >(slot.as_mut(), decoder, ())?;
2184
2185 Ok(())
2186 }
2187
2188 3 => {
2189 ::fidl_next::wire::Envelope::decode_as::<
2190 ___D,
2191 ::fidl_next::wire::fuchsia::EventPair,
2192 >(slot.as_mut(), decoder, ())?;
2193
2194 Ok(())
2195 }
2196
2197 4 => {
2198 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
2199 slot.as_mut(),
2200 decoder,
2201 (),
2202 )?;
2203
2204 Ok(())
2205 }
2206
2207 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2208 }
2209 })
2210 }
2211 }
2212
2213 impl<'de> ActivityGovernorAcquireWakeLease2Request<'de> {
2214 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
2215 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2216 }
2217
2218 pub fn take_name(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
2219 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2220 }
2221
2222 pub fn server_token(
2223 &self,
2224 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::EventPair> {
2225 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2226 }
2227
2228 pub fn take_server_token(
2229 &mut self,
2230 ) -> ::core::option::Option<::fidl_next::wire::fuchsia::EventPair> {
2231 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
2232 }
2233
2234 pub fn previous_client_token(
2235 &self,
2236 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::EventPair> {
2237 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2238 }
2239
2240 pub fn take_previous_client_token(
2241 &mut self,
2242 ) -> ::core::option::Option<::fidl_next::wire::fuchsia::EventPair> {
2243 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
2244 }
2245
2246 pub fn unmonitored(&self) -> ::core::option::Option<&bool> {
2247 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
2248 }
2249
2250 pub fn take_unmonitored(&mut self) -> ::core::option::Option<bool> {
2251 unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
2252 }
2253 }
2254
2255 impl<'de> ::core::fmt::Debug for ActivityGovernorAcquireWakeLease2Request<'de> {
2256 fn fmt(
2257 &self,
2258 f: &mut ::core::fmt::Formatter<'_>,
2259 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2260 f.debug_struct("ActivityGovernorAcquireWakeLease2Request")
2261 .field("name", &self.name())
2262 .field("server_token", &self.server_token())
2263 .field("previous_client_token", &self.previous_client_token())
2264 .field("unmonitored", &self.unmonitored())
2265 .finish()
2266 }
2267 }
2268
2269 impl<'de> ::fidl_next::IntoNatural for ActivityGovernorAcquireWakeLease2Request<'de> {
2270 type Natural = crate::natural::ActivityGovernorAcquireWakeLease2Request;
2271 }
2272
2273 #[derive(Debug)]
2275 #[repr(C)]
2276 pub struct ActivityGovernorTakeApplicationActivityLeaseResponse {
2277 pub token: ::fidl_next::wire::fuchsia::EventPair,
2278 }
2279
2280 static_assertions::const_assert_eq!(
2281 std::mem::size_of::<ActivityGovernorTakeApplicationActivityLeaseResponse>(),
2282 4
2283 );
2284 static_assertions::const_assert_eq!(
2285 std::mem::align_of::<ActivityGovernorTakeApplicationActivityLeaseResponse>(),
2286 4
2287 );
2288
2289 static_assertions::const_assert_eq!(
2290 std::mem::offset_of!(ActivityGovernorTakeApplicationActivityLeaseResponse, token),
2291 0
2292 );
2293
2294 impl ::fidl_next::Constrained for ActivityGovernorTakeApplicationActivityLeaseResponse {
2295 type Constraint = ();
2296
2297 fn validate(
2298 _: ::fidl_next::Slot<'_, Self>,
2299 _: Self::Constraint,
2300 ) -> Result<(), ::fidl_next::ValidationError> {
2301 Ok(())
2302 }
2303 }
2304
2305 unsafe impl ::fidl_next::Wire for ActivityGovernorTakeApplicationActivityLeaseResponse {
2306 type Narrowed<'de> = ActivityGovernorTakeApplicationActivityLeaseResponse;
2307
2308 #[inline]
2309 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2310 ::fidl_next::munge! {
2311 let Self {
2312 token,
2313
2314 } = &mut *out_;
2315 }
2316
2317 ::fidl_next::Wire::zero_padding(token);
2318 }
2319 }
2320
2321 unsafe impl<___D> ::fidl_next::Decode<___D> for ActivityGovernorTakeApplicationActivityLeaseResponse
2322 where
2323 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2324 ___D: ::fidl_next::fuchsia::HandleDecoder,
2325 {
2326 fn decode(
2327 slot_: ::fidl_next::Slot<'_, Self>,
2328 decoder_: &mut ___D,
2329 _: (),
2330 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2331 ::fidl_next::munge! {
2332 let Self {
2333 mut token,
2334
2335 } = slot_;
2336 }
2337
2338 let _field = token.as_mut();
2339
2340 ::fidl_next::Decode::decode(token.as_mut(), decoder_, ())?;
2341
2342 Ok(())
2343 }
2344 }
2345
2346 impl ::fidl_next::IntoNatural for ActivityGovernorTakeApplicationActivityLeaseResponse {
2347 type Natural = crate::natural::ActivityGovernorTakeApplicationActivityLeaseResponse;
2348 }
2349
2350 #[repr(C)]
2352 pub struct Cpu<'de> {
2353 pub(crate) table: ::fidl_next::wire::Table<'de>,
2354 }
2355
2356 impl<'de> Drop for Cpu<'de> {
2357 fn drop(&mut self) {
2358 let _ = self.table.get(1).map(|envelope| unsafe {
2359 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Event>()
2360 });
2361 }
2362 }
2363
2364 impl ::fidl_next::Constrained for Cpu<'_> {
2365 type Constraint = ();
2366
2367 fn validate(
2368 _: ::fidl_next::Slot<'_, Self>,
2369 _: Self::Constraint,
2370 ) -> Result<(), ::fidl_next::ValidationError> {
2371 Ok(())
2372 }
2373 }
2374
2375 unsafe impl ::fidl_next::Wire for Cpu<'static> {
2376 type Narrowed<'de> = Cpu<'de>;
2377
2378 #[inline]
2379 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2380 ::fidl_next::munge!(let Self { table } = out);
2381 ::fidl_next::wire::Table::zero_padding(table);
2382 }
2383 }
2384
2385 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Cpu<'de>
2386 where
2387 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2388 ___D: ::fidl_next::fuchsia::HandleDecoder,
2389 {
2390 fn decode(
2391 slot: ::fidl_next::Slot<'_, Self>,
2392 decoder: &mut ___D,
2393 _: (),
2394 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2395 ::fidl_next::munge!(let Self { table } = slot);
2396
2397 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2398 match ordinal {
2399 0 => unsafe { ::core::hint::unreachable_unchecked() },
2400
2401 1 => {
2402 ::fidl_next::wire::Envelope::decode_as::<
2403 ___D,
2404 ::fidl_next::wire::fuchsia::Event,
2405 >(slot.as_mut(), decoder, ())?;
2406
2407 Ok(())
2408 }
2409
2410 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2411 }
2412 })
2413 }
2414 }
2415
2416 impl<'de> Cpu<'de> {
2417 pub fn assertive_dependency_token(
2418 &self,
2419 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::Event> {
2420 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2421 }
2422
2423 pub fn take_assertive_dependency_token(
2424 &mut self,
2425 ) -> ::core::option::Option<::fidl_next::wire::fuchsia::Event> {
2426 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2427 }
2428 }
2429
2430 impl<'de> ::core::fmt::Debug for Cpu<'de> {
2431 fn fmt(
2432 &self,
2433 f: &mut ::core::fmt::Formatter<'_>,
2434 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2435 f.debug_struct("Cpu")
2436 .field("assertive_dependency_token", &self.assertive_dependency_token())
2437 .finish()
2438 }
2439 }
2440
2441 impl<'de> ::fidl_next::IntoNatural for Cpu<'de> {
2442 type Natural = crate::natural::Cpu;
2443 }
2444
2445 #[repr(C)]
2447 pub struct CpuElementManagerAddExecutionStateDependencyRequest<'de> {
2448 pub(crate) table: ::fidl_next::wire::Table<'de>,
2449 }
2450
2451 impl<'de> Drop for CpuElementManagerAddExecutionStateDependencyRequest<'de> {
2452 fn drop(&mut self) {
2453 let _ = self.table.get(1).map(|envelope| unsafe {
2454 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Event>()
2455 });
2456
2457 let _ = self.table.get(2).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
2458 }
2459 }
2460
2461 impl ::fidl_next::Constrained for CpuElementManagerAddExecutionStateDependencyRequest<'_> {
2462 type Constraint = ();
2463
2464 fn validate(
2465 _: ::fidl_next::Slot<'_, Self>,
2466 _: Self::Constraint,
2467 ) -> Result<(), ::fidl_next::ValidationError> {
2468 Ok(())
2469 }
2470 }
2471
2472 unsafe impl ::fidl_next::Wire for CpuElementManagerAddExecutionStateDependencyRequest<'static> {
2473 type Narrowed<'de> = CpuElementManagerAddExecutionStateDependencyRequest<'de>;
2474
2475 #[inline]
2476 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2477 ::fidl_next::munge!(let Self { table } = out);
2478 ::fidl_next::wire::Table::zero_padding(table);
2479 }
2480 }
2481
2482 unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
2483 for CpuElementManagerAddExecutionStateDependencyRequest<'de>
2484 where
2485 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2486 ___D: ::fidl_next::fuchsia::HandleDecoder,
2487 {
2488 fn decode(
2489 slot: ::fidl_next::Slot<'_, Self>,
2490 decoder: &mut ___D,
2491 _: (),
2492 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2493 ::fidl_next::munge!(let Self { table } = slot);
2494
2495 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2496 match ordinal {
2497 0 => unsafe { ::core::hint::unreachable_unchecked() },
2498
2499 1 => {
2500 ::fidl_next::wire::Envelope::decode_as::<
2501 ___D,
2502 ::fidl_next::wire::fuchsia::Event,
2503 >(slot.as_mut(), decoder, ())?;
2504
2505 Ok(())
2506 }
2507
2508 2 => {
2509 ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
2510 slot.as_mut(),
2511 decoder,
2512 (),
2513 )?;
2514
2515 Ok(())
2516 }
2517
2518 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2519 }
2520 })
2521 }
2522 }
2523
2524 impl<'de> CpuElementManagerAddExecutionStateDependencyRequest<'de> {
2525 pub fn dependency_token(
2526 &self,
2527 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::Event> {
2528 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2529 }
2530
2531 pub fn take_dependency_token(
2532 &mut self,
2533 ) -> ::core::option::Option<::fidl_next::wire::fuchsia::Event> {
2534 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2535 }
2536
2537 pub fn power_level(&self) -> ::core::option::Option<&u8> {
2538 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2539 }
2540
2541 pub fn take_power_level(&mut self) -> ::core::option::Option<u8> {
2542 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
2543 }
2544 }
2545
2546 impl<'de> ::core::fmt::Debug for CpuElementManagerAddExecutionStateDependencyRequest<'de> {
2547 fn fmt(
2548 &self,
2549 f: &mut ::core::fmt::Formatter<'_>,
2550 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2551 f.debug_struct("CpuElementManagerAddExecutionStateDependencyRequest")
2552 .field("dependency_token", &self.dependency_token())
2553 .field("power_level", &self.power_level())
2554 .finish()
2555 }
2556 }
2557
2558 impl<'de> ::fidl_next::IntoNatural for CpuElementManagerAddExecutionStateDependencyRequest<'de> {
2559 type Natural = crate::natural::CpuElementManagerAddExecutionStateDependencyRequest;
2560 }
2561
2562 #[repr(C)]
2564 pub struct ExecutionState<'de> {
2565 pub(crate) table: ::fidl_next::wire::Table<'de>,
2566 }
2567
2568 impl<'de> Drop for ExecutionState<'de> {
2569 fn drop(&mut self) {
2570 let _ = self.table.get(1).map(|envelope| unsafe {
2571 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Event>()
2572 });
2573 }
2574 }
2575
2576 impl ::fidl_next::Constrained for ExecutionState<'_> {
2577 type Constraint = ();
2578
2579 fn validate(
2580 _: ::fidl_next::Slot<'_, Self>,
2581 _: Self::Constraint,
2582 ) -> Result<(), ::fidl_next::ValidationError> {
2583 Ok(())
2584 }
2585 }
2586
2587 unsafe impl ::fidl_next::Wire for ExecutionState<'static> {
2588 type Narrowed<'de> = ExecutionState<'de>;
2589
2590 #[inline]
2591 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2592 ::fidl_next::munge!(let Self { table } = out);
2593 ::fidl_next::wire::Table::zero_padding(table);
2594 }
2595 }
2596
2597 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ExecutionState<'de>
2598 where
2599 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2600 ___D: ::fidl_next::fuchsia::HandleDecoder,
2601 {
2602 fn decode(
2603 slot: ::fidl_next::Slot<'_, Self>,
2604 decoder: &mut ___D,
2605 _: (),
2606 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2607 ::fidl_next::munge!(let Self { table } = slot);
2608
2609 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2610 match ordinal {
2611 0 => unsafe { ::core::hint::unreachable_unchecked() },
2612
2613 1 => {
2614 ::fidl_next::wire::Envelope::decode_as::<
2615 ___D,
2616 ::fidl_next::wire::fuchsia::Event,
2617 >(slot.as_mut(), decoder, ())?;
2618
2619 Ok(())
2620 }
2621
2622 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2623 }
2624 })
2625 }
2626 }
2627
2628 impl<'de> ExecutionState<'de> {
2629 pub fn dependency_token(
2630 &self,
2631 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::Event> {
2632 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2633 }
2634
2635 pub fn take_dependency_token(
2636 &mut self,
2637 ) -> ::core::option::Option<::fidl_next::wire::fuchsia::Event> {
2638 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2639 }
2640 }
2641
2642 impl<'de> ::core::fmt::Debug for ExecutionState<'de> {
2643 fn fmt(
2644 &self,
2645 f: &mut ::core::fmt::Formatter<'_>,
2646 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2647 f.debug_struct("ExecutionState")
2648 .field("dependency_token", &self.dependency_token())
2649 .finish()
2650 }
2651 }
2652
2653 impl<'de> ::fidl_next::IntoNatural for ExecutionState<'de> {
2654 type Natural = crate::natural::ExecutionState;
2655 }
2656
2657 #[repr(C)]
2659 pub struct ExecutionStateManagerAddApplicationActivityDependencyRequest<'de> {
2660 pub(crate) table: ::fidl_next::wire::Table<'de>,
2661 }
2662
2663 impl<'de> Drop for ExecutionStateManagerAddApplicationActivityDependencyRequest<'de> {
2664 fn drop(&mut self) {
2665 let _ = self.table.get(1).map(|envelope| unsafe {
2666 envelope.read_unchecked::<::fidl_next::wire::fuchsia::Event>()
2667 });
2668
2669 let _ = self.table.get(2).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
2670 }
2671 }
2672
2673 impl ::fidl_next::Constrained for ExecutionStateManagerAddApplicationActivityDependencyRequest<'_> {
2674 type Constraint = ();
2675
2676 fn validate(
2677 _: ::fidl_next::Slot<'_, Self>,
2678 _: Self::Constraint,
2679 ) -> Result<(), ::fidl_next::ValidationError> {
2680 Ok(())
2681 }
2682 }
2683
2684 unsafe impl ::fidl_next::Wire
2685 for ExecutionStateManagerAddApplicationActivityDependencyRequest<'static>
2686 {
2687 type Narrowed<'de> = ExecutionStateManagerAddApplicationActivityDependencyRequest<'de>;
2688
2689 #[inline]
2690 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2691 ::fidl_next::munge!(let Self { table } = out);
2692 ::fidl_next::wire::Table::zero_padding(table);
2693 }
2694 }
2695
2696 unsafe impl<'de, ___D> ::fidl_next::Decode<___D>
2697 for ExecutionStateManagerAddApplicationActivityDependencyRequest<'de>
2698 where
2699 ___D: ::fidl_next::Decoder<'de> + ?Sized,
2700 ___D: ::fidl_next::fuchsia::HandleDecoder,
2701 {
2702 fn decode(
2703 slot: ::fidl_next::Slot<'_, Self>,
2704 decoder: &mut ___D,
2705 _: (),
2706 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2707 ::fidl_next::munge!(let Self { table } = slot);
2708
2709 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2710 match ordinal {
2711 0 => unsafe { ::core::hint::unreachable_unchecked() },
2712
2713 1 => {
2714 ::fidl_next::wire::Envelope::decode_as::<
2715 ___D,
2716 ::fidl_next::wire::fuchsia::Event,
2717 >(slot.as_mut(), decoder, ())?;
2718
2719 Ok(())
2720 }
2721
2722 2 => {
2723 ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
2724 slot.as_mut(),
2725 decoder,
2726 (),
2727 )?;
2728
2729 Ok(())
2730 }
2731
2732 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
2733 }
2734 })
2735 }
2736 }
2737
2738 impl<'de> ExecutionStateManagerAddApplicationActivityDependencyRequest<'de> {
2739 pub fn dependency_token(
2740 &self,
2741 ) -> ::core::option::Option<&::fidl_next::wire::fuchsia::Event> {
2742 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2743 }
2744
2745 pub fn take_dependency_token(
2746 &mut self,
2747 ) -> ::core::option::Option<::fidl_next::wire::fuchsia::Event> {
2748 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
2749 }
2750
2751 pub fn power_level(&self) -> ::core::option::Option<&u8> {
2752 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2753 }
2754
2755 pub fn take_power_level(&mut self) -> ::core::option::Option<u8> {
2756 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
2757 }
2758 }
2759
2760 impl<'de> ::core::fmt::Debug for ExecutionStateManagerAddApplicationActivityDependencyRequest<'de> {
2761 fn fmt(
2762 &self,
2763 f: &mut ::core::fmt::Formatter<'_>,
2764 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2765 f.debug_struct("ExecutionStateManagerAddApplicationActivityDependencyRequest")
2766 .field("dependency_token", &self.dependency_token())
2767 .field("power_level", &self.power_level())
2768 .finish()
2769 }
2770 }
2771
2772 impl<'de> ::fidl_next::IntoNatural
2773 for ExecutionStateManagerAddApplicationActivityDependencyRequest<'de>
2774 {
2775 type Natural = crate::natural::ExecutionStateManagerAddApplicationActivityDependencyRequest;
2776 }
2777}
2778
2779pub mod wire_optional {
2780
2781 pub use fidl_next_common_fuchsia_power_system::wire_optional::*;
2782}
2783
2784pub mod generic {
2785
2786 pub use fidl_next_common_fuchsia_power_system::generic::*;
2787
2788 pub struct ActivityGovernorAcquireWakeLeaseResponse<T0> {
2790 pub token: T0,
2791 }
2792
2793 unsafe impl<___E, T0>
2794 ::fidl_next::Encode<crate::wire::ActivityGovernorAcquireWakeLeaseResponse, ___E>
2795 for ActivityGovernorAcquireWakeLeaseResponse<T0>
2796 where
2797 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2798 ___E: ::fidl_next::fuchsia::HandleEncoder,
2799 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::EventPair, ___E>,
2800 {
2801 #[inline]
2802 fn encode(
2803 self,
2804 encoder_: &mut ___E,
2805 out_: &mut ::core::mem::MaybeUninit<
2806 crate::wire::ActivityGovernorAcquireWakeLeaseResponse,
2807 >,
2808 _: (),
2809 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2810 ::fidl_next::munge! {
2811 let crate::wire::ActivityGovernorAcquireWakeLeaseResponse {
2812 token,
2813
2814 } = out_;
2815 }
2816
2817 ::fidl_next::Encode::encode(self.token, encoder_, token, ())?;
2818
2819 Ok(())
2820 }
2821 }
2822
2823 pub struct ActivityGovernorRegisterSuspendBlockerResponse<T0> {
2825 pub token: T0,
2826 }
2827
2828 unsafe impl<___E, T0>
2829 ::fidl_next::Encode<crate::wire::ActivityGovernorRegisterSuspendBlockerResponse, ___E>
2830 for ActivityGovernorRegisterSuspendBlockerResponse<T0>
2831 where
2832 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2833 ___E: ::fidl_next::fuchsia::HandleEncoder,
2834 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::EventPair, ___E>,
2835 {
2836 #[inline]
2837 fn encode(
2838 self,
2839 encoder_: &mut ___E,
2840 out_: &mut ::core::mem::MaybeUninit<
2841 crate::wire::ActivityGovernorRegisterSuspendBlockerResponse,
2842 >,
2843 _: (),
2844 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2845 ::fidl_next::munge! {
2846 let crate::wire::ActivityGovernorRegisterSuspendBlockerResponse {
2847 token,
2848
2849 } = out_;
2850 }
2851
2852 ::fidl_next::Encode::encode(self.token, encoder_, token, ())?;
2853
2854 Ok(())
2855 }
2856 }
2857
2858 pub struct ActivityGovernorAcquireUnmonitoredWakeLeaseResponse<T0> {
2860 pub token: T0,
2861 }
2862
2863 unsafe impl<___E, T0>
2864 ::fidl_next::Encode<crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse, ___E>
2865 for ActivityGovernorAcquireUnmonitoredWakeLeaseResponse<T0>
2866 where
2867 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2868 ___E: ::fidl_next::fuchsia::HandleEncoder,
2869 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::EventPair, ___E>,
2870 {
2871 #[inline]
2872 fn encode(
2873 self,
2874 encoder_: &mut ___E,
2875 out_: &mut ::core::mem::MaybeUninit<
2876 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse,
2877 >,
2878 _: (),
2879 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2880 ::fidl_next::munge! {
2881 let crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse {
2882 token,
2883
2884 } = out_;
2885 }
2886
2887 ::fidl_next::Encode::encode(self.token, encoder_, token, ())?;
2888
2889 Ok(())
2890 }
2891 }
2892
2893 pub struct ActivityGovernorAcquireWakeLeaseWithTokenRequest<T0, T1> {
2895 pub name: T0,
2896
2897 pub server_token: T1,
2898 }
2899
2900 unsafe impl<___E, T0, T1>
2901 ::fidl_next::Encode<
2902 crate::wire::ActivityGovernorAcquireWakeLeaseWithTokenRequest<'static>,
2903 ___E,
2904 > for ActivityGovernorAcquireWakeLeaseWithTokenRequest<T0, T1>
2905 where
2906 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2907 ___E: ::fidl_next::Encoder,
2908 ___E: ::fidl_next::fuchsia::HandleEncoder,
2909 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
2910 T1: ::fidl_next::Encode<::fidl_next::wire::fuchsia::EventPair, ___E>,
2911 {
2912 #[inline]
2913 fn encode(
2914 self,
2915 encoder_: &mut ___E,
2916 out_: &mut ::core::mem::MaybeUninit<
2917 crate::wire::ActivityGovernorAcquireWakeLeaseWithTokenRequest<'static>,
2918 >,
2919 _: (),
2920 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2921 ::fidl_next::munge! {
2922 let crate::wire::ActivityGovernorAcquireWakeLeaseWithTokenRequest {
2923 name,
2924 server_token,
2925
2926 } = out_;
2927 }
2928
2929 ::fidl_next::Encode::encode(self.name, encoder_, name, 64)?;
2930
2931 ::fidl_next::Encode::encode(self.server_token, encoder_, server_token, ())?;
2932
2933 Ok(())
2934 }
2935 }
2936
2937 pub struct ActivityGovernorTakeApplicationActivityLeaseResponse<T0> {
2939 pub token: T0,
2940 }
2941
2942 unsafe impl<___E, T0>
2943 ::fidl_next::Encode<crate::wire::ActivityGovernorTakeApplicationActivityLeaseResponse, ___E>
2944 for ActivityGovernorTakeApplicationActivityLeaseResponse<T0>
2945 where
2946 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2947 ___E: ::fidl_next::fuchsia::HandleEncoder,
2948 T0: ::fidl_next::Encode<::fidl_next::wire::fuchsia::EventPair, ___E>,
2949 {
2950 #[inline]
2951 fn encode(
2952 self,
2953 encoder_: &mut ___E,
2954 out_: &mut ::core::mem::MaybeUninit<
2955 crate::wire::ActivityGovernorTakeApplicationActivityLeaseResponse,
2956 >,
2957 _: (),
2958 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2959 ::fidl_next::munge! {
2960 let crate::wire::ActivityGovernorTakeApplicationActivityLeaseResponse {
2961 token,
2962
2963 } = out_;
2964 }
2965
2966 ::fidl_next::Encode::encode(self.token, encoder_, token, ())?;
2967
2968 Ok(())
2969 }
2970 }
2971}
2972
2973pub use self::natural::*;
2974
2975#[doc = " A service for exposing events and power elements managed by the system\n activity governor (SAG).\n\n SAG is responsible for managing the execution state of the hardware\n platform. The hardware platform consists of the components required to\n execute code on the device. This typically includes the CPU, memory,\n operating system, and other components required for these components to\n function (clock trees, power domains, etc.).\n"]
2977#[derive(PartialEq, Debug)]
2978pub struct ActivityGovernor;
2979
2980impl ::fidl_next::Discoverable for ActivityGovernor {
2981 const PROTOCOL_NAME: &'static str = "fuchsia.power.system.ActivityGovernor";
2982}
2983
2984#[cfg(target_os = "fuchsia")]
2985impl ::fidl_next::HasTransport for ActivityGovernor {
2986 type Transport = ::fidl_next::fuchsia::zx::Channel;
2987}
2988
2989pub mod activity_governor {
2990 pub mod prelude {
2991 pub use crate::{
2992 ActivityGovernor, ActivityGovernorClientHandler, ActivityGovernorLocalClientHandler,
2993 ActivityGovernorLocalServerHandler, ActivityGovernorServerHandler, activity_governor,
2994 };
2995
2996 pub use crate::natural::AcquireWakeLeaseError;
2997
2998 pub use crate::natural::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest;
2999
3000 pub use crate::natural::ActivityGovernorAcquireWakeLease2Request;
3001
3002 pub use crate::natural::ActivityGovernorAcquireWakeLeaseRequest;
3003
3004 pub use crate::natural::ActivityGovernorAcquireWakeLeaseWithTokenRequest;
3005
3006 pub use crate::natural::ActivityGovernorRegisterSuspendBlockerRequest;
3007
3008 pub use crate::natural::ActivityGovernorTakeApplicationActivityLeaseRequest;
3009
3010 pub use crate::natural::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse;
3011
3012 pub use crate::natural::ActivityGovernorAcquireWakeLease2Response;
3013
3014 pub use crate::natural::ActivityGovernorAcquireWakeLeaseWithTokenResponse;
3015
3016 pub use crate::natural::ActivityGovernorAcquireWakeLeaseResponse;
3017
3018 pub use crate::natural::ActivityGovernorRegisterSuspendBlockerResponse;
3019
3020 pub use crate::natural::ActivityGovernorTakeApplicationActivityLeaseResponse;
3021
3022 pub use crate::natural::PowerElements;
3023
3024 pub use crate::natural::RegisterSuspendBlockerError;
3025 }
3026
3027 pub struct GetPowerElements;
3028
3029 impl ::fidl_next::Method for GetPowerElements {
3030 const ORDINAL: u64 = 8755001135707412082;
3031 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3032 ::fidl_next::protocol::Flexibility::Flexible;
3033
3034 type Protocol = crate::ActivityGovernor;
3035
3036 type Request = ::fidl_next::wire::EmptyMessageBody;
3037 }
3038
3039 impl ::fidl_next::TwoWayMethod for GetPowerElements {
3040 type Response = ::fidl_next::wire::Flexible<'static, crate::wire::PowerElements<'static>>;
3041 }
3042
3043 impl<___R> ::fidl_next::Respond<___R> for GetPowerElements {
3044 type Output = ::fidl_next::Flexible<___R>;
3045
3046 fn respond(response: ___R) -> Self::Output {
3047 ::fidl_next::Flexible(response)
3048 }
3049 }
3050
3051 pub struct AcquireWakeLease;
3052
3053 impl ::fidl_next::Method for AcquireWakeLease {
3054 const ORDINAL: u64 = 3306304846648819971;
3055 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3056 ::fidl_next::protocol::Flexibility::Flexible;
3057
3058 type Protocol = crate::ActivityGovernor;
3059
3060 type Request = crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'static>;
3061 }
3062
3063 impl ::fidl_next::TwoWayMethod for AcquireWakeLease {
3064 type Response = ::fidl_next::wire::Result<
3065 'static,
3066 crate::wire::ActivityGovernorAcquireWakeLeaseResponse,
3067 crate::wire::AcquireWakeLeaseError,
3068 >;
3069 }
3070
3071 impl<___R> ::fidl_next::Respond<___R> for AcquireWakeLease {
3072 type Output = ::core::result::Result<
3073 crate::generic::ActivityGovernorAcquireWakeLeaseResponse<___R>,
3074 ::fidl_next::never::Never,
3075 >;
3076
3077 fn respond(response: ___R) -> Self::Output {
3078 ::core::result::Result::Ok(crate::generic::ActivityGovernorAcquireWakeLeaseResponse {
3079 token: response,
3080 })
3081 }
3082 }
3083
3084 impl<___R> ::fidl_next::RespondErr<___R> for AcquireWakeLease {
3085 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3086
3087 fn respond_err(response: ___R) -> Self::Output {
3088 ::core::result::Result::Err(response)
3089 }
3090 }
3091
3092 pub struct AcquireUnmonitoredWakeLease;
3093
3094 impl ::fidl_next::Method for AcquireUnmonitoredWakeLease {
3095 const ORDINAL: u64 = 6877005249659825577;
3096 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3097 ::fidl_next::protocol::Flexibility::Flexible;
3098
3099 type Protocol = crate::ActivityGovernor;
3100
3101 type Request = crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'static>;
3102 }
3103
3104 impl ::fidl_next::TwoWayMethod for AcquireUnmonitoredWakeLease {
3105 type Response = ::fidl_next::wire::Result<
3106 'static,
3107 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse,
3108 crate::wire::AcquireWakeLeaseError,
3109 >;
3110 }
3111
3112 impl<___R> ::fidl_next::Respond<___R> for AcquireUnmonitoredWakeLease {
3113 type Output = ::core::result::Result<
3114 crate::generic::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse<___R>,
3115 ::fidl_next::never::Never,
3116 >;
3117
3118 fn respond(response: ___R) -> Self::Output {
3119 ::core::result::Result::Ok(
3120 crate::generic::ActivityGovernorAcquireUnmonitoredWakeLeaseResponse {
3121 token: response,
3122 },
3123 )
3124 }
3125 }
3126
3127 impl<___R> ::fidl_next::RespondErr<___R> for AcquireUnmonitoredWakeLease {
3128 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3129
3130 fn respond_err(response: ___R) -> Self::Output {
3131 ::core::result::Result::Err(response)
3132 }
3133 }
3134
3135 pub struct AcquireWakeLeaseWithToken;
3136
3137 impl ::fidl_next::Method for AcquireWakeLeaseWithToken {
3138 const ORDINAL: u64 = 2079869883732225873;
3139 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3140 ::fidl_next::protocol::Flexibility::Flexible;
3141
3142 type Protocol = crate::ActivityGovernor;
3143
3144 type Request = crate::wire::ActivityGovernorAcquireWakeLeaseWithTokenRequest<'static>;
3145 }
3146
3147 impl ::fidl_next::TwoWayMethod for AcquireWakeLeaseWithToken {
3148 type Response = ::fidl_next::wire::Result<
3149 'static,
3150 crate::wire::ActivityGovernorAcquireWakeLeaseWithTokenResponse,
3151 crate::wire::AcquireWakeLeaseError,
3152 >;
3153 }
3154
3155 impl<___R> ::fidl_next::Respond<___R> for AcquireWakeLeaseWithToken {
3156 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
3157
3158 fn respond(response: ___R) -> Self::Output {
3159 ::core::result::Result::Ok(response)
3160 }
3161 }
3162
3163 impl<___R> ::fidl_next::RespondErr<___R> for AcquireWakeLeaseWithToken {
3164 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3165
3166 fn respond_err(response: ___R) -> Self::Output {
3167 ::core::result::Result::Err(response)
3168 }
3169 }
3170
3171 pub struct AcquireWakeLease2;
3172
3173 impl ::fidl_next::Method for AcquireWakeLease2 {
3174 const ORDINAL: u64 = 498586365593251363;
3175 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3176 ::fidl_next::protocol::Flexibility::Flexible;
3177
3178 type Protocol = crate::ActivityGovernor;
3179
3180 type Request = crate::wire::ActivityGovernorAcquireWakeLease2Request<'static>;
3181 }
3182
3183 impl ::fidl_next::TwoWayMethod for AcquireWakeLease2 {
3184 type Response = ::fidl_next::wire::Result<
3185 'static,
3186 crate::wire::ActivityGovernorAcquireWakeLease2Response,
3187 crate::wire::AcquireWakeLeaseError,
3188 >;
3189 }
3190
3191 impl<___R> ::fidl_next::Respond<___R> for AcquireWakeLease2 {
3192 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
3193
3194 fn respond(response: ___R) -> Self::Output {
3195 ::core::result::Result::Ok(response)
3196 }
3197 }
3198
3199 impl<___R> ::fidl_next::RespondErr<___R> for AcquireWakeLease2 {
3200 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3201
3202 fn respond_err(response: ___R) -> Self::Output {
3203 ::core::result::Result::Err(response)
3204 }
3205 }
3206
3207 pub struct TakeApplicationActivityLease;
3208
3209 impl ::fidl_next::Method for TakeApplicationActivityLease {
3210 const ORDINAL: u64 = 4020961735006149140;
3211 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3212 ::fidl_next::protocol::Flexibility::Flexible;
3213
3214 type Protocol = crate::ActivityGovernor;
3215
3216 type Request = crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'static>;
3217 }
3218
3219 impl ::fidl_next::TwoWayMethod for TakeApplicationActivityLease {
3220 type Response = ::fidl_next::wire::Flexible<
3221 'static,
3222 crate::wire::ActivityGovernorTakeApplicationActivityLeaseResponse,
3223 >;
3224 }
3225
3226 impl<___R> ::fidl_next::Respond<___R> for TakeApplicationActivityLease {
3227 type Output = ::fidl_next::Flexible<
3228 crate::generic::ActivityGovernorTakeApplicationActivityLeaseResponse<___R>,
3229 >;
3230
3231 fn respond(response: ___R) -> Self::Output {
3232 ::fidl_next::Flexible(
3233 crate::generic::ActivityGovernorTakeApplicationActivityLeaseResponse {
3234 token: response,
3235 },
3236 )
3237 }
3238 }
3239
3240 pub struct RegisterSuspendBlocker;
3241
3242 impl ::fidl_next::Method for RegisterSuspendBlocker {
3243 const ORDINAL: u64 = 3814361630267862785;
3244 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
3245 ::fidl_next::protocol::Flexibility::Flexible;
3246
3247 type Protocol = crate::ActivityGovernor;
3248
3249 type Request = crate::wire::ActivityGovernorRegisterSuspendBlockerRequest<'static>;
3250 }
3251
3252 impl ::fidl_next::TwoWayMethod for RegisterSuspendBlocker {
3253 type Response = ::fidl_next::wire::Result<
3254 'static,
3255 crate::wire::ActivityGovernorRegisterSuspendBlockerResponse,
3256 crate::wire::RegisterSuspendBlockerError,
3257 >;
3258 }
3259
3260 impl<___R> ::fidl_next::Respond<___R> for RegisterSuspendBlocker {
3261 type Output = ::core::result::Result<
3262 crate::generic::ActivityGovernorRegisterSuspendBlockerResponse<___R>,
3263 ::fidl_next::never::Never,
3264 >;
3265
3266 fn respond(response: ___R) -> Self::Output {
3267 ::core::result::Result::Ok(
3268 crate::generic::ActivityGovernorRegisterSuspendBlockerResponse { token: response },
3269 )
3270 }
3271 }
3272
3273 impl<___R> ::fidl_next::RespondErr<___R> for RegisterSuspendBlocker {
3274 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
3275
3276 fn respond_err(response: ___R) -> Self::Output {
3277 ::core::result::Result::Err(response)
3278 }
3279 }
3280
3281 mod ___detail {
3282 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::ActivityGovernor
3283 where
3284 ___T: ::fidl_next::Transport,
3285 {
3286 type Client = ActivityGovernorClient<___T>;
3287 type Server = ActivityGovernorServer<___T>;
3288 }
3289
3290 #[repr(transparent)]
3292 pub struct ActivityGovernorClient<___T: ::fidl_next::Transport> {
3293 #[allow(dead_code)]
3294 client: ::fidl_next::protocol::Client<___T>,
3295 }
3296
3297 impl<___T> ActivityGovernorClient<___T>
3298 where
3299 ___T: ::fidl_next::Transport,
3300 {
3301 #[doc = " Gets the power elements owned by the activity governor.\n\n If an error occurs while the server is registering a power element with\n the power broker or an error occurs while creating a token for a power\n element, then the channel to `ActivityGovernor` will be closed by the\n server and no response will be returned.\n"]
3302 pub fn get_power_elements(
3303 &self,
3304 ) -> ::fidl_next::TwoWayFuture<'_, super::GetPowerElements, ___T> {
3305 ::fidl_next::TwoWayFuture::from_untyped(
3306 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
3307 8755001135707412082,
3308 <super::GetPowerElements as ::fidl_next::Method>::FLEXIBILITY,
3309 (),
3310 ),
3311 )
3312 }
3313
3314 #[doc = " Creates a lease that blocks suspension of the hardware platform.\n\n The hardware platform will not suspend as long as a valid\n [`LeaseToken`] exists.\n"]
3315 pub fn acquire_wake_lease(
3316 &self,
3317
3318 name: impl ::fidl_next::Encode<
3319 ::fidl_next::wire::String<'static>,
3320 <___T as ::fidl_next::Transport>::SendBuffer,
3321 >,
3322 ) -> ::fidl_next::TwoWayFuture<'_, super::AcquireWakeLease, ___T>
3323 where
3324 <___T as ::fidl_next::Transport>::SendBuffer:
3325 ::fidl_next::encoder::InternalHandleEncoder,
3326 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3327 {
3328 self.acquire_wake_lease_with(
3329 crate::generic::ActivityGovernorAcquireWakeLeaseRequest { name },
3330 )
3331 }
3332
3333 #[doc = " Creates a lease that blocks suspension of the hardware platform.\n\n The hardware platform will not suspend as long as a valid\n [`LeaseToken`] exists.\n"]
3334 pub fn acquire_wake_lease_with<___R>(
3335 &self,
3336 request: ___R,
3337 ) -> ::fidl_next::TwoWayFuture<'_, super::AcquireWakeLease, ___T>
3338 where
3339 ___R: ::fidl_next::Encode<
3340 crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'static>,
3341 <___T as ::fidl_next::Transport>::SendBuffer,
3342 >,
3343 {
3344 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3345 3306304846648819971,
3346 <super::AcquireWakeLease as ::fidl_next::Method>::FLEXIBILITY,
3347 request,
3348 ))
3349 }
3350
3351 #[doc = " Creates an unmonitored lease that blocks suspension of the hardware platform.\n\n The hardware platform will not suspend as long as a valid\n [`LeaseToken`] exists.\n\n This is intended for leases expected to be held for extended periods.\n Unlike normal wake leases, the server does not monitor the duration\n of an unmonitored wake lease and will not file a crash report if it exceeds\n preconfigured alert thresholds.\n"]
3352 pub fn acquire_unmonitored_wake_lease(
3353 &self,
3354
3355 name: impl ::fidl_next::Encode<
3356 ::fidl_next::wire::String<'static>,
3357 <___T as ::fidl_next::Transport>::SendBuffer,
3358 >,
3359 ) -> ::fidl_next::TwoWayFuture<'_, super::AcquireUnmonitoredWakeLease, ___T>
3360 where
3361 <___T as ::fidl_next::Transport>::SendBuffer:
3362 ::fidl_next::encoder::InternalHandleEncoder,
3363 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3364 {
3365 self.acquire_unmonitored_wake_lease_with(
3366 crate::generic::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest { name },
3367 )
3368 }
3369
3370 #[doc = " Creates an unmonitored lease that blocks suspension of the hardware platform.\n\n The hardware platform will not suspend as long as a valid\n [`LeaseToken`] exists.\n\n This is intended for leases expected to be held for extended periods.\n Unlike normal wake leases, the server does not monitor the duration\n of an unmonitored wake lease and will not file a crash report if it exceeds\n preconfigured alert thresholds.\n"]
3371 pub fn acquire_unmonitored_wake_lease_with<___R>(
3372 &self,
3373 request: ___R,
3374 ) -> ::fidl_next::TwoWayFuture<'_, super::AcquireUnmonitoredWakeLease, ___T>
3375 where
3376 ___R: ::fidl_next::Encode<
3377 crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'static>,
3378 <___T as ::fidl_next::Transport>::SendBuffer,
3379 >,
3380 {
3381 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3382 6877005249659825577,
3383 <super::AcquireUnmonitoredWakeLease as ::fidl_next::Method>::FLEXIBILITY,
3384 request,
3385 ))
3386 }
3387
3388 #[doc = " Creates a lease that blocks suspension of the hardware platform.\n WARNING: Suspension can only be considered blocked after the client\n receives the response to this call. This means, for example, an\n interrupt should only be ack\'ed or a different wake lease dropped only\n **after** getting an error-free response.\n\n The hardware platform will remain resumed until `server_token` observes\n `PEER_CLOSED`, indicating all handles to the client side of the\n `LeaseToken` are closed.\n"]
3389 pub fn acquire_wake_lease_with_token(
3390 &self,
3391
3392 name: impl ::fidl_next::Encode<
3393 ::fidl_next::wire::String<'static>,
3394 <___T as ::fidl_next::Transport>::SendBuffer,
3395 >,
3396
3397 server_token: impl ::fidl_next::Encode<
3398 ::fidl_next::wire::fuchsia::EventPair,
3399 <___T as ::fidl_next::Transport>::SendBuffer,
3400 >,
3401 ) -> ::fidl_next::TwoWayFuture<'_, super::AcquireWakeLeaseWithToken, ___T>
3402 where
3403 <___T as ::fidl_next::Transport>::SendBuffer:
3404 ::fidl_next::encoder::InternalHandleEncoder,
3405 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3406 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
3407 {
3408 self.acquire_wake_lease_with_token_with(
3409 crate::generic::ActivityGovernorAcquireWakeLeaseWithTokenRequest {
3410 name,
3411
3412 server_token,
3413 },
3414 )
3415 }
3416
3417 #[doc = " Creates a lease that blocks suspension of the hardware platform.\n WARNING: Suspension can only be considered blocked after the client\n receives the response to this call. This means, for example, an\n interrupt should only be ack\'ed or a different wake lease dropped only\n **after** getting an error-free response.\n\n The hardware platform will remain resumed until `server_token` observes\n `PEER_CLOSED`, indicating all handles to the client side of the\n `LeaseToken` are closed.\n"]
3418 pub fn acquire_wake_lease_with_token_with<___R>(
3419 &self,
3420 request: ___R,
3421 ) -> ::fidl_next::TwoWayFuture<'_, super::AcquireWakeLeaseWithToken, ___T>
3422 where
3423 ___R: ::fidl_next::Encode<
3424 crate::wire::ActivityGovernorAcquireWakeLeaseWithTokenRequest<'static>,
3425 <___T as ::fidl_next::Transport>::SendBuffer,
3426 >,
3427 {
3428 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3429 2079869883732225873,
3430 <super::AcquireWakeLeaseWithToken as ::fidl_next::Method>::FLEXIBILITY,
3431 request,
3432 ))
3433 }
3434
3435 #[doc = " Creates a lease that blocks suspension of the hardware platform, optionally\n associating it with a predecessor lease (`previous_client_token`).\n\n WARNING: Suspension can only be considered blocked after the client\n receives the response to this call, unless `previous_client_token` is\n provided and actively blocking suspension. When `previous_client_token`\n is provided, SAG retains the `previous_client_token` handle until the new\n wake lease is registered to prevent suspension.\n\n The hardware platform will remain resumed until `server_token` observes\n `PEER_CLOSED`, indicating all handles to the client side of the\n `LeaseToken` are closed.\n"]
3436 pub fn acquire_wake_lease2_with<___R>(
3437 &self,
3438 request: ___R,
3439 ) -> ::fidl_next::TwoWayFuture<'_, super::AcquireWakeLease2, ___T>
3440 where
3441 ___R: ::fidl_next::Encode<
3442 crate::wire::ActivityGovernorAcquireWakeLease2Request<'static>,
3443 <___T as ::fidl_next::Transport>::SendBuffer,
3444 >,
3445 {
3446 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3447 498586365593251363,
3448 <super::AcquireWakeLease2 as ::fidl_next::Method>::FLEXIBILITY,
3449 request,
3450 ))
3451 }
3452
3453 #[doc = " Creates a lease that blocks the system from dropping below the Application\n Activity \'Active\' state. In particular, this blocks suspension of the\n hardware platform.\n\n This method is _not_ safe to call during SuspendBlocker.BeforeSuspend.\n\n If an error occurs while creating a token for the activity lease, then the\n channel to `ActivityGovernor` will be closed by the server and no\n response will be returned.\n"]
3454 pub fn take_application_activity_lease(
3455 &self,
3456
3457 name: impl ::fidl_next::Encode<
3458 ::fidl_next::wire::String<'static>,
3459 <___T as ::fidl_next::Transport>::SendBuffer,
3460 >,
3461 ) -> ::fidl_next::TwoWayFuture<'_, super::TakeApplicationActivityLease, ___T>
3462 where
3463 <___T as ::fidl_next::Transport>::SendBuffer:
3464 ::fidl_next::encoder::InternalHandleEncoder,
3465 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
3466 {
3467 self.take_application_activity_lease_with(
3468 crate::generic::ActivityGovernorTakeApplicationActivityLeaseRequest { name },
3469 )
3470 }
3471
3472 #[doc = " Creates a lease that blocks the system from dropping below the Application\n Activity \'Active\' state. In particular, this blocks suspension of the\n hardware platform.\n\n This method is _not_ safe to call during SuspendBlocker.BeforeSuspend.\n\n If an error occurs while creating a token for the activity lease, then the\n channel to `ActivityGovernor` will be closed by the server and no\n response will be returned.\n"]
3473 pub fn take_application_activity_lease_with<___R>(
3474 &self,
3475 request: ___R,
3476 ) -> ::fidl_next::TwoWayFuture<'_, super::TakeApplicationActivityLease, ___T>
3477 where
3478 ___R: ::fidl_next::Encode<
3479 crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'static>,
3480 <___T as ::fidl_next::Transport>::SendBuffer,
3481 >,
3482 {
3483 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3484 4020961735006149140,
3485 <super::TakeApplicationActivityLease as ::fidl_next::Method>::FLEXIBILITY,
3486 request,
3487 ))
3488 }
3489
3490 #[doc = " Registers a suspend blocker.\n\n On successful registration, a wake lease token is returned. This token\n prevents hardware platform suspension while it exists. Clients are\n expected to perform any initialization of the given `suspend_blocker`\n server while holding this token. Additionally, this means the first call\n `suspend_blocker` will get is `BeforeSuspend`.\n\n To unregister, close the `SuspendBlocker` channel.\n\n If any required field of the table is missing, the error\n [`RegisterSuspendBlockerError.INVALID_ARGS`] is returned.\n\n If an error occurs while registering `suspend_blocker`, it will be\n dropped, closing the channel.\n"]
3491 pub fn register_suspend_blocker_with<___R>(
3492 &self,
3493 request: ___R,
3494 ) -> ::fidl_next::TwoWayFuture<'_, super::RegisterSuspendBlocker, ___T>
3495 where
3496 ___R: ::fidl_next::Encode<
3497 crate::wire::ActivityGovernorRegisterSuspendBlockerRequest<'static>,
3498 <___T as ::fidl_next::Transport>::SendBuffer,
3499 >,
3500 {
3501 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
3502 3814361630267862785,
3503 <super::RegisterSuspendBlocker as ::fidl_next::Method>::FLEXIBILITY,
3504 request,
3505 ))
3506 }
3507 }
3508
3509 #[repr(transparent)]
3511 pub struct ActivityGovernorServer<___T: ::fidl_next::Transport> {
3512 server: ::fidl_next::protocol::Server<___T>,
3513 }
3514
3515 impl<___T> ActivityGovernorServer<___T> where ___T: ::fidl_next::Transport {}
3516 }
3517}
3518
3519#[diagnostic::on_unimplemented(
3520 note = "If {Self} implements the non-local ActivityGovernorClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
3521)]
3522
3523pub trait ActivityGovernorLocalClientHandler<
3527 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3528 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3529>
3530{
3531 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3532 ::core::future::ready(())
3533 }
3534}
3535
3536impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for ActivityGovernor
3537where
3538 ___H: ActivityGovernorLocalClientHandler<___T>,
3539 ___T: ::fidl_next::Transport,
3540{
3541 async fn on_event(
3542 handler: &mut ___H,
3543 mut message: ::fidl_next::Message<___T>,
3544 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3545 match *message.header().ordinal {
3546 ordinal => {
3547 handler.on_unknown_interaction(ordinal).await;
3548 if ::core::matches!(
3549 message.header().flexibility(),
3550 ::fidl_next::protocol::Flexibility::Strict
3551 ) {
3552 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3553 } else {
3554 Ok(())
3555 }
3556 }
3557 }
3558 }
3559}
3560
3561#[diagnostic::on_unimplemented(
3562 note = "If {Self} implements the non-local ActivityGovernorServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
3563)]
3564
3565pub trait ActivityGovernorLocalServerHandler<
3569 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3570 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3571>
3572{
3573 #[doc = " Gets the power elements owned by the activity governor.\n\n If an error occurs while the server is registering a power element with\n the power broker or an error occurs while creating a token for a power\n element, then the channel to `ActivityGovernor` will be closed by the\n server and no response will be returned.\n"]
3574 fn get_power_elements(
3575 &mut self,
3576
3577 responder: ::fidl_next::Responder<activity_governor::GetPowerElements, ___T>,
3578 ) -> impl ::core::future::Future<Output = ()>;
3579
3580 #[doc = " Creates a lease that blocks suspension of the hardware platform.\n\n The hardware platform will not suspend as long as a valid\n [`LeaseToken`] exists.\n"]
3581 fn acquire_wake_lease(
3582 &mut self,
3583
3584 request: ::fidl_next::Request<activity_governor::AcquireWakeLease, ___T>,
3585
3586 responder: ::fidl_next::Responder<activity_governor::AcquireWakeLease, ___T>,
3587 ) -> impl ::core::future::Future<Output = ()>;
3588
3589 #[doc = " Creates an unmonitored lease that blocks suspension of the hardware platform.\n\n The hardware platform will not suspend as long as a valid\n [`LeaseToken`] exists.\n\n This is intended for leases expected to be held for extended periods.\n Unlike normal wake leases, the server does not monitor the duration\n of an unmonitored wake lease and will not file a crash report if it exceeds\n preconfigured alert thresholds.\n"]
3590 fn acquire_unmonitored_wake_lease(
3591 &mut self,
3592
3593 request: ::fidl_next::Request<activity_governor::AcquireUnmonitoredWakeLease, ___T>,
3594
3595 responder: ::fidl_next::Responder<activity_governor::AcquireUnmonitoredWakeLease, ___T>,
3596 ) -> impl ::core::future::Future<Output = ()>;
3597
3598 #[doc = " Creates a lease that blocks suspension of the hardware platform.\n WARNING: Suspension can only be considered blocked after the client\n receives the response to this call. This means, for example, an\n interrupt should only be ack\'ed or a different wake lease dropped only\n **after** getting an error-free response.\n\n The hardware platform will remain resumed until `server_token` observes\n `PEER_CLOSED`, indicating all handles to the client side of the\n `LeaseToken` are closed.\n"]
3599 fn acquire_wake_lease_with_token(
3600 &mut self,
3601
3602 request: ::fidl_next::Request<activity_governor::AcquireWakeLeaseWithToken, ___T>,
3603
3604 responder: ::fidl_next::Responder<activity_governor::AcquireWakeLeaseWithToken, ___T>,
3605 ) -> impl ::core::future::Future<Output = ()>;
3606
3607 #[doc = " Creates a lease that blocks suspension of the hardware platform, optionally\n associating it with a predecessor lease (`previous_client_token`).\n\n WARNING: Suspension can only be considered blocked after the client\n receives the response to this call, unless `previous_client_token` is\n provided and actively blocking suspension. When `previous_client_token`\n is provided, SAG retains the `previous_client_token` handle until the new\n wake lease is registered to prevent suspension.\n\n The hardware platform will remain resumed until `server_token` observes\n `PEER_CLOSED`, indicating all handles to the client side of the\n `LeaseToken` are closed.\n"]
3608 fn acquire_wake_lease2(
3609 &mut self,
3610
3611 request: ::fidl_next::Request<activity_governor::AcquireWakeLease2, ___T>,
3612
3613 responder: ::fidl_next::Responder<activity_governor::AcquireWakeLease2, ___T>,
3614 ) -> impl ::core::future::Future<Output = ()>;
3615
3616 #[doc = " Creates a lease that blocks the system from dropping below the Application\n Activity \'Active\' state. In particular, this blocks suspension of the\n hardware platform.\n\n This method is _not_ safe to call during SuspendBlocker.BeforeSuspend.\n\n If an error occurs while creating a token for the activity lease, then the\n channel to `ActivityGovernor` will be closed by the server and no\n response will be returned.\n"]
3617 fn take_application_activity_lease(
3618 &mut self,
3619
3620 request: ::fidl_next::Request<activity_governor::TakeApplicationActivityLease, ___T>,
3621
3622 responder: ::fidl_next::Responder<activity_governor::TakeApplicationActivityLease, ___T>,
3623 ) -> impl ::core::future::Future<Output = ()>;
3624
3625 #[doc = " Registers a suspend blocker.\n\n On successful registration, a wake lease token is returned. This token\n prevents hardware platform suspension while it exists. Clients are\n expected to perform any initialization of the given `suspend_blocker`\n server while holding this token. Additionally, this means the first call\n `suspend_blocker` will get is `BeforeSuspend`.\n\n To unregister, close the `SuspendBlocker` channel.\n\n If any required field of the table is missing, the error\n [`RegisterSuspendBlockerError.INVALID_ARGS`] is returned.\n\n If an error occurs while registering `suspend_blocker`, it will be\n dropped, closing the channel.\n"]
3626 fn register_suspend_blocker(
3627 &mut self,
3628
3629 request: ::fidl_next::Request<activity_governor::RegisterSuspendBlocker, ___T>,
3630
3631 responder: ::fidl_next::Responder<activity_governor::RegisterSuspendBlocker, ___T>,
3632 ) -> impl ::core::future::Future<Output = ()>;
3633
3634 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
3635 ::core::future::ready(())
3636 }
3637}
3638
3639impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for ActivityGovernor
3640where
3641 ___H: ActivityGovernorLocalServerHandler<___T> ,
3642 ___T: ::fidl_next::Transport,
3643
3644
3645
3646
3647 for<'de> crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'de>: ::fidl_next::Decode<
3648 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3649 Constraint = (),
3650 >,
3651
3652
3653
3654 for<'de> crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'de>: ::fidl_next::Decode<
3655 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3656 Constraint = (),
3657 >,
3658
3659
3660
3661 for<'de> crate::wire::ActivityGovernorAcquireWakeLeaseWithTokenRequest<'de>: ::fidl_next::Decode<
3662 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3663 Constraint = (),
3664 >,
3665
3666
3667
3668 for<'de> crate::wire::ActivityGovernorAcquireWakeLease2Request<'de>: ::fidl_next::Decode<
3669 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3670 Constraint = (),
3671 >,
3672
3673
3674
3675 for<'de> crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'de>: ::fidl_next::Decode<
3676 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3677 Constraint = (),
3678 >,
3679
3680
3681
3682 for<'de> crate::wire::ActivityGovernorRegisterSuspendBlockerRequest<'de>: ::fidl_next::Decode<
3683 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
3684 Constraint = (),
3685 >,
3686
3687
3688{
3689 async fn on_one_way(
3690 handler: &mut ___H,
3691 mut message: ::fidl_next::Message<___T>,
3692 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
3693 match *message.header().ordinal {
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716 ordinal => {
3717
3718 handler.on_unknown_interaction(ordinal).await;
3719 if ::core::matches!(message.header().flexibility(), ::fidl_next::protocol::Flexibility::Strict) {
3720 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3721 } else {
3722 Ok(())
3723 }
3724
3725 }
3726 }
3727 }
3728
3729 async fn on_two_way(
3730 handler: &mut ___H,
3731 mut message: ::fidl_next::Message<___T>,
3732 responder: ::fidl_next::protocol::Responder<___T>,
3733 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
3734 match *message.header().ordinal {
3735
3736
3737
3738 8755001135707412082 => {
3739 let responder = ::fidl_next::Responder::from_untyped(responder);
3740
3741 handler.get_power_elements(responder).await;
3742 Ok(())
3743
3744 }
3745
3746
3747
3748
3749 3306304846648819971 => {
3750 let responder = ::fidl_next::Responder::from_untyped(responder);
3751
3752 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3753 Ok(decoded) => {
3754 handler.acquire_wake_lease(::fidl_next::Request::from_decoded(decoded), responder).await;
3755 Ok(())
3756 }
3757 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3758 ordinal: 3306304846648819971,
3759 error,
3760 }),
3761 }
3762
3763 }
3764
3765
3766
3767
3768 6877005249659825577 => {
3769 let responder = ::fidl_next::Responder::from_untyped(responder);
3770
3771 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3772 Ok(decoded) => {
3773 handler.acquire_unmonitored_wake_lease(::fidl_next::Request::from_decoded(decoded), responder).await;
3774 Ok(())
3775 }
3776 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3777 ordinal: 6877005249659825577,
3778 error,
3779 }),
3780 }
3781
3782 }
3783
3784
3785
3786
3787 2079869883732225873 => {
3788 let responder = ::fidl_next::Responder::from_untyped(responder);
3789
3790 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3791 Ok(decoded) => {
3792 handler.acquire_wake_lease_with_token(::fidl_next::Request::from_decoded(decoded), responder).await;
3793 Ok(())
3794 }
3795 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3796 ordinal: 2079869883732225873,
3797 error,
3798 }),
3799 }
3800
3801 }
3802
3803
3804
3805
3806 498586365593251363 => {
3807 let responder = ::fidl_next::Responder::from_untyped(responder);
3808
3809 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3810 Ok(decoded) => {
3811 handler.acquire_wake_lease2(::fidl_next::Request::from_decoded(decoded), responder).await;
3812 Ok(())
3813 }
3814 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3815 ordinal: 498586365593251363,
3816 error,
3817 }),
3818 }
3819
3820 }
3821
3822
3823
3824
3825 4020961735006149140 => {
3826 let responder = ::fidl_next::Responder::from_untyped(responder);
3827
3828 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3829 Ok(decoded) => {
3830 handler.take_application_activity_lease(::fidl_next::Request::from_decoded(decoded), responder).await;
3831 Ok(())
3832 }
3833 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3834 ordinal: 4020961735006149140,
3835 error,
3836 }),
3837 }
3838
3839 }
3840
3841
3842
3843
3844 3814361630267862785 => {
3845 let responder = ::fidl_next::Responder::from_untyped(responder);
3846
3847 match ::fidl_next::AsDecoderExt::into_decoded(message) {
3848 Ok(decoded) => {
3849 handler.register_suspend_blocker(::fidl_next::Request::from_decoded(decoded), responder).await;
3850 Ok(())
3851 }
3852 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
3853 ordinal: 3814361630267862785,
3854 error,
3855 }),
3856 }
3857
3858 }
3859
3860
3861 ordinal => {
3862
3863 handler.on_unknown_interaction(ordinal).await;
3864 if ::core::matches!(message.header().flexibility(), ::fidl_next::protocol::Flexibility::Strict) {
3865 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3866 } else {
3867 responder.respond_framework_error(
3868 ordinal,
3869 ::fidl_next::FrameworkError::UnknownMethod,
3870 )
3871 .expect("encoding a framework error should never fail")
3872 .await?;
3873 Ok(())
3874 }
3875
3876 }
3877 }
3878 }
3879}
3880
3881pub trait ActivityGovernorClientHandler<
3885 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3886 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3887>
3888{
3889 fn on_unknown_interaction(
3890 &mut self,
3891 ordinal: u64,
3892 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3893 ::core::future::ready(())
3894 }
3895}
3896
3897impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ActivityGovernor
3898where
3899 ___H: ActivityGovernorClientHandler<___T> + ::core::marker::Send,
3900 ___T: ::fidl_next::Transport,
3901{
3902 async fn on_event(
3903 handler: &mut ___H,
3904 mut message: ::fidl_next::Message<___T>,
3905 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3906 match *message.header().ordinal {
3907 ordinal => {
3908 handler.on_unknown_interaction(ordinal).await;
3909 if ::core::matches!(
3910 message.header().flexibility(),
3911 ::fidl_next::protocol::Flexibility::Strict
3912 ) {
3913 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
3914 } else {
3915 Ok(())
3916 }
3917 }
3918 }
3919 }
3920}
3921
3922pub trait ActivityGovernorServerHandler<
3926 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3927 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
3928>
3929{
3930 #[doc = " Gets the power elements owned by the activity governor.\n\n If an error occurs while the server is registering a power element with\n the power broker or an error occurs while creating a token for a power\n element, then the channel to `ActivityGovernor` will be closed by the\n server and no response will be returned.\n"]
3931 fn get_power_elements(
3932 &mut self,
3933
3934 responder: ::fidl_next::Responder<activity_governor::GetPowerElements, ___T>,
3935 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3936
3937 #[doc = " Creates a lease that blocks suspension of the hardware platform.\n\n The hardware platform will not suspend as long as a valid\n [`LeaseToken`] exists.\n"]
3938 fn acquire_wake_lease(
3939 &mut self,
3940
3941 request: ::fidl_next::Request<activity_governor::AcquireWakeLease, ___T>,
3942
3943 responder: ::fidl_next::Responder<activity_governor::AcquireWakeLease, ___T>,
3944 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3945
3946 #[doc = " Creates an unmonitored lease that blocks suspension of the hardware platform.\n\n The hardware platform will not suspend as long as a valid\n [`LeaseToken`] exists.\n\n This is intended for leases expected to be held for extended periods.\n Unlike normal wake leases, the server does not monitor the duration\n of an unmonitored wake lease and will not file a crash report if it exceeds\n preconfigured alert thresholds.\n"]
3947 fn acquire_unmonitored_wake_lease(
3948 &mut self,
3949
3950 request: ::fidl_next::Request<activity_governor::AcquireUnmonitoredWakeLease, ___T>,
3951
3952 responder: ::fidl_next::Responder<activity_governor::AcquireUnmonitoredWakeLease, ___T>,
3953 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3954
3955 #[doc = " Creates a lease that blocks suspension of the hardware platform.\n WARNING: Suspension can only be considered blocked after the client\n receives the response to this call. This means, for example, an\n interrupt should only be ack\'ed or a different wake lease dropped only\n **after** getting an error-free response.\n\n The hardware platform will remain resumed until `server_token` observes\n `PEER_CLOSED`, indicating all handles to the client side of the\n `LeaseToken` are closed.\n"]
3956 fn acquire_wake_lease_with_token(
3957 &mut self,
3958
3959 request: ::fidl_next::Request<activity_governor::AcquireWakeLeaseWithToken, ___T>,
3960
3961 responder: ::fidl_next::Responder<activity_governor::AcquireWakeLeaseWithToken, ___T>,
3962 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3963
3964 #[doc = " Creates a lease that blocks suspension of the hardware platform, optionally\n associating it with a predecessor lease (`previous_client_token`).\n\n WARNING: Suspension can only be considered blocked after the client\n receives the response to this call, unless `previous_client_token` is\n provided and actively blocking suspension. When `previous_client_token`\n is provided, SAG retains the `previous_client_token` handle until the new\n wake lease is registered to prevent suspension.\n\n The hardware platform will remain resumed until `server_token` observes\n `PEER_CLOSED`, indicating all handles to the client side of the\n `LeaseToken` are closed.\n"]
3965 fn acquire_wake_lease2(
3966 &mut self,
3967
3968 request: ::fidl_next::Request<activity_governor::AcquireWakeLease2, ___T>,
3969
3970 responder: ::fidl_next::Responder<activity_governor::AcquireWakeLease2, ___T>,
3971 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3972
3973 #[doc = " Creates a lease that blocks the system from dropping below the Application\n Activity \'Active\' state. In particular, this blocks suspension of the\n hardware platform.\n\n This method is _not_ safe to call during SuspendBlocker.BeforeSuspend.\n\n If an error occurs while creating a token for the activity lease, then the\n channel to `ActivityGovernor` will be closed by the server and no\n response will be returned.\n"]
3974 fn take_application_activity_lease(
3975 &mut self,
3976
3977 request: ::fidl_next::Request<activity_governor::TakeApplicationActivityLease, ___T>,
3978
3979 responder: ::fidl_next::Responder<activity_governor::TakeApplicationActivityLease, ___T>,
3980 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3981
3982 #[doc = " Registers a suspend blocker.\n\n On successful registration, a wake lease token is returned. This token\n prevents hardware platform suspension while it exists. Clients are\n expected to perform any initialization of the given `suspend_blocker`\n server while holding this token. Additionally, this means the first call\n `suspend_blocker` will get is `BeforeSuspend`.\n\n To unregister, close the `SuspendBlocker` channel.\n\n If any required field of the table is missing, the error\n [`RegisterSuspendBlockerError.INVALID_ARGS`] is returned.\n\n If an error occurs while registering `suspend_blocker`, it will be\n dropped, closing the channel.\n"]
3983 fn register_suspend_blocker(
3984 &mut self,
3985
3986 request: ::fidl_next::Request<activity_governor::RegisterSuspendBlocker, ___T>,
3987
3988 responder: ::fidl_next::Responder<activity_governor::RegisterSuspendBlocker, ___T>,
3989 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3990
3991 fn on_unknown_interaction(
3992 &mut self,
3993 ordinal: u64,
3994 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
3995 ::core::future::ready(())
3996 }
3997}
3998
3999impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ActivityGovernor
4000where
4001 ___H: ActivityGovernorServerHandler<___T> + ::core::marker::Send,
4002 ___T: ::fidl_next::Transport,
4003
4004
4005
4006
4007 for<'de> crate::wire::ActivityGovernorAcquireWakeLeaseRequest<'de>: ::fidl_next::Decode<
4008 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4009 Constraint = (),
4010 >,
4011
4012
4013
4014 for<'de> crate::wire::ActivityGovernorAcquireUnmonitoredWakeLeaseRequest<'de>: ::fidl_next::Decode<
4015 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4016 Constraint = (),
4017 >,
4018
4019
4020
4021 for<'de> crate::wire::ActivityGovernorAcquireWakeLeaseWithTokenRequest<'de>: ::fidl_next::Decode<
4022 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4023 Constraint = (),
4024 >,
4025
4026
4027
4028 for<'de> crate::wire::ActivityGovernorAcquireWakeLease2Request<'de>: ::fidl_next::Decode<
4029 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4030 Constraint = (),
4031 >,
4032
4033
4034
4035 for<'de> crate::wire::ActivityGovernorTakeApplicationActivityLeaseRequest<'de>: ::fidl_next::Decode<
4036 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4037 Constraint = (),
4038 >,
4039
4040
4041
4042 for<'de> crate::wire::ActivityGovernorRegisterSuspendBlockerRequest<'de>: ::fidl_next::Decode<
4043 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4044 Constraint = (),
4045 >,
4046
4047
4048{
4049 async fn on_one_way(
4050 handler: &mut ___H,
4051 mut message: ::fidl_next::Message<___T>,
4052 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
4053 match *message.header().ordinal {
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076 ordinal => {
4077
4078 handler.on_unknown_interaction(ordinal).await;
4079 if ::core::matches!(message.header().flexibility(), ::fidl_next::protocol::Flexibility::Strict) {
4080 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4081 } else {
4082 Ok(())
4083 }
4084
4085 }
4086 }
4087 }
4088
4089 async fn on_two_way(
4090 handler: &mut ___H,
4091 mut message: ::fidl_next::Message<___T>,
4092 responder: ::fidl_next::protocol::Responder<___T>,
4093 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
4094 match *message.header().ordinal {
4095
4096
4097
4098 8755001135707412082 => {
4099 let responder = ::fidl_next::Responder::from_untyped(responder);
4100
4101 handler.get_power_elements(responder).await;
4102 Ok(())
4103
4104 }
4105
4106
4107
4108
4109 3306304846648819971 => {
4110 let responder = ::fidl_next::Responder::from_untyped(responder);
4111
4112 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4113 Ok(decoded) => {
4114 handler.acquire_wake_lease(::fidl_next::Request::from_decoded(decoded), responder).await;
4115 Ok(())
4116 }
4117 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4118 ordinal: 3306304846648819971,
4119 error,
4120 }),
4121 }
4122
4123 }
4124
4125
4126
4127
4128 6877005249659825577 => {
4129 let responder = ::fidl_next::Responder::from_untyped(responder);
4130
4131 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4132 Ok(decoded) => {
4133 handler.acquire_unmonitored_wake_lease(::fidl_next::Request::from_decoded(decoded), responder).await;
4134 Ok(())
4135 }
4136 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4137 ordinal: 6877005249659825577,
4138 error,
4139 }),
4140 }
4141
4142 }
4143
4144
4145
4146
4147 2079869883732225873 => {
4148 let responder = ::fidl_next::Responder::from_untyped(responder);
4149
4150 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4151 Ok(decoded) => {
4152 handler.acquire_wake_lease_with_token(::fidl_next::Request::from_decoded(decoded), responder).await;
4153 Ok(())
4154 }
4155 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4156 ordinal: 2079869883732225873,
4157 error,
4158 }),
4159 }
4160
4161 }
4162
4163
4164
4165
4166 498586365593251363 => {
4167 let responder = ::fidl_next::Responder::from_untyped(responder);
4168
4169 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4170 Ok(decoded) => {
4171 handler.acquire_wake_lease2(::fidl_next::Request::from_decoded(decoded), responder).await;
4172 Ok(())
4173 }
4174 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4175 ordinal: 498586365593251363,
4176 error,
4177 }),
4178 }
4179
4180 }
4181
4182
4183
4184
4185 4020961735006149140 => {
4186 let responder = ::fidl_next::Responder::from_untyped(responder);
4187
4188 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4189 Ok(decoded) => {
4190 handler.take_application_activity_lease(::fidl_next::Request::from_decoded(decoded), responder).await;
4191 Ok(())
4192 }
4193 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4194 ordinal: 4020961735006149140,
4195 error,
4196 }),
4197 }
4198
4199 }
4200
4201
4202
4203
4204 3814361630267862785 => {
4205 let responder = ::fidl_next::Responder::from_untyped(responder);
4206
4207 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4208 Ok(decoded) => {
4209 handler.register_suspend_blocker(::fidl_next::Request::from_decoded(decoded), responder).await;
4210 Ok(())
4211 }
4212 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4213 ordinal: 3814361630267862785,
4214 error,
4215 }),
4216 }
4217
4218 }
4219
4220
4221 ordinal => {
4222
4223 handler.on_unknown_interaction(ordinal).await;
4224 if ::core::matches!(message.header().flexibility(), ::fidl_next::protocol::Flexibility::Strict) {
4225 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4226 } else {
4227 responder.respond_framework_error(
4228 ordinal,
4229 ::fidl_next::FrameworkError::UnknownMethod,
4230 )
4231 .expect("encoding a framework error should never fail")
4232 .await?;
4233 Ok(())
4234 }
4235
4236 }
4237 }
4238 }
4239}
4240
4241impl<___T> ActivityGovernorClientHandler<___T> for ::fidl_next::IgnoreEvents
4242where
4243 ___T: ::fidl_next::Transport,
4244{
4245 async fn on_unknown_interaction(&mut self, _: u64) {}
4246}
4247
4248impl<___H, ___T> ActivityGovernorLocalClientHandler<___T> for ::fidl_next::Local<___H>
4249where
4250 ___H: ActivityGovernorClientHandler<___T>,
4251 ___T: ::fidl_next::Transport,
4252{
4253 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4254 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4255 }
4256}
4257
4258impl<___H, ___T> ActivityGovernorLocalServerHandler<___T> for ::fidl_next::Local<___H>
4259where
4260 ___H: ActivityGovernorServerHandler<___T>,
4261 ___T: ::fidl_next::Transport,
4262{
4263 async fn get_power_elements(
4264 &mut self,
4265
4266 responder: ::fidl_next::Responder<activity_governor::GetPowerElements, ___T>,
4267 ) {
4268 ___H::get_power_elements(&mut self.0, responder).await
4269 }
4270
4271 async fn acquire_wake_lease(
4272 &mut self,
4273
4274 request: ::fidl_next::Request<activity_governor::AcquireWakeLease, ___T>,
4275
4276 responder: ::fidl_next::Responder<activity_governor::AcquireWakeLease, ___T>,
4277 ) {
4278 ___H::acquire_wake_lease(&mut self.0, request, responder).await
4279 }
4280
4281 async fn acquire_unmonitored_wake_lease(
4282 &mut self,
4283
4284 request: ::fidl_next::Request<activity_governor::AcquireUnmonitoredWakeLease, ___T>,
4285
4286 responder: ::fidl_next::Responder<activity_governor::AcquireUnmonitoredWakeLease, ___T>,
4287 ) {
4288 ___H::acquire_unmonitored_wake_lease(&mut self.0, request, responder).await
4289 }
4290
4291 async fn acquire_wake_lease_with_token(
4292 &mut self,
4293
4294 request: ::fidl_next::Request<activity_governor::AcquireWakeLeaseWithToken, ___T>,
4295
4296 responder: ::fidl_next::Responder<activity_governor::AcquireWakeLeaseWithToken, ___T>,
4297 ) {
4298 ___H::acquire_wake_lease_with_token(&mut self.0, request, responder).await
4299 }
4300
4301 async fn acquire_wake_lease2(
4302 &mut self,
4303
4304 request: ::fidl_next::Request<activity_governor::AcquireWakeLease2, ___T>,
4305
4306 responder: ::fidl_next::Responder<activity_governor::AcquireWakeLease2, ___T>,
4307 ) {
4308 ___H::acquire_wake_lease2(&mut self.0, request, responder).await
4309 }
4310
4311 async fn take_application_activity_lease(
4312 &mut self,
4313
4314 request: ::fidl_next::Request<activity_governor::TakeApplicationActivityLease, ___T>,
4315
4316 responder: ::fidl_next::Responder<activity_governor::TakeApplicationActivityLease, ___T>,
4317 ) {
4318 ___H::take_application_activity_lease(&mut self.0, request, responder).await
4319 }
4320
4321 async fn register_suspend_blocker(
4322 &mut self,
4323
4324 request: ::fidl_next::Request<activity_governor::RegisterSuspendBlocker, ___T>,
4325
4326 responder: ::fidl_next::Responder<activity_governor::RegisterSuspendBlocker, ___T>,
4327 ) {
4328 ___H::register_suspend_blocker(&mut self.0, request, responder).await
4329 }
4330
4331 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4332 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4333 }
4334}
4335
4336#[doc = " A service that provides access to CPU-related power elements.\n"]
4338#[derive(PartialEq, Debug)]
4339pub struct CpuElementManager;
4340
4341impl ::fidl_next::Discoverable for CpuElementManager {
4342 const PROTOCOL_NAME: &'static str = "fuchsia.power.system.CpuElementManager";
4343}
4344
4345#[cfg(target_os = "fuchsia")]
4346impl ::fidl_next::HasTransport for CpuElementManager {
4347 type Transport = ::fidl_next::fuchsia::zx::Channel;
4348}
4349
4350pub mod cpu_element_manager {
4351 pub mod prelude {
4352 pub use crate::{
4353 CpuElementManager, CpuElementManagerClientHandler, CpuElementManagerLocalClientHandler,
4354 CpuElementManagerLocalServerHandler, CpuElementManagerServerHandler,
4355 cpu_element_manager,
4356 };
4357
4358 pub use crate::natural::AddExecutionStateDependencyError;
4359
4360 pub use crate::natural::Cpu;
4361
4362 pub use crate::natural::CpuElementManagerAddExecutionStateDependencyRequest;
4363
4364 pub use crate::natural::CpuElementManagerAddExecutionStateDependencyResponse;
4365 }
4366
4367 pub struct GetCpuDependencyToken;
4368
4369 impl ::fidl_next::Method for GetCpuDependencyToken {
4370 const ORDINAL: u64 = 3189503319605462202;
4371 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4372 ::fidl_next::protocol::Flexibility::Flexible;
4373
4374 type Protocol = crate::CpuElementManager;
4375
4376 type Request = ::fidl_next::wire::EmptyMessageBody;
4377 }
4378
4379 impl ::fidl_next::TwoWayMethod for GetCpuDependencyToken {
4380 type Response = ::fidl_next::wire::Flexible<'static, crate::wire::Cpu<'static>>;
4381 }
4382
4383 impl<___R> ::fidl_next::Respond<___R> for GetCpuDependencyToken {
4384 type Output = ::fidl_next::Flexible<___R>;
4385
4386 fn respond(response: ___R) -> Self::Output {
4387 ::fidl_next::Flexible(response)
4388 }
4389 }
4390
4391 pub struct AddExecutionStateDependency;
4392
4393 impl ::fidl_next::Method for AddExecutionStateDependency {
4394 const ORDINAL: u64 = 1005136052949049908;
4395 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4396 ::fidl_next::protocol::Flexibility::Flexible;
4397
4398 type Protocol = crate::CpuElementManager;
4399
4400 type Request = crate::wire::CpuElementManagerAddExecutionStateDependencyRequest<'static>;
4401 }
4402
4403 impl ::fidl_next::TwoWayMethod for AddExecutionStateDependency {
4404 type Response = ::fidl_next::wire::Result<
4405 'static,
4406 crate::wire::CpuElementManagerAddExecutionStateDependencyResponse,
4407 crate::wire::AddExecutionStateDependencyError,
4408 >;
4409 }
4410
4411 impl<___R> ::fidl_next::Respond<___R> for AddExecutionStateDependency {
4412 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
4413
4414 fn respond(response: ___R) -> Self::Output {
4415 ::core::result::Result::Ok(response)
4416 }
4417 }
4418
4419 impl<___R> ::fidl_next::RespondErr<___R> for AddExecutionStateDependency {
4420 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
4421
4422 fn respond_err(response: ___R) -> Self::Output {
4423 ::core::result::Result::Err(response)
4424 }
4425 }
4426
4427 mod ___detail {
4428 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::CpuElementManager
4429 where
4430 ___T: ::fidl_next::Transport,
4431 {
4432 type Client = CpuElementManagerClient<___T>;
4433 type Server = CpuElementManagerServer<___T>;
4434 }
4435
4436 #[repr(transparent)]
4438 pub struct CpuElementManagerClient<___T: ::fidl_next::Transport> {
4439 #[allow(dead_code)]
4440 client: ::fidl_next::protocol::Client<___T>,
4441 }
4442
4443 impl<___T> CpuElementManagerClient<___T>
4444 where
4445 ___T: ::fidl_next::Transport,
4446 {
4447 #[doc = " Gets the assertive dependency token for the CPU power element.\n"]
4448 pub fn get_cpu_dependency_token(
4449 &self,
4450 ) -> ::fidl_next::TwoWayFuture<'_, super::GetCpuDependencyToken, ___T> {
4451 ::fidl_next::TwoWayFuture::from_untyped(
4452 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
4453 3189503319605462202,
4454 <super::GetCpuDependencyToken as ::fidl_next::Method>::FLEXIBILITY,
4455 (),
4456 ),
4457 )
4458 }
4459
4460 #[doc = " Adds a dependency from the Execution State power element to the target\n power element identified by [`dependency_token`] at [`power_level`].\n\n Once the Execution State power element is created, future calls will\n return [`fuchsia.power.system/AddExecutionStateDependencyError.BAD_STATE`]\n and no changes to Execution State dependencies will be made.\n\n If any required entries in the request are missing, the server will\n return [`fuchsia.power.system/AddExecutionStateDependencyError.INVALID_ARGS`].\n"]
4461 pub fn add_execution_state_dependency_with<___R>(
4462 &self,
4463 request: ___R,
4464 ) -> ::fidl_next::TwoWayFuture<'_, super::AddExecutionStateDependency, ___T>
4465 where
4466 ___R: ::fidl_next::Encode<
4467 crate::wire::CpuElementManagerAddExecutionStateDependencyRequest<'static>,
4468 <___T as ::fidl_next::Transport>::SendBuffer,
4469 >,
4470 {
4471 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
4472 1005136052949049908,
4473 <super::AddExecutionStateDependency as ::fidl_next::Method>::FLEXIBILITY,
4474 request,
4475 ))
4476 }
4477 }
4478
4479 #[repr(transparent)]
4481 pub struct CpuElementManagerServer<___T: ::fidl_next::Transport> {
4482 server: ::fidl_next::protocol::Server<___T>,
4483 }
4484
4485 impl<___T> CpuElementManagerServer<___T> where ___T: ::fidl_next::Transport {}
4486 }
4487}
4488
4489#[diagnostic::on_unimplemented(
4490 note = "If {Self} implements the non-local CpuElementManagerClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
4491)]
4492
4493pub trait CpuElementManagerLocalClientHandler<
4497 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4498 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4499>
4500{
4501 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
4502 ::core::future::ready(())
4503 }
4504}
4505
4506impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for CpuElementManager
4507where
4508 ___H: CpuElementManagerLocalClientHandler<___T>,
4509 ___T: ::fidl_next::Transport,
4510{
4511 async fn on_event(
4512 handler: &mut ___H,
4513 mut message: ::fidl_next::Message<___T>,
4514 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4515 match *message.header().ordinal {
4516 ordinal => {
4517 handler.on_unknown_interaction(ordinal).await;
4518 if ::core::matches!(
4519 message.header().flexibility(),
4520 ::fidl_next::protocol::Flexibility::Strict
4521 ) {
4522 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4523 } else {
4524 Ok(())
4525 }
4526 }
4527 }
4528 }
4529}
4530
4531#[diagnostic::on_unimplemented(
4532 note = "If {Self} implements the non-local CpuElementManagerServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
4533)]
4534
4535pub trait CpuElementManagerLocalServerHandler<
4539 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4540 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4541>
4542{
4543 #[doc = " Gets the assertive dependency token for the CPU power element.\n"]
4544 fn get_cpu_dependency_token(
4545 &mut self,
4546
4547 responder: ::fidl_next::Responder<cpu_element_manager::GetCpuDependencyToken, ___T>,
4548 ) -> impl ::core::future::Future<Output = ()>;
4549
4550 #[doc = " Adds a dependency from the Execution State power element to the target\n power element identified by [`dependency_token`] at [`power_level`].\n\n Once the Execution State power element is created, future calls will\n return [`fuchsia.power.system/AddExecutionStateDependencyError.BAD_STATE`]\n and no changes to Execution State dependencies will be made.\n\n If any required entries in the request are missing, the server will\n return [`fuchsia.power.system/AddExecutionStateDependencyError.INVALID_ARGS`].\n"]
4551 fn add_execution_state_dependency(
4552 &mut self,
4553
4554 request: ::fidl_next::Request<cpu_element_manager::AddExecutionStateDependency, ___T>,
4555
4556 responder: ::fidl_next::Responder<cpu_element_manager::AddExecutionStateDependency, ___T>,
4557 ) -> impl ::core::future::Future<Output = ()>;
4558
4559 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
4560 ::core::future::ready(())
4561 }
4562}
4563
4564impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for CpuElementManager
4565where
4566 ___H: CpuElementManagerLocalServerHandler<___T> ,
4567 ___T: ::fidl_next::Transport,
4568
4569
4570
4571
4572 for<'de> crate::wire::CpuElementManagerAddExecutionStateDependencyRequest<'de>: ::fidl_next::Decode<
4573 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4574 Constraint = (),
4575 >,
4576
4577
4578{
4579 async fn on_one_way(
4580 handler: &mut ___H,
4581 mut message: ::fidl_next::Message<___T>,
4582 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
4583 match *message.header().ordinal {
4584
4585
4586
4587
4588
4589
4590
4591 ordinal => {
4592
4593 handler.on_unknown_interaction(ordinal).await;
4594 if ::core::matches!(message.header().flexibility(), ::fidl_next::protocol::Flexibility::Strict) {
4595 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4596 } else {
4597 Ok(())
4598 }
4599
4600 }
4601 }
4602 }
4603
4604 async fn on_two_way(
4605 handler: &mut ___H,
4606 mut message: ::fidl_next::Message<___T>,
4607 responder: ::fidl_next::protocol::Responder<___T>,
4608 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
4609 match *message.header().ordinal {
4610
4611
4612
4613 3189503319605462202 => {
4614 let responder = ::fidl_next::Responder::from_untyped(responder);
4615
4616 handler.get_cpu_dependency_token(responder).await;
4617 Ok(())
4618
4619 }
4620
4621
4622
4623
4624 1005136052949049908 => {
4625 let responder = ::fidl_next::Responder::from_untyped(responder);
4626
4627 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4628 Ok(decoded) => {
4629 handler.add_execution_state_dependency(::fidl_next::Request::from_decoded(decoded), responder).await;
4630 Ok(())
4631 }
4632 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4633 ordinal: 1005136052949049908,
4634 error,
4635 }),
4636 }
4637
4638 }
4639
4640
4641 ordinal => {
4642
4643 handler.on_unknown_interaction(ordinal).await;
4644 if ::core::matches!(message.header().flexibility(), ::fidl_next::protocol::Flexibility::Strict) {
4645 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4646 } else {
4647 responder.respond_framework_error(
4648 ordinal,
4649 ::fidl_next::FrameworkError::UnknownMethod,
4650 )
4651 .expect("encoding a framework error should never fail")
4652 .await?;
4653 Ok(())
4654 }
4655
4656 }
4657 }
4658 }
4659}
4660
4661pub trait CpuElementManagerClientHandler<
4665 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4666 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4667>
4668{
4669 fn on_unknown_interaction(
4670 &mut self,
4671 ordinal: u64,
4672 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4673 ::core::future::ready(())
4674 }
4675}
4676
4677impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for CpuElementManager
4678where
4679 ___H: CpuElementManagerClientHandler<___T> + ::core::marker::Send,
4680 ___T: ::fidl_next::Transport,
4681{
4682 async fn on_event(
4683 handler: &mut ___H,
4684 mut message: ::fidl_next::Message<___T>,
4685 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
4686 match *message.header().ordinal {
4687 ordinal => {
4688 handler.on_unknown_interaction(ordinal).await;
4689 if ::core::matches!(
4690 message.header().flexibility(),
4691 ::fidl_next::protocol::Flexibility::Strict
4692 ) {
4693 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4694 } else {
4695 Ok(())
4696 }
4697 }
4698 }
4699 }
4700}
4701
4702pub trait CpuElementManagerServerHandler<
4706 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
4707 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
4708>
4709{
4710 #[doc = " Gets the assertive dependency token for the CPU power element.\n"]
4711 fn get_cpu_dependency_token(
4712 &mut self,
4713
4714 responder: ::fidl_next::Responder<cpu_element_manager::GetCpuDependencyToken, ___T>,
4715 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4716
4717 #[doc = " Adds a dependency from the Execution State power element to the target\n power element identified by [`dependency_token`] at [`power_level`].\n\n Once the Execution State power element is created, future calls will\n return [`fuchsia.power.system/AddExecutionStateDependencyError.BAD_STATE`]\n and no changes to Execution State dependencies will be made.\n\n If any required entries in the request are missing, the server will\n return [`fuchsia.power.system/AddExecutionStateDependencyError.INVALID_ARGS`].\n"]
4718 fn add_execution_state_dependency(
4719 &mut self,
4720
4721 request: ::fidl_next::Request<cpu_element_manager::AddExecutionStateDependency, ___T>,
4722
4723 responder: ::fidl_next::Responder<cpu_element_manager::AddExecutionStateDependency, ___T>,
4724 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
4725
4726 fn on_unknown_interaction(
4727 &mut self,
4728 ordinal: u64,
4729 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
4730 ::core::future::ready(())
4731 }
4732}
4733
4734impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for CpuElementManager
4735where
4736 ___H: CpuElementManagerServerHandler<___T> + ::core::marker::Send,
4737 ___T: ::fidl_next::Transport,
4738
4739
4740
4741
4742 for<'de> crate::wire::CpuElementManagerAddExecutionStateDependencyRequest<'de>: ::fidl_next::Decode<
4743 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
4744 Constraint = (),
4745 >,
4746
4747
4748{
4749 async fn on_one_way(
4750 handler: &mut ___H,
4751 mut message: ::fidl_next::Message<___T>,
4752 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
4753 match *message.header().ordinal {
4754
4755
4756
4757
4758
4759
4760
4761 ordinal => {
4762
4763 handler.on_unknown_interaction(ordinal).await;
4764 if ::core::matches!(message.header().flexibility(), ::fidl_next::protocol::Flexibility::Strict) {
4765 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4766 } else {
4767 Ok(())
4768 }
4769
4770 }
4771 }
4772 }
4773
4774 async fn on_two_way(
4775 handler: &mut ___H,
4776 mut message: ::fidl_next::Message<___T>,
4777 responder: ::fidl_next::protocol::Responder<___T>,
4778 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
4779 match *message.header().ordinal {
4780
4781
4782
4783 3189503319605462202 => {
4784 let responder = ::fidl_next::Responder::from_untyped(responder);
4785
4786 handler.get_cpu_dependency_token(responder).await;
4787 Ok(())
4788
4789 }
4790
4791
4792
4793
4794 1005136052949049908 => {
4795 let responder = ::fidl_next::Responder::from_untyped(responder);
4796
4797 match ::fidl_next::AsDecoderExt::into_decoded(message) {
4798 Ok(decoded) => {
4799 handler.add_execution_state_dependency(::fidl_next::Request::from_decoded(decoded), responder).await;
4800 Ok(())
4801 }
4802 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
4803 ordinal: 1005136052949049908,
4804 error,
4805 }),
4806 }
4807
4808 }
4809
4810
4811 ordinal => {
4812
4813 handler.on_unknown_interaction(ordinal).await;
4814 if ::core::matches!(message.header().flexibility(), ::fidl_next::protocol::Flexibility::Strict) {
4815 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
4816 } else {
4817 responder.respond_framework_error(
4818 ordinal,
4819 ::fidl_next::FrameworkError::UnknownMethod,
4820 )
4821 .expect("encoding a framework error should never fail")
4822 .await?;
4823 Ok(())
4824 }
4825
4826 }
4827 }
4828 }
4829}
4830
4831impl<___T> CpuElementManagerClientHandler<___T> for ::fidl_next::IgnoreEvents
4832where
4833 ___T: ::fidl_next::Transport,
4834{
4835 async fn on_unknown_interaction(&mut self, _: u64) {}
4836}
4837
4838impl<___H, ___T> CpuElementManagerLocalClientHandler<___T> for ::fidl_next::Local<___H>
4839where
4840 ___H: CpuElementManagerClientHandler<___T>,
4841 ___T: ::fidl_next::Transport,
4842{
4843 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4844 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4845 }
4846}
4847
4848impl<___H, ___T> CpuElementManagerLocalServerHandler<___T> for ::fidl_next::Local<___H>
4849where
4850 ___H: CpuElementManagerServerHandler<___T>,
4851 ___T: ::fidl_next::Transport,
4852{
4853 async fn get_cpu_dependency_token(
4854 &mut self,
4855
4856 responder: ::fidl_next::Responder<cpu_element_manager::GetCpuDependencyToken, ___T>,
4857 ) {
4858 ___H::get_cpu_dependency_token(&mut self.0, responder).await
4859 }
4860
4861 async fn add_execution_state_dependency(
4862 &mut self,
4863
4864 request: ::fidl_next::Request<cpu_element_manager::AddExecutionStateDependency, ___T>,
4865
4866 responder: ::fidl_next::Responder<cpu_element_manager::AddExecutionStateDependency, ___T>,
4867 ) {
4868 ___H::add_execution_state_dependency(&mut self.0, request, responder).await
4869 }
4870
4871 async fn on_unknown_interaction(&mut self, ordinal: u64) {
4872 ___H::on_unknown_interaction(&mut self.0, ordinal).await
4873 }
4874}
4875
4876#[doc = " A service for exposing execution state management capabilities.\n"]
4878#[derive(PartialEq, Debug)]
4879pub struct ExecutionStateManager;
4880
4881impl ::fidl_next::Discoverable for ExecutionStateManager {
4882 const PROTOCOL_NAME: &'static str = "fuchsia.power.system.ExecutionStateManager";
4883}
4884
4885#[cfg(target_os = "fuchsia")]
4886impl ::fidl_next::HasTransport for ExecutionStateManager {
4887 type Transport = ::fidl_next::fuchsia::zx::Channel;
4888}
4889
4890pub mod execution_state_manager {
4891 pub mod prelude {
4892 pub use crate::{
4893 ExecutionStateManager, ExecutionStateManagerClientHandler,
4894 ExecutionStateManagerLocalClientHandler, ExecutionStateManagerLocalServerHandler,
4895 ExecutionStateManagerServerHandler, execution_state_manager,
4896 };
4897
4898 pub use crate::natural::AddApplicationActivityDependencyError;
4899
4900 pub use crate::natural::ExecutionState;
4901
4902 pub use crate::natural::ExecutionStateManagerAddApplicationActivityDependencyRequest;
4903
4904 pub use crate::natural::ExecutionStateManagerAddApplicationActivityDependencyResponse;
4905 }
4906
4907 pub struct GetExecutionStateDependencyToken;
4908
4909 impl ::fidl_next::Method for GetExecutionStateDependencyToken {
4910 const ORDINAL: u64 = 8208054324408055568;
4911 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4912 ::fidl_next::protocol::Flexibility::Flexible;
4913
4914 type Protocol = crate::ExecutionStateManager;
4915
4916 type Request = ::fidl_next::wire::EmptyMessageBody;
4917 }
4918
4919 impl ::fidl_next::TwoWayMethod for GetExecutionStateDependencyToken {
4920 type Response = ::fidl_next::wire::Flexible<'static, crate::wire::ExecutionState<'static>>;
4921 }
4922
4923 impl<___R> ::fidl_next::Respond<___R> for GetExecutionStateDependencyToken {
4924 type Output = ::fidl_next::Flexible<___R>;
4925
4926 fn respond(response: ___R) -> Self::Output {
4927 ::fidl_next::Flexible(response)
4928 }
4929 }
4930
4931 pub struct AddApplicationActivityDependency;
4932
4933 impl ::fidl_next::Method for AddApplicationActivityDependency {
4934 const ORDINAL: u64 = 4149397805243818457;
4935 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
4936 ::fidl_next::protocol::Flexibility::Flexible;
4937
4938 type Protocol = crate::ExecutionStateManager;
4939
4940 type Request =
4941 crate::wire::ExecutionStateManagerAddApplicationActivityDependencyRequest<'static>;
4942 }
4943
4944 impl ::fidl_next::TwoWayMethod for AddApplicationActivityDependency {
4945 type Response = ::fidl_next::wire::Result<
4946 'static,
4947 crate::wire::ExecutionStateManagerAddApplicationActivityDependencyResponse,
4948 crate::wire::AddApplicationActivityDependencyError,
4949 >;
4950 }
4951
4952 impl<___R> ::fidl_next::Respond<___R> for AddApplicationActivityDependency {
4953 type Output = ::core::result::Result<___R, ::fidl_next::never::Never>;
4954
4955 fn respond(response: ___R) -> Self::Output {
4956 ::core::result::Result::Ok(response)
4957 }
4958 }
4959
4960 impl<___R> ::fidl_next::RespondErr<___R> for AddApplicationActivityDependency {
4961 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
4962
4963 fn respond_err(response: ___R) -> Self::Output {
4964 ::core::result::Result::Err(response)
4965 }
4966 }
4967
4968 mod ___detail {
4969 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::ExecutionStateManager
4970 where
4971 ___T: ::fidl_next::Transport,
4972 {
4973 type Client = ExecutionStateManagerClient<___T>;
4974 type Server = ExecutionStateManagerServer<___T>;
4975 }
4976
4977 #[repr(transparent)]
4979 pub struct ExecutionStateManagerClient<___T: ::fidl_next::Transport> {
4980 #[allow(dead_code)]
4981 client: ::fidl_next::protocol::Client<___T>,
4982 }
4983
4984 impl<___T> ExecutionStateManagerClient<___T>
4985 where
4986 ___T: ::fidl_next::Transport,
4987 {
4988 #[doc = " Gets the dependency token for the execution state power element. This will block if SAG\n is not fully initialized.\n"]
4989 pub fn get_execution_state_dependency_token(
4990 &self,
4991 ) -> ::fidl_next::TwoWayFuture<'_, super::GetExecutionStateDependencyToken, ___T>
4992 {
4993 ::fidl_next::TwoWayFuture::from_untyped(
4994 self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
4995 8208054324408055568,
4996 <super::GetExecutionStateDependencyToken as ::fidl_next::Method>::FLEXIBILITY,
4997 (),
4998 )
4999 )
5000 }
5001
5002 #[doc = " Adds a dependency from the Application Activity power element to the target\n power element identified by [`dependency_token`] at [`power_level`].\n Be aware of the following client-side conditions:\n - If SAG is not fully initialized, the call blocks until initialization is complete.\n - The call may block as required by `fuchsia.power.broker/ElementControl.AddDependency`,\n which at time of writing may call `fuchsia.power.ElementControl.SetLevel` on the\n associated power element.\n"]
5003 pub fn add_application_activity_dependency_with<___R>(
5004 &self,
5005 request: ___R,
5006 ) -> ::fidl_next::TwoWayFuture<'_, super::AddApplicationActivityDependency, ___T>
5007 where
5008 ___R: ::fidl_next::Encode<
5009 crate::wire::ExecutionStateManagerAddApplicationActivityDependencyRequest<
5010 'static,
5011 >,
5012 <___T as ::fidl_next::Transport>::SendBuffer,
5013 >,
5014 {
5015 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
5016 4149397805243818457,
5017 <super::AddApplicationActivityDependency as ::fidl_next::Method>::FLEXIBILITY,
5018 request,
5019 ))
5020 }
5021 }
5022
5023 #[repr(transparent)]
5025 pub struct ExecutionStateManagerServer<___T: ::fidl_next::Transport> {
5026 server: ::fidl_next::protocol::Server<___T>,
5027 }
5028
5029 impl<___T> ExecutionStateManagerServer<___T> where ___T: ::fidl_next::Transport {}
5030 }
5031}
5032
5033#[diagnostic::on_unimplemented(
5034 note = "If {Self} implements the non-local ExecutionStateManagerClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
5035)]
5036
5037pub trait ExecutionStateManagerLocalClientHandler<
5041 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5042 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
5043>
5044{
5045 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
5046 ::core::future::ready(())
5047 }
5048}
5049
5050impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for ExecutionStateManager
5051where
5052 ___H: ExecutionStateManagerLocalClientHandler<___T>,
5053 ___T: ::fidl_next::Transport,
5054{
5055 async fn on_event(
5056 handler: &mut ___H,
5057 mut message: ::fidl_next::Message<___T>,
5058 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
5059 match *message.header().ordinal {
5060 ordinal => {
5061 handler.on_unknown_interaction(ordinal).await;
5062 if ::core::matches!(
5063 message.header().flexibility(),
5064 ::fidl_next::protocol::Flexibility::Strict
5065 ) {
5066 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
5067 } else {
5068 Ok(())
5069 }
5070 }
5071 }
5072 }
5073}
5074
5075#[diagnostic::on_unimplemented(
5076 note = "If {Self} implements the non-local ExecutionStateManagerServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
5077)]
5078
5079pub trait ExecutionStateManagerLocalServerHandler<
5083 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5084 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
5085>
5086{
5087 #[doc = " Gets the dependency token for the execution state power element. This will block if SAG\n is not fully initialized.\n"]
5088 fn get_execution_state_dependency_token(
5089 &mut self,
5090
5091 responder: ::fidl_next::Responder<
5092 execution_state_manager::GetExecutionStateDependencyToken,
5093 ___T,
5094 >,
5095 ) -> impl ::core::future::Future<Output = ()>;
5096
5097 #[doc = " Adds a dependency from the Application Activity power element to the target\n power element identified by [`dependency_token`] at [`power_level`].\n Be aware of the following client-side conditions:\n - If SAG is not fully initialized, the call blocks until initialization is complete.\n - The call may block as required by `fuchsia.power.broker/ElementControl.AddDependency`,\n which at time of writing may call `fuchsia.power.ElementControl.SetLevel` on the\n associated power element.\n"]
5098 fn add_application_activity_dependency(
5099 &mut self,
5100
5101 request: ::fidl_next::Request<
5102 execution_state_manager::AddApplicationActivityDependency,
5103 ___T,
5104 >,
5105
5106 responder: ::fidl_next::Responder<
5107 execution_state_manager::AddApplicationActivityDependency,
5108 ___T,
5109 >,
5110 ) -> impl ::core::future::Future<Output = ()>;
5111
5112 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
5113 ::core::future::ready(())
5114 }
5115}
5116
5117impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for ExecutionStateManager
5118where
5119 ___H: ExecutionStateManagerLocalServerHandler<___T> ,
5120 ___T: ::fidl_next::Transport,
5121
5122
5123
5124
5125 for<'de> crate::wire::ExecutionStateManagerAddApplicationActivityDependencyRequest<'de>: ::fidl_next::Decode<
5126 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5127 Constraint = (),
5128 >,
5129
5130
5131{
5132 async fn on_one_way(
5133 handler: &mut ___H,
5134 mut message: ::fidl_next::Message<___T>,
5135 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
5136 match *message.header().ordinal {
5137
5138
5139
5140
5141
5142
5143
5144 ordinal => {
5145
5146 handler.on_unknown_interaction(ordinal).await;
5147 if ::core::matches!(message.header().flexibility(), ::fidl_next::protocol::Flexibility::Strict) {
5148 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
5149 } else {
5150 Ok(())
5151 }
5152
5153 }
5154 }
5155 }
5156
5157 async fn on_two_way(
5158 handler: &mut ___H,
5159 mut message: ::fidl_next::Message<___T>,
5160 responder: ::fidl_next::protocol::Responder<___T>,
5161 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
5162 match *message.header().ordinal {
5163
5164
5165
5166 8208054324408055568 => {
5167 let responder = ::fidl_next::Responder::from_untyped(responder);
5168
5169 handler.get_execution_state_dependency_token(responder).await;
5170 Ok(())
5171
5172 }
5173
5174
5175
5176
5177 4149397805243818457 => {
5178 let responder = ::fidl_next::Responder::from_untyped(responder);
5179
5180 match ::fidl_next::AsDecoderExt::into_decoded(message) {
5181 Ok(decoded) => {
5182 handler.add_application_activity_dependency(::fidl_next::Request::from_decoded(decoded), responder).await;
5183 Ok(())
5184 }
5185 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5186 ordinal: 4149397805243818457,
5187 error,
5188 }),
5189 }
5190
5191 }
5192
5193
5194 ordinal => {
5195
5196 handler.on_unknown_interaction(ordinal).await;
5197 if ::core::matches!(message.header().flexibility(), ::fidl_next::protocol::Flexibility::Strict) {
5198 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
5199 } else {
5200 responder.respond_framework_error(
5201 ordinal,
5202 ::fidl_next::FrameworkError::UnknownMethod,
5203 )
5204 .expect("encoding a framework error should never fail")
5205 .await?;
5206 Ok(())
5207 }
5208
5209 }
5210 }
5211 }
5212}
5213
5214pub trait ExecutionStateManagerClientHandler<
5218 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5219 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
5220>
5221{
5222 fn on_unknown_interaction(
5223 &mut self,
5224 ordinal: u64,
5225 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
5226 ::core::future::ready(())
5227 }
5228}
5229
5230impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ExecutionStateManager
5231where
5232 ___H: ExecutionStateManagerClientHandler<___T> + ::core::marker::Send,
5233 ___T: ::fidl_next::Transport,
5234{
5235 async fn on_event(
5236 handler: &mut ___H,
5237 mut message: ::fidl_next::Message<___T>,
5238 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
5239 match *message.header().ordinal {
5240 ordinal => {
5241 handler.on_unknown_interaction(ordinal).await;
5242 if ::core::matches!(
5243 message.header().flexibility(),
5244 ::fidl_next::protocol::Flexibility::Strict
5245 ) {
5246 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
5247 } else {
5248 Ok(())
5249 }
5250 }
5251 }
5252 }
5253}
5254
5255pub trait ExecutionStateManagerServerHandler<
5259 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
5260 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
5261>
5262{
5263 #[doc = " Gets the dependency token for the execution state power element. This will block if SAG\n is not fully initialized.\n"]
5264 fn get_execution_state_dependency_token(
5265 &mut self,
5266
5267 responder: ::fidl_next::Responder<
5268 execution_state_manager::GetExecutionStateDependencyToken,
5269 ___T,
5270 >,
5271 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
5272
5273 #[doc = " Adds a dependency from the Application Activity power element to the target\n power element identified by [`dependency_token`] at [`power_level`].\n Be aware of the following client-side conditions:\n - If SAG is not fully initialized, the call blocks until initialization is complete.\n - The call may block as required by `fuchsia.power.broker/ElementControl.AddDependency`,\n which at time of writing may call `fuchsia.power.ElementControl.SetLevel` on the\n associated power element.\n"]
5274 fn add_application_activity_dependency(
5275 &mut self,
5276
5277 request: ::fidl_next::Request<
5278 execution_state_manager::AddApplicationActivityDependency,
5279 ___T,
5280 >,
5281
5282 responder: ::fidl_next::Responder<
5283 execution_state_manager::AddApplicationActivityDependency,
5284 ___T,
5285 >,
5286 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
5287
5288 fn on_unknown_interaction(
5289 &mut self,
5290 ordinal: u64,
5291 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
5292 ::core::future::ready(())
5293 }
5294}
5295
5296impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ExecutionStateManager
5297where
5298 ___H: ExecutionStateManagerServerHandler<___T> + ::core::marker::Send,
5299 ___T: ::fidl_next::Transport,
5300
5301
5302
5303
5304 for<'de> crate::wire::ExecutionStateManagerAddApplicationActivityDependencyRequest<'de>: ::fidl_next::Decode<
5305 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
5306 Constraint = (),
5307 >,
5308
5309
5310{
5311 async fn on_one_way(
5312 handler: &mut ___H,
5313 mut message: ::fidl_next::Message<___T>,
5314 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
5315 match *message.header().ordinal {
5316
5317
5318
5319
5320
5321
5322
5323 ordinal => {
5324
5325 handler.on_unknown_interaction(ordinal).await;
5326 if ::core::matches!(message.header().flexibility(), ::fidl_next::protocol::Flexibility::Strict) {
5327 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
5328 } else {
5329 Ok(())
5330 }
5331
5332 }
5333 }
5334 }
5335
5336 async fn on_two_way(
5337 handler: &mut ___H,
5338 mut message: ::fidl_next::Message<___T>,
5339 responder: ::fidl_next::protocol::Responder<___T>,
5340 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>> {
5341 match *message.header().ordinal {
5342
5343
5344
5345 8208054324408055568 => {
5346 let responder = ::fidl_next::Responder::from_untyped(responder);
5347
5348 handler.get_execution_state_dependency_token(responder).await;
5349 Ok(())
5350
5351 }
5352
5353
5354
5355
5356 4149397805243818457 => {
5357 let responder = ::fidl_next::Responder::from_untyped(responder);
5358
5359 match ::fidl_next::AsDecoderExt::into_decoded(message) {
5360 Ok(decoded) => {
5361 handler.add_application_activity_dependency(::fidl_next::Request::from_decoded(decoded), responder).await;
5362 Ok(())
5363 }
5364 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
5365 ordinal: 4149397805243818457,
5366 error,
5367 }),
5368 }
5369
5370 }
5371
5372
5373 ordinal => {
5374
5375 handler.on_unknown_interaction(ordinal).await;
5376 if ::core::matches!(message.header().flexibility(), ::fidl_next::protocol::Flexibility::Strict) {
5377 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
5378 } else {
5379 responder.respond_framework_error(
5380 ordinal,
5381 ::fidl_next::FrameworkError::UnknownMethod,
5382 )
5383 .expect("encoding a framework error should never fail")
5384 .await?;
5385 Ok(())
5386 }
5387
5388 }
5389 }
5390 }
5391}
5392
5393impl<___T> ExecutionStateManagerClientHandler<___T> for ::fidl_next::IgnoreEvents
5394where
5395 ___T: ::fidl_next::Transport,
5396{
5397 async fn on_unknown_interaction(&mut self, _: u64) {}
5398}
5399
5400impl<___H, ___T> ExecutionStateManagerLocalClientHandler<___T> for ::fidl_next::Local<___H>
5401where
5402 ___H: ExecutionStateManagerClientHandler<___T>,
5403 ___T: ::fidl_next::Transport,
5404{
5405 async fn on_unknown_interaction(&mut self, ordinal: u64) {
5406 ___H::on_unknown_interaction(&mut self.0, ordinal).await
5407 }
5408}
5409
5410impl<___H, ___T> ExecutionStateManagerLocalServerHandler<___T> for ::fidl_next::Local<___H>
5411where
5412 ___H: ExecutionStateManagerServerHandler<___T>,
5413 ___T: ::fidl_next::Transport,
5414{
5415 async fn get_execution_state_dependency_token(
5416 &mut self,
5417
5418 responder: ::fidl_next::Responder<
5419 execution_state_manager::GetExecutionStateDependencyToken,
5420 ___T,
5421 >,
5422 ) {
5423 ___H::get_execution_state_dependency_token(&mut self.0, responder).await
5424 }
5425
5426 async fn add_application_activity_dependency(
5427 &mut self,
5428
5429 request: ::fidl_next::Request<
5430 execution_state_manager::AddApplicationActivityDependency,
5431 ___T,
5432 >,
5433
5434 responder: ::fidl_next::Responder<
5435 execution_state_manager::AddApplicationActivityDependency,
5436 ___T,
5437 >,
5438 ) {
5439 ___H::add_application_activity_dependency(&mut self.0, request, responder).await
5440 }
5441
5442 async fn on_unknown_interaction(&mut self, ordinal: u64) {
5443 ___H::on_unknown_interaction(&mut self.0, ordinal).await
5444 }
5445}
5446
5447pub use fidl_next_common_fuchsia_power_system::*;