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