1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 pub use fidl_next_common_fuchsia_component_resolution::natural::*;
8
9 #[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"]
10 #[derive(Debug, Default, PartialEq)]
11 pub struct Package {
12 pub url: ::core::option::Option<::std::string::String>,
13
14 pub directory: ::core::option::Option<
15 ::fidl_next::ClientEnd<
16 ::fidl_next_fuchsia_io::Directory,
17 ::fidl_next::fuchsia::zx::Channel,
18 >,
19 >,
20 }
21
22 impl Package {
23 fn __max_ordinal(&self) -> usize {
24 if self.directory.is_some() {
25 return 2;
26 }
27
28 if self.url.is_some() {
29 return 1;
30 }
31
32 0
33 }
34 }
35
36 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Package<'static>, ___E> for Package
37 where
38 ___E: ::fidl_next::Encoder + ?Sized,
39 ___E: ::fidl_next::fuchsia::HandleEncoder,
40 {
41 #[inline]
42 fn encode(
43 mut self,
44 encoder: &mut ___E,
45 out: &mut ::core::mem::MaybeUninit<crate::wire::Package<'static>>,
46 _: (),
47 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
48 ::fidl_next::munge!(let crate::wire::Package { table } = out);
49
50 let max_ord = self.__max_ordinal();
51
52 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
53 ::fidl_next::Wire::zero_padding(&mut out);
54
55 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
56 ::fidl_next::wire::Envelope,
57 >(encoder, max_ord);
58
59 for i in 1..=max_ord {
60 match i {
61 2 => {
62 if let Some(value) = self.directory.take() {
63 ::fidl_next::wire::Envelope::encode_value::<
64 ::fidl_next::ClientEnd<
65 ::fidl_next_fuchsia_io::Directory,
66 ::fidl_next::wire::fuchsia::Channel,
67 >,
68 ___E,
69 >(
70 value, preallocated.encoder, &mut out, ()
71 )?;
72 } else {
73 ::fidl_next::wire::Envelope::encode_zero(&mut out)
74 }
75 }
76
77 1 => {
78 if let Some(value) = self.url.take() {
79 ::fidl_next::wire::Envelope::encode_value::<
80 ::fidl_next::wire::String<'static>,
81 ___E,
82 >(
83 value, preallocated.encoder, &mut out, 2083
84 )?;
85 } else {
86 ::fidl_next::wire::Envelope::encode_zero(&mut out)
87 }
88 }
89
90 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
91 }
92 unsafe {
93 preallocated.write_next(out.assume_init_ref());
94 }
95 }
96
97 ::fidl_next::wire::Table::encode_len(table, max_ord);
98
99 Ok(())
100 }
101 }
102
103 impl<'de> ::fidl_next::FromWire<crate::wire::Package<'de>> for Package {
104 #[inline]
105 fn from_wire(wire_: crate::wire::Package<'de>) -> Self {
106 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
107
108 let url = wire_.table.get(1);
109
110 let directory = wire_.table.get(2);
111
112 Self {
113 url: url.map(|envelope| {
114 ::fidl_next::FromWire::from_wire(unsafe {
115 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
116 })
117 }),
118
119 directory: directory.map(|envelope| {
120 ::fidl_next::FromWire::from_wire(unsafe {
121 envelope.read_unchecked::<::fidl_next::ClientEnd<
122 ::fidl_next_fuchsia_io::Directory,
123 ::fidl_next::wire::fuchsia::Channel,
124 >>()
125 })
126 }),
127 }
128 }
129 }
130
131 #[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"]
132 #[derive(Debug, Default, PartialEq)]
133 pub struct Component {
134 pub url: ::core::option::Option<::std::string::String>,
135
136 pub decl: ::core::option::Option<::fidl_next_fuchsia_mem::natural::Data>,
137
138 pub package: ::core::option::Option<crate::natural::Package>,
139
140 pub config_values: ::core::option::Option<::fidl_next_fuchsia_mem::natural::Data>,
141
142 pub resolution_context: ::core::option::Option<crate::natural::Context>,
143
144 pub abi_revision: ::core::option::Option<u64>,
145 }
146
147 impl Component {
148 fn __max_ordinal(&self) -> usize {
149 if self.abi_revision.is_some() {
150 return 6;
151 }
152
153 if self.resolution_context.is_some() {
154 return 5;
155 }
156
157 if self.config_values.is_some() {
158 return 4;
159 }
160
161 if self.package.is_some() {
162 return 3;
163 }
164
165 if self.decl.is_some() {
166 return 2;
167 }
168
169 if self.url.is_some() {
170 return 1;
171 }
172
173 0
174 }
175 }
176
177 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Component<'static>, ___E> for Component
178 where
179 ___E: ::fidl_next::Encoder + ?Sized,
180 ___E: ::fidl_next::fuchsia::HandleEncoder,
181 {
182 #[inline]
183 fn encode(
184 mut self,
185 encoder: &mut ___E,
186 out: &mut ::core::mem::MaybeUninit<crate::wire::Component<'static>>,
187 _: (),
188 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
189 ::fidl_next::munge!(let crate::wire::Component { table } = out);
190
191 let max_ord = self.__max_ordinal();
192
193 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
194 ::fidl_next::Wire::zero_padding(&mut out);
195
196 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
197 ::fidl_next::wire::Envelope,
198 >(encoder, max_ord);
199
200 for i in 1..=max_ord {
201 match i {
202 6 => {
203 if let Some(value) = self.abi_revision.take() {
204 ::fidl_next::wire::Envelope::encode_value::<
205 ::fidl_next::wire::Uint64,
206 ___E,
207 >(
208 value, preallocated.encoder, &mut out, ()
209 )?;
210 } else {
211 ::fidl_next::wire::Envelope::encode_zero(&mut out)
212 }
213 }
214
215 5 => {
216 if let Some(value) = self.resolution_context.take() {
217 ::fidl_next::wire::Envelope::encode_value::<
218 crate::wire::Context<'static>,
219 ___E,
220 >(
221 value, preallocated.encoder, &mut out, ()
222 )?;
223 } else {
224 ::fidl_next::wire::Envelope::encode_zero(&mut out)
225 }
226 }
227
228 4 => {
229 if let Some(value) = self.config_values.take() {
230 ::fidl_next::wire::Envelope::encode_value::<
231 ::fidl_next_fuchsia_mem::wire::Data<'static>,
232 ___E,
233 >(
234 value, preallocated.encoder, &mut out, ()
235 )?;
236 } else {
237 ::fidl_next::wire::Envelope::encode_zero(&mut out)
238 }
239 }
240
241 3 => {
242 if let Some(value) = self.package.take() {
243 ::fidl_next::wire::Envelope::encode_value::<
244 crate::wire::Package<'static>,
245 ___E,
246 >(
247 value, preallocated.encoder, &mut out, ()
248 )?;
249 } else {
250 ::fidl_next::wire::Envelope::encode_zero(&mut out)
251 }
252 }
253
254 2 => {
255 if let Some(value) = self.decl.take() {
256 ::fidl_next::wire::Envelope::encode_value::<
257 ::fidl_next_fuchsia_mem::wire::Data<'static>,
258 ___E,
259 >(
260 value, preallocated.encoder, &mut out, ()
261 )?;
262 } else {
263 ::fidl_next::wire::Envelope::encode_zero(&mut out)
264 }
265 }
266
267 1 => {
268 if let Some(value) = self.url.take() {
269 ::fidl_next::wire::Envelope::encode_value::<
270 ::fidl_next::wire::String<'static>,
271 ___E,
272 >(
273 value, preallocated.encoder, &mut out, 2083
274 )?;
275 } else {
276 ::fidl_next::wire::Envelope::encode_zero(&mut out)
277 }
278 }
279
280 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
281 }
282 unsafe {
283 preallocated.write_next(out.assume_init_ref());
284 }
285 }
286
287 ::fidl_next::wire::Table::encode_len(table, max_ord);
288
289 Ok(())
290 }
291 }
292
293 impl<'de> ::fidl_next::FromWire<crate::wire::Component<'de>> for Component {
294 #[inline]
295 fn from_wire(wire_: crate::wire::Component<'de>) -> Self {
296 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
297
298 let url = wire_.table.get(1);
299
300 let decl = wire_.table.get(2);
301
302 let package = wire_.table.get(3);
303
304 let config_values = wire_.table.get(4);
305
306 let resolution_context = wire_.table.get(5);
307
308 let abi_revision = wire_.table.get(6);
309
310 Self {
311 url: url.map(|envelope| {
312 ::fidl_next::FromWire::from_wire(unsafe {
313 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
314 })
315 }),
316
317 decl: decl.map(|envelope| {
318 ::fidl_next::FromWire::from_wire(unsafe {
319 envelope.read_unchecked::<::fidl_next_fuchsia_mem::wire::Data<'de>>()
320 })
321 }),
322
323 package: package.map(|envelope| {
324 ::fidl_next::FromWire::from_wire(unsafe {
325 envelope.read_unchecked::<crate::wire::Package<'de>>()
326 })
327 }),
328
329 config_values: config_values.map(|envelope| {
330 ::fidl_next::FromWire::from_wire(unsafe {
331 envelope.read_unchecked::<::fidl_next_fuchsia_mem::wire::Data<'de>>()
332 })
333 }),
334
335 resolution_context: resolution_context.map(|envelope| {
336 ::fidl_next::FromWire::from_wire(unsafe {
337 envelope.read_unchecked::<crate::wire::Context<'de>>()
338 })
339 }),
340
341 abi_revision: abi_revision.map(|envelope| {
342 ::fidl_next::FromWire::from_wire(unsafe {
343 envelope.read_unchecked::<::fidl_next::wire::Uint64>()
344 })
345 }),
346 }
347 }
348 }
349
350 #[derive(Debug, PartialEq)]
351 pub struct ResolverResolveResponse {
352 pub component: crate::natural::Component,
353 }
354
355 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ResolverResolveResponse<'static>, ___E>
356 for ResolverResolveResponse
357 where
358 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
359 ___E: ::fidl_next::Encoder,
360 ___E: ::fidl_next::fuchsia::HandleEncoder,
361 {
362 #[inline]
363 fn encode(
364 self,
365 encoder_: &mut ___E,
366 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolverResolveResponse<'static>>,
367 _: (),
368 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
369 ::fidl_next::munge! {
370 let crate::wire::ResolverResolveResponse {
371 component,
372
373 } = out_;
374 }
375
376 ::fidl_next::Encode::encode(self.component, encoder_, component, ())?;
377
378 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(component.as_mut_ptr()) };
379
380 Ok(())
381 }
382 }
383
384 unsafe impl<___E>
385 ::fidl_next::EncodeOption<
386 ::fidl_next::wire::Box<'static, crate::wire::ResolverResolveResponse<'static>>,
387 ___E,
388 > for ResolverResolveResponse
389 where
390 ___E: ::fidl_next::Encoder + ?Sized,
391 ResolverResolveResponse:
392 ::fidl_next::Encode<crate::wire::ResolverResolveResponse<'static>, ___E>,
393 {
394 #[inline]
395 fn encode_option(
396 this: ::core::option::Option<Self>,
397 encoder: &mut ___E,
398 out: &mut ::core::mem::MaybeUninit<
399 ::fidl_next::wire::Box<'static, crate::wire::ResolverResolveResponse<'static>>,
400 >,
401 _: (),
402 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
403 if let Some(inner) = this {
404 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
405 ::fidl_next::wire::Box::encode_present(out);
406 } else {
407 ::fidl_next::wire::Box::encode_absent(out);
408 }
409
410 Ok(())
411 }
412 }
413
414 impl<'de> ::fidl_next::FromWire<crate::wire::ResolverResolveResponse<'de>>
415 for ResolverResolveResponse
416 {
417 #[inline]
418 fn from_wire(wire: crate::wire::ResolverResolveResponse<'de>) -> Self {
419 Self { component: ::fidl_next::FromWire::from_wire(wire.component) }
420 }
421 }
422
423 #[derive(Debug, PartialEq)]
424 pub struct ResolverResolveWithContextResponse {
425 pub component: crate::natural::Component,
426 }
427
428 unsafe impl<___E>
429 ::fidl_next::Encode<crate::wire::ResolverResolveWithContextResponse<'static>, ___E>
430 for ResolverResolveWithContextResponse
431 where
432 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
433 ___E: ::fidl_next::Encoder,
434 ___E: ::fidl_next::fuchsia::HandleEncoder,
435 {
436 #[inline]
437 fn encode(
438 self,
439 encoder_: &mut ___E,
440 out_: &mut ::core::mem::MaybeUninit<
441 crate::wire::ResolverResolveWithContextResponse<'static>,
442 >,
443 _: (),
444 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
445 ::fidl_next::munge! {
446 let crate::wire::ResolverResolveWithContextResponse {
447 component,
448
449 } = out_;
450 }
451
452 ::fidl_next::Encode::encode(self.component, encoder_, component, ())?;
453
454 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(component.as_mut_ptr()) };
455
456 Ok(())
457 }
458 }
459
460 unsafe impl<___E>
461 ::fidl_next::EncodeOption<
462 ::fidl_next::wire::Box<
463 'static,
464 crate::wire::ResolverResolveWithContextResponse<'static>,
465 >,
466 ___E,
467 > for ResolverResolveWithContextResponse
468 where
469 ___E: ::fidl_next::Encoder + ?Sized,
470 ResolverResolveWithContextResponse:
471 ::fidl_next::Encode<crate::wire::ResolverResolveWithContextResponse<'static>, ___E>,
472 {
473 #[inline]
474 fn encode_option(
475 this: ::core::option::Option<Self>,
476 encoder: &mut ___E,
477 out: &mut ::core::mem::MaybeUninit<
478 ::fidl_next::wire::Box<
479 'static,
480 crate::wire::ResolverResolveWithContextResponse<'static>,
481 >,
482 >,
483 _: (),
484 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
485 if let Some(inner) = this {
486 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
487 ::fidl_next::wire::Box::encode_present(out);
488 } else {
489 ::fidl_next::wire::Box::encode_absent(out);
490 }
491
492 Ok(())
493 }
494 }
495
496 impl<'de> ::fidl_next::FromWire<crate::wire::ResolverResolveWithContextResponse<'de>>
497 for ResolverResolveWithContextResponse
498 {
499 #[inline]
500 fn from_wire(wire: crate::wire::ResolverResolveWithContextResponse<'de>) -> Self {
501 Self { component: ::fidl_next::FromWire::from_wire(wire.component) }
502 }
503 }
504}
505
506pub mod wire {
507
508 pub use fidl_next_common_fuchsia_component_resolution::wire::*;
509
510 #[repr(C)]
512 pub struct Package<'de> {
513 pub(crate) table: ::fidl_next::wire::Table<'de>,
514 }
515
516 impl<'de> Drop for Package<'de> {
517 fn drop(&mut self) {
518 let _ = self.table.get(1).map(|envelope| unsafe {
519 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
520 });
521
522 let _ = self.table.get(2).map(|envelope| unsafe {
523 envelope.read_unchecked::<::fidl_next::ClientEnd<
524 ::fidl_next_fuchsia_io::Directory,
525 ::fidl_next::wire::fuchsia::Channel,
526 >>()
527 });
528 }
529 }
530
531 impl ::fidl_next::Constrained for Package<'_> {
532 type Constraint = ();
533
534 fn validate(
535 _: ::fidl_next::Slot<'_, Self>,
536 _: Self::Constraint,
537 ) -> Result<(), ::fidl_next::ValidationError> {
538 Ok(())
539 }
540 }
541
542 unsafe impl ::fidl_next::Wire for Package<'static> {
543 type Narrowed<'de> = Package<'de>;
544
545 #[inline]
546 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
547 ::fidl_next::munge!(let Self { table } = out);
548 ::fidl_next::wire::Table::zero_padding(table);
549 }
550 }
551
552 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Package<'de>
553 where
554 ___D: ::fidl_next::Decoder<'de> + ?Sized,
555 ___D: ::fidl_next::fuchsia::HandleDecoder,
556 {
557 fn decode(
558 slot: ::fidl_next::Slot<'_, Self>,
559 decoder: &mut ___D,
560 _: (),
561 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
562 ::fidl_next::munge!(let Self { table } = slot);
563
564 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
565 match ordinal {
566 0 => unsafe { ::core::hint::unreachable_unchecked() },
567
568 1 => {
569 ::fidl_next::wire::Envelope::decode_as::<
570 ___D,
571 ::fidl_next::wire::String<'de>,
572 >(slot.as_mut(), decoder, 2083)?;
573
574 let value = unsafe {
575 slot.deref_unchecked()
576 .deref_unchecked::<::fidl_next::wire::String<'_>>()
577 };
578
579 if value.len() > 2083 {
580 return Err(::fidl_next::DecodeError::VectorTooLong {
581 size: value.len() as u64,
582 limit: 2083,
583 });
584 }
585
586 Ok(())
587 }
588
589 2 => {
590 ::fidl_next::wire::Envelope::decode_as::<
591 ___D,
592 ::fidl_next::ClientEnd<
593 ::fidl_next_fuchsia_io::Directory,
594 ::fidl_next::wire::fuchsia::Channel,
595 >,
596 >(slot.as_mut(), decoder, ())?;
597
598 Ok(())
599 }
600
601 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
602 }
603 })
604 }
605 }
606
607 impl<'de> Package<'de> {
608 pub fn url(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
609 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
610 }
611
612 pub fn directory(
613 &self,
614 ) -> ::core::option::Option<
615 &::fidl_next::ClientEnd<
616 ::fidl_next_fuchsia_io::Directory,
617 ::fidl_next::wire::fuchsia::Channel,
618 >,
619 > {
620 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
621 }
622 }
623
624 impl<'de> ::core::fmt::Debug for Package<'de> {
625 fn fmt(
626 &self,
627 f: &mut ::core::fmt::Formatter<'_>,
628 ) -> ::core::result::Result<(), ::core::fmt::Error> {
629 f.debug_struct("Package")
630 .field("url", &self.url())
631 .field("directory", &self.directory())
632 .finish()
633 }
634 }
635
636 impl<'de> ::fidl_next::IntoNatural for Package<'de> {
637 type Natural = crate::natural::Package;
638 }
639
640 #[repr(C)]
642 pub struct Component<'de> {
643 pub(crate) table: ::fidl_next::wire::Table<'de>,
644 }
645
646 impl<'de> Drop for Component<'de> {
647 fn drop(&mut self) {
648 let _ = self.table.get(1).map(|envelope| unsafe {
649 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
650 });
651
652 let _ = self.table.get(2).map(|envelope| unsafe {
653 envelope.read_unchecked::<::fidl_next_fuchsia_mem::wire::Data<'de>>()
654 });
655
656 let _ = self
657 .table
658 .get(3)
659 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Package<'de>>() });
660
661 let _ = self.table.get(4).map(|envelope| unsafe {
662 envelope.read_unchecked::<::fidl_next_fuchsia_mem::wire::Data<'de>>()
663 });
664
665 let _ = self
666 .table
667 .get(5)
668 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Context<'de>>() });
669
670 let _ = self
671 .table
672 .get(6)
673 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
674 }
675 }
676
677 impl ::fidl_next::Constrained for Component<'_> {
678 type Constraint = ();
679
680 fn validate(
681 _: ::fidl_next::Slot<'_, Self>,
682 _: Self::Constraint,
683 ) -> Result<(), ::fidl_next::ValidationError> {
684 Ok(())
685 }
686 }
687
688 unsafe impl ::fidl_next::Wire for Component<'static> {
689 type Narrowed<'de> = Component<'de>;
690
691 #[inline]
692 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
693 ::fidl_next::munge!(let Self { table } = out);
694 ::fidl_next::wire::Table::zero_padding(table);
695 }
696 }
697
698 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Component<'de>
699 where
700 ___D: ::fidl_next::Decoder<'de> + ?Sized,
701 ___D: ::fidl_next::fuchsia::HandleDecoder,
702 {
703 fn decode(
704 slot: ::fidl_next::Slot<'_, Self>,
705 decoder: &mut ___D,
706 _: (),
707 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
708 ::fidl_next::munge!(let Self { table } = slot);
709
710 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
711 match ordinal {
712 0 => unsafe { ::core::hint::unreachable_unchecked() },
713
714 1 => {
715 ::fidl_next::wire::Envelope::decode_as::<
716 ___D,
717 ::fidl_next::wire::String<'de>,
718 >(slot.as_mut(), decoder, 2083)?;
719
720 let value = unsafe {
721 slot.deref_unchecked()
722 .deref_unchecked::<::fidl_next::wire::String<'_>>()
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::wire::Envelope::decode_as::<
737 ___D,
738 ::fidl_next_fuchsia_mem::wire::Data<'de>,
739 >(slot.as_mut(), decoder, ())?;
740
741 Ok(())
742 }
743
744 3 => {
745 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Package<'de>>(
746 slot.as_mut(),
747 decoder,
748 (),
749 )?;
750
751 Ok(())
752 }
753
754 4 => {
755 ::fidl_next::wire::Envelope::decode_as::<
756 ___D,
757 ::fidl_next_fuchsia_mem::wire::Data<'de>,
758 >(slot.as_mut(), decoder, ())?;
759
760 Ok(())
761 }
762
763 5 => {
764 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Context<'de>>(
765 slot.as_mut(),
766 decoder,
767 (),
768 )?;
769
770 Ok(())
771 }
772
773 6 => {
774 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
775 slot.as_mut(),
776 decoder,
777 (),
778 )?;
779
780 Ok(())
781 }
782
783 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
784 }
785 })
786 }
787 }
788
789 impl<'de> Component<'de> {
790 pub fn url(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
791 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
792 }
793
794 pub fn decl(&self) -> ::core::option::Option<&::fidl_next_fuchsia_mem::wire::Data<'de>> {
795 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
796 }
797
798 pub fn package(&self) -> ::core::option::Option<&crate::wire::Package<'de>> {
799 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
800 }
801
802 pub fn config_values(
803 &self,
804 ) -> ::core::option::Option<&::fidl_next_fuchsia_mem::wire::Data<'de>> {
805 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
806 }
807
808 pub fn resolution_context(&self) -> ::core::option::Option<&crate::wire::Context<'de>> {
809 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
810 }
811
812 pub fn abi_revision(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
813 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
814 }
815 }
816
817 impl<'de> ::core::fmt::Debug for Component<'de> {
818 fn fmt(
819 &self,
820 f: &mut ::core::fmt::Formatter<'_>,
821 ) -> ::core::result::Result<(), ::core::fmt::Error> {
822 f.debug_struct("Component")
823 .field("url", &self.url())
824 .field("decl", &self.decl())
825 .field("package", &self.package())
826 .field("config_values", &self.config_values())
827 .field("resolution_context", &self.resolution_context())
828 .field("abi_revision", &self.abi_revision())
829 .finish()
830 }
831 }
832
833 impl<'de> ::fidl_next::IntoNatural for Component<'de> {
834 type Natural = crate::natural::Component;
835 }
836
837 #[derive(Debug)]
839 #[repr(C)]
840 pub struct ResolverResolveResponse<'de> {
841 pub component: crate::wire::Component<'de>,
842 }
843
844 static_assertions::const_assert_eq!(std::mem::size_of::<ResolverResolveResponse<'_>>(), 16);
845 static_assertions::const_assert_eq!(std::mem::align_of::<ResolverResolveResponse<'_>>(), 8);
846
847 static_assertions::const_assert_eq!(
848 std::mem::offset_of!(ResolverResolveResponse<'_>, component),
849 0
850 );
851
852 impl ::fidl_next::Constrained for ResolverResolveResponse<'_> {
853 type Constraint = ();
854
855 fn validate(
856 _: ::fidl_next::Slot<'_, Self>,
857 _: Self::Constraint,
858 ) -> Result<(), ::fidl_next::ValidationError> {
859 Ok(())
860 }
861 }
862
863 unsafe impl ::fidl_next::Wire for ResolverResolveResponse<'static> {
864 type Narrowed<'de> = ResolverResolveResponse<'de>;
865
866 #[inline]
867 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
868 ::fidl_next::munge! {
869 let Self {
870
871 component,
872
873 } = &mut *out_;
874 }
875
876 ::fidl_next::Wire::zero_padding(component);
877 }
878 }
879
880 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ResolverResolveResponse<'de>
881 where
882 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
883 ___D: ::fidl_next::Decoder<'de>,
884 ___D: ::fidl_next::fuchsia::HandleDecoder,
885 {
886 fn decode(
887 slot_: ::fidl_next::Slot<'_, Self>,
888 decoder_: &mut ___D,
889 _: (),
890 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
891 ::fidl_next::munge! {
892 let Self {
893
894 mut component,
895
896 } = slot_;
897 }
898
899 let _field = component.as_mut();
900
901 ::fidl_next::Decode::decode(component.as_mut(), decoder_, ())?;
902
903 Ok(())
904 }
905 }
906
907 impl<'de> ::fidl_next::IntoNatural for ResolverResolveResponse<'de> {
908 type Natural = crate::natural::ResolverResolveResponse;
909 }
910
911 #[derive(Debug)]
913 #[repr(C)]
914 pub struct ResolverResolveWithContextResponse<'de> {
915 pub component: crate::wire::Component<'de>,
916 }
917
918 static_assertions::const_assert_eq!(
919 std::mem::size_of::<ResolverResolveWithContextResponse<'_>>(),
920 16
921 );
922 static_assertions::const_assert_eq!(
923 std::mem::align_of::<ResolverResolveWithContextResponse<'_>>(),
924 8
925 );
926
927 static_assertions::const_assert_eq!(
928 std::mem::offset_of!(ResolverResolveWithContextResponse<'_>, component),
929 0
930 );
931
932 impl ::fidl_next::Constrained for ResolverResolveWithContextResponse<'_> {
933 type Constraint = ();
934
935 fn validate(
936 _: ::fidl_next::Slot<'_, Self>,
937 _: Self::Constraint,
938 ) -> Result<(), ::fidl_next::ValidationError> {
939 Ok(())
940 }
941 }
942
943 unsafe impl ::fidl_next::Wire for ResolverResolveWithContextResponse<'static> {
944 type Narrowed<'de> = ResolverResolveWithContextResponse<'de>;
945
946 #[inline]
947 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
948 ::fidl_next::munge! {
949 let Self {
950
951 component,
952
953 } = &mut *out_;
954 }
955
956 ::fidl_next::Wire::zero_padding(component);
957 }
958 }
959
960 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ResolverResolveWithContextResponse<'de>
961 where
962 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
963 ___D: ::fidl_next::Decoder<'de>,
964 ___D: ::fidl_next::fuchsia::HandleDecoder,
965 {
966 fn decode(
967 slot_: ::fidl_next::Slot<'_, Self>,
968 decoder_: &mut ___D,
969 _: (),
970 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
971 ::fidl_next::munge! {
972 let Self {
973
974 mut component,
975
976 } = slot_;
977 }
978
979 let _field = component.as_mut();
980
981 ::fidl_next::Decode::decode(component.as_mut(), decoder_, ())?;
982
983 Ok(())
984 }
985 }
986
987 impl<'de> ::fidl_next::IntoNatural for ResolverResolveWithContextResponse<'de> {
988 type Natural = crate::natural::ResolverResolveWithContextResponse;
989 }
990}
991
992pub mod wire_optional {
993
994 pub use fidl_next_common_fuchsia_component_resolution::wire_optional::*;
995}
996
997pub mod generic {
998
999 pub use fidl_next_common_fuchsia_component_resolution::generic::*;
1000
1001 pub struct ResolverResolveResponse<T0> {
1002 pub component: T0,
1003 }
1004
1005 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ResolverResolveResponse<'static>, ___E>
1006 for ResolverResolveResponse<T0>
1007 where
1008 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1009 ___E: ::fidl_next::Encoder,
1010 ___E: ::fidl_next::fuchsia::HandleEncoder,
1011 T0: ::fidl_next::Encode<crate::wire::Component<'static>, ___E>,
1012 {
1013 #[inline]
1014 fn encode(
1015 self,
1016 encoder_: &mut ___E,
1017 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolverResolveResponse<'static>>,
1018 _: (),
1019 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1020 ::fidl_next::munge! {
1021 let crate::wire::ResolverResolveResponse {
1022
1023 component,
1024
1025 } = out_;
1026 }
1027
1028 ::fidl_next::Encode::encode(self.component, encoder_, component, ())?;
1029
1030 Ok(())
1031 }
1032 }
1033
1034 pub struct ResolverResolveWithContextResponse<T0> {
1035 pub component: T0,
1036 }
1037
1038 unsafe impl<___E, T0>
1039 ::fidl_next::Encode<crate::wire::ResolverResolveWithContextResponse<'static>, ___E>
1040 for ResolverResolveWithContextResponse<T0>
1041 where
1042 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1043 ___E: ::fidl_next::Encoder,
1044 ___E: ::fidl_next::fuchsia::HandleEncoder,
1045 T0: ::fidl_next::Encode<crate::wire::Component<'static>, ___E>,
1046 {
1047 #[inline]
1048 fn encode(
1049 self,
1050 encoder_: &mut ___E,
1051 out_: &mut ::core::mem::MaybeUninit<
1052 crate::wire::ResolverResolveWithContextResponse<'static>,
1053 >,
1054 _: (),
1055 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1056 ::fidl_next::munge! {
1057 let crate::wire::ResolverResolveWithContextResponse {
1058
1059 component,
1060
1061 } = out_;
1062 }
1063
1064 ::fidl_next::Encode::encode(self.component, encoder_, component, ())?;
1065
1066 Ok(())
1067 }
1068 }
1069}
1070
1071pub use self::natural::*;
1072
1073#[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"]
1075#[derive(PartialEq, Debug)]
1076pub struct Resolver;
1077
1078impl ::fidl_next::Discoverable for Resolver {
1079 const PROTOCOL_NAME: &'static str = "fuchsia.component.resolution.Resolver";
1080}
1081
1082#[cfg(target_os = "fuchsia")]
1083impl ::fidl_next::HasTransport for Resolver {
1084 type Transport = ::fidl_next::fuchsia::zx::Channel;
1085}
1086
1087pub mod resolver {
1088 pub mod prelude {
1089 pub use crate::{Resolver, ResolverClientHandler, ResolverServerHandler, resolver};
1090
1091 pub use crate::natural::ResolverError;
1092
1093 pub use crate::natural::ResolverResolveRequest;
1094
1095 pub use crate::natural::ResolverResolveWithContextRequest;
1096
1097 pub use crate::natural::ResolverResolveWithContextResponse;
1098
1099 pub use crate::natural::ResolverResolveResponse;
1100 }
1101
1102 pub struct Resolve;
1103
1104 impl ::fidl_next::Method for Resolve {
1105 const ORDINAL: u64 = 6339326548187935461;
1106 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1107 ::fidl_next::protocol::Flexibility::Strict;
1108
1109 type Protocol = crate::Resolver;
1110
1111 type Request = crate::wire::ResolverResolveRequest<'static>;
1112 }
1113
1114 impl ::fidl_next::TwoWayMethod for Resolve {
1115 type Response = ::fidl_next::wire::Result<
1116 'static,
1117 crate::wire::ResolverResolveResponse<'static>,
1118 crate::wire::ResolverError,
1119 >;
1120 }
1121
1122 impl<___R> ::fidl_next::Respond<___R> for Resolve {
1123 type Output = ::core::result::Result<
1124 crate::generic::ResolverResolveResponse<___R>,
1125 ::fidl_next::util::Never,
1126 >;
1127
1128 fn respond(response: ___R) -> Self::Output {
1129 ::core::result::Result::Ok(crate::generic::ResolverResolveResponse {
1130 component: response,
1131 })
1132 }
1133 }
1134
1135 impl<___R> ::fidl_next::RespondErr<___R> for Resolve {
1136 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
1137
1138 fn respond_err(response: ___R) -> Self::Output {
1139 ::core::result::Result::Err(response)
1140 }
1141 }
1142
1143 pub struct ResolveWithContext;
1144
1145 impl ::fidl_next::Method for ResolveWithContext {
1146 const ORDINAL: u64 = 5576776708309151933;
1147 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1148 ::fidl_next::protocol::Flexibility::Strict;
1149
1150 type Protocol = crate::Resolver;
1151
1152 type Request = crate::wire::ResolverResolveWithContextRequest<'static>;
1153 }
1154
1155 impl ::fidl_next::TwoWayMethod for ResolveWithContext {
1156 type Response = ::fidl_next::wire::Result<
1157 'static,
1158 crate::wire::ResolverResolveWithContextResponse<'static>,
1159 crate::wire::ResolverError,
1160 >;
1161 }
1162
1163 impl<___R> ::fidl_next::Respond<___R> for ResolveWithContext {
1164 type Output = ::core::result::Result<
1165 crate::generic::ResolverResolveWithContextResponse<___R>,
1166 ::fidl_next::util::Never,
1167 >;
1168
1169 fn respond(response: ___R) -> Self::Output {
1170 ::core::result::Result::Ok(crate::generic::ResolverResolveWithContextResponse {
1171 component: response,
1172 })
1173 }
1174 }
1175
1176 impl<___R> ::fidl_next::RespondErr<___R> for ResolveWithContext {
1177 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
1178
1179 fn respond_err(response: ___R) -> Self::Output {
1180 ::core::result::Result::Err(response)
1181 }
1182 }
1183
1184 mod ___detail {
1185 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Resolver
1186 where
1187 ___T: ::fidl_next::Transport,
1188 {
1189 type Client = ResolverClient<___T>;
1190 type Server = ResolverServer<___T>;
1191 }
1192
1193 #[repr(transparent)]
1195 pub struct ResolverClient<___T: ::fidl_next::Transport> {
1196 #[allow(dead_code)]
1197 client: ::fidl_next::protocol::Client<___T>,
1198 }
1199
1200 impl<___T> ResolverClient<___T>
1201 where
1202 ___T: ::fidl_next::Transport,
1203 {
1204 #[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"]
1205 pub fn resolve(
1206 &self,
1207
1208 component_url: impl ::fidl_next::Encode<
1209 ::fidl_next::wire::String<'static>,
1210 <___T as ::fidl_next::Transport>::SendBuffer,
1211 >,
1212 ) -> ::fidl_next::TwoWayFuture<'_, super::Resolve, ___T>
1213 where
1214 <___T as ::fidl_next::Transport>::SendBuffer:
1215 ::fidl_next::encoder::InternalHandleEncoder,
1216 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1217 {
1218 self.resolve_with(crate::generic::ResolverResolveRequest { component_url })
1219 }
1220
1221 #[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"]
1222 pub fn resolve_with<___R>(
1223 &self,
1224 request: ___R,
1225 ) -> ::fidl_next::TwoWayFuture<'_, super::Resolve, ___T>
1226 where
1227 ___R: ::fidl_next::Encode<
1228 crate::wire::ResolverResolveRequest<'static>,
1229 <___T as ::fidl_next::Transport>::SendBuffer,
1230 >,
1231 {
1232 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1233 6339326548187935461,
1234 <super::Resolve as ::fidl_next::Method>::FLEXIBILITY,
1235 request,
1236 ))
1237 }
1238
1239 #[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"]
1240 pub fn resolve_with_context(
1241 &self,
1242
1243 component_url: impl ::fidl_next::Encode<
1244 ::fidl_next::wire::String<'static>,
1245 <___T as ::fidl_next::Transport>::SendBuffer,
1246 >,
1247
1248 context: impl ::fidl_next::Encode<
1249 crate::wire::Context<'static>,
1250 <___T as ::fidl_next::Transport>::SendBuffer,
1251 >,
1252 ) -> ::fidl_next::TwoWayFuture<'_, super::ResolveWithContext, ___T>
1253 where
1254 <___T as ::fidl_next::Transport>::SendBuffer:
1255 ::fidl_next::encoder::InternalHandleEncoder,
1256 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1257 {
1258 self.resolve_with_context_with(crate::generic::ResolverResolveWithContextRequest {
1259 component_url,
1260
1261 context,
1262 })
1263 }
1264
1265 #[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"]
1266 pub fn resolve_with_context_with<___R>(
1267 &self,
1268 request: ___R,
1269 ) -> ::fidl_next::TwoWayFuture<'_, super::ResolveWithContext, ___T>
1270 where
1271 ___R: ::fidl_next::Encode<
1272 crate::wire::ResolverResolveWithContextRequest<'static>,
1273 <___T as ::fidl_next::Transport>::SendBuffer,
1274 >,
1275 {
1276 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1277 5576776708309151933,
1278 <super::ResolveWithContext as ::fidl_next::Method>::FLEXIBILITY,
1279 request,
1280 ))
1281 }
1282 }
1283
1284 #[repr(transparent)]
1286 pub struct ResolverServer<___T: ::fidl_next::Transport> {
1287 server: ::fidl_next::protocol::Server<___T>,
1288 }
1289
1290 impl<___T> ResolverServer<___T> where ___T: ::fidl_next::Transport {}
1291 }
1292}
1293
1294pub trait ResolverClientHandler<
1298 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1299 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1300>
1301{
1302 fn on_unknown_interaction(
1303 &mut self,
1304 ordinal: u64,
1305 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1306 ::core::future::ready(())
1307 }
1308}
1309
1310impl<___T> ResolverClientHandler<___T> for ::fidl_next::IgnoreEvents
1311where
1312 ___T: ::fidl_next::Transport,
1313{
1314 async fn on_unknown_interaction(&mut self, _: u64) {}
1315}
1316
1317impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Resolver
1318where
1319 ___H: ResolverClientHandler<___T> + ::core::marker::Send,
1320 ___T: ::fidl_next::Transport,
1321{
1322 async fn on_event(
1323 handler: &mut ___H,
1324 ordinal: u64,
1325 flexibility: ::fidl_next::protocol::Flexibility,
1326 body: ::fidl_next::Body<___T>,
1327 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1328 match ordinal {
1329 ordinal => {
1330 handler.on_unknown_interaction(ordinal).await;
1331 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1332 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1333 } else {
1334 Ok(())
1335 }
1336 }
1337 }
1338 }
1339}
1340
1341pub trait ResolverServerHandler<
1345 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1346 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1347>
1348{
1349 #[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"]
1350 fn resolve(
1351 &mut self,
1352
1353 request: ::fidl_next::Request<resolver::Resolve, ___T>,
1354
1355 responder: ::fidl_next::Responder<resolver::Resolve, ___T>,
1356 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1357
1358 #[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"]
1359 fn resolve_with_context(
1360 &mut self,
1361
1362 request: ::fidl_next::Request<resolver::ResolveWithContext, ___T>,
1363
1364 responder: ::fidl_next::Responder<resolver::ResolveWithContext, ___T>,
1365 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1366
1367 fn on_unknown_interaction(
1368 &mut self,
1369 ordinal: u64,
1370 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1371 ::core::future::ready(())
1372 }
1373}
1374
1375impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Resolver
1376where
1377 ___H: ResolverServerHandler<___T> + ::core::marker::Send,
1378 ___T: ::fidl_next::Transport,
1379 for<'de> crate::wire::ResolverResolveRequest<'de>: ::fidl_next::Decode<
1380 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1381 Constraint = (),
1382 >,
1383 for<'de> crate::wire::ResolverResolveWithContextRequest<'de>: ::fidl_next::Decode<
1384 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1385 Constraint = (),
1386 >,
1387{
1388 async fn on_one_way(
1389 handler: &mut ___H,
1390 ordinal: u64,
1391 flexibility: ::fidl_next::protocol::Flexibility,
1392 body: ::fidl_next::Body<___T>,
1393 ) -> ::core::result::Result<
1394 (),
1395 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1396 > {
1397 match ordinal {
1398 ordinal => {
1399 handler.on_unknown_interaction(ordinal).await;
1400 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1401 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1402 } else {
1403 Ok(())
1404 }
1405 }
1406 }
1407 }
1408
1409 async fn on_two_way(
1410 handler: &mut ___H,
1411 ordinal: u64,
1412 flexibility: ::fidl_next::protocol::Flexibility,
1413 body: ::fidl_next::Body<___T>,
1414 responder: ::fidl_next::protocol::Responder<___T>,
1415 ) -> ::core::result::Result<
1416 (),
1417 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1418 > {
1419 match ordinal {
1420 6339326548187935461 => {
1421 let responder = ::fidl_next::Responder::from_untyped(responder);
1422
1423 match ::fidl_next::AsDecoderExt::into_decoded(body) {
1424 Ok(decoded) => {
1425 handler
1426 .resolve(::fidl_next::Request::from_decoded(decoded), responder)
1427 .await;
1428 Ok(())
1429 }
1430 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1431 ordinal: 6339326548187935461,
1432 error,
1433 }),
1434 }
1435 }
1436
1437 5576776708309151933 => {
1438 let responder = ::fidl_next::Responder::from_untyped(responder);
1439
1440 match ::fidl_next::AsDecoderExt::into_decoded(body) {
1441 Ok(decoded) => {
1442 handler
1443 .resolve_with_context(
1444 ::fidl_next::Request::from_decoded(decoded),
1445 responder,
1446 )
1447 .await;
1448 Ok(())
1449 }
1450 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1451 ordinal: 5576776708309151933,
1452 error,
1453 }),
1454 }
1455 }
1456
1457 ordinal => {
1458 handler.on_unknown_interaction(ordinal).await;
1459 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1460 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1461 } else {
1462 responder
1463 .respond(
1464 ordinal,
1465 flexibility,
1466 ::fidl_next::Flexible::<()>::FrameworkErr(
1467 ::fidl_next::FrameworkError::UnknownMethod,
1468 ),
1469 )
1470 .expect("encoding a framework error should never fail")
1471 .await?;
1472 Ok(())
1473 }
1474 }
1475 }
1476 }
1477}
1478
1479pub use fidl_next_common_fuchsia_component_resolution::*;
1480
1481pub mod compat {
1483
1484 pub use fidl_next_common_fuchsia_component_resolution::compat::*;
1485
1486 impl ::fidl_next::CompatFrom<crate::Package> for ::fidl_fuchsia_component_resolution::Package {
1487 fn compat_from(value: crate::Package) -> Self {
1488 Self {
1489 url: ::fidl_next::CompatFrom::compat_from(value.url),
1490
1491 directory: ::fidl_next::CompatFrom::compat_from(value.directory),
1492
1493 __source_breaking: ::fidl::marker::SourceBreaking,
1494 }
1495 }
1496 }
1497
1498 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::Package> for crate::Package {
1499 fn compat_from(value: ::fidl_fuchsia_component_resolution::Package) -> Self {
1500 Self {
1501 url: ::fidl_next::CompatFrom::compat_from(value.url),
1502
1503 directory: ::fidl_next::CompatFrom::compat_from(value.directory),
1504 }
1505 }
1506 }
1507
1508 impl ::fidl_next::CompatFrom<crate::Component> for ::fidl_fuchsia_component_resolution::Component {
1509 fn compat_from(value: crate::Component) -> Self {
1510 Self {
1511 url: ::fidl_next::CompatFrom::compat_from(value.url),
1512
1513 decl: ::fidl_next::CompatFrom::compat_from(value.decl),
1514
1515 package: ::fidl_next::CompatFrom::compat_from(value.package),
1516
1517 config_values: ::fidl_next::CompatFrom::compat_from(value.config_values),
1518
1519 resolution_context: ::fidl_next::CompatFrom::compat_from(value.resolution_context),
1520
1521 abi_revision: ::fidl_next::CompatFrom::compat_from(value.abi_revision),
1522
1523 __source_breaking: ::fidl::marker::SourceBreaking,
1524 }
1525 }
1526 }
1527
1528 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::Component> for crate::Component {
1529 fn compat_from(value: ::fidl_fuchsia_component_resolution::Component) -> Self {
1530 Self {
1531 url: ::fidl_next::CompatFrom::compat_from(value.url),
1532
1533 decl: ::fidl_next::CompatFrom::compat_from(value.decl),
1534
1535 package: ::fidl_next::CompatFrom::compat_from(value.package),
1536
1537 config_values: ::fidl_next::CompatFrom::compat_from(value.config_values),
1538
1539 resolution_context: ::fidl_next::CompatFrom::compat_from(value.resolution_context),
1540
1541 abi_revision: ::fidl_next::CompatFrom::compat_from(value.abi_revision),
1542 }
1543 }
1544 }
1545
1546 impl ::fidl_next::CompatFrom<crate::ResolverResolveResponse>
1547 for ::fidl_fuchsia_component_resolution::ResolverResolveResponse
1548 {
1549 #[inline]
1550 fn compat_from(value: crate::ResolverResolveResponse) -> Self {
1551 Self { component: ::fidl_next::CompatFrom::compat_from(value.component) }
1552 }
1553 }
1554
1555 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::ResolverResolveResponse>
1556 for crate::ResolverResolveResponse
1557 {
1558 #[inline]
1559 fn compat_from(
1560 value: ::fidl_fuchsia_component_resolution::ResolverResolveResponse,
1561 ) -> Self {
1562 Self { component: ::fidl_next::CompatFrom::compat_from(value.component) }
1563 }
1564 }
1565
1566 impl ::fidl_next::CompatFrom<crate::ResolverResolveWithContextResponse>
1567 for ::fidl_fuchsia_component_resolution::ResolverResolveWithContextResponse
1568 {
1569 #[inline]
1570 fn compat_from(value: crate::ResolverResolveWithContextResponse) -> Self {
1571 Self { component: ::fidl_next::CompatFrom::compat_from(value.component) }
1572 }
1573 }
1574
1575 impl
1576 ::fidl_next::CompatFrom<
1577 ::fidl_fuchsia_component_resolution::ResolverResolveWithContextResponse,
1578 > for crate::ResolverResolveWithContextResponse
1579 {
1580 #[inline]
1581 fn compat_from(
1582 value: ::fidl_fuchsia_component_resolution::ResolverResolveWithContextResponse,
1583 ) -> Self {
1584 Self { component: ::fidl_next::CompatFrom::compat_from(value.component) }
1585 }
1586 }
1587
1588 #[cfg(target_os = "fuchsia")]
1589 pub type ResolverProxy = ::fidl_next::Client<crate::Resolver>;
1592
1593 impl ::fidl_next::CompatFrom<crate::Resolver>
1594 for ::fidl_fuchsia_component_resolution::ResolverMarker
1595 {
1596 fn compat_from(_: crate::Resolver) -> Self {
1597 Self
1598 }
1599 }
1600
1601 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_resolution::ResolverMarker>
1602 for crate::Resolver
1603 {
1604 fn compat_from(_: ::fidl_fuchsia_component_resolution::ResolverMarker) -> Self {
1605 Self
1606 }
1607 }
1608
1609 #[cfg(target_os = "fuchsia")]
1610
1611 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_component_resolution::ResolverProxy>
1612 for crate::Resolver
1613 {
1614 fn client_compat_from(
1615 proxy: ::fidl_fuchsia_component_resolution::ResolverProxy,
1616 ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
1617 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
1618 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
1619 ::fidl_next::ClientDispatcher::new(client_end)
1620 }
1621 }
1622}