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