Skip to main content

fidl_next_common_fuchsia_component_resolution/
fidl_next_common_fuchsia_component_resolution.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 component resolution context, used when resolving component URLs relative\n to another component. The context is stored in a byte array that persists a\n value used by the target `Resolver` to locate and resolve a component by\n relative path (for example, by a subpackage name).\n"]
8    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9    pub struct Context {
10        pub bytes: ::std::vec::Vec<u8>,
11    }
12
13    unsafe impl<___E> ::fidl_next::Encode<crate::wire::Context<'static>, ___E> for Context
14    where
15        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
16        ___E: ::fidl_next::Encoder,
17    {
18        #[inline]
19        fn encode(
20            self,
21            encoder_: &mut ___E,
22            out_: &mut ::core::mem::MaybeUninit<crate::wire::Context<'static>>,
23            _: (),
24        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
25            ::fidl_next::munge! {
26                let crate::wire::Context {
27                    bytes,
28
29                } = out_;
30            }
31
32            ::fidl_next::Encode::encode(self.bytes, encoder_, bytes, (8192, ()))?;
33
34            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(bytes.as_mut_ptr()) };
35            ::fidl_next::Constrained::validate(_field, (8192, ()))?;
36
37            Ok(())
38        }
39    }
40
41    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Context<'static>, ___E> for &'a Context
42    where
43        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
44        ___E: ::fidl_next::Encoder,
45    {
46        #[inline]
47        fn encode(
48            self,
49            encoder_: &mut ___E,
50            out_: &mut ::core::mem::MaybeUninit<crate::wire::Context<'static>>,
51            _: (),
52        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
53            ::fidl_next::munge! {
54                let crate::wire::Context {
55                    bytes,
56
57                } = out_;
58            }
59
60            ::fidl_next::Encode::encode(&self.bytes, encoder_, bytes, (8192, ()))?;
61
62            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(bytes.as_mut_ptr()) };
63            ::fidl_next::Constrained::validate(_field, (8192, ()))?;
64
65            Ok(())
66        }
67    }
68
69    unsafe impl<___E>
70        ::fidl_next::EncodeOption<
71            ::fidl_next::wire::Box<'static, crate::wire::Context<'static>>,
72            ___E,
73        > for Context
74    where
75        ___E: ::fidl_next::Encoder + ?Sized,
76        Context: ::fidl_next::Encode<crate::wire::Context<'static>, ___E>,
77    {
78        #[inline]
79        fn encode_option(
80            this: ::core::option::Option<Self>,
81            encoder: &mut ___E,
82            out: &mut ::core::mem::MaybeUninit<
83                ::fidl_next::wire::Box<'static, crate::wire::Context<'static>>,
84            >,
85            _: (),
86        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
87            if let Some(inner) = this {
88                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
89                ::fidl_next::wire::Box::encode_present(out);
90            } else {
91                ::fidl_next::wire::Box::encode_absent(out);
92            }
93
94            Ok(())
95        }
96    }
97
98    unsafe impl<'a, ___E>
99        ::fidl_next::EncodeOption<
100            ::fidl_next::wire::Box<'static, crate::wire::Context<'static>>,
101            ___E,
102        > for &'a Context
103    where
104        ___E: ::fidl_next::Encoder + ?Sized,
105        &'a Context: ::fidl_next::Encode<crate::wire::Context<'static>, ___E>,
106    {
107        #[inline]
108        fn encode_option(
109            this: ::core::option::Option<Self>,
110            encoder: &mut ___E,
111            out: &mut ::core::mem::MaybeUninit<
112                ::fidl_next::wire::Box<'static, crate::wire::Context<'static>>,
113            >,
114            _: (),
115        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
116            if let Some(inner) = this {
117                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
118                ::fidl_next::wire::Box::encode_present(out);
119            } else {
120                ::fidl_next::wire::Box::encode_absent(out);
121            }
122
123            Ok(())
124        }
125    }
126
127    impl<'de> ::fidl_next::FromWire<crate::wire::Context<'de>> for Context {
128        #[inline]
129        fn from_wire(wire: crate::wire::Context<'de>) -> Self {
130            Self { bytes: ::fidl_next::FromWire::from_wire(wire.bytes) }
131        }
132    }
133
134    impl<'de> ::fidl_next::FromWireRef<crate::wire::Context<'de>> for Context {
135        #[inline]
136        fn from_wire_ref(wire: &crate::wire::Context<'de>) -> Self {
137            Self { bytes: ::fidl_next::FromWireRef::from_wire_ref(&wire.bytes) }
138        }
139    }
140
141    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
142    pub struct ResolverResolveRequest {
143        pub component_url: ::std::string::String,
144    }
145
146    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ResolverResolveRequest<'static>, ___E>
147        for ResolverResolveRequest
148    where
149        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
150        ___E: ::fidl_next::Encoder,
151    {
152        #[inline]
153        fn encode(
154            self,
155            encoder_: &mut ___E,
156            out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolverResolveRequest<'static>>,
157            _: (),
158        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
159            ::fidl_next::munge! {
160                let crate::wire::ResolverResolveRequest {
161                    component_url,
162
163                } = out_;
164            }
165
166            ::fidl_next::Encode::encode(self.component_url, encoder_, component_url, 2083)?;
167
168            let mut _field =
169                unsafe { ::fidl_next::Slot::new_unchecked(component_url.as_mut_ptr()) };
170            ::fidl_next::Constrained::validate(_field, 2083)?;
171
172            Ok(())
173        }
174    }
175
176    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ResolverResolveRequest<'static>, ___E>
177        for &'a ResolverResolveRequest
178    where
179        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
180        ___E: ::fidl_next::Encoder,
181    {
182        #[inline]
183        fn encode(
184            self,
185            encoder_: &mut ___E,
186            out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolverResolveRequest<'static>>,
187            _: (),
188        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
189            ::fidl_next::munge! {
190                let crate::wire::ResolverResolveRequest {
191                    component_url,
192
193                } = out_;
194            }
195
196            ::fidl_next::Encode::encode(&self.component_url, encoder_, component_url, 2083)?;
197
198            let mut _field =
199                unsafe { ::fidl_next::Slot::new_unchecked(component_url.as_mut_ptr()) };
200            ::fidl_next::Constrained::validate(_field, 2083)?;
201
202            Ok(())
203        }
204    }
205
206    unsafe impl<___E>
207        ::fidl_next::EncodeOption<
208            ::fidl_next::wire::Box<'static, crate::wire::ResolverResolveRequest<'static>>,
209            ___E,
210        > for ResolverResolveRequest
211    where
212        ___E: ::fidl_next::Encoder + ?Sized,
213        ResolverResolveRequest:
214            ::fidl_next::Encode<crate::wire::ResolverResolveRequest<'static>, ___E>,
215    {
216        #[inline]
217        fn encode_option(
218            this: ::core::option::Option<Self>,
219            encoder: &mut ___E,
220            out: &mut ::core::mem::MaybeUninit<
221                ::fidl_next::wire::Box<'static, crate::wire::ResolverResolveRequest<'static>>,
222            >,
223            _: (),
224        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
225            if let Some(inner) = this {
226                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
227                ::fidl_next::wire::Box::encode_present(out);
228            } else {
229                ::fidl_next::wire::Box::encode_absent(out);
230            }
231
232            Ok(())
233        }
234    }
235
236    unsafe impl<'a, ___E>
237        ::fidl_next::EncodeOption<
238            ::fidl_next::wire::Box<'static, crate::wire::ResolverResolveRequest<'static>>,
239            ___E,
240        > for &'a ResolverResolveRequest
241    where
242        ___E: ::fidl_next::Encoder + ?Sized,
243        &'a ResolverResolveRequest:
244            ::fidl_next::Encode<crate::wire::ResolverResolveRequest<'static>, ___E>,
245    {
246        #[inline]
247        fn encode_option(
248            this: ::core::option::Option<Self>,
249            encoder: &mut ___E,
250            out: &mut ::core::mem::MaybeUninit<
251                ::fidl_next::wire::Box<'static, crate::wire::ResolverResolveRequest<'static>>,
252            >,
253            _: (),
254        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
255            if let Some(inner) = this {
256                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
257                ::fidl_next::wire::Box::encode_present(out);
258            } else {
259                ::fidl_next::wire::Box::encode_absent(out);
260            }
261
262            Ok(())
263        }
264    }
265
266    impl<'de> ::fidl_next::FromWire<crate::wire::ResolverResolveRequest<'de>>
267        for ResolverResolveRequest
268    {
269        #[inline]
270        fn from_wire(wire: crate::wire::ResolverResolveRequest<'de>) -> Self {
271            Self { component_url: ::fidl_next::FromWire::from_wire(wire.component_url) }
272        }
273    }
274
275    impl<'de> ::fidl_next::FromWireRef<crate::wire::ResolverResolveRequest<'de>>
276        for ResolverResolveRequest
277    {
278        #[inline]
279        fn from_wire_ref(wire: &crate::wire::ResolverResolveRequest<'de>) -> Self {
280            Self { component_url: ::fidl_next::FromWireRef::from_wire_ref(&wire.component_url) }
281        }
282    }
283
284    #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
285    pub struct ResolverResolveWithContextRequest {
286        pub component_url: ::std::string::String,
287
288        pub context: crate::natural::Context,
289    }
290
291    unsafe impl<___E>
292        ::fidl_next::Encode<crate::wire::ResolverResolveWithContextRequest<'static>, ___E>
293        for ResolverResolveWithContextRequest
294    where
295        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
296        ___E: ::fidl_next::Encoder,
297    {
298        #[inline]
299        fn encode(
300            self,
301            encoder_: &mut ___E,
302            out_: &mut ::core::mem::MaybeUninit<
303                crate::wire::ResolverResolveWithContextRequest<'static>,
304            >,
305            _: (),
306        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
307            ::fidl_next::munge! {
308                let crate::wire::ResolverResolveWithContextRequest {
309                    component_url,
310                    context,
311
312                } = out_;
313            }
314
315            ::fidl_next::Encode::encode(self.component_url, encoder_, component_url, 2083)?;
316
317            let mut _field =
318                unsafe { ::fidl_next::Slot::new_unchecked(component_url.as_mut_ptr()) };
319            ::fidl_next::Constrained::validate(_field, 2083)?;
320
321            ::fidl_next::Encode::encode(self.context, encoder_, context, ())?;
322
323            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(context.as_mut_ptr()) };
324
325            Ok(())
326        }
327    }
328
329    unsafe impl<'a, ___E>
330        ::fidl_next::Encode<crate::wire::ResolverResolveWithContextRequest<'static>, ___E>
331        for &'a ResolverResolveWithContextRequest
332    where
333        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
334        ___E: ::fidl_next::Encoder,
335    {
336        #[inline]
337        fn encode(
338            self,
339            encoder_: &mut ___E,
340            out_: &mut ::core::mem::MaybeUninit<
341                crate::wire::ResolverResolveWithContextRequest<'static>,
342            >,
343            _: (),
344        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
345            ::fidl_next::munge! {
346                let crate::wire::ResolverResolveWithContextRequest {
347                    component_url,
348                    context,
349
350                } = out_;
351            }
352
353            ::fidl_next::Encode::encode(&self.component_url, encoder_, component_url, 2083)?;
354
355            let mut _field =
356                unsafe { ::fidl_next::Slot::new_unchecked(component_url.as_mut_ptr()) };
357            ::fidl_next::Constrained::validate(_field, 2083)?;
358
359            ::fidl_next::Encode::encode(&self.context, encoder_, context, ())?;
360
361            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(context.as_mut_ptr()) };
362
363            Ok(())
364        }
365    }
366
367    unsafe impl<___E>
368        ::fidl_next::EncodeOption<
369            ::fidl_next::wire::Box<
370                'static,
371                crate::wire::ResolverResolveWithContextRequest<'static>,
372            >,
373            ___E,
374        > for ResolverResolveWithContextRequest
375    where
376        ___E: ::fidl_next::Encoder + ?Sized,
377        ResolverResolveWithContextRequest:
378            ::fidl_next::Encode<crate::wire::ResolverResolveWithContextRequest<'static>, ___E>,
379    {
380        #[inline]
381        fn encode_option(
382            this: ::core::option::Option<Self>,
383            encoder: &mut ___E,
384            out: &mut ::core::mem::MaybeUninit<
385                ::fidl_next::wire::Box<
386                    'static,
387                    crate::wire::ResolverResolveWithContextRequest<'static>,
388                >,
389            >,
390            _: (),
391        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
392            if let Some(inner) = this {
393                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
394                ::fidl_next::wire::Box::encode_present(out);
395            } else {
396                ::fidl_next::wire::Box::encode_absent(out);
397            }
398
399            Ok(())
400        }
401    }
402
403    unsafe impl<'a, ___E>
404        ::fidl_next::EncodeOption<
405            ::fidl_next::wire::Box<
406                'static,
407                crate::wire::ResolverResolveWithContextRequest<'static>,
408            >,
409            ___E,
410        > for &'a ResolverResolveWithContextRequest
411    where
412        ___E: ::fidl_next::Encoder + ?Sized,
413        &'a ResolverResolveWithContextRequest:
414            ::fidl_next::Encode<crate::wire::ResolverResolveWithContextRequest<'static>, ___E>,
415    {
416        #[inline]
417        fn encode_option(
418            this: ::core::option::Option<Self>,
419            encoder: &mut ___E,
420            out: &mut ::core::mem::MaybeUninit<
421                ::fidl_next::wire::Box<
422                    'static,
423                    crate::wire::ResolverResolveWithContextRequest<'static>,
424                >,
425            >,
426            _: (),
427        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
428            if let Some(inner) = this {
429                ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
430                ::fidl_next::wire::Box::encode_present(out);
431            } else {
432                ::fidl_next::wire::Box::encode_absent(out);
433            }
434
435            Ok(())
436        }
437    }
438
439    impl<'de> ::fidl_next::FromWire<crate::wire::ResolverResolveWithContextRequest<'de>>
440        for ResolverResolveWithContextRequest
441    {
442        #[inline]
443        fn from_wire(wire: crate::wire::ResolverResolveWithContextRequest<'de>) -> Self {
444            Self {
445                component_url: ::fidl_next::FromWire::from_wire(wire.component_url),
446
447                context: ::fidl_next::FromWire::from_wire(wire.context),
448            }
449        }
450    }
451
452    impl<'de> ::fidl_next::FromWireRef<crate::wire::ResolverResolveWithContextRequest<'de>>
453        for ResolverResolveWithContextRequest
454    {
455        #[inline]
456        fn from_wire_ref(wire: &crate::wire::ResolverResolveWithContextRequest<'de>) -> Self {
457            Self {
458                component_url: ::fidl_next::FromWireRef::from_wire_ref(&wire.component_url),
459
460                context: ::fidl_next::FromWireRef::from_wire_ref(&wire.context),
461            }
462        }
463    }
464
465    #[doc = " The possible error conditions returned by ComponentResolver.\n"]
466    #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
467    #[repr(u32)]
468    pub enum ResolverError {
469        Internal = 1,
470        Io = 2,
471        InvalidArgs = 3,
472        NotSupported = 4,
473        ManifestNotFound = 5,
474        PackageNotFound = 6,
475        NoSpace = 7,
476        ResourceUnavailable = 8,
477        InvalidManifest = 9,
478        ConfigValuesNotFound = 10,
479        AbiRevisionNotFound = 11,
480        InvalidAbiRevision = 12,
481    }
482    impl ::core::convert::TryFrom<u32> for ResolverError {
483        type Error = ::fidl_next::UnknownStrictEnumMemberError;
484        fn try_from(
485            value: u32,
486        ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
487            match value {
488                1 => Ok(Self::Internal),
489                2 => Ok(Self::Io),
490                3 => Ok(Self::InvalidArgs),
491                4 => Ok(Self::NotSupported),
492                5 => Ok(Self::ManifestNotFound),
493                6 => Ok(Self::PackageNotFound),
494                7 => Ok(Self::NoSpace),
495                8 => Ok(Self::ResourceUnavailable),
496                9 => Ok(Self::InvalidManifest),
497                10 => Ok(Self::ConfigValuesNotFound),
498                11 => Ok(Self::AbiRevisionNotFound),
499                12 => Ok(Self::InvalidAbiRevision),
500
501                _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
502            }
503        }
504    }
505
506    unsafe impl<___E> ::fidl_next::Encode<crate::wire::ResolverError, ___E> for ResolverError
507    where
508        ___E: ?Sized,
509    {
510        #[inline]
511        fn encode(
512            self,
513            encoder: &mut ___E,
514            out: &mut ::core::mem::MaybeUninit<crate::wire::ResolverError>,
515            _: (),
516        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
517            ::fidl_next::Encode::encode(&self, encoder, out, ())
518        }
519    }
520
521    unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ResolverError, ___E> for &'a ResolverError
522    where
523        ___E: ?Sized,
524    {
525        #[inline]
526        fn encode(
527            self,
528            encoder: &mut ___E,
529            out: &mut ::core::mem::MaybeUninit<crate::wire::ResolverError>,
530            _: (),
531        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
532            ::fidl_next::munge!(let crate::wire::ResolverError { value } = out);
533            let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
534                ResolverError::Internal => 1,
535
536                ResolverError::Io => 2,
537
538                ResolverError::InvalidArgs => 3,
539
540                ResolverError::NotSupported => 4,
541
542                ResolverError::ManifestNotFound => 5,
543
544                ResolverError::PackageNotFound => 6,
545
546                ResolverError::NoSpace => 7,
547
548                ResolverError::ResourceUnavailable => 8,
549
550                ResolverError::InvalidManifest => 9,
551
552                ResolverError::ConfigValuesNotFound => 10,
553
554                ResolverError::AbiRevisionNotFound => 11,
555
556                ResolverError::InvalidAbiRevision => 12,
557            }));
558
559            Ok(())
560        }
561    }
562
563    impl ::core::convert::From<crate::wire::ResolverError> for ResolverError {
564        fn from(wire: crate::wire::ResolverError) -> Self {
565            match u32::from(wire.value) {
566                1 => Self::Internal,
567
568                2 => Self::Io,
569
570                3 => Self::InvalidArgs,
571
572                4 => Self::NotSupported,
573
574                5 => Self::ManifestNotFound,
575
576                6 => Self::PackageNotFound,
577
578                7 => Self::NoSpace,
579
580                8 => Self::ResourceUnavailable,
581
582                9 => Self::InvalidManifest,
583
584                10 => Self::ConfigValuesNotFound,
585
586                11 => Self::AbiRevisionNotFound,
587
588                12 => Self::InvalidAbiRevision,
589
590                _ => unsafe { ::core::hint::unreachable_unchecked() },
591            }
592        }
593    }
594
595    impl ::fidl_next::FromWire<crate::wire::ResolverError> for ResolverError {
596        #[inline]
597        fn from_wire(wire: crate::wire::ResolverError) -> Self {
598            Self::from(wire)
599        }
600    }
601
602    impl ::fidl_next::FromWireRef<crate::wire::ResolverError> for ResolverError {
603        #[inline]
604        fn from_wire_ref(wire: &crate::wire::ResolverError) -> Self {
605            Self::from(*wire)
606        }
607    }
608}
609
610pub mod wire {
611
612    /// The wire type corresponding to [`Context`].
613    #[derive(Debug)]
614    #[repr(C)]
615    pub struct Context<'de> {
616        pub bytes: ::fidl_next::wire::Vector<'de, u8>,
617    }
618
619    static_assertions::const_assert_eq!(std::mem::size_of::<Context<'_>>(), 16);
620    static_assertions::const_assert_eq!(std::mem::align_of::<Context<'_>>(), 8);
621
622    static_assertions::const_assert_eq!(std::mem::offset_of!(Context<'_>, bytes), 0);
623
624    impl ::fidl_next::Constrained for Context<'_> {
625        type Constraint = ();
626
627        fn validate(
628            _: ::fidl_next::Slot<'_, Self>,
629            _: Self::Constraint,
630        ) -> Result<(), ::fidl_next::ValidationError> {
631            Ok(())
632        }
633    }
634
635    unsafe impl ::fidl_next::Wire for Context<'static> {
636        type Narrowed<'de> = Context<'de>;
637
638        #[inline]
639        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
640            ::fidl_next::munge! {
641                let Self {
642                    bytes,
643
644                } = &mut *out_;
645            }
646
647            ::fidl_next::Wire::zero_padding(bytes);
648        }
649    }
650
651    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Context<'de>
652    where
653        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
654        ___D: ::fidl_next::Decoder<'de>,
655    {
656        fn decode(
657            slot_: ::fidl_next::Slot<'_, Self>,
658            decoder_: &mut ___D,
659            _: (),
660        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
661            ::fidl_next::munge! {
662                let Self {
663                    mut bytes,
664
665                } = slot_;
666            }
667
668            let _field = bytes.as_mut();
669            ::fidl_next::Constrained::validate(_field, (8192, ()))?;
670            ::fidl_next::Decode::decode(bytes.as_mut(), decoder_, (8192, ()))?;
671
672            let bytes = unsafe { bytes.deref_unchecked() };
673
674            if bytes.len() > 8192 {
675                return Err(::fidl_next::DecodeError::VectorTooLong {
676                    size: bytes.len() as u64,
677                    limit: 8192,
678                });
679            }
680
681            Ok(())
682        }
683    }
684
685    impl<'de> ::fidl_next::IntoNatural for Context<'de> {
686        type Natural = crate::natural::Context;
687    }
688
689    /// The wire type corresponding to [`ResolverResolveRequest`].
690    #[derive(Debug)]
691    #[repr(C)]
692    pub struct ResolverResolveRequest<'de> {
693        pub component_url: ::fidl_next::wire::String<'de>,
694    }
695
696    static_assertions::const_assert_eq!(std::mem::size_of::<ResolverResolveRequest<'_>>(), 16);
697    static_assertions::const_assert_eq!(std::mem::align_of::<ResolverResolveRequest<'_>>(), 8);
698
699    static_assertions::const_assert_eq!(
700        std::mem::offset_of!(ResolverResolveRequest<'_>, component_url),
701        0
702    );
703
704    impl ::fidl_next::Constrained for ResolverResolveRequest<'_> {
705        type Constraint = ();
706
707        fn validate(
708            _: ::fidl_next::Slot<'_, Self>,
709            _: Self::Constraint,
710        ) -> Result<(), ::fidl_next::ValidationError> {
711            Ok(())
712        }
713    }
714
715    unsafe impl ::fidl_next::Wire for ResolverResolveRequest<'static> {
716        type Narrowed<'de> = ResolverResolveRequest<'de>;
717
718        #[inline]
719        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
720            ::fidl_next::munge! {
721                let Self {
722                    component_url,
723
724                } = &mut *out_;
725            }
726
727            ::fidl_next::Wire::zero_padding(component_url);
728        }
729    }
730
731    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ResolverResolveRequest<'de>
732    where
733        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
734        ___D: ::fidl_next::Decoder<'de>,
735    {
736        fn decode(
737            slot_: ::fidl_next::Slot<'_, Self>,
738            decoder_: &mut ___D,
739            _: (),
740        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
741            ::fidl_next::munge! {
742                let Self {
743                    mut component_url,
744
745                } = slot_;
746            }
747
748            let _field = component_url.as_mut();
749            ::fidl_next::Constrained::validate(_field, 2083)?;
750            ::fidl_next::Decode::decode(component_url.as_mut(), decoder_, 2083)?;
751
752            let component_url = unsafe { component_url.deref_unchecked() };
753
754            if component_url.len() > 2083 {
755                return Err(::fidl_next::DecodeError::VectorTooLong {
756                    size: component_url.len() as u64,
757                    limit: 2083,
758                });
759            }
760
761            Ok(())
762        }
763    }
764
765    impl<'de> ::fidl_next::IntoNatural for ResolverResolveRequest<'de> {
766        type Natural = crate::natural::ResolverResolveRequest;
767    }
768
769    /// The wire type corresponding to [`ResolverResolveWithContextRequest`].
770    #[derive(Debug)]
771    #[repr(C)]
772    pub struct ResolverResolveWithContextRequest<'de> {
773        pub component_url: ::fidl_next::wire::String<'de>,
774
775        pub context: crate::wire::Context<'de>,
776    }
777
778    static_assertions::const_assert_eq!(
779        std::mem::size_of::<ResolverResolveWithContextRequest<'_>>(),
780        32
781    );
782    static_assertions::const_assert_eq!(
783        std::mem::align_of::<ResolverResolveWithContextRequest<'_>>(),
784        8
785    );
786
787    static_assertions::const_assert_eq!(
788        std::mem::offset_of!(ResolverResolveWithContextRequest<'_>, component_url),
789        0
790    );
791
792    static_assertions::const_assert_eq!(
793        std::mem::offset_of!(ResolverResolveWithContextRequest<'_>, context),
794        16
795    );
796
797    impl ::fidl_next::Constrained for ResolverResolveWithContextRequest<'_> {
798        type Constraint = ();
799
800        fn validate(
801            _: ::fidl_next::Slot<'_, Self>,
802            _: Self::Constraint,
803        ) -> Result<(), ::fidl_next::ValidationError> {
804            Ok(())
805        }
806    }
807
808    unsafe impl ::fidl_next::Wire for ResolverResolveWithContextRequest<'static> {
809        type Narrowed<'de> = ResolverResolveWithContextRequest<'de>;
810
811        #[inline]
812        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
813            ::fidl_next::munge! {
814                let Self {
815                    component_url,
816                    context,
817
818                } = &mut *out_;
819            }
820
821            ::fidl_next::Wire::zero_padding(component_url);
822
823            ::fidl_next::Wire::zero_padding(context);
824        }
825    }
826
827    unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ResolverResolveWithContextRequest<'de>
828    where
829        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
830        ___D: ::fidl_next::Decoder<'de>,
831    {
832        fn decode(
833            slot_: ::fidl_next::Slot<'_, Self>,
834            decoder_: &mut ___D,
835            _: (),
836        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
837            ::fidl_next::munge! {
838                let Self {
839                    mut component_url,
840                    mut context,
841
842                } = slot_;
843            }
844
845            let _field = component_url.as_mut();
846            ::fidl_next::Constrained::validate(_field, 2083)?;
847            ::fidl_next::Decode::decode(component_url.as_mut(), decoder_, 2083)?;
848
849            let component_url = unsafe { component_url.deref_unchecked() };
850
851            if component_url.len() > 2083 {
852                return Err(::fidl_next::DecodeError::VectorTooLong {
853                    size: component_url.len() as u64,
854                    limit: 2083,
855                });
856            }
857
858            let _field = context.as_mut();
859
860            ::fidl_next::Decode::decode(context.as_mut(), decoder_, ())?;
861
862            Ok(())
863        }
864    }
865
866    impl<'de> ::fidl_next::IntoNatural for ResolverResolveWithContextRequest<'de> {
867        type Natural = crate::natural::ResolverResolveWithContextRequest;
868    }
869
870    /// The wire type corresponding to [`ResolverError`].
871    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
872    #[repr(transparent)]
873    pub struct ResolverError {
874        pub(crate) value: ::fidl_next::wire::Uint32,
875    }
876
877    impl ::fidl_next::Constrained for ResolverError {
878        type Constraint = ();
879
880        fn validate(
881            _: ::fidl_next::Slot<'_, Self>,
882            _: Self::Constraint,
883        ) -> Result<(), ::fidl_next::ValidationError> {
884            Ok(())
885        }
886    }
887
888    unsafe impl ::fidl_next::Wire for ResolverError {
889        type Narrowed<'de> = Self;
890
891        #[inline]
892        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
893            // Wire enums have no padding
894        }
895    }
896
897    impl ResolverError {
898        pub const INTERNAL: ResolverError = ResolverError { value: ::fidl_next::wire::Uint32(1) };
899
900        pub const IO: ResolverError = ResolverError { value: ::fidl_next::wire::Uint32(2) };
901
902        pub const INVALID_ARGS: ResolverError =
903            ResolverError { value: ::fidl_next::wire::Uint32(3) };
904
905        pub const NOT_SUPPORTED: ResolverError =
906            ResolverError { value: ::fidl_next::wire::Uint32(4) };
907
908        pub const MANIFEST_NOT_FOUND: ResolverError =
909            ResolverError { value: ::fidl_next::wire::Uint32(5) };
910
911        pub const PACKAGE_NOT_FOUND: ResolverError =
912            ResolverError { value: ::fidl_next::wire::Uint32(6) };
913
914        pub const NO_SPACE: ResolverError = ResolverError { value: ::fidl_next::wire::Uint32(7) };
915
916        pub const RESOURCE_UNAVAILABLE: ResolverError =
917            ResolverError { value: ::fidl_next::wire::Uint32(8) };
918
919        pub const INVALID_MANIFEST: ResolverError =
920            ResolverError { value: ::fidl_next::wire::Uint32(9) };
921
922        pub const CONFIG_VALUES_NOT_FOUND: ResolverError =
923            ResolverError { value: ::fidl_next::wire::Uint32(10) };
924
925        pub const ABI_REVISION_NOT_FOUND: ResolverError =
926            ResolverError { value: ::fidl_next::wire::Uint32(11) };
927
928        pub const INVALID_ABI_REVISION: ResolverError =
929            ResolverError { value: ::fidl_next::wire::Uint32(12) };
930    }
931
932    unsafe impl<___D> ::fidl_next::Decode<___D> for ResolverError
933    where
934        ___D: ?Sized,
935    {
936        fn decode(
937            slot: ::fidl_next::Slot<'_, Self>,
938            _: &mut ___D,
939            _: (),
940        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
941            ::fidl_next::munge!(let Self { value } = slot);
942
943            match u32::from(*value) {
944                1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 => (),
945                unknown => {
946                    return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
947                }
948            }
949
950            Ok(())
951        }
952    }
953
954    impl ::core::convert::From<crate::natural::ResolverError> for ResolverError {
955        fn from(natural: crate::natural::ResolverError) -> Self {
956            match natural {
957                crate::natural::ResolverError::Internal => ResolverError::INTERNAL,
958
959                crate::natural::ResolverError::Io => ResolverError::IO,
960
961                crate::natural::ResolverError::InvalidArgs => ResolverError::INVALID_ARGS,
962
963                crate::natural::ResolverError::NotSupported => ResolverError::NOT_SUPPORTED,
964
965                crate::natural::ResolverError::ManifestNotFound => {
966                    ResolverError::MANIFEST_NOT_FOUND
967                }
968
969                crate::natural::ResolverError::PackageNotFound => ResolverError::PACKAGE_NOT_FOUND,
970
971                crate::natural::ResolverError::NoSpace => ResolverError::NO_SPACE,
972
973                crate::natural::ResolverError::ResourceUnavailable => {
974                    ResolverError::RESOURCE_UNAVAILABLE
975                }
976
977                crate::natural::ResolverError::InvalidManifest => ResolverError::INVALID_MANIFEST,
978
979                crate::natural::ResolverError::ConfigValuesNotFound => {
980                    ResolverError::CONFIG_VALUES_NOT_FOUND
981                }
982
983                crate::natural::ResolverError::AbiRevisionNotFound => {
984                    ResolverError::ABI_REVISION_NOT_FOUND
985                }
986
987                crate::natural::ResolverError::InvalidAbiRevision => {
988                    ResolverError::INVALID_ABI_REVISION
989                }
990            }
991        }
992    }
993
994    impl ::fidl_next::IntoNatural for ResolverError {
995        type Natural = crate::natural::ResolverError;
996    }
997}
998
999pub mod wire_optional {}
1000
1001pub mod generic {
1002
1003    /// The generic type corresponding to [`Context`].
1004    pub struct Context<T0> {
1005        pub bytes: T0,
1006    }
1007
1008    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::Context<'static>, ___E> for Context<T0>
1009    where
1010        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1011        ___E: ::fidl_next::Encoder,
1012        T0: ::fidl_next::Encode<::fidl_next::wire::Vector<'static, u8>, ___E>,
1013    {
1014        #[inline]
1015        fn encode(
1016            self,
1017            encoder_: &mut ___E,
1018            out_: &mut ::core::mem::MaybeUninit<crate::wire::Context<'static>>,
1019            _: (),
1020        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1021            ::fidl_next::munge! {
1022                let crate::wire::Context {
1023                    bytes,
1024
1025                } = out_;
1026            }
1027
1028            ::fidl_next::Encode::encode(self.bytes, encoder_, bytes, (8192, ()))?;
1029
1030            Ok(())
1031        }
1032    }
1033
1034    /// The generic type corresponding to [`ResolverResolveRequest`].
1035    pub struct ResolverResolveRequest<T0> {
1036        pub component_url: T0,
1037    }
1038
1039    unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ResolverResolveRequest<'static>, ___E>
1040        for ResolverResolveRequest<T0>
1041    where
1042        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1043        ___E: ::fidl_next::Encoder,
1044        T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
1045    {
1046        #[inline]
1047        fn encode(
1048            self,
1049            encoder_: &mut ___E,
1050            out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolverResolveRequest<'static>>,
1051            _: (),
1052        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1053            ::fidl_next::munge! {
1054                let crate::wire::ResolverResolveRequest {
1055                    component_url,
1056
1057                } = out_;
1058            }
1059
1060            ::fidl_next::Encode::encode(self.component_url, encoder_, component_url, 2083)?;
1061
1062            Ok(())
1063        }
1064    }
1065
1066    /// The generic type corresponding to [`ResolverResolveWithContextRequest`].
1067    pub struct ResolverResolveWithContextRequest<T0, T1> {
1068        pub component_url: T0,
1069
1070        pub context: T1,
1071    }
1072
1073    unsafe impl<___E, T0, T1>
1074        ::fidl_next::Encode<crate::wire::ResolverResolveWithContextRequest<'static>, ___E>
1075        for ResolverResolveWithContextRequest<T0, T1>
1076    where
1077        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1078        ___E: ::fidl_next::Encoder,
1079        T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
1080        T1: ::fidl_next::Encode<crate::wire::Context<'static>, ___E>,
1081    {
1082        #[inline]
1083        fn encode(
1084            self,
1085            encoder_: &mut ___E,
1086            out_: &mut ::core::mem::MaybeUninit<
1087                crate::wire::ResolverResolveWithContextRequest<'static>,
1088            >,
1089            _: (),
1090        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1091            ::fidl_next::munge! {
1092                let crate::wire::ResolverResolveWithContextRequest {
1093                    component_url,
1094                    context,
1095
1096                } = out_;
1097            }
1098
1099            ::fidl_next::Encode::encode(self.component_url, encoder_, component_url, 2083)?;
1100
1101            ::fidl_next::Encode::encode(self.context, encoder_, context, ())?;
1102
1103            Ok(())
1104        }
1105    }
1106}
1107
1108pub use self::natural::*;
1109
1110#[doc = " Max length of component URL.\n"]
1111pub const MAX_COMPONENT_URL_LENGTH: u32 = 2083 as u32;
1112
1113#[doc = " The maximum number of bytes for a `Context`.\n"]
1114pub const MAX_RESOLUTION_CONTEXT_SIZE: u32 = 8192 as u32;