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