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 use self::natural::*;
1876
1877#[doc = " Max length of component URL.\n"]
1878pub const MAX_COMPONENT_URL_LENGTH: u32 = 2083 as u32;
1879
1880#[doc = " The maximum number of bytes for a `Context`.\n"]
1881pub const MAX_RESOLUTION_CONTEXT_SIZE: u32 = 8192 as u32;
1882
1883/// The type corresponding to the Resolver protocol.
1884#[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"]
1885#[derive(PartialEq, Debug)]
1886pub struct Resolver;
1887
1888impl ::fidl_next::Discoverable for Resolver {
1889    const PROTOCOL_NAME: &'static str = "fuchsia.component.resolution.Resolver";
1890}
1891
1892pub mod resolver {
1893    pub mod prelude {
1894        pub use crate::{Resolver, ResolverClientHandler, ResolverServerHandler, resolver};
1895
1896        pub use crate::natural::ResolverError;
1897
1898        pub use crate::natural::ResolverResolveRequest;
1899
1900        pub use crate::natural::ResolverResolveWithContextRequest;
1901
1902        pub use crate::natural::ResolverResolveWithContextResponse;
1903
1904        pub use crate::natural::ResolverResolveResponse;
1905    }
1906
1907    pub struct Resolve;
1908
1909    impl ::fidl_next::Method for Resolve {
1910        const ORDINAL: u64 = 6339326548187935461;
1911
1912        type Protocol = crate::Resolver;
1913
1914        type Request = crate::wire::ResolverResolveRequest<'static>;
1915
1916        type Response = ::fidl_next::WireResult<
1917            'static,
1918            crate::wire::ResolverResolveResponse<'static>,
1919            crate::wire::ResolverError,
1920        >;
1921    }
1922
1923    pub struct ResolveWithContext;
1924
1925    impl ::fidl_next::Method for ResolveWithContext {
1926        const ORDINAL: u64 = 5576776708309151933;
1927
1928        type Protocol = crate::Resolver;
1929
1930        type Request = crate::wire::ResolverResolveWithContextRequest<'static>;
1931
1932        type Response = ::fidl_next::WireResult<
1933            'static,
1934            crate::wire::ResolverResolveWithContextResponse<'static>,
1935            crate::wire::ResolverError,
1936        >;
1937    }
1938
1939    mod ___detail {
1940
1941        pub struct Resolve<T0> {
1942            component_url: T0,
1943        }
1944
1945        impl<T0> ::fidl_next::Encodable for Resolve<T0>
1946        where
1947            T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
1948        {
1949            type Encoded = crate::wire::ResolverResolveRequest<'static>;
1950        }
1951
1952        unsafe impl<___E, T0> ::fidl_next::Encode<___E> for Resolve<T0>
1953        where
1954            ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1955            ___E: ::fidl_next::Encoder,
1956            T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
1957        {
1958            #[inline]
1959            fn encode(
1960                self,
1961                encoder_: &mut ___E,
1962                out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1963                _: (),
1964            ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1965                ::fidl_next::munge! {
1966                    let Self::Encoded {
1967                        component_url,
1968
1969                    } = out_;
1970                }
1971
1972                ::fidl_next::Encode::encode(self.component_url, encoder_, component_url, 2083)?;
1973
1974                Ok(())
1975            }
1976        }
1977
1978        pub struct ResolveWithContext<T0, T1> {
1979            component_url: T0,
1980
1981            context: T1,
1982        }
1983
1984        impl<T0, T1> ::fidl_next::Encodable for ResolveWithContext<T0, T1>
1985        where
1986            T0: ::fidl_next::Encodable<Encoded = ::fidl_next::WireString<'static>>,
1987            T1: ::fidl_next::Encodable<Encoded = crate::wire::Context<'static>>,
1988        {
1989            type Encoded = crate::wire::ResolverResolveWithContextRequest<'static>;
1990        }
1991
1992        unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for ResolveWithContext<T0, T1>
1993        where
1994            ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1995            ___E: ::fidl_next::Encoder,
1996            T0: ::fidl_next::Encode<___E, Encoded = ::fidl_next::WireString<'static>>,
1997            T1: ::fidl_next::Encode<___E, Encoded = crate::wire::Context<'static>>,
1998        {
1999            #[inline]
2000            fn encode(
2001                self,
2002                encoder_: &mut ___E,
2003                out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2004                _: (),
2005            ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2006                ::fidl_next::munge! {
2007                    let Self::Encoded {
2008                        component_url,
2009                        context,
2010
2011                    } = out_;
2012                }
2013
2014                ::fidl_next::Encode::encode(self.component_url, encoder_, component_url, 2083)?;
2015
2016                ::fidl_next::Encode::encode(self.context, encoder_, context, ())?;
2017
2018                Ok(())
2019            }
2020        }
2021
2022        unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::Resolver
2023        where
2024            ___T: ::fidl_next::Transport,
2025        {
2026            type Client = ResolverClient<___T>;
2027            type Server = ResolverServer<___T>;
2028        }
2029
2030        /// The client for the `Resolver` protocol.
2031        #[repr(transparent)]
2032        pub struct ResolverClient<___T: ::fidl_next::Transport> {
2033            #[allow(dead_code)]
2034            client: ::fidl_next::protocol::Client<___T>,
2035        }
2036
2037        impl<___T> ResolverClient<___T>
2038        where
2039            ___T: ::fidl_next::Transport,
2040        {
2041            #[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"]
2042            pub fn resolve(
2043                &self,
2044
2045                component_url: impl ::fidl_next::Encode<
2046                    <___T as ::fidl_next::Transport>::SendBuffer,
2047                    Encoded = ::fidl_next::WireString<'static>,
2048                >,
2049            ) -> ::fidl_next::TwoWayFuture<'_, super::Resolve, ___T>
2050            where
2051                <___T as ::fidl_next::Transport>::SendBuffer:
2052                    ::fidl_next::encoder::InternalHandleEncoder,
2053                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2054            {
2055                self.resolve_with(Resolve { component_url })
2056            }
2057
2058            #[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"]
2059            pub fn resolve_with<___R>(
2060                &self,
2061                request: ___R,
2062            ) -> ::fidl_next::TwoWayFuture<'_, super::Resolve, ___T>
2063            where
2064                ___R: ::fidl_next::Encode<
2065                        <___T as ::fidl_next::Transport>::SendBuffer,
2066                        Encoded = crate::wire::ResolverResolveRequest<'static>,
2067                    >,
2068            {
2069                ::fidl_next::TwoWayFuture::from_untyped(
2070                    self.client.send_two_way(6339326548187935461, request),
2071                )
2072            }
2073
2074            #[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"]
2075            pub fn resolve_with_context(
2076                &self,
2077
2078                component_url: impl ::fidl_next::Encode<
2079                    <___T as ::fidl_next::Transport>::SendBuffer,
2080                    Encoded = ::fidl_next::WireString<'static>,
2081                >,
2082
2083                context: impl ::fidl_next::Encode<
2084                    <___T as ::fidl_next::Transport>::SendBuffer,
2085                    Encoded = crate::wire::Context<'static>,
2086                >,
2087            ) -> ::fidl_next::TwoWayFuture<'_, super::ResolveWithContext, ___T>
2088            where
2089                <___T as ::fidl_next::Transport>::SendBuffer:
2090                    ::fidl_next::encoder::InternalHandleEncoder,
2091                <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2092            {
2093                self.resolve_with_context_with(ResolveWithContext { component_url, context })
2094            }
2095
2096            #[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"]
2097            pub fn resolve_with_context_with<___R>(
2098                &self,
2099                request: ___R,
2100            ) -> ::fidl_next::TwoWayFuture<'_, super::ResolveWithContext, ___T>
2101            where
2102                ___R: ::fidl_next::Encode<
2103                        <___T as ::fidl_next::Transport>::SendBuffer,
2104                        Encoded = crate::wire::ResolverResolveWithContextRequest<'static>,
2105                    >,
2106            {
2107                ::fidl_next::TwoWayFuture::from_untyped(
2108                    self.client.send_two_way(5576776708309151933, request),
2109                )
2110            }
2111        }
2112
2113        /// The server for the `Resolver` protocol.
2114        #[repr(transparent)]
2115        pub struct ResolverServer<___T: ::fidl_next::Transport> {
2116            server: ::fidl_next::protocol::Server<___T>,
2117        }
2118
2119        impl<___T> ResolverServer<___T> where ___T: ::fidl_next::Transport {}
2120    }
2121}
2122
2123/// A client handler for the Resolver protocol.
2124///
2125/// See [`Resolver`] for more details.
2126pub trait ResolverClientHandler<
2127    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
2128    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2129>
2130{
2131    fn on_unknown_interaction(
2132        &mut self,
2133        ordinal: u64,
2134    ) -> impl ::core::future::Future<
2135        Output = ::core::result::Result<
2136            (),
2137            ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2138        >,
2139    > + ::core::marker::Send {
2140        ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
2141    }
2142}
2143
2144impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Resolver
2145where
2146    ___H: ResolverClientHandler<___T> + ::core::marker::Send,
2147    ___T: ::fidl_next::Transport,
2148    <resolver::Resolve as ::fidl_next::Method>::Response:
2149        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2150    <resolver::ResolveWithContext as ::fidl_next::Method>::Response:
2151        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2152{
2153    async fn on_event(
2154        handler: &mut ___H,
2155        ordinal: u64,
2156        buffer: ___T::RecvBuffer,
2157    ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2158        match ordinal {
2159            ordinal => handler.on_unknown_interaction(ordinal).await,
2160        }
2161    }
2162}
2163
2164/// A server handler for the Resolver protocol.
2165///
2166/// See [`Resolver`] for more details.
2167pub trait ResolverServerHandler<
2168    #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
2169    #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2170>
2171{
2172    #[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"]
2173    fn resolve(
2174        &mut self,
2175
2176        request: ::fidl_next::Request<resolver::Resolve, ___T>,
2177
2178        responder: ::fidl_next::Responder<resolver::Resolve, ___T>,
2179    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2180
2181    #[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"]
2182    fn resolve_with_context(
2183        &mut self,
2184
2185        request: ::fidl_next::Request<resolver::ResolveWithContext, ___T>,
2186
2187        responder: ::fidl_next::Responder<resolver::ResolveWithContext, ___T>,
2188    ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2189
2190    fn on_unknown_interaction(
2191        &mut self,
2192        ordinal: u64,
2193    ) -> impl ::core::future::Future<
2194        Output = ::core::result::Result<
2195            (),
2196            ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2197        >,
2198    > + ::core::marker::Send {
2199        ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
2200    }
2201}
2202
2203impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Resolver
2204where
2205    ___H: ResolverServerHandler<___T> + ::core::marker::Send,
2206    ___T: ::fidl_next::Transport,
2207    <resolver::Resolve as ::fidl_next::Method>::Request:
2208        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2209    <resolver::ResolveWithContext as ::fidl_next::Method>::Request:
2210        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2211{
2212    async fn on_one_way(
2213        handler: &mut ___H,
2214        ordinal: u64,
2215        buffer: ___T::RecvBuffer,
2216    ) -> ::core::result::Result<
2217        (),
2218        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2219    > {
2220        match ordinal {
2221            ordinal => handler.on_unknown_interaction(ordinal).await,
2222        }
2223    }
2224
2225    async fn on_two_way(
2226        handler: &mut ___H,
2227        ordinal: u64,
2228        buffer: ___T::RecvBuffer,
2229        responder: ::fidl_next::protocol::Responder<___T>,
2230    ) -> ::core::result::Result<
2231        (),
2232        ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2233    > {
2234        match ordinal {
2235            6339326548187935461 => {
2236                let responder = ::fidl_next::Responder::from_untyped(responder);
2237
2238                match ::fidl_next::DecoderExt::decode(buffer) {
2239                    Ok(decoded) => {
2240                        handler.resolve(decoded, responder).await;
2241                        Ok(())
2242                    }
2243                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2244                        ordinal: 6339326548187935461,
2245                        error,
2246                    }),
2247                }
2248            }
2249
2250            5576776708309151933 => {
2251                let responder = ::fidl_next::Responder::from_untyped(responder);
2252
2253                match ::fidl_next::DecoderExt::decode(buffer) {
2254                    Ok(decoded) => {
2255                        handler.resolve_with_context(decoded, responder).await;
2256                        Ok(())
2257                    }
2258                    Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2259                        ordinal: 5576776708309151933,
2260                        error,
2261                    }),
2262                }
2263            }
2264
2265            ordinal => handler.on_unknown_interaction(ordinal).await,
2266        }
2267    }
2268}
2269
2270/// Compatibility shims which mimic some API surfaces of the current Rust bindings.
2271pub mod compat {
2272
2273    impl ::fidl_next::CompatFrom<crate::Context> for ::fidl_fuchsia_component_resolution::Context {
2274        #[inline]
2275        fn compat_from(value: crate::Context) -> Self {
2276            Self { bytes: ::fidl_next::CompatFrom::compat_from(value.bytes) }
2277        }
2278    }
2279
2280    impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::Context> for crate::Context {
2281        #[inline]
2282        fn compat_from(value: ::fidl_fuchsia_component_resolution::Context) -> Self {
2283            Self { bytes: ::fidl_next::CompatFrom::compat_from(value.bytes) }
2284        }
2285    }
2286
2287    impl ::fidl_next::CompatFrom<crate::Package> for ::fidl_fuchsia_component_resolution::Package {
2288        fn compat_from(value: crate::Package) -> Self {
2289            Self {
2290                url: ::fidl_next::CompatFrom::compat_from(value.url),
2291
2292                directory: ::fidl_next::CompatFrom::compat_from(value.directory),
2293
2294                __source_breaking: ::fidl::marker::SourceBreaking,
2295            }
2296        }
2297    }
2298
2299    impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::Package> for crate::Package {
2300        fn compat_from(value: ::fidl_fuchsia_component_resolution::Package) -> Self {
2301            Self {
2302                url: ::fidl_next::CompatFrom::compat_from(value.url),
2303
2304                directory: ::fidl_next::CompatFrom::compat_from(value.directory),
2305            }
2306        }
2307    }
2308
2309    impl ::fidl_next::CompatFrom<crate::Component> for ::fidl_fuchsia_component_resolution::Component {
2310        fn compat_from(value: crate::Component) -> Self {
2311            Self {
2312                url: ::fidl_next::CompatFrom::compat_from(value.url),
2313
2314                decl: ::fidl_next::CompatFrom::compat_from(value.decl),
2315
2316                package: ::fidl_next::CompatFrom::compat_from(value.package),
2317
2318                config_values: ::fidl_next::CompatFrom::compat_from(value.config_values),
2319
2320                resolution_context: ::fidl_next::CompatFrom::compat_from(value.resolution_context),
2321
2322                abi_revision: ::fidl_next::CompatFrom::compat_from(value.abi_revision),
2323
2324                __source_breaking: ::fidl::marker::SourceBreaking,
2325            }
2326        }
2327    }
2328
2329    impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::Component> for crate::Component {
2330        fn compat_from(value: ::fidl_fuchsia_component_resolution::Component) -> Self {
2331            Self {
2332                url: ::fidl_next::CompatFrom::compat_from(value.url),
2333
2334                decl: ::fidl_next::CompatFrom::compat_from(value.decl),
2335
2336                package: ::fidl_next::CompatFrom::compat_from(value.package),
2337
2338                config_values: ::fidl_next::CompatFrom::compat_from(value.config_values),
2339
2340                resolution_context: ::fidl_next::CompatFrom::compat_from(value.resolution_context),
2341
2342                abi_revision: ::fidl_next::CompatFrom::compat_from(value.abi_revision),
2343            }
2344        }
2345    }
2346
2347    impl ::fidl_next::CompatFrom<crate::ResolverResolveRequest>
2348        for ::fidl_fuchsia_component_resolution::ResolverResolveRequest
2349    {
2350        #[inline]
2351        fn compat_from(value: crate::ResolverResolveRequest) -> Self {
2352            Self { component_url: ::fidl_next::CompatFrom::compat_from(value.component_url) }
2353        }
2354    }
2355
2356    impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::ResolverResolveRequest>
2357        for crate::ResolverResolveRequest
2358    {
2359        #[inline]
2360        fn compat_from(value: ::fidl_fuchsia_component_resolution::ResolverResolveRequest) -> Self {
2361            Self { component_url: ::fidl_next::CompatFrom::compat_from(value.component_url) }
2362        }
2363    }
2364
2365    impl ::fidl_next::CompatFrom<crate::ResolverResolveWithContextRequest>
2366        for ::fidl_fuchsia_component_resolution::ResolverResolveWithContextRequest
2367    {
2368        #[inline]
2369        fn compat_from(value: crate::ResolverResolveWithContextRequest) -> Self {
2370            Self {
2371                component_url: ::fidl_next::CompatFrom::compat_from(value.component_url),
2372
2373                context: ::fidl_next::CompatFrom::compat_from(value.context),
2374            }
2375        }
2376    }
2377
2378    impl
2379        ::fidl_next::CompatFrom<
2380            ::fidl_fuchsia_component_resolution::ResolverResolveWithContextRequest,
2381        > for crate::ResolverResolveWithContextRequest
2382    {
2383        #[inline]
2384        fn compat_from(
2385            value: ::fidl_fuchsia_component_resolution::ResolverResolveWithContextRequest,
2386        ) -> Self {
2387            Self {
2388                component_url: ::fidl_next::CompatFrom::compat_from(value.component_url),
2389
2390                context: ::fidl_next::CompatFrom::compat_from(value.context),
2391            }
2392        }
2393    }
2394
2395    impl ::fidl_next::CompatFrom<crate::ResolverError>
2396        for ::fidl_fuchsia_component_resolution::ResolverError
2397    {
2398        fn compat_from(value: crate::ResolverError) -> Self {
2399            match value {
2400                crate::ResolverError::Internal => Self::Internal,
2401
2402                crate::ResolverError::Io => Self::Io,
2403
2404                crate::ResolverError::InvalidArgs => Self::InvalidArgs,
2405
2406                crate::ResolverError::NotSupported => Self::NotSupported,
2407
2408                crate::ResolverError::ManifestNotFound => Self::ManifestNotFound,
2409
2410                crate::ResolverError::PackageNotFound => Self::PackageNotFound,
2411
2412                crate::ResolverError::NoSpace => Self::NoSpace,
2413
2414                crate::ResolverError::ResourceUnavailable => Self::ResourceUnavailable,
2415
2416                crate::ResolverError::InvalidManifest => Self::InvalidManifest,
2417
2418                crate::ResolverError::ConfigValuesNotFound => Self::ConfigValuesNotFound,
2419
2420                crate::ResolverError::AbiRevisionNotFound => Self::AbiRevisionNotFound,
2421
2422                crate::ResolverError::InvalidAbiRevision => Self::InvalidAbiRevision,
2423            }
2424        }
2425    }
2426
2427    impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::ResolverError>
2428        for crate::ResolverError
2429    {
2430        fn compat_from(value: ::fidl_fuchsia_component_resolution::ResolverError) -> Self {
2431            match value {
2432                ::fidl_fuchsia_component_resolution::ResolverError::Internal => Self::Internal,
2433
2434                ::fidl_fuchsia_component_resolution::ResolverError::Io => Self::Io,
2435
2436                ::fidl_fuchsia_component_resolution::ResolverError::InvalidArgs => {
2437                    Self::InvalidArgs
2438                }
2439
2440                ::fidl_fuchsia_component_resolution::ResolverError::NotSupported => {
2441                    Self::NotSupported
2442                }
2443
2444                ::fidl_fuchsia_component_resolution::ResolverError::ManifestNotFound => {
2445                    Self::ManifestNotFound
2446                }
2447
2448                ::fidl_fuchsia_component_resolution::ResolverError::PackageNotFound => {
2449                    Self::PackageNotFound
2450                }
2451
2452                ::fidl_fuchsia_component_resolution::ResolverError::NoSpace => Self::NoSpace,
2453
2454                ::fidl_fuchsia_component_resolution::ResolverError::ResourceUnavailable => {
2455                    Self::ResourceUnavailable
2456                }
2457
2458                ::fidl_fuchsia_component_resolution::ResolverError::InvalidManifest => {
2459                    Self::InvalidManifest
2460                }
2461
2462                ::fidl_fuchsia_component_resolution::ResolverError::ConfigValuesNotFound => {
2463                    Self::ConfigValuesNotFound
2464                }
2465
2466                ::fidl_fuchsia_component_resolution::ResolverError::AbiRevisionNotFound => {
2467                    Self::AbiRevisionNotFound
2468                }
2469
2470                ::fidl_fuchsia_component_resolution::ResolverError::InvalidAbiRevision => {
2471                    Self::InvalidAbiRevision
2472                }
2473            }
2474        }
2475    }
2476
2477    impl ::fidl_next::CompatFrom<crate::ResolverResolveResponse>
2478        for ::fidl_fuchsia_component_resolution::ResolverResolveResponse
2479    {
2480        #[inline]
2481        fn compat_from(value: crate::ResolverResolveResponse) -> Self {
2482            Self { component: ::fidl_next::CompatFrom::compat_from(value.component) }
2483        }
2484    }
2485
2486    impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::ResolverResolveResponse>
2487        for crate::ResolverResolveResponse
2488    {
2489        #[inline]
2490        fn compat_from(
2491            value: ::fidl_fuchsia_component_resolution::ResolverResolveResponse,
2492        ) -> Self {
2493            Self { component: ::fidl_next::CompatFrom::compat_from(value.component) }
2494        }
2495    }
2496
2497    impl ::fidl_next::CompatFrom<crate::ResolverResolveWithContextResponse>
2498        for ::fidl_fuchsia_component_resolution::ResolverResolveWithContextResponse
2499    {
2500        #[inline]
2501        fn compat_from(value: crate::ResolverResolveWithContextResponse) -> Self {
2502            Self { component: ::fidl_next::CompatFrom::compat_from(value.component) }
2503        }
2504    }
2505
2506    impl
2507        ::fidl_next::CompatFrom<
2508            ::fidl_fuchsia_component_resolution::ResolverResolveWithContextResponse,
2509        > for crate::ResolverResolveWithContextResponse
2510    {
2511        #[inline]
2512        fn compat_from(
2513            value: ::fidl_fuchsia_component_resolution::ResolverResolveWithContextResponse,
2514        ) -> Self {
2515            Self { component: ::fidl_next::CompatFrom::compat_from(value.component) }
2516        }
2517    }
2518
2519    #[cfg(target_os = "fuchsia")]
2520    /// An alias for a client over `zx::Channel` for the `Resolver`
2521    /// protocol.
2522    pub type ResolverProxy = ::fidl_next::Client<crate::Resolver>;
2523
2524    impl ::fidl_next::CompatFrom<crate::Resolver>
2525        for ::fidl_fuchsia_component_resolution::ResolverMarker
2526    {
2527        fn compat_from(_: crate::Resolver) -> Self {
2528            Self
2529        }
2530    }
2531
2532    impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::ResolverMarker>
2533        for crate::Resolver
2534    {
2535        fn compat_from(_: ::fidl_fuchsia_component_resolution::ResolverMarker) -> Self {
2536            Self
2537        }
2538    }
2539
2540    #[cfg(target_os = "fuchsia")]
2541
2542    impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_component_resolution::ResolverProxy>
2543        for crate::Resolver
2544    {
2545        fn client_compat_from(
2546            proxy: ::fidl_fuchsia_component_resolution::ResolverProxy,
2547        ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
2548            let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
2549            let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
2550            ::fidl_next::ClientDispatcher::new(client_end)
2551        }
2552    }
2553}