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