Skip to main content

fidl_fuchsia_driver_metadata_common/
fidl_fuchsia_driver_metadata_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_LENGTH: u32 = 1024;
12
13pub const MAX_NUM_ENTRIES: u32 = 1024;
14
15pub const MAX_NUM_VALUE_ITEMS: u32 = 1024;
16
17pub const MAX_VALUE_LENGTH: u32 = 32768;
18
19/// A key/value pair in a `Dictionary`.
20#[derive(Clone, Debug, PartialEq)]
21pub struct DictionaryEntry {
22    /// The key for a dictionary entry.
23    /// Nested dictionaries are represented by flattening the keys using '.' as a separator.
24    /// For example, a key "a.b" with value 42 represents a dictionary "a" containing
25    /// a key "b" with value 42.
26    pub key: String,
27    /// The value associated with the `key`.
28    pub value: DictionaryValue,
29}
30
31impl fidl::Persistable for DictionaryEntry {}
32
33#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
34pub struct MetadataGetPersistedMetadataResponse {
35    /// The persisted metadata. Assumed to be a persisted FIDL object. The actual type of the
36    /// FIDL object is decided outside of this function.
37    pub persisted_metadata: Vec<u8>,
38}
39
40impl fidl::Persistable for MetadataGetPersistedMetadataResponse {}
41
42/// A dictionary-like structure for generic metadata.
43#[derive(Clone, Debug, Default, PartialEq)]
44pub struct Dictionary {
45    /// A list of dictionary entries, where each entry is a (key, value) pair.
46    pub entries: Option<Vec<DictionaryEntry>>,
47    #[doc(hidden)]
48    pub __source_breaking: fidl::marker::SourceBreaking,
49}
50
51impl fidl::Persistable for Dictionary {}
52
53/// A dictionary's value is an integer or a list of integers.
54#[derive(Clone, Debug)]
55pub enum DictionaryValue {
56    Int64(i64),
57    Int64Vec(Vec<i64>),
58    Str(String),
59    StrVec(Vec<String>),
60    Boolean(bool),
61    #[doc(hidden)]
62    __SourceBreaking {
63        unknown_ordinal: u64,
64    },
65}
66
67/// Pattern that matches an unknown `DictionaryValue` member.
68#[macro_export]
69macro_rules! DictionaryValueUnknown {
70    () => {
71        _
72    };
73}
74
75// Custom PartialEq so that unknown variants are not equal to themselves.
76impl PartialEq for DictionaryValue {
77    fn eq(&self, other: &Self) -> bool {
78        match (self, other) {
79            (Self::Int64(x), Self::Int64(y)) => *x == *y,
80            (Self::Int64Vec(x), Self::Int64Vec(y)) => *x == *y,
81            (Self::Str(x), Self::Str(y)) => *x == *y,
82            (Self::StrVec(x), Self::StrVec(y)) => *x == *y,
83            (Self::Boolean(x), Self::Boolean(y)) => *x == *y,
84            _ => false,
85        }
86    }
87}
88
89impl DictionaryValue {
90    #[inline]
91    pub fn ordinal(&self) -> u64 {
92        match *self {
93            Self::Int64(_) => 1,
94            Self::Int64Vec(_) => 2,
95            Self::Str(_) => 3,
96            Self::StrVec(_) => 4,
97            Self::Boolean(_) => 5,
98            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
99        }
100    }
101
102    #[inline]
103    pub fn unknown_variant_for_testing() -> Self {
104        Self::__SourceBreaking { unknown_ordinal: 0 }
105    }
106
107    #[inline]
108    pub fn is_unknown(&self) -> bool {
109        match self {
110            Self::__SourceBreaking { .. } => true,
111            _ => false,
112        }
113    }
114}
115
116impl fidl::Persistable for DictionaryValue {}
117
118pub mod metadata_ordinals {
119    pub const GET_PERSISTED_METADATA: u64 = 0x431a76979a5b3277;
120}
121
122mod internal {
123    use super::*;
124
125    impl fidl::encoding::ValueTypeMarker for DictionaryEntry {
126        type Borrowed<'a> = &'a Self;
127        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
128            value
129        }
130    }
131
132    unsafe impl fidl::encoding::TypeMarker for DictionaryEntry {
133        type Owned = Self;
134
135        #[inline(always)]
136        fn inline_align(_context: fidl::encoding::Context) -> usize {
137            8
138        }
139
140        #[inline(always)]
141        fn inline_size(_context: fidl::encoding::Context) -> usize {
142            32
143        }
144    }
145
146    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DictionaryEntry, D>
147        for &DictionaryEntry
148    {
149        #[inline]
150        unsafe fn encode(
151            self,
152            encoder: &mut fidl::encoding::Encoder<'_, D>,
153            offset: usize,
154            _depth: fidl::encoding::Depth,
155        ) -> fidl::Result<()> {
156            encoder.debug_check_bounds::<DictionaryEntry>(offset);
157            // Delegate to tuple encoding.
158            fidl::encoding::Encode::<DictionaryEntry, D>::encode(
159                (
160                    <fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
161                    <DictionaryValue as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
162                ),
163                encoder, offset, _depth
164            )
165        }
166    }
167    unsafe impl<
168        D: fidl::encoding::ResourceDialect,
169        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<1024>, D>,
170        T1: fidl::encoding::Encode<DictionaryValue, D>,
171    > fidl::encoding::Encode<DictionaryEntry, D> for (T0, T1)
172    {
173        #[inline]
174        unsafe fn encode(
175            self,
176            encoder: &mut fidl::encoding::Encoder<'_, D>,
177            offset: usize,
178            depth: fidl::encoding::Depth,
179        ) -> fidl::Result<()> {
180            encoder.debug_check_bounds::<DictionaryEntry>(offset);
181            // Zero out padding regions. There's no need to apply masks
182            // because the unmasked parts will be overwritten by fields.
183            // Write the fields.
184            self.0.encode(encoder, offset + 0, depth)?;
185            self.1.encode(encoder, offset + 16, depth)?;
186            Ok(())
187        }
188    }
189
190    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DictionaryEntry {
191        #[inline(always)]
192        fn new_empty() -> Self {
193            Self {
194                key: fidl::new_empty!(fidl::encoding::BoundedString<1024>, D),
195                value: fidl::new_empty!(DictionaryValue, D),
196            }
197        }
198
199        #[inline]
200        unsafe fn decode(
201            &mut self,
202            decoder: &mut fidl::encoding::Decoder<'_, D>,
203            offset: usize,
204            _depth: fidl::encoding::Depth,
205        ) -> fidl::Result<()> {
206            decoder.debug_check_bounds::<Self>(offset);
207            // Verify that padding bytes are zero.
208            fidl::decode!(
209                fidl::encoding::BoundedString<1024>,
210                D,
211                &mut self.key,
212                decoder,
213                offset + 0,
214                _depth
215            )?;
216            fidl::decode!(DictionaryValue, D, &mut self.value, decoder, offset + 16, _depth)?;
217            Ok(())
218        }
219    }
220
221    impl fidl::encoding::ValueTypeMarker for MetadataGetPersistedMetadataResponse {
222        type Borrowed<'a> = &'a Self;
223        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
224            value
225        }
226    }
227
228    unsafe impl fidl::encoding::TypeMarker for MetadataGetPersistedMetadataResponse {
229        type Owned = Self;
230
231        #[inline(always)]
232        fn inline_align(_context: fidl::encoding::Context) -> usize {
233            8
234        }
235
236        #[inline(always)]
237        fn inline_size(_context: fidl::encoding::Context) -> usize {
238            16
239        }
240    }
241
242    unsafe impl<D: fidl::encoding::ResourceDialect>
243        fidl::encoding::Encode<MetadataGetPersistedMetadataResponse, D>
244        for &MetadataGetPersistedMetadataResponse
245    {
246        #[inline]
247        unsafe fn encode(
248            self,
249            encoder: &mut fidl::encoding::Encoder<'_, D>,
250            offset: usize,
251            _depth: fidl::encoding::Depth,
252        ) -> fidl::Result<()> {
253            encoder.debug_check_bounds::<MetadataGetPersistedMetadataResponse>(offset);
254            // Delegate to tuple encoding.
255            fidl::encoding::Encode::<MetadataGetPersistedMetadataResponse, D>::encode(
256                (<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(
257                    &self.persisted_metadata,
258                ),),
259                encoder,
260                offset,
261                _depth,
262            )
263        }
264    }
265    unsafe impl<
266        D: fidl::encoding::ResourceDialect,
267        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
268    > fidl::encoding::Encode<MetadataGetPersistedMetadataResponse, D> for (T0,)
269    {
270        #[inline]
271        unsafe fn encode(
272            self,
273            encoder: &mut fidl::encoding::Encoder<'_, D>,
274            offset: usize,
275            depth: fidl::encoding::Depth,
276        ) -> fidl::Result<()> {
277            encoder.debug_check_bounds::<MetadataGetPersistedMetadataResponse>(offset);
278            // Zero out padding regions. There's no need to apply masks
279            // because the unmasked parts will be overwritten by fields.
280            // Write the fields.
281            self.0.encode(encoder, offset + 0, depth)?;
282            Ok(())
283        }
284    }
285
286    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
287        for MetadataGetPersistedMetadataResponse
288    {
289        #[inline(always)]
290        fn new_empty() -> Self {
291            Self { persisted_metadata: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D) }
292        }
293
294        #[inline]
295        unsafe fn decode(
296            &mut self,
297            decoder: &mut fidl::encoding::Decoder<'_, D>,
298            offset: usize,
299            _depth: fidl::encoding::Depth,
300        ) -> fidl::Result<()> {
301            decoder.debug_check_bounds::<Self>(offset);
302            // Verify that padding bytes are zero.
303            fidl::decode!(
304                fidl::encoding::UnboundedVector<u8>,
305                D,
306                &mut self.persisted_metadata,
307                decoder,
308                offset + 0,
309                _depth
310            )?;
311            Ok(())
312        }
313    }
314
315    impl Dictionary {
316        #[inline(always)]
317        fn max_ordinal_present(&self) -> u64 {
318            if let Some(_) = self.entries {
319                return 1;
320            }
321            0
322        }
323    }
324
325    impl fidl::encoding::ValueTypeMarker for Dictionary {
326        type Borrowed<'a> = &'a Self;
327        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
328            value
329        }
330    }
331
332    unsafe impl fidl::encoding::TypeMarker for Dictionary {
333        type Owned = Self;
334
335        #[inline(always)]
336        fn inline_align(_context: fidl::encoding::Context) -> usize {
337            8
338        }
339
340        #[inline(always)]
341        fn inline_size(_context: fidl::encoding::Context) -> usize {
342            16
343        }
344    }
345
346    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Dictionary, D>
347        for &Dictionary
348    {
349        unsafe fn encode(
350            self,
351            encoder: &mut fidl::encoding::Encoder<'_, D>,
352            offset: usize,
353            mut depth: fidl::encoding::Depth,
354        ) -> fidl::Result<()> {
355            encoder.debug_check_bounds::<Dictionary>(offset);
356            // Vector header
357            let max_ordinal: u64 = self.max_ordinal_present();
358            encoder.write_num(max_ordinal, offset);
359            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
360            // Calling encoder.out_of_line_offset(0) is not allowed.
361            if max_ordinal == 0 {
362                return Ok(());
363            }
364            depth.increment()?;
365            let envelope_size = 8;
366            let bytes_len = max_ordinal as usize * envelope_size;
367            #[allow(unused_variables)]
368            let offset = encoder.out_of_line_offset(bytes_len);
369            let mut _prev_end_offset: usize = 0;
370            if 1 > max_ordinal {
371                return Ok(());
372            }
373
374            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
375            // are envelope_size bytes.
376            let cur_offset: usize = (1 - 1) * envelope_size;
377
378            // Zero reserved fields.
379            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
380
381            // Safety:
382            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
383            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
384            //   envelope_size bytes, there is always sufficient room.
385            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<DictionaryEntry, 1024>, D>(
386            self.entries.as_ref().map(<fidl::encoding::Vector<DictionaryEntry, 1024> as fidl::encoding::ValueTypeMarker>::borrow),
387            encoder, offset + cur_offset, depth
388        )?;
389
390            _prev_end_offset = cur_offset + envelope_size;
391
392            Ok(())
393        }
394    }
395
396    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Dictionary {
397        #[inline(always)]
398        fn new_empty() -> Self {
399            Self::default()
400        }
401
402        unsafe fn decode(
403            &mut self,
404            decoder: &mut fidl::encoding::Decoder<'_, D>,
405            offset: usize,
406            mut depth: fidl::encoding::Depth,
407        ) -> fidl::Result<()> {
408            decoder.debug_check_bounds::<Self>(offset);
409            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
410                None => return Err(fidl::Error::NotNullable),
411                Some(len) => len,
412            };
413            // Calling decoder.out_of_line_offset(0) is not allowed.
414            if len == 0 {
415                return Ok(());
416            };
417            depth.increment()?;
418            let envelope_size = 8;
419            let bytes_len = len * envelope_size;
420            let offset = decoder.out_of_line_offset(bytes_len)?;
421            // Decode the envelope for each type.
422            let mut _next_ordinal_to_read = 0;
423            let mut next_offset = offset;
424            let end_offset = offset + bytes_len;
425            _next_ordinal_to_read += 1;
426            if next_offset >= end_offset {
427                return Ok(());
428            }
429
430            // Decode unknown envelopes for gaps in ordinals.
431            while _next_ordinal_to_read < 1 {
432                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
433                _next_ordinal_to_read += 1;
434                next_offset += envelope_size;
435            }
436
437            let next_out_of_line = decoder.next_out_of_line();
438            let handles_before = decoder.remaining_handles();
439            if let Some((inlined, num_bytes, num_handles)) =
440                fidl::encoding::decode_envelope_header(decoder, next_offset)?
441            {
442                let member_inline_size = <fidl::encoding::Vector<DictionaryEntry, 1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
443                if inlined != (member_inline_size <= 4) {
444                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
445                }
446                let inner_offset;
447                let mut inner_depth = depth.clone();
448                if inlined {
449                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
450                    inner_offset = next_offset;
451                } else {
452                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
453                    inner_depth.increment()?;
454                }
455                let val_ref = self.entries.get_or_insert_with(
456                    || fidl::new_empty!(fidl::encoding::Vector<DictionaryEntry, 1024>, D),
457                );
458                fidl::decode!(fidl::encoding::Vector<DictionaryEntry, 1024>, D, val_ref, decoder, inner_offset, inner_depth)?;
459                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
460                {
461                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
462                }
463                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
464                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
465                }
466            }
467
468            next_offset += envelope_size;
469
470            // Decode the remaining unknown envelopes.
471            while next_offset < end_offset {
472                _next_ordinal_to_read += 1;
473                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
474                next_offset += envelope_size;
475            }
476
477            Ok(())
478        }
479    }
480
481    impl fidl::encoding::ValueTypeMarker for DictionaryValue {
482        type Borrowed<'a> = &'a Self;
483        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
484            value
485        }
486    }
487
488    unsafe impl fidl::encoding::TypeMarker for DictionaryValue {
489        type Owned = Self;
490
491        #[inline(always)]
492        fn inline_align(_context: fidl::encoding::Context) -> usize {
493            8
494        }
495
496        #[inline(always)]
497        fn inline_size(_context: fidl::encoding::Context) -> usize {
498            16
499        }
500    }
501
502    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DictionaryValue, D>
503        for &DictionaryValue
504    {
505        #[inline]
506        unsafe fn encode(
507            self,
508            encoder: &mut fidl::encoding::Encoder<'_, D>,
509            offset: usize,
510            _depth: fidl::encoding::Depth,
511        ) -> fidl::Result<()> {
512            encoder.debug_check_bounds::<DictionaryValue>(offset);
513            encoder.write_num::<u64>(self.ordinal(), offset);
514            match self {
515            DictionaryValue::Int64(ref val) => {
516                fidl::encoding::encode_in_envelope::<i64, D>(
517                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(val),
518                    encoder, offset + 8, _depth
519                )
520            }
521            DictionaryValue::Int64Vec(ref val) => {
522                fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<i64, 1024>, D>(
523                    <fidl::encoding::Vector<i64, 1024> as fidl::encoding::ValueTypeMarker>::borrow(val),
524                    encoder, offset + 8, _depth
525                )
526            }
527            DictionaryValue::Str(ref val) => {
528                fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<32768>, D>(
529                    <fidl::encoding::BoundedString<32768> as fidl::encoding::ValueTypeMarker>::borrow(val),
530                    encoder, offset + 8, _depth
531                )
532            }
533            DictionaryValue::StrVec(ref val) => {
534                fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<fidl::encoding::BoundedString<32768>, 1024>, D>(
535                    <fidl::encoding::Vector<fidl::encoding::BoundedString<32768>, 1024> as fidl::encoding::ValueTypeMarker>::borrow(val),
536                    encoder, offset + 8, _depth
537                )
538            }
539            DictionaryValue::Boolean(ref val) => {
540                fidl::encoding::encode_in_envelope::<bool, D>(
541                    <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
542                    encoder, offset + 8, _depth
543                )
544            }
545            DictionaryValue::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
546        }
547        }
548    }
549
550    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DictionaryValue {
551        #[inline(always)]
552        fn new_empty() -> Self {
553            Self::__SourceBreaking { unknown_ordinal: 0 }
554        }
555
556        #[inline]
557        unsafe fn decode(
558            &mut self,
559            decoder: &mut fidl::encoding::Decoder<'_, D>,
560            offset: usize,
561            mut depth: fidl::encoding::Depth,
562        ) -> fidl::Result<()> {
563            decoder.debug_check_bounds::<Self>(offset);
564            #[allow(unused_variables)]
565            let next_out_of_line = decoder.next_out_of_line();
566            let handles_before = decoder.remaining_handles();
567            let (ordinal, inlined, num_bytes, num_handles) =
568                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
569
570            let member_inline_size = match ordinal {
571            1 => <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
572            2 => <fidl::encoding::Vector<i64, 1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
573            3 => <fidl::encoding::BoundedString<32768> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
574            4 => <fidl::encoding::Vector<fidl::encoding::BoundedString<32768>, 1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
575            5 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
576            0 => return Err(fidl::Error::UnknownUnionTag),
577            _ => num_bytes as usize,
578        };
579
580            if inlined != (member_inline_size <= 4) {
581                return Err(fidl::Error::InvalidInlineBitInEnvelope);
582            }
583            let _inner_offset;
584            if inlined {
585                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
586                _inner_offset = offset + 8;
587            } else {
588                depth.increment()?;
589                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
590            }
591            match ordinal {
592                1 => {
593                    #[allow(irrefutable_let_patterns)]
594                    if let DictionaryValue::Int64(_) = self {
595                        // Do nothing, read the value into the object
596                    } else {
597                        // Initialize `self` to the right variant
598                        *self = DictionaryValue::Int64(fidl::new_empty!(i64, D));
599                    }
600                    #[allow(irrefutable_let_patterns)]
601                    if let DictionaryValue::Int64(ref mut val) = self {
602                        fidl::decode!(i64, D, val, decoder, _inner_offset, depth)?;
603                    } else {
604                        unreachable!()
605                    }
606                }
607                2 => {
608                    #[allow(irrefutable_let_patterns)]
609                    if let DictionaryValue::Int64Vec(_) = self {
610                        // Do nothing, read the value into the object
611                    } else {
612                        // Initialize `self` to the right variant
613                        *self = DictionaryValue::Int64Vec(
614                            fidl::new_empty!(fidl::encoding::Vector<i64, 1024>, D),
615                        );
616                    }
617                    #[allow(irrefutable_let_patterns)]
618                    if let DictionaryValue::Int64Vec(ref mut val) = self {
619                        fidl::decode!(fidl::encoding::Vector<i64, 1024>, D, val, decoder, _inner_offset, depth)?;
620                    } else {
621                        unreachable!()
622                    }
623                }
624                3 => {
625                    #[allow(irrefutable_let_patterns)]
626                    if let DictionaryValue::Str(_) = self {
627                        // Do nothing, read the value into the object
628                    } else {
629                        // Initialize `self` to the right variant
630                        *self = DictionaryValue::Str(fidl::new_empty!(
631                            fidl::encoding::BoundedString<32768>,
632                            D
633                        ));
634                    }
635                    #[allow(irrefutable_let_patterns)]
636                    if let DictionaryValue::Str(ref mut val) = self {
637                        fidl::decode!(
638                            fidl::encoding::BoundedString<32768>,
639                            D,
640                            val,
641                            decoder,
642                            _inner_offset,
643                            depth
644                        )?;
645                    } else {
646                        unreachable!()
647                    }
648                }
649                4 => {
650                    #[allow(irrefutable_let_patterns)]
651                    if let DictionaryValue::StrVec(_) = self {
652                        // Do nothing, read the value into the object
653                    } else {
654                        // Initialize `self` to the right variant
655                        *self = DictionaryValue::StrVec(fidl::new_empty!(
656                            fidl::encoding::Vector<fidl::encoding::BoundedString<32768>, 1024>,
657                            D
658                        ));
659                    }
660                    #[allow(irrefutable_let_patterns)]
661                    if let DictionaryValue::StrVec(ref mut val) = self {
662                        fidl::decode!(
663                            fidl::encoding::Vector<fidl::encoding::BoundedString<32768>, 1024>,
664                            D,
665                            val,
666                            decoder,
667                            _inner_offset,
668                            depth
669                        )?;
670                    } else {
671                        unreachable!()
672                    }
673                }
674                5 => {
675                    #[allow(irrefutable_let_patterns)]
676                    if let DictionaryValue::Boolean(_) = self {
677                        // Do nothing, read the value into the object
678                    } else {
679                        // Initialize `self` to the right variant
680                        *self = DictionaryValue::Boolean(fidl::new_empty!(bool, D));
681                    }
682                    #[allow(irrefutable_let_patterns)]
683                    if let DictionaryValue::Boolean(ref mut val) = self {
684                        fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
685                    } else {
686                        unreachable!()
687                    }
688                }
689                #[allow(deprecated)]
690                ordinal => {
691                    for _ in 0..num_handles {
692                        decoder.drop_next_handle()?;
693                    }
694                    *self = DictionaryValue::__SourceBreaking { unknown_ordinal: ordinal };
695                }
696            }
697            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
698                return Err(fidl::Error::InvalidNumBytesInEnvelope);
699            }
700            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
701                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
702            }
703            Ok(())
704        }
705    }
706}