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