fidl_fuchsia_hardware_input_common/
fidl_fuchsia_hardware_input_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 const MAX_REPORTS_COUNT: u32 = 50;
12
13#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14pub struct DeviceGetReportDescResponse {
15    pub desc: Vec<u8>,
16}
17
18impl fidl::Persistable for DeviceGetReportDescResponse {}
19
20#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
21pub struct DeviceGetReportRequest {
22    pub type_: fidl_fuchsia_hardware_hidbus::ReportType,
23    pub id: u8,
24}
25
26impl fidl::Persistable for DeviceGetReportRequest {}
27
28#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
29pub struct DeviceSetReportRequest {
30    pub type_: fidl_fuchsia_hardware_hidbus::ReportType,
31    pub id: u8,
32    pub report: Vec<u8>,
33}
34
35impl fidl::Persistable for DeviceSetReportRequest {}
36
37#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
38#[repr(C)]
39pub struct DeviceSetTraceIdRequest {
40    pub id: u32,
41}
42
43impl fidl::Persistable for DeviceSetTraceIdRequest {}
44
45#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
46pub struct DeviceGetReportResponse {
47    pub report: Vec<u8>,
48}
49
50impl fidl::Persistable for DeviceGetReportResponse {}
51
52#[derive(Clone, Debug, PartialEq)]
53pub struct DeviceQueryResponse {
54    pub info: fidl_fuchsia_hardware_hidbus::HidInfo,
55}
56
57impl fidl::Persistable for DeviceQueryResponse {}
58
59#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
60pub struct DeviceReadReportsResponse {
61    pub data: Vec<u8>,
62}
63
64impl fidl::Persistable for DeviceReadReportsResponse {}
65
66mod internal {
67    use super::*;
68
69    impl fidl::encoding::ValueTypeMarker for DeviceGetReportDescResponse {
70        type Borrowed<'a> = &'a Self;
71        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
72            value
73        }
74    }
75
76    unsafe impl fidl::encoding::TypeMarker for DeviceGetReportDescResponse {
77        type Owned = Self;
78
79        #[inline(always)]
80        fn inline_align(_context: fidl::encoding::Context) -> usize {
81            8
82        }
83
84        #[inline(always)]
85        fn inline_size(_context: fidl::encoding::Context) -> usize {
86            16
87        }
88    }
89
90    unsafe impl<D: fidl::encoding::ResourceDialect>
91        fidl::encoding::Encode<DeviceGetReportDescResponse, D> for &DeviceGetReportDescResponse
92    {
93        #[inline]
94        unsafe fn encode(
95            self,
96            encoder: &mut fidl::encoding::Encoder<'_, D>,
97            offset: usize,
98            _depth: fidl::encoding::Depth,
99        ) -> fidl::Result<()> {
100            encoder.debug_check_bounds::<DeviceGetReportDescResponse>(offset);
101            // Delegate to tuple encoding.
102            fidl::encoding::Encode::<DeviceGetReportDescResponse, D>::encode(
103                (<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
104                    &self.desc,
105                ),),
106                encoder,
107                offset,
108                _depth,
109            )
110        }
111    }
112    unsafe impl<
113            D: fidl::encoding::ResourceDialect,
114            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
115        > fidl::encoding::Encode<DeviceGetReportDescResponse, D> for (T0,)
116    {
117        #[inline]
118        unsafe fn encode(
119            self,
120            encoder: &mut fidl::encoding::Encoder<'_, D>,
121            offset: usize,
122            depth: fidl::encoding::Depth,
123        ) -> fidl::Result<()> {
124            encoder.debug_check_bounds::<DeviceGetReportDescResponse>(offset);
125            // Zero out padding regions. There's no need to apply masks
126            // because the unmasked parts will be overwritten by fields.
127            // Write the fields.
128            self.0.encode(encoder, offset + 0, depth)?;
129            Ok(())
130        }
131    }
132
133    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
134        for DeviceGetReportDescResponse
135    {
136        #[inline(always)]
137        fn new_empty() -> Self {
138            Self { desc: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D) }
139        }
140
141        #[inline]
142        unsafe fn decode(
143            &mut self,
144            decoder: &mut fidl::encoding::Decoder<'_, D>,
145            offset: usize,
146            _depth: fidl::encoding::Depth,
147        ) -> fidl::Result<()> {
148            decoder.debug_check_bounds::<Self>(offset);
149            // Verify that padding bytes are zero.
150            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.desc, decoder, offset + 0, _depth)?;
151            Ok(())
152        }
153    }
154
155    impl fidl::encoding::ValueTypeMarker for DeviceGetReportRequest {
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 DeviceGetReportRequest {
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            2
173        }
174    }
175
176    unsafe impl<D: fidl::encoding::ResourceDialect>
177        fidl::encoding::Encode<DeviceGetReportRequest, D> for &DeviceGetReportRequest
178    {
179        #[inline]
180        unsafe fn encode(
181            self,
182            encoder: &mut fidl::encoding::Encoder<'_, D>,
183            offset: usize,
184            _depth: fidl::encoding::Depth,
185        ) -> fidl::Result<()> {
186            encoder.debug_check_bounds::<DeviceGetReportRequest>(offset);
187            // Delegate to tuple encoding.
188            fidl::encoding::Encode::<DeviceGetReportRequest, D>::encode(
189                (
190                    <fidl_fuchsia_hardware_hidbus::ReportType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
191                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
192                ),
193                encoder, offset, _depth
194            )
195        }
196    }
197    unsafe impl<
198            D: fidl::encoding::ResourceDialect,
199            T0: fidl::encoding::Encode<fidl_fuchsia_hardware_hidbus::ReportType, D>,
200            T1: fidl::encoding::Encode<u8, D>,
201        > fidl::encoding::Encode<DeviceGetReportRequest, D> for (T0, T1)
202    {
203        #[inline]
204        unsafe fn encode(
205            self,
206            encoder: &mut fidl::encoding::Encoder<'_, D>,
207            offset: usize,
208            depth: fidl::encoding::Depth,
209        ) -> fidl::Result<()> {
210            encoder.debug_check_bounds::<DeviceGetReportRequest>(offset);
211            // Zero out padding regions. There's no need to apply masks
212            // because the unmasked parts will be overwritten by fields.
213            // Write the fields.
214            self.0.encode(encoder, offset + 0, depth)?;
215            self.1.encode(encoder, offset + 1, depth)?;
216            Ok(())
217        }
218    }
219
220    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
221        for DeviceGetReportRequest
222    {
223        #[inline(always)]
224        fn new_empty() -> Self {
225            Self {
226                type_: fidl::new_empty!(fidl_fuchsia_hardware_hidbus::ReportType, D),
227                id: fidl::new_empty!(u8, D),
228            }
229        }
230
231        #[inline]
232        unsafe fn decode(
233            &mut self,
234            decoder: &mut fidl::encoding::Decoder<'_, D>,
235            offset: usize,
236            _depth: fidl::encoding::Depth,
237        ) -> fidl::Result<()> {
238            decoder.debug_check_bounds::<Self>(offset);
239            // Verify that padding bytes are zero.
240            fidl::decode!(
241                fidl_fuchsia_hardware_hidbus::ReportType,
242                D,
243                &mut self.type_,
244                decoder,
245                offset + 0,
246                _depth
247            )?;
248            fidl::decode!(u8, D, &mut self.id, decoder, offset + 1, _depth)?;
249            Ok(())
250        }
251    }
252
253    impl fidl::encoding::ValueTypeMarker for DeviceSetReportRequest {
254        type Borrowed<'a> = &'a Self;
255        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
256            value
257        }
258    }
259
260    unsafe impl fidl::encoding::TypeMarker for DeviceSetReportRequest {
261        type Owned = Self;
262
263        #[inline(always)]
264        fn inline_align(_context: fidl::encoding::Context) -> usize {
265            8
266        }
267
268        #[inline(always)]
269        fn inline_size(_context: fidl::encoding::Context) -> usize {
270            24
271        }
272    }
273
274    unsafe impl<D: fidl::encoding::ResourceDialect>
275        fidl::encoding::Encode<DeviceSetReportRequest, D> for &DeviceSetReportRequest
276    {
277        #[inline]
278        unsafe fn encode(
279            self,
280            encoder: &mut fidl::encoding::Encoder<'_, D>,
281            offset: usize,
282            _depth: fidl::encoding::Depth,
283        ) -> fidl::Result<()> {
284            encoder.debug_check_bounds::<DeviceSetReportRequest>(offset);
285            // Delegate to tuple encoding.
286            fidl::encoding::Encode::<DeviceSetReportRequest, D>::encode(
287                (
288                    <fidl_fuchsia_hardware_hidbus::ReportType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
289                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.id),
290                    <fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(&self.report),
291                ),
292                encoder, offset, _depth
293            )
294        }
295    }
296    unsafe impl<
297            D: fidl::encoding::ResourceDialect,
298            T0: fidl::encoding::Encode<fidl_fuchsia_hardware_hidbus::ReportType, D>,
299            T1: fidl::encoding::Encode<u8, D>,
300            T2: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
301        > fidl::encoding::Encode<DeviceSetReportRequest, D> for (T0, T1, T2)
302    {
303        #[inline]
304        unsafe fn encode(
305            self,
306            encoder: &mut fidl::encoding::Encoder<'_, D>,
307            offset: usize,
308            depth: fidl::encoding::Depth,
309        ) -> fidl::Result<()> {
310            encoder.debug_check_bounds::<DeviceSetReportRequest>(offset);
311            // Zero out padding regions. There's no need to apply masks
312            // because the unmasked parts will be overwritten by fields.
313            unsafe {
314                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
315                (ptr as *mut u64).write_unaligned(0);
316            }
317            // Write the fields.
318            self.0.encode(encoder, offset + 0, depth)?;
319            self.1.encode(encoder, offset + 1, depth)?;
320            self.2.encode(encoder, offset + 8, depth)?;
321            Ok(())
322        }
323    }
324
325    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
326        for DeviceSetReportRequest
327    {
328        #[inline(always)]
329        fn new_empty() -> Self {
330            Self {
331                type_: fidl::new_empty!(fidl_fuchsia_hardware_hidbus::ReportType, D),
332                id: fidl::new_empty!(u8, D),
333                report: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D),
334            }
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            // Verify that padding bytes are zero.
346            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
347            let padval = unsafe { (ptr as *const u64).read_unaligned() };
348            let mask = 0xffffffffffff0000u64;
349            let maskedval = padval & mask;
350            if maskedval != 0 {
351                return Err(fidl::Error::NonZeroPadding {
352                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
353                });
354            }
355            fidl::decode!(
356                fidl_fuchsia_hardware_hidbus::ReportType,
357                D,
358                &mut self.type_,
359                decoder,
360                offset + 0,
361                _depth
362            )?;
363            fidl::decode!(u8, D, &mut self.id, decoder, offset + 1, _depth)?;
364            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.report, decoder, offset + 8, _depth)?;
365            Ok(())
366        }
367    }
368
369    impl fidl::encoding::ValueTypeMarker for DeviceSetTraceIdRequest {
370        type Borrowed<'a> = &'a Self;
371        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
372            value
373        }
374    }
375
376    unsafe impl fidl::encoding::TypeMarker for DeviceSetTraceIdRequest {
377        type Owned = Self;
378
379        #[inline(always)]
380        fn inline_align(_context: fidl::encoding::Context) -> usize {
381            4
382        }
383
384        #[inline(always)]
385        fn inline_size(_context: fidl::encoding::Context) -> usize {
386            4
387        }
388        #[inline(always)]
389        fn encode_is_copy() -> bool {
390            true
391        }
392
393        #[inline(always)]
394        fn decode_is_copy() -> bool {
395            true
396        }
397    }
398
399    unsafe impl<D: fidl::encoding::ResourceDialect>
400        fidl::encoding::Encode<DeviceSetTraceIdRequest, D> for &DeviceSetTraceIdRequest
401    {
402        #[inline]
403        unsafe fn encode(
404            self,
405            encoder: &mut fidl::encoding::Encoder<'_, D>,
406            offset: usize,
407            _depth: fidl::encoding::Depth,
408        ) -> fidl::Result<()> {
409            encoder.debug_check_bounds::<DeviceSetTraceIdRequest>(offset);
410            unsafe {
411                // Copy the object into the buffer.
412                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
413                (buf_ptr as *mut DeviceSetTraceIdRequest)
414                    .write_unaligned((self as *const DeviceSetTraceIdRequest).read());
415                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
416                // done second because the memcpy will write garbage to these bytes.
417            }
418            Ok(())
419        }
420    }
421    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
422        fidl::encoding::Encode<DeviceSetTraceIdRequest, D> for (T0,)
423    {
424        #[inline]
425        unsafe fn encode(
426            self,
427            encoder: &mut fidl::encoding::Encoder<'_, D>,
428            offset: usize,
429            depth: fidl::encoding::Depth,
430        ) -> fidl::Result<()> {
431            encoder.debug_check_bounds::<DeviceSetTraceIdRequest>(offset);
432            // Zero out padding regions. There's no need to apply masks
433            // because the unmasked parts will be overwritten by fields.
434            // Write the fields.
435            self.0.encode(encoder, offset + 0, depth)?;
436            Ok(())
437        }
438    }
439
440    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
441        for DeviceSetTraceIdRequest
442    {
443        #[inline(always)]
444        fn new_empty() -> Self {
445            Self { id: fidl::new_empty!(u32, D) }
446        }
447
448        #[inline]
449        unsafe fn decode(
450            &mut self,
451            decoder: &mut fidl::encoding::Decoder<'_, D>,
452            offset: usize,
453            _depth: fidl::encoding::Depth,
454        ) -> fidl::Result<()> {
455            decoder.debug_check_bounds::<Self>(offset);
456            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
457            // Verify that padding bytes are zero.
458            // Copy from the buffer into the object.
459            unsafe {
460                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
461            }
462            Ok(())
463        }
464    }
465
466    impl fidl::encoding::ValueTypeMarker for DeviceGetReportResponse {
467        type Borrowed<'a> = &'a Self;
468        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
469            value
470        }
471    }
472
473    unsafe impl fidl::encoding::TypeMarker for DeviceGetReportResponse {
474        type Owned = Self;
475
476        #[inline(always)]
477        fn inline_align(_context: fidl::encoding::Context) -> usize {
478            8
479        }
480
481        #[inline(always)]
482        fn inline_size(_context: fidl::encoding::Context) -> usize {
483            16
484        }
485    }
486
487    unsafe impl<D: fidl::encoding::ResourceDialect>
488        fidl::encoding::Encode<DeviceGetReportResponse, D> for &DeviceGetReportResponse
489    {
490        #[inline]
491        unsafe fn encode(
492            self,
493            encoder: &mut fidl::encoding::Encoder<'_, D>,
494            offset: usize,
495            _depth: fidl::encoding::Depth,
496        ) -> fidl::Result<()> {
497            encoder.debug_check_bounds::<DeviceGetReportResponse>(offset);
498            // Delegate to tuple encoding.
499            fidl::encoding::Encode::<DeviceGetReportResponse, D>::encode(
500                (<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
501                    &self.report,
502                ),),
503                encoder,
504                offset,
505                _depth,
506            )
507        }
508    }
509    unsafe impl<
510            D: fidl::encoding::ResourceDialect,
511            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
512        > fidl::encoding::Encode<DeviceGetReportResponse, D> for (T0,)
513    {
514        #[inline]
515        unsafe fn encode(
516            self,
517            encoder: &mut fidl::encoding::Encoder<'_, D>,
518            offset: usize,
519            depth: fidl::encoding::Depth,
520        ) -> fidl::Result<()> {
521            encoder.debug_check_bounds::<DeviceGetReportResponse>(offset);
522            // Zero out padding regions. There's no need to apply masks
523            // because the unmasked parts will be overwritten by fields.
524            // Write the fields.
525            self.0.encode(encoder, offset + 0, depth)?;
526            Ok(())
527        }
528    }
529
530    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
531        for DeviceGetReportResponse
532    {
533        #[inline(always)]
534        fn new_empty() -> Self {
535            Self { report: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D) }
536        }
537
538        #[inline]
539        unsafe fn decode(
540            &mut self,
541            decoder: &mut fidl::encoding::Decoder<'_, D>,
542            offset: usize,
543            _depth: fidl::encoding::Depth,
544        ) -> fidl::Result<()> {
545            decoder.debug_check_bounds::<Self>(offset);
546            // Verify that padding bytes are zero.
547            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.report, decoder, offset + 0, _depth)?;
548            Ok(())
549        }
550    }
551
552    impl fidl::encoding::ValueTypeMarker for DeviceQueryResponse {
553        type Borrowed<'a> = &'a Self;
554        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
555            value
556        }
557    }
558
559    unsafe impl fidl::encoding::TypeMarker for DeviceQueryResponse {
560        type Owned = Self;
561
562        #[inline(always)]
563        fn inline_align(_context: fidl::encoding::Context) -> usize {
564            8
565        }
566
567        #[inline(always)]
568        fn inline_size(_context: fidl::encoding::Context) -> usize {
569            16
570        }
571    }
572
573    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DeviceQueryResponse, D>
574        for &DeviceQueryResponse
575    {
576        #[inline]
577        unsafe fn encode(
578            self,
579            encoder: &mut fidl::encoding::Encoder<'_, D>,
580            offset: usize,
581            _depth: fidl::encoding::Depth,
582        ) -> fidl::Result<()> {
583            encoder.debug_check_bounds::<DeviceQueryResponse>(offset);
584            // Delegate to tuple encoding.
585            fidl::encoding::Encode::<DeviceQueryResponse, D>::encode(
586                (
587                    <fidl_fuchsia_hardware_hidbus::HidInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
588                ),
589                encoder, offset, _depth
590            )
591        }
592    }
593    unsafe impl<
594            D: fidl::encoding::ResourceDialect,
595            T0: fidl::encoding::Encode<fidl_fuchsia_hardware_hidbus::HidInfo, D>,
596        > fidl::encoding::Encode<DeviceQueryResponse, D> for (T0,)
597    {
598        #[inline]
599        unsafe fn encode(
600            self,
601            encoder: &mut fidl::encoding::Encoder<'_, D>,
602            offset: usize,
603            depth: fidl::encoding::Depth,
604        ) -> fidl::Result<()> {
605            encoder.debug_check_bounds::<DeviceQueryResponse>(offset);
606            // Zero out padding regions. There's no need to apply masks
607            // because the unmasked parts will be overwritten by fields.
608            // Write the fields.
609            self.0.encode(encoder, offset + 0, depth)?;
610            Ok(())
611        }
612    }
613
614    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeviceQueryResponse {
615        #[inline(always)]
616        fn new_empty() -> Self {
617            Self { info: fidl::new_empty!(fidl_fuchsia_hardware_hidbus::HidInfo, D) }
618        }
619
620        #[inline]
621        unsafe fn decode(
622            &mut self,
623            decoder: &mut fidl::encoding::Decoder<'_, D>,
624            offset: usize,
625            _depth: fidl::encoding::Depth,
626        ) -> fidl::Result<()> {
627            decoder.debug_check_bounds::<Self>(offset);
628            // Verify that padding bytes are zero.
629            fidl::decode!(
630                fidl_fuchsia_hardware_hidbus::HidInfo,
631                D,
632                &mut self.info,
633                decoder,
634                offset + 0,
635                _depth
636            )?;
637            Ok(())
638        }
639    }
640
641    impl fidl::encoding::ValueTypeMarker for DeviceReadReportsResponse {
642        type Borrowed<'a> = &'a Self;
643        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
644            value
645        }
646    }
647
648    unsafe impl fidl::encoding::TypeMarker for DeviceReadReportsResponse {
649        type Owned = Self;
650
651        #[inline(always)]
652        fn inline_align(_context: fidl::encoding::Context) -> usize {
653            8
654        }
655
656        #[inline(always)]
657        fn inline_size(_context: fidl::encoding::Context) -> usize {
658            16
659        }
660    }
661
662    unsafe impl<D: fidl::encoding::ResourceDialect>
663        fidl::encoding::Encode<DeviceReadReportsResponse, D> for &DeviceReadReportsResponse
664    {
665        #[inline]
666        unsafe fn encode(
667            self,
668            encoder: &mut fidl::encoding::Encoder<'_, D>,
669            offset: usize,
670            _depth: fidl::encoding::Depth,
671        ) -> fidl::Result<()> {
672            encoder.debug_check_bounds::<DeviceReadReportsResponse>(offset);
673            // Delegate to tuple encoding.
674            fidl::encoding::Encode::<DeviceReadReportsResponse, D>::encode(
675                (<fidl::encoding::Vector<u8, 8192> as fidl::encoding::ValueTypeMarker>::borrow(
676                    &self.data,
677                ),),
678                encoder,
679                offset,
680                _depth,
681            )
682        }
683    }
684    unsafe impl<
685            D: fidl::encoding::ResourceDialect,
686            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8192>, D>,
687        > fidl::encoding::Encode<DeviceReadReportsResponse, D> for (T0,)
688    {
689        #[inline]
690        unsafe fn encode(
691            self,
692            encoder: &mut fidl::encoding::Encoder<'_, D>,
693            offset: usize,
694            depth: fidl::encoding::Depth,
695        ) -> fidl::Result<()> {
696            encoder.debug_check_bounds::<DeviceReadReportsResponse>(offset);
697            // Zero out padding regions. There's no need to apply masks
698            // because the unmasked parts will be overwritten by fields.
699            // Write the fields.
700            self.0.encode(encoder, offset + 0, depth)?;
701            Ok(())
702        }
703    }
704
705    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
706        for DeviceReadReportsResponse
707    {
708        #[inline(always)]
709        fn new_empty() -> Self {
710            Self { data: fidl::new_empty!(fidl::encoding::Vector<u8, 8192>, D) }
711        }
712
713        #[inline]
714        unsafe fn decode(
715            &mut self,
716            decoder: &mut fidl::encoding::Decoder<'_, D>,
717            offset: usize,
718            _depth: fidl::encoding::Depth,
719        ) -> fidl::Result<()> {
720            decoder.debug_check_bounds::<Self>(offset);
721            // Verify that padding bytes are zero.
722            fidl::decode!(fidl::encoding::Vector<u8, 8192>, D, &mut self.data, decoder, offset + 0, _depth)?;
723            Ok(())
724        }
725    }
726}