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