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 component,
871
872 } = &mut *out_;
873 }
874
875 ::fidl_next::Wire::zero_padding(component);
876 }
877 }
878
879 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ResolverResolveResponse<'de>
880 where
881 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
882 ___D: ::fidl_next::Decoder<'de>,
883 ___D: ::fidl_next::fuchsia::HandleDecoder,
884 {
885 fn decode(
886 slot_: ::fidl_next::Slot<'_, Self>,
887 decoder_: &mut ___D,
888 _: (),
889 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
890 ::fidl_next::munge! {
891 let Self {
892 mut component,
893
894 } = slot_;
895 }
896
897 let _field = component.as_mut();
898
899 ::fidl_next::Decode::decode(component.as_mut(), decoder_, ())?;
900
901 Ok(())
902 }
903 }
904
905 impl<'de> ::fidl_next::IntoNatural for ResolverResolveResponse<'de> {
906 type Natural = crate::natural::ResolverResolveResponse;
907 }
908
909 #[derive(Debug)]
911 #[repr(C)]
912 pub struct ResolverResolveWithContextResponse<'de> {
913 pub component: crate::wire::Component<'de>,
914 }
915
916 static_assertions::const_assert_eq!(
917 std::mem::size_of::<ResolverResolveWithContextResponse<'_>>(),
918 16
919 );
920 static_assertions::const_assert_eq!(
921 std::mem::align_of::<ResolverResolveWithContextResponse<'_>>(),
922 8
923 );
924
925 static_assertions::const_assert_eq!(
926 std::mem::offset_of!(ResolverResolveWithContextResponse<'_>, component),
927 0
928 );
929
930 impl ::fidl_next::Constrained for ResolverResolveWithContextResponse<'_> {
931 type Constraint = ();
932
933 fn validate(
934 _: ::fidl_next::Slot<'_, Self>,
935 _: Self::Constraint,
936 ) -> Result<(), ::fidl_next::ValidationError> {
937 Ok(())
938 }
939 }
940
941 unsafe impl ::fidl_next::Wire for ResolverResolveWithContextResponse<'static> {
942 type Narrowed<'de> = ResolverResolveWithContextResponse<'de>;
943
944 #[inline]
945 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
946 ::fidl_next::munge! {
947 let Self {
948 component,
949
950 } = &mut *out_;
951 }
952
953 ::fidl_next::Wire::zero_padding(component);
954 }
955 }
956
957 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ResolverResolveWithContextResponse<'de>
958 where
959 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
960 ___D: ::fidl_next::Decoder<'de>,
961 ___D: ::fidl_next::fuchsia::HandleDecoder,
962 {
963 fn decode(
964 slot_: ::fidl_next::Slot<'_, Self>,
965 decoder_: &mut ___D,
966 _: (),
967 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
968 ::fidl_next::munge! {
969 let Self {
970 mut component,
971
972 } = slot_;
973 }
974
975 let _field = component.as_mut();
976
977 ::fidl_next::Decode::decode(component.as_mut(), decoder_, ())?;
978
979 Ok(())
980 }
981 }
982
983 impl<'de> ::fidl_next::IntoNatural for ResolverResolveWithContextResponse<'de> {
984 type Natural = crate::natural::ResolverResolveWithContextResponse;
985 }
986}
987
988pub mod wire_optional {
989
990 pub use fidl_next_common_fuchsia_component_resolution::wire_optional::*;
991}
992
993pub mod generic {
994
995 pub use fidl_next_common_fuchsia_component_resolution::generic::*;
996
997 pub struct ResolverResolveResponse<T0> {
999 pub component: T0,
1000 }
1001
1002 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ResolverResolveResponse<'static>, ___E>
1003 for ResolverResolveResponse<T0>
1004 where
1005 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1006 ___E: ::fidl_next::Encoder,
1007 ___E: ::fidl_next::fuchsia::HandleEncoder,
1008 T0: ::fidl_next::Encode<crate::wire::Component<'static>, ___E>,
1009 {
1010 #[inline]
1011 fn encode(
1012 self,
1013 encoder_: &mut ___E,
1014 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolverResolveResponse<'static>>,
1015 _: (),
1016 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1017 ::fidl_next::munge! {
1018 let crate::wire::ResolverResolveResponse {
1019 component,
1020
1021 } = out_;
1022 }
1023
1024 ::fidl_next::Encode::encode(self.component, encoder_, component, ())?;
1025
1026 Ok(())
1027 }
1028 }
1029
1030 pub struct ResolverResolveWithContextResponse<T0> {
1032 pub component: T0,
1033 }
1034
1035 unsafe impl<___E, T0>
1036 ::fidl_next::Encode<crate::wire::ResolverResolveWithContextResponse<'static>, ___E>
1037 for ResolverResolveWithContextResponse<T0>
1038 where
1039 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1040 ___E: ::fidl_next::Encoder,
1041 ___E: ::fidl_next::fuchsia::HandleEncoder,
1042 T0: ::fidl_next::Encode<crate::wire::Component<'static>, ___E>,
1043 {
1044 #[inline]
1045 fn encode(
1046 self,
1047 encoder_: &mut ___E,
1048 out_: &mut ::core::mem::MaybeUninit<
1049 crate::wire::ResolverResolveWithContextResponse<'static>,
1050 >,
1051 _: (),
1052 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1053 ::fidl_next::munge! {
1054 let crate::wire::ResolverResolveWithContextResponse {
1055 component,
1056
1057 } = out_;
1058 }
1059
1060 ::fidl_next::Encode::encode(self.component, encoder_, component, ())?;
1061
1062 Ok(())
1063 }
1064 }
1065}
1066
1067pub use self::natural::*;
1068
1069#[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"]
1071#[derive(PartialEq, Debug)]
1072pub struct Resolver;
1073
1074impl ::fidl_next::Discoverable for Resolver {
1075 const PROTOCOL_NAME: &'static str = "fuchsia.component.resolution.Resolver";
1076}
1077
1078#[cfg(target_os = "fuchsia")]
1079impl ::fidl_next::HasTransport for Resolver {
1080 type Transport = ::fidl_next::fuchsia::zx::Channel;
1081}
1082
1083pub mod resolver {
1084 pub mod prelude {
1085 pub use crate::{
1086 Resolver, ResolverClientHandler, ResolverLocalClientHandler,
1087 ResolverLocalServerHandler, ResolverServerHandler, resolver,
1088 };
1089
1090 pub use crate::natural::ResolverError;
1091
1092 pub use crate::natural::ResolverResolveRequest;
1093
1094 pub use crate::natural::ResolverResolveWithContextRequest;
1095
1096 pub use crate::natural::ResolverResolveWithContextResponse;
1097
1098 pub use crate::natural::ResolverResolveResponse;
1099 }
1100
1101 pub struct Resolve;
1102
1103 impl ::fidl_next::Method for Resolve {
1104 const ORDINAL: u64 = 6339326548187935461;
1105 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1106 ::fidl_next::protocol::Flexibility::Strict;
1107
1108 type Protocol = crate::Resolver;
1109
1110 type Request = crate::wire::ResolverResolveRequest<'static>;
1111 }
1112
1113 impl ::fidl_next::TwoWayMethod for Resolve {
1114 type Response = ::fidl_next::wire::Result<
1115 'static,
1116 crate::wire::ResolverResolveResponse<'static>,
1117 crate::wire::ResolverError,
1118 >;
1119 }
1120
1121 impl<___R> ::fidl_next::Respond<___R> for Resolve {
1122 type Output = ::core::result::Result<
1123 crate::generic::ResolverResolveResponse<___R>,
1124 ::fidl_next::util::Never,
1125 >;
1126
1127 fn respond(response: ___R) -> Self::Output {
1128 ::core::result::Result::Ok(crate::generic::ResolverResolveResponse {
1129 component: response,
1130 })
1131 }
1132 }
1133
1134 impl<___R> ::fidl_next::RespondErr<___R> for Resolve {
1135 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
1136
1137 fn respond_err(response: ___R) -> Self::Output {
1138 ::core::result::Result::Err(response)
1139 }
1140 }
1141
1142 pub struct ResolveWithContext;
1143
1144 impl ::fidl_next::Method for ResolveWithContext {
1145 const ORDINAL: u64 = 5576776708309151933;
1146 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1147 ::fidl_next::protocol::Flexibility::Strict;
1148
1149 type Protocol = crate::Resolver;
1150
1151 type Request = crate::wire::ResolverResolveWithContextRequest<'static>;
1152 }
1153
1154 impl ::fidl_next::TwoWayMethod for ResolveWithContext {
1155 type Response = ::fidl_next::wire::Result<
1156 'static,
1157 crate::wire::ResolverResolveWithContextResponse<'static>,
1158 crate::wire::ResolverError,
1159 >;
1160 }
1161
1162 impl<___R> ::fidl_next::Respond<___R> for ResolveWithContext {
1163 type Output = ::core::result::Result<
1164 crate::generic::ResolverResolveWithContextResponse<___R>,
1165 ::fidl_next::util::Never,
1166 >;
1167
1168 fn respond(response: ___R) -> Self::Output {
1169 ::core::result::Result::Ok(crate::generic::ResolverResolveWithContextResponse {
1170 component: response,
1171 })
1172 }
1173 }
1174
1175 impl<___R> ::fidl_next::RespondErr<___R> for ResolveWithContext {
1176 type Output = ::core::result::Result<::fidl_next::util::Never, ___R>;
1177
1178 fn respond_err(response: ___R) -> Self::Output {
1179 ::core::result::Result::Err(response)
1180 }
1181 }
1182
1183 mod ___detail {
1184 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Resolver
1185 where
1186 ___T: ::fidl_next::Transport,
1187 {
1188 type Client = ResolverClient<___T>;
1189 type Server = ResolverServer<___T>;
1190 }
1191
1192 #[repr(transparent)]
1194 pub struct ResolverClient<___T: ::fidl_next::Transport> {
1195 #[allow(dead_code)]
1196 client: ::fidl_next::protocol::Client<___T>,
1197 }
1198
1199 impl<___T> ResolverClient<___T>
1200 where
1201 ___T: ::fidl_next::Transport,
1202 {
1203 #[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"]
1204 pub fn resolve(
1205 &self,
1206
1207 component_url: impl ::fidl_next::Encode<
1208 ::fidl_next::wire::String<'static>,
1209 <___T as ::fidl_next::Transport>::SendBuffer,
1210 >,
1211 ) -> ::fidl_next::TwoWayFuture<'_, super::Resolve, ___T>
1212 where
1213 <___T as ::fidl_next::Transport>::SendBuffer:
1214 ::fidl_next::encoder::InternalHandleEncoder,
1215 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1216 {
1217 self.resolve_with(crate::generic::ResolverResolveRequest { component_url })
1218 }
1219
1220 #[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"]
1221 pub fn resolve_with<___R>(
1222 &self,
1223 request: ___R,
1224 ) -> ::fidl_next::TwoWayFuture<'_, super::Resolve, ___T>
1225 where
1226 ___R: ::fidl_next::Encode<
1227 crate::wire::ResolverResolveRequest<'static>,
1228 <___T as ::fidl_next::Transport>::SendBuffer,
1229 >,
1230 {
1231 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1232 6339326548187935461,
1233 <super::Resolve as ::fidl_next::Method>::FLEXIBILITY,
1234 request,
1235 ))
1236 }
1237
1238 #[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"]
1239 pub fn resolve_with_context(
1240 &self,
1241
1242 component_url: impl ::fidl_next::Encode<
1243 ::fidl_next::wire::String<'static>,
1244 <___T as ::fidl_next::Transport>::SendBuffer,
1245 >,
1246
1247 context: impl ::fidl_next::Encode<
1248 crate::wire::Context<'static>,
1249 <___T as ::fidl_next::Transport>::SendBuffer,
1250 >,
1251 ) -> ::fidl_next::TwoWayFuture<'_, super::ResolveWithContext, ___T>
1252 where
1253 <___T as ::fidl_next::Transport>::SendBuffer:
1254 ::fidl_next::encoder::InternalHandleEncoder,
1255 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1256 {
1257 self.resolve_with_context_with(crate::generic::ResolverResolveWithContextRequest {
1258 component_url,
1259
1260 context,
1261 })
1262 }
1263
1264 #[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"]
1265 pub fn resolve_with_context_with<___R>(
1266 &self,
1267 request: ___R,
1268 ) -> ::fidl_next::TwoWayFuture<'_, super::ResolveWithContext, ___T>
1269 where
1270 ___R: ::fidl_next::Encode<
1271 crate::wire::ResolverResolveWithContextRequest<'static>,
1272 <___T as ::fidl_next::Transport>::SendBuffer,
1273 >,
1274 {
1275 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1276 5576776708309151933,
1277 <super::ResolveWithContext as ::fidl_next::Method>::FLEXIBILITY,
1278 request,
1279 ))
1280 }
1281 }
1282
1283 #[repr(transparent)]
1285 pub struct ResolverServer<___T: ::fidl_next::Transport> {
1286 server: ::fidl_next::protocol::Server<___T>,
1287 }
1288
1289 impl<___T> ResolverServer<___T> where ___T: ::fidl_next::Transport {}
1290 }
1291}
1292
1293#[diagnostic::on_unimplemented(
1294 note = "If {Self} implements the non-local ResolverClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
1295)]
1296
1297pub trait ResolverLocalClientHandler<
1301 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1302 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1303>
1304{
1305 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1306 ::core::future::ready(())
1307 }
1308}
1309
1310impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Resolver
1311where
1312 ___H: ResolverLocalClientHandler<___T>,
1313 ___T: ::fidl_next::Transport,
1314{
1315 async fn on_event(
1316 handler: &mut ___H,
1317 ordinal: u64,
1318 flexibility: ::fidl_next::protocol::Flexibility,
1319 body: ::fidl_next::Body<___T>,
1320 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1321 match ordinal {
1322 ordinal => {
1323 handler.on_unknown_interaction(ordinal).await;
1324 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1325 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1326 } else {
1327 Ok(())
1328 }
1329 }
1330 }
1331 }
1332}
1333
1334#[diagnostic::on_unimplemented(
1335 note = "If {Self} implements the non-local ResolverServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
1336)]
1337
1338pub trait ResolverLocalServerHandler<
1342 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1343 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1344>
1345{
1346 #[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"]
1347 fn resolve(
1348 &mut self,
1349
1350 request: ::fidl_next::Request<resolver::Resolve, ___T>,
1351
1352 responder: ::fidl_next::Responder<resolver::Resolve, ___T>,
1353 ) -> impl ::core::future::Future<Output = ()>;
1354
1355 #[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"]
1356 fn resolve_with_context(
1357 &mut self,
1358
1359 request: ::fidl_next::Request<resolver::ResolveWithContext, ___T>,
1360
1361 responder: ::fidl_next::Responder<resolver::ResolveWithContext, ___T>,
1362 ) -> impl ::core::future::Future<Output = ()>;
1363
1364 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1365 ::core::future::ready(())
1366 }
1367}
1368
1369impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Resolver
1370where
1371 ___H: ResolverLocalServerHandler<___T>,
1372 ___T: ::fidl_next::Transport,
1373 for<'de> crate::wire::ResolverResolveRequest<'de>: ::fidl_next::Decode<
1374 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1375 Constraint = (),
1376 >,
1377 for<'de> crate::wire::ResolverResolveWithContextRequest<'de>: ::fidl_next::Decode<
1378 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1379 Constraint = (),
1380 >,
1381{
1382 async fn on_one_way(
1383 handler: &mut ___H,
1384 ordinal: u64,
1385 flexibility: ::fidl_next::protocol::Flexibility,
1386 body: ::fidl_next::Body<___T>,
1387 ) -> ::core::result::Result<
1388 (),
1389 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1390 > {
1391 match ordinal {
1392 ordinal => {
1393 handler.on_unknown_interaction(ordinal).await;
1394 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1395 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1396 } else {
1397 Ok(())
1398 }
1399 }
1400 }
1401 }
1402
1403 async fn on_two_way(
1404 handler: &mut ___H,
1405 ordinal: u64,
1406 flexibility: ::fidl_next::protocol::Flexibility,
1407 body: ::fidl_next::Body<___T>,
1408 responder: ::fidl_next::protocol::Responder<___T>,
1409 ) -> ::core::result::Result<
1410 (),
1411 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1412 > {
1413 match ordinal {
1414 6339326548187935461 => {
1415 let responder = ::fidl_next::Responder::from_untyped(responder);
1416
1417 match ::fidl_next::AsDecoderExt::into_decoded(body) {
1418 Ok(decoded) => {
1419 handler
1420 .resolve(::fidl_next::Request::from_decoded(decoded), responder)
1421 .await;
1422 Ok(())
1423 }
1424 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1425 ordinal: 6339326548187935461,
1426 error,
1427 }),
1428 }
1429 }
1430
1431 5576776708309151933 => {
1432 let responder = ::fidl_next::Responder::from_untyped(responder);
1433
1434 match ::fidl_next::AsDecoderExt::into_decoded(body) {
1435 Ok(decoded) => {
1436 handler
1437 .resolve_with_context(
1438 ::fidl_next::Request::from_decoded(decoded),
1439 responder,
1440 )
1441 .await;
1442 Ok(())
1443 }
1444 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1445 ordinal: 5576776708309151933,
1446 error,
1447 }),
1448 }
1449 }
1450
1451 ordinal => {
1452 handler.on_unknown_interaction(ordinal).await;
1453 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1454 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1455 } else {
1456 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
1457 ordinal,
1458 flexibility,
1459 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
1460 )
1461 .expect("encoding a framework error should never fail")
1462 .await?;
1463 Ok(())
1464 }
1465 }
1466 }
1467 }
1468}
1469
1470pub trait ResolverClientHandler<
1474 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1475 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1476>
1477{
1478 fn on_unknown_interaction(
1479 &mut self,
1480 ordinal: u64,
1481 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1482 ::core::future::ready(())
1483 }
1484}
1485
1486impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Resolver
1487where
1488 ___H: ResolverClientHandler<___T> + ::core::marker::Send,
1489 ___T: ::fidl_next::Transport,
1490{
1491 async fn on_event(
1492 handler: &mut ___H,
1493 ordinal: u64,
1494 flexibility: ::fidl_next::protocol::Flexibility,
1495 body: ::fidl_next::Body<___T>,
1496 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1497 match ordinal {
1498 ordinal => {
1499 handler.on_unknown_interaction(ordinal).await;
1500 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1501 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1502 } else {
1503 Ok(())
1504 }
1505 }
1506 }
1507 }
1508}
1509
1510pub trait ResolverServerHandler<
1514 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1515 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1516>
1517{
1518 #[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"]
1519 fn resolve(
1520 &mut self,
1521
1522 request: ::fidl_next::Request<resolver::Resolve, ___T>,
1523
1524 responder: ::fidl_next::Responder<resolver::Resolve, ___T>,
1525 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1526
1527 #[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"]
1528 fn resolve_with_context(
1529 &mut self,
1530
1531 request: ::fidl_next::Request<resolver::ResolveWithContext, ___T>,
1532
1533 responder: ::fidl_next::Responder<resolver::ResolveWithContext, ___T>,
1534 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1535
1536 fn on_unknown_interaction(
1537 &mut self,
1538 ordinal: u64,
1539 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1540 ::core::future::ready(())
1541 }
1542}
1543
1544impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Resolver
1545where
1546 ___H: ResolverServerHandler<___T> + ::core::marker::Send,
1547 ___T: ::fidl_next::Transport,
1548 for<'de> crate::wire::ResolverResolveRequest<'de>: ::fidl_next::Decode<
1549 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1550 Constraint = (),
1551 >,
1552 for<'de> crate::wire::ResolverResolveWithContextRequest<'de>: ::fidl_next::Decode<
1553 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1554 Constraint = (),
1555 >,
1556{
1557 async fn on_one_way(
1558 handler: &mut ___H,
1559 ordinal: u64,
1560 flexibility: ::fidl_next::protocol::Flexibility,
1561 body: ::fidl_next::Body<___T>,
1562 ) -> ::core::result::Result<
1563 (),
1564 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1565 > {
1566 match ordinal {
1567 ordinal => {
1568 handler.on_unknown_interaction(ordinal).await;
1569 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1570 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1571 } else {
1572 Ok(())
1573 }
1574 }
1575 }
1576 }
1577
1578 async fn on_two_way(
1579 handler: &mut ___H,
1580 ordinal: u64,
1581 flexibility: ::fidl_next::protocol::Flexibility,
1582 body: ::fidl_next::Body<___T>,
1583 responder: ::fidl_next::protocol::Responder<___T>,
1584 ) -> ::core::result::Result<
1585 (),
1586 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1587 > {
1588 match ordinal {
1589 6339326548187935461 => {
1590 let responder = ::fidl_next::Responder::from_untyped(responder);
1591
1592 match ::fidl_next::AsDecoderExt::into_decoded(body) {
1593 Ok(decoded) => {
1594 handler
1595 .resolve(::fidl_next::Request::from_decoded(decoded), responder)
1596 .await;
1597 Ok(())
1598 }
1599 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1600 ordinal: 6339326548187935461,
1601 error,
1602 }),
1603 }
1604 }
1605
1606 5576776708309151933 => {
1607 let responder = ::fidl_next::Responder::from_untyped(responder);
1608
1609 match ::fidl_next::AsDecoderExt::into_decoded(body) {
1610 Ok(decoded) => {
1611 handler
1612 .resolve_with_context(
1613 ::fidl_next::Request::from_decoded(decoded),
1614 responder,
1615 )
1616 .await;
1617 Ok(())
1618 }
1619 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1620 ordinal: 5576776708309151933,
1621 error,
1622 }),
1623 }
1624 }
1625
1626 ordinal => {
1627 handler.on_unknown_interaction(ordinal).await;
1628 if ::core::matches!(flexibility, ::fidl_next::protocol::Flexibility::Strict) {
1629 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1630 } else {
1631 responder.respond::<::fidl_next::wire::Flexible<'_, ::fidl_next::wire::EmptyMessageBody>>(
1632 ordinal,
1633 flexibility,
1634 ::fidl_next::Flexible::<::fidl_next::util::Never>::FrameworkErr(::fidl_next::FrameworkError::UnknownMethod),
1635 )
1636 .expect("encoding a framework error should never fail")
1637 .await?;
1638 Ok(())
1639 }
1640 }
1641 }
1642 }
1643}
1644
1645impl<___T> ResolverClientHandler<___T> for ::fidl_next::IgnoreEvents
1646where
1647 ___T: ::fidl_next::Transport,
1648{
1649 async fn on_unknown_interaction(&mut self, _: u64) {}
1650}
1651
1652impl<___H, ___T> ResolverLocalClientHandler<___T> for ::fidl_next::Local<___H>
1653where
1654 ___H: ResolverClientHandler<___T>,
1655 ___T: ::fidl_next::Transport,
1656{
1657 async fn on_unknown_interaction(&mut self, ordinal: u64) {
1658 ___H::on_unknown_interaction(&mut self.0, ordinal).await
1659 }
1660}
1661
1662impl<___H, ___T> ResolverLocalServerHandler<___T> for ::fidl_next::Local<___H>
1663where
1664 ___H: ResolverServerHandler<___T>,
1665 ___T: ::fidl_next::Transport,
1666{
1667 async fn resolve(
1668 &mut self,
1669
1670 request: ::fidl_next::Request<resolver::Resolve, ___T>,
1671
1672 responder: ::fidl_next::Responder<resolver::Resolve, ___T>,
1673 ) {
1674 ___H::resolve(&mut self.0, request, responder).await
1675 }
1676
1677 async fn resolve_with_context(
1678 &mut self,
1679
1680 request: ::fidl_next::Request<resolver::ResolveWithContext, ___T>,
1681
1682 responder: ::fidl_next::Responder<resolver::ResolveWithContext, ___T>,
1683 ) {
1684 ___H::resolve_with_context(&mut self.0, request, responder).await
1685 }
1686
1687 async fn on_unknown_interaction(&mut self, ordinal: u64) {
1688 ___H::on_unknown_interaction(&mut self.0, ordinal).await
1689 }
1690}
1691
1692pub use fidl_next_common_fuchsia_component_resolution::*;