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 take_url(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
613 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
614 }
615
616 pub fn directory(
617 &self,
618 ) -> ::core::option::Option<
619 &::fidl_next::ClientEnd<
620 ::fidl_next_fuchsia_io::Directory,
621 ::fidl_next::wire::fuchsia::Channel,
622 >,
623 > {
624 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
625 }
626
627 pub fn take_directory(
628 &mut self,
629 ) -> ::core::option::Option<
630 ::fidl_next::ClientEnd<
631 ::fidl_next_fuchsia_io::Directory,
632 ::fidl_next::wire::fuchsia::Channel,
633 >,
634 > {
635 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
636 }
637 }
638
639 impl<'de> ::core::fmt::Debug for Package<'de> {
640 fn fmt(
641 &self,
642 f: &mut ::core::fmt::Formatter<'_>,
643 ) -> ::core::result::Result<(), ::core::fmt::Error> {
644 f.debug_struct("Package")
645 .field("url", &self.url())
646 .field("directory", &self.directory())
647 .finish()
648 }
649 }
650
651 impl<'de> ::fidl_next::IntoNatural for Package<'de> {
652 type Natural = crate::natural::Package;
653 }
654
655 #[repr(C)]
657 pub struct Component<'de> {
658 pub(crate) table: ::fidl_next::wire::Table<'de>,
659 }
660
661 impl<'de> Drop for Component<'de> {
662 fn drop(&mut self) {
663 let _ = self.table.get(1).map(|envelope| unsafe {
664 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
665 });
666
667 let _ = self.table.get(2).map(|envelope| unsafe {
668 envelope.read_unchecked::<::fidl_next_fuchsia_mem::wire::Data<'de>>()
669 });
670
671 let _ = self
672 .table
673 .get(3)
674 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Package<'de>>() });
675
676 let _ = self.table.get(4).map(|envelope| unsafe {
677 envelope.read_unchecked::<::fidl_next_fuchsia_mem::wire::Data<'de>>()
678 });
679
680 let _ = self
681 .table
682 .get(5)
683 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Context<'de>>() });
684
685 let _ = self
686 .table
687 .get(6)
688 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint64>() });
689 }
690 }
691
692 impl ::fidl_next::Constrained for Component<'_> {
693 type Constraint = ();
694
695 fn validate(
696 _: ::fidl_next::Slot<'_, Self>,
697 _: Self::Constraint,
698 ) -> Result<(), ::fidl_next::ValidationError> {
699 Ok(())
700 }
701 }
702
703 unsafe impl ::fidl_next::Wire for Component<'static> {
704 type Narrowed<'de> = Component<'de>;
705
706 #[inline]
707 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
708 ::fidl_next::munge!(let Self { table } = out);
709 ::fidl_next::wire::Table::zero_padding(table);
710 }
711 }
712
713 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Component<'de>
714 where
715 ___D: ::fidl_next::Decoder<'de> + ?Sized,
716 ___D: ::fidl_next::fuchsia::HandleDecoder,
717 {
718 fn decode(
719 slot: ::fidl_next::Slot<'_, Self>,
720 decoder: &mut ___D,
721 _: (),
722 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
723 ::fidl_next::munge!(let Self { table } = slot);
724
725 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
726 match ordinal {
727 0 => unsafe { ::core::hint::unreachable_unchecked() },
728
729 1 => {
730 ::fidl_next::wire::Envelope::decode_as::<
731 ___D,
732 ::fidl_next::wire::String<'de>,
733 >(slot.as_mut(), decoder, 2083)?;
734
735 let value = unsafe {
736 slot.deref_unchecked()
737 .deref_unchecked::<::fidl_next::wire::String<'_>>()
738 };
739
740 if value.len() > 2083 {
741 return Err(::fidl_next::DecodeError::VectorTooLong {
742 size: value.len() as u64,
743 limit: 2083,
744 });
745 }
746
747 Ok(())
748 }
749
750 2 => {
751 ::fidl_next::wire::Envelope::decode_as::<
752 ___D,
753 ::fidl_next_fuchsia_mem::wire::Data<'de>,
754 >(slot.as_mut(), decoder, ())?;
755
756 Ok(())
757 }
758
759 3 => {
760 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Package<'de>>(
761 slot.as_mut(),
762 decoder,
763 (),
764 )?;
765
766 Ok(())
767 }
768
769 4 => {
770 ::fidl_next::wire::Envelope::decode_as::<
771 ___D,
772 ::fidl_next_fuchsia_mem::wire::Data<'de>,
773 >(slot.as_mut(), decoder, ())?;
774
775 Ok(())
776 }
777
778 5 => {
779 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Context<'de>>(
780 slot.as_mut(),
781 decoder,
782 (),
783 )?;
784
785 Ok(())
786 }
787
788 6 => {
789 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint64>(
790 slot.as_mut(),
791 decoder,
792 (),
793 )?;
794
795 Ok(())
796 }
797
798 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
799 }
800 })
801 }
802 }
803
804 impl<'de> Component<'de> {
805 pub fn url(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
806 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
807 }
808
809 pub fn take_url(&mut self) -> ::core::option::Option<::fidl_next::wire::String<'de>> {
810 unsafe { Some(self.table.get_mut(1)?.take_unchecked()) }
811 }
812
813 pub fn decl(&self) -> ::core::option::Option<&::fidl_next_fuchsia_mem::wire::Data<'de>> {
814 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
815 }
816
817 pub fn take_decl(
818 &mut self,
819 ) -> ::core::option::Option<::fidl_next_fuchsia_mem::wire::Data<'de>> {
820 unsafe { Some(self.table.get_mut(2)?.take_unchecked()) }
821 }
822
823 pub fn package(&self) -> ::core::option::Option<&crate::wire::Package<'de>> {
824 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
825 }
826
827 pub fn take_package(&mut self) -> ::core::option::Option<crate::wire::Package<'de>> {
828 unsafe { Some(self.table.get_mut(3)?.take_unchecked()) }
829 }
830
831 pub fn config_values(
832 &self,
833 ) -> ::core::option::Option<&::fidl_next_fuchsia_mem::wire::Data<'de>> {
834 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
835 }
836
837 pub fn take_config_values(
838 &mut self,
839 ) -> ::core::option::Option<::fidl_next_fuchsia_mem::wire::Data<'de>> {
840 unsafe { Some(self.table.get_mut(4)?.take_unchecked()) }
841 }
842
843 pub fn resolution_context(&self) -> ::core::option::Option<&crate::wire::Context<'de>> {
844 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
845 }
846
847 pub fn take_resolution_context(
848 &mut self,
849 ) -> ::core::option::Option<crate::wire::Context<'de>> {
850 unsafe { Some(self.table.get_mut(5)?.take_unchecked()) }
851 }
852
853 pub fn abi_revision(&self) -> ::core::option::Option<&::fidl_next::wire::Uint64> {
854 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
855 }
856
857 pub fn take_abi_revision(&mut self) -> ::core::option::Option<::fidl_next::wire::Uint64> {
858 unsafe { Some(self.table.get_mut(6)?.take_unchecked()) }
859 }
860 }
861
862 impl<'de> ::core::fmt::Debug for Component<'de> {
863 fn fmt(
864 &self,
865 f: &mut ::core::fmt::Formatter<'_>,
866 ) -> ::core::result::Result<(), ::core::fmt::Error> {
867 f.debug_struct("Component")
868 .field("url", &self.url())
869 .field("decl", &self.decl())
870 .field("package", &self.package())
871 .field("config_values", &self.config_values())
872 .field("resolution_context", &self.resolution_context())
873 .field("abi_revision", &self.abi_revision())
874 .finish()
875 }
876 }
877
878 impl<'de> ::fidl_next::IntoNatural for Component<'de> {
879 type Natural = crate::natural::Component;
880 }
881
882 #[derive(Debug)]
884 #[repr(C)]
885 pub struct ResolverResolveResponse<'de> {
886 pub component: crate::wire::Component<'de>,
887 }
888
889 static_assertions::const_assert_eq!(std::mem::size_of::<ResolverResolveResponse<'_>>(), 16);
890 static_assertions::const_assert_eq!(std::mem::align_of::<ResolverResolveResponse<'_>>(), 8);
891
892 static_assertions::const_assert_eq!(
893 std::mem::offset_of!(ResolverResolveResponse<'_>, component),
894 0
895 );
896
897 impl ::fidl_next::Constrained for ResolverResolveResponse<'_> {
898 type Constraint = ();
899
900 fn validate(
901 _: ::fidl_next::Slot<'_, Self>,
902 _: Self::Constraint,
903 ) -> Result<(), ::fidl_next::ValidationError> {
904 Ok(())
905 }
906 }
907
908 unsafe impl ::fidl_next::Wire for ResolverResolveResponse<'static> {
909 type Narrowed<'de> = ResolverResolveResponse<'de>;
910
911 #[inline]
912 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
913 ::fidl_next::munge! {
914 let Self {
915 component,
916
917 } = &mut *out_;
918 }
919
920 ::fidl_next::Wire::zero_padding(component);
921 }
922 }
923
924 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ResolverResolveResponse<'de>
925 where
926 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
927 ___D: ::fidl_next::Decoder<'de>,
928 ___D: ::fidl_next::fuchsia::HandleDecoder,
929 {
930 fn decode(
931 slot_: ::fidl_next::Slot<'_, Self>,
932 decoder_: &mut ___D,
933 _: (),
934 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
935 ::fidl_next::munge! {
936 let Self {
937 mut component,
938
939 } = slot_;
940 }
941
942 let _field = component.as_mut();
943
944 ::fidl_next::Decode::decode(component.as_mut(), decoder_, ())?;
945
946 Ok(())
947 }
948 }
949
950 impl<'de> ::fidl_next::IntoNatural for ResolverResolveResponse<'de> {
951 type Natural = crate::natural::ResolverResolveResponse;
952 }
953
954 #[derive(Debug)]
956 #[repr(C)]
957 pub struct ResolverResolveWithContextResponse<'de> {
958 pub component: crate::wire::Component<'de>,
959 }
960
961 static_assertions::const_assert_eq!(
962 std::mem::size_of::<ResolverResolveWithContextResponse<'_>>(),
963 16
964 );
965 static_assertions::const_assert_eq!(
966 std::mem::align_of::<ResolverResolveWithContextResponse<'_>>(),
967 8
968 );
969
970 static_assertions::const_assert_eq!(
971 std::mem::offset_of!(ResolverResolveWithContextResponse<'_>, component),
972 0
973 );
974
975 impl ::fidl_next::Constrained for ResolverResolveWithContextResponse<'_> {
976 type Constraint = ();
977
978 fn validate(
979 _: ::fidl_next::Slot<'_, Self>,
980 _: Self::Constraint,
981 ) -> Result<(), ::fidl_next::ValidationError> {
982 Ok(())
983 }
984 }
985
986 unsafe impl ::fidl_next::Wire for ResolverResolveWithContextResponse<'static> {
987 type Narrowed<'de> = ResolverResolveWithContextResponse<'de>;
988
989 #[inline]
990 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
991 ::fidl_next::munge! {
992 let Self {
993 component,
994
995 } = &mut *out_;
996 }
997
998 ::fidl_next::Wire::zero_padding(component);
999 }
1000 }
1001
1002 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ResolverResolveWithContextResponse<'de>
1003 where
1004 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1005 ___D: ::fidl_next::Decoder<'de>,
1006 ___D: ::fidl_next::fuchsia::HandleDecoder,
1007 {
1008 fn decode(
1009 slot_: ::fidl_next::Slot<'_, Self>,
1010 decoder_: &mut ___D,
1011 _: (),
1012 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1013 ::fidl_next::munge! {
1014 let Self {
1015 mut component,
1016
1017 } = slot_;
1018 }
1019
1020 let _field = component.as_mut();
1021
1022 ::fidl_next::Decode::decode(component.as_mut(), decoder_, ())?;
1023
1024 Ok(())
1025 }
1026 }
1027
1028 impl<'de> ::fidl_next::IntoNatural for ResolverResolveWithContextResponse<'de> {
1029 type Natural = crate::natural::ResolverResolveWithContextResponse;
1030 }
1031}
1032
1033pub mod wire_optional {
1034
1035 pub use fidl_next_common_fuchsia_component_resolution::wire_optional::*;
1036}
1037
1038pub mod generic {
1039
1040 pub use fidl_next_common_fuchsia_component_resolution::generic::*;
1041
1042 pub struct ResolverResolveResponse<T0> {
1044 pub component: T0,
1045 }
1046
1047 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::ResolverResolveResponse<'static>, ___E>
1048 for ResolverResolveResponse<T0>
1049 where
1050 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1051 ___E: ::fidl_next::Encoder,
1052 ___E: ::fidl_next::fuchsia::HandleEncoder,
1053 T0: ::fidl_next::Encode<crate::wire::Component<'static>, ___E>,
1054 {
1055 #[inline]
1056 fn encode(
1057 self,
1058 encoder_: &mut ___E,
1059 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolverResolveResponse<'static>>,
1060 _: (),
1061 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1062 ::fidl_next::munge! {
1063 let crate::wire::ResolverResolveResponse {
1064 component,
1065
1066 } = out_;
1067 }
1068
1069 ::fidl_next::Encode::encode(self.component, encoder_, component, ())?;
1070
1071 Ok(())
1072 }
1073 }
1074
1075 pub struct ResolverResolveWithContextResponse<T0> {
1077 pub component: T0,
1078 }
1079
1080 unsafe impl<___E, T0>
1081 ::fidl_next::Encode<crate::wire::ResolverResolveWithContextResponse<'static>, ___E>
1082 for ResolverResolveWithContextResponse<T0>
1083 where
1084 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1085 ___E: ::fidl_next::Encoder,
1086 ___E: ::fidl_next::fuchsia::HandleEncoder,
1087 T0: ::fidl_next::Encode<crate::wire::Component<'static>, ___E>,
1088 {
1089 #[inline]
1090 fn encode(
1091 self,
1092 encoder_: &mut ___E,
1093 out_: &mut ::core::mem::MaybeUninit<
1094 crate::wire::ResolverResolveWithContextResponse<'static>,
1095 >,
1096 _: (),
1097 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1098 ::fidl_next::munge! {
1099 let crate::wire::ResolverResolveWithContextResponse {
1100 component,
1101
1102 } = out_;
1103 }
1104
1105 ::fidl_next::Encode::encode(self.component, encoder_, component, ())?;
1106
1107 Ok(())
1108 }
1109 }
1110}
1111
1112pub use self::natural::*;
1113
1114#[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"]
1116#[derive(PartialEq, Debug)]
1117pub struct Resolver;
1118
1119impl ::fidl_next::Discoverable for Resolver {
1120 const PROTOCOL_NAME: &'static str = "fuchsia.component.resolution.Resolver";
1121}
1122
1123#[cfg(target_os = "fuchsia")]
1124impl ::fidl_next::HasTransport for Resolver {
1125 type Transport = ::fidl_next::fuchsia::zx::Channel;
1126}
1127
1128pub mod resolver {
1129 pub mod prelude {
1130 pub use crate::{
1131 Resolver, ResolverClientHandler, ResolverLocalClientHandler,
1132 ResolverLocalServerHandler, ResolverServerHandler, resolver,
1133 };
1134
1135 pub use crate::natural::ResolverError;
1136
1137 pub use crate::natural::ResolverResolveRequest;
1138
1139 pub use crate::natural::ResolverResolveWithContextRequest;
1140
1141 pub use crate::natural::ResolverResolveWithContextResponse;
1142
1143 pub use crate::natural::ResolverResolveResponse;
1144 }
1145
1146 pub struct Resolve;
1147
1148 impl ::fidl_next::Method for Resolve {
1149 const ORDINAL: u64 = 6339326548187935461;
1150 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1151 ::fidl_next::protocol::Flexibility::Strict;
1152
1153 type Protocol = crate::Resolver;
1154
1155 type Request = crate::wire::ResolverResolveRequest<'static>;
1156 }
1157
1158 impl ::fidl_next::TwoWayMethod for Resolve {
1159 type Response = ::fidl_next::wire::Result<
1160 'static,
1161 crate::wire::ResolverResolveResponse<'static>,
1162 crate::wire::ResolverError,
1163 >;
1164 }
1165
1166 impl<___R> ::fidl_next::Respond<___R> for Resolve {
1167 type Output = ::core::result::Result<
1168 crate::generic::ResolverResolveResponse<___R>,
1169 ::fidl_next::never::Never,
1170 >;
1171
1172 fn respond(response: ___R) -> Self::Output {
1173 ::core::result::Result::Ok(crate::generic::ResolverResolveResponse {
1174 component: response,
1175 })
1176 }
1177 }
1178
1179 impl<___R> ::fidl_next::RespondErr<___R> for Resolve {
1180 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1181
1182 fn respond_err(response: ___R) -> Self::Output {
1183 ::core::result::Result::Err(response)
1184 }
1185 }
1186
1187 pub struct ResolveWithContext;
1188
1189 impl ::fidl_next::Method for ResolveWithContext {
1190 const ORDINAL: u64 = 5576776708309151933;
1191 const FLEXIBILITY: ::fidl_next::protocol::Flexibility =
1192 ::fidl_next::protocol::Flexibility::Strict;
1193
1194 type Protocol = crate::Resolver;
1195
1196 type Request = crate::wire::ResolverResolveWithContextRequest<'static>;
1197 }
1198
1199 impl ::fidl_next::TwoWayMethod for ResolveWithContext {
1200 type Response = ::fidl_next::wire::Result<
1201 'static,
1202 crate::wire::ResolverResolveWithContextResponse<'static>,
1203 crate::wire::ResolverError,
1204 >;
1205 }
1206
1207 impl<___R> ::fidl_next::Respond<___R> for ResolveWithContext {
1208 type Output = ::core::result::Result<
1209 crate::generic::ResolverResolveWithContextResponse<___R>,
1210 ::fidl_next::never::Never,
1211 >;
1212
1213 fn respond(response: ___R) -> Self::Output {
1214 ::core::result::Result::Ok(crate::generic::ResolverResolveWithContextResponse {
1215 component: response,
1216 })
1217 }
1218 }
1219
1220 impl<___R> ::fidl_next::RespondErr<___R> for ResolveWithContext {
1221 type Output = ::core::result::Result<::fidl_next::never::Never, ___R>;
1222
1223 fn respond_err(response: ___R) -> Self::Output {
1224 ::core::result::Result::Err(response)
1225 }
1226 }
1227
1228 mod ___detail {
1229 unsafe impl<___T> ::fidl_next::HasConnectionHandles<___T> for crate::Resolver
1230 where
1231 ___T: ::fidl_next::Transport,
1232 {
1233 type Client = ResolverClient<___T>;
1234 type Server = ResolverServer<___T>;
1235 }
1236
1237 #[repr(transparent)]
1239 pub struct ResolverClient<___T: ::fidl_next::Transport> {
1240 #[allow(dead_code)]
1241 client: ::fidl_next::protocol::Client<___T>,
1242 }
1243
1244 impl<___T> ResolverClient<___T>
1245 where
1246 ___T: ::fidl_next::Transport,
1247 {
1248 #[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"]
1249 pub fn resolve(
1250 &self,
1251
1252 component_url: impl ::fidl_next::Encode<
1253 ::fidl_next::wire::String<'static>,
1254 <___T as ::fidl_next::Transport>::SendBuffer,
1255 >,
1256 ) -> ::fidl_next::TwoWayFuture<'_, super::Resolve, ___T>
1257 where
1258 <___T as ::fidl_next::Transport>::SendBuffer:
1259 ::fidl_next::encoder::InternalHandleEncoder,
1260 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1261 {
1262 self.resolve_with(crate::generic::ResolverResolveRequest { component_url })
1263 }
1264
1265 #[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"]
1266 pub fn resolve_with<___R>(
1267 &self,
1268 request: ___R,
1269 ) -> ::fidl_next::TwoWayFuture<'_, super::Resolve, ___T>
1270 where
1271 ___R: ::fidl_next::Encode<
1272 crate::wire::ResolverResolveRequest<'static>,
1273 <___T as ::fidl_next::Transport>::SendBuffer,
1274 >,
1275 {
1276 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1277 6339326548187935461,
1278 <super::Resolve as ::fidl_next::Method>::FLEXIBILITY,
1279 request,
1280 ))
1281 }
1282
1283 #[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"]
1284 pub fn resolve_with_context(
1285 &self,
1286
1287 component_url: impl ::fidl_next::Encode<
1288 ::fidl_next::wire::String<'static>,
1289 <___T as ::fidl_next::Transport>::SendBuffer,
1290 >,
1291
1292 context: impl ::fidl_next::Encode<
1293 crate::wire::Context<'static>,
1294 <___T as ::fidl_next::Transport>::SendBuffer,
1295 >,
1296 ) -> ::fidl_next::TwoWayFuture<'_, super::ResolveWithContext, ___T>
1297 where
1298 <___T as ::fidl_next::Transport>::SendBuffer:
1299 ::fidl_next::encoder::InternalHandleEncoder,
1300 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1301 {
1302 self.resolve_with_context_with(crate::generic::ResolverResolveWithContextRequest {
1303 component_url,
1304
1305 context,
1306 })
1307 }
1308
1309 #[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"]
1310 pub fn resolve_with_context_with<___R>(
1311 &self,
1312 request: ___R,
1313 ) -> ::fidl_next::TwoWayFuture<'_, super::ResolveWithContext, ___T>
1314 where
1315 ___R: ::fidl_next::Encode<
1316 crate::wire::ResolverResolveWithContextRequest<'static>,
1317 <___T as ::fidl_next::Transport>::SendBuffer,
1318 >,
1319 {
1320 ::fidl_next::TwoWayFuture::from_untyped(self.client.send_two_way(
1321 5576776708309151933,
1322 <super::ResolveWithContext as ::fidl_next::Method>::FLEXIBILITY,
1323 request,
1324 ))
1325 }
1326 }
1327
1328 #[repr(transparent)]
1330 pub struct ResolverServer<___T: ::fidl_next::Transport> {
1331 server: ::fidl_next::protocol::Server<___T>,
1332 }
1333
1334 impl<___T> ResolverServer<___T> where ___T: ::fidl_next::Transport {}
1335 }
1336}
1337
1338#[diagnostic::on_unimplemented(
1339 note = "If {Self} implements the non-local ResolverClientHandler trait, use `spawn_as_local` or the `Local` adapter type"
1340)]
1341
1342pub trait ResolverLocalClientHandler<
1346 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1347 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1348>
1349{
1350 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1351 ::core::future::ready(())
1352 }
1353}
1354
1355impl<___H, ___T> ::fidl_next::DispatchLocalClientMessage<___H, ___T> for Resolver
1356where
1357 ___H: ResolverLocalClientHandler<___T>,
1358 ___T: ::fidl_next::Transport,
1359{
1360 async fn on_event(
1361 handler: &mut ___H,
1362 mut message: ::fidl_next::Message<___T>,
1363 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1364 match *message.header().ordinal {
1365 ordinal => {
1366 handler.on_unknown_interaction(ordinal).await;
1367 if ::core::matches!(
1368 message.header().flexibility(),
1369 ::fidl_next::protocol::Flexibility::Strict
1370 ) {
1371 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1372 } else {
1373 Ok(())
1374 }
1375 }
1376 }
1377 }
1378}
1379
1380#[diagnostic::on_unimplemented(
1381 note = "If {Self} implements the non-local ResolverServerHandler trait, use `spawn_as_local` or the `Local` adapter type"
1382)]
1383
1384pub trait ResolverLocalServerHandler<
1388 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1389 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1390>
1391{
1392 #[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"]
1393 fn resolve(
1394 &mut self,
1395
1396 request: ::fidl_next::Request<resolver::Resolve, ___T>,
1397
1398 responder: ::fidl_next::Responder<resolver::Resolve, ___T>,
1399 ) -> impl ::core::future::Future<Output = ()>;
1400
1401 #[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"]
1402 fn resolve_with_context(
1403 &mut self,
1404
1405 request: ::fidl_next::Request<resolver::ResolveWithContext, ___T>,
1406
1407 responder: ::fidl_next::Responder<resolver::ResolveWithContext, ___T>,
1408 ) -> impl ::core::future::Future<Output = ()>;
1409
1410 fn on_unknown_interaction(&mut self, ordinal: u64) -> impl ::core::future::Future<Output = ()> {
1411 ::core::future::ready(())
1412 }
1413}
1414
1415impl<___H, ___T> ::fidl_next::DispatchLocalServerMessage<___H, ___T> for Resolver
1416where
1417 ___H: ResolverLocalServerHandler<___T>,
1418 ___T: ::fidl_next::Transport,
1419 for<'de> crate::wire::ResolverResolveRequest<'de>: ::fidl_next::Decode<
1420 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1421 Constraint = (),
1422 >,
1423 for<'de> crate::wire::ResolverResolveWithContextRequest<'de>: ::fidl_next::Decode<
1424 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1425 Constraint = (),
1426 >,
1427{
1428 async fn on_one_way(
1429 handler: &mut ___H,
1430 mut message: ::fidl_next::Message<___T>,
1431 ) -> ::core::result::Result<
1432 (),
1433 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1434 > {
1435 match *message.header().ordinal {
1436 ordinal => {
1437 handler.on_unknown_interaction(ordinal).await;
1438 if ::core::matches!(
1439 message.header().flexibility(),
1440 ::fidl_next::protocol::Flexibility::Strict
1441 ) {
1442 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1443 } else {
1444 Ok(())
1445 }
1446 }
1447 }
1448 }
1449
1450 async fn on_two_way(
1451 handler: &mut ___H,
1452 mut message: ::fidl_next::Message<___T>,
1453 responder: ::fidl_next::protocol::Responder<___T>,
1454 ) -> ::core::result::Result<
1455 (),
1456 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1457 > {
1458 match *message.header().ordinal {
1459 6339326548187935461 => {
1460 let responder = ::fidl_next::Responder::from_untyped(responder);
1461
1462 match ::fidl_next::AsDecoderExt::into_decoded(message) {
1463 Ok(decoded) => {
1464 handler
1465 .resolve(::fidl_next::Request::from_decoded(decoded), responder)
1466 .await;
1467 Ok(())
1468 }
1469 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1470 ordinal: 6339326548187935461,
1471 error,
1472 }),
1473 }
1474 }
1475
1476 5576776708309151933 => {
1477 let responder = ::fidl_next::Responder::from_untyped(responder);
1478
1479 match ::fidl_next::AsDecoderExt::into_decoded(message) {
1480 Ok(decoded) => {
1481 handler
1482 .resolve_with_context(
1483 ::fidl_next::Request::from_decoded(decoded),
1484 responder,
1485 )
1486 .await;
1487 Ok(())
1488 }
1489 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1490 ordinal: 5576776708309151933,
1491 error,
1492 }),
1493 }
1494 }
1495
1496 ordinal => {
1497 handler.on_unknown_interaction(ordinal).await;
1498 if ::core::matches!(
1499 message.header().flexibility(),
1500 ::fidl_next::protocol::Flexibility::Strict
1501 ) {
1502 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1503 } else {
1504 responder
1505 .respond_framework_error(
1506 ordinal,
1507 ::fidl_next::FrameworkError::UnknownMethod,
1508 )
1509 .expect("encoding a framework error should never fail")
1510 .await?;
1511 Ok(())
1512 }
1513 }
1514 }
1515 }
1516}
1517
1518pub trait ResolverClientHandler<
1522 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1523 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1524>
1525{
1526 fn on_unknown_interaction(
1527 &mut self,
1528 ordinal: u64,
1529 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1530 ::core::future::ready(())
1531 }
1532}
1533
1534impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for Resolver
1535where
1536 ___H: ResolverClientHandler<___T> + ::core::marker::Send,
1537 ___T: ::fidl_next::Transport,
1538{
1539 async fn on_event(
1540 handler: &mut ___H,
1541 mut message: ::fidl_next::Message<___T>,
1542 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1543 match *message.header().ordinal {
1544 ordinal => {
1545 handler.on_unknown_interaction(ordinal).await;
1546 if ::core::matches!(
1547 message.header().flexibility(),
1548 ::fidl_next::protocol::Flexibility::Strict
1549 ) {
1550 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1551 } else {
1552 Ok(())
1553 }
1554 }
1555 }
1556 }
1557}
1558
1559pub trait ResolverServerHandler<
1563 #[cfg(target_os = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1564 #[cfg(not(target_os = "fuchsia"))] ___T: ::fidl_next::Transport,
1565>
1566{
1567 #[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"]
1568 fn resolve(
1569 &mut self,
1570
1571 request: ::fidl_next::Request<resolver::Resolve, ___T>,
1572
1573 responder: ::fidl_next::Responder<resolver::Resolve, ___T>,
1574 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1575
1576 #[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"]
1577 fn resolve_with_context(
1578 &mut self,
1579
1580 request: ::fidl_next::Request<resolver::ResolveWithContext, ___T>,
1581
1582 responder: ::fidl_next::Responder<resolver::ResolveWithContext, ___T>,
1583 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1584
1585 fn on_unknown_interaction(
1586 &mut self,
1587 ordinal: u64,
1588 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send {
1589 ::core::future::ready(())
1590 }
1591}
1592
1593impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for Resolver
1594where
1595 ___H: ResolverServerHandler<___T> + ::core::marker::Send,
1596 ___T: ::fidl_next::Transport,
1597 for<'de> crate::wire::ResolverResolveRequest<'de>: ::fidl_next::Decode<
1598 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1599 Constraint = (),
1600 >,
1601 for<'de> crate::wire::ResolverResolveWithContextRequest<'de>: ::fidl_next::Decode<
1602 <<___T as ::fidl_next::Transport>::RecvBuffer as ::fidl_next::AsDecoder<'de>>::Decoder,
1603 Constraint = (),
1604 >,
1605{
1606 async fn on_one_way(
1607 handler: &mut ___H,
1608 mut message: ::fidl_next::Message<___T>,
1609 ) -> ::core::result::Result<
1610 (),
1611 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1612 > {
1613 match *message.header().ordinal {
1614 ordinal => {
1615 handler.on_unknown_interaction(ordinal).await;
1616 if ::core::matches!(
1617 message.header().flexibility(),
1618 ::fidl_next::protocol::Flexibility::Strict
1619 ) {
1620 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1621 } else {
1622 Ok(())
1623 }
1624 }
1625 }
1626 }
1627
1628 async fn on_two_way(
1629 handler: &mut ___H,
1630 mut message: ::fidl_next::Message<___T>,
1631 responder: ::fidl_next::protocol::Responder<___T>,
1632 ) -> ::core::result::Result<
1633 (),
1634 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1635 > {
1636 match *message.header().ordinal {
1637 6339326548187935461 => {
1638 let responder = ::fidl_next::Responder::from_untyped(responder);
1639
1640 match ::fidl_next::AsDecoderExt::into_decoded(message) {
1641 Ok(decoded) => {
1642 handler
1643 .resolve(::fidl_next::Request::from_decoded(decoded), responder)
1644 .await;
1645 Ok(())
1646 }
1647 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1648 ordinal: 6339326548187935461,
1649 error,
1650 }),
1651 }
1652 }
1653
1654 5576776708309151933 => {
1655 let responder = ::fidl_next::Responder::from_untyped(responder);
1656
1657 match ::fidl_next::AsDecoderExt::into_decoded(message) {
1658 Ok(decoded) => {
1659 handler
1660 .resolve_with_context(
1661 ::fidl_next::Request::from_decoded(decoded),
1662 responder,
1663 )
1664 .await;
1665 Ok(())
1666 }
1667 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1668 ordinal: 5576776708309151933,
1669 error,
1670 }),
1671 }
1672 }
1673
1674 ordinal => {
1675 handler.on_unknown_interaction(ordinal).await;
1676 if ::core::matches!(
1677 message.header().flexibility(),
1678 ::fidl_next::protocol::Flexibility::Strict
1679 ) {
1680 Err(::fidl_next::ProtocolError::UnknownOrdinal(ordinal))
1681 } else {
1682 responder
1683 .respond_framework_error(
1684 ordinal,
1685 ::fidl_next::FrameworkError::UnknownMethod,
1686 )
1687 .expect("encoding a framework error should never fail")
1688 .await?;
1689 Ok(())
1690 }
1691 }
1692 }
1693 }
1694}
1695
1696impl<___T> ResolverClientHandler<___T> for ::fidl_next::IgnoreEvents
1697where
1698 ___T: ::fidl_next::Transport,
1699{
1700 async fn on_unknown_interaction(&mut self, _: u64) {}
1701}
1702
1703impl<___H, ___T> ResolverLocalClientHandler<___T> for ::fidl_next::Local<___H>
1704where
1705 ___H: ResolverClientHandler<___T>,
1706 ___T: ::fidl_next::Transport,
1707{
1708 async fn on_unknown_interaction(&mut self, ordinal: u64) {
1709 ___H::on_unknown_interaction(&mut self.0, ordinal).await
1710 }
1711}
1712
1713impl<___H, ___T> ResolverLocalServerHandler<___T> for ::fidl_next::Local<___H>
1714where
1715 ___H: ResolverServerHandler<___T>,
1716 ___T: ::fidl_next::Transport,
1717{
1718 async fn resolve(
1719 &mut self,
1720
1721 request: ::fidl_next::Request<resolver::Resolve, ___T>,
1722
1723 responder: ::fidl_next::Responder<resolver::Resolve, ___T>,
1724 ) {
1725 ___H::resolve(&mut self.0, request, responder).await
1726 }
1727
1728 async fn resolve_with_context(
1729 &mut self,
1730
1731 request: ::fidl_next::Request<resolver::ResolveWithContext, ___T>,
1732
1733 responder: ::fidl_next::Responder<resolver::ResolveWithContext, ___T>,
1734 ) {
1735 ___H::resolve_with_context(&mut self.0, request, responder).await
1736 }
1737
1738 async fn on_unknown_interaction(&mut self, ordinal: u64) {
1739 ___H::on_unknown_interaction(&mut self.0, ordinal).await
1740 }
1741}
1742
1743pub use fidl_next_common_fuchsia_component_resolution::*;