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_KEY_SIZE: u64 = 256;
12
13pub const MAX_STRING_SIZE: u64 = 12000;
16
17#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
18#[repr(u32)]
19pub enum FlushError {
20 ReadOnly = 1,
21 CommitFailed = 2,
22}
23
24impl FlushError {
25 #[inline]
26 pub fn from_primitive(prim: u32) -> Option<Self> {
27 match prim {
28 1 => Some(Self::ReadOnly),
29 2 => Some(Self::CommitFailed),
30 _ => None,
31 }
32 }
33
34 #[inline]
35 pub const fn into_primitive(self) -> u32 {
36 self as u32
37 }
38
39 #[deprecated = "Strict enums should not use `is_unknown`"]
40 #[inline]
41 pub fn is_unknown(&self) -> bool {
42 false
43 }
44}
45
46#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
48#[repr(u8)]
49pub enum ValueType {
50 IntVal = 1,
51 FloatVal = 2,
52 BoolVal = 3,
53 StringVal = 4,
54 BytesVal = 5,
55}
56
57impl ValueType {
58 #[inline]
59 pub fn from_primitive(prim: u8) -> Option<Self> {
60 match prim {
61 1 => Some(Self::IntVal),
62 2 => Some(Self::FloatVal),
63 3 => Some(Self::BoolVal),
64 4 => Some(Self::StringVal),
65 5 => Some(Self::BytesVal),
66 _ => None,
67 }
68 }
69
70 #[inline]
71 pub const fn into_primitive(self) -> u8 {
72 self as u8
73 }
74
75 #[deprecated = "Strict enums should not use `is_unknown`"]
76 #[inline]
77 pub fn is_unknown(&self) -> bool {
78 false
79 }
80}
81
82#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
84pub struct ListItem {
85 pub key: String,
86 pub type_: ValueType,
87}
88
89impl fidl::Persistable for ListItem {}
90
91#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
92pub struct ListIteratorGetNextResponse {
93 pub keys: Vec<ListItem>,
94}
95
96impl fidl::Persistable for ListIteratorGetNextResponse {}
97
98#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
99pub struct StoreAccessorDeletePrefixRequest {
100 pub prefix: String,
101}
102
103impl fidl::Persistable for StoreAccessorDeletePrefixRequest {}
104
105#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
106pub struct StoreAccessorDeleteValueRequest {
107 pub key: String,
108}
109
110impl fidl::Persistable for StoreAccessorDeleteValueRequest {}
111
112#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
113pub struct StoreAccessorGetValueRequest {
114 pub key: String,
115}
116
117impl fidl::Persistable for StoreAccessorGetValueRequest {}
118
119#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
120pub struct StoreIdentifyRequest {
121 pub name: String,
122}
123
124impl fidl::Persistable for StoreIdentifyRequest {}
125
126mod internal {
127 use super::*;
128 unsafe impl fidl::encoding::TypeMarker for FlushError {
129 type Owned = Self;
130
131 #[inline(always)]
132 fn inline_align(_context: fidl::encoding::Context) -> usize {
133 std::mem::align_of::<u32>()
134 }
135
136 #[inline(always)]
137 fn inline_size(_context: fidl::encoding::Context) -> usize {
138 std::mem::size_of::<u32>()
139 }
140
141 #[inline(always)]
142 fn encode_is_copy() -> bool {
143 true
144 }
145
146 #[inline(always)]
147 fn decode_is_copy() -> bool {
148 false
149 }
150 }
151
152 impl fidl::encoding::ValueTypeMarker for FlushError {
153 type Borrowed<'a> = Self;
154 #[inline(always)]
155 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
156 *value
157 }
158 }
159
160 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FlushError {
161 #[inline]
162 unsafe fn encode(
163 self,
164 encoder: &mut fidl::encoding::Encoder<'_, D>,
165 offset: usize,
166 _depth: fidl::encoding::Depth,
167 ) -> fidl::Result<()> {
168 encoder.debug_check_bounds::<Self>(offset);
169 encoder.write_num(self.into_primitive(), offset);
170 Ok(())
171 }
172 }
173
174 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FlushError {
175 #[inline(always)]
176 fn new_empty() -> Self {
177 Self::ReadOnly
178 }
179
180 #[inline]
181 unsafe fn decode(
182 &mut self,
183 decoder: &mut fidl::encoding::Decoder<'_, D>,
184 offset: usize,
185 _depth: fidl::encoding::Depth,
186 ) -> fidl::Result<()> {
187 decoder.debug_check_bounds::<Self>(offset);
188 let prim = decoder.read_num::<u32>(offset);
189
190 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
191 Ok(())
192 }
193 }
194 unsafe impl fidl::encoding::TypeMarker for ValueType {
195 type Owned = Self;
196
197 #[inline(always)]
198 fn inline_align(_context: fidl::encoding::Context) -> usize {
199 std::mem::align_of::<u8>()
200 }
201
202 #[inline(always)]
203 fn inline_size(_context: fidl::encoding::Context) -> usize {
204 std::mem::size_of::<u8>()
205 }
206
207 #[inline(always)]
208 fn encode_is_copy() -> bool {
209 true
210 }
211
212 #[inline(always)]
213 fn decode_is_copy() -> bool {
214 false
215 }
216 }
217
218 impl fidl::encoding::ValueTypeMarker for ValueType {
219 type Borrowed<'a> = Self;
220 #[inline(always)]
221 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
222 *value
223 }
224 }
225
226 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ValueType {
227 #[inline]
228 unsafe fn encode(
229 self,
230 encoder: &mut fidl::encoding::Encoder<'_, D>,
231 offset: usize,
232 _depth: fidl::encoding::Depth,
233 ) -> fidl::Result<()> {
234 encoder.debug_check_bounds::<Self>(offset);
235 encoder.write_num(self.into_primitive(), offset);
236 Ok(())
237 }
238 }
239
240 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ValueType {
241 #[inline(always)]
242 fn new_empty() -> Self {
243 Self::IntVal
244 }
245
246 #[inline]
247 unsafe fn decode(
248 &mut self,
249 decoder: &mut fidl::encoding::Decoder<'_, D>,
250 offset: usize,
251 _depth: fidl::encoding::Depth,
252 ) -> fidl::Result<()> {
253 decoder.debug_check_bounds::<Self>(offset);
254 let prim = decoder.read_num::<u8>(offset);
255
256 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
257 Ok(())
258 }
259 }
260
261 impl fidl::encoding::ValueTypeMarker for ListItem {
262 type Borrowed<'a> = &'a Self;
263 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
264 value
265 }
266 }
267
268 unsafe impl fidl::encoding::TypeMarker for ListItem {
269 type Owned = Self;
270
271 #[inline(always)]
272 fn inline_align(_context: fidl::encoding::Context) -> usize {
273 8
274 }
275
276 #[inline(always)]
277 fn inline_size(_context: fidl::encoding::Context) -> usize {
278 24
279 }
280 }
281
282 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ListItem, D> for &ListItem {
283 #[inline]
284 unsafe fn encode(
285 self,
286 encoder: &mut fidl::encoding::Encoder<'_, D>,
287 offset: usize,
288 _depth: fidl::encoding::Depth,
289 ) -> fidl::Result<()> {
290 encoder.debug_check_bounds::<ListItem>(offset);
291 fidl::encoding::Encode::<ListItem, D>::encode(
293 (
294 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
295 &self.key,
296 ),
297 <ValueType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
298 ),
299 encoder,
300 offset,
301 _depth,
302 )
303 }
304 }
305 unsafe impl<
306 D: fidl::encoding::ResourceDialect,
307 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
308 T1: fidl::encoding::Encode<ValueType, D>,
309 > fidl::encoding::Encode<ListItem, D> for (T0, T1)
310 {
311 #[inline]
312 unsafe fn encode(
313 self,
314 encoder: &mut fidl::encoding::Encoder<'_, D>,
315 offset: usize,
316 depth: fidl::encoding::Depth,
317 ) -> fidl::Result<()> {
318 encoder.debug_check_bounds::<ListItem>(offset);
319 unsafe {
322 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
323 (ptr as *mut u64).write_unaligned(0);
324 }
325 self.0.encode(encoder, offset + 0, depth)?;
327 self.1.encode(encoder, offset + 16, depth)?;
328 Ok(())
329 }
330 }
331
332 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ListItem {
333 #[inline(always)]
334 fn new_empty() -> Self {
335 Self {
336 key: fidl::new_empty!(fidl::encoding::BoundedString<256>, D),
337 type_: fidl::new_empty!(ValueType, D),
338 }
339 }
340
341 #[inline]
342 unsafe fn decode(
343 &mut self,
344 decoder: &mut fidl::encoding::Decoder<'_, D>,
345 offset: usize,
346 _depth: fidl::encoding::Depth,
347 ) -> fidl::Result<()> {
348 decoder.debug_check_bounds::<Self>(offset);
349 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
351 let padval = unsafe { (ptr as *const u64).read_unaligned() };
352 let mask = 0xffffffffffffff00u64;
353 let maskedval = padval & mask;
354 if maskedval != 0 {
355 return Err(fidl::Error::NonZeroPadding {
356 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
357 });
358 }
359 fidl::decode!(
360 fidl::encoding::BoundedString<256>,
361 D,
362 &mut self.key,
363 decoder,
364 offset + 0,
365 _depth
366 )?;
367 fidl::decode!(ValueType, D, &mut self.type_, decoder, offset + 16, _depth)?;
368 Ok(())
369 }
370 }
371
372 impl fidl::encoding::ValueTypeMarker for ListIteratorGetNextResponse {
373 type Borrowed<'a> = &'a Self;
374 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
375 value
376 }
377 }
378
379 unsafe impl fidl::encoding::TypeMarker for ListIteratorGetNextResponse {
380 type Owned = Self;
381
382 #[inline(always)]
383 fn inline_align(_context: fidl::encoding::Context) -> usize {
384 8
385 }
386
387 #[inline(always)]
388 fn inline_size(_context: fidl::encoding::Context) -> usize {
389 16
390 }
391 }
392
393 unsafe impl<D: fidl::encoding::ResourceDialect>
394 fidl::encoding::Encode<ListIteratorGetNextResponse, D> for &ListIteratorGetNextResponse
395 {
396 #[inline]
397 unsafe fn encode(
398 self,
399 encoder: &mut fidl::encoding::Encoder<'_, D>,
400 offset: usize,
401 _depth: fidl::encoding::Depth,
402 ) -> fidl::Result<()> {
403 encoder.debug_check_bounds::<ListIteratorGetNextResponse>(offset);
404 fidl::encoding::Encode::<ListIteratorGetNextResponse, D>::encode(
406 (
407 <fidl::encoding::UnboundedVector<ListItem> as fidl::encoding::ValueTypeMarker>::borrow(&self.keys),
408 ),
409 encoder, offset, _depth
410 )
411 }
412 }
413 unsafe impl<
414 D: fidl::encoding::ResourceDialect,
415 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<ListItem>, D>,
416 > fidl::encoding::Encode<ListIteratorGetNextResponse, D> for (T0,)
417 {
418 #[inline]
419 unsafe fn encode(
420 self,
421 encoder: &mut fidl::encoding::Encoder<'_, D>,
422 offset: usize,
423 depth: fidl::encoding::Depth,
424 ) -> fidl::Result<()> {
425 encoder.debug_check_bounds::<ListIteratorGetNextResponse>(offset);
426 self.0.encode(encoder, offset + 0, depth)?;
430 Ok(())
431 }
432 }
433
434 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
435 for ListIteratorGetNextResponse
436 {
437 #[inline(always)]
438 fn new_empty() -> Self {
439 Self { keys: fidl::new_empty!(fidl::encoding::UnboundedVector<ListItem>, D) }
440 }
441
442 #[inline]
443 unsafe fn decode(
444 &mut self,
445 decoder: &mut fidl::encoding::Decoder<'_, D>,
446 offset: usize,
447 _depth: fidl::encoding::Depth,
448 ) -> fidl::Result<()> {
449 decoder.debug_check_bounds::<Self>(offset);
450 fidl::decode!(
452 fidl::encoding::UnboundedVector<ListItem>,
453 D,
454 &mut self.keys,
455 decoder,
456 offset + 0,
457 _depth
458 )?;
459 Ok(())
460 }
461 }
462
463 impl fidl::encoding::ValueTypeMarker for StoreAccessorDeletePrefixRequest {
464 type Borrowed<'a> = &'a Self;
465 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
466 value
467 }
468 }
469
470 unsafe impl fidl::encoding::TypeMarker for StoreAccessorDeletePrefixRequest {
471 type Owned = Self;
472
473 #[inline(always)]
474 fn inline_align(_context: fidl::encoding::Context) -> usize {
475 8
476 }
477
478 #[inline(always)]
479 fn inline_size(_context: fidl::encoding::Context) -> usize {
480 16
481 }
482 }
483
484 unsafe impl<D: fidl::encoding::ResourceDialect>
485 fidl::encoding::Encode<StoreAccessorDeletePrefixRequest, D>
486 for &StoreAccessorDeletePrefixRequest
487 {
488 #[inline]
489 unsafe fn encode(
490 self,
491 encoder: &mut fidl::encoding::Encoder<'_, D>,
492 offset: usize,
493 _depth: fidl::encoding::Depth,
494 ) -> fidl::Result<()> {
495 encoder.debug_check_bounds::<StoreAccessorDeletePrefixRequest>(offset);
496 fidl::encoding::Encode::<StoreAccessorDeletePrefixRequest, D>::encode(
498 (<fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
499 &self.prefix,
500 ),),
501 encoder,
502 offset,
503 _depth,
504 )
505 }
506 }
507 unsafe impl<
508 D: fidl::encoding::ResourceDialect,
509 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
510 > fidl::encoding::Encode<StoreAccessorDeletePrefixRequest, D> for (T0,)
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::<StoreAccessorDeletePrefixRequest>(offset);
520 self.0.encode(encoder, offset + 0, depth)?;
524 Ok(())
525 }
526 }
527
528 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
529 for StoreAccessorDeletePrefixRequest
530 {
531 #[inline(always)]
532 fn new_empty() -> Self {
533 Self { prefix: fidl::new_empty!(fidl::encoding::BoundedString<256>, D) }
534 }
535
536 #[inline]
537 unsafe fn decode(
538 &mut self,
539 decoder: &mut fidl::encoding::Decoder<'_, D>,
540 offset: usize,
541 _depth: fidl::encoding::Depth,
542 ) -> fidl::Result<()> {
543 decoder.debug_check_bounds::<Self>(offset);
544 fidl::decode!(
546 fidl::encoding::BoundedString<256>,
547 D,
548 &mut self.prefix,
549 decoder,
550 offset + 0,
551 _depth
552 )?;
553 Ok(())
554 }
555 }
556
557 impl fidl::encoding::ValueTypeMarker for StoreAccessorDeleteValueRequest {
558 type Borrowed<'a> = &'a Self;
559 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
560 value
561 }
562 }
563
564 unsafe impl fidl::encoding::TypeMarker for StoreAccessorDeleteValueRequest {
565 type Owned = Self;
566
567 #[inline(always)]
568 fn inline_align(_context: fidl::encoding::Context) -> usize {
569 8
570 }
571
572 #[inline(always)]
573 fn inline_size(_context: fidl::encoding::Context) -> usize {
574 16
575 }
576 }
577
578 unsafe impl<D: fidl::encoding::ResourceDialect>
579 fidl::encoding::Encode<StoreAccessorDeleteValueRequest, D>
580 for &StoreAccessorDeleteValueRequest
581 {
582 #[inline]
583 unsafe fn encode(
584 self,
585 encoder: &mut fidl::encoding::Encoder<'_, D>,
586 offset: usize,
587 _depth: fidl::encoding::Depth,
588 ) -> fidl::Result<()> {
589 encoder.debug_check_bounds::<StoreAccessorDeleteValueRequest>(offset);
590 fidl::encoding::Encode::<StoreAccessorDeleteValueRequest, D>::encode(
592 (<fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
593 &self.key,
594 ),),
595 encoder,
596 offset,
597 _depth,
598 )
599 }
600 }
601 unsafe impl<
602 D: fidl::encoding::ResourceDialect,
603 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
604 > fidl::encoding::Encode<StoreAccessorDeleteValueRequest, D> for (T0,)
605 {
606 #[inline]
607 unsafe fn encode(
608 self,
609 encoder: &mut fidl::encoding::Encoder<'_, D>,
610 offset: usize,
611 depth: fidl::encoding::Depth,
612 ) -> fidl::Result<()> {
613 encoder.debug_check_bounds::<StoreAccessorDeleteValueRequest>(offset);
614 self.0.encode(encoder, offset + 0, depth)?;
618 Ok(())
619 }
620 }
621
622 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
623 for StoreAccessorDeleteValueRequest
624 {
625 #[inline(always)]
626 fn new_empty() -> Self {
627 Self { key: fidl::new_empty!(fidl::encoding::BoundedString<256>, D) }
628 }
629
630 #[inline]
631 unsafe fn decode(
632 &mut self,
633 decoder: &mut fidl::encoding::Decoder<'_, D>,
634 offset: usize,
635 _depth: fidl::encoding::Depth,
636 ) -> fidl::Result<()> {
637 decoder.debug_check_bounds::<Self>(offset);
638 fidl::decode!(
640 fidl::encoding::BoundedString<256>,
641 D,
642 &mut self.key,
643 decoder,
644 offset + 0,
645 _depth
646 )?;
647 Ok(())
648 }
649 }
650
651 impl fidl::encoding::ValueTypeMarker for StoreAccessorGetValueRequest {
652 type Borrowed<'a> = &'a Self;
653 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
654 value
655 }
656 }
657
658 unsafe impl fidl::encoding::TypeMarker for StoreAccessorGetValueRequest {
659 type Owned = Self;
660
661 #[inline(always)]
662 fn inline_align(_context: fidl::encoding::Context) -> usize {
663 8
664 }
665
666 #[inline(always)]
667 fn inline_size(_context: fidl::encoding::Context) -> usize {
668 16
669 }
670 }
671
672 unsafe impl<D: fidl::encoding::ResourceDialect>
673 fidl::encoding::Encode<StoreAccessorGetValueRequest, D> for &StoreAccessorGetValueRequest
674 {
675 #[inline]
676 unsafe fn encode(
677 self,
678 encoder: &mut fidl::encoding::Encoder<'_, D>,
679 offset: usize,
680 _depth: fidl::encoding::Depth,
681 ) -> fidl::Result<()> {
682 encoder.debug_check_bounds::<StoreAccessorGetValueRequest>(offset);
683 fidl::encoding::Encode::<StoreAccessorGetValueRequest, D>::encode(
685 (<fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
686 &self.key,
687 ),),
688 encoder,
689 offset,
690 _depth,
691 )
692 }
693 }
694 unsafe impl<
695 D: fidl::encoding::ResourceDialect,
696 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
697 > fidl::encoding::Encode<StoreAccessorGetValueRequest, D> for (T0,)
698 {
699 #[inline]
700 unsafe fn encode(
701 self,
702 encoder: &mut fidl::encoding::Encoder<'_, D>,
703 offset: usize,
704 depth: fidl::encoding::Depth,
705 ) -> fidl::Result<()> {
706 encoder.debug_check_bounds::<StoreAccessorGetValueRequest>(offset);
707 self.0.encode(encoder, offset + 0, depth)?;
711 Ok(())
712 }
713 }
714
715 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
716 for StoreAccessorGetValueRequest
717 {
718 #[inline(always)]
719 fn new_empty() -> Self {
720 Self { key: fidl::new_empty!(fidl::encoding::BoundedString<256>, D) }
721 }
722
723 #[inline]
724 unsafe fn decode(
725 &mut self,
726 decoder: &mut fidl::encoding::Decoder<'_, D>,
727 offset: usize,
728 _depth: fidl::encoding::Depth,
729 ) -> fidl::Result<()> {
730 decoder.debug_check_bounds::<Self>(offset);
731 fidl::decode!(
733 fidl::encoding::BoundedString<256>,
734 D,
735 &mut self.key,
736 decoder,
737 offset + 0,
738 _depth
739 )?;
740 Ok(())
741 }
742 }
743
744 impl fidl::encoding::ValueTypeMarker for StoreIdentifyRequest {
745 type Borrowed<'a> = &'a Self;
746 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
747 value
748 }
749 }
750
751 unsafe impl fidl::encoding::TypeMarker for StoreIdentifyRequest {
752 type Owned = Self;
753
754 #[inline(always)]
755 fn inline_align(_context: fidl::encoding::Context) -> usize {
756 8
757 }
758
759 #[inline(always)]
760 fn inline_size(_context: fidl::encoding::Context) -> usize {
761 16
762 }
763 }
764
765 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StoreIdentifyRequest, D>
766 for &StoreIdentifyRequest
767 {
768 #[inline]
769 unsafe fn encode(
770 self,
771 encoder: &mut fidl::encoding::Encoder<'_, D>,
772 offset: usize,
773 _depth: fidl::encoding::Depth,
774 ) -> fidl::Result<()> {
775 encoder.debug_check_bounds::<StoreIdentifyRequest>(offset);
776 fidl::encoding::Encode::<StoreIdentifyRequest, D>::encode(
778 (<fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
779 &self.name,
780 ),),
781 encoder,
782 offset,
783 _depth,
784 )
785 }
786 }
787 unsafe impl<
788 D: fidl::encoding::ResourceDialect,
789 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
790 > fidl::encoding::Encode<StoreIdentifyRequest, D> for (T0,)
791 {
792 #[inline]
793 unsafe fn encode(
794 self,
795 encoder: &mut fidl::encoding::Encoder<'_, D>,
796 offset: usize,
797 depth: fidl::encoding::Depth,
798 ) -> fidl::Result<()> {
799 encoder.debug_check_bounds::<StoreIdentifyRequest>(offset);
800 self.0.encode(encoder, offset + 0, depth)?;
804 Ok(())
805 }
806 }
807
808 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StoreIdentifyRequest {
809 #[inline(always)]
810 fn new_empty() -> Self {
811 Self { name: fidl::new_empty!(fidl::encoding::BoundedString<256>, D) }
812 }
813
814 #[inline]
815 unsafe fn decode(
816 &mut self,
817 decoder: &mut fidl::encoding::Decoder<'_, D>,
818 offset: usize,
819 _depth: fidl::encoding::Depth,
820 ) -> fidl::Result<()> {
821 decoder.debug_check_bounds::<Self>(offset);
822 fidl::decode!(
824 fidl::encoding::BoundedString<256>,
825 D,
826 &mut self.name,
827 decoder,
828 offset + 0,
829 _depth
830 )?;
831 Ok(())
832 }
833 }
834}