fidl_fuchsia_hardware_qcom_hvdcpopti__common/
fidl_fuchsia_hardware_qcom_hvdcpopti__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub 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
25/// Battery configuration.
26pub const BATTERY_CONFIG_LENGTH: u64 = 304;
27
28pub const BATTERY_PROFILE_LENGTH: u64 = 596;
29
30/// Battery profile.
31pub const BATTERY_PROFILE_REQUEST_LENGTH: u64 = 8;
32
33/// Config.
34pub const CONFIG_LENGTH: u64 = 104;
35
36/// Essential Parameters.
37pub const ESSENTIAL_PARAMS_LENGTH: u64 = 48;
38
39/// FIFO data.
40pub const FIFO_DATA_MAX_LENGTH: u64 = 1748;
41
42/// FIFO processed data.
43pub const PROCESSED_FIFO_DATA_LENGTH: u64 = 152;
44
45/// Step and JEITA Params.
46pub 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
134mod internal {
135    use super::*;
136
137    impl fidl::encoding::ValueTypeMarker for DeviceGetBatteryConfigResponse {
138        type Borrowed<'a> = &'a Self;
139        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
140            value
141        }
142    }
143
144    unsafe impl fidl::encoding::TypeMarker for DeviceGetBatteryConfigResponse {
145        type Owned = Self;
146
147        #[inline(always)]
148        fn inline_align(_context: fidl::encoding::Context) -> usize {
149            1
150        }
151
152        #[inline(always)]
153        fn inline_size(_context: fidl::encoding::Context) -> usize {
154            304
155        }
156        #[inline(always)]
157        fn encode_is_copy() -> bool {
158            true
159        }
160
161        #[inline(always)]
162        fn decode_is_copy() -> bool {
163            true
164        }
165    }
166
167    unsafe impl<D: fidl::encoding::ResourceDialect>
168        fidl::encoding::Encode<DeviceGetBatteryConfigResponse, D>
169        for &DeviceGetBatteryConfigResponse
170    {
171        #[inline]
172        unsafe fn encode(
173            self,
174            encoder: &mut fidl::encoding::Encoder<'_, D>,
175            offset: usize,
176            _depth: fidl::encoding::Depth,
177        ) -> fidl::Result<()> {
178            encoder.debug_check_bounds::<DeviceGetBatteryConfigResponse>(offset);
179            unsafe {
180                // Copy the object into the buffer.
181                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
182                (buf_ptr as *mut DeviceGetBatteryConfigResponse)
183                    .write_unaligned((self as *const DeviceGetBatteryConfigResponse).read());
184                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
185                // done second because the memcpy will write garbage to these bytes.
186            }
187            Ok(())
188        }
189    }
190    unsafe impl<
191            D: fidl::encoding::ResourceDialect,
192            T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 304>, D>,
193        > fidl::encoding::Encode<DeviceGetBatteryConfigResponse, D> for (T0,)
194    {
195        #[inline]
196        unsafe fn encode(
197            self,
198            encoder: &mut fidl::encoding::Encoder<'_, D>,
199            offset: usize,
200            depth: fidl::encoding::Depth,
201        ) -> fidl::Result<()> {
202            encoder.debug_check_bounds::<DeviceGetBatteryConfigResponse>(offset);
203            // Zero out padding regions. There's no need to apply masks
204            // because the unmasked parts will be overwritten by fields.
205            // Write the fields.
206            self.0.encode(encoder, offset + 0, depth)?;
207            Ok(())
208        }
209    }
210
211    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
212        for DeviceGetBatteryConfigResponse
213    {
214        #[inline(always)]
215        fn new_empty() -> Self {
216            Self { config: fidl::new_empty!(fidl::encoding::Array<u8, 304>, D) }
217        }
218
219        #[inline]
220        unsafe fn decode(
221            &mut self,
222            decoder: &mut fidl::encoding::Decoder<'_, D>,
223            offset: usize,
224            _depth: fidl::encoding::Depth,
225        ) -> fidl::Result<()> {
226            decoder.debug_check_bounds::<Self>(offset);
227            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
228            // Verify that padding bytes are zero.
229            // Copy from the buffer into the object.
230            unsafe {
231                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 304);
232            }
233            Ok(())
234        }
235    }
236
237    impl fidl::encoding::ValueTypeMarker for DeviceGetBatteryProfileRequest {
238        type Borrowed<'a> = &'a Self;
239        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
240            value
241        }
242    }
243
244    unsafe impl fidl::encoding::TypeMarker for DeviceGetBatteryProfileRequest {
245        type Owned = Self;
246
247        #[inline(always)]
248        fn inline_align(_context: fidl::encoding::Context) -> usize {
249            1
250        }
251
252        #[inline(always)]
253        fn inline_size(_context: fidl::encoding::Context) -> usize {
254            8
255        }
256        #[inline(always)]
257        fn encode_is_copy() -> bool {
258            true
259        }
260
261        #[inline(always)]
262        fn decode_is_copy() -> bool {
263            true
264        }
265    }
266
267    unsafe impl<D: fidl::encoding::ResourceDialect>
268        fidl::encoding::Encode<DeviceGetBatteryProfileRequest, D>
269        for &DeviceGetBatteryProfileRequest
270    {
271        #[inline]
272        unsafe fn encode(
273            self,
274            encoder: &mut fidl::encoding::Encoder<'_, D>,
275            offset: usize,
276            _depth: fidl::encoding::Depth,
277        ) -> fidl::Result<()> {
278            encoder.debug_check_bounds::<DeviceGetBatteryProfileRequest>(offset);
279            unsafe {
280                // Copy the object into the buffer.
281                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
282                (buf_ptr as *mut DeviceGetBatteryProfileRequest)
283                    .write_unaligned((self as *const DeviceGetBatteryProfileRequest).read());
284                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
285                // done second because the memcpy will write garbage to these bytes.
286            }
287            Ok(())
288        }
289    }
290    unsafe impl<
291            D: fidl::encoding::ResourceDialect,
292            T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 8>, D>,
293        > fidl::encoding::Encode<DeviceGetBatteryProfileRequest, D> for (T0,)
294    {
295        #[inline]
296        unsafe fn encode(
297            self,
298            encoder: &mut fidl::encoding::Encoder<'_, D>,
299            offset: usize,
300            depth: fidl::encoding::Depth,
301        ) -> fidl::Result<()> {
302            encoder.debug_check_bounds::<DeviceGetBatteryProfileRequest>(offset);
303            // Zero out padding regions. There's no need to apply masks
304            // because the unmasked parts will be overwritten by fields.
305            // Write the fields.
306            self.0.encode(encoder, offset + 0, depth)?;
307            Ok(())
308        }
309    }
310
311    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
312        for DeviceGetBatteryProfileRequest
313    {
314        #[inline(always)]
315        fn new_empty() -> Self {
316            Self { request: fidl::new_empty!(fidl::encoding::Array<u8, 8>, D) }
317        }
318
319        #[inline]
320        unsafe fn decode(
321            &mut self,
322            decoder: &mut fidl::encoding::Decoder<'_, D>,
323            offset: usize,
324            _depth: fidl::encoding::Depth,
325        ) -> fidl::Result<()> {
326            decoder.debug_check_bounds::<Self>(offset);
327            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
328            // Verify that padding bytes are zero.
329            // Copy from the buffer into the object.
330            unsafe {
331                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
332            }
333            Ok(())
334        }
335    }
336
337    impl fidl::encoding::ValueTypeMarker for DeviceGetConfigResponse {
338        type Borrowed<'a> = &'a Self;
339        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
340            value
341        }
342    }
343
344    unsafe impl fidl::encoding::TypeMarker for DeviceGetConfigResponse {
345        type Owned = Self;
346
347        #[inline(always)]
348        fn inline_align(_context: fidl::encoding::Context) -> usize {
349            1
350        }
351
352        #[inline(always)]
353        fn inline_size(_context: fidl::encoding::Context) -> usize {
354            104
355        }
356        #[inline(always)]
357        fn encode_is_copy() -> bool {
358            true
359        }
360
361        #[inline(always)]
362        fn decode_is_copy() -> bool {
363            true
364        }
365    }
366
367    unsafe impl<D: fidl::encoding::ResourceDialect>
368        fidl::encoding::Encode<DeviceGetConfigResponse, D> for &DeviceGetConfigResponse
369    {
370        #[inline]
371        unsafe fn encode(
372            self,
373            encoder: &mut fidl::encoding::Encoder<'_, D>,
374            offset: usize,
375            _depth: fidl::encoding::Depth,
376        ) -> fidl::Result<()> {
377            encoder.debug_check_bounds::<DeviceGetConfigResponse>(offset);
378            unsafe {
379                // Copy the object into the buffer.
380                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
381                (buf_ptr as *mut DeviceGetConfigResponse)
382                    .write_unaligned((self as *const DeviceGetConfigResponse).read());
383                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
384                // done second because the memcpy will write garbage to these bytes.
385            }
386            Ok(())
387        }
388    }
389    unsafe impl<
390            D: fidl::encoding::ResourceDialect,
391            T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 104>, D>,
392        > fidl::encoding::Encode<DeviceGetConfigResponse, D> for (T0,)
393    {
394        #[inline]
395        unsafe fn encode(
396            self,
397            encoder: &mut fidl::encoding::Encoder<'_, D>,
398            offset: usize,
399            depth: fidl::encoding::Depth,
400        ) -> fidl::Result<()> {
401            encoder.debug_check_bounds::<DeviceGetConfigResponse>(offset);
402            // Zero out padding regions. There's no need to apply masks
403            // because the unmasked parts will be overwritten by fields.
404            // Write the fields.
405            self.0.encode(encoder, offset + 0, depth)?;
406            Ok(())
407        }
408    }
409
410    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
411        for DeviceGetConfigResponse
412    {
413        #[inline(always)]
414        fn new_empty() -> Self {
415            Self { config: fidl::new_empty!(fidl::encoding::Array<u8, 104>, D) }
416        }
417
418        #[inline]
419        unsafe fn decode(
420            &mut self,
421            decoder: &mut fidl::encoding::Decoder<'_, D>,
422            offset: usize,
423            _depth: fidl::encoding::Depth,
424        ) -> fidl::Result<()> {
425            decoder.debug_check_bounds::<Self>(offset);
426            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
427            // Verify that padding bytes are zero.
428            // Copy from the buffer into the object.
429            unsafe {
430                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 104);
431            }
432            Ok(())
433        }
434    }
435
436    impl fidl::encoding::ValueTypeMarker for DeviceGetIioValueRequest {
437        type Borrowed<'a> = &'a Self;
438        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
439            value
440        }
441    }
442
443    unsafe impl fidl::encoding::TypeMarker for DeviceGetIioValueRequest {
444        type Owned = Self;
445
446        #[inline(always)]
447        fn inline_align(_context: fidl::encoding::Context) -> usize {
448            8
449        }
450
451        #[inline(always)]
452        fn inline_size(_context: fidl::encoding::Context) -> usize {
453            16
454        }
455    }
456
457    unsafe impl<D: fidl::encoding::ResourceDialect>
458        fidl::encoding::Encode<DeviceGetIioValueRequest, D> for &DeviceGetIioValueRequest
459    {
460        #[inline]
461        unsafe fn encode(
462            self,
463            encoder: &mut fidl::encoding::Encoder<'_, D>,
464            offset: usize,
465            _depth: fidl::encoding::Depth,
466        ) -> fidl::Result<()> {
467            encoder.debug_check_bounds::<DeviceGetIioValueRequest>(offset);
468            // Delegate to tuple encoding.
469            fidl::encoding::Encode::<DeviceGetIioValueRequest, D>::encode(
470                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
471                    &self.label,
472                ),),
473                encoder,
474                offset,
475                _depth,
476            )
477        }
478    }
479    unsafe impl<
480            D: fidl::encoding::ResourceDialect,
481            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
482        > fidl::encoding::Encode<DeviceGetIioValueRequest, D> for (T0,)
483    {
484        #[inline]
485        unsafe fn encode(
486            self,
487            encoder: &mut fidl::encoding::Encoder<'_, D>,
488            offset: usize,
489            depth: fidl::encoding::Depth,
490        ) -> fidl::Result<()> {
491            encoder.debug_check_bounds::<DeviceGetIioValueRequest>(offset);
492            // Zero out padding regions. There's no need to apply masks
493            // because the unmasked parts will be overwritten by fields.
494            // Write the fields.
495            self.0.encode(encoder, offset + 0, depth)?;
496            Ok(())
497        }
498    }
499
500    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
501        for DeviceGetIioValueRequest
502    {
503        #[inline(always)]
504        fn new_empty() -> Self {
505            Self { label: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
506        }
507
508        #[inline]
509        unsafe fn decode(
510            &mut self,
511            decoder: &mut fidl::encoding::Decoder<'_, D>,
512            offset: usize,
513            _depth: fidl::encoding::Depth,
514        ) -> fidl::Result<()> {
515            decoder.debug_check_bounds::<Self>(offset);
516            // Verify that padding bytes are zero.
517            fidl::decode!(
518                fidl::encoding::UnboundedString,
519                D,
520                &mut self.label,
521                decoder,
522                offset + 0,
523                _depth
524            )?;
525            Ok(())
526        }
527    }
528
529    impl fidl::encoding::ValueTypeMarker for DeviceGetStepAndJeitaParamsResponse {
530        type Borrowed<'a> = &'a Self;
531        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
532            value
533        }
534    }
535
536    unsafe impl fidl::encoding::TypeMarker for DeviceGetStepAndJeitaParamsResponse {
537        type Owned = Self;
538
539        #[inline(always)]
540        fn inline_align(_context: fidl::encoding::Context) -> usize {
541            1
542        }
543
544        #[inline(always)]
545        fn inline_size(_context: fidl::encoding::Context) -> usize {
546            247
547        }
548        #[inline(always)]
549        fn encode_is_copy() -> bool {
550            true
551        }
552
553        #[inline(always)]
554        fn decode_is_copy() -> bool {
555            true
556        }
557    }
558
559    unsafe impl<D: fidl::encoding::ResourceDialect>
560        fidl::encoding::Encode<DeviceGetStepAndJeitaParamsResponse, D>
561        for &DeviceGetStepAndJeitaParamsResponse
562    {
563        #[inline]
564        unsafe fn encode(
565            self,
566            encoder: &mut fidl::encoding::Encoder<'_, D>,
567            offset: usize,
568            _depth: fidl::encoding::Depth,
569        ) -> fidl::Result<()> {
570            encoder.debug_check_bounds::<DeviceGetStepAndJeitaParamsResponse>(offset);
571            unsafe {
572                // Copy the object into the buffer.
573                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
574                (buf_ptr as *mut DeviceGetStepAndJeitaParamsResponse)
575                    .write_unaligned((self as *const DeviceGetStepAndJeitaParamsResponse).read());
576                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
577                // done second because the memcpy will write garbage to these bytes.
578            }
579            Ok(())
580        }
581    }
582    unsafe impl<
583            D: fidl::encoding::ResourceDialect,
584            T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 247>, D>,
585        > fidl::encoding::Encode<DeviceGetStepAndJeitaParamsResponse, 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::<DeviceGetStepAndJeitaParamsResponse>(offset);
595            // Zero out padding regions. There's no need to apply masks
596            // because the unmasked parts will be overwritten by fields.
597            // Write the fields.
598            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 DeviceGetStepAndJeitaParamsResponse
605    {
606        #[inline(always)]
607        fn new_empty() -> Self {
608            Self { params: fidl::new_empty!(fidl::encoding::Array<u8, 247>, 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            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
620            // Verify that padding bytes are zero.
621            // Copy from the buffer into the object.
622            unsafe {
623                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 247);
624            }
625            Ok(())
626        }
627    }
628
629    impl fidl::encoding::ValueTypeMarker for DeviceOnFifoDataRequest {
630        type Borrowed<'a> = &'a Self;
631        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
632            value
633        }
634    }
635
636    unsafe impl fidl::encoding::TypeMarker for DeviceOnFifoDataRequest {
637        type Owned = Self;
638
639        #[inline(always)]
640        fn inline_align(_context: fidl::encoding::Context) -> usize {
641            8
642        }
643
644        #[inline(always)]
645        fn inline_size(_context: fidl::encoding::Context) -> usize {
646            16
647        }
648    }
649
650    unsafe impl<D: fidl::encoding::ResourceDialect>
651        fidl::encoding::Encode<DeviceOnFifoDataRequest, D> for &DeviceOnFifoDataRequest
652    {
653        #[inline]
654        unsafe fn encode(
655            self,
656            encoder: &mut fidl::encoding::Encoder<'_, D>,
657            offset: usize,
658            _depth: fidl::encoding::Depth,
659        ) -> fidl::Result<()> {
660            encoder.debug_check_bounds::<DeviceOnFifoDataRequest>(offset);
661            // Delegate to tuple encoding.
662            fidl::encoding::Encode::<DeviceOnFifoDataRequest, D>::encode(
663                (<fidl::encoding::Vector<u8, 1748> as fidl::encoding::ValueTypeMarker>::borrow(
664                    &self.data,
665                ),),
666                encoder,
667                offset,
668                _depth,
669            )
670        }
671    }
672    unsafe impl<
673            D: fidl::encoding::ResourceDialect,
674            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 1748>, D>,
675        > fidl::encoding::Encode<DeviceOnFifoDataRequest, D> for (T0,)
676    {
677        #[inline]
678        unsafe fn encode(
679            self,
680            encoder: &mut fidl::encoding::Encoder<'_, D>,
681            offset: usize,
682            depth: fidl::encoding::Depth,
683        ) -> fidl::Result<()> {
684            encoder.debug_check_bounds::<DeviceOnFifoDataRequest>(offset);
685            // Zero out padding regions. There's no need to apply masks
686            // because the unmasked parts will be overwritten by fields.
687            // Write the fields.
688            self.0.encode(encoder, offset + 0, depth)?;
689            Ok(())
690        }
691    }
692
693    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
694        for DeviceOnFifoDataRequest
695    {
696        #[inline(always)]
697        fn new_empty() -> Self {
698            Self { data: fidl::new_empty!(fidl::encoding::Vector<u8, 1748>, D) }
699        }
700
701        #[inline]
702        unsafe fn decode(
703            &mut self,
704            decoder: &mut fidl::encoding::Decoder<'_, D>,
705            offset: usize,
706            _depth: fidl::encoding::Depth,
707        ) -> fidl::Result<()> {
708            decoder.debug_check_bounds::<Self>(offset);
709            // Verify that padding bytes are zero.
710            fidl::decode!(fidl::encoding::Vector<u8, 1748>, D, &mut self.data, decoder, offset + 0, _depth)?;
711            Ok(())
712        }
713    }
714
715    impl fidl::encoding::ValueTypeMarker for DeviceSetEssentialParamsRequest {
716        type Borrowed<'a> = &'a Self;
717        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
718            value
719        }
720    }
721
722    unsafe impl fidl::encoding::TypeMarker for DeviceSetEssentialParamsRequest {
723        type Owned = Self;
724
725        #[inline(always)]
726        fn inline_align(_context: fidl::encoding::Context) -> usize {
727            1
728        }
729
730        #[inline(always)]
731        fn inline_size(_context: fidl::encoding::Context) -> usize {
732            48
733        }
734        #[inline(always)]
735        fn encode_is_copy() -> bool {
736            true
737        }
738
739        #[inline(always)]
740        fn decode_is_copy() -> bool {
741            true
742        }
743    }
744
745    unsafe impl<D: fidl::encoding::ResourceDialect>
746        fidl::encoding::Encode<DeviceSetEssentialParamsRequest, D>
747        for &DeviceSetEssentialParamsRequest
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::<DeviceSetEssentialParamsRequest>(offset);
757            unsafe {
758                // Copy the object into the buffer.
759                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
760                (buf_ptr as *mut DeviceSetEssentialParamsRequest)
761                    .write_unaligned((self as *const DeviceSetEssentialParamsRequest).read());
762                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
763                // done second because the memcpy will write garbage to these bytes.
764            }
765            Ok(())
766        }
767    }
768    unsafe impl<
769            D: fidl::encoding::ResourceDialect,
770            T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 48>, D>,
771        > fidl::encoding::Encode<DeviceSetEssentialParamsRequest, D> for (T0,)
772    {
773        #[inline]
774        unsafe fn encode(
775            self,
776            encoder: &mut fidl::encoding::Encoder<'_, D>,
777            offset: usize,
778            depth: fidl::encoding::Depth,
779        ) -> fidl::Result<()> {
780            encoder.debug_check_bounds::<DeviceSetEssentialParamsRequest>(offset);
781            // Zero out padding regions. There's no need to apply masks
782            // because the unmasked parts will be overwritten by fields.
783            // Write the fields.
784            self.0.encode(encoder, offset + 0, depth)?;
785            Ok(())
786        }
787    }
788
789    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
790        for DeviceSetEssentialParamsRequest
791    {
792        #[inline(always)]
793        fn new_empty() -> Self {
794            Self { params: fidl::new_empty!(fidl::encoding::Array<u8, 48>, D) }
795        }
796
797        #[inline]
798        unsafe fn decode(
799            &mut self,
800            decoder: &mut fidl::encoding::Decoder<'_, D>,
801            offset: usize,
802            _depth: fidl::encoding::Depth,
803        ) -> fidl::Result<()> {
804            decoder.debug_check_bounds::<Self>(offset);
805            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
806            // Verify that padding bytes are zero.
807            // Copy from the buffer into the object.
808            unsafe {
809                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 48);
810            }
811            Ok(())
812        }
813    }
814
815    impl fidl::encoding::ValueTypeMarker for DeviceSetProcessedFifoDataRequest {
816        type Borrowed<'a> = &'a Self;
817        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
818            value
819        }
820    }
821
822    unsafe impl fidl::encoding::TypeMarker for DeviceSetProcessedFifoDataRequest {
823        type Owned = Self;
824
825        #[inline(always)]
826        fn inline_align(_context: fidl::encoding::Context) -> usize {
827            1
828        }
829
830        #[inline(always)]
831        fn inline_size(_context: fidl::encoding::Context) -> usize {
832            152
833        }
834        #[inline(always)]
835        fn encode_is_copy() -> bool {
836            true
837        }
838
839        #[inline(always)]
840        fn decode_is_copy() -> bool {
841            true
842        }
843    }
844
845    unsafe impl<D: fidl::encoding::ResourceDialect>
846        fidl::encoding::Encode<DeviceSetProcessedFifoDataRequest, D>
847        for &DeviceSetProcessedFifoDataRequest
848    {
849        #[inline]
850        unsafe fn encode(
851            self,
852            encoder: &mut fidl::encoding::Encoder<'_, D>,
853            offset: usize,
854            _depth: fidl::encoding::Depth,
855        ) -> fidl::Result<()> {
856            encoder.debug_check_bounds::<DeviceSetProcessedFifoDataRequest>(offset);
857            unsafe {
858                // Copy the object into the buffer.
859                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
860                (buf_ptr as *mut DeviceSetProcessedFifoDataRequest)
861                    .write_unaligned((self as *const DeviceSetProcessedFifoDataRequest).read());
862                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
863                // done second because the memcpy will write garbage to these bytes.
864            }
865            Ok(())
866        }
867    }
868    unsafe impl<
869            D: fidl::encoding::ResourceDialect,
870            T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 152>, D>,
871        > fidl::encoding::Encode<DeviceSetProcessedFifoDataRequest, D> for (T0,)
872    {
873        #[inline]
874        unsafe fn encode(
875            self,
876            encoder: &mut fidl::encoding::Encoder<'_, D>,
877            offset: usize,
878            depth: fidl::encoding::Depth,
879        ) -> fidl::Result<()> {
880            encoder.debug_check_bounds::<DeviceSetProcessedFifoDataRequest>(offset);
881            // Zero out padding regions. There's no need to apply masks
882            // because the unmasked parts will be overwritten by fields.
883            // Write the fields.
884            self.0.encode(encoder, offset + 0, depth)?;
885            Ok(())
886        }
887    }
888
889    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
890        for DeviceSetProcessedFifoDataRequest
891    {
892        #[inline(always)]
893        fn new_empty() -> Self {
894            Self { data: fidl::new_empty!(fidl::encoding::Array<u8, 152>, D) }
895        }
896
897        #[inline]
898        unsafe fn decode(
899            &mut self,
900            decoder: &mut fidl::encoding::Decoder<'_, D>,
901            offset: usize,
902            _depth: fidl::encoding::Depth,
903        ) -> fidl::Result<()> {
904            decoder.debug_check_bounds::<Self>(offset);
905            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
906            // Verify that padding bytes are zero.
907            // Copy from the buffer into the object.
908            unsafe {
909                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 152);
910            }
911            Ok(())
912        }
913    }
914
915    impl fidl::encoding::ValueTypeMarker for DeviceGetBatteryProfileResponse {
916        type Borrowed<'a> = &'a Self;
917        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
918            value
919        }
920    }
921
922    unsafe impl fidl::encoding::TypeMarker for DeviceGetBatteryProfileResponse {
923        type Owned = Self;
924
925        #[inline(always)]
926        fn inline_align(_context: fidl::encoding::Context) -> usize {
927            1
928        }
929
930        #[inline(always)]
931        fn inline_size(_context: fidl::encoding::Context) -> usize {
932            596
933        }
934        #[inline(always)]
935        fn encode_is_copy() -> bool {
936            true
937        }
938
939        #[inline(always)]
940        fn decode_is_copy() -> bool {
941            true
942        }
943    }
944
945    unsafe impl<D: fidl::encoding::ResourceDialect>
946        fidl::encoding::Encode<DeviceGetBatteryProfileResponse, D>
947        for &DeviceGetBatteryProfileResponse
948    {
949        #[inline]
950        unsafe fn encode(
951            self,
952            encoder: &mut fidl::encoding::Encoder<'_, D>,
953            offset: usize,
954            _depth: fidl::encoding::Depth,
955        ) -> fidl::Result<()> {
956            encoder.debug_check_bounds::<DeviceGetBatteryProfileResponse>(offset);
957            unsafe {
958                // Copy the object into the buffer.
959                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
960                (buf_ptr as *mut DeviceGetBatteryProfileResponse)
961                    .write_unaligned((self as *const DeviceGetBatteryProfileResponse).read());
962                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
963                // done second because the memcpy will write garbage to these bytes.
964            }
965            Ok(())
966        }
967    }
968    unsafe impl<
969            D: fidl::encoding::ResourceDialect,
970            T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 596>, D>,
971        > fidl::encoding::Encode<DeviceGetBatteryProfileResponse, D> for (T0,)
972    {
973        #[inline]
974        unsafe fn encode(
975            self,
976            encoder: &mut fidl::encoding::Encoder<'_, D>,
977            offset: usize,
978            depth: fidl::encoding::Depth,
979        ) -> fidl::Result<()> {
980            encoder.debug_check_bounds::<DeviceGetBatteryProfileResponse>(offset);
981            // Zero out padding regions. There's no need to apply masks
982            // because the unmasked parts will be overwritten by fields.
983            // Write the fields.
984            self.0.encode(encoder, offset + 0, depth)?;
985            Ok(())
986        }
987    }
988
989    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
990        for DeviceGetBatteryProfileResponse
991    {
992        #[inline(always)]
993        fn new_empty() -> Self {
994            Self { profile: fidl::new_empty!(fidl::encoding::Array<u8, 596>, D) }
995        }
996
997        #[inline]
998        unsafe fn decode(
999            &mut self,
1000            decoder: &mut fidl::encoding::Decoder<'_, D>,
1001            offset: usize,
1002            _depth: fidl::encoding::Depth,
1003        ) -> fidl::Result<()> {
1004            decoder.debug_check_bounds::<Self>(offset);
1005            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1006            // Verify that padding bytes are zero.
1007            // Copy from the buffer into the object.
1008            unsafe {
1009                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 596);
1010            }
1011            Ok(())
1012        }
1013    }
1014
1015    impl fidl::encoding::ValueTypeMarker for DeviceGetEssentialParamsResponse {
1016        type Borrowed<'a> = &'a Self;
1017        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1018            value
1019        }
1020    }
1021
1022    unsafe impl fidl::encoding::TypeMarker for DeviceGetEssentialParamsResponse {
1023        type Owned = Self;
1024
1025        #[inline(always)]
1026        fn inline_align(_context: fidl::encoding::Context) -> usize {
1027            1
1028        }
1029
1030        #[inline(always)]
1031        fn inline_size(_context: fidl::encoding::Context) -> usize {
1032            48
1033        }
1034        #[inline(always)]
1035        fn encode_is_copy() -> bool {
1036            true
1037        }
1038
1039        #[inline(always)]
1040        fn decode_is_copy() -> bool {
1041            true
1042        }
1043    }
1044
1045    unsafe impl<D: fidl::encoding::ResourceDialect>
1046        fidl::encoding::Encode<DeviceGetEssentialParamsResponse, D>
1047        for &DeviceGetEssentialParamsResponse
1048    {
1049        #[inline]
1050        unsafe fn encode(
1051            self,
1052            encoder: &mut fidl::encoding::Encoder<'_, D>,
1053            offset: usize,
1054            _depth: fidl::encoding::Depth,
1055        ) -> fidl::Result<()> {
1056            encoder.debug_check_bounds::<DeviceGetEssentialParamsResponse>(offset);
1057            unsafe {
1058                // Copy the object into the buffer.
1059                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1060                (buf_ptr as *mut DeviceGetEssentialParamsResponse)
1061                    .write_unaligned((self as *const DeviceGetEssentialParamsResponse).read());
1062                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1063                // done second because the memcpy will write garbage to these bytes.
1064            }
1065            Ok(())
1066        }
1067    }
1068    unsafe impl<
1069            D: fidl::encoding::ResourceDialect,
1070            T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 48>, D>,
1071        > fidl::encoding::Encode<DeviceGetEssentialParamsResponse, D> for (T0,)
1072    {
1073        #[inline]
1074        unsafe fn encode(
1075            self,
1076            encoder: &mut fidl::encoding::Encoder<'_, D>,
1077            offset: usize,
1078            depth: fidl::encoding::Depth,
1079        ) -> fidl::Result<()> {
1080            encoder.debug_check_bounds::<DeviceGetEssentialParamsResponse>(offset);
1081            // Zero out padding regions. There's no need to apply masks
1082            // because the unmasked parts will be overwritten by fields.
1083            // Write the fields.
1084            self.0.encode(encoder, offset + 0, depth)?;
1085            Ok(())
1086        }
1087    }
1088
1089    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1090        for DeviceGetEssentialParamsResponse
1091    {
1092        #[inline(always)]
1093        fn new_empty() -> Self {
1094            Self { params: fidl::new_empty!(fidl::encoding::Array<u8, 48>, D) }
1095        }
1096
1097        #[inline]
1098        unsafe fn decode(
1099            &mut self,
1100            decoder: &mut fidl::encoding::Decoder<'_, D>,
1101            offset: usize,
1102            _depth: fidl::encoding::Depth,
1103        ) -> fidl::Result<()> {
1104            decoder.debug_check_bounds::<Self>(offset);
1105            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1106            // Verify that padding bytes are zero.
1107            // Copy from the buffer into the object.
1108            unsafe {
1109                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 48);
1110            }
1111            Ok(())
1112        }
1113    }
1114
1115    impl fidl::encoding::ValueTypeMarker for DeviceGetIioValueResponse {
1116        type Borrowed<'a> = &'a Self;
1117        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1118            value
1119        }
1120    }
1121
1122    unsafe impl fidl::encoding::TypeMarker for DeviceGetIioValueResponse {
1123        type Owned = Self;
1124
1125        #[inline(always)]
1126        fn inline_align(_context: fidl::encoding::Context) -> usize {
1127            4
1128        }
1129
1130        #[inline(always)]
1131        fn inline_size(_context: fidl::encoding::Context) -> usize {
1132            4
1133        }
1134        #[inline(always)]
1135        fn encode_is_copy() -> bool {
1136            true
1137        }
1138
1139        #[inline(always)]
1140        fn decode_is_copy() -> bool {
1141            true
1142        }
1143    }
1144
1145    unsafe impl<D: fidl::encoding::ResourceDialect>
1146        fidl::encoding::Encode<DeviceGetIioValueResponse, D> for &DeviceGetIioValueResponse
1147    {
1148        #[inline]
1149        unsafe fn encode(
1150            self,
1151            encoder: &mut fidl::encoding::Encoder<'_, D>,
1152            offset: usize,
1153            _depth: fidl::encoding::Depth,
1154        ) -> fidl::Result<()> {
1155            encoder.debug_check_bounds::<DeviceGetIioValueResponse>(offset);
1156            unsafe {
1157                // Copy the object into the buffer.
1158                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1159                (buf_ptr as *mut DeviceGetIioValueResponse)
1160                    .write_unaligned((self as *const DeviceGetIioValueResponse).read());
1161                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1162                // done second because the memcpy will write garbage to these bytes.
1163            }
1164            Ok(())
1165        }
1166    }
1167    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1168        fidl::encoding::Encode<DeviceGetIioValueResponse, D> for (T0,)
1169    {
1170        #[inline]
1171        unsafe fn encode(
1172            self,
1173            encoder: &mut fidl::encoding::Encoder<'_, D>,
1174            offset: usize,
1175            depth: fidl::encoding::Depth,
1176        ) -> fidl::Result<()> {
1177            encoder.debug_check_bounds::<DeviceGetIioValueResponse>(offset);
1178            // Zero out padding regions. There's no need to apply masks
1179            // because the unmasked parts will be overwritten by fields.
1180            // Write the fields.
1181            self.0.encode(encoder, offset + 0, depth)?;
1182            Ok(())
1183        }
1184    }
1185
1186    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1187        for DeviceGetIioValueResponse
1188    {
1189        #[inline(always)]
1190        fn new_empty() -> Self {
1191            Self { value: fidl::new_empty!(i32, D) }
1192        }
1193
1194        #[inline]
1195        unsafe fn decode(
1196            &mut self,
1197            decoder: &mut fidl::encoding::Decoder<'_, D>,
1198            offset: usize,
1199            _depth: fidl::encoding::Depth,
1200        ) -> fidl::Result<()> {
1201            decoder.debug_check_bounds::<Self>(offset);
1202            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1203            // Verify that padding bytes are zero.
1204            // Copy from the buffer into the object.
1205            unsafe {
1206                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1207            }
1208            Ok(())
1209        }
1210    }
1211}