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