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