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