fidl_next_fuchsia_component_resolution/
fidl_next_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    impl ::fidl_next::Encodable for Context {
14        type Encoded = crate::wire::Context<'static>;
15    }
16
17    unsafe impl<___E> ::fidl_next::Encode<___E> for Context
18    where
19        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
20        ___E: ::fidl_next::Encoder,
21    {
22        #[inline]
23        fn encode(
24            self,
25            encoder_: &mut ___E,
26            out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
27            _: (),
28        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
29            ::fidl_next::munge! {
30                let Self::Encoded {
31                    bytes,
32
33                } = out_;
34            }
35
36            ::fidl_next::Encode::encode(self.bytes, encoder_, bytes, (8192, ()))?;
37
38            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(bytes.as_mut_ptr()) };
39            ::fidl_next::Constrained::validate(_field, (8192, ()))?;
40
41            Ok(())
42        }
43    }
44
45    unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Context
46    where
47        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
48        ___E: ::fidl_next::Encoder,
49    {
50        #[inline]
51        fn encode_ref(
52            &self,
53            encoder_: &mut ___E,
54            out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
55            _: (),
56        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
57            ::fidl_next::munge! {
58                let Self::Encoded {
59
60                    bytes,
61
62                } = out_;
63            }
64
65            ::fidl_next::EncodeRef::encode_ref(&self.bytes, encoder_, bytes, (8192, ()))?;
66
67            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(bytes.as_mut_ptr()) };
68            ::fidl_next::Constrained::validate(_field, (8192, ()))?;
69
70            Ok(())
71        }
72    }
73
74    impl ::fidl_next::EncodableOption for Context {
75        type EncodedOption = ::fidl_next::WireBox<'static, crate::wire::Context<'static>>;
76    }
77
78    unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Context
79    where
80        ___E: ::fidl_next::Encoder + ?Sized,
81        Context: ::fidl_next::Encode<___E>,
82    {
83        #[inline]
84        fn encode_option(
85            this: ::core::option::Option<Self>,
86            encoder: &mut ___E,
87            out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
88            _: (),
89        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
90            if let Some(inner) = this {
91                ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
92                ::fidl_next::WireBox::encode_present(out);
93            } else {
94                ::fidl_next::WireBox::encode_absent(out);
95            }
96
97            Ok(())
98        }
99    }
100
101    unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for Context
102    where
103        ___E: ::fidl_next::Encoder + ?Sized,
104        Context: ::fidl_next::EncodeRef<___E>,
105    {
106        #[inline]
107        fn encode_option_ref(
108            this: ::core::option::Option<&Self>,
109            encoder: &mut ___E,
110            out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
111            _: (),
112        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
113            if let Some(inner) = this {
114                ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
115                ::fidl_next::WireBox::encode_present(out);
116            } else {
117                ::fidl_next::WireBox::encode_absent(out);
118            }
119
120            Ok(())
121        }
122    }
123
124    impl<'de> ::fidl_next::FromWire<crate::wire::Context<'de>> for Context {
125        #[inline]
126        fn from_wire(wire: crate::wire::Context<'de>) -> Self {
127            Self { bytes: ::fidl_next::FromWire::from_wire(wire.bytes) }
128        }
129    }
130
131    impl<'de> ::fidl_next::FromWireRef<crate::wire::Context<'de>> for Context {
132        #[inline]
133        fn from_wire_ref(wire: &crate::wire::Context<'de>) -> Self {
134            Self { bytes: ::fidl_next::FromWireRef::from_wire_ref(&wire.bytes) }
135        }
136    }
137
138    #[doc = " A package is a signed collection of immutable files.\n\n This object provides access to a package\'s content and relevant metadata.\n"]
139    #[derive(PartialEq, Debug, Default)]
140    pub struct Package {
141        pub url: ::core::option::Option<::std::string::String>,
142
143        pub directory: ::core::option::Option<
144            ::fidl_next::ClientEnd<
145                ::fidl_next_fuchsia_io::Directory,
146                ::fidl_next::fuchsia::zx::Channel,
147            >,
148        >,
149    }
150
151    impl Package {
152        fn __max_ordinal(&self) -> usize {
153            if self.directory.is_some() {
154                return 2;
155            }
156
157            if self.url.is_some() {
158                return 1;
159            }
160
161            0
162        }
163    }
164
165    impl ::fidl_next::Encodable for Package {
166        type Encoded = crate::wire::Package<'static>;
167    }
168
169    unsafe impl<___E> ::fidl_next::Encode<___E> for Package
170    where
171        ___E: ::fidl_next::Encoder + ?Sized,
172        ___E: ::fidl_next::fuchsia::HandleEncoder,
173    {
174        #[inline]
175        fn encode(
176            mut self,
177            encoder: &mut ___E,
178            out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
179            _: (),
180        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
181            ::fidl_next::munge!(let crate::wire::Package { table } = out);
182
183            let max_ord = self.__max_ordinal();
184
185            let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
186            ::fidl_next::Wire::zero_padding(&mut out);
187
188            let mut preallocated =
189                ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
190
191            for i in 1..=max_ord {
192                match i {
193                    2 => {
194                        if let Some(value) = self.directory.take() {
195                            ::fidl_next::WireEnvelope::encode_value(
196                                value,
197                                preallocated.encoder,
198                                &mut out,
199                                (),
200                            )?;
201                        } else {
202                            ::fidl_next::WireEnvelope::encode_zero(&mut out)
203                        }
204                    }
205
206                    1 => {
207                        if let Some(value) = self.url.take() {
208                            ::fidl_next::WireEnvelope::encode_value(
209                                value,
210                                preallocated.encoder,
211                                &mut out,
212                                2083,
213                            )?;
214                        } else {
215                            ::fidl_next::WireEnvelope::encode_zero(&mut out)
216                        }
217                    }
218
219                    _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
220                }
221                unsafe {
222                    preallocated.write_next(out.assume_init_ref());
223                }
224            }
225
226            ::fidl_next::WireTable::encode_len(table, max_ord);
227
228            Ok(())
229        }
230    }
231
232    impl<'de> ::fidl_next::FromWire<crate::wire::Package<'de>> for Package {
233        #[inline]
234        fn from_wire(wire_: crate::wire::Package<'de>) -> Self {
235            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
236
237            let url = wire_.table.get(1);
238
239            let directory = wire_.table.get(2);
240
241            Self {
242                url: url.map(|envelope| {
243                    ::fidl_next::FromWire::from_wire(unsafe {
244                        envelope.read_unchecked::<::fidl_next::WireString<'de>>()
245                    })
246                }),
247
248                directory: directory.map(|envelope| {
249                    ::fidl_next::FromWire::from_wire(unsafe {
250                        envelope.read_unchecked::<::fidl_next::ClientEnd<
251                            ::fidl_next_fuchsia_io::Directory,
252                            ::fidl_next::fuchsia::WireChannel,
253                        >>()
254                    })
255                }),
256            }
257        }
258    }
259
260    #[doc = " A component is a unit of executable software.\n\n This object provides the component\'s declaration, access to its package\'s\n content, and relevant metadata as resolved `fuchsia.component.resolution.Resolver`.\n"]
261    #[derive(PartialEq, Debug, Default)]
262    pub struct Component {
263        pub url: ::core::option::Option<::std::string::String>,
264
265        pub decl: ::core::option::Option<::fidl_next_fuchsia_mem::natural::Data>,
266
267        pub package: ::core::option::Option<crate::natural::Package>,
268
269        pub config_values: ::core::option::Option<::fidl_next_fuchsia_mem::natural::Data>,
270
271        pub resolution_context: ::core::option::Option<crate::natural::Context>,
272
273        pub abi_revision: ::core::option::Option<u64>,
274    }
275
276    impl Component {
277        fn __max_ordinal(&self) -> usize {
278            if self.abi_revision.is_some() {
279                return 6;
280            }
281
282            if self.resolution_context.is_some() {
283                return 5;
284            }
285
286            if self.config_values.is_some() {
287                return 4;
288            }
289
290            if self.package.is_some() {
291                return 3;
292            }
293
294            if self.decl.is_some() {
295                return 2;
296            }
297
298            if self.url.is_some() {
299                return 1;
300            }
301
302            0
303        }
304    }
305
306    impl ::fidl_next::Encodable for Component {
307        type Encoded = crate::wire::Component<'static>;
308    }
309
310    unsafe impl<___E> ::fidl_next::Encode<___E> for Component
311    where
312        ___E: ::fidl_next::Encoder + ?Sized,
313        ___E: ::fidl_next::fuchsia::HandleEncoder,
314    {
315        #[inline]
316        fn encode(
317            mut self,
318            encoder: &mut ___E,
319            out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
320            _: (),
321        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
322            ::fidl_next::munge!(let crate::wire::Component { table } = out);
323
324            let max_ord = self.__max_ordinal();
325
326            let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
327            ::fidl_next::Wire::zero_padding(&mut out);
328
329            let mut preallocated =
330                ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
331
332            for i in 1..=max_ord {
333                match i {
334                    6 => {
335                        if let Some(value) = self.abi_revision.take() {
336                            ::fidl_next::WireEnvelope::encode_value(
337                                value,
338                                preallocated.encoder,
339                                &mut out,
340                                (),
341                            )?;
342                        } else {
343                            ::fidl_next::WireEnvelope::encode_zero(&mut out)
344                        }
345                    }
346
347                    5 => {
348                        if let Some(value) = self.resolution_context.take() {
349                            ::fidl_next::WireEnvelope::encode_value(
350                                value,
351                                preallocated.encoder,
352                                &mut out,
353                                (),
354                            )?;
355                        } else {
356                            ::fidl_next::WireEnvelope::encode_zero(&mut out)
357                        }
358                    }
359
360                    4 => {
361                        if let Some(value) = self.config_values.take() {
362                            ::fidl_next::WireEnvelope::encode_value(
363                                value,
364                                preallocated.encoder,
365                                &mut out,
366                                (),
367                            )?;
368                        } else {
369                            ::fidl_next::WireEnvelope::encode_zero(&mut out)
370                        }
371                    }
372
373                    3 => {
374                        if let Some(value) = self.package.take() {
375                            ::fidl_next::WireEnvelope::encode_value(
376                                value,
377                                preallocated.encoder,
378                                &mut out,
379                                (),
380                            )?;
381                        } else {
382                            ::fidl_next::WireEnvelope::encode_zero(&mut out)
383                        }
384                    }
385
386                    2 => {
387                        if let Some(value) = self.decl.take() {
388                            ::fidl_next::WireEnvelope::encode_value(
389                                value,
390                                preallocated.encoder,
391                                &mut out,
392                                (),
393                            )?;
394                        } else {
395                            ::fidl_next::WireEnvelope::encode_zero(&mut out)
396                        }
397                    }
398
399                    1 => {
400                        if let Some(value) = self.url.take() {
401                            ::fidl_next::WireEnvelope::encode_value(
402                                value,
403                                preallocated.encoder,
404                                &mut out,
405                                2083,
406                            )?;
407                        } else {
408                            ::fidl_next::WireEnvelope::encode_zero(&mut out)
409                        }
410                    }
411
412                    _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
413                }
414                unsafe {
415                    preallocated.write_next(out.assume_init_ref());
416                }
417            }
418
419            ::fidl_next::WireTable::encode_len(table, max_ord);
420
421            Ok(())
422        }
423    }
424
425    impl<'de> ::fidl_next::FromWire<crate::wire::Component<'de>> for Component {
426        #[inline]
427        fn from_wire(wire_: crate::wire::Component<'de>) -> Self {
428            let wire_ = ::core::mem::ManuallyDrop::new(wire_);
429
430            let url = wire_.table.get(1);
431
432            let decl = wire_.table.get(2);
433
434            let package = wire_.table.get(3);
435
436            let config_values = wire_.table.get(4);
437
438            let resolution_context = wire_.table.get(5);
439
440            let abi_revision = wire_.table.get(6);
441
442            Self {
443                url: url.map(|envelope| {
444                    ::fidl_next::FromWire::from_wire(unsafe {
445                        envelope.read_unchecked::<::fidl_next::WireString<'de>>()
446                    })
447                }),
448
449                decl: decl.map(|envelope| {
450                    ::fidl_next::FromWire::from_wire(unsafe {
451                        envelope.read_unchecked::<::fidl_next_fuchsia_mem::wire::Data<'de>>()
452                    })
453                }),
454
455                package: package.map(|envelope| {
456                    ::fidl_next::FromWire::from_wire(unsafe {
457                        envelope.read_unchecked::<crate::wire::Package<'de>>()
458                    })
459                }),
460
461                config_values: config_values.map(|envelope| {
462                    ::fidl_next::FromWire::from_wire(unsafe {
463                        envelope.read_unchecked::<::fidl_next_fuchsia_mem::wire::Data<'de>>()
464                    })
465                }),
466
467                resolution_context: resolution_context.map(|envelope| {
468                    ::fidl_next::FromWire::from_wire(unsafe {
469                        envelope.read_unchecked::<crate::wire::Context<'de>>()
470                    })
471                }),
472
473                abi_revision: abi_revision.map(|envelope| {
474                    ::fidl_next::FromWire::from_wire(unsafe {
475                        envelope.read_unchecked::<::fidl_next::WireU64>()
476                    })
477                }),
478            }
479        }
480    }
481
482    #[derive(PartialEq, Clone, Debug)]
483    pub struct ResolverResolveRequest {
484        pub component_url: ::std::string::String,
485    }
486
487    impl ::fidl_next::Encodable for ResolverResolveRequest {
488        type Encoded = crate::wire::ResolverResolveRequest<'static>;
489    }
490
491    unsafe impl<___E> ::fidl_next::Encode<___E> for ResolverResolveRequest
492    where
493        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
494        ___E: ::fidl_next::Encoder,
495    {
496        #[inline]
497        fn encode(
498            self,
499            encoder_: &mut ___E,
500            out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
501            _: (),
502        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
503            ::fidl_next::munge! {
504                let Self::Encoded {
505                    component_url,
506
507                } = out_;
508            }
509
510            ::fidl_next::Encode::encode(self.component_url, encoder_, component_url, 2083)?;
511
512            let mut _field =
513                unsafe { ::fidl_next::Slot::new_unchecked(component_url.as_mut_ptr()) };
514            ::fidl_next::Constrained::validate(_field, 2083)?;
515
516            Ok(())
517        }
518    }
519
520    unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ResolverResolveRequest
521    where
522        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
523        ___E: ::fidl_next::Encoder,
524    {
525        #[inline]
526        fn encode_ref(
527            &self,
528            encoder_: &mut ___E,
529            out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
530            _: (),
531        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
532            ::fidl_next::munge! {
533                let Self::Encoded {
534
535                    component_url,
536
537                } = out_;
538            }
539
540            ::fidl_next::EncodeRef::encode_ref(&self.component_url, encoder_, component_url, 2083)?;
541
542            let mut _field =
543                unsafe { ::fidl_next::Slot::new_unchecked(component_url.as_mut_ptr()) };
544            ::fidl_next::Constrained::validate(_field, 2083)?;
545
546            Ok(())
547        }
548    }
549
550    impl ::fidl_next::EncodableOption for ResolverResolveRequest {
551        type EncodedOption =
552            ::fidl_next::WireBox<'static, crate::wire::ResolverResolveRequest<'static>>;
553    }
554
555    unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ResolverResolveRequest
556    where
557        ___E: ::fidl_next::Encoder + ?Sized,
558        ResolverResolveRequest: ::fidl_next::Encode<___E>,
559    {
560        #[inline]
561        fn encode_option(
562            this: ::core::option::Option<Self>,
563            encoder: &mut ___E,
564            out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
565            _: (),
566        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
567            if let Some(inner) = this {
568                ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
569                ::fidl_next::WireBox::encode_present(out);
570            } else {
571                ::fidl_next::WireBox::encode_absent(out);
572            }
573
574            Ok(())
575        }
576    }
577
578    unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ResolverResolveRequest
579    where
580        ___E: ::fidl_next::Encoder + ?Sized,
581        ResolverResolveRequest: ::fidl_next::EncodeRef<___E>,
582    {
583        #[inline]
584        fn encode_option_ref(
585            this: ::core::option::Option<&Self>,
586            encoder: &mut ___E,
587            out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
588            _: (),
589        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
590            if let Some(inner) = this {
591                ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
592                ::fidl_next::WireBox::encode_present(out);
593            } else {
594                ::fidl_next::WireBox::encode_absent(out);
595            }
596
597            Ok(())
598        }
599    }
600
601    impl<'de> ::fidl_next::FromWire<crate::wire::ResolverResolveRequest<'de>>
602        for ResolverResolveRequest
603    {
604        #[inline]
605        fn from_wire(wire: crate::wire::ResolverResolveRequest<'de>) -> Self {
606            Self { component_url: ::fidl_next::FromWire::from_wire(wire.component_url) }
607        }
608    }
609
610    impl<'de> ::fidl_next::FromWireRef<crate::wire::ResolverResolveRequest<'de>>
611        for ResolverResolveRequest
612    {
613        #[inline]
614        fn from_wire_ref(wire: &crate::wire::ResolverResolveRequest<'de>) -> Self {
615            Self { component_url: ::fidl_next::FromWireRef::from_wire_ref(&wire.component_url) }
616        }
617    }
618
619    #[derive(PartialEq, Clone, Debug)]
620    pub struct ResolverResolveWithContextRequest {
621        pub component_url: ::std::string::String,
622
623        pub context: crate::natural::Context,
624    }
625
626    impl ::fidl_next::Encodable for ResolverResolveWithContextRequest {
627        type Encoded = crate::wire::ResolverResolveWithContextRequest<'static>;
628    }
629
630    unsafe impl<___E> ::fidl_next::Encode<___E> for ResolverResolveWithContextRequest
631    where
632        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
633        ___E: ::fidl_next::Encoder,
634    {
635        #[inline]
636        fn encode(
637            self,
638            encoder_: &mut ___E,
639            out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
640            _: (),
641        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
642            ::fidl_next::munge! {
643                let Self::Encoded {
644                    component_url,
645                    context,
646
647                } = out_;
648            }
649
650            ::fidl_next::Encode::encode(self.component_url, encoder_, component_url, 2083)?;
651
652            let mut _field =
653                unsafe { ::fidl_next::Slot::new_unchecked(component_url.as_mut_ptr()) };
654            ::fidl_next::Constrained::validate(_field, 2083)?;
655
656            ::fidl_next::Encode::encode(self.context, encoder_, context, ())?;
657
658            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(context.as_mut_ptr()) };
659
660            Ok(())
661        }
662    }
663
664    unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ResolverResolveWithContextRequest
665    where
666        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
667        ___E: ::fidl_next::Encoder,
668    {
669        #[inline]
670        fn encode_ref(
671            &self,
672            encoder_: &mut ___E,
673            out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
674            _: (),
675        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
676            ::fidl_next::munge! {
677                let Self::Encoded {
678
679                    component_url,
680                    context,
681
682                } = out_;
683            }
684
685            ::fidl_next::EncodeRef::encode_ref(&self.component_url, encoder_, component_url, 2083)?;
686
687            let mut _field =
688                unsafe { ::fidl_next::Slot::new_unchecked(component_url.as_mut_ptr()) };
689            ::fidl_next::Constrained::validate(_field, 2083)?;
690
691            ::fidl_next::EncodeRef::encode_ref(&self.context, encoder_, context, ())?;
692
693            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(context.as_mut_ptr()) };
694
695            Ok(())
696        }
697    }
698
699    impl ::fidl_next::EncodableOption for ResolverResolveWithContextRequest {
700        type EncodedOption =
701            ::fidl_next::WireBox<'static, crate::wire::ResolverResolveWithContextRequest<'static>>;
702    }
703
704    unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ResolverResolveWithContextRequest
705    where
706        ___E: ::fidl_next::Encoder + ?Sized,
707        ResolverResolveWithContextRequest: ::fidl_next::Encode<___E>,
708    {
709        #[inline]
710        fn encode_option(
711            this: ::core::option::Option<Self>,
712            encoder: &mut ___E,
713            out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
714            _: (),
715        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
716            if let Some(inner) = this {
717                ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
718                ::fidl_next::WireBox::encode_present(out);
719            } else {
720                ::fidl_next::WireBox::encode_absent(out);
721            }
722
723            Ok(())
724        }
725    }
726
727    unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ResolverResolveWithContextRequest
728    where
729        ___E: ::fidl_next::Encoder + ?Sized,
730        ResolverResolveWithContextRequest: ::fidl_next::EncodeRef<___E>,
731    {
732        #[inline]
733        fn encode_option_ref(
734            this: ::core::option::Option<&Self>,
735            encoder: &mut ___E,
736            out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
737            _: (),
738        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
739            if let Some(inner) = this {
740                ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
741                ::fidl_next::WireBox::encode_present(out);
742            } else {
743                ::fidl_next::WireBox::encode_absent(out);
744            }
745
746            Ok(())
747        }
748    }
749
750    impl<'de> ::fidl_next::FromWire<crate::wire::ResolverResolveWithContextRequest<'de>>
751        for ResolverResolveWithContextRequest
752    {
753        #[inline]
754        fn from_wire(wire: crate::wire::ResolverResolveWithContextRequest<'de>) -> Self {
755            Self {
756                component_url: ::fidl_next::FromWire::from_wire(wire.component_url),
757
758                context: ::fidl_next::FromWire::from_wire(wire.context),
759            }
760        }
761    }
762
763    impl<'de> ::fidl_next::FromWireRef<crate::wire::ResolverResolveWithContextRequest<'de>>
764        for ResolverResolveWithContextRequest
765    {
766        #[inline]
767        fn from_wire_ref(wire: &crate::wire::ResolverResolveWithContextRequest<'de>) -> Self {
768            Self {
769                component_url: ::fidl_next::FromWireRef::from_wire_ref(&wire.component_url),
770
771                context: ::fidl_next::FromWireRef::from_wire_ref(&wire.context),
772            }
773        }
774    }
775
776    #[doc = " The possible error conditions returned by ComponentResolver.\n"]
777    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
778    #[repr(u32)]
779    pub enum ResolverError {
780        Internal = 1,
781        Io = 2,
782        InvalidArgs = 3,
783        NotSupported = 4,
784        ManifestNotFound = 5,
785        PackageNotFound = 6,
786        NoSpace = 7,
787        ResourceUnavailable = 8,
788        InvalidManifest = 9,
789        ConfigValuesNotFound = 10,
790        AbiRevisionNotFound = 11,
791        InvalidAbiRevision = 12,
792    }
793
794    impl ::fidl_next::Encodable for ResolverError {
795        type Encoded = crate::wire::ResolverError;
796    }
797    impl ::core::convert::TryFrom<u32> for ResolverError {
798        type Error = ::fidl_next::UnknownStrictEnumMemberError;
799        fn try_from(
800            value: u32,
801        ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
802            match value {
803                1 => Ok(Self::Internal),
804                2 => Ok(Self::Io),
805                3 => Ok(Self::InvalidArgs),
806                4 => Ok(Self::NotSupported),
807                5 => Ok(Self::ManifestNotFound),
808                6 => Ok(Self::PackageNotFound),
809                7 => Ok(Self::NoSpace),
810                8 => Ok(Self::ResourceUnavailable),
811                9 => Ok(Self::InvalidManifest),
812                10 => Ok(Self::ConfigValuesNotFound),
813                11 => Ok(Self::AbiRevisionNotFound),
814                12 => Ok(Self::InvalidAbiRevision),
815
816                _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
817            }
818        }
819    }
820
821    unsafe impl<___E> ::fidl_next::Encode<___E> for ResolverError
822    where
823        ___E: ?Sized,
824    {
825        #[inline]
826        fn encode(
827            self,
828            encoder: &mut ___E,
829            out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
830            _: (),
831        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
832            ::fidl_next::EncodeRef::encode_ref(&self, encoder, out, ())
833        }
834    }
835
836    unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ResolverError
837    where
838        ___E: ?Sized,
839    {
840        #[inline]
841        fn encode_ref(
842            &self,
843            encoder: &mut ___E,
844            out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
845            _: (),
846        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
847            ::fidl_next::munge!(let crate::wire::ResolverError { value } = out);
848            let _ = value.write(::fidl_next::WireU32::from(match *self {
849                Self::Internal => 1,
850
851                Self::Io => 2,
852
853                Self::InvalidArgs => 3,
854
855                Self::NotSupported => 4,
856
857                Self::ManifestNotFound => 5,
858
859                Self::PackageNotFound => 6,
860
861                Self::NoSpace => 7,
862
863                Self::ResourceUnavailable => 8,
864
865                Self::InvalidManifest => 9,
866
867                Self::ConfigValuesNotFound => 10,
868
869                Self::AbiRevisionNotFound => 11,
870
871                Self::InvalidAbiRevision => 12,
872            }));
873
874            Ok(())
875        }
876    }
877
878    impl ::core::convert::From<crate::wire::ResolverError> for ResolverError {
879        fn from(wire: crate::wire::ResolverError) -> Self {
880            match u32::from(wire.value) {
881                1 => Self::Internal,
882
883                2 => Self::Io,
884
885                3 => Self::InvalidArgs,
886
887                4 => Self::NotSupported,
888
889                5 => Self::ManifestNotFound,
890
891                6 => Self::PackageNotFound,
892
893                7 => Self::NoSpace,
894
895                8 => Self::ResourceUnavailable,
896
897                9 => Self::InvalidManifest,
898
899                10 => Self::ConfigValuesNotFound,
900
901                11 => Self::AbiRevisionNotFound,
902
903                12 => Self::InvalidAbiRevision,
904
905                _ => unsafe { ::core::hint::unreachable_unchecked() },
906            }
907        }
908    }
909
910    impl ::fidl_next::FromWire<crate::wire::ResolverError> for ResolverError {
911        #[inline]
912        fn from_wire(wire: crate::wire::ResolverError) -> Self {
913            Self::from(wire)
914        }
915    }
916
917    impl ::fidl_next::FromWireRef<crate::wire::ResolverError> for ResolverError {
918        #[inline]
919        fn from_wire_ref(wire: &crate::wire::ResolverError) -> Self {
920            Self::from(*wire)
921        }
922    }
923
924    #[derive(PartialEq, Debug)]
925    pub struct ResolverResolveResponse {
926        pub component: crate::natural::Component,
927    }
928
929    impl ::fidl_next::Encodable for ResolverResolveResponse {
930        type Encoded = crate::wire::ResolverResolveResponse<'static>;
931    }
932
933    unsafe impl<___E> ::fidl_next::Encode<___E> for ResolverResolveResponse
934    where
935        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
936        ___E: ::fidl_next::Encoder,
937        ___E: ::fidl_next::fuchsia::HandleEncoder,
938    {
939        #[inline]
940        fn encode(
941            self,
942            encoder_: &mut ___E,
943            out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
944            _: (),
945        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
946            ::fidl_next::munge! {
947                let Self::Encoded {
948                    component,
949
950                } = out_;
951            }
952
953            ::fidl_next::Encode::encode(self.component, encoder_, component, ())?;
954
955            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(component.as_mut_ptr()) };
956
957            Ok(())
958        }
959    }
960
961    impl ::fidl_next::EncodableOption for ResolverResolveResponse {
962        type EncodedOption =
963            ::fidl_next::WireBox<'static, crate::wire::ResolverResolveResponse<'static>>;
964    }
965
966    unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ResolverResolveResponse
967    where
968        ___E: ::fidl_next::Encoder + ?Sized,
969        ResolverResolveResponse: ::fidl_next::Encode<___E>,
970    {
971        #[inline]
972        fn encode_option(
973            this: ::core::option::Option<Self>,
974            encoder: &mut ___E,
975            out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
976            _: (),
977        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
978            if let Some(inner) = this {
979                ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
980                ::fidl_next::WireBox::encode_present(out);
981            } else {
982                ::fidl_next::WireBox::encode_absent(out);
983            }
984
985            Ok(())
986        }
987    }
988
989    impl<'de> ::fidl_next::FromWire<crate::wire::ResolverResolveResponse<'de>>
990        for ResolverResolveResponse
991    {
992        #[inline]
993        fn from_wire(wire: crate::wire::ResolverResolveResponse<'de>) -> Self {
994            Self { component: ::fidl_next::FromWire::from_wire(wire.component) }
995        }
996    }
997
998    #[derive(PartialEq, Debug)]
999    pub struct ResolverResolveWithContextResponse {
1000        pub component: crate::natural::Component,
1001    }
1002
1003    impl ::fidl_next::Encodable for ResolverResolveWithContextResponse {
1004        type Encoded = crate::wire::ResolverResolveWithContextResponse<'static>;
1005    }
1006
1007    unsafe impl<___E> ::fidl_next::Encode<___E> for ResolverResolveWithContextResponse
1008    where
1009        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1010        ___E: ::fidl_next::Encoder,
1011        ___E: ::fidl_next::fuchsia::HandleEncoder,
1012    {
1013        #[inline]
1014        fn encode(
1015            self,
1016            encoder_: &mut ___E,
1017            out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1018            _: (),
1019        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1020            ::fidl_next::munge! {
1021                let Self::Encoded {
1022                    component,
1023
1024                } = out_;
1025            }
1026
1027            ::fidl_next::Encode::encode(self.component, encoder_, component, ())?;
1028
1029            let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(component.as_mut_ptr()) };
1030
1031            Ok(())
1032        }
1033    }
1034
1035    impl ::fidl_next::EncodableOption for ResolverResolveWithContextResponse {
1036        type EncodedOption =
1037            ::fidl_next::WireBox<'static, crate::wire::ResolverResolveWithContextResponse<'static>>;
1038    }
1039
1040    unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ResolverResolveWithContextResponse
1041    where
1042        ___E: ::fidl_next::Encoder + ?Sized,
1043        ResolverResolveWithContextResponse: ::fidl_next::Encode<___E>,
1044    {
1045        #[inline]
1046        fn encode_option(
1047            this: ::core::option::Option<Self>,
1048            encoder: &mut ___E,
1049            out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1050            _: (),
1051        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1052            if let Some(inner) = this {
1053                ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
1054                ::fidl_next::WireBox::encode_present(out);
1055            } else {
1056                ::fidl_next::WireBox::encode_absent(out);
1057            }
1058
1059            Ok(())
1060        }
1061    }
1062
1063    impl<'de> ::fidl_next::FromWire<crate::wire::ResolverResolveWithContextResponse<'de>>
1064        for ResolverResolveWithContextResponse
1065    {
1066        #[inline]
1067        fn from_wire(wire: crate::wire::ResolverResolveWithContextResponse<'de>) -> Self {
1068            Self { component: ::fidl_next::FromWire::from_wire(wire.component) }
1069        }
1070    }
1071}
1072
1073pub mod wire {
1074
1075    /// The wire type corresponding to [`Context`].
1076    #[derive(Debug)]
1077    #[repr(C)]
1078    pub struct Context<'de> {
1079        pub bytes: ::fidl_next::WireVector<'de, u8>,
1080    }
1081
1082    static_assertions::const_assert_eq!(std::mem::size_of::<Context<'_>>(), 16);
1083    static_assertions::const_assert_eq!(std::mem::align_of::<Context<'_>>(), 8);
1084
1085    static_assertions::const_assert_eq!(std::mem::offset_of!(Context<'_>, bytes), 0);
1086
1087    unsafe impl ::fidl_next::Wire for Context<'static> {
1088        type Decoded<'de> = Context<'de>;
1089
1090        #[inline]
1091        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1092            ::fidl_next::munge! {
1093                let Self {
1094
1095                    bytes,
1096
1097                } = &mut *out_;
1098            }
1099
1100            ::fidl_next::Wire::zero_padding(bytes);
1101        }
1102    }
1103
1104    unsafe impl<___D> ::fidl_next::Decode<___D> for Context<'static>
1105    where
1106        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1107        ___D: ::fidl_next::Decoder,
1108    {
1109        fn decode(
1110            slot_: ::fidl_next::Slot<'_, Self>,
1111            decoder_: &mut ___D,
1112            _: (),
1113        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1114            ::fidl_next::munge! {
1115                let Self {
1116
1117                    mut bytes,
1118
1119                } = slot_;
1120            }
1121
1122            let _field = bytes.as_mut();
1123            ::fidl_next::Constrained::validate(_field, (8192, ()))?;
1124            ::fidl_next::Decode::decode(bytes.as_mut(), decoder_, (8192, ()))?;
1125
1126            let bytes = unsafe { bytes.deref_unchecked() };
1127
1128            if bytes.len() > 8192 {
1129                return Err(::fidl_next::DecodeError::VectorTooLong {
1130                    size: bytes.len() as u64,
1131                    limit: 8192,
1132                });
1133            }
1134
1135            Ok(())
1136        }
1137    }
1138
1139    impl<'de> ::fidl_next::IntoNatural for Context<'de> {
1140        type Natural = crate::natural::Context;
1141    }
1142
1143    impl ::fidl_next::Unconstrained for Context<'static> {}
1144
1145    /// The wire type corresponding to [`Package`].
1146    #[repr(C)]
1147    pub struct Package<'de> {
1148        pub(crate) table: ::fidl_next::WireTable<'de>,
1149    }
1150
1151    impl<'de> Drop for Package<'de> {
1152        fn drop(&mut self) {
1153            let _ = self.table.get(1).map(|envelope| unsafe {
1154                envelope.read_unchecked::<::fidl_next::WireString<'de>>()
1155            });
1156
1157            let _ = self.table.get(2).map(|envelope| unsafe {
1158                envelope.read_unchecked::<::fidl_next::ClientEnd<
1159                    ::fidl_next_fuchsia_io::Directory,
1160                    ::fidl_next::fuchsia::WireChannel,
1161                >>()
1162            });
1163        }
1164    }
1165
1166    unsafe impl ::fidl_next::Wire for Package<'static> {
1167        type Decoded<'de> = Package<'de>;
1168
1169        #[inline]
1170        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1171            ::fidl_next::munge!(let Self { table } = out);
1172            ::fidl_next::WireTable::zero_padding(table);
1173        }
1174    }
1175
1176    unsafe impl<___D> ::fidl_next::Decode<___D> for Package<'static>
1177    where
1178        ___D: ::fidl_next::Decoder + ?Sized,
1179        ___D: ::fidl_next::fuchsia::HandleDecoder,
1180    {
1181        fn decode(
1182            slot: ::fidl_next::Slot<'_, Self>,
1183            decoder: &mut ___D,
1184            _: (),
1185        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1186            ::fidl_next::munge!(let Self { table } = slot);
1187
1188            ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1189                match ordinal {
1190                    0 => unsafe { ::core::hint::unreachable_unchecked() },
1191
1192                    1 => {
1193                        ::fidl_next::WireEnvelope::decode_as::<
1194                            ___D,
1195                            ::fidl_next::WireString<'static>,
1196                        >(slot.as_mut(), decoder, 2083)?;
1197
1198                        let value = unsafe {
1199                            slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
1200                        };
1201
1202                        if value.len() > 2083 {
1203                            return Err(::fidl_next::DecodeError::VectorTooLong {
1204                                size: value.len() as u64,
1205                                limit: 2083,
1206                            });
1207                        }
1208
1209                        Ok(())
1210                    }
1211
1212                    2 => {
1213                        ::fidl_next::WireEnvelope::decode_as::<
1214                            ___D,
1215                            ::fidl_next::ClientEnd<
1216                                ::fidl_next_fuchsia_io::Directory,
1217                                ::fidl_next::fuchsia::WireChannel,
1218                            >,
1219                        >(slot.as_mut(), decoder, ())?;
1220
1221                        Ok(())
1222                    }
1223
1224                    _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1225                }
1226            })
1227        }
1228    }
1229
1230    impl<'de> Package<'de> {
1231        pub fn url(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
1232            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1233        }
1234
1235        pub fn directory(
1236            &self,
1237        ) -> ::core::option::Option<
1238            &::fidl_next::ClientEnd<
1239                ::fidl_next_fuchsia_io::Directory,
1240                ::fidl_next::fuchsia::WireChannel,
1241            >,
1242        > {
1243            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1244        }
1245    }
1246
1247    impl<'de> ::core::fmt::Debug for Package<'de> {
1248        fn fmt(
1249            &self,
1250            f: &mut ::core::fmt::Formatter<'_>,
1251        ) -> ::core::result::Result<(), ::core::fmt::Error> {
1252            f.debug_struct("Package")
1253                .field("url", &self.url())
1254                .field("directory", &self.directory())
1255                .finish()
1256        }
1257    }
1258
1259    impl<'de> ::fidl_next::IntoNatural for Package<'de> {
1260        type Natural = crate::natural::Package;
1261    }
1262
1263    impl ::fidl_next::Unconstrained for Package<'_> {}
1264
1265    /// The wire type corresponding to [`Component`].
1266    #[repr(C)]
1267    pub struct Component<'de> {
1268        pub(crate) table: ::fidl_next::WireTable<'de>,
1269    }
1270
1271    impl<'de> Drop for Component<'de> {
1272        fn drop(&mut self) {
1273            let _ = self.table.get(1).map(|envelope| unsafe {
1274                envelope.read_unchecked::<::fidl_next::WireString<'de>>()
1275            });
1276
1277            let _ = self.table.get(2).map(|envelope| unsafe {
1278                envelope.read_unchecked::<::fidl_next_fuchsia_mem::wire::Data<'de>>()
1279            });
1280
1281            let _ = self
1282                .table
1283                .get(3)
1284                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Package<'de>>() });
1285
1286            let _ = self.table.get(4).map(|envelope| unsafe {
1287                envelope.read_unchecked::<::fidl_next_fuchsia_mem::wire::Data<'de>>()
1288            });
1289
1290            let _ = self
1291                .table
1292                .get(5)
1293                .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Context<'de>>() });
1294
1295            let _ = self
1296                .table
1297                .get(6)
1298                .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU64>() });
1299        }
1300    }
1301
1302    unsafe impl ::fidl_next::Wire for Component<'static> {
1303        type Decoded<'de> = Component<'de>;
1304
1305        #[inline]
1306        fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1307            ::fidl_next::munge!(let Self { table } = out);
1308            ::fidl_next::WireTable::zero_padding(table);
1309        }
1310    }
1311
1312    unsafe impl<___D> ::fidl_next::Decode<___D> for Component<'static>
1313    where
1314        ___D: ::fidl_next::Decoder + ?Sized,
1315        ___D: ::fidl_next::fuchsia::HandleDecoder,
1316    {
1317        fn decode(
1318            slot: ::fidl_next::Slot<'_, Self>,
1319            decoder: &mut ___D,
1320            _: (),
1321        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1322            ::fidl_next::munge!(let Self { table } = slot);
1323
1324            ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1325                match ordinal {
1326                    0 => unsafe { ::core::hint::unreachable_unchecked() },
1327
1328                    1 => {
1329                        ::fidl_next::WireEnvelope::decode_as::<
1330                            ___D,
1331                            ::fidl_next::WireString<'static>,
1332                        >(slot.as_mut(), decoder, 2083)?;
1333
1334                        let value = unsafe {
1335                            slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
1336                        };
1337
1338                        if value.len() > 2083 {
1339                            return Err(::fidl_next::DecodeError::VectorTooLong {
1340                                size: value.len() as u64,
1341                                limit: 2083,
1342                            });
1343                        }
1344
1345                        Ok(())
1346                    }
1347
1348                    2 => {
1349                        ::fidl_next::WireEnvelope::decode_as::<
1350                            ___D,
1351                            ::fidl_next_fuchsia_mem::wire::Data<'static>,
1352                        >(slot.as_mut(), decoder, ())?;
1353
1354                        Ok(())
1355                    }
1356
1357                    3 => {
1358                        ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Package<'static>>(
1359                            slot.as_mut(),
1360                            decoder,
1361                            (),
1362                        )?;
1363
1364                        Ok(())
1365                    }
1366
1367                    4 => {
1368                        ::fidl_next::WireEnvelope::decode_as::<
1369                            ___D,
1370                            ::fidl_next_fuchsia_mem::wire::Data<'static>,
1371                        >(slot.as_mut(), decoder, ())?;
1372
1373                        Ok(())
1374                    }
1375
1376                    5 => {
1377                        ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Context<'static>>(
1378                            slot.as_mut(),
1379                            decoder,
1380                            (),
1381                        )?;
1382
1383                        Ok(())
1384                    }
1385
1386                    6 => {
1387                        ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU64>(
1388                            slot.as_mut(),
1389                            decoder,
1390                            (),
1391                        )?;
1392
1393                        Ok(())
1394                    }
1395
1396                    _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1397                }
1398            })
1399        }
1400    }
1401
1402    impl<'de> Component<'de> {
1403        pub fn url(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
1404            unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1405        }
1406
1407        pub fn decl(&self) -> ::core::option::Option<&::fidl_next_fuchsia_mem::wire::Data<'de>> {
1408            unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1409        }
1410
1411        pub fn package(&self) -> ::core::option::Option<&crate::wire::Package<'de>> {
1412            unsafe { Some(self.table.get(3)?.deref_unchecked()) }
1413        }
1414
1415        pub fn config_values(
1416            &self,
1417        ) -> ::core::option::Option<&::fidl_next_fuchsia_mem::wire::Data<'de>> {
1418            unsafe { Some(self.table.get(4)?.deref_unchecked()) }
1419        }
1420
1421        pub fn resolution_context(&self) -> ::core::option::Option<&crate::wire::Context<'de>> {
1422            unsafe { Some(self.table.get(5)?.deref_unchecked()) }
1423        }
1424
1425        pub fn abi_revision(&self) -> ::core::option::Option<&::fidl_next::WireU64> {
1426            unsafe { Some(self.table.get(6)?.deref_unchecked()) }
1427        }
1428    }
1429
1430    impl<'de> ::core::fmt::Debug for Component<'de> {
1431        fn fmt(
1432            &self,
1433            f: &mut ::core::fmt::Formatter<'_>,
1434        ) -> ::core::result::Result<(), ::core::fmt::Error> {
1435            f.debug_struct("Component")
1436                .field("url", &self.url())
1437                .field("decl", &self.decl())
1438                .field("package", &self.package())
1439                .field("config_values", &self.config_values())
1440                .field("resolution_context", &self.resolution_context())
1441                .field("abi_revision", &self.abi_revision())
1442                .finish()
1443        }
1444    }
1445
1446    impl<'de> ::fidl_next::IntoNatural for Component<'de> {
1447        type Natural = crate::natural::Component;
1448    }
1449
1450    impl ::fidl_next::Unconstrained for Component<'_> {}
1451
1452    /// The wire type corresponding to [`ResolverResolveRequest`].
1453    #[derive(Debug)]
1454    #[repr(C)]
1455    pub struct ResolverResolveRequest<'de> {
1456        pub component_url: ::fidl_next::WireString<'de>,
1457    }
1458
1459    static_assertions::const_assert_eq!(std::mem::size_of::<ResolverResolveRequest<'_>>(), 16);
1460    static_assertions::const_assert_eq!(std::mem::align_of::<ResolverResolveRequest<'_>>(), 8);
1461
1462    static_assertions::const_assert_eq!(
1463        std::mem::offset_of!(ResolverResolveRequest<'_>, component_url),
1464        0
1465    );
1466
1467    unsafe impl ::fidl_next::Wire for ResolverResolveRequest<'static> {
1468        type Decoded<'de> = ResolverResolveRequest<'de>;
1469
1470        #[inline]
1471        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1472            ::fidl_next::munge! {
1473                let Self {
1474
1475                    component_url,
1476
1477                } = &mut *out_;
1478            }
1479
1480            ::fidl_next::Wire::zero_padding(component_url);
1481        }
1482    }
1483
1484    unsafe impl<___D> ::fidl_next::Decode<___D> for ResolverResolveRequest<'static>
1485    where
1486        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1487        ___D: ::fidl_next::Decoder,
1488    {
1489        fn decode(
1490            slot_: ::fidl_next::Slot<'_, Self>,
1491            decoder_: &mut ___D,
1492            _: (),
1493        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1494            ::fidl_next::munge! {
1495                let Self {
1496
1497                    mut component_url,
1498
1499                } = slot_;
1500            }
1501
1502            let _field = component_url.as_mut();
1503            ::fidl_next::Constrained::validate(_field, 2083)?;
1504            ::fidl_next::Decode::decode(component_url.as_mut(), decoder_, 2083)?;
1505
1506            let component_url = unsafe { component_url.deref_unchecked() };
1507
1508            if component_url.len() > 2083 {
1509                return Err(::fidl_next::DecodeError::VectorTooLong {
1510                    size: component_url.len() as u64,
1511                    limit: 2083,
1512                });
1513            }
1514
1515            Ok(())
1516        }
1517    }
1518
1519    impl<'de> ::fidl_next::IntoNatural for ResolverResolveRequest<'de> {
1520        type Natural = crate::natural::ResolverResolveRequest;
1521    }
1522
1523    impl ::fidl_next::Unconstrained for ResolverResolveRequest<'static> {}
1524
1525    /// The wire type corresponding to [`ResolverResolveWithContextRequest`].
1526    #[derive(Debug)]
1527    #[repr(C)]
1528    pub struct ResolverResolveWithContextRequest<'de> {
1529        pub component_url: ::fidl_next::WireString<'de>,
1530
1531        pub context: crate::wire::Context<'de>,
1532    }
1533
1534    static_assertions::const_assert_eq!(
1535        std::mem::size_of::<ResolverResolveWithContextRequest<'_>>(),
1536        32
1537    );
1538    static_assertions::const_assert_eq!(
1539        std::mem::align_of::<ResolverResolveWithContextRequest<'_>>(),
1540        8
1541    );
1542
1543    static_assertions::const_assert_eq!(
1544        std::mem::offset_of!(ResolverResolveWithContextRequest<'_>, component_url),
1545        0
1546    );
1547
1548    static_assertions::const_assert_eq!(
1549        std::mem::offset_of!(ResolverResolveWithContextRequest<'_>, context),
1550        16
1551    );
1552
1553    unsafe impl ::fidl_next::Wire for ResolverResolveWithContextRequest<'static> {
1554        type Decoded<'de> = ResolverResolveWithContextRequest<'de>;
1555
1556        #[inline]
1557        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1558            ::fidl_next::munge! {
1559                let Self {
1560
1561                    component_url,
1562                    context,
1563
1564                } = &mut *out_;
1565            }
1566
1567            ::fidl_next::Wire::zero_padding(component_url);
1568
1569            ::fidl_next::Wire::zero_padding(context);
1570        }
1571    }
1572
1573    unsafe impl<___D> ::fidl_next::Decode<___D> for ResolverResolveWithContextRequest<'static>
1574    where
1575        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1576        ___D: ::fidl_next::Decoder,
1577    {
1578        fn decode(
1579            slot_: ::fidl_next::Slot<'_, Self>,
1580            decoder_: &mut ___D,
1581            _: (),
1582        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1583            ::fidl_next::munge! {
1584                let Self {
1585
1586                    mut component_url,
1587                    mut context,
1588
1589                } = slot_;
1590            }
1591
1592            let _field = component_url.as_mut();
1593            ::fidl_next::Constrained::validate(_field, 2083)?;
1594            ::fidl_next::Decode::decode(component_url.as_mut(), decoder_, 2083)?;
1595
1596            let component_url = unsafe { component_url.deref_unchecked() };
1597
1598            if component_url.len() > 2083 {
1599                return Err(::fidl_next::DecodeError::VectorTooLong {
1600                    size: component_url.len() as u64,
1601                    limit: 2083,
1602                });
1603            }
1604
1605            let _field = context.as_mut();
1606
1607            ::fidl_next::Decode::decode(context.as_mut(), decoder_, ())?;
1608
1609            Ok(())
1610        }
1611    }
1612
1613    impl<'de> ::fidl_next::IntoNatural for ResolverResolveWithContextRequest<'de> {
1614        type Natural = crate::natural::ResolverResolveWithContextRequest;
1615    }
1616
1617    impl ::fidl_next::Unconstrained for ResolverResolveWithContextRequest<'static> {}
1618
1619    /// The wire type corresponding to [`ResolverError`].
1620    #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1621    #[repr(transparent)]
1622    pub struct ResolverError {
1623        pub(crate) value: ::fidl_next::WireU32,
1624    }
1625
1626    unsafe impl ::fidl_next::Wire for ResolverError {
1627        type Decoded<'de> = Self;
1628
1629        #[inline]
1630        fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
1631            // Wire enums have no padding
1632        }
1633    }
1634
1635    impl ResolverError {
1636        pub const INTERNAL: ResolverError = ResolverError { value: ::fidl_next::WireU32(1) };
1637
1638        pub const IO: ResolverError = ResolverError { value: ::fidl_next::WireU32(2) };
1639
1640        pub const INVALID_ARGS: ResolverError = ResolverError { value: ::fidl_next::WireU32(3) };
1641
1642        pub const NOT_SUPPORTED: ResolverError = ResolverError { value: ::fidl_next::WireU32(4) };
1643
1644        pub const MANIFEST_NOT_FOUND: ResolverError =
1645            ResolverError { value: ::fidl_next::WireU32(5) };
1646
1647        pub const PACKAGE_NOT_FOUND: ResolverError =
1648            ResolverError { value: ::fidl_next::WireU32(6) };
1649
1650        pub const NO_SPACE: ResolverError = ResolverError { value: ::fidl_next::WireU32(7) };
1651
1652        pub const RESOURCE_UNAVAILABLE: ResolverError =
1653            ResolverError { value: ::fidl_next::WireU32(8) };
1654
1655        pub const INVALID_MANIFEST: ResolverError =
1656            ResolverError { value: ::fidl_next::WireU32(9) };
1657
1658        pub const CONFIG_VALUES_NOT_FOUND: ResolverError =
1659            ResolverError { value: ::fidl_next::WireU32(10) };
1660
1661        pub const ABI_REVISION_NOT_FOUND: ResolverError =
1662            ResolverError { value: ::fidl_next::WireU32(11) };
1663
1664        pub const INVALID_ABI_REVISION: ResolverError =
1665            ResolverError { value: ::fidl_next::WireU32(12) };
1666    }
1667
1668    unsafe impl<___D> ::fidl_next::Decode<___D> for ResolverError
1669    where
1670        ___D: ?Sized,
1671    {
1672        fn decode(
1673            slot: ::fidl_next::Slot<'_, Self>,
1674            _: &mut ___D,
1675            _: (),
1676        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1677            ::fidl_next::munge!(let Self { value } = slot);
1678
1679            match u32::from(*value) {
1680                1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 => (),
1681                unknown => {
1682                    return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
1683                }
1684            }
1685
1686            Ok(())
1687        }
1688    }
1689
1690    impl ::core::convert::From<crate::natural::ResolverError> for ResolverError {
1691        fn from(natural: crate::natural::ResolverError) -> Self {
1692            match natural {
1693                crate::natural::ResolverError::Internal => ResolverError::INTERNAL,
1694
1695                crate::natural::ResolverError::Io => ResolverError::IO,
1696
1697                crate::natural::ResolverError::InvalidArgs => ResolverError::INVALID_ARGS,
1698
1699                crate::natural::ResolverError::NotSupported => ResolverError::NOT_SUPPORTED,
1700
1701                crate::natural::ResolverError::ManifestNotFound => {
1702                    ResolverError::MANIFEST_NOT_FOUND
1703                }
1704
1705                crate::natural::ResolverError::PackageNotFound => ResolverError::PACKAGE_NOT_FOUND,
1706
1707                crate::natural::ResolverError::NoSpace => ResolverError::NO_SPACE,
1708
1709                crate::natural::ResolverError::ResourceUnavailable => {
1710                    ResolverError::RESOURCE_UNAVAILABLE
1711                }
1712
1713                crate::natural::ResolverError::InvalidManifest => ResolverError::INVALID_MANIFEST,
1714
1715                crate::natural::ResolverError::ConfigValuesNotFound => {
1716                    ResolverError::CONFIG_VALUES_NOT_FOUND
1717                }
1718
1719                crate::natural::ResolverError::AbiRevisionNotFound => {
1720                    ResolverError::ABI_REVISION_NOT_FOUND
1721                }
1722
1723                crate::natural::ResolverError::InvalidAbiRevision => {
1724                    ResolverError::INVALID_ABI_REVISION
1725                }
1726            }
1727        }
1728    }
1729
1730    impl ::fidl_next::IntoNatural for ResolverError {
1731        type Natural = crate::natural::ResolverError;
1732    }
1733
1734    impl ::fidl_next::Unconstrained for ResolverError {}
1735
1736    /// The wire type corresponding to [`ResolverResolveResponse`].
1737    #[derive(Debug)]
1738    #[repr(C)]
1739    pub struct ResolverResolveResponse<'de> {
1740        pub component: crate::wire::Component<'de>,
1741    }
1742
1743    static_assertions::const_assert_eq!(std::mem::size_of::<ResolverResolveResponse<'_>>(), 16);
1744    static_assertions::const_assert_eq!(std::mem::align_of::<ResolverResolveResponse<'_>>(), 8);
1745
1746    static_assertions::const_assert_eq!(
1747        std::mem::offset_of!(ResolverResolveResponse<'_>, component),
1748        0
1749    );
1750
1751    unsafe impl ::fidl_next::Wire for ResolverResolveResponse<'static> {
1752        type Decoded<'de> = ResolverResolveResponse<'de>;
1753
1754        #[inline]
1755        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1756            ::fidl_next::munge! {
1757                let Self {
1758
1759                    component,
1760
1761                } = &mut *out_;
1762            }
1763
1764            ::fidl_next::Wire::zero_padding(component);
1765        }
1766    }
1767
1768    unsafe impl<___D> ::fidl_next::Decode<___D> for ResolverResolveResponse<'static>
1769    where
1770        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1771        ___D: ::fidl_next::Decoder,
1772        ___D: ::fidl_next::fuchsia::HandleDecoder,
1773    {
1774        fn decode(
1775            slot_: ::fidl_next::Slot<'_, Self>,
1776            decoder_: &mut ___D,
1777            _: (),
1778        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1779            ::fidl_next::munge! {
1780                let Self {
1781
1782                    mut component,
1783
1784                } = slot_;
1785            }
1786
1787            let _field = component.as_mut();
1788
1789            ::fidl_next::Decode::decode(component.as_mut(), decoder_, ())?;
1790
1791            Ok(())
1792        }
1793    }
1794
1795    impl<'de> ::fidl_next::IntoNatural for ResolverResolveResponse<'de> {
1796        type Natural = crate::natural::ResolverResolveResponse;
1797    }
1798
1799    impl ::fidl_next::Unconstrained for ResolverResolveResponse<'static> {}
1800
1801    /// The wire type corresponding to [`ResolverResolveWithContextResponse`].
1802    #[derive(Debug)]
1803    #[repr(C)]
1804    pub struct ResolverResolveWithContextResponse<'de> {
1805        pub component: crate::wire::Component<'de>,
1806    }
1807
1808    static_assertions::const_assert_eq!(
1809        std::mem::size_of::<ResolverResolveWithContextResponse<'_>>(),
1810        16
1811    );
1812    static_assertions::const_assert_eq!(
1813        std::mem::align_of::<ResolverResolveWithContextResponse<'_>>(),
1814        8
1815    );
1816
1817    static_assertions::const_assert_eq!(
1818        std::mem::offset_of!(ResolverResolveWithContextResponse<'_>, component),
1819        0
1820    );
1821
1822    unsafe impl ::fidl_next::Wire for ResolverResolveWithContextResponse<'static> {
1823        type Decoded<'de> = ResolverResolveWithContextResponse<'de>;
1824
1825        #[inline]
1826        fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
1827            ::fidl_next::munge! {
1828                let Self {
1829
1830                    component,
1831
1832                } = &mut *out_;
1833            }
1834
1835            ::fidl_next::Wire::zero_padding(component);
1836        }
1837    }
1838
1839    unsafe impl<___D> ::fidl_next::Decode<___D> for ResolverResolveWithContextResponse<'static>
1840    where
1841        ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1842        ___D: ::fidl_next::Decoder,
1843        ___D: ::fidl_next::fuchsia::HandleDecoder,
1844    {
1845        fn decode(
1846            slot_: ::fidl_next::Slot<'_, Self>,
1847            decoder_: &mut ___D,
1848            _: (),
1849        ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1850            ::fidl_next::munge! {
1851                let Self {
1852
1853                    mut component,
1854
1855                } = slot_;
1856            }
1857
1858            let _field = component.as_mut();
1859
1860            ::fidl_next::Decode::decode(component.as_mut(), decoder_, ())?;
1861
1862            Ok(())
1863        }
1864    }
1865
1866    impl<'de> ::fidl_next::IntoNatural for ResolverResolveWithContextResponse<'de> {
1867        type Natural = crate::natural::ResolverResolveWithContextResponse;
1868    }
1869
1870    impl ::fidl_next::Unconstrained for ResolverResolveWithContextResponse<'static> {}
1871}
1872
1873pub mod wire_optional {}
1874
1875pub mod generic {
1876
1877    pub struct Context<T0> {
1878        pub bytes: T0,
1879    }
1880
1881    impl<T0> ::fidl_next::Encodable for Context<T0>
1882    where
1883        T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireVector<'static, u8>>,
1884    {
1885        type Encoded = crate::wire::Context<'static>;
1886    }
1887
1888    unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Context<T0>
1889    where
1890        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1891        ___E: ::fidl_next::Encoder,
1892        T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireVector<'static, u8>>,
1893    {
1894        #[inline]
1895        fn encode(
1896            self,
1897            encoder_: &mut ___E,
1898            out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1899            _: (),
1900        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1901            ::fidl_next::munge! {
1902                let Self::Encoded {
1903
1904                    bytes,
1905
1906                } = out_;
1907            }
1908
1909            ::fidl_next::Encode::encode(self.bytes, encoder_, bytes, (8192, ()))?;
1910
1911            Ok(())
1912        }
1913    }
1914
1915    pub struct ResolverResolveRequest<T0> {
1916        pub component_url: T0,
1917    }
1918
1919    impl<T0> ::fidl_next::Encodable for ResolverResolveRequest<T0>
1920    where
1921        T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
1922    {
1923        type Encoded = crate::wire::ResolverResolveRequest<'static>;
1924    }
1925
1926    unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ResolverResolveRequest<T0>
1927    where
1928        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1929        ___E: ::fidl_next::Encoder,
1930        T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
1931    {
1932        #[inline]
1933        fn encode(
1934            self,
1935            encoder_: &mut ___E,
1936            out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1937            _: (),
1938        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1939            ::fidl_next::munge! {
1940                let Self::Encoded {
1941
1942                    component_url,
1943
1944                } = out_;
1945            }
1946
1947            ::fidl_next::Encode::encode(self.component_url, encoder_, component_url, 2083)?;
1948
1949            Ok(())
1950        }
1951    }
1952
1953    pub struct ResolverResolveWithContextRequest<T0, T1> {
1954        pub component_url: T0,
1955
1956        pub context: T1,
1957    }
1958
1959    impl<T0, T1> ::fidl_next::Encodable for ResolverResolveWithContextRequest<T0, T1>
1960    where
1961        T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
1962        T1: ::fidl_next::Encodable<Encoded = crate::wire::Context<'static>>,
1963    {
1964        type Encoded = crate::wire::ResolverResolveWithContextRequest<'static>;
1965    }
1966
1967    unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for ResolverResolveWithContextRequest<T0, T1>
1968    where
1969        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1970        ___E: ::fidl_next::Encoder,
1971        T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
1972        T1: ::fidl_next::Encode<___E, Encoded = crate::wire::Context<'static>>,
1973    {
1974        #[inline]
1975        fn encode(
1976            self,
1977            encoder_: &mut ___E,
1978            out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1979            _: (),
1980        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1981            ::fidl_next::munge! {
1982                let Self::Encoded {
1983
1984                    component_url,
1985                    context,
1986
1987                } = out_;
1988            }
1989
1990            ::fidl_next::Encode::encode(self.component_url, encoder_, component_url, 2083)?;
1991
1992            ::fidl_next::Encode::encode(self.context, encoder_, context, ())?;
1993
1994            Ok(())
1995        }
1996    }
1997
1998    pub struct ResolverResolveResponse<T0> {
1999        pub component: T0,
2000    }
2001
2002    impl<T0> ::fidl_next::Encodable for ResolverResolveResponse<T0>
2003    where
2004        T0: ::fidl_next::Encodable<Encoded = crate::wire::Component<'static>>,
2005    {
2006        type Encoded = crate::wire::ResolverResolveResponse<'static>;
2007    }
2008
2009    unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ResolverResolveResponse<T0>
2010    where
2011        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2012        ___E: ::fidl_next::Encoder,
2013        ___E: ::fidl_next::fuchsia::HandleEncoder,
2014        T0: ::fidl_next::Encode<___E, Encoded = crate::wire::Component<'static>>,
2015    {
2016        #[inline]
2017        fn encode(
2018            self,
2019            encoder_: &mut ___E,
2020            out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2021            _: (),
2022        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2023            ::fidl_next::munge! {
2024                let Self::Encoded {
2025
2026                    component,
2027
2028                } = out_;
2029            }
2030
2031            ::fidl_next::Encode::encode(self.component, encoder_, component, ())?;
2032
2033            Ok(())
2034        }
2035    }
2036
2037    pub struct ResolverResolveWithContextResponse<T0> {
2038        pub component: T0,
2039    }
2040
2041    impl<T0> ::fidl_next::Encodable for ResolverResolveWithContextResponse<T0>
2042    where
2043        T0: ::fidl_next::Encodable<Encoded = crate::wire::Component<'static>>,
2044    {
2045        type Encoded = crate::wire::ResolverResolveWithContextResponse<'static>;
2046    }
2047
2048    unsafe impl<___E, T0> ::fidl_next::Encode<___E> for ResolverResolveWithContextResponse<T0>
2049    where
2050        ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2051        ___E: ::fidl_next::Encoder,
2052        ___E: ::fidl_next::fuchsia::HandleEncoder,
2053        T0: ::fidl_next::Encode<___E, Encoded = crate::wire::Component<'static>>,
2054    {
2055        #[inline]
2056        fn encode(
2057            self,
2058            encoder_: &mut ___E,
2059            out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2060            _: (),
2061        ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2062            ::fidl_next::munge! {
2063                let Self::Encoded {
2064
2065                    component,
2066
2067                } = out_;
2068            }
2069
2070            ::fidl_next::Encode::encode(self.component, encoder_, component, ())?;
2071
2072            Ok(())
2073        }
2074    }
2075}
2076
2077pub use self::natural::*;
2078
2079#[doc = " Max length of component URL.\n"]
2080pub const MAX_COMPONENT_URL_LENGTH: u32 = 2083 as u32;
2081
2082#[doc = " The maximum number of bytes for a `Context`.\n"]
2083pub const MAX_RESOLUTION_CONTEXT_SIZE: u32 = 8192 as u32;
2084
2085/// The type corresponding to the Resolver protocol.
2086#[doc = " An interface for resolving a URL to a component.\n\n This interface is implemented by components that provide support\n for loading components with a particular URL scheme.   For example,\n the Fuchsia package component resolver exposes a service with this\n interface to resolve component URLs using the \"fuchsia-pkg://\" scheme.\n\n To use a resolver to resolve URLs within your realm, register it\n in your realm\'s manifest.\n\n Note: The component manager is the only intended direct client of this\n interface.\n"]
2087#[derive(PartialEq, Debug)]
2088pub struct Resolver;
2089
2090impl ::fidl_next::Discoverable for Resolver {
2091    const PROTOCOL_NAME: &'static str = "fuchsia.component.resolution.Resolver";
2092}
2093
2094#[cfg(target_os = "fuchsia")]
2095impl ::fidl_next::HasTransport for Resolver {
2096    type Transport = ::fidl_next::fuchsia::zx::Channel;
2097}
2098
2099pub mod resolver {
2100    pub mod prelude {
2101        pub use crate::{Resolver, ResolverClientHandler, ResolverServerHandler, resolver};
2102
2103        pub use crate::natural::ResolverError;
2104
2105        pub use crate::natural::ResolverResolveRequest;
2106
2107        pub use crate::natural::ResolverResolveWithContextRequest;
2108
2109        pub use crate::natural::ResolverResolveWithContextResponse;
2110
2111        pub use crate::natural::ResolverResolveResponse;
2112    }
2113
2114    pub struct Resolve;
2115
2116    impl ::fidl_next::Method for Resolve {
2117        const ORDINAL: u64 = 6339326548187935461;
2118        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2119            ::fidl_next::protocol::Flexibility::Strict;
2120
2121        type Protocol = crate::Resolver;
2122
2123        type Request = crate::wire::ResolverResolveRequest<'static>;
2124
2125        type Response = ::fidl_next::WireResult<
2126            'static,
2127            crate::wire::ResolverResolveResponse<'static>,
2128            crate::wire::ResolverError,
2129        >;
2130    }
2131
2132    impl<___R> ::fidl_next::Respond<___R> for Resolve {
2133        type Output = ::core::result::Result<
2134            crate::generic::ResolverResolveResponse<___R>,
2135            ::fidl_next::util::EncodableNever<crate::wire::ResolverError>,
2136        >;
2137
2138        fn respond(response: ___R) -> Self::Output {
2139            ::core::result::Result::Ok(crate::generic::ResolverResolveResponse {
2140                component: response,
2141            })
2142        }
2143    }
2144
2145    impl<___R> ::fidl_next::RespondErr<___R> for Resolve {
2146        type Output = ::core::result::Result<
2147            ::fidl_next::util::EncodableNever<crate::wire::ResolverResolveResponse<'static>>,
2148            ___R,
2149        >;
2150
2151        fn respond_err(response: ___R) -> Self::Output {
2152            ::core::result::Result::Err(response)
2153        }
2154    }
2155
2156    pub struct ResolveWithContext;
2157
2158    impl ::fidl_next::Method for ResolveWithContext {
2159        const ORDINAL: u64 = 5576776708309151933;
2160        const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
2161            ::fidl_next::protocol::Flexibility::Strict;
2162
2163        type Protocol = crate::Resolver;
2164
2165        type Request = crate::wire::ResolverResolveWithContextRequest<'static>;
2166
2167        type Response = ::fidl_next::WireResult<
2168            'static,
2169            crate::wire::ResolverResolveWithContextResponse<'static>,
2170            crate::wire::ResolverError,
2171        >;
2172    }
2173
2174    impl<___R> ::fidl_next::Respond<___R> for ResolveWithContext {
2175        type Output = ::core::result::Result<
2176            crate::generic::ResolverResolveWithContextResponse<___R>,
2177            ::fidl_next::util::EncodableNever<crate::wire::ResolverError>,
2178        >;
2179
2180        fn respond(response: ___R) -> Self::Output {
2181            ::core::result::Result::Ok(crate::generic::ResolverResolveWithContextResponse {
2182                component: response,
2183            })
2184        }
2185    }
2186
2187    impl<___R> ::fidl_next::RespondErr<___R> for ResolveWithContext {
2188        type Output = ::core::result::Result<
2189            ::fidl_next::util::EncodableNever<
2190                crate::wire::ResolverResolveWithContextResponse<'static>,
2191            >,
2192            ___R,
2193        >;
2194
2195        fn respond_err(response: ___R) -> Self::Output {
2196            ::core::result::Result::Err(response)
2197        }
2198    }
2199
2200    mod ___detail {
2201        unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Resolver
2202        where
2203            ___T: ::fidl_next::Transport,
2204        {
2205            type Client = ResolverClient<___T>;
2206            type Server = ResolverServer<___T>;
2207        }
2208
2209        /// The client for the `Resolver` protocol.
2210        #[repr(transparent)]
2211        pub struct ResolverClient<___T: ::fidl_next::Transport> {
2212            #[allow(dead_code)]
2213            client: ::fidl_next::protocol::Client<___T>,
2214        }
2215
2216        impl<___T> ResolverClient<___T>
2217        where
2218            ___T: ::fidl_next::Transport,
2219        {
2220            #[doc = " Resolves a component with the given absolute URL.\n\n `component_url` is the unescaped URL of the component to resolve.\n\n If successful, returns information about the component\n that was resolved.\n\n On failure, returns a `ResolverError` error.\n"]
2221            pub fn resolve(
2222                &self,
2223
2224                component_url: impl ::fidl_next::Encode<
2225                    <___T as ::fidl_next::Transport>::SendBuffer,
2226                    Encoded = ::fidl_next::WireString<'static>,
2227                >,
2228            ) -> ::fidl_next::TwoWayFuture<'_, super::Resolve, ___T>
2229            where
2230                <___T as ::fidl_next::Transport>::SendBuffer:
2231                    ::fidl_next::encoder::InternalHandleEncoder,
2232                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2233            {
2234                self.resolve_with(crate::generic::ResolverResolveRequest { component_url })
2235            }
2236
2237            #[doc = " Resolves a component with the given absolute URL.\n\n `component_url` is the unescaped URL of the component to resolve.\n\n If successful, returns information about the component\n that was resolved.\n\n On failure, returns a `ResolverError` error.\n"]
2238            pub fn resolve_with<___R>(
2239                &self,
2240                request: ___R,
2241            ) -> ::fidl_next::TwoWayFuture<'_, super::Resolve, ___T>
2242            where
2243                ___R: ::fidl_next::Encode<
2244                        <___T as ::fidl_next::Transport>::SendBuffer,
2245                        Encoded = crate::wire::ResolverResolveRequest<'static>,
2246                    >,
2247            {
2248                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2249                    6339326548187935461,
2250                    <super::Resolve as ::fidl_next::Method>::FLEXIBILITY,
2251                    request,
2252                ))
2253            }
2254
2255            #[doc = " Resolves a component with the absolute or relative URL. If relative, the\n component will be resolved relative to the supplied `context`.\n\n `component_url` is the unescaped URL of the component to resolve, the\n format of which can be either:\n\n   * a fully-qualified absolute component URL; or\n   * a subpackaged-component reference, prefixed by a URI relative\n     path to its containing subpackage (for example,\n     `child_package#meta/some_component.cm`)\n\n `context` is the `resolution_context` of a previously-resolved\n `Component`, providing the context for resoving a relative URL.\n"]
2256            pub fn resolve_with_context(
2257                &self,
2258
2259                component_url: impl ::fidl_next::Encode<
2260                    <___T as ::fidl_next::Transport>::SendBuffer,
2261                    Encoded = ::fidl_next::WireString<'static>,
2262                >,
2263
2264                context: impl ::fidl_next::Encode<
2265                    <___T as ::fidl_next::Transport>::SendBuffer,
2266                    Encoded = crate::wire::Context<'static>,
2267                >,
2268            ) -> ::fidl_next::TwoWayFuture<'_, super::ResolveWithContext, ___T>
2269            where
2270                <___T as ::fidl_next::Transport>::SendBuffer:
2271                    ::fidl_next::encoder::InternalHandleEncoder,
2272                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2273            {
2274                self.resolve_with_context_with(crate::generic::ResolverResolveWithContextRequest {
2275                    component_url,
2276
2277                    context,
2278                })
2279            }
2280
2281            #[doc = " Resolves a component with the absolute or relative URL. If relative, the\n component will be resolved relative to the supplied `context`.\n\n `component_url` is the unescaped URL of the component to resolve, the\n format of which can be either:\n\n   * a fully-qualified absolute component URL; or\n   * a subpackaged-component reference, prefixed by a URI relative\n     path to its containing subpackage (for example,\n     `child_package#meta/some_component.cm`)\n\n `context` is the `resolution_context` of a previously-resolved\n `Component`, providing the context for resoving a relative URL.\n"]
2282            pub fn resolve_with_context_with<___R>(
2283                &self,
2284                request: ___R,
2285            ) -> ::fidl_next::TwoWayFuture<'_, super::ResolveWithContext, ___T>
2286            where
2287                ___R: ::fidl_next::Encode<
2288                        <___T as ::fidl_next::Transport>::SendBuffer,
2289                        Encoded = crate::wire::ResolverResolveWithContextRequest<'static>,
2290                    >,
2291            {
2292                ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
2293                    5576776708309151933,
2294                    <super::ResolveWithContext as ::fidl_next::Method>::FLEXIBILITY,
2295                    request,
2296                ))
2297            }
2298        }
2299
2300        /// The server for the `Resolver` protocol.
2301        #[repr(transparent)]
2302        pub struct ResolverServer<___T: ::fidl_next::Transport> {
2303            server: ::fidl_next::protocol::Server<___T>,
2304        }
2305
2306        impl<___T> ResolverServer<___T> where ___T: ::fidl_next::Transport {}
2307    }
2308}
2309
2310/// A client handler for the Resolver protocol.
2311///
2312/// See [`Resolver`] for more details.
2313pub trait ResolverClientHandler<
2314    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2315    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2316>
2317{
2318    fn on_unknown_interaction(
2319        &mut self,
2320        ordinal: u64,
2321    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2322        ::core::future::ready(())
2323    }
2324}
2325
2326impl<___T> ResolverClientHandler<___T> for ::fidl_next::IgnoreEvents
2327where
2328    ___T: ::fidl_next::Transport,
2329{
2330    async fn on_unknown_interaction(&mut self, _: u64) {}
2331}
2332
2333impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Resolver
2334where
2335    ___H: ResolverClientHandler<___T> + ::core::marker::Send,
2336    ___T: ::fidl_next::Transport,
2337    <resolver::Resolve as ::fidl_next::Method>::Response:
2338        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2339    <resolver::ResolveWithContext as ::fidl_next::Method>::Response:
2340        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2341{
2342    async fn on_event(
2343        handler: &mut ___H,
2344        ordinal: u64,
2345        flexibility: ::fidl_next::protocol::Flexibility,
2346        buffer: ___T::RecvBuffer,
2347    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2348        match ordinal {
2349            ordinal => {
2350                handler.on_unknown_interaction(ordinal).await;
2351                if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
2352                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2353                } else {
2354                    Ok(())
2355                }
2356            }
2357        }
2358    }
2359}
2360
2361/// A server handler for the Resolver protocol.
2362///
2363/// See [`Resolver`] for more details.
2364pub trait ResolverServerHandler<
2365    #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2366    #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
2367>
2368{
2369    #[doc = " Resolves a component with the given absolute URL.\n\n `component_url` is the unescaped URL of the component to resolve.\n\n If successful, returns information about the component\n that was resolved.\n\n On failure, returns a `ResolverError` error.\n"]
2370    fn resolve(
2371        &mut self,
2372
2373        request: ::fidl_next::Request<resolver::Resolve, ___T>,
2374
2375        responder: ::fidl_next::Responder<resolver::Resolve, ___T>,
2376    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2377
2378    #[doc = " Resolves a component with the absolute or relative URL. If relative, the\n component will be resolved relative to the supplied `context`.\n\n `component_url` is the unescaped URL of the component to resolve, the\n format of which can be either:\n\n   * a fully-qualified absolute component URL; or\n   * a subpackaged-component reference, prefixed by a URI relative\n     path to its containing subpackage (for example,\n     `child_package#meta/some_component.cm`)\n\n `context` is the `resolution_context` of a previously-resolved\n `Component`, providing the context for resoving a relative URL.\n"]
2379    fn resolve_with_context(
2380        &mut self,
2381
2382        request: ::fidl_next::Request<resolver::ResolveWithContext, ___T>,
2383
2384        responder: ::fidl_next::Responder<resolver::ResolveWithContext, ___T>,
2385    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2386
2387    fn on_unknown_interaction(
2388        &mut self,
2389        ordinal: u64,
2390    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
2391        ::core::future::ready(())
2392    }
2393}
2394
2395impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Resolver
2396where
2397    ___H: ResolverServerHandler<___T> + ::core::marker::Send,
2398    ___T: ::fidl_next::Transport,
2399    <resolver::Resolve as ::fidl_next::Method>::Request:
2400        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2401    <resolver::ResolveWithContext as ::fidl_next::Method>::Request:
2402        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2403{
2404    async fn on_one_way(
2405        handler: &mut ___H,
2406        ordinal: u64,
2407        flexibility: ::fidl_next::protocol::Flexibility,
2408        buffer: ___T::RecvBuffer,
2409    ) -> ::core::result::Result<
2410        (),
2411        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2412    > {
2413        match ordinal {
2414            ordinal => {
2415                handler.on_unknown_interaction(ordinal).await;
2416                if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
2417                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2418                } else {
2419                    Ok(())
2420                }
2421            }
2422        }
2423    }
2424
2425    async fn on_two_way(
2426        handler: &mut ___H,
2427        ordinal: u64,
2428        flexibility: ::fidl_next::protocol::Flexibility,
2429        buffer: ___T::RecvBuffer,
2430        responder: ::fidl_next::protocol::Responder<___T>,
2431    ) -> ::core::result::Result<
2432        (),
2433        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2434    > {
2435        match ordinal {
2436            6339326548187935461 => {
2437                let responder = ::fidl_next::Responder::from_untyped(responder);
2438
2439                match ::fidl_next::DecoderExt::decode(buffer) {
2440                    Ok(decoded) => {
2441                        handler.resolve(decoded, responder).await;
2442                        Ok(())
2443                    }
2444                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2445                        ordinal: 6339326548187935461,
2446                        error,
2447                    }),
2448                }
2449            }
2450
2451            5576776708309151933 => {
2452                let responder = ::fidl_next::Responder::from_untyped(responder);
2453
2454                match ::fidl_next::DecoderExt::decode(buffer) {
2455                    Ok(decoded) => {
2456                        handler.resolve_with_context(decoded, responder).await;
2457                        Ok(())
2458                    }
2459                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2460                        ordinal: 5576776708309151933,
2461                        error,
2462                    }),
2463                }
2464            }
2465
2466            ordinal => {
2467                handler.on_unknown_interaction(ordinal).await;
2468                if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
2469                    Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
2470                } else {
2471                    responder
2472                        .respond(
2473                            ordinal,
2474                            flexibility,
2475                            ::fidl_next::Flexible::<()>::FrameworkErr(
2476                                ::fidl_next::FrameworkError::UnknownMethod,
2477                            ),
2478                        )
2479                        .expect("encoding a framework error should never fail")
2480                        .await?;
2481                    Ok(())
2482                }
2483            }
2484        }
2485    }
2486}
2487
2488/// Compatibility shims which mimic some API surfaces of the current Rust bindings.
2489pub mod compat {
2490
2491    impl ::fidl_next::CompatFrom<crate::Context> for ::fidl_fuchsia_component_resolution::Context {
2492        #[inline]
2493        fn compat_from(value: crate::Context) -> Self {
2494            Self { bytes: ::fidl_next::CompatFrom::compat_from(value.bytes) }
2495        }
2496    }
2497
2498    impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::Context> for crate::Context {
2499        #[inline]
2500        fn compat_from(value: ::fidl_fuchsia_component_resolution::Context) -> Self {
2501            Self { bytes: ::fidl_next::CompatFrom::compat_from(value.bytes) }
2502        }
2503    }
2504
2505    impl ::fidl_next::CompatFrom<crate::Package> for ::fidl_fuchsia_component_resolution::Package {
2506        fn compat_from(value: crate::Package) -> Self {
2507            Self {
2508                url: ::fidl_next::CompatFrom::compat_from(value.url),
2509
2510                directory: ::fidl_next::CompatFrom::compat_from(value.directory),
2511
2512                __source_breaking: ::fidl::marker::SourceBreaking,
2513            }
2514        }
2515    }
2516
2517    impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::Package> for crate::Package {
2518        fn compat_from(value: ::fidl_fuchsia_component_resolution::Package) -> Self {
2519            Self {
2520                url: ::fidl_next::CompatFrom::compat_from(value.url),
2521
2522                directory: ::fidl_next::CompatFrom::compat_from(value.directory),
2523            }
2524        }
2525    }
2526
2527    impl ::fidl_next::CompatFrom<crate::Component> for ::fidl_fuchsia_component_resolution::Component {
2528        fn compat_from(value: crate::Component) -> Self {
2529            Self {
2530                url: ::fidl_next::CompatFrom::compat_from(value.url),
2531
2532                decl: ::fidl_next::CompatFrom::compat_from(value.decl),
2533
2534                package: ::fidl_next::CompatFrom::compat_from(value.package),
2535
2536                config_values: ::fidl_next::CompatFrom::compat_from(value.config_values),
2537
2538                resolution_context: ::fidl_next::CompatFrom::compat_from(value.resolution_context),
2539
2540                abi_revision: ::fidl_next::CompatFrom::compat_from(value.abi_revision),
2541
2542                __source_breaking: ::fidl::marker::SourceBreaking,
2543            }
2544        }
2545    }
2546
2547    impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::Component> for crate::Component {
2548        fn compat_from(value: ::fidl_fuchsia_component_resolution::Component) -> Self {
2549            Self {
2550                url: ::fidl_next::CompatFrom::compat_from(value.url),
2551
2552                decl: ::fidl_next::CompatFrom::compat_from(value.decl),
2553
2554                package: ::fidl_next::CompatFrom::compat_from(value.package),
2555
2556                config_values: ::fidl_next::CompatFrom::compat_from(value.config_values),
2557
2558                resolution_context: ::fidl_next::CompatFrom::compat_from(value.resolution_context),
2559
2560                abi_revision: ::fidl_next::CompatFrom::compat_from(value.abi_revision),
2561            }
2562        }
2563    }
2564
2565    impl ::fidl_next::CompatFrom<crate::ResolverResolveRequest>
2566        for ::fidl_fuchsia_component_resolution::ResolverResolveRequest
2567    {
2568        #[inline]
2569        fn compat_from(value: crate::ResolverResolveRequest) -> Self {
2570            Self { component_url: ::fidl_next::CompatFrom::compat_from(value.component_url) }
2571        }
2572    }
2573
2574    impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::ResolverResolveRequest>
2575        for crate::ResolverResolveRequest
2576    {
2577        #[inline]
2578        fn compat_from(value: ::fidl_fuchsia_component_resolution::ResolverResolveRequest) -> Self {
2579            Self { component_url: ::fidl_next::CompatFrom::compat_from(value.component_url) }
2580        }
2581    }
2582
2583    impl ::fidl_next::CompatFrom<crate::ResolverResolveWithContextRequest>
2584        for ::fidl_fuchsia_component_resolution::ResolverResolveWithContextRequest
2585    {
2586        #[inline]
2587        fn compat_from(value: crate::ResolverResolveWithContextRequest) -> Self {
2588            Self {
2589                component_url: ::fidl_next::CompatFrom::compat_from(value.component_url),
2590
2591                context: ::fidl_next::CompatFrom::compat_from(value.context),
2592            }
2593        }
2594    }
2595
2596    impl
2597        ::fidl_next::CompatFrom<
2598            ::fidl_fuchsia_component_resolution::ResolverResolveWithContextRequest,
2599        > for crate::ResolverResolveWithContextRequest
2600    {
2601        #[inline]
2602        fn compat_from(
2603            value: ::fidl_fuchsia_component_resolution::ResolverResolveWithContextRequest,
2604        ) -> Self {
2605            Self {
2606                component_url: ::fidl_next::CompatFrom::compat_from(value.component_url),
2607
2608                context: ::fidl_next::CompatFrom::compat_from(value.context),
2609            }
2610        }
2611    }
2612
2613    impl ::fidl_next::CompatFrom<crate::ResolverError>
2614        for ::fidl_fuchsia_component_resolution::ResolverError
2615    {
2616        fn compat_from(value: crate::ResolverError) -> Self {
2617            match value {
2618                crate::ResolverError::Internal => Self::Internal,
2619
2620                crate::ResolverError::Io => Self::Io,
2621
2622                crate::ResolverError::InvalidArgs => Self::InvalidArgs,
2623
2624                crate::ResolverError::NotSupported => Self::NotSupported,
2625
2626                crate::ResolverError::ManifestNotFound => Self::ManifestNotFound,
2627
2628                crate::ResolverError::PackageNotFound => Self::PackageNotFound,
2629
2630                crate::ResolverError::NoSpace => Self::NoSpace,
2631
2632                crate::ResolverError::ResourceUnavailable => Self::ResourceUnavailable,
2633
2634                crate::ResolverError::InvalidManifest => Self::InvalidManifest,
2635
2636                crate::ResolverError::ConfigValuesNotFound => Self::ConfigValuesNotFound,
2637
2638                crate::ResolverError::AbiRevisionNotFound => Self::AbiRevisionNotFound,
2639
2640                crate::ResolverError::InvalidAbiRevision => Self::InvalidAbiRevision,
2641            }
2642        }
2643    }
2644
2645    impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::ResolverError>
2646        for crate::ResolverError
2647    {
2648        fn compat_from(value: ::fidl_fuchsia_component_resolution::ResolverError) -> Self {
2649            match value {
2650                ::fidl_fuchsia_component_resolution::ResolverError::Internal => Self::Internal,
2651
2652                ::fidl_fuchsia_component_resolution::ResolverError::Io => Self::Io,
2653
2654                ::fidl_fuchsia_component_resolution::ResolverError::InvalidArgs => {
2655                    Self::InvalidArgs
2656                }
2657
2658                ::fidl_fuchsia_component_resolution::ResolverError::NotSupported => {
2659                    Self::NotSupported
2660                }
2661
2662                ::fidl_fuchsia_component_resolution::ResolverError::ManifestNotFound => {
2663                    Self::ManifestNotFound
2664                }
2665
2666                ::fidl_fuchsia_component_resolution::ResolverError::PackageNotFound => {
2667                    Self::PackageNotFound
2668                }
2669
2670                ::fidl_fuchsia_component_resolution::ResolverError::NoSpace => Self::NoSpace,
2671
2672                ::fidl_fuchsia_component_resolution::ResolverError::ResourceUnavailable => {
2673                    Self::ResourceUnavailable
2674                }
2675
2676                ::fidl_fuchsia_component_resolution::ResolverError::InvalidManifest => {
2677                    Self::InvalidManifest
2678                }
2679
2680                ::fidl_fuchsia_component_resolution::ResolverError::ConfigValuesNotFound => {
2681                    Self::ConfigValuesNotFound
2682                }
2683
2684                ::fidl_fuchsia_component_resolution::ResolverError::AbiRevisionNotFound => {
2685                    Self::AbiRevisionNotFound
2686                }
2687
2688                ::fidl_fuchsia_component_resolution::ResolverError::InvalidAbiRevision => {
2689                    Self::InvalidAbiRevision
2690                }
2691            }
2692        }
2693    }
2694
2695    impl ::fidl_next::CompatFrom<crate::ResolverResolveResponse>
2696        for ::fidl_fuchsia_component_resolution::ResolverResolveResponse
2697    {
2698        #[inline]
2699        fn compat_from(value: crate::ResolverResolveResponse) -> Self {
2700            Self { component: ::fidl_next::CompatFrom::compat_from(value.component) }
2701        }
2702    }
2703
2704    impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::ResolverResolveResponse>
2705        for crate::ResolverResolveResponse
2706    {
2707        #[inline]
2708        fn compat_from(
2709            value: ::fidl_fuchsia_component_resolution::ResolverResolveResponse,
2710        ) -> Self {
2711            Self { component: ::fidl_next::CompatFrom::compat_from(value.component) }
2712        }
2713    }
2714
2715    impl ::fidl_next::CompatFrom<crate::ResolverResolveWithContextResponse>
2716        for ::fidl_fuchsia_component_resolution::ResolverResolveWithContextResponse
2717    {
2718        #[inline]
2719        fn compat_from(value: crate::ResolverResolveWithContextResponse) -> Self {
2720            Self { component: ::fidl_next::CompatFrom::compat_from(value.component) }
2721        }
2722    }
2723
2724    impl
2725        ::fidl_next::CompatFrom<
2726            ::fidl_fuchsia_component_resolution::ResolverResolveWithContextResponse,
2727        > for crate::ResolverResolveWithContextResponse
2728    {
2729        #[inline]
2730        fn compat_from(
2731            value: ::fidl_fuchsia_component_resolution::ResolverResolveWithContextResponse,
2732        ) -> Self {
2733            Self { component: ::fidl_next::CompatFrom::compat_from(value.component) }
2734        }
2735    }
2736
2737    #[cfg(target_os = "fuchsia")]
2738    /// An alias for a client over `zx::Channel` for the `Resolver`
2739    /// protocol.
2740    pub type ResolverProxy = ::fidl_next::Client<crate::Resolver>;
2741
2742    impl ::fidl_next::CompatFrom<crate::Resolver>
2743        for ::fidl_fuchsia_component_resolution::ResolverMarker
2744    {
2745        fn compat_from(_: crate::Resolver) -> Self {
2746            Self
2747        }
2748    }
2749
2750    impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::ResolverMarker>
2751        for crate::Resolver
2752    {
2753        fn compat_from(_: ::fidl_fuchsia_component_resolution::ResolverMarker) -> Self {
2754            Self
2755        }
2756    }
2757
2758    #[cfg(target_os = "fuchsia")]
2759
2760    impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_component_resolution::ResolverProxy>
2761        for crate::Resolver
2762    {
2763        fn client_compat_from(
2764            proxy: ::fidl_fuchsia_component_resolution::ResolverProxy,
2765        ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
2766            let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
2767            let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
2768            ::fidl_next::ClientDispatcher::new(client_end)
2769        }
2770    }
2771}