fidl_fuchsia_boot__common/
fidl_fuchsia_boot__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_ARGS_COLLECT_LENGTH: u8 = 193;
12
13pub const MAX_ARGS_NAME_LENGTH: u8 = 64;
14
15pub const MAX_ARGS_VALUE_LENGTH: u8 = 128;
16
17pub const MAX_ARGS_VECTOR_LENGTH: u8 = 255;
18
19pub const MAX_FILE_NAME_LENGTH: u8 = 255;
20
21#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
22pub struct ArgumentsCollectRequest {
23    pub prefix: String,
24}
25
26impl fidl::Persistable for ArgumentsCollectRequest {}
27
28#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
29pub struct ArgumentsCollectResponse {
30    pub results: Vec<String>,
31}
32
33impl fidl::Persistable for ArgumentsCollectResponse {}
34
35#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
36pub struct ArgumentsGetBoolRequest {
37    pub key: String,
38    pub defaultval: bool,
39}
40
41impl fidl::Persistable for ArgumentsGetBoolRequest {}
42
43#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
44pub struct ArgumentsGetBoolResponse {
45    pub value: bool,
46}
47
48impl fidl::Persistable for ArgumentsGetBoolResponse {}
49
50#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
51pub struct ArgumentsGetBoolsRequest {
52    pub keys: Vec<BoolPair>,
53}
54
55impl fidl::Persistable for ArgumentsGetBoolsRequest {}
56
57#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
58pub struct ArgumentsGetBoolsResponse {
59    pub values: Vec<bool>,
60}
61
62impl fidl::Persistable for ArgumentsGetBoolsResponse {}
63
64#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
65pub struct ArgumentsGetStringRequest {
66    pub key: String,
67}
68
69impl fidl::Persistable for ArgumentsGetStringRequest {}
70
71#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
72pub struct ArgumentsGetStringResponse {
73    pub value: Option<String>,
74}
75
76impl fidl::Persistable for ArgumentsGetStringResponse {}
77
78#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
79pub struct ArgumentsGetStringsRequest {
80    pub keys: Vec<String>,
81}
82
83impl fidl::Persistable for ArgumentsGetStringsRequest {}
84
85#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
86pub struct ArgumentsGetStringsResponse {
87    pub values: Vec<Option<String>>,
88}
89
90impl fidl::Persistable for ArgumentsGetStringsResponse {}
91
92#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
93pub struct BoolPair {
94    pub key: String,
95    pub defaultval: bool,
96}
97
98impl fidl::Persistable for BoolPair {}
99
100#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
101#[repr(C)]
102pub struct Extra {
103    pub n: u32,
104}
105
106impl fidl::Persistable for Extra {}
107
108#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
109#[repr(C)]
110pub struct FactoryItemsGetRequest {
111    pub extra: u32,
112}
113
114impl fidl::Persistable for FactoryItemsGetRequest {}
115
116#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
117pub struct ItemsGet2Request {
118    pub type_: u32,
119    pub extra: Option<Box<Extra>>,
120}
121
122impl fidl::Persistable for ItemsGet2Request {}
123
124#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
125pub struct ItemsGetBootloaderFileRequest {
126    pub filename: String,
127}
128
129impl fidl::Persistable for ItemsGetBootloaderFileRequest {}
130
131#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
132#[repr(C)]
133pub struct ItemsGetRequest {
134    pub type_: u32,
135    pub extra: u32,
136}
137
138impl fidl::Persistable for ItemsGetRequest {}
139
140pub mod arguments_ordinals {
141    pub const GET_STRING: u64 = 0x426c026d966f8fe;
142    pub const GET_STRINGS: u64 = 0x328fb6b545aa96f7;
143    pub const GET_BOOL: u64 = 0x4c5dd3149815cccd;
144    pub const GET_BOOLS: u64 = 0xfcc9fc9a0f22615;
145    pub const COLLECT: u64 = 0x24e5acd864546e30;
146}
147
148pub mod factory_items_ordinals {
149    pub const GET: u64 = 0x2f0dcb1aba41b6d9;
150}
151
152pub mod items_ordinals {
153    pub const GET: u64 = 0x542db3f176641edc;
154    pub const GET2: u64 = 0x2a64bd32f9ba3f2e;
155    pub const GET_BOOTLOADER_FILE: u64 = 0x5a004db3c9378e8c;
156}
157
158pub mod read_only_log_ordinals {
159    pub const GET: u64 = 0x6f3ceba5eca871ff;
160}
161
162pub mod svc_stash_ordinals {
163    pub const STORE: u64 = 0xc2648e356ca2870;
164}
165
166pub mod svc_stash_provider_ordinals {
167    pub const GET: u64 = 0x3885bad5b734f883;
168}
169
170pub mod userboot_ordinals {
171    pub const POST_BOOTFS_FILES: u64 = 0x296d4420db7cc694;
172    pub const POST_STASH_SVC: u64 = 0x506ecf7db01adeac;
173}
174
175pub mod write_only_log_ordinals {
176    pub const GET: u64 = 0x4579dac289d3007;
177}
178
179mod internal {
180    use super::*;
181
182    impl fidl::encoding::ValueTypeMarker for ArgumentsCollectRequest {
183        type Borrowed<'a> = &'a Self;
184        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
185            value
186        }
187    }
188
189    unsafe impl fidl::encoding::TypeMarker for ArgumentsCollectRequest {
190        type Owned = Self;
191
192        #[inline(always)]
193        fn inline_align(_context: fidl::encoding::Context) -> usize {
194            8
195        }
196
197        #[inline(always)]
198        fn inline_size(_context: fidl::encoding::Context) -> usize {
199            16
200        }
201    }
202
203    unsafe impl<D: fidl::encoding::ResourceDialect>
204        fidl::encoding::Encode<ArgumentsCollectRequest, D> for &ArgumentsCollectRequest
205    {
206        #[inline]
207        unsafe fn encode(
208            self,
209            encoder: &mut fidl::encoding::Encoder<'_, D>,
210            offset: usize,
211            _depth: fidl::encoding::Depth,
212        ) -> fidl::Result<()> {
213            encoder.debug_check_bounds::<ArgumentsCollectRequest>(offset);
214            // Delegate to tuple encoding.
215            fidl::encoding::Encode::<ArgumentsCollectRequest, D>::encode(
216                (<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
217                    &self.prefix,
218                ),),
219                encoder,
220                offset,
221                _depth,
222            )
223        }
224    }
225    unsafe impl<
226            D: fidl::encoding::ResourceDialect,
227            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
228        > fidl::encoding::Encode<ArgumentsCollectRequest, D> for (T0,)
229    {
230        #[inline]
231        unsafe fn encode(
232            self,
233            encoder: &mut fidl::encoding::Encoder<'_, D>,
234            offset: usize,
235            depth: fidl::encoding::Depth,
236        ) -> fidl::Result<()> {
237            encoder.debug_check_bounds::<ArgumentsCollectRequest>(offset);
238            // Zero out padding regions. There's no need to apply masks
239            // because the unmasked parts will be overwritten by fields.
240            // Write the fields.
241            self.0.encode(encoder, offset + 0, depth)?;
242            Ok(())
243        }
244    }
245
246    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
247        for ArgumentsCollectRequest
248    {
249        #[inline(always)]
250        fn new_empty() -> Self {
251            Self { prefix: fidl::new_empty!(fidl::encoding::BoundedString<64>, D) }
252        }
253
254        #[inline]
255        unsafe fn decode(
256            &mut self,
257            decoder: &mut fidl::encoding::Decoder<'_, D>,
258            offset: usize,
259            _depth: fidl::encoding::Depth,
260        ) -> fidl::Result<()> {
261            decoder.debug_check_bounds::<Self>(offset);
262            // Verify that padding bytes are zero.
263            fidl::decode!(
264                fidl::encoding::BoundedString<64>,
265                D,
266                &mut self.prefix,
267                decoder,
268                offset + 0,
269                _depth
270            )?;
271            Ok(())
272        }
273    }
274
275    impl fidl::encoding::ValueTypeMarker for ArgumentsCollectResponse {
276        type Borrowed<'a> = &'a Self;
277        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
278            value
279        }
280    }
281
282    unsafe impl fidl::encoding::TypeMarker for ArgumentsCollectResponse {
283        type Owned = Self;
284
285        #[inline(always)]
286        fn inline_align(_context: fidl::encoding::Context) -> usize {
287            8
288        }
289
290        #[inline(always)]
291        fn inline_size(_context: fidl::encoding::Context) -> usize {
292            16
293        }
294    }
295
296    unsafe impl<D: fidl::encoding::ResourceDialect>
297        fidl::encoding::Encode<ArgumentsCollectResponse, D> for &ArgumentsCollectResponse
298    {
299        #[inline]
300        unsafe fn encode(
301            self,
302            encoder: &mut fidl::encoding::Encoder<'_, D>,
303            offset: usize,
304            _depth: fidl::encoding::Depth,
305        ) -> fidl::Result<()> {
306            encoder.debug_check_bounds::<ArgumentsCollectResponse>(offset);
307            // Delegate to tuple encoding.
308            fidl::encoding::Encode::<ArgumentsCollectResponse, D>::encode(
309                (
310                    <fidl::encoding::Vector<fidl::encoding::BoundedString<193>, 255> as fidl::encoding::ValueTypeMarker>::borrow(&self.results),
311                ),
312                encoder, offset, _depth
313            )
314        }
315    }
316    unsafe impl<
317            D: fidl::encoding::ResourceDialect,
318            T0: fidl::encoding::Encode<
319                fidl::encoding::Vector<fidl::encoding::BoundedString<193>, 255>,
320                D,
321            >,
322        > fidl::encoding::Encode<ArgumentsCollectResponse, D> for (T0,)
323    {
324        #[inline]
325        unsafe fn encode(
326            self,
327            encoder: &mut fidl::encoding::Encoder<'_, D>,
328            offset: usize,
329            depth: fidl::encoding::Depth,
330        ) -> fidl::Result<()> {
331            encoder.debug_check_bounds::<ArgumentsCollectResponse>(offset);
332            // Zero out padding regions. There's no need to apply masks
333            // because the unmasked parts will be overwritten by fields.
334            // Write the fields.
335            self.0.encode(encoder, offset + 0, depth)?;
336            Ok(())
337        }
338    }
339
340    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
341        for ArgumentsCollectResponse
342    {
343        #[inline(always)]
344        fn new_empty() -> Self {
345            Self {
346                results: fidl::new_empty!(
347                    fidl::encoding::Vector<fidl::encoding::BoundedString<193>, 255>,
348                    D
349                ),
350            }
351        }
352
353        #[inline]
354        unsafe fn decode(
355            &mut self,
356            decoder: &mut fidl::encoding::Decoder<'_, D>,
357            offset: usize,
358            _depth: fidl::encoding::Depth,
359        ) -> fidl::Result<()> {
360            decoder.debug_check_bounds::<Self>(offset);
361            // Verify that padding bytes are zero.
362            fidl::decode!(
363                fidl::encoding::Vector<fidl::encoding::BoundedString<193>, 255>,
364                D,
365                &mut self.results,
366                decoder,
367                offset + 0,
368                _depth
369            )?;
370            Ok(())
371        }
372    }
373
374    impl fidl::encoding::ValueTypeMarker for ArgumentsGetBoolRequest {
375        type Borrowed<'a> = &'a Self;
376        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
377            value
378        }
379    }
380
381    unsafe impl fidl::encoding::TypeMarker for ArgumentsGetBoolRequest {
382        type Owned = Self;
383
384        #[inline(always)]
385        fn inline_align(_context: fidl::encoding::Context) -> usize {
386            8
387        }
388
389        #[inline(always)]
390        fn inline_size(_context: fidl::encoding::Context) -> usize {
391            24
392        }
393    }
394
395    unsafe impl<D: fidl::encoding::ResourceDialect>
396        fidl::encoding::Encode<ArgumentsGetBoolRequest, D> for &ArgumentsGetBoolRequest
397    {
398        #[inline]
399        unsafe fn encode(
400            self,
401            encoder: &mut fidl::encoding::Encoder<'_, D>,
402            offset: usize,
403            _depth: fidl::encoding::Depth,
404        ) -> fidl::Result<()> {
405            encoder.debug_check_bounds::<ArgumentsGetBoolRequest>(offset);
406            // Delegate to tuple encoding.
407            fidl::encoding::Encode::<ArgumentsGetBoolRequest, D>::encode(
408                (
409                    <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
410                        &self.key,
411                    ),
412                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.defaultval),
413                ),
414                encoder,
415                offset,
416                _depth,
417            )
418        }
419    }
420    unsafe impl<
421            D: fidl::encoding::ResourceDialect,
422            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
423            T1: fidl::encoding::Encode<bool, D>,
424        > fidl::encoding::Encode<ArgumentsGetBoolRequest, D> for (T0, T1)
425    {
426        #[inline]
427        unsafe fn encode(
428            self,
429            encoder: &mut fidl::encoding::Encoder<'_, D>,
430            offset: usize,
431            depth: fidl::encoding::Depth,
432        ) -> fidl::Result<()> {
433            encoder.debug_check_bounds::<ArgumentsGetBoolRequest>(offset);
434            // Zero out padding regions. There's no need to apply masks
435            // because the unmasked parts will be overwritten by fields.
436            unsafe {
437                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
438                (ptr as *mut u64).write_unaligned(0);
439            }
440            // Write the fields.
441            self.0.encode(encoder, offset + 0, depth)?;
442            self.1.encode(encoder, offset + 16, depth)?;
443            Ok(())
444        }
445    }
446
447    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
448        for ArgumentsGetBoolRequest
449    {
450        #[inline(always)]
451        fn new_empty() -> Self {
452            Self {
453                key: fidl::new_empty!(fidl::encoding::BoundedString<64>, D),
454                defaultval: fidl::new_empty!(bool, D),
455            }
456        }
457
458        #[inline]
459        unsafe fn decode(
460            &mut self,
461            decoder: &mut fidl::encoding::Decoder<'_, D>,
462            offset: usize,
463            _depth: fidl::encoding::Depth,
464        ) -> fidl::Result<()> {
465            decoder.debug_check_bounds::<Self>(offset);
466            // Verify that padding bytes are zero.
467            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
468            let padval = unsafe { (ptr as *const u64).read_unaligned() };
469            let mask = 0xffffffffffffff00u64;
470            let maskedval = padval & mask;
471            if maskedval != 0 {
472                return Err(fidl::Error::NonZeroPadding {
473                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
474                });
475            }
476            fidl::decode!(
477                fidl::encoding::BoundedString<64>,
478                D,
479                &mut self.key,
480                decoder,
481                offset + 0,
482                _depth
483            )?;
484            fidl::decode!(bool, D, &mut self.defaultval, decoder, offset + 16, _depth)?;
485            Ok(())
486        }
487    }
488
489    impl fidl::encoding::ValueTypeMarker for ArgumentsGetBoolResponse {
490        type Borrowed<'a> = &'a Self;
491        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
492            value
493        }
494    }
495
496    unsafe impl fidl::encoding::TypeMarker for ArgumentsGetBoolResponse {
497        type Owned = Self;
498
499        #[inline(always)]
500        fn inline_align(_context: fidl::encoding::Context) -> usize {
501            1
502        }
503
504        #[inline(always)]
505        fn inline_size(_context: fidl::encoding::Context) -> usize {
506            1
507        }
508    }
509
510    unsafe impl<D: fidl::encoding::ResourceDialect>
511        fidl::encoding::Encode<ArgumentsGetBoolResponse, D> for &ArgumentsGetBoolResponse
512    {
513        #[inline]
514        unsafe fn encode(
515            self,
516            encoder: &mut fidl::encoding::Encoder<'_, D>,
517            offset: usize,
518            _depth: fidl::encoding::Depth,
519        ) -> fidl::Result<()> {
520            encoder.debug_check_bounds::<ArgumentsGetBoolResponse>(offset);
521            // Delegate to tuple encoding.
522            fidl::encoding::Encode::<ArgumentsGetBoolResponse, D>::encode(
523                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.value),),
524                encoder,
525                offset,
526                _depth,
527            )
528        }
529    }
530    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
531        fidl::encoding::Encode<ArgumentsGetBoolResponse, D> for (T0,)
532    {
533        #[inline]
534        unsafe fn encode(
535            self,
536            encoder: &mut fidl::encoding::Encoder<'_, D>,
537            offset: usize,
538            depth: fidl::encoding::Depth,
539        ) -> fidl::Result<()> {
540            encoder.debug_check_bounds::<ArgumentsGetBoolResponse>(offset);
541            // Zero out padding regions. There's no need to apply masks
542            // because the unmasked parts will be overwritten by fields.
543            // Write the fields.
544            self.0.encode(encoder, offset + 0, depth)?;
545            Ok(())
546        }
547    }
548
549    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
550        for ArgumentsGetBoolResponse
551    {
552        #[inline(always)]
553        fn new_empty() -> Self {
554            Self { value: fidl::new_empty!(bool, D) }
555        }
556
557        #[inline]
558        unsafe fn decode(
559            &mut self,
560            decoder: &mut fidl::encoding::Decoder<'_, D>,
561            offset: usize,
562            _depth: fidl::encoding::Depth,
563        ) -> fidl::Result<()> {
564            decoder.debug_check_bounds::<Self>(offset);
565            // Verify that padding bytes are zero.
566            fidl::decode!(bool, D, &mut self.value, decoder, offset + 0, _depth)?;
567            Ok(())
568        }
569    }
570
571    impl fidl::encoding::ValueTypeMarker for ArgumentsGetBoolsRequest {
572        type Borrowed<'a> = &'a Self;
573        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
574            value
575        }
576    }
577
578    unsafe impl fidl::encoding::TypeMarker for ArgumentsGetBoolsRequest {
579        type Owned = Self;
580
581        #[inline(always)]
582        fn inline_align(_context: fidl::encoding::Context) -> usize {
583            8
584        }
585
586        #[inline(always)]
587        fn inline_size(_context: fidl::encoding::Context) -> usize {
588            16
589        }
590    }
591
592    unsafe impl<D: fidl::encoding::ResourceDialect>
593        fidl::encoding::Encode<ArgumentsGetBoolsRequest, D> for &ArgumentsGetBoolsRequest
594    {
595        #[inline]
596        unsafe fn encode(
597            self,
598            encoder: &mut fidl::encoding::Encoder<'_, D>,
599            offset: usize,
600            _depth: fidl::encoding::Depth,
601        ) -> fidl::Result<()> {
602            encoder.debug_check_bounds::<ArgumentsGetBoolsRequest>(offset);
603            // Delegate to tuple encoding.
604            fidl::encoding::Encode::<ArgumentsGetBoolsRequest, D>::encode(
605                (
606                    <fidl::encoding::Vector<BoolPair, 255> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
607                ),
608                encoder, offset, _depth
609            )
610        }
611    }
612    unsafe impl<
613            D: fidl::encoding::ResourceDialect,
614            T0: fidl::encoding::Encode<fidl::encoding::Vector<BoolPair, 255>, D>,
615        > fidl::encoding::Encode<ArgumentsGetBoolsRequest, D> for (T0,)
616    {
617        #[inline]
618        unsafe fn encode(
619            self,
620            encoder: &mut fidl::encoding::Encoder<'_, D>,
621            offset: usize,
622            depth: fidl::encoding::Depth,
623        ) -> fidl::Result<()> {
624            encoder.debug_check_bounds::<ArgumentsGetBoolsRequest>(offset);
625            // Zero out padding regions. There's no need to apply masks
626            // because the unmasked parts will be overwritten by fields.
627            // Write the fields.
628            self.0.encode(encoder, offset + 0, depth)?;
629            Ok(())
630        }
631    }
632
633    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
634        for ArgumentsGetBoolsRequest
635    {
636        #[inline(always)]
637        fn new_empty() -> Self {
638            Self { keys: fidl::new_empty!(fidl::encoding::Vector<BoolPair, 255>, D) }
639        }
640
641        #[inline]
642        unsafe fn decode(
643            &mut self,
644            decoder: &mut fidl::encoding::Decoder<'_, D>,
645            offset: usize,
646            _depth: fidl::encoding::Depth,
647        ) -> fidl::Result<()> {
648            decoder.debug_check_bounds::<Self>(offset);
649            // Verify that padding bytes are zero.
650            fidl::decode!(fidl::encoding::Vector<BoolPair, 255>, D, &mut self.keys, decoder, offset + 0, _depth)?;
651            Ok(())
652        }
653    }
654
655    impl fidl::encoding::ValueTypeMarker for ArgumentsGetBoolsResponse {
656        type Borrowed<'a> = &'a Self;
657        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
658            value
659        }
660    }
661
662    unsafe impl fidl::encoding::TypeMarker for ArgumentsGetBoolsResponse {
663        type Owned = Self;
664
665        #[inline(always)]
666        fn inline_align(_context: fidl::encoding::Context) -> usize {
667            8
668        }
669
670        #[inline(always)]
671        fn inline_size(_context: fidl::encoding::Context) -> usize {
672            16
673        }
674    }
675
676    unsafe impl<D: fidl::encoding::ResourceDialect>
677        fidl::encoding::Encode<ArgumentsGetBoolsResponse, D> for &ArgumentsGetBoolsResponse
678    {
679        #[inline]
680        unsafe fn encode(
681            self,
682            encoder: &mut fidl::encoding::Encoder<'_, D>,
683            offset: usize,
684            _depth: fidl::encoding::Depth,
685        ) -> fidl::Result<()> {
686            encoder.debug_check_bounds::<ArgumentsGetBoolsResponse>(offset);
687            // Delegate to tuple encoding.
688            fidl::encoding::Encode::<ArgumentsGetBoolsResponse, D>::encode(
689                (<fidl::encoding::Vector<bool, 255> as fidl::encoding::ValueTypeMarker>::borrow(
690                    &self.values,
691                ),),
692                encoder,
693                offset,
694                _depth,
695            )
696        }
697    }
698    unsafe impl<
699            D: fidl::encoding::ResourceDialect,
700            T0: fidl::encoding::Encode<fidl::encoding::Vector<bool, 255>, D>,
701        > fidl::encoding::Encode<ArgumentsGetBoolsResponse, D> for (T0,)
702    {
703        #[inline]
704        unsafe fn encode(
705            self,
706            encoder: &mut fidl::encoding::Encoder<'_, D>,
707            offset: usize,
708            depth: fidl::encoding::Depth,
709        ) -> fidl::Result<()> {
710            encoder.debug_check_bounds::<ArgumentsGetBoolsResponse>(offset);
711            // Zero out padding regions. There's no need to apply masks
712            // because the unmasked parts will be overwritten by fields.
713            // Write the fields.
714            self.0.encode(encoder, offset + 0, depth)?;
715            Ok(())
716        }
717    }
718
719    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
720        for ArgumentsGetBoolsResponse
721    {
722        #[inline(always)]
723        fn new_empty() -> Self {
724            Self { values: fidl::new_empty!(fidl::encoding::Vector<bool, 255>, D) }
725        }
726
727        #[inline]
728        unsafe fn decode(
729            &mut self,
730            decoder: &mut fidl::encoding::Decoder<'_, D>,
731            offset: usize,
732            _depth: fidl::encoding::Depth,
733        ) -> fidl::Result<()> {
734            decoder.debug_check_bounds::<Self>(offset);
735            // Verify that padding bytes are zero.
736            fidl::decode!(fidl::encoding::Vector<bool, 255>, D, &mut self.values, decoder, offset + 0, _depth)?;
737            Ok(())
738        }
739    }
740
741    impl fidl::encoding::ValueTypeMarker for ArgumentsGetStringRequest {
742        type Borrowed<'a> = &'a Self;
743        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
744            value
745        }
746    }
747
748    unsafe impl fidl::encoding::TypeMarker for ArgumentsGetStringRequest {
749        type Owned = Self;
750
751        #[inline(always)]
752        fn inline_align(_context: fidl::encoding::Context) -> usize {
753            8
754        }
755
756        #[inline(always)]
757        fn inline_size(_context: fidl::encoding::Context) -> usize {
758            16
759        }
760    }
761
762    unsafe impl<D: fidl::encoding::ResourceDialect>
763        fidl::encoding::Encode<ArgumentsGetStringRequest, D> for &ArgumentsGetStringRequest
764    {
765        #[inline]
766        unsafe fn encode(
767            self,
768            encoder: &mut fidl::encoding::Encoder<'_, D>,
769            offset: usize,
770            _depth: fidl::encoding::Depth,
771        ) -> fidl::Result<()> {
772            encoder.debug_check_bounds::<ArgumentsGetStringRequest>(offset);
773            // Delegate to tuple encoding.
774            fidl::encoding::Encode::<ArgumentsGetStringRequest, D>::encode(
775                (<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
776                    &self.key,
777                ),),
778                encoder,
779                offset,
780                _depth,
781            )
782        }
783    }
784    unsafe impl<
785            D: fidl::encoding::ResourceDialect,
786            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
787        > fidl::encoding::Encode<ArgumentsGetStringRequest, D> for (T0,)
788    {
789        #[inline]
790        unsafe fn encode(
791            self,
792            encoder: &mut fidl::encoding::Encoder<'_, D>,
793            offset: usize,
794            depth: fidl::encoding::Depth,
795        ) -> fidl::Result<()> {
796            encoder.debug_check_bounds::<ArgumentsGetStringRequest>(offset);
797            // Zero out padding regions. There's no need to apply masks
798            // because the unmasked parts will be overwritten by fields.
799            // Write the fields.
800            self.0.encode(encoder, offset + 0, depth)?;
801            Ok(())
802        }
803    }
804
805    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
806        for ArgumentsGetStringRequest
807    {
808        #[inline(always)]
809        fn new_empty() -> Self {
810            Self { key: fidl::new_empty!(fidl::encoding::BoundedString<64>, D) }
811        }
812
813        #[inline]
814        unsafe fn decode(
815            &mut self,
816            decoder: &mut fidl::encoding::Decoder<'_, D>,
817            offset: usize,
818            _depth: fidl::encoding::Depth,
819        ) -> fidl::Result<()> {
820            decoder.debug_check_bounds::<Self>(offset);
821            // Verify that padding bytes are zero.
822            fidl::decode!(
823                fidl::encoding::BoundedString<64>,
824                D,
825                &mut self.key,
826                decoder,
827                offset + 0,
828                _depth
829            )?;
830            Ok(())
831        }
832    }
833
834    impl fidl::encoding::ValueTypeMarker for ArgumentsGetStringResponse {
835        type Borrowed<'a> = &'a Self;
836        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
837            value
838        }
839    }
840
841    unsafe impl fidl::encoding::TypeMarker for ArgumentsGetStringResponse {
842        type Owned = Self;
843
844        #[inline(always)]
845        fn inline_align(_context: fidl::encoding::Context) -> usize {
846            8
847        }
848
849        #[inline(always)]
850        fn inline_size(_context: fidl::encoding::Context) -> usize {
851            16
852        }
853    }
854
855    unsafe impl<D: fidl::encoding::ResourceDialect>
856        fidl::encoding::Encode<ArgumentsGetStringResponse, D> for &ArgumentsGetStringResponse
857    {
858        #[inline]
859        unsafe fn encode(
860            self,
861            encoder: &mut fidl::encoding::Encoder<'_, D>,
862            offset: usize,
863            _depth: fidl::encoding::Depth,
864        ) -> fidl::Result<()> {
865            encoder.debug_check_bounds::<ArgumentsGetStringResponse>(offset);
866            // Delegate to tuple encoding.
867            fidl::encoding::Encode::<ArgumentsGetStringResponse, D>::encode(
868                (
869                    <fidl::encoding::Optional<fidl::encoding::BoundedString<128>> as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
870                ),
871                encoder, offset, _depth
872            )
873        }
874    }
875    unsafe impl<
876            D: fidl::encoding::ResourceDialect,
877            T0: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::BoundedString<128>>, D>,
878        > fidl::encoding::Encode<ArgumentsGetStringResponse, D> for (T0,)
879    {
880        #[inline]
881        unsafe fn encode(
882            self,
883            encoder: &mut fidl::encoding::Encoder<'_, D>,
884            offset: usize,
885            depth: fidl::encoding::Depth,
886        ) -> fidl::Result<()> {
887            encoder.debug_check_bounds::<ArgumentsGetStringResponse>(offset);
888            // Zero out padding regions. There's no need to apply masks
889            // because the unmasked parts will be overwritten by fields.
890            // Write the fields.
891            self.0.encode(encoder, offset + 0, depth)?;
892            Ok(())
893        }
894    }
895
896    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
897        for ArgumentsGetStringResponse
898    {
899        #[inline(always)]
900        fn new_empty() -> Self {
901            Self {
902                value: fidl::new_empty!(
903                    fidl::encoding::Optional<fidl::encoding::BoundedString<128>>,
904                    D
905                ),
906            }
907        }
908
909        #[inline]
910        unsafe fn decode(
911            &mut self,
912            decoder: &mut fidl::encoding::Decoder<'_, D>,
913            offset: usize,
914            _depth: fidl::encoding::Depth,
915        ) -> fidl::Result<()> {
916            decoder.debug_check_bounds::<Self>(offset);
917            // Verify that padding bytes are zero.
918            fidl::decode!(
919                fidl::encoding::Optional<fidl::encoding::BoundedString<128>>,
920                D,
921                &mut self.value,
922                decoder,
923                offset + 0,
924                _depth
925            )?;
926            Ok(())
927        }
928    }
929
930    impl fidl::encoding::ValueTypeMarker for ArgumentsGetStringsRequest {
931        type Borrowed<'a> = &'a Self;
932        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
933            value
934        }
935    }
936
937    unsafe impl fidl::encoding::TypeMarker for ArgumentsGetStringsRequest {
938        type Owned = Self;
939
940        #[inline(always)]
941        fn inline_align(_context: fidl::encoding::Context) -> usize {
942            8
943        }
944
945        #[inline(always)]
946        fn inline_size(_context: fidl::encoding::Context) -> usize {
947            16
948        }
949    }
950
951    unsafe impl<D: fidl::encoding::ResourceDialect>
952        fidl::encoding::Encode<ArgumentsGetStringsRequest, D> for &ArgumentsGetStringsRequest
953    {
954        #[inline]
955        unsafe fn encode(
956            self,
957            encoder: &mut fidl::encoding::Encoder<'_, D>,
958            offset: usize,
959            _depth: fidl::encoding::Depth,
960        ) -> fidl::Result<()> {
961            encoder.debug_check_bounds::<ArgumentsGetStringsRequest>(offset);
962            // Delegate to tuple encoding.
963            fidl::encoding::Encode::<ArgumentsGetStringsRequest, D>::encode(
964                (
965                    <fidl::encoding::Vector<fidl::encoding::BoundedString<64>, 255> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
966                ),
967                encoder, offset, _depth
968            )
969        }
970    }
971    unsafe impl<
972            D: fidl::encoding::ResourceDialect,
973            T0: fidl::encoding::Encode<
974                fidl::encoding::Vector<fidl::encoding::BoundedString<64>, 255>,
975                D,
976            >,
977        > fidl::encoding::Encode<ArgumentsGetStringsRequest, D> for (T0,)
978    {
979        #[inline]
980        unsafe fn encode(
981            self,
982            encoder: &mut fidl::encoding::Encoder<'_, D>,
983            offset: usize,
984            depth: fidl::encoding::Depth,
985        ) -> fidl::Result<()> {
986            encoder.debug_check_bounds::<ArgumentsGetStringsRequest>(offset);
987            // Zero out padding regions. There's no need to apply masks
988            // because the unmasked parts will be overwritten by fields.
989            // Write the fields.
990            self.0.encode(encoder, offset + 0, depth)?;
991            Ok(())
992        }
993    }
994
995    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
996        for ArgumentsGetStringsRequest
997    {
998        #[inline(always)]
999        fn new_empty() -> Self {
1000            Self {
1001                keys: fidl::new_empty!(
1002                    fidl::encoding::Vector<fidl::encoding::BoundedString<64>, 255>,
1003                    D
1004                ),
1005            }
1006        }
1007
1008        #[inline]
1009        unsafe fn decode(
1010            &mut self,
1011            decoder: &mut fidl::encoding::Decoder<'_, D>,
1012            offset: usize,
1013            _depth: fidl::encoding::Depth,
1014        ) -> fidl::Result<()> {
1015            decoder.debug_check_bounds::<Self>(offset);
1016            // Verify that padding bytes are zero.
1017            fidl::decode!(
1018                fidl::encoding::Vector<fidl::encoding::BoundedString<64>, 255>,
1019                D,
1020                &mut self.keys,
1021                decoder,
1022                offset + 0,
1023                _depth
1024            )?;
1025            Ok(())
1026        }
1027    }
1028
1029    impl fidl::encoding::ValueTypeMarker for ArgumentsGetStringsResponse {
1030        type Borrowed<'a> = &'a Self;
1031        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1032            value
1033        }
1034    }
1035
1036    unsafe impl fidl::encoding::TypeMarker for ArgumentsGetStringsResponse {
1037        type Owned = Self;
1038
1039        #[inline(always)]
1040        fn inline_align(_context: fidl::encoding::Context) -> usize {
1041            8
1042        }
1043
1044        #[inline(always)]
1045        fn inline_size(_context: fidl::encoding::Context) -> usize {
1046            16
1047        }
1048    }
1049
1050    unsafe impl<D: fidl::encoding::ResourceDialect>
1051        fidl::encoding::Encode<ArgumentsGetStringsResponse, D> for &ArgumentsGetStringsResponse
1052    {
1053        #[inline]
1054        unsafe fn encode(
1055            self,
1056            encoder: &mut fidl::encoding::Encoder<'_, D>,
1057            offset: usize,
1058            _depth: fidl::encoding::Depth,
1059        ) -> fidl::Result<()> {
1060            encoder.debug_check_bounds::<ArgumentsGetStringsResponse>(offset);
1061            // Delegate to tuple encoding.
1062            fidl::encoding::Encode::<ArgumentsGetStringsResponse, D>::encode(
1063                (<fidl::encoding::Vector<
1064                    fidl::encoding::Optional<fidl::encoding::BoundedString<128>>,
1065                    255,
1066                > as fidl::encoding::ValueTypeMarker>::borrow(&self.values),),
1067                encoder,
1068                offset,
1069                _depth,
1070            )
1071        }
1072    }
1073    unsafe impl<
1074            D: fidl::encoding::ResourceDialect,
1075            T0: fidl::encoding::Encode<
1076                fidl::encoding::Vector<
1077                    fidl::encoding::Optional<fidl::encoding::BoundedString<128>>,
1078                    255,
1079                >,
1080                D,
1081            >,
1082        > fidl::encoding::Encode<ArgumentsGetStringsResponse, D> for (T0,)
1083    {
1084        #[inline]
1085        unsafe fn encode(
1086            self,
1087            encoder: &mut fidl::encoding::Encoder<'_, D>,
1088            offset: usize,
1089            depth: fidl::encoding::Depth,
1090        ) -> fidl::Result<()> {
1091            encoder.debug_check_bounds::<ArgumentsGetStringsResponse>(offset);
1092            // Zero out padding regions. There's no need to apply masks
1093            // because the unmasked parts will be overwritten by fields.
1094            // Write the fields.
1095            self.0.encode(encoder, offset + 0, depth)?;
1096            Ok(())
1097        }
1098    }
1099
1100    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1101        for ArgumentsGetStringsResponse
1102    {
1103        #[inline(always)]
1104        fn new_empty() -> Self {
1105            Self {
1106                values: fidl::new_empty!(
1107                    fidl::encoding::Vector<
1108                        fidl::encoding::Optional<fidl::encoding::BoundedString<128>>,
1109                        255,
1110                    >,
1111                    D
1112                ),
1113            }
1114        }
1115
1116        #[inline]
1117        unsafe fn decode(
1118            &mut self,
1119            decoder: &mut fidl::encoding::Decoder<'_, D>,
1120            offset: usize,
1121            _depth: fidl::encoding::Depth,
1122        ) -> fidl::Result<()> {
1123            decoder.debug_check_bounds::<Self>(offset);
1124            // Verify that padding bytes are zero.
1125            fidl::decode!(
1126                fidl::encoding::Vector<
1127                    fidl::encoding::Optional<fidl::encoding::BoundedString<128>>,
1128                    255,
1129                >,
1130                D,
1131                &mut self.values,
1132                decoder,
1133                offset + 0,
1134                _depth
1135            )?;
1136            Ok(())
1137        }
1138    }
1139
1140    impl fidl::encoding::ValueTypeMarker for BoolPair {
1141        type Borrowed<'a> = &'a Self;
1142        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1143            value
1144        }
1145    }
1146
1147    unsafe impl fidl::encoding::TypeMarker for BoolPair {
1148        type Owned = Self;
1149
1150        #[inline(always)]
1151        fn inline_align(_context: fidl::encoding::Context) -> usize {
1152            8
1153        }
1154
1155        #[inline(always)]
1156        fn inline_size(_context: fidl::encoding::Context) -> usize {
1157            24
1158        }
1159    }
1160
1161    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BoolPair, D> for &BoolPair {
1162        #[inline]
1163        unsafe fn encode(
1164            self,
1165            encoder: &mut fidl::encoding::Encoder<'_, D>,
1166            offset: usize,
1167            _depth: fidl::encoding::Depth,
1168        ) -> fidl::Result<()> {
1169            encoder.debug_check_bounds::<BoolPair>(offset);
1170            // Delegate to tuple encoding.
1171            fidl::encoding::Encode::<BoolPair, D>::encode(
1172                (
1173                    <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
1174                        &self.key,
1175                    ),
1176                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.defaultval),
1177                ),
1178                encoder,
1179                offset,
1180                _depth,
1181            )
1182        }
1183    }
1184    unsafe impl<
1185            D: fidl::encoding::ResourceDialect,
1186            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
1187            T1: fidl::encoding::Encode<bool, D>,
1188        > fidl::encoding::Encode<BoolPair, D> for (T0, T1)
1189    {
1190        #[inline]
1191        unsafe fn encode(
1192            self,
1193            encoder: &mut fidl::encoding::Encoder<'_, D>,
1194            offset: usize,
1195            depth: fidl::encoding::Depth,
1196        ) -> fidl::Result<()> {
1197            encoder.debug_check_bounds::<BoolPair>(offset);
1198            // Zero out padding regions. There's no need to apply masks
1199            // because the unmasked parts will be overwritten by fields.
1200            unsafe {
1201                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
1202                (ptr as *mut u64).write_unaligned(0);
1203            }
1204            // Write the fields.
1205            self.0.encode(encoder, offset + 0, depth)?;
1206            self.1.encode(encoder, offset + 16, depth)?;
1207            Ok(())
1208        }
1209    }
1210
1211    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BoolPair {
1212        #[inline(always)]
1213        fn new_empty() -> Self {
1214            Self {
1215                key: fidl::new_empty!(fidl::encoding::BoundedString<64>, D),
1216                defaultval: fidl::new_empty!(bool, D),
1217            }
1218        }
1219
1220        #[inline]
1221        unsafe fn decode(
1222            &mut self,
1223            decoder: &mut fidl::encoding::Decoder<'_, D>,
1224            offset: usize,
1225            _depth: fidl::encoding::Depth,
1226        ) -> fidl::Result<()> {
1227            decoder.debug_check_bounds::<Self>(offset);
1228            // Verify that padding bytes are zero.
1229            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
1230            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1231            let mask = 0xffffffffffffff00u64;
1232            let maskedval = padval & mask;
1233            if maskedval != 0 {
1234                return Err(fidl::Error::NonZeroPadding {
1235                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
1236                });
1237            }
1238            fidl::decode!(
1239                fidl::encoding::BoundedString<64>,
1240                D,
1241                &mut self.key,
1242                decoder,
1243                offset + 0,
1244                _depth
1245            )?;
1246            fidl::decode!(bool, D, &mut self.defaultval, decoder, offset + 16, _depth)?;
1247            Ok(())
1248        }
1249    }
1250
1251    impl fidl::encoding::ValueTypeMarker for Extra {
1252        type Borrowed<'a> = &'a Self;
1253        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1254            value
1255        }
1256    }
1257
1258    unsafe impl fidl::encoding::TypeMarker for Extra {
1259        type Owned = Self;
1260
1261        #[inline(always)]
1262        fn inline_align(_context: fidl::encoding::Context) -> usize {
1263            4
1264        }
1265
1266        #[inline(always)]
1267        fn inline_size(_context: fidl::encoding::Context) -> usize {
1268            4
1269        }
1270        #[inline(always)]
1271        fn encode_is_copy() -> bool {
1272            true
1273        }
1274
1275        #[inline(always)]
1276        fn decode_is_copy() -> bool {
1277            true
1278        }
1279    }
1280
1281    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Extra, D> for &Extra {
1282        #[inline]
1283        unsafe fn encode(
1284            self,
1285            encoder: &mut fidl::encoding::Encoder<'_, D>,
1286            offset: usize,
1287            _depth: fidl::encoding::Depth,
1288        ) -> fidl::Result<()> {
1289            encoder.debug_check_bounds::<Extra>(offset);
1290            unsafe {
1291                // Copy the object into the buffer.
1292                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1293                (buf_ptr as *mut Extra).write_unaligned((self as *const Extra).read());
1294                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1295                // done second because the memcpy will write garbage to these bytes.
1296            }
1297            Ok(())
1298        }
1299    }
1300    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1301        fidl::encoding::Encode<Extra, D> for (T0,)
1302    {
1303        #[inline]
1304        unsafe fn encode(
1305            self,
1306            encoder: &mut fidl::encoding::Encoder<'_, D>,
1307            offset: usize,
1308            depth: fidl::encoding::Depth,
1309        ) -> fidl::Result<()> {
1310            encoder.debug_check_bounds::<Extra>(offset);
1311            // Zero out padding regions. There's no need to apply masks
1312            // because the unmasked parts will be overwritten by fields.
1313            // Write the fields.
1314            self.0.encode(encoder, offset + 0, depth)?;
1315            Ok(())
1316        }
1317    }
1318
1319    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Extra {
1320        #[inline(always)]
1321        fn new_empty() -> Self {
1322            Self { n: fidl::new_empty!(u32, D) }
1323        }
1324
1325        #[inline]
1326        unsafe fn decode(
1327            &mut self,
1328            decoder: &mut fidl::encoding::Decoder<'_, D>,
1329            offset: usize,
1330            _depth: fidl::encoding::Depth,
1331        ) -> fidl::Result<()> {
1332            decoder.debug_check_bounds::<Self>(offset);
1333            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1334            // Verify that padding bytes are zero.
1335            // Copy from the buffer into the object.
1336            unsafe {
1337                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1338            }
1339            Ok(())
1340        }
1341    }
1342
1343    impl fidl::encoding::ValueTypeMarker for FactoryItemsGetRequest {
1344        type Borrowed<'a> = &'a Self;
1345        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1346            value
1347        }
1348    }
1349
1350    unsafe impl fidl::encoding::TypeMarker for FactoryItemsGetRequest {
1351        type Owned = Self;
1352
1353        #[inline(always)]
1354        fn inline_align(_context: fidl::encoding::Context) -> usize {
1355            4
1356        }
1357
1358        #[inline(always)]
1359        fn inline_size(_context: fidl::encoding::Context) -> usize {
1360            4
1361        }
1362        #[inline(always)]
1363        fn encode_is_copy() -> bool {
1364            true
1365        }
1366
1367        #[inline(always)]
1368        fn decode_is_copy() -> bool {
1369            true
1370        }
1371    }
1372
1373    unsafe impl<D: fidl::encoding::ResourceDialect>
1374        fidl::encoding::Encode<FactoryItemsGetRequest, D> for &FactoryItemsGetRequest
1375    {
1376        #[inline]
1377        unsafe fn encode(
1378            self,
1379            encoder: &mut fidl::encoding::Encoder<'_, D>,
1380            offset: usize,
1381            _depth: fidl::encoding::Depth,
1382        ) -> fidl::Result<()> {
1383            encoder.debug_check_bounds::<FactoryItemsGetRequest>(offset);
1384            unsafe {
1385                // Copy the object into the buffer.
1386                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1387                (buf_ptr as *mut FactoryItemsGetRequest)
1388                    .write_unaligned((self as *const FactoryItemsGetRequest).read());
1389                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1390                // done second because the memcpy will write garbage to these bytes.
1391            }
1392            Ok(())
1393        }
1394    }
1395    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1396        fidl::encoding::Encode<FactoryItemsGetRequest, D> for (T0,)
1397    {
1398        #[inline]
1399        unsafe fn encode(
1400            self,
1401            encoder: &mut fidl::encoding::Encoder<'_, D>,
1402            offset: usize,
1403            depth: fidl::encoding::Depth,
1404        ) -> fidl::Result<()> {
1405            encoder.debug_check_bounds::<FactoryItemsGetRequest>(offset);
1406            // Zero out padding regions. There's no need to apply masks
1407            // because the unmasked parts will be overwritten by fields.
1408            // Write the fields.
1409            self.0.encode(encoder, offset + 0, depth)?;
1410            Ok(())
1411        }
1412    }
1413
1414    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1415        for FactoryItemsGetRequest
1416    {
1417        #[inline(always)]
1418        fn new_empty() -> Self {
1419            Self { extra: fidl::new_empty!(u32, D) }
1420        }
1421
1422        #[inline]
1423        unsafe fn decode(
1424            &mut self,
1425            decoder: &mut fidl::encoding::Decoder<'_, D>,
1426            offset: usize,
1427            _depth: fidl::encoding::Depth,
1428        ) -> fidl::Result<()> {
1429            decoder.debug_check_bounds::<Self>(offset);
1430            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1431            // Verify that padding bytes are zero.
1432            // Copy from the buffer into the object.
1433            unsafe {
1434                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1435            }
1436            Ok(())
1437        }
1438    }
1439
1440    impl fidl::encoding::ValueTypeMarker for ItemsGet2Request {
1441        type Borrowed<'a> = &'a Self;
1442        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1443            value
1444        }
1445    }
1446
1447    unsafe impl fidl::encoding::TypeMarker for ItemsGet2Request {
1448        type Owned = Self;
1449
1450        #[inline(always)]
1451        fn inline_align(_context: fidl::encoding::Context) -> usize {
1452            8
1453        }
1454
1455        #[inline(always)]
1456        fn inline_size(_context: fidl::encoding::Context) -> usize {
1457            16
1458        }
1459    }
1460
1461    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ItemsGet2Request, D>
1462        for &ItemsGet2Request
1463    {
1464        #[inline]
1465        unsafe fn encode(
1466            self,
1467            encoder: &mut fidl::encoding::Encoder<'_, D>,
1468            offset: usize,
1469            _depth: fidl::encoding::Depth,
1470        ) -> fidl::Result<()> {
1471            encoder.debug_check_bounds::<ItemsGet2Request>(offset);
1472            // Delegate to tuple encoding.
1473            fidl::encoding::Encode::<ItemsGet2Request, D>::encode(
1474                (
1475                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
1476                    <fidl::encoding::Boxed<Extra> as fidl::encoding::ValueTypeMarker>::borrow(
1477                        &self.extra,
1478                    ),
1479                ),
1480                encoder,
1481                offset,
1482                _depth,
1483            )
1484        }
1485    }
1486    unsafe impl<
1487            D: fidl::encoding::ResourceDialect,
1488            T0: fidl::encoding::Encode<u32, D>,
1489            T1: fidl::encoding::Encode<fidl::encoding::Boxed<Extra>, D>,
1490        > fidl::encoding::Encode<ItemsGet2Request, D> for (T0, T1)
1491    {
1492        #[inline]
1493        unsafe fn encode(
1494            self,
1495            encoder: &mut fidl::encoding::Encoder<'_, D>,
1496            offset: usize,
1497            depth: fidl::encoding::Depth,
1498        ) -> fidl::Result<()> {
1499            encoder.debug_check_bounds::<ItemsGet2Request>(offset);
1500            // Zero out padding regions. There's no need to apply masks
1501            // because the unmasked parts will be overwritten by fields.
1502            unsafe {
1503                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1504                (ptr as *mut u64).write_unaligned(0);
1505            }
1506            // Write the fields.
1507            self.0.encode(encoder, offset + 0, depth)?;
1508            self.1.encode(encoder, offset + 8, depth)?;
1509            Ok(())
1510        }
1511    }
1512
1513    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ItemsGet2Request {
1514        #[inline(always)]
1515        fn new_empty() -> Self {
1516            Self {
1517                type_: fidl::new_empty!(u32, D),
1518                extra: fidl::new_empty!(fidl::encoding::Boxed<Extra>, D),
1519            }
1520        }
1521
1522        #[inline]
1523        unsafe fn decode(
1524            &mut self,
1525            decoder: &mut fidl::encoding::Decoder<'_, D>,
1526            offset: usize,
1527            _depth: fidl::encoding::Depth,
1528        ) -> fidl::Result<()> {
1529            decoder.debug_check_bounds::<Self>(offset);
1530            // Verify that padding bytes are zero.
1531            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1532            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1533            let mask = 0xffffffff00000000u64;
1534            let maskedval = padval & mask;
1535            if maskedval != 0 {
1536                return Err(fidl::Error::NonZeroPadding {
1537                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1538                });
1539            }
1540            fidl::decode!(u32, D, &mut self.type_, decoder, offset + 0, _depth)?;
1541            fidl::decode!(
1542                fidl::encoding::Boxed<Extra>,
1543                D,
1544                &mut self.extra,
1545                decoder,
1546                offset + 8,
1547                _depth
1548            )?;
1549            Ok(())
1550        }
1551    }
1552
1553    impl fidl::encoding::ValueTypeMarker for ItemsGetBootloaderFileRequest {
1554        type Borrowed<'a> = &'a Self;
1555        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1556            value
1557        }
1558    }
1559
1560    unsafe impl fidl::encoding::TypeMarker for ItemsGetBootloaderFileRequest {
1561        type Owned = Self;
1562
1563        #[inline(always)]
1564        fn inline_align(_context: fidl::encoding::Context) -> usize {
1565            8
1566        }
1567
1568        #[inline(always)]
1569        fn inline_size(_context: fidl::encoding::Context) -> usize {
1570            16
1571        }
1572    }
1573
1574    unsafe impl<D: fidl::encoding::ResourceDialect>
1575        fidl::encoding::Encode<ItemsGetBootloaderFileRequest, D>
1576        for &ItemsGetBootloaderFileRequest
1577    {
1578        #[inline]
1579        unsafe fn encode(
1580            self,
1581            encoder: &mut fidl::encoding::Encoder<'_, D>,
1582            offset: usize,
1583            _depth: fidl::encoding::Depth,
1584        ) -> fidl::Result<()> {
1585            encoder.debug_check_bounds::<ItemsGetBootloaderFileRequest>(offset);
1586            // Delegate to tuple encoding.
1587            fidl::encoding::Encode::<ItemsGetBootloaderFileRequest, D>::encode(
1588                (<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
1589                    &self.filename,
1590                ),),
1591                encoder,
1592                offset,
1593                _depth,
1594            )
1595        }
1596    }
1597    unsafe impl<
1598            D: fidl::encoding::ResourceDialect,
1599            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
1600        > fidl::encoding::Encode<ItemsGetBootloaderFileRequest, D> for (T0,)
1601    {
1602        #[inline]
1603        unsafe fn encode(
1604            self,
1605            encoder: &mut fidl::encoding::Encoder<'_, D>,
1606            offset: usize,
1607            depth: fidl::encoding::Depth,
1608        ) -> fidl::Result<()> {
1609            encoder.debug_check_bounds::<ItemsGetBootloaderFileRequest>(offset);
1610            // Zero out padding regions. There's no need to apply masks
1611            // because the unmasked parts will be overwritten by fields.
1612            // Write the fields.
1613            self.0.encode(encoder, offset + 0, depth)?;
1614            Ok(())
1615        }
1616    }
1617
1618    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1619        for ItemsGetBootloaderFileRequest
1620    {
1621        #[inline(always)]
1622        fn new_empty() -> Self {
1623            Self { filename: fidl::new_empty!(fidl::encoding::BoundedString<255>, D) }
1624        }
1625
1626        #[inline]
1627        unsafe fn decode(
1628            &mut self,
1629            decoder: &mut fidl::encoding::Decoder<'_, D>,
1630            offset: usize,
1631            _depth: fidl::encoding::Depth,
1632        ) -> fidl::Result<()> {
1633            decoder.debug_check_bounds::<Self>(offset);
1634            // Verify that padding bytes are zero.
1635            fidl::decode!(
1636                fidl::encoding::BoundedString<255>,
1637                D,
1638                &mut self.filename,
1639                decoder,
1640                offset + 0,
1641                _depth
1642            )?;
1643            Ok(())
1644        }
1645    }
1646
1647    impl fidl::encoding::ValueTypeMarker for ItemsGetRequest {
1648        type Borrowed<'a> = &'a Self;
1649        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1650            value
1651        }
1652    }
1653
1654    unsafe impl fidl::encoding::TypeMarker for ItemsGetRequest {
1655        type Owned = Self;
1656
1657        #[inline(always)]
1658        fn inline_align(_context: fidl::encoding::Context) -> usize {
1659            4
1660        }
1661
1662        #[inline(always)]
1663        fn inline_size(_context: fidl::encoding::Context) -> usize {
1664            8
1665        }
1666        #[inline(always)]
1667        fn encode_is_copy() -> bool {
1668            true
1669        }
1670
1671        #[inline(always)]
1672        fn decode_is_copy() -> bool {
1673            true
1674        }
1675    }
1676
1677    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ItemsGetRequest, D>
1678        for &ItemsGetRequest
1679    {
1680        #[inline]
1681        unsafe fn encode(
1682            self,
1683            encoder: &mut fidl::encoding::Encoder<'_, D>,
1684            offset: usize,
1685            _depth: fidl::encoding::Depth,
1686        ) -> fidl::Result<()> {
1687            encoder.debug_check_bounds::<ItemsGetRequest>(offset);
1688            unsafe {
1689                // Copy the object into the buffer.
1690                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1691                (buf_ptr as *mut ItemsGetRequest)
1692                    .write_unaligned((self as *const ItemsGetRequest).read());
1693                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1694                // done second because the memcpy will write garbage to these bytes.
1695            }
1696            Ok(())
1697        }
1698    }
1699    unsafe impl<
1700            D: fidl::encoding::ResourceDialect,
1701            T0: fidl::encoding::Encode<u32, D>,
1702            T1: fidl::encoding::Encode<u32, D>,
1703        > fidl::encoding::Encode<ItemsGetRequest, D> for (T0, T1)
1704    {
1705        #[inline]
1706        unsafe fn encode(
1707            self,
1708            encoder: &mut fidl::encoding::Encoder<'_, D>,
1709            offset: usize,
1710            depth: fidl::encoding::Depth,
1711        ) -> fidl::Result<()> {
1712            encoder.debug_check_bounds::<ItemsGetRequest>(offset);
1713            // Zero out padding regions. There's no need to apply masks
1714            // because the unmasked parts will be overwritten by fields.
1715            // Write the fields.
1716            self.0.encode(encoder, offset + 0, depth)?;
1717            self.1.encode(encoder, offset + 4, depth)?;
1718            Ok(())
1719        }
1720    }
1721
1722    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ItemsGetRequest {
1723        #[inline(always)]
1724        fn new_empty() -> Self {
1725            Self { type_: fidl::new_empty!(u32, D), extra: fidl::new_empty!(u32, D) }
1726        }
1727
1728        #[inline]
1729        unsafe fn decode(
1730            &mut self,
1731            decoder: &mut fidl::encoding::Decoder<'_, D>,
1732            offset: usize,
1733            _depth: fidl::encoding::Depth,
1734        ) -> fidl::Result<()> {
1735            decoder.debug_check_bounds::<Self>(offset);
1736            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1737            // Verify that padding bytes are zero.
1738            // Copy from the buffer into the object.
1739            unsafe {
1740                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
1741            }
1742            Ok(())
1743        }
1744    }
1745}