Skip to main content

fidl_next_common_fuchsia_driver_metadata/
fidl_next_common_fuchsia_driver_metadata.rs

1// DO NOT EDIT: This file is machine-generated by fidlgen
2#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7    #[doc = " A dictionary\'s value is an integer or a list of integers.\n"]
8    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9    pub enum DictionaryValue {
10        Int64(i64),
11
12        Int64Vec(::std::vec::Vec<i64>),
13
14        Str(::std::string::String),
15
16        StrVec(::std::vec::Vec<::std::string::String>),
17
18        Boolean(bool),
19
20        UnknownOrdinal_(u64),
21    }
22
23    impl DictionaryValue {
24        pub fn is_unknown(&self) -> bool {
25            #[allow(unreachable_patterns)]
26            match self {
27                Self::UnknownOrdinal_(_) => true,
28                _ => false,
29            }
30        }
31    }
32
33    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DictionaryValue<'static>, ___E>
34        for DictionaryValue
35    where
36        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
37        ___E: ::fidl_next::Encoder,
38    {
39        #[inline]
40        fn encode(
41            self,
42            encoder: &mut ___E,
43            out: &mut ::core::mem::MaybeUninit<crate::wire::DictionaryValue<'static>>,
44            _: (),
45        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
46            ::fidl_next::munge!(let crate::wire::DictionaryValue { raw, _phantom: _ } = out);
47
48            match self {
49                Self::Int64(value) => ::fidl_next::wire::Union::encode_as::<
50                    ___E,
51                    ::fidl_next::wire::Int64,
52                >(value, 1, encoder, raw, ())?,
53
54                Self::Int64Vec(value) => ::fidl_next::wire::Union::encode_as::<
55                    ___E,
56                    ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Int64>,
57                >(value, 2, encoder, raw, (1024, ()))?,
58
59                Self::Str(value) => ::fidl_next::wire::Union::encode_as::<
60                    ___E,
61                    ::fidl_next::wire::String<'static>,
62                >(value, 3, encoder, raw, 32768)?,
63
64                Self::StrVec(value) => ::fidl_next::wire::Union::encode_as::<
65                    ___E,
66                    ::fidl_next::wire::Vector<'static, ::fidl_next::wire::String<'static>>,
67                >(value, 4, encoder, raw, (1024, 32768))?,
68
69                Self::Boolean(value) => {
70                    ::fidl_next::wire::Union::encode_as::<___E, bool>(value, 5, encoder, raw, ())?
71                }
72
73                Self::UnknownOrdinal_(ordinal) => {
74                    return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
75                }
76            }
77
78            Ok(())
79        }
80    }
81
82    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DictionaryValue<'static>, ___E>
83        for &'a DictionaryValue
84    where
85        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
86        ___E: ::fidl_next::Encoder,
87    {
88        #[inline]
89        fn encode(
90            self,
91            encoder: &mut ___E,
92            out: &mut ::core::mem::MaybeUninit<crate::wire::DictionaryValue<'static>>,
93            _: (),
94        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
95            ::fidl_next::munge!(let crate::wire::DictionaryValue { raw, _phantom: _ } = out);
96
97            match self {
98                DictionaryValue::Int64(value) => ::fidl_next::wire::Union::encode_as::<
99                    ___E,
100                    ::fidl_next::wire::Int64,
101                >(value, 1, encoder, raw, ())?,
102
103                DictionaryValue::Int64Vec(value) => {
104                    ::fidl_next::wire::Union::encode_as::<
105                        ___E,
106                        ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Int64>,
107                    >(value, 2, encoder, raw, (1024, ()))?
108                }
109
110                DictionaryValue::Str(value) => ::fidl_next::wire::Union::encode_as::<
111                    ___E,
112                    ::fidl_next::wire::String<'static>,
113                >(value, 3, encoder, raw, 32768)?,
114
115                DictionaryValue::StrVec(value) => {
116                    ::fidl_next::wire::Union::encode_as::<
117                        ___E,
118                        ::fidl_next::wire::Vector<'static, ::fidl_next::wire::String<'static>>,
119                    >(value, 4, encoder, raw, (1024, 32768))?
120                }
121
122                DictionaryValue::Boolean(value) => {
123                    ::fidl_next::wire::Union::encode_as::<___E, bool>(value, 5, encoder, raw, ())?
124                }
125
126                DictionaryValue::UnknownOrdinal_(ordinal) => {
127                    return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
128                }
129            }
130
131            Ok(())
132        }
133    }
134
135    unsafe impl<___E>
136        ::fidl_next::EncodeOption<crate::wire_optional::DictionaryValue<'static>, ___E>
137        for DictionaryValue
138    where
139        ___E: ?Sized,
140        DictionaryValue: ::fidl_next::Encode<crate::wire::DictionaryValue<'static>, ___E>,
141    {
142        #[inline]
143        fn encode_option(
144            this: ::core::option::Option<Self>,
145            encoder: &mut ___E,
146            out: &mut ::core::mem::MaybeUninit<crate::wire_optional::DictionaryValue<'static>>,
147            _: (),
148        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
149            ::fidl_next::munge!(let crate::wire_optional::DictionaryValue { raw, _phantom: _ } = &mut *out);
150
151            if let Some(inner) = this {
152                let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
153                ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
154            } else {
155                ::fidl_next::wire::Union::encode_absent(raw);
156            }
157
158            Ok(())
159        }
160    }
161
162    unsafe impl<'a, ___E>
163        ::fidl_next::EncodeOption<crate::wire_optional::DictionaryValue<'static>, ___E>
164        for &'a DictionaryValue
165    where
166        ___E: ?Sized,
167        &'a DictionaryValue: ::fidl_next::Encode<crate::wire::DictionaryValue<'static>, ___E>,
168    {
169        #[inline]
170        fn encode_option(
171            this: ::core::option::Option<Self>,
172            encoder: &mut ___E,
173            out: &mut ::core::mem::MaybeUninit<crate::wire_optional::DictionaryValue<'static>>,
174            _: (),
175        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
176            ::fidl_next::munge!(let crate::wire_optional::DictionaryValue { raw, _phantom: _ } = &mut *out);
177
178            if let Some(inner) = this {
179                let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
180                ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
181            } else {
182                ::fidl_next::wire::Union::encode_absent(raw);
183            }
184
185            Ok(())
186        }
187    }
188
189    impl<'de> ::fidl_next::FromWire<crate::wire::DictionaryValue<'de>> for DictionaryValue {
190        #[inline]
191        fn from_wire(wire: crate::wire::DictionaryValue<'de>) -> Self {
192            let wire = ::core::mem::ManuallyDrop::new(wire);
193            match wire.raw.ordinal() {
194                1 => Self::Int64(::fidl_next::FromWire::from_wire(unsafe {
195                    wire.raw.get().read_unchecked::<::fidl_next::wire::Int64>()
196                })),
197
198                2 => {
199                    Self::Int64Vec(::fidl_next::FromWire::from_wire(unsafe {
200                        wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>>()
201                    }))
202                }
203
204                3 => Self::Str(::fidl_next::FromWire::from_wire(unsafe {
205                    wire.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
206                })),
207
208                4 => Self::StrVec(::fidl_next::FromWire::from_wire(unsafe {
209                    wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
210                })),
211
212                5 => Self::Boolean(::fidl_next::FromWire::from_wire(unsafe {
213                    wire.raw.get().read_unchecked::<bool>()
214                })),
215
216                ord => return Self::UnknownOrdinal_(ord as u64),
217            }
218        }
219    }
220
221    impl<'de> ::fidl_next::FromWireRef<crate::wire::DictionaryValue<'de>> for DictionaryValue {
222        #[inline]
223        fn from_wire_ref(wire: &crate::wire::DictionaryValue<'de>) -> Self {
224            match wire.raw.ordinal() {
225                1 => Self::Int64(::fidl_next::FromWireRef::from_wire_ref(unsafe {
226                    wire.raw.get().deref_unchecked::<::fidl_next::wire::Int64>()
227                })),
228
229                2 => Self::Int64Vec(::fidl_next::FromWireRef::from_wire_ref(unsafe {
230                    wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>>()
231                })),
232
233                3 => Self::Str(::fidl_next::FromWireRef::from_wire_ref(unsafe {
234                    wire.raw.get().deref_unchecked::<::fidl_next::wire::String<'de>>()
235                })),
236
237                4 => Self::StrVec(::fidl_next::FromWireRef::from_wire_ref(unsafe {
238                    wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
239                })),
240
241                5 => Self::Boolean(::fidl_next::FromWireRef::from_wire_ref(unsafe {
242                    wire.raw.get().deref_unchecked::<bool>()
243                })),
244
245                ord => return Self::UnknownOrdinal_(ord as u64),
246            }
247        }
248    }
249
250    impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::DictionaryValue<'de>>
251        for DictionaryValue
252    {
253        #[inline]
254        fn from_wire_option(
255            wire: crate::wire_optional::DictionaryValue<'de>,
256        ) -> ::core::option::Option<Self> {
257            if let Some(inner) = wire.into_option() {
258                Some(::fidl_next::FromWire::from_wire(inner))
259            } else {
260                None
261            }
262        }
263    }
264
265    impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::DictionaryValue<'de>>
266        for Box<DictionaryValue>
267    {
268        #[inline]
269        fn from_wire_option(
270            wire: crate::wire_optional::DictionaryValue<'de>,
271        ) -> ::core::option::Option<Self> {
272            <DictionaryValue as ::fidl_next::FromWireOption<
273                crate::wire_optional::DictionaryValue<'de>,
274            >>::from_wire_option(wire)
275            .map(Box::new)
276        }
277    }
278
279    impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::DictionaryValue<'de>>
280        for Box<DictionaryValue>
281    {
282        #[inline]
283        fn from_wire_option_ref(
284            wire: &crate::wire_optional::DictionaryValue<'de>,
285        ) -> ::core::option::Option<Self> {
286            if let Some(inner) = wire.as_ref() {
287                Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
288            } else {
289                None
290            }
291        }
292    }
293
294    #[doc = " A key/value pair in a `Dictionary`.\n"]
295    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
296    pub struct DictionaryEntry {
297        pub key: ::std::string::String,
298
299        pub value: crate::natural::DictionaryValue,
300    }
301
302    unsafe impl<___E> ::fidl_next::Encode<crate::wire::DictionaryEntry<'static>, ___E>
303        for DictionaryEntry
304    where
305        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
306        ___E: ::fidl_next::Encoder,
307    {
308        #[inline]
309        fn encode(
310            self,
311            encoder_: &mut ___E,
312            out_: &mut ::core::mem::MaybeUninit<crate::wire::DictionaryEntry<'static>>,
313            _: (),
314        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
315            ::fidl_next::munge! {
316                let crate::wire::DictionaryEntry {
317                    key,
318                    value,
319
320                } = out_;
321            }
322
323            ::fidl_next::Encode::encode(self.key, encoder_, key, 1024)?;
324
325            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(key.as_mut_ptr()) };
326            ::fidl_next::Constrained::validate(_field, 1024)?;
327
328            ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
329
330            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
331
332            Ok(())
333        }
334    }
335
336    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DictionaryEntry<'static>, ___E>
337        for &'a DictionaryEntry
338    where
339        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
340        ___E: ::fidl_next::Encoder,
341    {
342        #[inline]
343        fn encode(
344            self,
345            encoder_: &mut ___E,
346            out_: &mut ::core::mem::MaybeUninit<crate::wire::DictionaryEntry<'static>>,
347            _: (),
348        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
349            ::fidl_next::munge! {
350                let crate::wire::DictionaryEntry {
351                    key,
352                    value,
353
354                } = out_;
355            }
356
357            ::fidl_next::Encode::encode(&self.key, encoder_, key, 1024)?;
358
359            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(key.as_mut_ptr()) };
360            ::fidl_next::Constrained::validate(_field, 1024)?;
361
362            ::fidl_next::Encode::encode(&self.value, encoder_, value, ())?;
363
364            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
365
366            Ok(())
367        }
368    }
369
370    unsafe impl<___E>
371        ::fidl_next::EncodeOption<
372            ::fidl_next::wire::Box<'static, crate::wire::DictionaryEntry<'static>>,
373            ___E,
374        > for DictionaryEntry
375    where
376        ___E: ::fidl_next::Encoder + ?Sized,
377        DictionaryEntry: ::fidl_next::Encode<crate::wire::DictionaryEntry<'static>, ___E>,
378    {
379        #[inline]
380        fn encode_option(
381            this: ::core::option::Option<Self>,
382            encoder: &mut ___E,
383            out: &mut ::core::mem::MaybeUninit<
384                ::fidl_next::wire::Box<'static, crate::wire::DictionaryEntry<'static>>,
385            >,
386            _: (),
387        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
388            if let Some(inner) = this {
389                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
390                ::fidl_next::wire::Box::encode_present(out);
391            } else {
392                ::fidl_next::wire::Box::encode_absent(out);
393            }
394
395            Ok(())
396        }
397    }
398
399    unsafe impl<'a, ___E>
400        ::fidl_next::EncodeOption<
401            ::fidl_next::wire::Box<'static, crate::wire::DictionaryEntry<'static>>,
402            ___E,
403        > for &'a DictionaryEntry
404    where
405        ___E: ::fidl_next::Encoder + ?Sized,
406        &'a DictionaryEntry: ::fidl_next::Encode<crate::wire::DictionaryEntry<'static>, ___E>,
407    {
408        #[inline]
409        fn encode_option(
410            this: ::core::option::Option<Self>,
411            encoder: &mut ___E,
412            out: &mut ::core::mem::MaybeUninit<
413                ::fidl_next::wire::Box<'static, crate::wire::DictionaryEntry<'static>>,
414            >,
415            _: (),
416        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
417            if let Some(inner) = this {
418                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
419                ::fidl_next::wire::Box::encode_present(out);
420            } else {
421                ::fidl_next::wire::Box::encode_absent(out);
422            }
423
424            Ok(())
425        }
426    }
427
428    impl<'de> ::fidl_next::FromWire<crate::wire::DictionaryEntry<'de>> for DictionaryEntry {
429        #[inline]
430        fn from_wire(wire: crate::wire::DictionaryEntry<'de>) -> Self {
431            Self {
432                key: ::fidl_next::FromWire::from_wire(wire.key),
433
434                value: ::fidl_next::FromWire::from_wire(wire.value),
435            }
436        }
437    }
438
439    impl<'de> ::fidl_next::FromWireRef<crate::wire::DictionaryEntry<'de>> for DictionaryEntry {
440        #[inline]
441        fn from_wire_ref(wire: &crate::wire::DictionaryEntry<'de>) -> Self {
442            Self {
443                key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
444
445                value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value),
446            }
447        }
448    }
449
450    #[doc = " A dictionary-like structure for generic metadata.\n"]
451    #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
452    pub struct Dictionary {
453        pub entries: ::core::option::Option<::std::vec::Vec<crate::natural::DictionaryEntry>>,
454    }
455
456    impl Dictionary {
457        fn __max_ordinal(&self) -> usize {
458            if self.entries.is_some() {
459                return 1;
460            }
461
462            0
463        }
464    }
465
466    unsafe impl<___E> ::fidl_next::Encode<crate::wire::Dictionary<'static>, ___E> for Dictionary
467    where
468        ___E: ::fidl_next::Encoder + ?Sized,
469    {
470        #[inline]
471        fn encode(
472            mut self,
473            encoder: &mut ___E,
474            out: &mut ::core::mem::MaybeUninit<crate::wire::Dictionary<'static>>,
475            _: (),
476        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
477            ::fidl_next::munge!(let crate::wire::Dictionary { table } = out);
478
479            let max_ord = self.__max_ordinal();
480
481            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
482            ::fidl_next::Wire::zero_padding(&mut out);
483
484            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
485                ::fidl_next::wire::Envelope,
486            >(encoder, max_ord);
487
488            for i in 1..=max_ord {
489                match i {
490                    1 => {
491                        if let Some(value) = self.entries.take() {
492                            ::fidl_next::wire::Envelope::encode_value::<
493                                ::fidl_next::wire::Vector<
494                                    'static,
495                                    crate::wire::DictionaryEntry<'static>,
496                                >,
497                                ___E,
498                            >(
499                                value, preallocated.encoder, &mut out, (1024, ())
500                            )?;
501                        } else {
502                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
503                        }
504                    }
505
506                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
507                }
508                unsafe {
509                    preallocated.write_next(out.assume_init_ref());
510                }
511            }
512
513            ::fidl_next::wire::Table::encode_len(table, max_ord);
514
515            Ok(())
516        }
517    }
518
519    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Dictionary<'static>, ___E> for &'a Dictionary
520    where
521        ___E: ::fidl_next::Encoder + ?Sized,
522    {
523        #[inline]
524        fn encode(
525            self,
526            encoder: &mut ___E,
527            out: &mut ::core::mem::MaybeUninit<crate::wire::Dictionary<'static>>,
528            _: (),
529        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
530            ::fidl_next::munge!(let crate::wire::Dictionary { table } = out);
531
532            let max_ord = self.__max_ordinal();
533
534            let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
535            ::fidl_next::Wire::zero_padding(&mut out);
536
537            let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
538                ::fidl_next::wire::Envelope,
539            >(encoder, max_ord);
540
541            for i in 1..=max_ord {
542                match i {
543                    1 => {
544                        if let Some(value) = &self.entries {
545                            ::fidl_next::wire::Envelope::encode_value::<
546                                ::fidl_next::wire::Vector<
547                                    'static,
548                                    crate::wire::DictionaryEntry<'static>,
549                                >,
550                                ___E,
551                            >(
552                                value, preallocated.encoder, &mut out, (1024, ())
553                            )?;
554                        } else {
555                            ::fidl_next::wire::Envelope::encode_zero(&mut out)
556                        }
557                    }
558
559                    _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
560                }
561                unsafe {
562                    preallocated.write_next(out.assume_init_ref());
563                }
564            }
565
566            ::fidl_next::wire::Table::encode_len(table, max_ord);
567
568            Ok(())
569        }
570    }
571
572    impl<'de> ::fidl_next::FromWire<crate::wire::Dictionary<'de>> for Dictionary {
573        #[inline]
574        fn from_wire(wire_: crate::wire::Dictionary<'de>) -> Self {
575            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
576
577            let entries = wire_.table.get(1);
578
579            Self {
580
581
582                entries: entries.map(|envelope| ::fidl_next::FromWire::from_wire(
583                    unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DictionaryEntry<'de>>>() }
584                )),
585
586        }
587        }
588    }
589
590    impl<'de> ::fidl_next::FromWireRef<crate::wire::Dictionary<'de>> for Dictionary {
591        #[inline]
592        fn from_wire_ref(wire: &crate::wire::Dictionary<'de>) -> Self {
593            Self {
594
595
596                entries: wire.table.get(1)
597                    .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
598                        unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DictionaryEntry<'de>>>() }
599                    )),
600
601        }
602        }
603    }
604
605    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
606    pub struct MetadataGetPersistedMetadataResponse {
607        pub persisted_metadata: ::std::vec::Vec<u8>,
608    }
609
610    unsafe impl<___E>
611        ::fidl_next::Encode<crate::wire::MetadataGetPersistedMetadataResponse<'static>, ___E>
612        for MetadataGetPersistedMetadataResponse
613    where
614        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
615        ___E: ::fidl_next::Encoder,
616    {
617        #[inline]
618        fn encode(
619            self,
620            encoder_: &mut ___E,
621            out_: &mut ::core::mem::MaybeUninit<
622                crate::wire::MetadataGetPersistedMetadataResponse<'static>,
623            >,
624            _: (),
625        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
626            ::fidl_next::munge! {
627                let crate::wire::MetadataGetPersistedMetadataResponse {
628                    persisted_metadata,
629
630                } = out_;
631            }
632
633            ::fidl_next::Encode::encode(
634                self.persisted_metadata,
635                encoder_,
636                persisted_metadata,
637                (4294967295, ()),
638            )?;
639
640            let mut _field =
641                unsafe { ::fidl_next::Slot::new_unchecked(persisted_metadata.as_mut_ptr()) };
642            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
643
644            Ok(())
645        }
646    }
647
648    unsafe impl<'a, ___E>
649        ::fidl_next::Encode<crate::wire::MetadataGetPersistedMetadataResponse<'static>, ___E>
650        for &'a MetadataGetPersistedMetadataResponse
651    where
652        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
653        ___E: ::fidl_next::Encoder,
654    {
655        #[inline]
656        fn encode(
657            self,
658            encoder_: &mut ___E,
659            out_: &mut ::core::mem::MaybeUninit<
660                crate::wire::MetadataGetPersistedMetadataResponse<'static>,
661            >,
662            _: (),
663        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
664            ::fidl_next::munge! {
665                let crate::wire::MetadataGetPersistedMetadataResponse {
666                    persisted_metadata,
667
668                } = out_;
669            }
670
671            ::fidl_next::Encode::encode(
672                &self.persisted_metadata,
673                encoder_,
674                persisted_metadata,
675                (4294967295, ()),
676            )?;
677
678            let mut _field =
679                unsafe { ::fidl_next::Slot::new_unchecked(persisted_metadata.as_mut_ptr()) };
680            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
681
682            Ok(())
683        }
684    }
685
686    unsafe impl<___E>
687        ::fidl_next::EncodeOption<
688            ::fidl_next::wire::Box<
689                'static,
690                crate::wire::MetadataGetPersistedMetadataResponse<'static>,
691            >,
692            ___E,
693        > for MetadataGetPersistedMetadataResponse
694    where
695        ___E: ::fidl_next::Encoder + ?Sized,
696        MetadataGetPersistedMetadataResponse:
697            ::fidl_next::Encode<crate::wire::MetadataGetPersistedMetadataResponse<'static>, ___E>,
698    {
699        #[inline]
700        fn encode_option(
701            this: ::core::option::Option<Self>,
702            encoder: &mut ___E,
703            out: &mut ::core::mem::MaybeUninit<
704                ::fidl_next::wire::Box<
705                    'static,
706                    crate::wire::MetadataGetPersistedMetadataResponse<'static>,
707                >,
708            >,
709            _: (),
710        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
711            if let Some(inner) = this {
712                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
713                ::fidl_next::wire::Box::encode_present(out);
714            } else {
715                ::fidl_next::wire::Box::encode_absent(out);
716            }
717
718            Ok(())
719        }
720    }
721
722    unsafe impl<'a, ___E>
723        ::fidl_next::EncodeOption<
724            ::fidl_next::wire::Box<
725                'static,
726                crate::wire::MetadataGetPersistedMetadataResponse<'static>,
727            >,
728            ___E,
729        > for &'a MetadataGetPersistedMetadataResponse
730    where
731        ___E: ::fidl_next::Encoder + ?Sized,
732        &'a MetadataGetPersistedMetadataResponse:
733            ::fidl_next::Encode<crate::wire::MetadataGetPersistedMetadataResponse<'static>, ___E>,
734    {
735        #[inline]
736        fn encode_option(
737            this: ::core::option::Option<Self>,
738            encoder: &mut ___E,
739            out: &mut ::core::mem::MaybeUninit<
740                ::fidl_next::wire::Box<
741                    'static,
742                    crate::wire::MetadataGetPersistedMetadataResponse<'static>,
743                >,
744            >,
745            _: (),
746        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
747            if let Some(inner) = this {
748                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
749                ::fidl_next::wire::Box::encode_present(out);
750            } else {
751                ::fidl_next::wire::Box::encode_absent(out);
752            }
753
754            Ok(())
755        }
756    }
757
758    impl<'de> ::fidl_next::FromWire<crate::wire::MetadataGetPersistedMetadataResponse<'de>>
759        for MetadataGetPersistedMetadataResponse
760    {
761        #[inline]
762        fn from_wire(wire: crate::wire::MetadataGetPersistedMetadataResponse<'de>) -> Self {
763            Self { persisted_metadata: ::fidl_next::FromWire::from_wire(wire.persisted_metadata) }
764        }
765    }
766
767    impl<'de> ::fidl_next::FromWireRef<crate::wire::MetadataGetPersistedMetadataResponse<'de>>
768        for MetadataGetPersistedMetadataResponse
769    {
770        #[inline]
771        fn from_wire_ref(wire: &crate::wire::MetadataGetPersistedMetadataResponse<'de>) -> Self {
772            Self {
773                persisted_metadata: ::fidl_next::FromWireRef::from_wire_ref(
774                    &wire.persisted_metadata,
775                ),
776            }
777        }
778    }
779}
780
781pub mod wire {
782
783    /// The wire type corresponding to [`DictionaryValue`].
784    #[repr(transparent)]
785    pub struct DictionaryValue<'de> {
786        pub(crate) raw: ::fidl_next::wire::Union,
787        pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
788    }
789
790    impl<'de> Drop for DictionaryValue<'de> {
791        fn drop(&mut self) {
792            match self.raw.ordinal() {
793                1 => {
794                    let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Int64>() };
795                }
796
797                2 => {
798                    let _ = unsafe {
799                        self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>>()
800                    };
801                }
802
803                3 => {
804                    let _ = unsafe {
805                        self.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
806                    };
807                }
808
809                4 => {
810                    let _ = unsafe {
811                        self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
812                    };
813                }
814
815                5 => {
816                    let _ = unsafe { self.raw.get().read_unchecked::<bool>() };
817                }
818
819                _ => (),
820            }
821        }
822    }
823
824    impl ::fidl_next::Constrained for DictionaryValue<'_> {
825        type Constraint = ();
826
827        fn validate(
828            _: ::fidl_next::Slot<'_, Self>,
829            _: Self::Constraint,
830        ) -> Result<(), ::fidl_next::ValidationError> {
831            Ok(())
832        }
833    }
834
835    unsafe impl ::fidl_next::Wire for DictionaryValue<'static> {
836        type Narrowed<'de> = DictionaryValue<'de>;
837
838        #[inline]
839        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
840            ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
841            ::fidl_next::wire::Union::zero_padding(raw);
842        }
843    }
844
845    pub mod dictionary_value {
846        pub enum Ref<'de> {
847            Int64(&'de ::fidl_next::wire::Int64),
848
849            Int64Vec(&'de ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>),
850
851            Str(&'de ::fidl_next::wire::String<'de>),
852
853            StrVec(&'de ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>),
854
855            Boolean(&'de bool),
856
857            UnknownOrdinal_(u64),
858        }
859
860        pub enum Value<'de> {
861            Int64(::fidl_next::wire::Int64),
862
863            Int64Vec(::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>),
864
865            Str(::fidl_next::wire::String<'de>),
866
867            StrVec(::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>),
868
869            Boolean(bool),
870
871            UnknownOrdinal_(u64),
872        }
873    }
874
875    impl<'de> DictionaryValue<'de> {
876        pub fn as_ref(&self) -> crate::wire::dictionary_value::Ref<'_> {
877            match self.raw.ordinal() {
878                1 => crate::wire::dictionary_value::Ref::Int64(unsafe {
879                    self.raw.get().deref_unchecked::<::fidl_next::wire::Int64>()
880                }),
881
882                2 => {
883                    crate::wire::dictionary_value::Ref::Int64Vec(unsafe {
884                        self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Int64>>()
885                    })
886                }
887
888                3 => crate::wire::dictionary_value::Ref::Str(unsafe {
889                    self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>()
890                }),
891
892                4 => crate::wire::dictionary_value::Ref::StrVec(unsafe {
893                    self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::String<'_>>>()
894                }),
895
896                5 => crate::wire::dictionary_value::Ref::Boolean(unsafe {
897                    self.raw.get().deref_unchecked::<bool>()
898                }),
899
900                unknown => crate::wire::dictionary_value::Ref::UnknownOrdinal_(unknown),
901            }
902        }
903
904        pub fn into_inner(self) -> crate::wire::dictionary_value::Value<'de> {
905            let this = ::core::mem::ManuallyDrop::new(self);
906
907            match this.raw.ordinal() {
908                1 => crate::wire::dictionary_value::Value::Int64(unsafe {
909                    this.raw.get().read_unchecked::<::fidl_next::wire::Int64>()
910                }),
911
912                2 => {
913                    crate::wire::dictionary_value::Value::Int64Vec(unsafe {
914                        this.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>>()
915                    })
916                }
917
918                3 => crate::wire::dictionary_value::Value::Str(unsafe {
919                    this.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
920                }),
921
922                4 => crate::wire::dictionary_value::Value::StrVec(unsafe {
923                    this.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
924                }),
925
926                5 => crate::wire::dictionary_value::Value::Boolean(unsafe {
927                    this.raw.get().read_unchecked::<bool>()
928                }),
929
930                unknown => crate::wire::dictionary_value::Value::UnknownOrdinal_(unknown),
931            }
932        }
933    }
934
935    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DictionaryValue<'de>
936    where
937        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
938        ___D: ::fidl_next::Decoder<'de>,
939    {
940        fn decode(
941            mut slot: ::fidl_next::Slot<'_, Self>,
942            decoder: &mut ___D,
943            _: (),
944        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
945            ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
946            match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
947                1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int64>(
948                    raw,
949                    decoder,
950                    (),
951                )?,
952
953                2 => ::fidl_next::wire::Union::decode_as::<
954                    ___D,
955                    ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>,
956                >(raw, decoder, (1024, ()))?,
957
958                3 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
959                    raw, decoder, 32768,
960                )?,
961
962                4 => ::fidl_next::wire::Union::decode_as::<
963                    ___D,
964                    ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>,
965                >(raw, decoder, (1024, 32768))?,
966
967                5 => ::fidl_next::wire::Union::decode_as::<___D, bool>(raw, decoder, ())?,
968
969                _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
970            }
971
972            Ok(())
973        }
974    }
975
976    impl<'de> ::core::fmt::Debug for DictionaryValue<'de> {
977        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
978            match self.raw.ordinal() {
979                1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::wire::Int64>().fmt(f) },
980                2 => unsafe {
981                    self.raw
982                        .get()
983                        .deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Int64>>(
984                        )
985                        .fmt(f)
986                },
987                3 => unsafe {
988                    self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>().fmt(f)
989                },
990                4 => unsafe {
991                    self.raw.get().deref_unchecked::<
992                            ::fidl_next::wire::Vector<'_, ::fidl_next::wire::String<'_>>
993                        >().fmt(f)
994                },
995                5 => unsafe { self.raw.get().deref_unchecked::<bool>().fmt(f) },
996                _ => unsafe { ::core::hint::unreachable_unchecked() },
997            }
998        }
999    }
1000
1001    impl<'de> ::fidl_next::IntoNatural for DictionaryValue<'de> {
1002        type Natural = crate::natural::DictionaryValue;
1003    }
1004
1005    /// The wire type corresponding to [`DictionaryEntry`].
1006    #[derive(Debug)]
1007    #[repr(C)]
1008    pub struct DictionaryEntry<'de> {
1009        pub key: ::fidl_next::wire::String<'de>,
1010
1011        pub value: crate::wire::DictionaryValue<'de>,
1012    }
1013
1014    static_assertions::const_assert_eq!(std::mem::size_of::<DictionaryEntry<'_>>(), 32);
1015    static_assertions::const_assert_eq!(std::mem::align_of::<DictionaryEntry<'_>>(), 8);
1016
1017    static_assertions::const_assert_eq!(std::mem::offset_of!(DictionaryEntry<'_>, key), 0);
1018
1019    static_assertions::const_assert_eq!(std::mem::offset_of!(DictionaryEntry<'_>, value), 16);
1020
1021    impl ::fidl_next::Constrained for DictionaryEntry<'_> {
1022        type Constraint = ();
1023
1024        fn validate(
1025            _: ::fidl_next::Slot<'_, Self>,
1026            _: Self::Constraint,
1027        ) -> Result<(), ::fidl_next::ValidationError> {
1028            Ok(())
1029        }
1030    }
1031
1032    unsafe impl ::fidl_next::Wire for DictionaryEntry<'static> {
1033        type Narrowed<'de> = DictionaryEntry<'de>;
1034
1035        #[inline]
1036        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1037            ::fidl_next::munge! {
1038                let Self {
1039                    key,
1040                    value,
1041
1042                } = &mut *out_;
1043            }
1044
1045            ::fidl_next::Wire::zero_padding(key);
1046
1047            ::fidl_next::Wire::zero_padding(value);
1048        }
1049    }
1050
1051    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DictionaryEntry<'de>
1052    where
1053        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1054        ___D: ::fidl_next::Decoder<'de>,
1055    {
1056        fn decode(
1057            slot_: ::fidl_next::Slot<'_, Self>,
1058            decoder_: &mut ___D,
1059            _: (),
1060        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1061            ::fidl_next::munge! {
1062                let Self {
1063                    mut key,
1064                    mut value,
1065
1066                } = slot_;
1067            }
1068
1069            let _field = key.as_mut();
1070            ::fidl_next::Constrained::validate(_field, 1024)?;
1071            ::fidl_next::Decode::decode(key.as_mut(), decoder_, 1024)?;
1072
1073            let key = unsafe { key.deref_unchecked() };
1074
1075            if key.len() > 1024 {
1076                return Err(::fidl_next::DecodeError::VectorTooLong {
1077                    size: key.len() as u64,
1078                    limit: 1024,
1079                });
1080            }
1081
1082            let _field = value.as_mut();
1083
1084            ::fidl_next::Decode::decode(value.as_mut(), decoder_, ())?;
1085
1086            Ok(())
1087        }
1088    }
1089
1090    impl<'de> ::fidl_next::IntoNatural for DictionaryEntry<'de> {
1091        type Natural = crate::natural::DictionaryEntry;
1092    }
1093
1094    /// The wire type corresponding to [`Dictionary`].
1095    #[repr(C)]
1096    pub struct Dictionary<'de> {
1097        pub(crate) table: ::fidl_next::wire::Table<'de>,
1098    }
1099
1100    impl<'de> Drop for Dictionary<'de> {
1101        fn drop(&mut self) {
1102            let _ = self.table.get(1)
1103                .map(|envelope| unsafe {
1104                    envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DictionaryEntry<'de>>>()
1105                });
1106        }
1107    }
1108
1109    impl ::fidl_next::Constrained for Dictionary<'_> {
1110        type Constraint = ();
1111
1112        fn validate(
1113            _: ::fidl_next::Slot<'_, Self>,
1114            _: Self::Constraint,
1115        ) -> Result<(), ::fidl_next::ValidationError> {
1116            Ok(())
1117        }
1118    }
1119
1120    unsafe impl ::fidl_next::Wire for Dictionary<'static> {
1121        type Narrowed<'de> = Dictionary<'de>;
1122
1123        #[inline]
1124        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1125            ::fidl_next::munge!(let Self { table } = out);
1126            ::fidl_next::wire::Table::zero_padding(table);
1127        }
1128    }
1129
1130    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Dictionary<'de>
1131    where
1132        ___D: ::fidl_next::Decoder<'de> + ?Sized,
1133    {
1134        fn decode(
1135            slot: ::fidl_next::Slot<'_, Self>,
1136            decoder: &mut ___D,
1137            _: (),
1138        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1139            ::fidl_next::munge!(let Self { table } = slot);
1140
1141            ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1142                match ordinal {
1143                    0 => unsafe { ::core::hint::unreachable_unchecked() },
1144
1145                    1 => {
1146                        ::fidl_next::wire::Envelope::decode_as::<
1147                            ___D,
1148                            ::fidl_next::wire::Vector<'de, crate::wire::DictionaryEntry<'de>>,
1149                        >(slot.as_mut(), decoder, (1024, ()))?;
1150
1151                        let value = unsafe {
1152                            slot
1153                                            .deref_unchecked()
1154                                            .deref_unchecked::<
1155                                                ::fidl_next::wire::Vector<'_, crate::wire::DictionaryEntry<'_>>
1156                                            >()
1157                        };
1158
1159                        if value.len() > 1024 {
1160                            return Err(::fidl_next::DecodeError::VectorTooLong {
1161                                size: value.len() as u64,
1162                                limit: 1024,
1163                            });
1164                        }
1165
1166                        Ok(())
1167                    }
1168
1169                    _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
1170                }
1171            })
1172        }
1173    }
1174
1175    impl<'de> Dictionary<'de> {
1176        pub fn entries(
1177            &self,
1178        ) -> ::core::option::Option<
1179            &::fidl_next::wire::Vector<'de, crate::wire::DictionaryEntry<'de>>,
1180        > {
1181            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1182        }
1183
1184        pub fn take_entries(
1185            &mut self,
1186        ) -> ::core::option::Option<::fidl_next::wire::Vector<'de, crate::wire::DictionaryEntry<'de>>>
1187        {
1188            unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
1189        }
1190    }
1191
1192    impl<'de> ::core::fmt::Debug for Dictionary<'de> {
1193        fn fmt(
1194            &self,
1195            f: &mut ::core::fmt::Formatter<'_>,
1196        ) -> ::core::result::Result<(), ::core::fmt::Error> {
1197            f.debug_struct("Dictionary").field("entries", &self.entries()).finish()
1198        }
1199    }
1200
1201    impl<'de> ::fidl_next::IntoNatural for Dictionary<'de> {
1202        type Natural = crate::natural::Dictionary;
1203    }
1204
1205    /// The wire type corresponding to [`MetadataGetPersistedMetadataResponse`].
1206    #[derive(Debug)]
1207    #[repr(C)]
1208    pub struct MetadataGetPersistedMetadataResponse<'de> {
1209        pub persisted_metadata: ::fidl_next::wire::Vector<'de, u8>,
1210    }
1211
1212    static_assertions::const_assert_eq!(
1213        std::mem::size_of::<MetadataGetPersistedMetadataResponse<'_>>(),
1214        16
1215    );
1216    static_assertions::const_assert_eq!(
1217        std::mem::align_of::<MetadataGetPersistedMetadataResponse<'_>>(),
1218        8
1219    );
1220
1221    static_assertions::const_assert_eq!(
1222        std::mem::offset_of!(MetadataGetPersistedMetadataResponse<'_>, persisted_metadata),
1223        0
1224    );
1225
1226    impl ::fidl_next::Constrained for MetadataGetPersistedMetadataResponse<'_> {
1227        type Constraint = ();
1228
1229        fn validate(
1230            _: ::fidl_next::Slot<'_, Self>,
1231            _: Self::Constraint,
1232        ) -> Result<(), ::fidl_next::ValidationError> {
1233            Ok(())
1234        }
1235    }
1236
1237    unsafe impl ::fidl_next::Wire for MetadataGetPersistedMetadataResponse<'static> {
1238        type Narrowed<'de> = MetadataGetPersistedMetadataResponse<'de>;
1239
1240        #[inline]
1241        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1242            ::fidl_next::munge! {
1243                let Self {
1244                    persisted_metadata,
1245
1246                } = &mut *out_;
1247            }
1248
1249            ::fidl_next::Wire::zero_padding(persisted_metadata);
1250        }
1251    }
1252
1253    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for MetadataGetPersistedMetadataResponse<'de>
1254    where
1255        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1256        ___D: ::fidl_next::Decoder<'de>,
1257    {
1258        fn decode(
1259            slot_: ::fidl_next::Slot<'_, Self>,
1260            decoder_: &mut ___D,
1261            _: (),
1262        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1263            ::fidl_next::munge! {
1264                let Self {
1265                    mut persisted_metadata,
1266
1267                } = slot_;
1268            }
1269
1270            let _field = persisted_metadata.as_mut();
1271            ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
1272            ::fidl_next::Decode::decode(persisted_metadata.as_mut(), decoder_, (4294967295, ()))?;
1273
1274            Ok(())
1275        }
1276    }
1277
1278    impl<'de> ::fidl_next::IntoNatural for MetadataGetPersistedMetadataResponse<'de> {
1279        type Natural = crate::natural::MetadataGetPersistedMetadataResponse;
1280    }
1281}
1282
1283pub mod wire_optional {
1284
1285    #[repr(transparent)]
1286    pub struct DictionaryValue<'de> {
1287        pub(crate) raw: ::fidl_next::wire::Union,
1288        pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
1289    }
1290
1291    impl ::fidl_next::Constrained for DictionaryValue<'_> {
1292        type Constraint = ();
1293
1294        fn validate(
1295            _: ::fidl_next::Slot<'_, Self>,
1296            _: Self::Constraint,
1297        ) -> Result<(), ::fidl_next::ValidationError> {
1298            Ok(())
1299        }
1300    }
1301
1302    unsafe impl ::fidl_next::Wire for DictionaryValue<'static> {
1303        type Narrowed<'de> = DictionaryValue<'de>;
1304
1305        #[inline]
1306        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1307            ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
1308            ::fidl_next::wire::Union::zero_padding(raw);
1309        }
1310    }
1311
1312    impl<'de> DictionaryValue<'de> {
1313        pub fn is_some(&self) -> bool {
1314            self.raw.is_some()
1315        }
1316
1317        pub fn is_none(&self) -> bool {
1318            self.raw.is_none()
1319        }
1320
1321        pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::DictionaryValue<'de>> {
1322            if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
1323        }
1324
1325        pub fn into_option(self) -> ::core::option::Option<crate::wire::DictionaryValue<'de>> {
1326            if self.is_some() {
1327                Some(crate::wire::DictionaryValue {
1328                    raw: self.raw,
1329                    _phantom: ::core::marker::PhantomData,
1330                })
1331            } else {
1332                None
1333            }
1334        }
1335    }
1336
1337    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DictionaryValue<'de>
1338    where
1339        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1340        ___D: ::fidl_next::Decoder<'de>,
1341    {
1342        fn decode(
1343            mut slot: ::fidl_next::Slot<'_, Self>,
1344            decoder: &mut ___D,
1345            _: (),
1346        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1347            ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
1348            match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
1349                1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int64>(
1350                    raw,
1351                    decoder,
1352                    (),
1353                )?,
1354
1355                2 => ::fidl_next::wire::Union::decode_as::<
1356                    ___D,
1357                    ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>,
1358                >(raw, decoder, (1024, ()))?,
1359
1360                3 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
1361                    raw, decoder, 32768,
1362                )?,
1363
1364                4 => ::fidl_next::wire::Union::decode_as::<
1365                    ___D,
1366                    ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>,
1367                >(raw, decoder, (1024, 32768))?,
1368
1369                5 => ::fidl_next::wire::Union::decode_as::<___D, bool>(raw, decoder, ())?,
1370
1371                0 => ::fidl_next::wire::Union::decode_absent(raw)?,
1372                _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
1373            }
1374
1375            Ok(())
1376        }
1377    }
1378
1379    impl<'de> ::core::fmt::Debug for DictionaryValue<'de> {
1380        fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1381            self.as_ref().fmt(f)
1382        }
1383    }
1384
1385    impl<'de> ::fidl_next::IntoNatural for DictionaryValue<'de> {
1386        type Natural = ::core::option::Option<crate::natural::DictionaryValue>;
1387    }
1388}
1389
1390pub mod generic {
1391
1392    /// The generic type corresponding to [`DictionaryEntry`].
1393    pub struct DictionaryEntry<T0, T1> {
1394        pub key: T0,
1395
1396        pub value: T1,
1397    }
1398
1399    unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::DictionaryEntry<'static>, ___E>
1400        for DictionaryEntry<T0, T1>
1401    where
1402        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1403        ___E: ::fidl_next::Encoder,
1404        T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
1405        T1: ::fidl_next::Encode<crate::wire::DictionaryValue<'static>, ___E>,
1406    {
1407        #[inline]
1408        fn encode(
1409            self,
1410            encoder_: &mut ___E,
1411            out_: &mut ::core::mem::MaybeUninit<crate::wire::DictionaryEntry<'static>>,
1412            _: (),
1413        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1414            ::fidl_next::munge! {
1415                let crate::wire::DictionaryEntry {
1416                    key,
1417                    value,
1418
1419                } = out_;
1420            }
1421
1422            ::fidl_next::Encode::encode(self.key, encoder_, key, 1024)?;
1423
1424            ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
1425
1426            Ok(())
1427        }
1428    }
1429
1430    /// The generic type corresponding to [`MetadataGetPersistedMetadataResponse`].
1431    pub struct MetadataGetPersistedMetadataResponse<T0> {
1432        pub persisted_metadata: T0,
1433    }
1434
1435    unsafe impl<___E, T0>
1436        ::fidl_next::Encode<crate::wire::MetadataGetPersistedMetadataResponse<'static>, ___E>
1437        for MetadataGetPersistedMetadataResponse<T0>
1438    where
1439        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1440        ___E: ::fidl_next::Encoder,
1441        T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1442    {
1443        #[inline]
1444        fn encode(
1445            self,
1446            encoder_: &mut ___E,
1447            out_: &mut ::core::mem::MaybeUninit<
1448                crate::wire::MetadataGetPersistedMetadataResponse<'static>,
1449            >,
1450            _: (),
1451        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1452            ::fidl_next::munge! {
1453                let crate::wire::MetadataGetPersistedMetadataResponse {
1454                    persisted_metadata,
1455
1456                } = out_;
1457            }
1458
1459            ::fidl_next::Encode::encode(
1460                self.persisted_metadata,
1461                encoder_,
1462                persisted_metadata,
1463                (4294967295, ()),
1464            )?;
1465
1466            Ok(())
1467        }
1468    }
1469}
1470
1471pub use self::natural::*;
1472
1473pub const MAX_KEY_LENGTH: u32 = 1024 as u32;
1474
1475pub const MAX_NUM_VALUE_ITEMS: u32 = 1024 as u32;
1476
1477pub const MAX_VALUE_LENGTH: u32 = 32768 as u32;
1478
1479pub const MAX_NUM_ENTRIES: u32 = 1024 as u32;
1480
1481/// The type corresponding to the Metadata protocol.
1482#[derive(PartialEq, Debug)]
1483pub struct Metadata;
1484
1485#[cfg(target_os = "fuchsia")]
1486impl ::fidl_next::HasTransport for Metadata {
1487    type Transport = ::fidl_next::fuchsia::zx::Channel;
1488}
1489
1490pub mod metadata {
1491    pub mod prelude {
1492        pub use crate::{
1493            Metadata, MetadataClientHandler, MetadataLocalClientHandler,
1494            MetadataLocalServerHandler, MetadataServerHandler, metadata,
1495        };
1496
1497        pub use crate::natural::MetadataGetPersistedMetadataResponse;
1498    }
1499
1500    pub struct GetPersistedMetadata;
1501
1502    impl ::fidl_next::Method for GetPersistedMetadata {
1503        const ORDINAL: u64 = 4835307543437455991;
1504        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1505            ::fidl_next::protocol::Flexibility::Strict;
1506
1507        type Protocol = crate::Metadata;
1508
1509        type Request = ::fidl_next::wire::EmptyMessageBody;
1510    }
1511
1512    impl ::fidl_next::TwoWayMethod for GetPersistedMetadata {
1513        type Response = ::fidl_next::wire::Result<
1514            'static,
1515            crate::wire::MetadataGetPersistedMetadataResponse<'static>,
1516            ::fidl_next::wire::fuchsia::Status,
1517        >;
1518    }
1519
1520    impl<___R> ::fidl_next::Respond<___R> for GetPersistedMetadata {
1521        type Output = ::core::result::Result<
1522            crate::generic::MetadataGetPersistedMetadataResponse<___R>,
1523            ::fidl_next::never::Never,
1524        >;
1525
1526        fn respond(response: ___R) -> Self::Output {
1527            ::core::result::Result::Ok(crate::generic::MetadataGetPersistedMetadataResponse {
1528                persisted_metadata: response,
1529            })
1530        }
1531    }
1532
1533    impl<___R> ::fidl_next::RespondErr<___R> for GetPersistedMetadata {
1534        type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1535
1536        fn respond_err(response: ___R) -> Self::Output {
1537            ::core::result::Result::Err(response)
1538        }
1539    }
1540
1541    mod ___detail {
1542        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Metadata
1543        where
1544            ___T: ::fidl_next::Transport,
1545        {
1546            type Client = MetadataClient<___T>;
1547            type Server = MetadataServer<___T>;
1548        }
1549
1550        /// The client for the `Metadata` protocol.
1551        #[repr(transparent)]
1552        pub struct MetadataClient<___T: ::fidl_next::Transport> {
1553            #[allow(dead_code)]
1554            client: ::fidl_next::protocol::Client<___T>,
1555        }
1556
1557        impl<___T> MetadataClient<___T>
1558        where
1559            ___T: ::fidl_next::Transport,
1560        {
1561            #[doc = " Retrieve the persisted metadata provided by the server. Returns ZX_ERR_NOT_FOUND if the\n server does not have metadata to provide.\n"]
1562            pub fn get_persisted_metadata(
1563                &self,
1564            ) -> ::fidl_next::TwoWayFuture<'_, super::GetPersistedMetadata, ___T> {
1565                ::fidl_next::TwoWayFuture::from_untyped(
1566                    self.client.send_two_way::<::fidl_next::wire::EmptyMessageBody>(
1567                        4835307543437455991,
1568                        <super::GetPersistedMetadata as ::fidl_next::Method>::FLEXIBILITY,
1569                        (),
1570                    ),
1571                )
1572            }
1573        }
1574
1575        /// The server for the `Metadata` protocol.
1576        #[repr(transparent)]
1577        pub struct MetadataServer<___T: ::fidl_next::Transport> {
1578            server: ::fidl_next::protocol::Server<___T>,
1579        }
1580
1581        impl<___T> MetadataServer<___T> where ___T: ::fidl_next::Transport {}
1582    }
1583}
1584
1585#[diagnostic::on_unimplemented(
1586    note = "If {Self} implements the non-local MetadataClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
1587)]
1588
1589/// A client handler for the Metadata protocol.
1590///
1591/// See [`Metadata`] for more details.
1592pub trait MetadataLocalClientHandler<
1593    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1594    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1595>
1596{
1597}
1598
1599impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Metadata
1600where
1601    ___H: MetadataLocalClientHandler<___T>,
1602    ___T: ::fidl_next::Transport,
1603{
1604    async fn on_event(
1605        handler: &mut ___H,
1606        mut message: ::fidl_next::Message<___T>,
1607    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1608        match *message.header().ordinal {
1609            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1610        }
1611    }
1612}
1613
1614#[diagnostic::on_unimplemented(
1615    note = "If {Self} implements the non-local MetadataServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
1616)]
1617
1618/// A server handler for the Metadata protocol.
1619///
1620/// See [`Metadata`] for more details.
1621pub trait MetadataLocalServerHandler<
1622    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1623    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1624>
1625{
1626    #[doc = " Retrieve the persisted metadata provided by the server. Returns ZX_ERR_NOT_FOUND if the\n server does not have metadata to provide.\n"]
1627    fn get_persisted_metadata(
1628        &mut self,
1629
1630        responder: ::fidl_next::Responder<metadata::GetPersistedMetadata, ___T>,
1631    ) -> impl ::core::future::Future<Output = ()>;
1632}
1633
1634impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Metadata
1635where
1636    ___H: MetadataLocalServerHandler<___T>,
1637    ___T: ::fidl_next::Transport,
1638{
1639    async fn on_one_way(
1640        handler: &mut ___H,
1641        mut message: ::fidl_next::Message<___T>,
1642    ) -> ::core::result::Result<
1643        (),
1644        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1645    > {
1646        match *message.header().ordinal {
1647            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1648        }
1649    }
1650
1651    async fn on_two_way(
1652        handler: &mut ___H,
1653        mut message: ::fidl_next::Message<___T>,
1654        responder: ::fidl_next::protocol::Responder<___T>,
1655    ) -> ::core::result::Result<
1656        (),
1657        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1658    > {
1659        match *message.header().ordinal {
1660            4835307543437455991 => {
1661                let responder = ::fidl_next::Responder::from_untyped(responder);
1662
1663                handler.get_persisted_metadata(responder).await;
1664                Ok(())
1665            }
1666
1667            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1668        }
1669    }
1670}
1671
1672/// A client handler for the Metadata protocol.
1673///
1674/// See [`Metadata`] for more details.
1675pub trait MetadataClientHandler<
1676    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1677    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1678>
1679{
1680}
1681
1682impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Metadata
1683where
1684    ___H: MetadataClientHandler<___T> + ::core::marker::Send,
1685    ___T: ::fidl_next::Transport,
1686{
1687    async fn on_event(
1688        handler: &mut ___H,
1689        mut message: ::fidl_next::Message<___T>,
1690    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1691        match *message.header().ordinal {
1692            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1693        }
1694    }
1695}
1696
1697/// A server handler for the Metadata protocol.
1698///
1699/// See [`Metadata`] for more details.
1700pub trait MetadataServerHandler<
1701    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1702    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1703>
1704{
1705    #[doc = " Retrieve the persisted metadata provided by the server. Returns ZX_ERR_NOT_FOUND if the\n server does not have metadata to provide.\n"]
1706    fn get_persisted_metadata(
1707        &mut self,
1708
1709        responder: ::fidl_next::Responder<metadata::GetPersistedMetadata, ___T>,
1710    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1711}
1712
1713impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Metadata
1714where
1715    ___H: MetadataServerHandler<___T> + ::core::marker::Send,
1716    ___T: ::fidl_next::Transport,
1717{
1718    async fn on_one_way(
1719        handler: &mut ___H,
1720        mut message: ::fidl_next::Message<___T>,
1721    ) -> ::core::result::Result<
1722        (),
1723        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1724    > {
1725        match *message.header().ordinal {
1726            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1727        }
1728    }
1729
1730    async fn on_two_way(
1731        handler: &mut ___H,
1732        mut message: ::fidl_next::Message<___T>,
1733        responder: ::fidl_next::protocol::Responder<___T>,
1734    ) -> ::core::result::Result<
1735        (),
1736        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1737    > {
1738        match *message.header().ordinal {
1739            4835307543437455991 => {
1740                let responder = ::fidl_next::Responder::from_untyped(responder);
1741
1742                handler.get_persisted_metadata(responder).await;
1743                Ok(())
1744            }
1745
1746            ordinal => Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal)),
1747        }
1748    }
1749}
1750
1751impl<___T> MetadataClientHandler<___T> for ::fidl_next::IgnoreEvents where
1752    ___T: ::fidl_next::Transport
1753{
1754}
1755
1756impl<___H, ___T> MetadataLocalClientHandler<___T> for ::fidl_next::Local<___H>
1757where
1758    ___H: MetadataClientHandler<___T>,
1759    ___T: ::fidl_next::Transport,
1760{
1761}
1762
1763impl<___H, ___T> MetadataLocalServerHandler<___T> for ::fidl_next::Local<___H>
1764where
1765    ___H: MetadataServerHandler<___T>,
1766    ___T: ::fidl_next::Transport,
1767{
1768    async fn get_persisted_metadata(
1769        &mut self,
1770
1771        responder: ::fidl_next::Responder<metadata::GetPersistedMetadata, ___T>,
1772    ) {
1773        ___H::get_persisted_metadata(&mut self.0, responder).await
1774    }
1775}