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