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