1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub type BatteryConfig = [u8; 304];
12
13pub type BatteryProfile = [u8; 596];
14
15pub type BatteryProfileRequest = [u8; 8];
16
17pub type Config = [u8; 104];
18
19pub type EssentialParams = [u8; 48];
20
21pub type ProcessedFifoData = [u8; 152];
22
23pub type StepAndJeitaParams = [u8; 247];
24
25pub const BATTERY_CONFIG_LENGTH: u64 = 304;
27
28pub const BATTERY_PROFILE_LENGTH: u64 = 596;
29
30pub const BATTERY_PROFILE_REQUEST_LENGTH: u64 = 8;
32
33pub const CONFIG_LENGTH: u64 = 104;
35
36pub const ESSENTIAL_PARAMS_LENGTH: u64 = 48;
38
39pub const FIFO_DATA_MAX_LENGTH: u64 = 1748;
41
42pub const PROCESSED_FIFO_DATA_LENGTH: u64 = 152;
44
45pub const STEP_AND_JEITA_PARAMS_LENGTH: u64 = 247;
47
48#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
49#[repr(C)]
50pub struct DeviceGetBatteryConfigResponse {
51 pub config: [u8; 304],
52}
53
54impl fidl::Persistable for DeviceGetBatteryConfigResponse {}
55
56#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
57#[repr(C)]
58pub struct DeviceGetBatteryProfileRequest {
59 pub request: [u8; 8],
60}
61
62impl fidl::Persistable for DeviceGetBatteryProfileRequest {}
63
64#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
65#[repr(C)]
66pub struct DeviceGetConfigResponse {
67 pub config: [u8; 104],
68}
69
70impl fidl::Persistable for DeviceGetConfigResponse {}
71
72#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
73pub struct DeviceGetIioValueRequest {
74 pub label: String,
75}
76
77impl fidl::Persistable for DeviceGetIioValueRequest {}
78
79#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
80#[repr(C)]
81pub struct DeviceGetStepAndJeitaParamsResponse {
82 pub params: [u8; 247],
83}
84
85impl fidl::Persistable for DeviceGetStepAndJeitaParamsResponse {}
86
87#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
88pub struct DeviceOnFifoDataRequest {
89 pub data: Vec<u8>,
90}
91
92impl fidl::Persistable for DeviceOnFifoDataRequest {}
93
94#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
95#[repr(C)]
96pub struct DeviceSetEssentialParamsRequest {
97 pub params: [u8; 48],
98}
99
100impl fidl::Persistable for DeviceSetEssentialParamsRequest {}
101
102#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
103#[repr(C)]
104pub struct DeviceSetProcessedFifoDataRequest {
105 pub data: [u8; 152],
106}
107
108impl fidl::Persistable for DeviceSetProcessedFifoDataRequest {}
109
110#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
111#[repr(C)]
112pub struct DeviceGetBatteryProfileResponse {
113 pub profile: [u8; 596],
114}
115
116impl fidl::Persistable for DeviceGetBatteryProfileResponse {}
117
118#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
119#[repr(C)]
120pub struct DeviceGetEssentialParamsResponse {
121 pub params: [u8; 48],
122}
123
124impl fidl::Persistable for DeviceGetEssentialParamsResponse {}
125
126#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
127#[repr(C)]
128pub struct DeviceGetIioValueResponse {
129 pub value: i32,
130}
131
132impl fidl::Persistable for DeviceGetIioValueResponse {}
133
134pub mod device_ordinals {
135 pub const GET_ESSENTIAL_PARAMS: u64 = 0x2093fd296e2d8996;
136 pub const SET_ESSENTIAL_PARAMS: u64 = 0x55b14f267312168c;
137 pub const GET_CONFIG: u64 = 0x41a72f916b11e11f;
138 pub const ON_FIFO_DATA: u64 = 0x79aa05363cb0b4c7;
139 pub const SET_PROCESSED_FIFO_DATA: u64 = 0x4689e121bf9e884;
140 pub const GET_STEP_AND_JEITA_PARAMS: u64 = 0x1c7ba411ae13b250;
141 pub const GET_BATTERY_CONFIG: u64 = 0x1790c60bf5e3dd40;
142 pub const GET_BATTERY_PROFILE: u64 = 0x35f1cb1630c6079f;
143 pub const GET_IIO_VALUE: u64 = 0x7e59fae7f9193277;
144}
145
146mod internal {
147 use super::*;
148
149 impl fidl::encoding::ValueTypeMarker for DeviceGetBatteryConfigResponse {
150 type Borrowed<'a> = &'a Self;
151 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
152 value
153 }
154 }
155
156 unsafe impl fidl::encoding::TypeMarker for DeviceGetBatteryConfigResponse {
157 type Owned = Self;
158
159 #[inline(always)]
160 fn inline_align(_context: fidl::encoding::Context) -> usize {
161 1
162 }
163
164 #[inline(always)]
165 fn inline_size(_context: fidl::encoding::Context) -> usize {
166 304
167 }
168 #[inline(always)]
169 fn encode_is_copy() -> bool {
170 true
171 }
172
173 #[inline(always)]
174 fn decode_is_copy() -> bool {
175 true
176 }
177 }
178
179 unsafe impl<D: fidl::encoding::ResourceDialect>
180 fidl::encoding::Encode<DeviceGetBatteryConfigResponse, D>
181 for &DeviceGetBatteryConfigResponse
182 {
183 #[inline]
184 unsafe fn encode(
185 self,
186 encoder: &mut fidl::encoding::Encoder<'_, D>,
187 offset: usize,
188 _depth: fidl::encoding::Depth,
189 ) -> fidl::Result<()> {
190 encoder.debug_check_bounds::<DeviceGetBatteryConfigResponse>(offset);
191 unsafe {
192 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
194 (buf_ptr as *mut DeviceGetBatteryConfigResponse)
195 .write_unaligned((self as *const DeviceGetBatteryConfigResponse).read());
196 }
199 Ok(())
200 }
201 }
202 unsafe impl<
203 D: fidl::encoding::ResourceDialect,
204 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 304>, D>,
205 > fidl::encoding::Encode<DeviceGetBatteryConfigResponse, D> for (T0,)
206 {
207 #[inline]
208 unsafe fn encode(
209 self,
210 encoder: &mut fidl::encoding::Encoder<'_, D>,
211 offset: usize,
212 depth: fidl::encoding::Depth,
213 ) -> fidl::Result<()> {
214 encoder.debug_check_bounds::<DeviceGetBatteryConfigResponse>(offset);
215 self.0.encode(encoder, offset + 0, depth)?;
219 Ok(())
220 }
221 }
222
223 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
224 for DeviceGetBatteryConfigResponse
225 {
226 #[inline(always)]
227 fn new_empty() -> Self {
228 Self { config: fidl::new_empty!(fidl::encoding::Array<u8, 304>, D) }
229 }
230
231 #[inline]
232 unsafe fn decode(
233 &mut self,
234 decoder: &mut fidl::encoding::Decoder<'_, D>,
235 offset: usize,
236 _depth: fidl::encoding::Depth,
237 ) -> fidl::Result<()> {
238 decoder.debug_check_bounds::<Self>(offset);
239 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
240 unsafe {
243 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 304);
244 }
245 Ok(())
246 }
247 }
248
249 impl fidl::encoding::ValueTypeMarker for DeviceGetBatteryProfileRequest {
250 type Borrowed<'a> = &'a Self;
251 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
252 value
253 }
254 }
255
256 unsafe impl fidl::encoding::TypeMarker for DeviceGetBatteryProfileRequest {
257 type Owned = Self;
258
259 #[inline(always)]
260 fn inline_align(_context: fidl::encoding::Context) -> usize {
261 1
262 }
263
264 #[inline(always)]
265 fn inline_size(_context: fidl::encoding::Context) -> usize {
266 8
267 }
268 #[inline(always)]
269 fn encode_is_copy() -> bool {
270 true
271 }
272
273 #[inline(always)]
274 fn decode_is_copy() -> bool {
275 true
276 }
277 }
278
279 unsafe impl<D: fidl::encoding::ResourceDialect>
280 fidl::encoding::Encode<DeviceGetBatteryProfileRequest, D>
281 for &DeviceGetBatteryProfileRequest
282 {
283 #[inline]
284 unsafe fn encode(
285 self,
286 encoder: &mut fidl::encoding::Encoder<'_, D>,
287 offset: usize,
288 _depth: fidl::encoding::Depth,
289 ) -> fidl::Result<()> {
290 encoder.debug_check_bounds::<DeviceGetBatteryProfileRequest>(offset);
291 unsafe {
292 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
294 (buf_ptr as *mut DeviceGetBatteryProfileRequest)
295 .write_unaligned((self as *const DeviceGetBatteryProfileRequest).read());
296 }
299 Ok(())
300 }
301 }
302 unsafe impl<
303 D: fidl::encoding::ResourceDialect,
304 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 8>, D>,
305 > fidl::encoding::Encode<DeviceGetBatteryProfileRequest, D> for (T0,)
306 {
307 #[inline]
308 unsafe fn encode(
309 self,
310 encoder: &mut fidl::encoding::Encoder<'_, D>,
311 offset: usize,
312 depth: fidl::encoding::Depth,
313 ) -> fidl::Result<()> {
314 encoder.debug_check_bounds::<DeviceGetBatteryProfileRequest>(offset);
315 self.0.encode(encoder, offset + 0, depth)?;
319 Ok(())
320 }
321 }
322
323 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
324 for DeviceGetBatteryProfileRequest
325 {
326 #[inline(always)]
327 fn new_empty() -> Self {
328 Self { request: fidl::new_empty!(fidl::encoding::Array<u8, 8>, D) }
329 }
330
331 #[inline]
332 unsafe fn decode(
333 &mut self,
334 decoder: &mut fidl::encoding::Decoder<'_, D>,
335 offset: usize,
336 _depth: fidl::encoding::Depth,
337 ) -> fidl::Result<()> {
338 decoder.debug_check_bounds::<Self>(offset);
339 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
340 unsafe {
343 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
344 }
345 Ok(())
346 }
347 }
348
349 impl fidl::encoding::ValueTypeMarker for DeviceGetConfigResponse {
350 type Borrowed<'a> = &'a Self;
351 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
352 value
353 }
354 }
355
356 unsafe impl fidl::encoding::TypeMarker for DeviceGetConfigResponse {
357 type Owned = Self;
358
359 #[inline(always)]
360 fn inline_align(_context: fidl::encoding::Context) -> usize {
361 1
362 }
363
364 #[inline(always)]
365 fn inline_size(_context: fidl::encoding::Context) -> usize {
366 104
367 }
368 #[inline(always)]
369 fn encode_is_copy() -> bool {
370 true
371 }
372
373 #[inline(always)]
374 fn decode_is_copy() -> bool {
375 true
376 }
377 }
378
379 unsafe impl<D: fidl::encoding::ResourceDialect>
380 fidl::encoding::Encode<DeviceGetConfigResponse, D> for &DeviceGetConfigResponse
381 {
382 #[inline]
383 unsafe fn encode(
384 self,
385 encoder: &mut fidl::encoding::Encoder<'_, D>,
386 offset: usize,
387 _depth: fidl::encoding::Depth,
388 ) -> fidl::Result<()> {
389 encoder.debug_check_bounds::<DeviceGetConfigResponse>(offset);
390 unsafe {
391 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
393 (buf_ptr as *mut DeviceGetConfigResponse)
394 .write_unaligned((self as *const DeviceGetConfigResponse).read());
395 }
398 Ok(())
399 }
400 }
401 unsafe impl<
402 D: fidl::encoding::ResourceDialect,
403 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 104>, D>,
404 > fidl::encoding::Encode<DeviceGetConfigResponse, D> for (T0,)
405 {
406 #[inline]
407 unsafe fn encode(
408 self,
409 encoder: &mut fidl::encoding::Encoder<'_, D>,
410 offset: usize,
411 depth: fidl::encoding::Depth,
412 ) -> fidl::Result<()> {
413 encoder.debug_check_bounds::<DeviceGetConfigResponse>(offset);
414 self.0.encode(encoder, offset + 0, depth)?;
418 Ok(())
419 }
420 }
421
422 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
423 for DeviceGetConfigResponse
424 {
425 #[inline(always)]
426 fn new_empty() -> Self {
427 Self { config: fidl::new_empty!(fidl::encoding::Array<u8, 104>, D) }
428 }
429
430 #[inline]
431 unsafe fn decode(
432 &mut self,
433 decoder: &mut fidl::encoding::Decoder<'_, D>,
434 offset: usize,
435 _depth: fidl::encoding::Depth,
436 ) -> fidl::Result<()> {
437 decoder.debug_check_bounds::<Self>(offset);
438 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
439 unsafe {
442 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 104);
443 }
444 Ok(())
445 }
446 }
447
448 impl fidl::encoding::ValueTypeMarker for DeviceGetIioValueRequest {
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 DeviceGetIioValueRequest {
456 type Owned = Self;
457
458 #[inline(always)]
459 fn inline_align(_context: fidl::encoding::Context) -> usize {
460 8
461 }
462
463 #[inline(always)]
464 fn inline_size(_context: fidl::encoding::Context) -> usize {
465 16
466 }
467 }
468
469 unsafe impl<D: fidl::encoding::ResourceDialect>
470 fidl::encoding::Encode<DeviceGetIioValueRequest, D> for &DeviceGetIioValueRequest
471 {
472 #[inline]
473 unsafe fn encode(
474 self,
475 encoder: &mut fidl::encoding::Encoder<'_, D>,
476 offset: usize,
477 _depth: fidl::encoding::Depth,
478 ) -> fidl::Result<()> {
479 encoder.debug_check_bounds::<DeviceGetIioValueRequest>(offset);
480 fidl::encoding::Encode::<DeviceGetIioValueRequest, D>::encode(
482 (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
483 &self.label,
484 ),),
485 encoder,
486 offset,
487 _depth,
488 )
489 }
490 }
491 unsafe impl<
492 D: fidl::encoding::ResourceDialect,
493 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
494 > fidl::encoding::Encode<DeviceGetIioValueRequest, D> for (T0,)
495 {
496 #[inline]
497 unsafe fn encode(
498 self,
499 encoder: &mut fidl::encoding::Encoder<'_, D>,
500 offset: usize,
501 depth: fidl::encoding::Depth,
502 ) -> fidl::Result<()> {
503 encoder.debug_check_bounds::<DeviceGetIioValueRequest>(offset);
504 self.0.encode(encoder, offset + 0, depth)?;
508 Ok(())
509 }
510 }
511
512 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
513 for DeviceGetIioValueRequest
514 {
515 #[inline(always)]
516 fn new_empty() -> Self {
517 Self { label: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
518 }
519
520 #[inline]
521 unsafe fn decode(
522 &mut self,
523 decoder: &mut fidl::encoding::Decoder<'_, D>,
524 offset: usize,
525 _depth: fidl::encoding::Depth,
526 ) -> fidl::Result<()> {
527 decoder.debug_check_bounds::<Self>(offset);
528 fidl::decode!(
530 fidl::encoding::UnboundedString,
531 D,
532 &mut self.label,
533 decoder,
534 offset + 0,
535 _depth
536 )?;
537 Ok(())
538 }
539 }
540
541 impl fidl::encoding::ValueTypeMarker for DeviceGetStepAndJeitaParamsResponse {
542 type Borrowed<'a> = &'a Self;
543 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
544 value
545 }
546 }
547
548 unsafe impl fidl::encoding::TypeMarker for DeviceGetStepAndJeitaParamsResponse {
549 type Owned = Self;
550
551 #[inline(always)]
552 fn inline_align(_context: fidl::encoding::Context) -> usize {
553 1
554 }
555
556 #[inline(always)]
557 fn inline_size(_context: fidl::encoding::Context) -> usize {
558 247
559 }
560 #[inline(always)]
561 fn encode_is_copy() -> bool {
562 true
563 }
564
565 #[inline(always)]
566 fn decode_is_copy() -> bool {
567 true
568 }
569 }
570
571 unsafe impl<D: fidl::encoding::ResourceDialect>
572 fidl::encoding::Encode<DeviceGetStepAndJeitaParamsResponse, D>
573 for &DeviceGetStepAndJeitaParamsResponse
574 {
575 #[inline]
576 unsafe fn encode(
577 self,
578 encoder: &mut fidl::encoding::Encoder<'_, D>,
579 offset: usize,
580 _depth: fidl::encoding::Depth,
581 ) -> fidl::Result<()> {
582 encoder.debug_check_bounds::<DeviceGetStepAndJeitaParamsResponse>(offset);
583 unsafe {
584 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
586 (buf_ptr as *mut DeviceGetStepAndJeitaParamsResponse)
587 .write_unaligned((self as *const DeviceGetStepAndJeitaParamsResponse).read());
588 }
591 Ok(())
592 }
593 }
594 unsafe impl<
595 D: fidl::encoding::ResourceDialect,
596 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 247>, D>,
597 > fidl::encoding::Encode<DeviceGetStepAndJeitaParamsResponse, D> for (T0,)
598 {
599 #[inline]
600 unsafe fn encode(
601 self,
602 encoder: &mut fidl::encoding::Encoder<'_, D>,
603 offset: usize,
604 depth: fidl::encoding::Depth,
605 ) -> fidl::Result<()> {
606 encoder.debug_check_bounds::<DeviceGetStepAndJeitaParamsResponse>(offset);
607 self.0.encode(encoder, offset + 0, depth)?;
611 Ok(())
612 }
613 }
614
615 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
616 for DeviceGetStepAndJeitaParamsResponse
617 {
618 #[inline(always)]
619 fn new_empty() -> Self {
620 Self { params: fidl::new_empty!(fidl::encoding::Array<u8, 247>, D) }
621 }
622
623 #[inline]
624 unsafe fn decode(
625 &mut self,
626 decoder: &mut fidl::encoding::Decoder<'_, D>,
627 offset: usize,
628 _depth: fidl::encoding::Depth,
629 ) -> fidl::Result<()> {
630 decoder.debug_check_bounds::<Self>(offset);
631 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
632 unsafe {
635 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 247);
636 }
637 Ok(())
638 }
639 }
640
641 impl fidl::encoding::ValueTypeMarker for DeviceOnFifoDataRequest {
642 type Borrowed<'a> = &'a Self;
643 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
644 value
645 }
646 }
647
648 unsafe impl fidl::encoding::TypeMarker for DeviceOnFifoDataRequest {
649 type Owned = Self;
650
651 #[inline(always)]
652 fn inline_align(_context: fidl::encoding::Context) -> usize {
653 8
654 }
655
656 #[inline(always)]
657 fn inline_size(_context: fidl::encoding::Context) -> usize {
658 16
659 }
660 }
661
662 unsafe impl<D: fidl::encoding::ResourceDialect>
663 fidl::encoding::Encode<DeviceOnFifoDataRequest, D> for &DeviceOnFifoDataRequest
664 {
665 #[inline]
666 unsafe fn encode(
667 self,
668 encoder: &mut fidl::encoding::Encoder<'_, D>,
669 offset: usize,
670 _depth: fidl::encoding::Depth,
671 ) -> fidl::Result<()> {
672 encoder.debug_check_bounds::<DeviceOnFifoDataRequest>(offset);
673 fidl::encoding::Encode::<DeviceOnFifoDataRequest, D>::encode(
675 (<fidl::encoding::Vector<u8, 1748> as fidl::encoding::ValueTypeMarker>::borrow(
676 &self.data,
677 ),),
678 encoder,
679 offset,
680 _depth,
681 )
682 }
683 }
684 unsafe impl<
685 D: fidl::encoding::ResourceDialect,
686 T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 1748>, D>,
687 > fidl::encoding::Encode<DeviceOnFifoDataRequest, D> for (T0,)
688 {
689 #[inline]
690 unsafe fn encode(
691 self,
692 encoder: &mut fidl::encoding::Encoder<'_, D>,
693 offset: usize,
694 depth: fidl::encoding::Depth,
695 ) -> fidl::Result<()> {
696 encoder.debug_check_bounds::<DeviceOnFifoDataRequest>(offset);
697 self.0.encode(encoder, offset + 0, depth)?;
701 Ok(())
702 }
703 }
704
705 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
706 for DeviceOnFifoDataRequest
707 {
708 #[inline(always)]
709 fn new_empty() -> Self {
710 Self { data: fidl::new_empty!(fidl::encoding::Vector<u8, 1748>, D) }
711 }
712
713 #[inline]
714 unsafe fn decode(
715 &mut self,
716 decoder: &mut fidl::encoding::Decoder<'_, D>,
717 offset: usize,
718 _depth: fidl::encoding::Depth,
719 ) -> fidl::Result<()> {
720 decoder.debug_check_bounds::<Self>(offset);
721 fidl::decode!(fidl::encoding::Vector<u8, 1748>, D, &mut self.data, decoder, offset + 0, _depth)?;
723 Ok(())
724 }
725 }
726
727 impl fidl::encoding::ValueTypeMarker for DeviceSetEssentialParamsRequest {
728 type Borrowed<'a> = &'a Self;
729 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
730 value
731 }
732 }
733
734 unsafe impl fidl::encoding::TypeMarker for DeviceSetEssentialParamsRequest {
735 type Owned = Self;
736
737 #[inline(always)]
738 fn inline_align(_context: fidl::encoding::Context) -> usize {
739 1
740 }
741
742 #[inline(always)]
743 fn inline_size(_context: fidl::encoding::Context) -> usize {
744 48
745 }
746 #[inline(always)]
747 fn encode_is_copy() -> bool {
748 true
749 }
750
751 #[inline(always)]
752 fn decode_is_copy() -> bool {
753 true
754 }
755 }
756
757 unsafe impl<D: fidl::encoding::ResourceDialect>
758 fidl::encoding::Encode<DeviceSetEssentialParamsRequest, D>
759 for &DeviceSetEssentialParamsRequest
760 {
761 #[inline]
762 unsafe fn encode(
763 self,
764 encoder: &mut fidl::encoding::Encoder<'_, D>,
765 offset: usize,
766 _depth: fidl::encoding::Depth,
767 ) -> fidl::Result<()> {
768 encoder.debug_check_bounds::<DeviceSetEssentialParamsRequest>(offset);
769 unsafe {
770 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
772 (buf_ptr as *mut DeviceSetEssentialParamsRequest)
773 .write_unaligned((self as *const DeviceSetEssentialParamsRequest).read());
774 }
777 Ok(())
778 }
779 }
780 unsafe impl<
781 D: fidl::encoding::ResourceDialect,
782 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 48>, D>,
783 > fidl::encoding::Encode<DeviceSetEssentialParamsRequest, D> for (T0,)
784 {
785 #[inline]
786 unsafe fn encode(
787 self,
788 encoder: &mut fidl::encoding::Encoder<'_, D>,
789 offset: usize,
790 depth: fidl::encoding::Depth,
791 ) -> fidl::Result<()> {
792 encoder.debug_check_bounds::<DeviceSetEssentialParamsRequest>(offset);
793 self.0.encode(encoder, offset + 0, depth)?;
797 Ok(())
798 }
799 }
800
801 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
802 for DeviceSetEssentialParamsRequest
803 {
804 #[inline(always)]
805 fn new_empty() -> Self {
806 Self { params: fidl::new_empty!(fidl::encoding::Array<u8, 48>, D) }
807 }
808
809 #[inline]
810 unsafe fn decode(
811 &mut self,
812 decoder: &mut fidl::encoding::Decoder<'_, D>,
813 offset: usize,
814 _depth: fidl::encoding::Depth,
815 ) -> fidl::Result<()> {
816 decoder.debug_check_bounds::<Self>(offset);
817 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
818 unsafe {
821 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 48);
822 }
823 Ok(())
824 }
825 }
826
827 impl fidl::encoding::ValueTypeMarker for DeviceSetProcessedFifoDataRequest {
828 type Borrowed<'a> = &'a Self;
829 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
830 value
831 }
832 }
833
834 unsafe impl fidl::encoding::TypeMarker for DeviceSetProcessedFifoDataRequest {
835 type Owned = Self;
836
837 #[inline(always)]
838 fn inline_align(_context: fidl::encoding::Context) -> usize {
839 1
840 }
841
842 #[inline(always)]
843 fn inline_size(_context: fidl::encoding::Context) -> usize {
844 152
845 }
846 #[inline(always)]
847 fn encode_is_copy() -> bool {
848 true
849 }
850
851 #[inline(always)]
852 fn decode_is_copy() -> bool {
853 true
854 }
855 }
856
857 unsafe impl<D: fidl::encoding::ResourceDialect>
858 fidl::encoding::Encode<DeviceSetProcessedFifoDataRequest, D>
859 for &DeviceSetProcessedFifoDataRequest
860 {
861 #[inline]
862 unsafe fn encode(
863 self,
864 encoder: &mut fidl::encoding::Encoder<'_, D>,
865 offset: usize,
866 _depth: fidl::encoding::Depth,
867 ) -> fidl::Result<()> {
868 encoder.debug_check_bounds::<DeviceSetProcessedFifoDataRequest>(offset);
869 unsafe {
870 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
872 (buf_ptr as *mut DeviceSetProcessedFifoDataRequest)
873 .write_unaligned((self as *const DeviceSetProcessedFifoDataRequest).read());
874 }
877 Ok(())
878 }
879 }
880 unsafe impl<
881 D: fidl::encoding::ResourceDialect,
882 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 152>, D>,
883 > fidl::encoding::Encode<DeviceSetProcessedFifoDataRequest, D> for (T0,)
884 {
885 #[inline]
886 unsafe fn encode(
887 self,
888 encoder: &mut fidl::encoding::Encoder<'_, D>,
889 offset: usize,
890 depth: fidl::encoding::Depth,
891 ) -> fidl::Result<()> {
892 encoder.debug_check_bounds::<DeviceSetProcessedFifoDataRequest>(offset);
893 self.0.encode(encoder, offset + 0, depth)?;
897 Ok(())
898 }
899 }
900
901 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
902 for DeviceSetProcessedFifoDataRequest
903 {
904 #[inline(always)]
905 fn new_empty() -> Self {
906 Self { data: fidl::new_empty!(fidl::encoding::Array<u8, 152>, D) }
907 }
908
909 #[inline]
910 unsafe fn decode(
911 &mut self,
912 decoder: &mut fidl::encoding::Decoder<'_, D>,
913 offset: usize,
914 _depth: fidl::encoding::Depth,
915 ) -> fidl::Result<()> {
916 decoder.debug_check_bounds::<Self>(offset);
917 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
918 unsafe {
921 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 152);
922 }
923 Ok(())
924 }
925 }
926
927 impl fidl::encoding::ValueTypeMarker for DeviceGetBatteryProfileResponse {
928 type Borrowed<'a> = &'a Self;
929 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
930 value
931 }
932 }
933
934 unsafe impl fidl::encoding::TypeMarker for DeviceGetBatteryProfileResponse {
935 type Owned = Self;
936
937 #[inline(always)]
938 fn inline_align(_context: fidl::encoding::Context) -> usize {
939 1
940 }
941
942 #[inline(always)]
943 fn inline_size(_context: fidl::encoding::Context) -> usize {
944 596
945 }
946 #[inline(always)]
947 fn encode_is_copy() -> bool {
948 true
949 }
950
951 #[inline(always)]
952 fn decode_is_copy() -> bool {
953 true
954 }
955 }
956
957 unsafe impl<D: fidl::encoding::ResourceDialect>
958 fidl::encoding::Encode<DeviceGetBatteryProfileResponse, D>
959 for &DeviceGetBatteryProfileResponse
960 {
961 #[inline]
962 unsafe fn encode(
963 self,
964 encoder: &mut fidl::encoding::Encoder<'_, D>,
965 offset: usize,
966 _depth: fidl::encoding::Depth,
967 ) -> fidl::Result<()> {
968 encoder.debug_check_bounds::<DeviceGetBatteryProfileResponse>(offset);
969 unsafe {
970 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
972 (buf_ptr as *mut DeviceGetBatteryProfileResponse)
973 .write_unaligned((self as *const DeviceGetBatteryProfileResponse).read());
974 }
977 Ok(())
978 }
979 }
980 unsafe impl<
981 D: fidl::encoding::ResourceDialect,
982 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 596>, D>,
983 > fidl::encoding::Encode<DeviceGetBatteryProfileResponse, D> for (T0,)
984 {
985 #[inline]
986 unsafe fn encode(
987 self,
988 encoder: &mut fidl::encoding::Encoder<'_, D>,
989 offset: usize,
990 depth: fidl::encoding::Depth,
991 ) -> fidl::Result<()> {
992 encoder.debug_check_bounds::<DeviceGetBatteryProfileResponse>(offset);
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 DeviceGetBatteryProfileResponse
1003 {
1004 #[inline(always)]
1005 fn new_empty() -> Self {
1006 Self { profile: fidl::new_empty!(fidl::encoding::Array<u8, 596>, 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, 596);
1022 }
1023 Ok(())
1024 }
1025 }
1026
1027 impl fidl::encoding::ValueTypeMarker for DeviceGetEssentialParamsResponse {
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 DeviceGetEssentialParamsResponse {
1035 type Owned = Self;
1036
1037 #[inline(always)]
1038 fn inline_align(_context: fidl::encoding::Context) -> usize {
1039 1
1040 }
1041
1042 #[inline(always)]
1043 fn inline_size(_context: fidl::encoding::Context) -> usize {
1044 48
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<DeviceGetEssentialParamsResponse, D>
1059 for &DeviceGetEssentialParamsResponse
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::<DeviceGetEssentialParamsResponse>(offset);
1069 unsafe {
1070 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1072 (buf_ptr as *mut DeviceGetEssentialParamsResponse)
1073 .write_unaligned((self as *const DeviceGetEssentialParamsResponse).read());
1074 }
1077 Ok(())
1078 }
1079 }
1080 unsafe impl<
1081 D: fidl::encoding::ResourceDialect,
1082 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 48>, D>,
1083 > fidl::encoding::Encode<DeviceGetEssentialParamsResponse, 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::<DeviceGetEssentialParamsResponse>(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 DeviceGetEssentialParamsResponse
1103 {
1104 #[inline(always)]
1105 fn new_empty() -> Self {
1106 Self { params: fidl::new_empty!(fidl::encoding::Array<u8, 48>, 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, 48);
1122 }
1123 Ok(())
1124 }
1125 }
1126
1127 impl fidl::encoding::ValueTypeMarker for DeviceGetIioValueResponse {
1128 type Borrowed<'a> = &'a Self;
1129 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1130 value
1131 }
1132 }
1133
1134 unsafe impl fidl::encoding::TypeMarker for DeviceGetIioValueResponse {
1135 type Owned = Self;
1136
1137 #[inline(always)]
1138 fn inline_align(_context: fidl::encoding::Context) -> usize {
1139 4
1140 }
1141
1142 #[inline(always)]
1143 fn inline_size(_context: fidl::encoding::Context) -> usize {
1144 4
1145 }
1146 #[inline(always)]
1147 fn encode_is_copy() -> bool {
1148 true
1149 }
1150
1151 #[inline(always)]
1152 fn decode_is_copy() -> bool {
1153 true
1154 }
1155 }
1156
1157 unsafe impl<D: fidl::encoding::ResourceDialect>
1158 fidl::encoding::Encode<DeviceGetIioValueResponse, D> for &DeviceGetIioValueResponse
1159 {
1160 #[inline]
1161 unsafe fn encode(
1162 self,
1163 encoder: &mut fidl::encoding::Encoder<'_, D>,
1164 offset: usize,
1165 _depth: fidl::encoding::Depth,
1166 ) -> fidl::Result<()> {
1167 encoder.debug_check_bounds::<DeviceGetIioValueResponse>(offset);
1168 unsafe {
1169 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1171 (buf_ptr as *mut DeviceGetIioValueResponse)
1172 .write_unaligned((self as *const DeviceGetIioValueResponse).read());
1173 }
1176 Ok(())
1177 }
1178 }
1179 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1180 fidl::encoding::Encode<DeviceGetIioValueResponse, D> for (T0,)
1181 {
1182 #[inline]
1183 unsafe fn encode(
1184 self,
1185 encoder: &mut fidl::encoding::Encoder<'_, D>,
1186 offset: usize,
1187 depth: fidl::encoding::Depth,
1188 ) -> fidl::Result<()> {
1189 encoder.debug_check_bounds::<DeviceGetIioValueResponse>(offset);
1190 self.0.encode(encoder, offset + 0, depth)?;
1194 Ok(())
1195 }
1196 }
1197
1198 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1199 for DeviceGetIioValueResponse
1200 {
1201 #[inline(always)]
1202 fn new_empty() -> Self {
1203 Self { value: fidl::new_empty!(i32, D) }
1204 }
1205
1206 #[inline]
1207 unsafe fn decode(
1208 &mut self,
1209 decoder: &mut fidl::encoding::Decoder<'_, D>,
1210 offset: usize,
1211 _depth: fidl::encoding::Depth,
1212 ) -> fidl::Result<()> {
1213 decoder.debug_check_bounds::<Self>(offset);
1214 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1215 unsafe {
1218 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1219 }
1220 Ok(())
1221 }
1222 }
1223}