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