1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5pub mod natural {
6
7 #[doc = " The kinds of offers that can target the children in a collection.\n"]
8 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9 #[repr(u32)]
10 pub enum AllowedOffers {
11 StaticOnly = 1,
12 StaticAndDynamic = 2,
13 }
14 impl ::core::convert::TryFrom<u32> for AllowedOffers {
15 type Error = ::fidl_next::UnknownStrictEnumMemberError;
16 fn try_from(
17 value: u32,
18 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
19 match value {
20 1 => Ok(Self::StaticOnly),
21 2 => Ok(Self::StaticAndDynamic),
22
23 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
24 }
25 }
26 }
27
28 unsafe impl<___E> ::fidl_next::Encode<crate::wire::AllowedOffers, ___E> for AllowedOffers
29 where
30 ___E: ?Sized,
31 {
32 #[inline]
33 fn encode(
34 self,
35 encoder: &mut ___E,
36 out: &mut ::core::mem::MaybeUninit<crate::wire::AllowedOffers>,
37 _: (),
38 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
39 ::fidl_next::Encode::encode(&self, encoder, out, ())
40 }
41 }
42
43 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::AllowedOffers, ___E> for &'a AllowedOffers
44 where
45 ___E: ?Sized,
46 {
47 #[inline]
48 fn encode(
49 self,
50 encoder: &mut ___E,
51 out: &mut ::core::mem::MaybeUninit<crate::wire::AllowedOffers>,
52 _: (),
53 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
54 ::fidl_next::munge!(let crate::wire::AllowedOffers { value } = out);
55 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
56 AllowedOffers::StaticOnly => 1,
57
58 AllowedOffers::StaticAndDynamic => 2,
59 }));
60
61 Ok(())
62 }
63 }
64
65 impl ::core::convert::From<crate::wire::AllowedOffers> for AllowedOffers {
66 fn from(wire: crate::wire::AllowedOffers) -> Self {
67 match u32::from(wire.value) {
68 1 => Self::StaticOnly,
69
70 2 => Self::StaticAndDynamic,
71
72 _ => unsafe { ::core::hint::unreachable_unchecked() },
73 }
74 }
75 }
76
77 impl ::fidl_next::FromWire<crate::wire::AllowedOffers> for AllowedOffers {
78 #[inline]
79 fn from_wire(wire: crate::wire::AllowedOffers) -> Self {
80 Self::from(wire)
81 }
82 }
83
84 impl ::fidl_next::FromWireRef<crate::wire::AllowedOffers> for AllowedOffers {
85 #[inline]
86 fn from_wire_ref(wire: &crate::wire::AllowedOffers) -> Self {
87 Self::from(*wire)
88 }
89 }
90
91 #[doc = " Describes the expected availability of the capability.\n\n Some capabilities may not be present on all system configurations. In those\n cases, the availability will be declared as `OPTIONAL` along the chains of\n exposes/offers/uses, and the capability would be routed from `void` on\n system configurations where it does not make sense to route or provide a\n particular capability (e.g. graphical capabilities on a headless system).\n"]
92 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
93 #[repr(u32)]
94 pub enum Availability {
95 Required = 1,
96 Optional = 2,
97 SameAsTarget = 3,
98 Transitional = 4,
99 }
100 impl ::core::convert::TryFrom<u32> for Availability {
101 type Error = ::fidl_next::UnknownStrictEnumMemberError;
102 fn try_from(
103 value: u32,
104 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
105 match value {
106 1 => Ok(Self::Required),
107 2 => Ok(Self::Optional),
108 3 => Ok(Self::SameAsTarget),
109 4 => Ok(Self::Transitional),
110
111 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
112 }
113 }
114 }
115
116 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Availability, ___E> for Availability
117 where
118 ___E: ?Sized,
119 {
120 #[inline]
121 fn encode(
122 self,
123 encoder: &mut ___E,
124 out: &mut ::core::mem::MaybeUninit<crate::wire::Availability>,
125 _: (),
126 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
127 ::fidl_next::Encode::encode(&self, encoder, out, ())
128 }
129 }
130
131 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Availability, ___E> for &'a Availability
132 where
133 ___E: ?Sized,
134 {
135 #[inline]
136 fn encode(
137 self,
138 encoder: &mut ___E,
139 out: &mut ::core::mem::MaybeUninit<crate::wire::Availability>,
140 _: (),
141 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
142 ::fidl_next::munge!(let crate::wire::Availability { value } = out);
143 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
144 Availability::Required => 1,
145
146 Availability::Optional => 2,
147
148 Availability::SameAsTarget => 3,
149
150 Availability::Transitional => 4,
151 }));
152
153 Ok(())
154 }
155 }
156
157 impl ::core::convert::From<crate::wire::Availability> for Availability {
158 fn from(wire: crate::wire::Availability) -> Self {
159 match u32::from(wire.value) {
160 1 => Self::Required,
161
162 2 => Self::Optional,
163
164 3 => Self::SameAsTarget,
165
166 4 => Self::Transitional,
167
168 _ => unsafe { ::core::hint::unreachable_unchecked() },
169 }
170 }
171 }
172
173 impl ::fidl_next::FromWire<crate::wire::Availability> for Availability {
174 #[inline]
175 fn from_wire(wire: crate::wire::Availability) -> Self {
176 Self::from(wire)
177 }
178 }
179
180 impl ::fidl_next::FromWireRef<crate::wire::Availability> for Availability {
181 #[inline]
182 fn from_wire_ref(wire: &crate::wire::Availability) -> Self {
183 Self::from(*wire)
184 }
185 }
186
187 pub type Name = ::std::string::String;
188
189 #[doc = " Declares a service capability backed by this component.\n\n To learn more about services, see:\n https://fuchsia.dev/fuchsia-src/glossary#service\n"]
190 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
191 pub struct Service {
192 pub name: ::core::option::Option<::std::string::String>,
193
194 pub source_path: ::core::option::Option<::std::string::String>,
195 }
196
197 impl Service {
198 fn __max_ordinal(&self) -> usize {
199 if self.source_path.is_some() {
200 return 2;
201 }
202
203 if self.name.is_some() {
204 return 1;
205 }
206
207 0
208 }
209 }
210
211 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Service<'static>, ___E> for Service
212 where
213 ___E: ::fidl_next::Encoder + ?Sized,
214 {
215 #[inline]
216 fn encode(
217 mut self,
218 encoder: &mut ___E,
219 out: &mut ::core::mem::MaybeUninit<crate::wire::Service<'static>>,
220 _: (),
221 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
222 ::fidl_next::munge!(let crate::wire::Service { table } = out);
223
224 let max_ord = self.__max_ordinal();
225
226 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
227 ::fidl_next::Wire::zero_padding(&mut out);
228
229 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
230 ::fidl_next::wire::Envelope,
231 >(encoder, max_ord);
232
233 for i in 1..=max_ord {
234 match i {
235 2 => {
236 if let Some(value) = self.source_path.take() {
237 ::fidl_next::wire::Envelope::encode_value::<
238 ::fidl_next::wire::String<'static>,
239 ___E,
240 >(
241 value, preallocated.encoder, &mut out, 1024
242 )?;
243 } else {
244 ::fidl_next::wire::Envelope::encode_zero(&mut out)
245 }
246 }
247
248 1 => {
249 if let Some(value) = self.name.take() {
250 ::fidl_next::wire::Envelope::encode_value::<
251 ::fidl_next::wire::String<'static>,
252 ___E,
253 >(
254 value, preallocated.encoder, &mut out, 100
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 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Service<'static>, ___E> for &'a Service
275 where
276 ___E: ::fidl_next::Encoder + ?Sized,
277 {
278 #[inline]
279 fn encode(
280 self,
281 encoder: &mut ___E,
282 out: &mut ::core::mem::MaybeUninit<crate::wire::Service<'static>>,
283 _: (),
284 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
285 ::fidl_next::munge!(let crate::wire::Service { table } = out);
286
287 let max_ord = self.__max_ordinal();
288
289 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
290 ::fidl_next::Wire::zero_padding(&mut out);
291
292 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
293 ::fidl_next::wire::Envelope,
294 >(encoder, max_ord);
295
296 for i in 1..=max_ord {
297 match i {
298 2 => {
299 if let Some(value) = &self.source_path {
300 ::fidl_next::wire::Envelope::encode_value::<
301 ::fidl_next::wire::String<'static>,
302 ___E,
303 >(
304 value, preallocated.encoder, &mut out, 1024
305 )?;
306 } else {
307 ::fidl_next::wire::Envelope::encode_zero(&mut out)
308 }
309 }
310
311 1 => {
312 if let Some(value) = &self.name {
313 ::fidl_next::wire::Envelope::encode_value::<
314 ::fidl_next::wire::String<'static>,
315 ___E,
316 >(
317 value, preallocated.encoder, &mut out, 100
318 )?;
319 } else {
320 ::fidl_next::wire::Envelope::encode_zero(&mut out)
321 }
322 }
323
324 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
325 }
326 unsafe {
327 preallocated.write_next(out.assume_init_ref());
328 }
329 }
330
331 ::fidl_next::wire::Table::encode_len(table, max_ord);
332
333 Ok(())
334 }
335 }
336
337 impl<'de> ::fidl_next::FromWire<crate::wire::Service<'de>> for Service {
338 #[inline]
339 fn from_wire(wire_: crate::wire::Service<'de>) -> Self {
340 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
341
342 let name = wire_.table.get(1);
343
344 let source_path = wire_.table.get(2);
345
346 Self {
347 name: name.map(|envelope| {
348 ::fidl_next::FromWire::from_wire(unsafe {
349 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
350 })
351 }),
352
353 source_path: source_path.map(|envelope| {
354 ::fidl_next::FromWire::from_wire(unsafe {
355 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
356 })
357 }),
358 }
359 }
360 }
361
362 impl<'de> ::fidl_next::FromWireRef<crate::wire::Service<'de>> for Service {
363 #[inline]
364 fn from_wire_ref(wire: &crate::wire::Service<'de>) -> Self {
365 Self {
366 name: wire.table.get(1).map(|envelope| {
367 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
368 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
369 })
370 }),
371
372 source_path: wire.table.get(2).map(|envelope| {
373 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
374 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
375 })
376 }),
377 }
378 }
379 }
380
381 #[doc = " Declares a directory capability backed by this component.\n\n To learn more about directories, see:\n https://fuchsia.dev/fuchsia-src/glossary#directory\n"]
382 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
383 pub struct Directory {
384 pub name: ::core::option::Option<::std::string::String>,
385
386 pub source_path: ::core::option::Option<::std::string::String>,
387
388 pub rights: ::core::option::Option<::fidl_next_common_fuchsia_io::natural::Operations>,
389 }
390
391 impl Directory {
392 fn __max_ordinal(&self) -> usize {
393 if self.rights.is_some() {
394 return 3;
395 }
396
397 if self.source_path.is_some() {
398 return 2;
399 }
400
401 if self.name.is_some() {
402 return 1;
403 }
404
405 0
406 }
407 }
408
409 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Directory<'static>, ___E> for Directory
410 where
411 ___E: ::fidl_next::Encoder + ?Sized,
412 {
413 #[inline]
414 fn encode(
415 mut self,
416 encoder: &mut ___E,
417 out: &mut ::core::mem::MaybeUninit<crate::wire::Directory<'static>>,
418 _: (),
419 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
420 ::fidl_next::munge!(let crate::wire::Directory { table } = out);
421
422 let max_ord = self.__max_ordinal();
423
424 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
425 ::fidl_next::Wire::zero_padding(&mut out);
426
427 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
428 ::fidl_next::wire::Envelope,
429 >(encoder, max_ord);
430
431 for i in 1..=max_ord {
432 match i {
433 3 => {
434 if let Some(value) = self.rights.take() {
435 ::fidl_next::wire::Envelope::encode_value::<
436 ::fidl_next_common_fuchsia_io::wire::Operations,
437 ___E,
438 >(
439 value, preallocated.encoder, &mut out, ()
440 )?;
441 } else {
442 ::fidl_next::wire::Envelope::encode_zero(&mut out)
443 }
444 }
445
446 2 => {
447 if let Some(value) = self.source_path.take() {
448 ::fidl_next::wire::Envelope::encode_value::<
449 ::fidl_next::wire::String<'static>,
450 ___E,
451 >(
452 value, preallocated.encoder, &mut out, 1024
453 )?;
454 } else {
455 ::fidl_next::wire::Envelope::encode_zero(&mut out)
456 }
457 }
458
459 1 => {
460 if let Some(value) = self.name.take() {
461 ::fidl_next::wire::Envelope::encode_value::<
462 ::fidl_next::wire::String<'static>,
463 ___E,
464 >(
465 value, preallocated.encoder, &mut out, 100
466 )?;
467 } else {
468 ::fidl_next::wire::Envelope::encode_zero(&mut out)
469 }
470 }
471
472 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
473 }
474 unsafe {
475 preallocated.write_next(out.assume_init_ref());
476 }
477 }
478
479 ::fidl_next::wire::Table::encode_len(table, max_ord);
480
481 Ok(())
482 }
483 }
484
485 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Directory<'static>, ___E> for &'a Directory
486 where
487 ___E: ::fidl_next::Encoder + ?Sized,
488 {
489 #[inline]
490 fn encode(
491 self,
492 encoder: &mut ___E,
493 out: &mut ::core::mem::MaybeUninit<crate::wire::Directory<'static>>,
494 _: (),
495 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
496 ::fidl_next::munge!(let crate::wire::Directory { table } = out);
497
498 let max_ord = self.__max_ordinal();
499
500 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
501 ::fidl_next::Wire::zero_padding(&mut out);
502
503 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
504 ::fidl_next::wire::Envelope,
505 >(encoder, max_ord);
506
507 for i in 1..=max_ord {
508 match i {
509 3 => {
510 if let Some(value) = &self.rights {
511 ::fidl_next::wire::Envelope::encode_value::<
512 ::fidl_next_common_fuchsia_io::wire::Operations,
513 ___E,
514 >(
515 value, preallocated.encoder, &mut out, ()
516 )?;
517 } else {
518 ::fidl_next::wire::Envelope::encode_zero(&mut out)
519 }
520 }
521
522 2 => {
523 if let Some(value) = &self.source_path {
524 ::fidl_next::wire::Envelope::encode_value::<
525 ::fidl_next::wire::String<'static>,
526 ___E,
527 >(
528 value, preallocated.encoder, &mut out, 1024
529 )?;
530 } else {
531 ::fidl_next::wire::Envelope::encode_zero(&mut out)
532 }
533 }
534
535 1 => {
536 if let Some(value) = &self.name {
537 ::fidl_next::wire::Envelope::encode_value::<
538 ::fidl_next::wire::String<'static>,
539 ___E,
540 >(
541 value, preallocated.encoder, &mut out, 100
542 )?;
543 } else {
544 ::fidl_next::wire::Envelope::encode_zero(&mut out)
545 }
546 }
547
548 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
549 }
550 unsafe {
551 preallocated.write_next(out.assume_init_ref());
552 }
553 }
554
555 ::fidl_next::wire::Table::encode_len(table, max_ord);
556
557 Ok(())
558 }
559 }
560
561 impl<'de> ::fidl_next::FromWire<crate::wire::Directory<'de>> for Directory {
562 #[inline]
563 fn from_wire(wire_: crate::wire::Directory<'de>) -> Self {
564 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
565
566 let name = wire_.table.get(1);
567
568 let source_path = wire_.table.get(2);
569
570 let rights = wire_.table.get(3);
571
572 Self {
573 name: name.map(|envelope| {
574 ::fidl_next::FromWire::from_wire(unsafe {
575 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
576 })
577 }),
578
579 source_path: source_path.map(|envelope| {
580 ::fidl_next::FromWire::from_wire(unsafe {
581 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
582 })
583 }),
584
585 rights: rights.map(|envelope| {
586 ::fidl_next::FromWire::from_wire(unsafe {
587 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
588 })
589 }),
590 }
591 }
592 }
593
594 impl<'de> ::fidl_next::FromWireRef<crate::wire::Directory<'de>> for Directory {
595 #[inline]
596 fn from_wire_ref(wire: &crate::wire::Directory<'de>) -> Self {
597 Self {
598 name: wire.table.get(1).map(|envelope| {
599 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
600 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
601 })
602 }),
603
604 source_path: wire.table.get(2).map(|envelope| {
605 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
606 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
607 })
608 }),
609
610 rights: wire.table.get(3).map(|envelope| {
611 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
612 envelope
613 .deref_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
614 })
615 }),
616 }
617 }
618 }
619
620 #[doc = " A reference to a component\'s parent instance.\n"]
621 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
622 #[repr(C)]
623 pub struct ParentRef {}
624
625 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ParentRef, ___E> for ParentRef
626 where
627 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
628 {
629 #[inline]
630 fn encode(
631 self,
632 encoder_: &mut ___E,
633 out_: &mut ::core::mem::MaybeUninit<crate::wire::ParentRef>,
634 _: (),
635 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
636 ::fidl_next::munge! {
637 let crate::wire::ParentRef {
638
639 _empty,
640
641 } = out_;
642 }
643
644 let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
645
646 Ok(())
647 }
648 }
649
650 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ParentRef, ___E> for &'a ParentRef
651 where
652 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
653 {
654 #[inline]
655 fn encode(
656 self,
657 encoder_: &mut ___E,
658 out_: &mut ::core::mem::MaybeUninit<crate::wire::ParentRef>,
659 _: (),
660 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
661 ::fidl_next::munge! {
662 let crate::wire::ParentRef {
663
664 _empty,
665
666
667 } = out_;
668 }
669
670 let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
671
672 Ok(())
673 }
674 }
675
676 unsafe impl<___E>
677 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::ParentRef>, ___E>
678 for ParentRef
679 where
680 ___E: ::fidl_next::Encoder + ?Sized,
681 ParentRef: ::fidl_next::Encode<crate::wire::ParentRef, ___E>,
682 {
683 #[inline]
684 fn encode_option(
685 this: ::core::option::Option<Self>,
686 encoder: &mut ___E,
687 out: &mut ::core::mem::MaybeUninit<
688 ::fidl_next::wire::Box<'static, crate::wire::ParentRef>,
689 >,
690 _: (),
691 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
692 if let Some(inner) = this {
693 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
694 ::fidl_next::wire::Box::encode_present(out);
695 } else {
696 ::fidl_next::wire::Box::encode_absent(out);
697 }
698
699 Ok(())
700 }
701 }
702
703 unsafe impl<'a, ___E>
704 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::ParentRef>, ___E>
705 for &'a ParentRef
706 where
707 ___E: ::fidl_next::Encoder + ?Sized,
708 &'a ParentRef: ::fidl_next::Encode<crate::wire::ParentRef, ___E>,
709 {
710 #[inline]
711 fn encode_option(
712 this: ::core::option::Option<Self>,
713 encoder: &mut ___E,
714 out: &mut ::core::mem::MaybeUninit<
715 ::fidl_next::wire::Box<'static, crate::wire::ParentRef>,
716 >,
717 _: (),
718 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
719 if let Some(inner) = this {
720 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
721 ::fidl_next::wire::Box::encode_present(out);
722 } else {
723 ::fidl_next::wire::Box::encode_absent(out);
724 }
725
726 Ok(())
727 }
728 }
729
730 impl ::fidl_next::FromWire<crate::wire::ParentRef> for ParentRef {
731 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::ParentRef, Self> =
732 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
733
734 #[inline]
735 fn from_wire(wire: crate::wire::ParentRef) -> Self {
736 Self {}
737 }
738 }
739
740 impl ::fidl_next::FromWireRef<crate::wire::ParentRef> for ParentRef {
741 #[inline]
742 fn from_wire_ref(wire: &crate::wire::ParentRef) -> Self {
743 Self {}
744 }
745 }
746
747 #[doc = " A reference to the component itself.\n"]
748 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
749 #[repr(C)]
750 pub struct SelfRef {}
751
752 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SelfRef, ___E> for SelfRef
753 where
754 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
755 {
756 #[inline]
757 fn encode(
758 self,
759 encoder_: &mut ___E,
760 out_: &mut ::core::mem::MaybeUninit<crate::wire::SelfRef>,
761 _: (),
762 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
763 ::fidl_next::munge! {
764 let crate::wire::SelfRef {
765
766 _empty,
767
768 } = out_;
769 }
770
771 let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
772
773 Ok(())
774 }
775 }
776
777 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SelfRef, ___E> for &'a SelfRef
778 where
779 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
780 {
781 #[inline]
782 fn encode(
783 self,
784 encoder_: &mut ___E,
785 out_: &mut ::core::mem::MaybeUninit<crate::wire::SelfRef>,
786 _: (),
787 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
788 ::fidl_next::munge! {
789 let crate::wire::SelfRef {
790
791 _empty,
792
793
794 } = out_;
795 }
796
797 let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
798
799 Ok(())
800 }
801 }
802
803 unsafe impl<___E>
804 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::SelfRef>, ___E>
805 for SelfRef
806 where
807 ___E: ::fidl_next::Encoder + ?Sized,
808 SelfRef: ::fidl_next::Encode<crate::wire::SelfRef, ___E>,
809 {
810 #[inline]
811 fn encode_option(
812 this: ::core::option::Option<Self>,
813 encoder: &mut ___E,
814 out: &mut ::core::mem::MaybeUninit<
815 ::fidl_next::wire::Box<'static, crate::wire::SelfRef>,
816 >,
817 _: (),
818 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
819 if let Some(inner) = this {
820 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
821 ::fidl_next::wire::Box::encode_present(out);
822 } else {
823 ::fidl_next::wire::Box::encode_absent(out);
824 }
825
826 Ok(())
827 }
828 }
829
830 unsafe impl<'a, ___E>
831 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::SelfRef>, ___E>
832 for &'a SelfRef
833 where
834 ___E: ::fidl_next::Encoder + ?Sized,
835 &'a SelfRef: ::fidl_next::Encode<crate::wire::SelfRef, ___E>,
836 {
837 #[inline]
838 fn encode_option(
839 this: ::core::option::Option<Self>,
840 encoder: &mut ___E,
841 out: &mut ::core::mem::MaybeUninit<
842 ::fidl_next::wire::Box<'static, crate::wire::SelfRef>,
843 >,
844 _: (),
845 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
846 if let Some(inner) = this {
847 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
848 ::fidl_next::wire::Box::encode_present(out);
849 } else {
850 ::fidl_next::wire::Box::encode_absent(out);
851 }
852
853 Ok(())
854 }
855 }
856
857 impl ::fidl_next::FromWire<crate::wire::SelfRef> for SelfRef {
858 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::SelfRef, Self> =
859 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
860
861 #[inline]
862 fn from_wire(wire: crate::wire::SelfRef) -> Self {
863 Self {}
864 }
865 }
866
867 impl ::fidl_next::FromWireRef<crate::wire::SelfRef> for SelfRef {
868 #[inline]
869 fn from_wire_ref(wire: &crate::wire::SelfRef) -> Self {
870 Self {}
871 }
872 }
873
874 pub type ChildName = ::std::string::String;
875
876 #[doc = " A reference to one of the component\'s child instances.\n"]
877 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
878 pub struct ChildRef {
879 pub name: ::std::string::String,
880
881 pub collection: ::core::option::Option<::std::string::String>,
882 }
883
884 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ChildRef<'static>, ___E> for ChildRef
885 where
886 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
887 ___E: ::fidl_next::Encoder,
888 {
889 #[inline]
890 fn encode(
891 self,
892 encoder_: &mut ___E,
893 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChildRef<'static>>,
894 _: (),
895 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
896 ::fidl_next::munge! {
897 let crate::wire::ChildRef {
898 name,
899 collection,
900
901 } = out_;
902 }
903
904 ::fidl_next::Encode::encode(self.name, encoder_, name, 1024)?;
905
906 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
907 ::fidl_next::Constrained::validate(_field, 1024)?;
908
909 ::fidl_next::Encode::encode(self.collection, encoder_, collection, 100)?;
910
911 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(collection.as_mut_ptr()) };
912 ::fidl_next::Constrained::validate(_field, 100)?;
913
914 Ok(())
915 }
916 }
917
918 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ChildRef<'static>, ___E> for &'a ChildRef
919 where
920 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
921 ___E: ::fidl_next::Encoder,
922 {
923 #[inline]
924 fn encode(
925 self,
926 encoder_: &mut ___E,
927 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChildRef<'static>>,
928 _: (),
929 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
930 ::fidl_next::munge! {
931 let crate::wire::ChildRef {
932
933 name,
934 collection,
935
936 } = out_;
937 }
938
939 ::fidl_next::Encode::encode(&self.name, encoder_, name, 1024)?;
940
941 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
942 ::fidl_next::Constrained::validate(_field, 1024)?;
943
944 ::fidl_next::Encode::encode(&self.collection, encoder_, collection, 100)?;
945
946 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(collection.as_mut_ptr()) };
947 ::fidl_next::Constrained::validate(_field, 100)?;
948
949 Ok(())
950 }
951 }
952
953 unsafe impl<___E>
954 ::fidl_next::EncodeOption<
955 ::fidl_next::wire::Box<'static, crate::wire::ChildRef<'static>>,
956 ___E,
957 > for ChildRef
958 where
959 ___E: ::fidl_next::Encoder + ?Sized,
960 ChildRef: ::fidl_next::Encode<crate::wire::ChildRef<'static>, ___E>,
961 {
962 #[inline]
963 fn encode_option(
964 this: ::core::option::Option<Self>,
965 encoder: &mut ___E,
966 out: &mut ::core::mem::MaybeUninit<
967 ::fidl_next::wire::Box<'static, crate::wire::ChildRef<'static>>,
968 >,
969 _: (),
970 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
971 if let Some(inner) = this {
972 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
973 ::fidl_next::wire::Box::encode_present(out);
974 } else {
975 ::fidl_next::wire::Box::encode_absent(out);
976 }
977
978 Ok(())
979 }
980 }
981
982 unsafe impl<'a, ___E>
983 ::fidl_next::EncodeOption<
984 ::fidl_next::wire::Box<'static, crate::wire::ChildRef<'static>>,
985 ___E,
986 > for &'a ChildRef
987 where
988 ___E: ::fidl_next::Encoder + ?Sized,
989 &'a ChildRef: ::fidl_next::Encode<crate::wire::ChildRef<'static>, ___E>,
990 {
991 #[inline]
992 fn encode_option(
993 this: ::core::option::Option<Self>,
994 encoder: &mut ___E,
995 out: &mut ::core::mem::MaybeUninit<
996 ::fidl_next::wire::Box<'static, crate::wire::ChildRef<'static>>,
997 >,
998 _: (),
999 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1000 if let Some(inner) = this {
1001 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1002 ::fidl_next::wire::Box::encode_present(out);
1003 } else {
1004 ::fidl_next::wire::Box::encode_absent(out);
1005 }
1006
1007 Ok(())
1008 }
1009 }
1010
1011 impl<'de> ::fidl_next::FromWire<crate::wire::ChildRef<'de>> for ChildRef {
1012 #[inline]
1013 fn from_wire(wire: crate::wire::ChildRef<'de>) -> Self {
1014 Self {
1015 name: ::fidl_next::FromWire::from_wire(wire.name),
1016
1017 collection: ::fidl_next::FromWire::from_wire(wire.collection),
1018 }
1019 }
1020 }
1021
1022 impl<'de> ::fidl_next::FromWireRef<crate::wire::ChildRef<'de>> for ChildRef {
1023 #[inline]
1024 fn from_wire_ref(wire: &crate::wire::ChildRef<'de>) -> Self {
1025 Self {
1026 name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
1027
1028 collection: ::fidl_next::FromWireRef::from_wire_ref(&wire.collection),
1029 }
1030 }
1031 }
1032
1033 #[doc = " A reference to one of the component\'s collections.\n"]
1034 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1035 pub struct CollectionRef {
1036 pub name: ::std::string::String,
1037 }
1038
1039 unsafe impl<___E> ::fidl_next::Encode<crate::wire::CollectionRef<'static>, ___E> for CollectionRef
1040 where
1041 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1042 ___E: ::fidl_next::Encoder,
1043 {
1044 #[inline]
1045 fn encode(
1046 self,
1047 encoder_: &mut ___E,
1048 out_: &mut ::core::mem::MaybeUninit<crate::wire::CollectionRef<'static>>,
1049 _: (),
1050 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1051 ::fidl_next::munge! {
1052 let crate::wire::CollectionRef {
1053 name,
1054
1055 } = out_;
1056 }
1057
1058 ::fidl_next::Encode::encode(self.name, encoder_, name, 100)?;
1059
1060 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
1061 ::fidl_next::Constrained::validate(_field, 100)?;
1062
1063 Ok(())
1064 }
1065 }
1066
1067 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::CollectionRef<'static>, ___E>
1068 for &'a CollectionRef
1069 where
1070 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1071 ___E: ::fidl_next::Encoder,
1072 {
1073 #[inline]
1074 fn encode(
1075 self,
1076 encoder_: &mut ___E,
1077 out_: &mut ::core::mem::MaybeUninit<crate::wire::CollectionRef<'static>>,
1078 _: (),
1079 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1080 ::fidl_next::munge! {
1081 let crate::wire::CollectionRef {
1082
1083 name,
1084
1085 } = out_;
1086 }
1087
1088 ::fidl_next::Encode::encode(&self.name, encoder_, name, 100)?;
1089
1090 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
1091 ::fidl_next::Constrained::validate(_field, 100)?;
1092
1093 Ok(())
1094 }
1095 }
1096
1097 unsafe impl<___E>
1098 ::fidl_next::EncodeOption<
1099 ::fidl_next::wire::Box<'static, crate::wire::CollectionRef<'static>>,
1100 ___E,
1101 > for CollectionRef
1102 where
1103 ___E: ::fidl_next::Encoder + ?Sized,
1104 CollectionRef: ::fidl_next::Encode<crate::wire::CollectionRef<'static>, ___E>,
1105 {
1106 #[inline]
1107 fn encode_option(
1108 this: ::core::option::Option<Self>,
1109 encoder: &mut ___E,
1110 out: &mut ::core::mem::MaybeUninit<
1111 ::fidl_next::wire::Box<'static, crate::wire::CollectionRef<'static>>,
1112 >,
1113 _: (),
1114 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1115 if let Some(inner) = this {
1116 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1117 ::fidl_next::wire::Box::encode_present(out);
1118 } else {
1119 ::fidl_next::wire::Box::encode_absent(out);
1120 }
1121
1122 Ok(())
1123 }
1124 }
1125
1126 unsafe impl<'a, ___E>
1127 ::fidl_next::EncodeOption<
1128 ::fidl_next::wire::Box<'static, crate::wire::CollectionRef<'static>>,
1129 ___E,
1130 > for &'a CollectionRef
1131 where
1132 ___E: ::fidl_next::Encoder + ?Sized,
1133 &'a CollectionRef: ::fidl_next::Encode<crate::wire::CollectionRef<'static>, ___E>,
1134 {
1135 #[inline]
1136 fn encode_option(
1137 this: ::core::option::Option<Self>,
1138 encoder: &mut ___E,
1139 out: &mut ::core::mem::MaybeUninit<
1140 ::fidl_next::wire::Box<'static, crate::wire::CollectionRef<'static>>,
1141 >,
1142 _: (),
1143 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1144 if let Some(inner) = this {
1145 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1146 ::fidl_next::wire::Box::encode_present(out);
1147 } else {
1148 ::fidl_next::wire::Box::encode_absent(out);
1149 }
1150
1151 Ok(())
1152 }
1153 }
1154
1155 impl<'de> ::fidl_next::FromWire<crate::wire::CollectionRef<'de>> for CollectionRef {
1156 #[inline]
1157 fn from_wire(wire: crate::wire::CollectionRef<'de>) -> Self {
1158 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
1159 }
1160 }
1161
1162 impl<'de> ::fidl_next::FromWireRef<crate::wire::CollectionRef<'de>> for CollectionRef {
1163 #[inline]
1164 fn from_wire_ref(wire: &crate::wire::CollectionRef<'de>) -> Self {
1165 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
1166 }
1167 }
1168
1169 #[doc = " A reference to the component framework itself.\n"]
1170 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1171 #[repr(C)]
1172 pub struct FrameworkRef {}
1173
1174 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FrameworkRef, ___E> for FrameworkRef
1175 where
1176 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1177 {
1178 #[inline]
1179 fn encode(
1180 self,
1181 encoder_: &mut ___E,
1182 out_: &mut ::core::mem::MaybeUninit<crate::wire::FrameworkRef>,
1183 _: (),
1184 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1185 ::fidl_next::munge! {
1186 let crate::wire::FrameworkRef {
1187
1188 _empty,
1189
1190 } = out_;
1191 }
1192
1193 let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
1194
1195 Ok(())
1196 }
1197 }
1198
1199 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FrameworkRef, ___E> for &'a FrameworkRef
1200 where
1201 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1202 {
1203 #[inline]
1204 fn encode(
1205 self,
1206 encoder_: &mut ___E,
1207 out_: &mut ::core::mem::MaybeUninit<crate::wire::FrameworkRef>,
1208 _: (),
1209 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1210 ::fidl_next::munge! {
1211 let crate::wire::FrameworkRef {
1212
1213 _empty,
1214
1215
1216 } = out_;
1217 }
1218
1219 let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
1220
1221 Ok(())
1222 }
1223 }
1224
1225 unsafe impl<___E>
1226 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::FrameworkRef>, ___E>
1227 for FrameworkRef
1228 where
1229 ___E: ::fidl_next::Encoder + ?Sized,
1230 FrameworkRef: ::fidl_next::Encode<crate::wire::FrameworkRef, ___E>,
1231 {
1232 #[inline]
1233 fn encode_option(
1234 this: ::core::option::Option<Self>,
1235 encoder: &mut ___E,
1236 out: &mut ::core::mem::MaybeUninit<
1237 ::fidl_next::wire::Box<'static, crate::wire::FrameworkRef>,
1238 >,
1239 _: (),
1240 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1241 if let Some(inner) = this {
1242 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1243 ::fidl_next::wire::Box::encode_present(out);
1244 } else {
1245 ::fidl_next::wire::Box::encode_absent(out);
1246 }
1247
1248 Ok(())
1249 }
1250 }
1251
1252 unsafe impl<'a, ___E>
1253 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::FrameworkRef>, ___E>
1254 for &'a FrameworkRef
1255 where
1256 ___E: ::fidl_next::Encoder + ?Sized,
1257 &'a FrameworkRef: ::fidl_next::Encode<crate::wire::FrameworkRef, ___E>,
1258 {
1259 #[inline]
1260 fn encode_option(
1261 this: ::core::option::Option<Self>,
1262 encoder: &mut ___E,
1263 out: &mut ::core::mem::MaybeUninit<
1264 ::fidl_next::wire::Box<'static, crate::wire::FrameworkRef>,
1265 >,
1266 _: (),
1267 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1268 if let Some(inner) = this {
1269 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1270 ::fidl_next::wire::Box::encode_present(out);
1271 } else {
1272 ::fidl_next::wire::Box::encode_absent(out);
1273 }
1274
1275 Ok(())
1276 }
1277 }
1278
1279 impl ::fidl_next::FromWire<crate::wire::FrameworkRef> for FrameworkRef {
1280 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::FrameworkRef, Self> =
1281 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1282
1283 #[inline]
1284 fn from_wire(wire: crate::wire::FrameworkRef) -> Self {
1285 Self {}
1286 }
1287 }
1288
1289 impl ::fidl_next::FromWireRef<crate::wire::FrameworkRef> for FrameworkRef {
1290 #[inline]
1291 fn from_wire_ref(wire: &crate::wire::FrameworkRef) -> Self {
1292 Self {}
1293 }
1294 }
1295
1296 #[doc = " A reference to a capability declared in this component.\n"]
1297 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1298 pub struct CapabilityRef {
1299 pub name: ::std::string::String,
1300 }
1301
1302 unsafe impl<___E> ::fidl_next::Encode<crate::wire::CapabilityRef<'static>, ___E> for CapabilityRef
1303 where
1304 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1305 ___E: ::fidl_next::Encoder,
1306 {
1307 #[inline]
1308 fn encode(
1309 self,
1310 encoder_: &mut ___E,
1311 out_: &mut ::core::mem::MaybeUninit<crate::wire::CapabilityRef<'static>>,
1312 _: (),
1313 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1314 ::fidl_next::munge! {
1315 let crate::wire::CapabilityRef {
1316 name,
1317
1318 } = out_;
1319 }
1320
1321 ::fidl_next::Encode::encode(self.name, encoder_, name, 100)?;
1322
1323 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
1324 ::fidl_next::Constrained::validate(_field, 100)?;
1325
1326 Ok(())
1327 }
1328 }
1329
1330 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::CapabilityRef<'static>, ___E>
1331 for &'a CapabilityRef
1332 where
1333 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1334 ___E: ::fidl_next::Encoder,
1335 {
1336 #[inline]
1337 fn encode(
1338 self,
1339 encoder_: &mut ___E,
1340 out_: &mut ::core::mem::MaybeUninit<crate::wire::CapabilityRef<'static>>,
1341 _: (),
1342 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1343 ::fidl_next::munge! {
1344 let crate::wire::CapabilityRef {
1345
1346 name,
1347
1348 } = out_;
1349 }
1350
1351 ::fidl_next::Encode::encode(&self.name, encoder_, name, 100)?;
1352
1353 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
1354 ::fidl_next::Constrained::validate(_field, 100)?;
1355
1356 Ok(())
1357 }
1358 }
1359
1360 unsafe impl<___E>
1361 ::fidl_next::EncodeOption<
1362 ::fidl_next::wire::Box<'static, crate::wire::CapabilityRef<'static>>,
1363 ___E,
1364 > for CapabilityRef
1365 where
1366 ___E: ::fidl_next::Encoder + ?Sized,
1367 CapabilityRef: ::fidl_next::Encode<crate::wire::CapabilityRef<'static>, ___E>,
1368 {
1369 #[inline]
1370 fn encode_option(
1371 this: ::core::option::Option<Self>,
1372 encoder: &mut ___E,
1373 out: &mut ::core::mem::MaybeUninit<
1374 ::fidl_next::wire::Box<'static, crate::wire::CapabilityRef<'static>>,
1375 >,
1376 _: (),
1377 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1378 if let Some(inner) = this {
1379 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1380 ::fidl_next::wire::Box::encode_present(out);
1381 } else {
1382 ::fidl_next::wire::Box::encode_absent(out);
1383 }
1384
1385 Ok(())
1386 }
1387 }
1388
1389 unsafe impl<'a, ___E>
1390 ::fidl_next::EncodeOption<
1391 ::fidl_next::wire::Box<'static, crate::wire::CapabilityRef<'static>>,
1392 ___E,
1393 > for &'a CapabilityRef
1394 where
1395 ___E: ::fidl_next::Encoder + ?Sized,
1396 &'a CapabilityRef: ::fidl_next::Encode<crate::wire::CapabilityRef<'static>, ___E>,
1397 {
1398 #[inline]
1399 fn encode_option(
1400 this: ::core::option::Option<Self>,
1401 encoder: &mut ___E,
1402 out: &mut ::core::mem::MaybeUninit<
1403 ::fidl_next::wire::Box<'static, crate::wire::CapabilityRef<'static>>,
1404 >,
1405 _: (),
1406 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1407 if let Some(inner) = this {
1408 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1409 ::fidl_next::wire::Box::encode_present(out);
1410 } else {
1411 ::fidl_next::wire::Box::encode_absent(out);
1412 }
1413
1414 Ok(())
1415 }
1416 }
1417
1418 impl<'de> ::fidl_next::FromWire<crate::wire::CapabilityRef<'de>> for CapabilityRef {
1419 #[inline]
1420 fn from_wire(wire: crate::wire::CapabilityRef<'de>) -> Self {
1421 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
1422 }
1423 }
1424
1425 impl<'de> ::fidl_next::FromWireRef<crate::wire::CapabilityRef<'de>> for CapabilityRef {
1426 #[inline]
1427 fn from_wire_ref(wire: &crate::wire::CapabilityRef<'de>) -> Self {
1428 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
1429 }
1430 }
1431
1432 #[doc = " A reference to the environment\'s debug capabilities.\n"]
1433 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1434 #[repr(C)]
1435 pub struct DebugRef {}
1436
1437 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DebugRef, ___E> for DebugRef
1438 where
1439 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1440 {
1441 #[inline]
1442 fn encode(
1443 self,
1444 encoder_: &mut ___E,
1445 out_: &mut ::core::mem::MaybeUninit<crate::wire::DebugRef>,
1446 _: (),
1447 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1448 ::fidl_next::munge! {
1449 let crate::wire::DebugRef {
1450
1451 _empty,
1452
1453 } = out_;
1454 }
1455
1456 let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
1457
1458 Ok(())
1459 }
1460 }
1461
1462 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DebugRef, ___E> for &'a DebugRef
1463 where
1464 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1465 {
1466 #[inline]
1467 fn encode(
1468 self,
1469 encoder_: &mut ___E,
1470 out_: &mut ::core::mem::MaybeUninit<crate::wire::DebugRef>,
1471 _: (),
1472 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1473 ::fidl_next::munge! {
1474 let crate::wire::DebugRef {
1475
1476 _empty,
1477
1478
1479 } = out_;
1480 }
1481
1482 let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
1483
1484 Ok(())
1485 }
1486 }
1487
1488 unsafe impl<___E>
1489 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::DebugRef>, ___E>
1490 for DebugRef
1491 where
1492 ___E: ::fidl_next::Encoder + ?Sized,
1493 DebugRef: ::fidl_next::Encode<crate::wire::DebugRef, ___E>,
1494 {
1495 #[inline]
1496 fn encode_option(
1497 this: ::core::option::Option<Self>,
1498 encoder: &mut ___E,
1499 out: &mut ::core::mem::MaybeUninit<
1500 ::fidl_next::wire::Box<'static, crate::wire::DebugRef>,
1501 >,
1502 _: (),
1503 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1504 if let Some(inner) = this {
1505 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1506 ::fidl_next::wire::Box::encode_present(out);
1507 } else {
1508 ::fidl_next::wire::Box::encode_absent(out);
1509 }
1510
1511 Ok(())
1512 }
1513 }
1514
1515 unsafe impl<'a, ___E>
1516 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::DebugRef>, ___E>
1517 for &'a DebugRef
1518 where
1519 ___E: ::fidl_next::Encoder + ?Sized,
1520 &'a DebugRef: ::fidl_next::Encode<crate::wire::DebugRef, ___E>,
1521 {
1522 #[inline]
1523 fn encode_option(
1524 this: ::core::option::Option<Self>,
1525 encoder: &mut ___E,
1526 out: &mut ::core::mem::MaybeUninit<
1527 ::fidl_next::wire::Box<'static, crate::wire::DebugRef>,
1528 >,
1529 _: (),
1530 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1531 if let Some(inner) = this {
1532 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1533 ::fidl_next::wire::Box::encode_present(out);
1534 } else {
1535 ::fidl_next::wire::Box::encode_absent(out);
1536 }
1537
1538 Ok(())
1539 }
1540 }
1541
1542 impl ::fidl_next::FromWire<crate::wire::DebugRef> for DebugRef {
1543 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::DebugRef, Self> =
1544 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1545
1546 #[inline]
1547 fn from_wire(wire: crate::wire::DebugRef) -> Self {
1548 Self {}
1549 }
1550 }
1551
1552 impl ::fidl_next::FromWireRef<crate::wire::DebugRef> for DebugRef {
1553 #[inline]
1554 fn from_wire_ref(wire: &crate::wire::DebugRef) -> Self {
1555 Self {}
1556 }
1557 }
1558
1559 #[doc = " A reference to an intentionally missing offer source.\n"]
1560 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1561 #[repr(C)]
1562 pub struct VoidRef {}
1563
1564 unsafe impl<___E> ::fidl_next::Encode<crate::wire::VoidRef, ___E> for VoidRef
1565 where
1566 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1567 {
1568 #[inline]
1569 fn encode(
1570 self,
1571 encoder_: &mut ___E,
1572 out_: &mut ::core::mem::MaybeUninit<crate::wire::VoidRef>,
1573 _: (),
1574 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1575 ::fidl_next::munge! {
1576 let crate::wire::VoidRef {
1577
1578 _empty,
1579
1580 } = out_;
1581 }
1582
1583 let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
1584
1585 Ok(())
1586 }
1587 }
1588
1589 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::VoidRef, ___E> for &'a VoidRef
1590 where
1591 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1592 {
1593 #[inline]
1594 fn encode(
1595 self,
1596 encoder_: &mut ___E,
1597 out_: &mut ::core::mem::MaybeUninit<crate::wire::VoidRef>,
1598 _: (),
1599 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1600 ::fidl_next::munge! {
1601 let crate::wire::VoidRef {
1602
1603 _empty,
1604
1605
1606 } = out_;
1607 }
1608
1609 let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
1610
1611 Ok(())
1612 }
1613 }
1614
1615 unsafe impl<___E>
1616 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::VoidRef>, ___E>
1617 for VoidRef
1618 where
1619 ___E: ::fidl_next::Encoder + ?Sized,
1620 VoidRef: ::fidl_next::Encode<crate::wire::VoidRef, ___E>,
1621 {
1622 #[inline]
1623 fn encode_option(
1624 this: ::core::option::Option<Self>,
1625 encoder: &mut ___E,
1626 out: &mut ::core::mem::MaybeUninit<
1627 ::fidl_next::wire::Box<'static, crate::wire::VoidRef>,
1628 >,
1629 _: (),
1630 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1631 if let Some(inner) = this {
1632 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1633 ::fidl_next::wire::Box::encode_present(out);
1634 } else {
1635 ::fidl_next::wire::Box::encode_absent(out);
1636 }
1637
1638 Ok(())
1639 }
1640 }
1641
1642 unsafe impl<'a, ___E>
1643 ::fidl_next::EncodeOption<::fidl_next::wire::Box<'static, crate::wire::VoidRef>, ___E>
1644 for &'a VoidRef
1645 where
1646 ___E: ::fidl_next::Encoder + ?Sized,
1647 &'a VoidRef: ::fidl_next::Encode<crate::wire::VoidRef, ___E>,
1648 {
1649 #[inline]
1650 fn encode_option(
1651 this: ::core::option::Option<Self>,
1652 encoder: &mut ___E,
1653 out: &mut ::core::mem::MaybeUninit<
1654 ::fidl_next::wire::Box<'static, crate::wire::VoidRef>,
1655 >,
1656 _: (),
1657 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1658 if let Some(inner) = this {
1659 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1660 ::fidl_next::wire::Box::encode_present(out);
1661 } else {
1662 ::fidl_next::wire::Box::encode_absent(out);
1663 }
1664
1665 Ok(())
1666 }
1667 }
1668
1669 impl ::fidl_next::FromWire<crate::wire::VoidRef> for VoidRef {
1670 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::VoidRef, Self> =
1671 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1672
1673 #[inline]
1674 fn from_wire(wire: crate::wire::VoidRef) -> Self {
1675 Self {}
1676 }
1677 }
1678
1679 impl ::fidl_next::FromWireRef<crate::wire::VoidRef> for VoidRef {
1680 #[inline]
1681 fn from_wire_ref(wire: &crate::wire::VoidRef) -> Self {
1682 Self {}
1683 }
1684 }
1685
1686 #[doc = " Declares which identifier to use to key a component\'s isolated storage\n directory.\n"]
1687 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1688 #[repr(u32)]
1689 pub enum StorageId {
1690 StaticInstanceId = 1,
1691 StaticInstanceIdOrMoniker = 2,
1692 }
1693 impl ::core::convert::TryFrom<u32> for StorageId {
1694 type Error = ::fidl_next::UnknownStrictEnumMemberError;
1695 fn try_from(
1696 value: u32,
1697 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
1698 match value {
1699 1 => Ok(Self::StaticInstanceId),
1700 2 => Ok(Self::StaticInstanceIdOrMoniker),
1701
1702 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
1703 }
1704 }
1705 }
1706
1707 unsafe impl<___E> ::fidl_next::Encode<crate::wire::StorageId, ___E> for StorageId
1708 where
1709 ___E: ?Sized,
1710 {
1711 #[inline]
1712 fn encode(
1713 self,
1714 encoder: &mut ___E,
1715 out: &mut ::core::mem::MaybeUninit<crate::wire::StorageId>,
1716 _: (),
1717 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1718 ::fidl_next::Encode::encode(&self, encoder, out, ())
1719 }
1720 }
1721
1722 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::StorageId, ___E> for &'a StorageId
1723 where
1724 ___E: ?Sized,
1725 {
1726 #[inline]
1727 fn encode(
1728 self,
1729 encoder: &mut ___E,
1730 out: &mut ::core::mem::MaybeUninit<crate::wire::StorageId>,
1731 _: (),
1732 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1733 ::fidl_next::munge!(let crate::wire::StorageId { value } = out);
1734 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
1735 StorageId::StaticInstanceId => 1,
1736
1737 StorageId::StaticInstanceIdOrMoniker => 2,
1738 }));
1739
1740 Ok(())
1741 }
1742 }
1743
1744 impl ::core::convert::From<crate::wire::StorageId> for StorageId {
1745 fn from(wire: crate::wire::StorageId) -> Self {
1746 match u32::from(wire.value) {
1747 1 => Self::StaticInstanceId,
1748
1749 2 => Self::StaticInstanceIdOrMoniker,
1750
1751 _ => unsafe { ::core::hint::unreachable_unchecked() },
1752 }
1753 }
1754 }
1755
1756 impl ::fidl_next::FromWire<crate::wire::StorageId> for StorageId {
1757 #[inline]
1758 fn from_wire(wire: crate::wire::StorageId) -> Self {
1759 Self::from(wire)
1760 }
1761 }
1762
1763 impl ::fidl_next::FromWireRef<crate::wire::StorageId> for StorageId {
1764 #[inline]
1765 fn from_wire_ref(wire: &crate::wire::StorageId) -> Self {
1766 Self::from(*wire)
1767 }
1768 }
1769
1770 #[doc = " Declares a runner capability backed by a service.\n"]
1771 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1772 pub struct Runner {
1773 pub name: ::core::option::Option<::std::string::String>,
1774
1775 pub source_path: ::core::option::Option<::std::string::String>,
1776 }
1777
1778 impl Runner {
1779 fn __max_ordinal(&self) -> usize {
1780 if self.source_path.is_some() {
1781 return 2;
1782 }
1783
1784 if self.name.is_some() {
1785 return 1;
1786 }
1787
1788 0
1789 }
1790 }
1791
1792 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Runner<'static>, ___E> for Runner
1793 where
1794 ___E: ::fidl_next::Encoder + ?Sized,
1795 {
1796 #[inline]
1797 fn encode(
1798 mut self,
1799 encoder: &mut ___E,
1800 out: &mut ::core::mem::MaybeUninit<crate::wire::Runner<'static>>,
1801 _: (),
1802 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1803 ::fidl_next::munge!(let crate::wire::Runner { table } = out);
1804
1805 let max_ord = self.__max_ordinal();
1806
1807 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1808 ::fidl_next::Wire::zero_padding(&mut out);
1809
1810 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1811 ::fidl_next::wire::Envelope,
1812 >(encoder, max_ord);
1813
1814 for i in 1..=max_ord {
1815 match i {
1816 2 => {
1817 if let Some(value) = self.source_path.take() {
1818 ::fidl_next::wire::Envelope::encode_value::<
1819 ::fidl_next::wire::String<'static>,
1820 ___E,
1821 >(
1822 value, preallocated.encoder, &mut out, 1024
1823 )?;
1824 } else {
1825 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1826 }
1827 }
1828
1829 1 => {
1830 if let Some(value) = self.name.take() {
1831 ::fidl_next::wire::Envelope::encode_value::<
1832 ::fidl_next::wire::String<'static>,
1833 ___E,
1834 >(
1835 value, preallocated.encoder, &mut out, 100
1836 )?;
1837 } else {
1838 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1839 }
1840 }
1841
1842 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1843 }
1844 unsafe {
1845 preallocated.write_next(out.assume_init_ref());
1846 }
1847 }
1848
1849 ::fidl_next::wire::Table::encode_len(table, max_ord);
1850
1851 Ok(())
1852 }
1853 }
1854
1855 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Runner<'static>, ___E> for &'a Runner
1856 where
1857 ___E: ::fidl_next::Encoder + ?Sized,
1858 {
1859 #[inline]
1860 fn encode(
1861 self,
1862 encoder: &mut ___E,
1863 out: &mut ::core::mem::MaybeUninit<crate::wire::Runner<'static>>,
1864 _: (),
1865 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1866 ::fidl_next::munge!(let crate::wire::Runner { table } = out);
1867
1868 let max_ord = self.__max_ordinal();
1869
1870 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
1871 ::fidl_next::Wire::zero_padding(&mut out);
1872
1873 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
1874 ::fidl_next::wire::Envelope,
1875 >(encoder, max_ord);
1876
1877 for i in 1..=max_ord {
1878 match i {
1879 2 => {
1880 if let Some(value) = &self.source_path {
1881 ::fidl_next::wire::Envelope::encode_value::<
1882 ::fidl_next::wire::String<'static>,
1883 ___E,
1884 >(
1885 value, preallocated.encoder, &mut out, 1024
1886 )?;
1887 } else {
1888 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1889 }
1890 }
1891
1892 1 => {
1893 if let Some(value) = &self.name {
1894 ::fidl_next::wire::Envelope::encode_value::<
1895 ::fidl_next::wire::String<'static>,
1896 ___E,
1897 >(
1898 value, preallocated.encoder, &mut out, 100
1899 )?;
1900 } else {
1901 ::fidl_next::wire::Envelope::encode_zero(&mut out)
1902 }
1903 }
1904
1905 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
1906 }
1907 unsafe {
1908 preallocated.write_next(out.assume_init_ref());
1909 }
1910 }
1911
1912 ::fidl_next::wire::Table::encode_len(table, max_ord);
1913
1914 Ok(())
1915 }
1916 }
1917
1918 impl<'de> ::fidl_next::FromWire<crate::wire::Runner<'de>> for Runner {
1919 #[inline]
1920 fn from_wire(wire_: crate::wire::Runner<'de>) -> Self {
1921 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1922
1923 let name = wire_.table.get(1);
1924
1925 let source_path = wire_.table.get(2);
1926
1927 Self {
1928 name: name.map(|envelope| {
1929 ::fidl_next::FromWire::from_wire(unsafe {
1930 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
1931 })
1932 }),
1933
1934 source_path: source_path.map(|envelope| {
1935 ::fidl_next::FromWire::from_wire(unsafe {
1936 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
1937 })
1938 }),
1939 }
1940 }
1941 }
1942
1943 impl<'de> ::fidl_next::FromWireRef<crate::wire::Runner<'de>> for Runner {
1944 #[inline]
1945 fn from_wire_ref(wire: &crate::wire::Runner<'de>) -> Self {
1946 Self {
1947 name: wire.table.get(1).map(|envelope| {
1948 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1949 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
1950 })
1951 }),
1952
1953 source_path: wire.table.get(2).map(|envelope| {
1954 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1955 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
1956 })
1957 }),
1958 }
1959 }
1960 }
1961
1962 #[doc = " Declares a resolver which is responsible for resolving component URLs to\n actual components. See `fuchsia.component.resolution.Resolver` for the\n protocol resolvers are expected to implement.\n"]
1963 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
1964 pub struct Resolver {
1965 pub name: ::core::option::Option<::std::string::String>,
1966
1967 pub source_path: ::core::option::Option<::std::string::String>,
1968 }
1969
1970 impl Resolver {
1971 fn __max_ordinal(&self) -> usize {
1972 if self.source_path.is_some() {
1973 return 2;
1974 }
1975
1976 if self.name.is_some() {
1977 return 1;
1978 }
1979
1980 0
1981 }
1982 }
1983
1984 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Resolver<'static>, ___E> for Resolver
1985 where
1986 ___E: ::fidl_next::Encoder + ?Sized,
1987 {
1988 #[inline]
1989 fn encode(
1990 mut self,
1991 encoder: &mut ___E,
1992 out: &mut ::core::mem::MaybeUninit<crate::wire::Resolver<'static>>,
1993 _: (),
1994 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1995 ::fidl_next::munge!(let crate::wire::Resolver { table } = out);
1996
1997 let max_ord = self.__max_ordinal();
1998
1999 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2000 ::fidl_next::Wire::zero_padding(&mut out);
2001
2002 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2003 ::fidl_next::wire::Envelope,
2004 >(encoder, max_ord);
2005
2006 for i in 1..=max_ord {
2007 match i {
2008 2 => {
2009 if let Some(value) = self.source_path.take() {
2010 ::fidl_next::wire::Envelope::encode_value::<
2011 ::fidl_next::wire::String<'static>,
2012 ___E,
2013 >(
2014 value, preallocated.encoder, &mut out, 1024
2015 )?;
2016 } else {
2017 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2018 }
2019 }
2020
2021 1 => {
2022 if let Some(value) = self.name.take() {
2023 ::fidl_next::wire::Envelope::encode_value::<
2024 ::fidl_next::wire::String<'static>,
2025 ___E,
2026 >(
2027 value, preallocated.encoder, &mut out, 100
2028 )?;
2029 } else {
2030 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2031 }
2032 }
2033
2034 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2035 }
2036 unsafe {
2037 preallocated.write_next(out.assume_init_ref());
2038 }
2039 }
2040
2041 ::fidl_next::wire::Table::encode_len(table, max_ord);
2042
2043 Ok(())
2044 }
2045 }
2046
2047 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Resolver<'static>, ___E> for &'a Resolver
2048 where
2049 ___E: ::fidl_next::Encoder + ?Sized,
2050 {
2051 #[inline]
2052 fn encode(
2053 self,
2054 encoder: &mut ___E,
2055 out: &mut ::core::mem::MaybeUninit<crate::wire::Resolver<'static>>,
2056 _: (),
2057 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2058 ::fidl_next::munge!(let crate::wire::Resolver { table } = out);
2059
2060 let max_ord = self.__max_ordinal();
2061
2062 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2063 ::fidl_next::Wire::zero_padding(&mut out);
2064
2065 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2066 ::fidl_next::wire::Envelope,
2067 >(encoder, max_ord);
2068
2069 for i in 1..=max_ord {
2070 match i {
2071 2 => {
2072 if let Some(value) = &self.source_path {
2073 ::fidl_next::wire::Envelope::encode_value::<
2074 ::fidl_next::wire::String<'static>,
2075 ___E,
2076 >(
2077 value, preallocated.encoder, &mut out, 1024
2078 )?;
2079 } else {
2080 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2081 }
2082 }
2083
2084 1 => {
2085 if let Some(value) = &self.name {
2086 ::fidl_next::wire::Envelope::encode_value::<
2087 ::fidl_next::wire::String<'static>,
2088 ___E,
2089 >(
2090 value, preallocated.encoder, &mut out, 100
2091 )?;
2092 } else {
2093 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2094 }
2095 }
2096
2097 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2098 }
2099 unsafe {
2100 preallocated.write_next(out.assume_init_ref());
2101 }
2102 }
2103
2104 ::fidl_next::wire::Table::encode_len(table, max_ord);
2105
2106 Ok(())
2107 }
2108 }
2109
2110 impl<'de> ::fidl_next::FromWire<crate::wire::Resolver<'de>> for Resolver {
2111 #[inline]
2112 fn from_wire(wire_: crate::wire::Resolver<'de>) -> Self {
2113 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
2114
2115 let name = wire_.table.get(1);
2116
2117 let source_path = wire_.table.get(2);
2118
2119 Self {
2120 name: name.map(|envelope| {
2121 ::fidl_next::FromWire::from_wire(unsafe {
2122 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2123 })
2124 }),
2125
2126 source_path: source_path.map(|envelope| {
2127 ::fidl_next::FromWire::from_wire(unsafe {
2128 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2129 })
2130 }),
2131 }
2132 }
2133 }
2134
2135 impl<'de> ::fidl_next::FromWireRef<crate::wire::Resolver<'de>> for Resolver {
2136 #[inline]
2137 fn from_wire_ref(wire: &crate::wire::Resolver<'de>) -> Self {
2138 Self {
2139 name: wire.table.get(1).map(|envelope| {
2140 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2141 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
2142 })
2143 }),
2144
2145 source_path: wire.table.get(2).map(|envelope| {
2146 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2147 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
2148 })
2149 }),
2150 }
2151 }
2152 }
2153
2154 #[doc = " Declares an event_stream capability\n\n This type cannot be used in `fuchsia.component.decl.Component`. It is only\n used for the framework\'s built-in capabilities declared in\n `internal.Config`.\n"]
2155 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2156 pub struct EventStream {
2157 pub name: ::core::option::Option<::std::string::String>,
2158 }
2159
2160 impl EventStream {
2161 fn __max_ordinal(&self) -> usize {
2162 if self.name.is_some() {
2163 return 1;
2164 }
2165
2166 0
2167 }
2168 }
2169
2170 unsafe impl<___E> ::fidl_next::Encode<crate::wire::EventStream<'static>, ___E> for EventStream
2171 where
2172 ___E: ::fidl_next::Encoder + ?Sized,
2173 {
2174 #[inline]
2175 fn encode(
2176 mut self,
2177 encoder: &mut ___E,
2178 out: &mut ::core::mem::MaybeUninit<crate::wire::EventStream<'static>>,
2179 _: (),
2180 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2181 ::fidl_next::munge!(let crate::wire::EventStream { table } = out);
2182
2183 let max_ord = self.__max_ordinal();
2184
2185 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2186 ::fidl_next::Wire::zero_padding(&mut out);
2187
2188 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2189 ::fidl_next::wire::Envelope,
2190 >(encoder, max_ord);
2191
2192 for i in 1..=max_ord {
2193 match i {
2194 1 => {
2195 if let Some(value) = self.name.take() {
2196 ::fidl_next::wire::Envelope::encode_value::<
2197 ::fidl_next::wire::String<'static>,
2198 ___E,
2199 >(
2200 value, preallocated.encoder, &mut out, 100
2201 )?;
2202 } else {
2203 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2204 }
2205 }
2206
2207 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2208 }
2209 unsafe {
2210 preallocated.write_next(out.assume_init_ref());
2211 }
2212 }
2213
2214 ::fidl_next::wire::Table::encode_len(table, max_ord);
2215
2216 Ok(())
2217 }
2218 }
2219
2220 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EventStream<'static>, ___E>
2221 for &'a EventStream
2222 where
2223 ___E: ::fidl_next::Encoder + ?Sized,
2224 {
2225 #[inline]
2226 fn encode(
2227 self,
2228 encoder: &mut ___E,
2229 out: &mut ::core::mem::MaybeUninit<crate::wire::EventStream<'static>>,
2230 _: (),
2231 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2232 ::fidl_next::munge!(let crate::wire::EventStream { table } = out);
2233
2234 let max_ord = self.__max_ordinal();
2235
2236 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
2237 ::fidl_next::Wire::zero_padding(&mut out);
2238
2239 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
2240 ::fidl_next::wire::Envelope,
2241 >(encoder, max_ord);
2242
2243 for i in 1..=max_ord {
2244 match i {
2245 1 => {
2246 if let Some(value) = &self.name {
2247 ::fidl_next::wire::Envelope::encode_value::<
2248 ::fidl_next::wire::String<'static>,
2249 ___E,
2250 >(
2251 value, preallocated.encoder, &mut out, 100
2252 )?;
2253 } else {
2254 ::fidl_next::wire::Envelope::encode_zero(&mut out)
2255 }
2256 }
2257
2258 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
2259 }
2260 unsafe {
2261 preallocated.write_next(out.assume_init_ref());
2262 }
2263 }
2264
2265 ::fidl_next::wire::Table::encode_len(table, max_ord);
2266
2267 Ok(())
2268 }
2269 }
2270
2271 impl<'de> ::fidl_next::FromWire<crate::wire::EventStream<'de>> for EventStream {
2272 #[inline]
2273 fn from_wire(wire_: crate::wire::EventStream<'de>) -> Self {
2274 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
2275
2276 let name = wire_.table.get(1);
2277
2278 Self {
2279 name: name.map(|envelope| {
2280 ::fidl_next::FromWire::from_wire(unsafe {
2281 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
2282 })
2283 }),
2284 }
2285 }
2286 }
2287
2288 impl<'de> ::fidl_next::FromWireRef<crate::wire::EventStream<'de>> for EventStream {
2289 #[inline]
2290 fn from_wire_ref(wire: &crate::wire::EventStream<'de>) -> Self {
2291 Self {
2292 name: wire.table.get(1).map(|envelope| {
2293 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2294 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
2295 })
2296 }),
2297 }
2298 }
2299 }
2300
2301 #[doc = " A single configuration value.\n"]
2302 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2303 pub enum ConfigSingleValue {
2304 Bool(bool),
2305
2306 Uint8(u8),
2307
2308 Uint16(u16),
2309
2310 Uint32(u32),
2311
2312 Uint64(u64),
2313
2314 Int8(i8),
2315
2316 Int16(i16),
2317
2318 Int32(i32),
2319
2320 Int64(i64),
2321
2322 String(::std::string::String),
2323
2324 UnknownOrdinal_(u64),
2325 }
2326
2327 impl ConfigSingleValue {
2328 pub fn is_unknown(&self) -> bool {
2329 #[allow(unreachable_patterns)]
2330 match self {
2331 Self::UnknownOrdinal_(_) => true,
2332 _ => false,
2333 }
2334 }
2335 }
2336
2337 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigSingleValue<'static>, ___E>
2338 for ConfigSingleValue
2339 where
2340 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2341 ___E: ::fidl_next::Encoder,
2342 {
2343 #[inline]
2344 fn encode(
2345 self,
2346 encoder: &mut ___E,
2347 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSingleValue<'static>>,
2348 _: (),
2349 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2350 ::fidl_next::munge!(let crate::wire::ConfigSingleValue { raw, _phantom: _ } = out);
2351
2352 match self {
2353 Self::Bool(value) => {
2354 ::fidl_next::wire::Union::encode_as::<___E, bool>(value, 1, encoder, raw, ())?
2355 }
2356
2357 Self::Uint8(value) => {
2358 ::fidl_next::wire::Union::encode_as::<___E, u8>(value, 2, encoder, raw, ())?
2359 }
2360
2361 Self::Uint16(value) => ::fidl_next::wire::Union::encode_as::<
2362 ___E,
2363 ::fidl_next::wire::Uint16,
2364 >(value, 3, encoder, raw, ())?,
2365
2366 Self::Uint32(value) => ::fidl_next::wire::Union::encode_as::<
2367 ___E,
2368 ::fidl_next::wire::Uint32,
2369 >(value, 4, encoder, raw, ())?,
2370
2371 Self::Uint64(value) => ::fidl_next::wire::Union::encode_as::<
2372 ___E,
2373 ::fidl_next::wire::Uint64,
2374 >(value, 5, encoder, raw, ())?,
2375
2376 Self::Int8(value) => {
2377 ::fidl_next::wire::Union::encode_as::<___E, i8>(value, 6, encoder, raw, ())?
2378 }
2379
2380 Self::Int16(value) => ::fidl_next::wire::Union::encode_as::<
2381 ___E,
2382 ::fidl_next::wire::Int16,
2383 >(value, 7, encoder, raw, ())?,
2384
2385 Self::Int32(value) => ::fidl_next::wire::Union::encode_as::<
2386 ___E,
2387 ::fidl_next::wire::Int32,
2388 >(value, 8, encoder, raw, ())?,
2389
2390 Self::Int64(value) => ::fidl_next::wire::Union::encode_as::<
2391 ___E,
2392 ::fidl_next::wire::Int64,
2393 >(value, 9, encoder, raw, ())?,
2394
2395 Self::String(value) => ::fidl_next::wire::Union::encode_as::<
2396 ___E,
2397 ::fidl_next::wire::String<'static>,
2398 >(value, 10, encoder, raw, 4294967295)?,
2399
2400 Self::UnknownOrdinal_(ordinal) => {
2401 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
2402 }
2403 }
2404
2405 Ok(())
2406 }
2407 }
2408
2409 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigSingleValue<'static>, ___E>
2410 for &'a ConfigSingleValue
2411 where
2412 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2413 ___E: ::fidl_next::Encoder,
2414 {
2415 #[inline]
2416 fn encode(
2417 self,
2418 encoder: &mut ___E,
2419 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSingleValue<'static>>,
2420 _: (),
2421 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2422 ::fidl_next::munge!(let crate::wire::ConfigSingleValue { raw, _phantom: _ } = out);
2423
2424 match self {
2425 ConfigSingleValue::Bool(value) => {
2426 ::fidl_next::wire::Union::encode_as::<___E, bool>(value, 1, encoder, raw, ())?
2427 }
2428
2429 ConfigSingleValue::Uint8(value) => {
2430 ::fidl_next::wire::Union::encode_as::<___E, u8>(value, 2, encoder, raw, ())?
2431 }
2432
2433 ConfigSingleValue::Uint16(value) => ::fidl_next::wire::Union::encode_as::<
2434 ___E,
2435 ::fidl_next::wire::Uint16,
2436 >(value, 3, encoder, raw, ())?,
2437
2438 ConfigSingleValue::Uint32(value) => ::fidl_next::wire::Union::encode_as::<
2439 ___E,
2440 ::fidl_next::wire::Uint32,
2441 >(value, 4, encoder, raw, ())?,
2442
2443 ConfigSingleValue::Uint64(value) => ::fidl_next::wire::Union::encode_as::<
2444 ___E,
2445 ::fidl_next::wire::Uint64,
2446 >(value, 5, encoder, raw, ())?,
2447
2448 ConfigSingleValue::Int8(value) => {
2449 ::fidl_next::wire::Union::encode_as::<___E, i8>(value, 6, encoder, raw, ())?
2450 }
2451
2452 ConfigSingleValue::Int16(value) => ::fidl_next::wire::Union::encode_as::<
2453 ___E,
2454 ::fidl_next::wire::Int16,
2455 >(value, 7, encoder, raw, ())?,
2456
2457 ConfigSingleValue::Int32(value) => ::fidl_next::wire::Union::encode_as::<
2458 ___E,
2459 ::fidl_next::wire::Int32,
2460 >(value, 8, encoder, raw, ())?,
2461
2462 ConfigSingleValue::Int64(value) => ::fidl_next::wire::Union::encode_as::<
2463 ___E,
2464 ::fidl_next::wire::Int64,
2465 >(value, 9, encoder, raw, ())?,
2466
2467 ConfigSingleValue::String(value) => {
2468 ::fidl_next::wire::Union::encode_as::<___E, ::fidl_next::wire::String<'static>>(
2469 value, 10, encoder, raw, 4294967295,
2470 )?
2471 }
2472
2473 ConfigSingleValue::UnknownOrdinal_(ordinal) => {
2474 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
2475 }
2476 }
2477
2478 Ok(())
2479 }
2480 }
2481
2482 unsafe impl<___E>
2483 ::fidl_next::EncodeOption<crate::wire_optional::ConfigSingleValue<'static>, ___E>
2484 for ConfigSingleValue
2485 where
2486 ___E: ?Sized,
2487 ConfigSingleValue: ::fidl_next::Encode<crate::wire::ConfigSingleValue<'static>, ___E>,
2488 {
2489 #[inline]
2490 fn encode_option(
2491 this: ::core::option::Option<Self>,
2492 encoder: &mut ___E,
2493 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigSingleValue<'static>>,
2494 _: (),
2495 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2496 ::fidl_next::munge!(let crate::wire_optional::ConfigSingleValue { raw, _phantom: _ } = &mut *out);
2497
2498 if let Some(inner) = this {
2499 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
2500 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
2501 } else {
2502 ::fidl_next::wire::Union::encode_absent(raw);
2503 }
2504
2505 Ok(())
2506 }
2507 }
2508
2509 unsafe impl<'a, ___E>
2510 ::fidl_next::EncodeOption<crate::wire_optional::ConfigSingleValue<'static>, ___E>
2511 for &'a ConfigSingleValue
2512 where
2513 ___E: ?Sized,
2514 &'a ConfigSingleValue: ::fidl_next::Encode<crate::wire::ConfigSingleValue<'static>, ___E>,
2515 {
2516 #[inline]
2517 fn encode_option(
2518 this: ::core::option::Option<Self>,
2519 encoder: &mut ___E,
2520 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigSingleValue<'static>>,
2521 _: (),
2522 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2523 ::fidl_next::munge!(let crate::wire_optional::ConfigSingleValue { raw, _phantom: _ } = &mut *out);
2524
2525 if let Some(inner) = this {
2526 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
2527 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
2528 } else {
2529 ::fidl_next::wire::Union::encode_absent(raw);
2530 }
2531
2532 Ok(())
2533 }
2534 }
2535
2536 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigSingleValue<'de>> for ConfigSingleValue {
2537 #[inline]
2538 fn from_wire(wire: crate::wire::ConfigSingleValue<'de>) -> Self {
2539 let wire = ::core::mem::ManuallyDrop::new(wire);
2540 match wire.raw.ordinal() {
2541 1 => Self::Bool(::fidl_next::FromWire::from_wire(unsafe {
2542 wire.raw.get().read_unchecked::<bool>()
2543 })),
2544
2545 2 => Self::Uint8(::fidl_next::FromWire::from_wire(unsafe {
2546 wire.raw.get().read_unchecked::<u8>()
2547 })),
2548
2549 3 => Self::Uint16(::fidl_next::FromWire::from_wire(unsafe {
2550 wire.raw.get().read_unchecked::<::fidl_next::wire::Uint16>()
2551 })),
2552
2553 4 => Self::Uint32(::fidl_next::FromWire::from_wire(unsafe {
2554 wire.raw.get().read_unchecked::<::fidl_next::wire::Uint32>()
2555 })),
2556
2557 5 => Self::Uint64(::fidl_next::FromWire::from_wire(unsafe {
2558 wire.raw.get().read_unchecked::<::fidl_next::wire::Uint64>()
2559 })),
2560
2561 6 => Self::Int8(::fidl_next::FromWire::from_wire(unsafe {
2562 wire.raw.get().read_unchecked::<i8>()
2563 })),
2564
2565 7 => Self::Int16(::fidl_next::FromWire::from_wire(unsafe {
2566 wire.raw.get().read_unchecked::<::fidl_next::wire::Int16>()
2567 })),
2568
2569 8 => Self::Int32(::fidl_next::FromWire::from_wire(unsafe {
2570 wire.raw.get().read_unchecked::<::fidl_next::wire::Int32>()
2571 })),
2572
2573 9 => Self::Int64(::fidl_next::FromWire::from_wire(unsafe {
2574 wire.raw.get().read_unchecked::<::fidl_next::wire::Int64>()
2575 })),
2576
2577 10 => Self::String(::fidl_next::FromWire::from_wire(unsafe {
2578 wire.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
2579 })),
2580
2581 ord => return Self::UnknownOrdinal_(ord as u64),
2582 }
2583 }
2584 }
2585
2586 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigSingleValue<'de>> for ConfigSingleValue {
2587 #[inline]
2588 fn from_wire_ref(wire: &crate::wire::ConfigSingleValue<'de>) -> Self {
2589 match wire.raw.ordinal() {
2590 1 => Self::Bool(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2591 wire.raw.get().deref_unchecked::<bool>()
2592 })),
2593
2594 2 => Self::Uint8(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2595 wire.raw.get().deref_unchecked::<u8>()
2596 })),
2597
2598 3 => Self::Uint16(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2599 wire.raw.get().deref_unchecked::<::fidl_next::wire::Uint16>()
2600 })),
2601
2602 4 => Self::Uint32(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2603 wire.raw.get().deref_unchecked::<::fidl_next::wire::Uint32>()
2604 })),
2605
2606 5 => Self::Uint64(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2607 wire.raw.get().deref_unchecked::<::fidl_next::wire::Uint64>()
2608 })),
2609
2610 6 => Self::Int8(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2611 wire.raw.get().deref_unchecked::<i8>()
2612 })),
2613
2614 7 => Self::Int16(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2615 wire.raw.get().deref_unchecked::<::fidl_next::wire::Int16>()
2616 })),
2617
2618 8 => Self::Int32(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2619 wire.raw.get().deref_unchecked::<::fidl_next::wire::Int32>()
2620 })),
2621
2622 9 => Self::Int64(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2623 wire.raw.get().deref_unchecked::<::fidl_next::wire::Int64>()
2624 })),
2625
2626 10 => Self::String(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2627 wire.raw.get().deref_unchecked::<::fidl_next::wire::String<'de>>()
2628 })),
2629
2630 ord => return Self::UnknownOrdinal_(ord as u64),
2631 }
2632 }
2633 }
2634
2635 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigSingleValue<'de>>
2636 for ConfigSingleValue
2637 {
2638 #[inline]
2639 fn from_wire_option(
2640 wire: crate::wire_optional::ConfigSingleValue<'de>,
2641 ) -> ::core::option::Option<Self> {
2642 if let Some(inner) = wire.into_option() {
2643 Some(::fidl_next::FromWire::from_wire(inner))
2644 } else {
2645 None
2646 }
2647 }
2648 }
2649
2650 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigSingleValue<'de>>
2651 for Box<ConfigSingleValue>
2652 {
2653 #[inline]
2654 fn from_wire_option(
2655 wire: crate::wire_optional::ConfigSingleValue<'de>,
2656 ) -> ::core::option::Option<Self> {
2657 <ConfigSingleValue as ::fidl_next::FromWireOption<
2658 crate::wire_optional::ConfigSingleValue<'de>,
2659 >>::from_wire_option(wire)
2660 .map(Box::new)
2661 }
2662 }
2663
2664 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::ConfigSingleValue<'de>>
2665 for Box<ConfigSingleValue>
2666 {
2667 #[inline]
2668 fn from_wire_option_ref(
2669 wire: &crate::wire_optional::ConfigSingleValue<'de>,
2670 ) -> ::core::option::Option<Self> {
2671 if let Some(inner) = wire.as_ref() {
2672 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
2673 } else {
2674 None
2675 }
2676 }
2677 }
2678
2679 #[doc = " A vector configuration value.\n"]
2680 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
2681 pub enum ConfigVectorValue {
2682 BoolVector(::std::vec::Vec<bool>),
2683
2684 Uint8Vector(::std::vec::Vec<u8>),
2685
2686 Uint16Vector(::std::vec::Vec<u16>),
2687
2688 Uint32Vector(::std::vec::Vec<u32>),
2689
2690 Uint64Vector(::std::vec::Vec<u64>),
2691
2692 Int8Vector(::std::vec::Vec<i8>),
2693
2694 Int16Vector(::std::vec::Vec<i16>),
2695
2696 Int32Vector(::std::vec::Vec<i32>),
2697
2698 Int64Vector(::std::vec::Vec<i64>),
2699
2700 StringVector(::std::vec::Vec<::std::string::String>),
2701
2702 UnknownOrdinal_(u64),
2703 }
2704
2705 impl ConfigVectorValue {
2706 pub fn is_unknown(&self) -> bool {
2707 #[allow(unreachable_patterns)]
2708 match self {
2709 Self::UnknownOrdinal_(_) => true,
2710 _ => false,
2711 }
2712 }
2713 }
2714
2715 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigVectorValue<'static>, ___E>
2716 for ConfigVectorValue
2717 where
2718 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2719 ___E: ::fidl_next::Encoder,
2720 {
2721 #[inline]
2722 fn encode(
2723 self,
2724 encoder: &mut ___E,
2725 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigVectorValue<'static>>,
2726 _: (),
2727 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2728 ::fidl_next::munge!(let crate::wire::ConfigVectorValue { raw, _phantom: _ } = out);
2729
2730 match self {
2731 Self::BoolVector(value) => {
2732 ::fidl_next::wire::Union::encode_as::<
2733 ___E,
2734 ::fidl_next::wire::Vector<'static, bool>,
2735 >(value, 1, encoder, raw, (4294967295, ()))?
2736 }
2737
2738 Self::Uint8Vector(value) => {
2739 ::fidl_next::wire::Union::encode_as::<
2740 ___E,
2741 ::fidl_next::wire::Vector<'static, u8>,
2742 >(value, 2, encoder, raw, (4294967295, ()))?
2743 }
2744
2745 Self::Uint16Vector(value) => {
2746 ::fidl_next::wire::Union::encode_as::<
2747 ___E,
2748 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint16>,
2749 >(value, 3, encoder, raw, (4294967295, ()))?
2750 }
2751
2752 Self::Uint32Vector(value) => {
2753 ::fidl_next::wire::Union::encode_as::<
2754 ___E,
2755 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>,
2756 >(value, 4, encoder, raw, (4294967295, ()))?
2757 }
2758
2759 Self::Uint64Vector(value) => {
2760 ::fidl_next::wire::Union::encode_as::<
2761 ___E,
2762 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint64>,
2763 >(value, 5, encoder, raw, (4294967295, ()))?
2764 }
2765
2766 Self::Int8Vector(value) => {
2767 ::fidl_next::wire::Union::encode_as::<
2768 ___E,
2769 ::fidl_next::wire::Vector<'static, i8>,
2770 >(value, 6, encoder, raw, (4294967295, ()))?
2771 }
2772
2773 Self::Int16Vector(value) => {
2774 ::fidl_next::wire::Union::encode_as::<
2775 ___E,
2776 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Int16>,
2777 >(value, 7, encoder, raw, (4294967295, ()))?
2778 }
2779
2780 Self::Int32Vector(value) => {
2781 ::fidl_next::wire::Union::encode_as::<
2782 ___E,
2783 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Int32>,
2784 >(value, 8, encoder, raw, (4294967295, ()))?
2785 }
2786
2787 Self::Int64Vector(value) => {
2788 ::fidl_next::wire::Union::encode_as::<
2789 ___E,
2790 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Int64>,
2791 >(value, 9, encoder, raw, (4294967295, ()))?
2792 }
2793
2794 Self::StringVector(value) => {
2795 ::fidl_next::wire::Union::encode_as::<
2796 ___E,
2797 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::String<'static>>,
2798 >(value, 10, encoder, raw, (4294967295, 4294967295))?
2799 }
2800
2801 Self::UnknownOrdinal_(ordinal) => {
2802 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
2803 }
2804 }
2805
2806 Ok(())
2807 }
2808 }
2809
2810 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigVectorValue<'static>, ___E>
2811 for &'a ConfigVectorValue
2812 where
2813 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2814 ___E: ::fidl_next::Encoder,
2815 {
2816 #[inline]
2817 fn encode(
2818 self,
2819 encoder: &mut ___E,
2820 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigVectorValue<'static>>,
2821 _: (),
2822 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2823 ::fidl_next::munge!(let crate::wire::ConfigVectorValue { raw, _phantom: _ } = out);
2824
2825 match self {
2826 ConfigVectorValue::BoolVector(value) => {
2827 ::fidl_next::wire::Union::encode_as::<
2828 ___E,
2829 ::fidl_next::wire::Vector<'static, bool>,
2830 >(value, 1, encoder, raw, (4294967295, ()))?
2831 }
2832
2833 ConfigVectorValue::Uint8Vector(value) => {
2834 ::fidl_next::wire::Union::encode_as::<
2835 ___E,
2836 ::fidl_next::wire::Vector<'static, u8>,
2837 >(value, 2, encoder, raw, (4294967295, ()))?
2838 }
2839
2840 ConfigVectorValue::Uint16Vector(value) => {
2841 ::fidl_next::wire::Union::encode_as::<
2842 ___E,
2843 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint16>,
2844 >(value, 3, encoder, raw, (4294967295, ()))?
2845 }
2846
2847 ConfigVectorValue::Uint32Vector(value) => {
2848 ::fidl_next::wire::Union::encode_as::<
2849 ___E,
2850 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint32>,
2851 >(value, 4, encoder, raw, (4294967295, ()))?
2852 }
2853
2854 ConfigVectorValue::Uint64Vector(value) => {
2855 ::fidl_next::wire::Union::encode_as::<
2856 ___E,
2857 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Uint64>,
2858 >(value, 5, encoder, raw, (4294967295, ()))?
2859 }
2860
2861 ConfigVectorValue::Int8Vector(value) => {
2862 ::fidl_next::wire::Union::encode_as::<
2863 ___E,
2864 ::fidl_next::wire::Vector<'static, i8>,
2865 >(value, 6, encoder, raw, (4294967295, ()))?
2866 }
2867
2868 ConfigVectorValue::Int16Vector(value) => {
2869 ::fidl_next::wire::Union::encode_as::<
2870 ___E,
2871 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Int16>,
2872 >(value, 7, encoder, raw, (4294967295, ()))?
2873 }
2874
2875 ConfigVectorValue::Int32Vector(value) => {
2876 ::fidl_next::wire::Union::encode_as::<
2877 ___E,
2878 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Int32>,
2879 >(value, 8, encoder, raw, (4294967295, ()))?
2880 }
2881
2882 ConfigVectorValue::Int64Vector(value) => {
2883 ::fidl_next::wire::Union::encode_as::<
2884 ___E,
2885 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::Int64>,
2886 >(value, 9, encoder, raw, (4294967295, ()))?
2887 }
2888
2889 ConfigVectorValue::StringVector(value) => {
2890 ::fidl_next::wire::Union::encode_as::<
2891 ___E,
2892 ::fidl_next::wire::Vector<'static, ::fidl_next::wire::String<'static>>,
2893 >(value, 10, encoder, raw, (4294967295, 4294967295))?
2894 }
2895
2896 ConfigVectorValue::UnknownOrdinal_(ordinal) => {
2897 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
2898 }
2899 }
2900
2901 Ok(())
2902 }
2903 }
2904
2905 unsafe impl<___E>
2906 ::fidl_next::EncodeOption<crate::wire_optional::ConfigVectorValue<'static>, ___E>
2907 for ConfigVectorValue
2908 where
2909 ___E: ?Sized,
2910 ConfigVectorValue: ::fidl_next::Encode<crate::wire::ConfigVectorValue<'static>, ___E>,
2911 {
2912 #[inline]
2913 fn encode_option(
2914 this: ::core::option::Option<Self>,
2915 encoder: &mut ___E,
2916 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigVectorValue<'static>>,
2917 _: (),
2918 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2919 ::fidl_next::munge!(let crate::wire_optional::ConfigVectorValue { raw, _phantom: _ } = &mut *out);
2920
2921 if let Some(inner) = this {
2922 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
2923 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
2924 } else {
2925 ::fidl_next::wire::Union::encode_absent(raw);
2926 }
2927
2928 Ok(())
2929 }
2930 }
2931
2932 unsafe impl<'a, ___E>
2933 ::fidl_next::EncodeOption<crate::wire_optional::ConfigVectorValue<'static>, ___E>
2934 for &'a ConfigVectorValue
2935 where
2936 ___E: ?Sized,
2937 &'a ConfigVectorValue: ::fidl_next::Encode<crate::wire::ConfigVectorValue<'static>, ___E>,
2938 {
2939 #[inline]
2940 fn encode_option(
2941 this: ::core::option::Option<Self>,
2942 encoder: &mut ___E,
2943 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigVectorValue<'static>>,
2944 _: (),
2945 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2946 ::fidl_next::munge!(let crate::wire_optional::ConfigVectorValue { raw, _phantom: _ } = &mut *out);
2947
2948 if let Some(inner) = this {
2949 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
2950 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
2951 } else {
2952 ::fidl_next::wire::Union::encode_absent(raw);
2953 }
2954
2955 Ok(())
2956 }
2957 }
2958
2959 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigVectorValue<'de>> for ConfigVectorValue {
2960 #[inline]
2961 fn from_wire(wire: crate::wire::ConfigVectorValue<'de>) -> Self {
2962 let wire = ::core::mem::ManuallyDrop::new(wire);
2963 match wire.raw.ordinal() {
2964 1 => Self::BoolVector(::fidl_next::FromWire::from_wire(unsafe {
2965 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, bool>>()
2966 })),
2967
2968 2 => Self::Uint8Vector(::fidl_next::FromWire::from_wire(unsafe {
2969 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
2970 })),
2971
2972 3 => Self::Uint16Vector(::fidl_next::FromWire::from_wire(unsafe {
2973 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint16>>()
2974 })),
2975
2976 4 => Self::Uint32Vector(::fidl_next::FromWire::from_wire(unsafe {
2977 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>>()
2978 })),
2979
2980 5 => Self::Uint64Vector(::fidl_next::FromWire::from_wire(unsafe {
2981 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint64>>()
2982 })),
2983
2984 6 => Self::Int8Vector(::fidl_next::FromWire::from_wire(unsafe {
2985 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, i8>>()
2986 })),
2987
2988 7 => {
2989 Self::Int16Vector(::fidl_next::FromWire::from_wire(unsafe {
2990 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int16>>()
2991 }))
2992 }
2993
2994 8 => {
2995 Self::Int32Vector(::fidl_next::FromWire::from_wire(unsafe {
2996 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int32>>()
2997 }))
2998 }
2999
3000 9 => {
3001 Self::Int64Vector(::fidl_next::FromWire::from_wire(unsafe {
3002 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>>()
3003 }))
3004 }
3005
3006 10 => Self::StringVector(::fidl_next::FromWire::from_wire(unsafe {
3007 wire.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
3008 })),
3009
3010 ord => return Self::UnknownOrdinal_(ord as u64),
3011 }
3012 }
3013 }
3014
3015 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigVectorValue<'de>> for ConfigVectorValue {
3016 #[inline]
3017 fn from_wire_ref(wire: &crate::wire::ConfigVectorValue<'de>) -> Self {
3018 match wire.raw.ordinal() {
3019 1 => Self::BoolVector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3020 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, bool>>()
3021 })),
3022
3023 2 => Self::Uint8Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3024 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
3025 })),
3026
3027 3 => Self::Uint16Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3028 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint16>>()
3029 })),
3030
3031 4 => Self::Uint32Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3032 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>>()
3033 })),
3034
3035 5 => Self::Uint64Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3036 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint64>>()
3037 })),
3038
3039 6 => Self::Int8Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3040 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, i8>>()
3041 })),
3042
3043 7 => Self::Int16Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3044 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int16>>()
3045 })),
3046
3047 8 => Self::Int32Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3048 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int32>>()
3049 })),
3050
3051 9 => Self::Int64Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3052 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>>()
3053 })),
3054
3055 10 => Self::StringVector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3056 wire.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
3057 })),
3058
3059 ord => return Self::UnknownOrdinal_(ord as u64),
3060 }
3061 }
3062 }
3063
3064 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigVectorValue<'de>>
3065 for ConfigVectorValue
3066 {
3067 #[inline]
3068 fn from_wire_option(
3069 wire: crate::wire_optional::ConfigVectorValue<'de>,
3070 ) -> ::core::option::Option<Self> {
3071 if let Some(inner) = wire.into_option() {
3072 Some(::fidl_next::FromWire::from_wire(inner))
3073 } else {
3074 None
3075 }
3076 }
3077 }
3078
3079 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigVectorValue<'de>>
3080 for Box<ConfigVectorValue>
3081 {
3082 #[inline]
3083 fn from_wire_option(
3084 wire: crate::wire_optional::ConfigVectorValue<'de>,
3085 ) -> ::core::option::Option<Self> {
3086 <ConfigVectorValue as ::fidl_next::FromWireOption<
3087 crate::wire_optional::ConfigVectorValue<'de>,
3088 >>::from_wire_option(wire)
3089 .map(Box::new)
3090 }
3091 }
3092
3093 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::ConfigVectorValue<'de>>
3094 for Box<ConfigVectorValue>
3095 {
3096 #[inline]
3097 fn from_wire_option_ref(
3098 wire: &crate::wire_optional::ConfigVectorValue<'de>,
3099 ) -> ::core::option::Option<Self> {
3100 if let Some(inner) = wire.as_ref() {
3101 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
3102 } else {
3103 None
3104 }
3105 }
3106 }
3107
3108 #[doc = " A configuration value which can be provided to a component.\n\n Used both for storing configuration at-rest and in runtime configuration APIs.\n"]
3109 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3110 pub enum ConfigValue {
3111 Single(crate::natural::ConfigSingleValue),
3112
3113 Vector(crate::natural::ConfigVectorValue),
3114
3115 UnknownOrdinal_(u64),
3116 }
3117
3118 impl ConfigValue {
3119 pub fn is_unknown(&self) -> bool {
3120 #[allow(unreachable_patterns)]
3121 match self {
3122 Self::UnknownOrdinal_(_) => true,
3123 _ => false,
3124 }
3125 }
3126 }
3127
3128 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigValue<'static>, ___E> for ConfigValue
3129 where
3130 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3131 ___E: ::fidl_next::Encoder,
3132 {
3133 #[inline]
3134 fn encode(
3135 self,
3136 encoder: &mut ___E,
3137 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValue<'static>>,
3138 _: (),
3139 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3140 ::fidl_next::munge!(let crate::wire::ConfigValue { raw, _phantom: _ } = out);
3141
3142 match self {
3143 Self::Single(value) => ::fidl_next::wire::Union::encode_as::<
3144 ___E,
3145 crate::wire::ConfigSingleValue<'static>,
3146 >(value, 1, encoder, raw, ())?,
3147
3148 Self::Vector(value) => ::fidl_next::wire::Union::encode_as::<
3149 ___E,
3150 crate::wire::ConfigVectorValue<'static>,
3151 >(value, 2, encoder, raw, ())?,
3152
3153 Self::UnknownOrdinal_(ordinal) => {
3154 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
3155 }
3156 }
3157
3158 Ok(())
3159 }
3160 }
3161
3162 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigValue<'static>, ___E>
3163 for &'a ConfigValue
3164 where
3165 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3166 ___E: ::fidl_next::Encoder,
3167 {
3168 #[inline]
3169 fn encode(
3170 self,
3171 encoder: &mut ___E,
3172 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValue<'static>>,
3173 _: (),
3174 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3175 ::fidl_next::munge!(let crate::wire::ConfigValue { raw, _phantom: _ } = out);
3176
3177 match self {
3178 ConfigValue::Single(value) => ::fidl_next::wire::Union::encode_as::<
3179 ___E,
3180 crate::wire::ConfigSingleValue<'static>,
3181 >(value, 1, encoder, raw, ())?,
3182
3183 ConfigValue::Vector(value) => ::fidl_next::wire::Union::encode_as::<
3184 ___E,
3185 crate::wire::ConfigVectorValue<'static>,
3186 >(value, 2, encoder, raw, ())?,
3187
3188 ConfigValue::UnknownOrdinal_(ordinal) => {
3189 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
3190 }
3191 }
3192
3193 Ok(())
3194 }
3195 }
3196
3197 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::ConfigValue<'static>, ___E>
3198 for ConfigValue
3199 where
3200 ___E: ?Sized,
3201 ConfigValue: ::fidl_next::Encode<crate::wire::ConfigValue<'static>, ___E>,
3202 {
3203 #[inline]
3204 fn encode_option(
3205 this: ::core::option::Option<Self>,
3206 encoder: &mut ___E,
3207 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigValue<'static>>,
3208 _: (),
3209 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3210 ::fidl_next::munge!(let crate::wire_optional::ConfigValue { raw, _phantom: _ } = &mut *out);
3211
3212 if let Some(inner) = this {
3213 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
3214 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
3215 } else {
3216 ::fidl_next::wire::Union::encode_absent(raw);
3217 }
3218
3219 Ok(())
3220 }
3221 }
3222
3223 unsafe impl<'a, ___E>
3224 ::fidl_next::EncodeOption<crate::wire_optional::ConfigValue<'static>, ___E>
3225 for &'a ConfigValue
3226 where
3227 ___E: ?Sized,
3228 &'a ConfigValue: ::fidl_next::Encode<crate::wire::ConfigValue<'static>, ___E>,
3229 {
3230 #[inline]
3231 fn encode_option(
3232 this: ::core::option::Option<Self>,
3233 encoder: &mut ___E,
3234 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigValue<'static>>,
3235 _: (),
3236 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3237 ::fidl_next::munge!(let crate::wire_optional::ConfigValue { raw, _phantom: _ } = &mut *out);
3238
3239 if let Some(inner) = this {
3240 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
3241 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
3242 } else {
3243 ::fidl_next::wire::Union::encode_absent(raw);
3244 }
3245
3246 Ok(())
3247 }
3248 }
3249
3250 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigValue<'de>> for ConfigValue {
3251 #[inline]
3252 fn from_wire(wire: crate::wire::ConfigValue<'de>) -> Self {
3253 let wire = ::core::mem::ManuallyDrop::new(wire);
3254 match wire.raw.ordinal() {
3255 1 => Self::Single(::fidl_next::FromWire::from_wire(unsafe {
3256 wire.raw.get().read_unchecked::<crate::wire::ConfigSingleValue<'de>>()
3257 })),
3258
3259 2 => Self::Vector(::fidl_next::FromWire::from_wire(unsafe {
3260 wire.raw.get().read_unchecked::<crate::wire::ConfigVectorValue<'de>>()
3261 })),
3262
3263 ord => return Self::UnknownOrdinal_(ord as u64),
3264 }
3265 }
3266 }
3267
3268 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigValue<'de>> for ConfigValue {
3269 #[inline]
3270 fn from_wire_ref(wire: &crate::wire::ConfigValue<'de>) -> Self {
3271 match wire.raw.ordinal() {
3272 1 => Self::Single(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3273 wire.raw.get().deref_unchecked::<crate::wire::ConfigSingleValue<'de>>()
3274 })),
3275
3276 2 => Self::Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3277 wire.raw.get().deref_unchecked::<crate::wire::ConfigVectorValue<'de>>()
3278 })),
3279
3280 ord => return Self::UnknownOrdinal_(ord as u64),
3281 }
3282 }
3283 }
3284
3285 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigValue<'de>> for ConfigValue {
3286 #[inline]
3287 fn from_wire_option(
3288 wire: crate::wire_optional::ConfigValue<'de>,
3289 ) -> ::core::option::Option<Self> {
3290 if let Some(inner) = wire.into_option() {
3291 Some(::fidl_next::FromWire::from_wire(inner))
3292 } else {
3293 None
3294 }
3295 }
3296 }
3297
3298 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigValue<'de>> for Box<ConfigValue> {
3299 #[inline]
3300 fn from_wire_option(
3301 wire: crate::wire_optional::ConfigValue<'de>,
3302 ) -> ::core::option::Option<Self> {
3303 <
3304 ConfigValue as ::fidl_next::FromWireOption<crate::wire_optional::ConfigValue<'de>>
3305 >::from_wire_option(wire).map(Box::new)
3306 }
3307 }
3308
3309 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::ConfigValue<'de>>
3310 for Box<ConfigValue>
3311 {
3312 #[inline]
3313 fn from_wire_option_ref(
3314 wire: &crate::wire_optional::ConfigValue<'de>,
3315 ) -> ::core::option::Option<Self> {
3316 if let Some(inner) = wire.as_ref() {
3317 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
3318 } else {
3319 None
3320 }
3321 }
3322 }
3323
3324 #[doc = " Declares a configuration capability.\n\n To learn more about configuration capabilities, see:\n https://fuchsia.dev/fuchsia-src/glossary#configuration-capability\n or:\n https://fuchsia.dev/fuchsia-src/docs/concepts/components/v2/capabilities/configuration\n"]
3325 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3326 pub struct Configuration {
3327 pub name: ::core::option::Option<::std::string::String>,
3328
3329 pub value: ::core::option::Option<crate::natural::ConfigValue>,
3330 }
3331
3332 impl Configuration {
3333 fn __max_ordinal(&self) -> usize {
3334 if self.value.is_some() {
3335 return 2;
3336 }
3337
3338 if self.name.is_some() {
3339 return 1;
3340 }
3341
3342 0
3343 }
3344 }
3345
3346 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Configuration<'static>, ___E> for Configuration
3347 where
3348 ___E: ::fidl_next::Encoder + ?Sized,
3349 {
3350 #[inline]
3351 fn encode(
3352 mut self,
3353 encoder: &mut ___E,
3354 out: &mut ::core::mem::MaybeUninit<crate::wire::Configuration<'static>>,
3355 _: (),
3356 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3357 ::fidl_next::munge!(let crate::wire::Configuration { table } = out);
3358
3359 let max_ord = self.__max_ordinal();
3360
3361 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3362 ::fidl_next::Wire::zero_padding(&mut out);
3363
3364 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3365 ::fidl_next::wire::Envelope,
3366 >(encoder, max_ord);
3367
3368 for i in 1..=max_ord {
3369 match i {
3370 2 => {
3371 if let Some(value) = self.value.take() {
3372 ::fidl_next::wire::Envelope::encode_value::<
3373 crate::wire::ConfigValue<'static>,
3374 ___E,
3375 >(
3376 value, preallocated.encoder, &mut out, ()
3377 )?;
3378 } else {
3379 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3380 }
3381 }
3382
3383 1 => {
3384 if let Some(value) = self.name.take() {
3385 ::fidl_next::wire::Envelope::encode_value::<
3386 ::fidl_next::wire::String<'static>,
3387 ___E,
3388 >(
3389 value, preallocated.encoder, &mut out, 100
3390 )?;
3391 } else {
3392 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3393 }
3394 }
3395
3396 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3397 }
3398 unsafe {
3399 preallocated.write_next(out.assume_init_ref());
3400 }
3401 }
3402
3403 ::fidl_next::wire::Table::encode_len(table, max_ord);
3404
3405 Ok(())
3406 }
3407 }
3408
3409 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Configuration<'static>, ___E>
3410 for &'a Configuration
3411 where
3412 ___E: ::fidl_next::Encoder + ?Sized,
3413 {
3414 #[inline]
3415 fn encode(
3416 self,
3417 encoder: &mut ___E,
3418 out: &mut ::core::mem::MaybeUninit<crate::wire::Configuration<'static>>,
3419 _: (),
3420 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3421 ::fidl_next::munge!(let crate::wire::Configuration { table } = out);
3422
3423 let max_ord = self.__max_ordinal();
3424
3425 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3426 ::fidl_next::Wire::zero_padding(&mut out);
3427
3428 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3429 ::fidl_next::wire::Envelope,
3430 >(encoder, max_ord);
3431
3432 for i in 1..=max_ord {
3433 match i {
3434 2 => {
3435 if let Some(value) = &self.value {
3436 ::fidl_next::wire::Envelope::encode_value::<
3437 crate::wire::ConfigValue<'static>,
3438 ___E,
3439 >(
3440 value, preallocated.encoder, &mut out, ()
3441 )?;
3442 } else {
3443 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3444 }
3445 }
3446
3447 1 => {
3448 if let Some(value) = &self.name {
3449 ::fidl_next::wire::Envelope::encode_value::<
3450 ::fidl_next::wire::String<'static>,
3451 ___E,
3452 >(
3453 value, preallocated.encoder, &mut out, 100
3454 )?;
3455 } else {
3456 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3457 }
3458 }
3459
3460 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3461 }
3462 unsafe {
3463 preallocated.write_next(out.assume_init_ref());
3464 }
3465 }
3466
3467 ::fidl_next::wire::Table::encode_len(table, max_ord);
3468
3469 Ok(())
3470 }
3471 }
3472
3473 impl<'de> ::fidl_next::FromWire<crate::wire::Configuration<'de>> for Configuration {
3474 #[inline]
3475 fn from_wire(wire_: crate::wire::Configuration<'de>) -> Self {
3476 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3477
3478 let name = wire_.table.get(1);
3479
3480 let value = wire_.table.get(2);
3481
3482 Self {
3483 name: name.map(|envelope| {
3484 ::fidl_next::FromWire::from_wire(unsafe {
3485 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
3486 })
3487 }),
3488
3489 value: value.map(|envelope| {
3490 ::fidl_next::FromWire::from_wire(unsafe {
3491 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
3492 })
3493 }),
3494 }
3495 }
3496 }
3497
3498 impl<'de> ::fidl_next::FromWireRef<crate::wire::Configuration<'de>> for Configuration {
3499 #[inline]
3500 fn from_wire_ref(wire: &crate::wire::Configuration<'de>) -> Self {
3501 Self {
3502 name: wire.table.get(1).map(|envelope| {
3503 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3504 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
3505 })
3506 }),
3507
3508 value: wire.table.get(2).map(|envelope| {
3509 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3510 envelope.deref_unchecked::<crate::wire::ConfigValue<'de>>()
3511 })
3512 }),
3513 }
3514 }
3515 }
3516
3517 #[doc = " Path in a dictionary. The format is similar to a directory path, except no `.` or `..`.\n is allowed and each path segment must conform to the format of the `name` type.\n\n The \"dirname\" (first to the penultimate segment, or empty if there is one\n segment) represents a sequence of nested dictionaries.\n The \"basename\" (last segment) identifies a capability in the last nested\n dictionary.\n"]
3518 pub type DictionaryPath = ::std::string::String;
3519
3520 #[doc = " `DeliveryType` may be used when declaring a capability, and specifies under\n what conditions the framework will open the capability from the provider\n component\'s outgoing directory when there is a request for this capability.\n"]
3521 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3522 #[repr(u32)]
3523 pub enum DeliveryType {
3524 Immediate = 0,
3525 OnReadable = 1,
3526 UnknownOrdinal_(u32) = 2,
3527 }
3528 impl ::std::convert::From<u32> for DeliveryType {
3529 fn from(value: u32) -> Self {
3530 match value {
3531 0 => Self::Immediate,
3532 1 => Self::OnReadable,
3533
3534 _ => Self::UnknownOrdinal_(value),
3535 }
3536 }
3537 }
3538
3539 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeliveryType, ___E> for DeliveryType
3540 where
3541 ___E: ?Sized,
3542 {
3543 #[inline]
3544 fn encode(
3545 self,
3546 encoder: &mut ___E,
3547 out: &mut ::core::mem::MaybeUninit<crate::wire::DeliveryType>,
3548 _: (),
3549 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3550 ::fidl_next::Encode::encode(&self, encoder, out, ())
3551 }
3552 }
3553
3554 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeliveryType, ___E> for &'a DeliveryType
3555 where
3556 ___E: ?Sized,
3557 {
3558 #[inline]
3559 fn encode(
3560 self,
3561 encoder: &mut ___E,
3562 out: &mut ::core::mem::MaybeUninit<crate::wire::DeliveryType>,
3563 _: (),
3564 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3565 ::fidl_next::munge!(let crate::wire::DeliveryType { value } = out);
3566 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
3567 DeliveryType::Immediate => 0,
3568
3569 DeliveryType::OnReadable => 1,
3570
3571 DeliveryType::UnknownOrdinal_(value) => value,
3572 }));
3573
3574 Ok(())
3575 }
3576 }
3577
3578 impl ::core::convert::From<crate::wire::DeliveryType> for DeliveryType {
3579 fn from(wire: crate::wire::DeliveryType) -> Self {
3580 match u32::from(wire.value) {
3581 0 => Self::Immediate,
3582
3583 1 => Self::OnReadable,
3584
3585 value => Self::UnknownOrdinal_(value),
3586 }
3587 }
3588 }
3589
3590 impl ::fidl_next::FromWire<crate::wire::DeliveryType> for DeliveryType {
3591 #[inline]
3592 fn from_wire(wire: crate::wire::DeliveryType) -> Self {
3593 Self::from(wire)
3594 }
3595 }
3596
3597 impl ::fidl_next::FromWireRef<crate::wire::DeliveryType> for DeliveryType {
3598 #[inline]
3599 fn from_wire_ref(wire: &crate::wire::DeliveryType) -> Self {
3600 Self::from(*wire)
3601 }
3602 }
3603
3604 #[doc = " Declares a protocol capability backed by this component.\n\n To learn more about protocols, see:\n https://fuchsia.dev/fuchsia-src/glossary#protocol\n"]
3605 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3606 pub struct Protocol {
3607 pub name: ::core::option::Option<::std::string::String>,
3608
3609 pub source_path: ::core::option::Option<::std::string::String>,
3610
3611 pub delivery: ::core::option::Option<crate::natural::DeliveryType>,
3612 }
3613
3614 impl Protocol {
3615 fn __max_ordinal(&self) -> usize {
3616 if self.delivery.is_some() {
3617 return 3;
3618 }
3619
3620 if self.source_path.is_some() {
3621 return 2;
3622 }
3623
3624 if self.name.is_some() {
3625 return 1;
3626 }
3627
3628 0
3629 }
3630 }
3631
3632 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Protocol<'static>, ___E> for Protocol
3633 where
3634 ___E: ::fidl_next::Encoder + ?Sized,
3635 {
3636 #[inline]
3637 fn encode(
3638 mut self,
3639 encoder: &mut ___E,
3640 out: &mut ::core::mem::MaybeUninit<crate::wire::Protocol<'static>>,
3641 _: (),
3642 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3643 ::fidl_next::munge!(let crate::wire::Protocol { table } = out);
3644
3645 let max_ord = self.__max_ordinal();
3646
3647 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3648 ::fidl_next::Wire::zero_padding(&mut out);
3649
3650 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3651 ::fidl_next::wire::Envelope,
3652 >(encoder, max_ord);
3653
3654 for i in 1..=max_ord {
3655 match i {
3656 3 => {
3657 if let Some(value) = self.delivery.take() {
3658 ::fidl_next::wire::Envelope::encode_value::<
3659 crate::wire::DeliveryType,
3660 ___E,
3661 >(
3662 value, preallocated.encoder, &mut out, ()
3663 )?;
3664 } else {
3665 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3666 }
3667 }
3668
3669 2 => {
3670 if let Some(value) = self.source_path.take() {
3671 ::fidl_next::wire::Envelope::encode_value::<
3672 ::fidl_next::wire::String<'static>,
3673 ___E,
3674 >(
3675 value, preallocated.encoder, &mut out, 1024
3676 )?;
3677 } else {
3678 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3679 }
3680 }
3681
3682 1 => {
3683 if let Some(value) = self.name.take() {
3684 ::fidl_next::wire::Envelope::encode_value::<
3685 ::fidl_next::wire::String<'static>,
3686 ___E,
3687 >(
3688 value, preallocated.encoder, &mut out, 100
3689 )?;
3690 } else {
3691 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3692 }
3693 }
3694
3695 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3696 }
3697 unsafe {
3698 preallocated.write_next(out.assume_init_ref());
3699 }
3700 }
3701
3702 ::fidl_next::wire::Table::encode_len(table, max_ord);
3703
3704 Ok(())
3705 }
3706 }
3707
3708 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Protocol<'static>, ___E> for &'a Protocol
3709 where
3710 ___E: ::fidl_next::Encoder + ?Sized,
3711 {
3712 #[inline]
3713 fn encode(
3714 self,
3715 encoder: &mut ___E,
3716 out: &mut ::core::mem::MaybeUninit<crate::wire::Protocol<'static>>,
3717 _: (),
3718 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3719 ::fidl_next::munge!(let crate::wire::Protocol { table } = out);
3720
3721 let max_ord = self.__max_ordinal();
3722
3723 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
3724 ::fidl_next::Wire::zero_padding(&mut out);
3725
3726 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
3727 ::fidl_next::wire::Envelope,
3728 >(encoder, max_ord);
3729
3730 for i in 1..=max_ord {
3731 match i {
3732 3 => {
3733 if let Some(value) = &self.delivery {
3734 ::fidl_next::wire::Envelope::encode_value::<
3735 crate::wire::DeliveryType,
3736 ___E,
3737 >(
3738 value, preallocated.encoder, &mut out, ()
3739 )?;
3740 } else {
3741 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3742 }
3743 }
3744
3745 2 => {
3746 if let Some(value) = &self.source_path {
3747 ::fidl_next::wire::Envelope::encode_value::<
3748 ::fidl_next::wire::String<'static>,
3749 ___E,
3750 >(
3751 value, preallocated.encoder, &mut out, 1024
3752 )?;
3753 } else {
3754 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3755 }
3756 }
3757
3758 1 => {
3759 if let Some(value) = &self.name {
3760 ::fidl_next::wire::Envelope::encode_value::<
3761 ::fidl_next::wire::String<'static>,
3762 ___E,
3763 >(
3764 value, preallocated.encoder, &mut out, 100
3765 )?;
3766 } else {
3767 ::fidl_next::wire::Envelope::encode_zero(&mut out)
3768 }
3769 }
3770
3771 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
3772 }
3773 unsafe {
3774 preallocated.write_next(out.assume_init_ref());
3775 }
3776 }
3777
3778 ::fidl_next::wire::Table::encode_len(table, max_ord);
3779
3780 Ok(())
3781 }
3782 }
3783
3784 impl<'de> ::fidl_next::FromWire<crate::wire::Protocol<'de>> for Protocol {
3785 #[inline]
3786 fn from_wire(wire_: crate::wire::Protocol<'de>) -> Self {
3787 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3788
3789 let name = wire_.table.get(1);
3790
3791 let source_path = wire_.table.get(2);
3792
3793 let delivery = wire_.table.get(3);
3794
3795 Self {
3796 name: name.map(|envelope| {
3797 ::fidl_next::FromWire::from_wire(unsafe {
3798 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
3799 })
3800 }),
3801
3802 source_path: source_path.map(|envelope| {
3803 ::fidl_next::FromWire::from_wire(unsafe {
3804 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
3805 })
3806 }),
3807
3808 delivery: delivery.map(|envelope| {
3809 ::fidl_next::FromWire::from_wire(unsafe {
3810 envelope.read_unchecked::<crate::wire::DeliveryType>()
3811 })
3812 }),
3813 }
3814 }
3815 }
3816
3817 impl<'de> ::fidl_next::FromWireRef<crate::wire::Protocol<'de>> for Protocol {
3818 #[inline]
3819 fn from_wire_ref(wire: &crate::wire::Protocol<'de>) -> Self {
3820 Self {
3821 name: wire.table.get(1).map(|envelope| {
3822 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3823 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
3824 })
3825 }),
3826
3827 source_path: wire.table.get(2).map(|envelope| {
3828 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3829 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
3830 })
3831 }),
3832
3833 delivery: wire.table.get(3).map(|envelope| {
3834 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3835 envelope.deref_unchecked::<crate::wire::DeliveryType>()
3836 })
3837 }),
3838 }
3839 }
3840 }
3841
3842 #[doc = " A reference to the environment.\n"]
3843 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3844 #[repr(C)]
3845 pub struct EnvironmentRef {}
3846
3847 unsafe impl<___E> ::fidl_next::Encode<crate::wire::EnvironmentRef, ___E> for EnvironmentRef
3848 where
3849 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3850 {
3851 #[inline]
3852 fn encode(
3853 self,
3854 encoder_: &mut ___E,
3855 out_: &mut ::core::mem::MaybeUninit<crate::wire::EnvironmentRef>,
3856 _: (),
3857 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3858 ::fidl_next::munge! {
3859 let crate::wire::EnvironmentRef {
3860
3861 _empty,
3862
3863 } = out_;
3864 }
3865
3866 let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
3867
3868 Ok(())
3869 }
3870 }
3871
3872 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EnvironmentRef, ___E> for &'a EnvironmentRef
3873 where
3874 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3875 {
3876 #[inline]
3877 fn encode(
3878 self,
3879 encoder_: &mut ___E,
3880 out_: &mut ::core::mem::MaybeUninit<crate::wire::EnvironmentRef>,
3881 _: (),
3882 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3883 ::fidl_next::munge! {
3884 let crate::wire::EnvironmentRef {
3885
3886 _empty,
3887
3888
3889 } = out_;
3890 }
3891
3892 let _ = _empty.write(::fidl_next::wire::EmptyStruct::Zero);
3893
3894 Ok(())
3895 }
3896 }
3897
3898 unsafe impl<___E>
3899 ::fidl_next::EncodeOption<
3900 ::fidl_next::wire::Box<'static, crate::wire::EnvironmentRef>,
3901 ___E,
3902 > for EnvironmentRef
3903 where
3904 ___E: ::fidl_next::Encoder + ?Sized,
3905 EnvironmentRef: ::fidl_next::Encode<crate::wire::EnvironmentRef, ___E>,
3906 {
3907 #[inline]
3908 fn encode_option(
3909 this: ::core::option::Option<Self>,
3910 encoder: &mut ___E,
3911 out: &mut ::core::mem::MaybeUninit<
3912 ::fidl_next::wire::Box<'static, crate::wire::EnvironmentRef>,
3913 >,
3914 _: (),
3915 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3916 if let Some(inner) = this {
3917 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3918 ::fidl_next::wire::Box::encode_present(out);
3919 } else {
3920 ::fidl_next::wire::Box::encode_absent(out);
3921 }
3922
3923 Ok(())
3924 }
3925 }
3926
3927 unsafe impl<'a, ___E>
3928 ::fidl_next::EncodeOption<
3929 ::fidl_next::wire::Box<'static, crate::wire::EnvironmentRef>,
3930 ___E,
3931 > for &'a EnvironmentRef
3932 where
3933 ___E: ::fidl_next::Encoder + ?Sized,
3934 &'a EnvironmentRef: ::fidl_next::Encode<crate::wire::EnvironmentRef, ___E>,
3935 {
3936 #[inline]
3937 fn encode_option(
3938 this: ::core::option::Option<Self>,
3939 encoder: &mut ___E,
3940 out: &mut ::core::mem::MaybeUninit<
3941 ::fidl_next::wire::Box<'static, crate::wire::EnvironmentRef>,
3942 >,
3943 _: (),
3944 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3945 if let Some(inner) = this {
3946 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3947 ::fidl_next::wire::Box::encode_present(out);
3948 } else {
3949 ::fidl_next::wire::Box::encode_absent(out);
3950 }
3951
3952 Ok(())
3953 }
3954 }
3955
3956 impl ::fidl_next::FromWire<crate::wire::EnvironmentRef> for EnvironmentRef {
3957 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::EnvironmentRef, Self> =
3958 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
3959
3960 #[inline]
3961 fn from_wire(wire: crate::wire::EnvironmentRef) -> Self {
3962 Self {}
3963 }
3964 }
3965
3966 impl ::fidl_next::FromWireRef<crate::wire::EnvironmentRef> for EnvironmentRef {
3967 #[inline]
3968 fn from_wire_ref(wire: &crate::wire::EnvironmentRef) -> Self {
3969 Self {}
3970 }
3971 }
3972
3973 #[doc = " A reference to a capability source or destination relative to this\n component.\n"]
3974 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3975 pub enum Ref {
3976 Parent(crate::natural::ParentRef),
3977
3978 Self_(crate::natural::SelfRef),
3979
3980 Child(crate::natural::ChildRef),
3981
3982 Collection(crate::natural::CollectionRef),
3983
3984 Framework(crate::natural::FrameworkRef),
3985
3986 Capability(crate::natural::CapabilityRef),
3987
3988 Debug(crate::natural::DebugRef),
3989
3990 VoidType(crate::natural::VoidRef),
3991
3992 Environment(crate::natural::EnvironmentRef),
3993
3994 UnknownOrdinal_(u64),
3995 }
3996
3997 impl Ref {
3998 pub fn is_unknown(&self) -> bool {
3999 #[allow(unreachable_patterns)]
4000 match self {
4001 Self::UnknownOrdinal_(_) => true,
4002 _ => false,
4003 }
4004 }
4005 }
4006
4007 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Ref<'static>, ___E> for Ref
4008 where
4009 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4010 ___E: ::fidl_next::Encoder,
4011 {
4012 #[inline]
4013 fn encode(
4014 self,
4015 encoder: &mut ___E,
4016 out: &mut ::core::mem::MaybeUninit<crate::wire::Ref<'static>>,
4017 _: (),
4018 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4019 ::fidl_next::munge!(let crate::wire::Ref { raw, _phantom: _ } = out);
4020
4021 match self {
4022 Self::Parent(value) => ::fidl_next::wire::Union::encode_as::<
4023 ___E,
4024 crate::wire::ParentRef,
4025 >(value, 1, encoder, raw, ())?,
4026
4027 Self::Self_(value) => ::fidl_next::wire::Union::encode_as::<
4028 ___E,
4029 crate::wire::SelfRef,
4030 >(value, 2, encoder, raw, ())?,
4031
4032 Self::Child(value) => ::fidl_next::wire::Union::encode_as::<
4033 ___E,
4034 crate::wire::ChildRef<'static>,
4035 >(value, 3, encoder, raw, ())?,
4036
4037 Self::Collection(value) => ::fidl_next::wire::Union::encode_as::<
4038 ___E,
4039 crate::wire::CollectionRef<'static>,
4040 >(value, 4, encoder, raw, ())?,
4041
4042 Self::Framework(value) => ::fidl_next::wire::Union::encode_as::<
4043 ___E,
4044 crate::wire::FrameworkRef,
4045 >(value, 5, encoder, raw, ())?,
4046
4047 Self::Capability(value) => ::fidl_next::wire::Union::encode_as::<
4048 ___E,
4049 crate::wire::CapabilityRef<'static>,
4050 >(value, 6, encoder, raw, ())?,
4051
4052 Self::Debug(value) => ::fidl_next::wire::Union::encode_as::<
4053 ___E,
4054 crate::wire::DebugRef,
4055 >(value, 7, encoder, raw, ())?,
4056
4057 Self::VoidType(value) => ::fidl_next::wire::Union::encode_as::<
4058 ___E,
4059 crate::wire::VoidRef,
4060 >(value, 8, encoder, raw, ())?,
4061
4062 Self::Environment(value) => ::fidl_next::wire::Union::encode_as::<
4063 ___E,
4064 crate::wire::EnvironmentRef,
4065 >(value, 9, encoder, raw, ())?,
4066
4067 Self::UnknownOrdinal_(ordinal) => {
4068 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
4069 }
4070 }
4071
4072 Ok(())
4073 }
4074 }
4075
4076 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Ref<'static>, ___E> for &'a Ref
4077 where
4078 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4079 ___E: ::fidl_next::Encoder,
4080 {
4081 #[inline]
4082 fn encode(
4083 self,
4084 encoder: &mut ___E,
4085 out: &mut ::core::mem::MaybeUninit<crate::wire::Ref<'static>>,
4086 _: (),
4087 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4088 ::fidl_next::munge!(let crate::wire::Ref { raw, _phantom: _ } = out);
4089
4090 match self {
4091 Ref::Parent(value) => ::fidl_next::wire::Union::encode_as::<
4092 ___E,
4093 crate::wire::ParentRef,
4094 >(value, 1, encoder, raw, ())?,
4095
4096 Ref::Self_(value) => ::fidl_next::wire::Union::encode_as::<
4097 ___E,
4098 crate::wire::SelfRef,
4099 >(value, 2, encoder, raw, ())?,
4100
4101 Ref::Child(value) => ::fidl_next::wire::Union::encode_as::<
4102 ___E,
4103 crate::wire::ChildRef<'static>,
4104 >(value, 3, encoder, raw, ())?,
4105
4106 Ref::Collection(value) => ::fidl_next::wire::Union::encode_as::<
4107 ___E,
4108 crate::wire::CollectionRef<'static>,
4109 >(value, 4, encoder, raw, ())?,
4110
4111 Ref::Framework(value) => ::fidl_next::wire::Union::encode_as::<
4112 ___E,
4113 crate::wire::FrameworkRef,
4114 >(value, 5, encoder, raw, ())?,
4115
4116 Ref::Capability(value) => ::fidl_next::wire::Union::encode_as::<
4117 ___E,
4118 crate::wire::CapabilityRef<'static>,
4119 >(value, 6, encoder, raw, ())?,
4120
4121 Ref::Debug(value) => ::fidl_next::wire::Union::encode_as::<
4122 ___E,
4123 crate::wire::DebugRef,
4124 >(value, 7, encoder, raw, ())?,
4125
4126 Ref::VoidType(value) => ::fidl_next::wire::Union::encode_as::<
4127 ___E,
4128 crate::wire::VoidRef,
4129 >(value, 8, encoder, raw, ())?,
4130
4131 Ref::Environment(value) => ::fidl_next::wire::Union::encode_as::<
4132 ___E,
4133 crate::wire::EnvironmentRef,
4134 >(value, 9, encoder, raw, ())?,
4135
4136 Ref::UnknownOrdinal_(ordinal) => {
4137 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
4138 }
4139 }
4140
4141 Ok(())
4142 }
4143 }
4144
4145 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::Ref<'static>, ___E> for Ref
4146 where
4147 ___E: ?Sized,
4148 Ref: ::fidl_next::Encode<crate::wire::Ref<'static>, ___E>,
4149 {
4150 #[inline]
4151 fn encode_option(
4152 this: ::core::option::Option<Self>,
4153 encoder: &mut ___E,
4154 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Ref<'static>>,
4155 _: (),
4156 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4157 ::fidl_next::munge!(let crate::wire_optional::Ref { raw, _phantom: _ } = &mut *out);
4158
4159 if let Some(inner) = this {
4160 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
4161 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
4162 } else {
4163 ::fidl_next::wire::Union::encode_absent(raw);
4164 }
4165
4166 Ok(())
4167 }
4168 }
4169
4170 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::Ref<'static>, ___E>
4171 for &'a Ref
4172 where
4173 ___E: ?Sized,
4174 &'a Ref: ::fidl_next::Encode<crate::wire::Ref<'static>, ___E>,
4175 {
4176 #[inline]
4177 fn encode_option(
4178 this: ::core::option::Option<Self>,
4179 encoder: &mut ___E,
4180 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Ref<'static>>,
4181 _: (),
4182 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4183 ::fidl_next::munge!(let crate::wire_optional::Ref { raw, _phantom: _ } = &mut *out);
4184
4185 if let Some(inner) = this {
4186 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
4187 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
4188 } else {
4189 ::fidl_next::wire::Union::encode_absent(raw);
4190 }
4191
4192 Ok(())
4193 }
4194 }
4195
4196 impl<'de> ::fidl_next::FromWire<crate::wire::Ref<'de>> for Ref {
4197 #[inline]
4198 fn from_wire(wire: crate::wire::Ref<'de>) -> Self {
4199 let wire = ::core::mem::ManuallyDrop::new(wire);
4200 match wire.raw.ordinal() {
4201 1 => Self::Parent(::fidl_next::FromWire::from_wire(unsafe {
4202 wire.raw.get().read_unchecked::<crate::wire::ParentRef>()
4203 })),
4204
4205 2 => Self::Self_(::fidl_next::FromWire::from_wire(unsafe {
4206 wire.raw.get().read_unchecked::<crate::wire::SelfRef>()
4207 })),
4208
4209 3 => Self::Child(::fidl_next::FromWire::from_wire(unsafe {
4210 wire.raw.get().read_unchecked::<crate::wire::ChildRef<'de>>()
4211 })),
4212
4213 4 => Self::Collection(::fidl_next::FromWire::from_wire(unsafe {
4214 wire.raw.get().read_unchecked::<crate::wire::CollectionRef<'de>>()
4215 })),
4216
4217 5 => Self::Framework(::fidl_next::FromWire::from_wire(unsafe {
4218 wire.raw.get().read_unchecked::<crate::wire::FrameworkRef>()
4219 })),
4220
4221 6 => Self::Capability(::fidl_next::FromWire::from_wire(unsafe {
4222 wire.raw.get().read_unchecked::<crate::wire::CapabilityRef<'de>>()
4223 })),
4224
4225 7 => Self::Debug(::fidl_next::FromWire::from_wire(unsafe {
4226 wire.raw.get().read_unchecked::<crate::wire::DebugRef>()
4227 })),
4228
4229 8 => Self::VoidType(::fidl_next::FromWire::from_wire(unsafe {
4230 wire.raw.get().read_unchecked::<crate::wire::VoidRef>()
4231 })),
4232
4233 9 => Self::Environment(::fidl_next::FromWire::from_wire(unsafe {
4234 wire.raw.get().read_unchecked::<crate::wire::EnvironmentRef>()
4235 })),
4236
4237 ord => return Self::UnknownOrdinal_(ord as u64),
4238 }
4239 }
4240 }
4241
4242 impl<'de> ::fidl_next::FromWireRef<crate::wire::Ref<'de>> for Ref {
4243 #[inline]
4244 fn from_wire_ref(wire: &crate::wire::Ref<'de>) -> Self {
4245 match wire.raw.ordinal() {
4246 1 => Self::Parent(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4247 wire.raw.get().deref_unchecked::<crate::wire::ParentRef>()
4248 })),
4249
4250 2 => Self::Self_(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4251 wire.raw.get().deref_unchecked::<crate::wire::SelfRef>()
4252 })),
4253
4254 3 => Self::Child(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4255 wire.raw.get().deref_unchecked::<crate::wire::ChildRef<'de>>()
4256 })),
4257
4258 4 => Self::Collection(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4259 wire.raw.get().deref_unchecked::<crate::wire::CollectionRef<'de>>()
4260 })),
4261
4262 5 => Self::Framework(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4263 wire.raw.get().deref_unchecked::<crate::wire::FrameworkRef>()
4264 })),
4265
4266 6 => Self::Capability(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4267 wire.raw.get().deref_unchecked::<crate::wire::CapabilityRef<'de>>()
4268 })),
4269
4270 7 => Self::Debug(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4271 wire.raw.get().deref_unchecked::<crate::wire::DebugRef>()
4272 })),
4273
4274 8 => Self::VoidType(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4275 wire.raw.get().deref_unchecked::<crate::wire::VoidRef>()
4276 })),
4277
4278 9 => Self::Environment(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4279 wire.raw.get().deref_unchecked::<crate::wire::EnvironmentRef>()
4280 })),
4281
4282 ord => return Self::UnknownOrdinal_(ord as u64),
4283 }
4284 }
4285 }
4286
4287 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Ref<'de>> for Ref {
4288 #[inline]
4289 fn from_wire_option(wire: crate::wire_optional::Ref<'de>) -> ::core::option::Option<Self> {
4290 if let Some(inner) = wire.into_option() {
4291 Some(::fidl_next::FromWire::from_wire(inner))
4292 } else {
4293 None
4294 }
4295 }
4296 }
4297
4298 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Ref<'de>> for Box<Ref> {
4299 #[inline]
4300 fn from_wire_option(wire: crate::wire_optional::Ref<'de>) -> ::core::option::Option<Self> {
4301 <Ref as ::fidl_next::FromWireOption<crate::wire_optional::Ref<'de>>>::from_wire_option(
4302 wire,
4303 )
4304 .map(Box::new)
4305 }
4306 }
4307
4308 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::Ref<'de>> for Box<Ref> {
4309 #[inline]
4310 fn from_wire_option_ref(
4311 wire: &crate::wire_optional::Ref<'de>,
4312 ) -> ::core::option::Option<Self> {
4313 if let Some(inner) = wire.as_ref() {
4314 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
4315 } else {
4316 None
4317 }
4318 }
4319 }
4320
4321 #[doc = " Declares a storage capability backed by a directory from which data, cache,\n or meta storage can be offered.\n"]
4322 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4323 pub struct Storage {
4324 pub name: ::core::option::Option<::std::string::String>,
4325
4326 pub source: ::core::option::Option<crate::natural::Ref>,
4327
4328 pub backing_dir: ::core::option::Option<::std::string::String>,
4329
4330 pub subdir: ::core::option::Option<::std::string::String>,
4331
4332 pub storage_id: ::core::option::Option<crate::natural::StorageId>,
4333 }
4334
4335 impl Storage {
4336 fn __max_ordinal(&self) -> usize {
4337 if self.storage_id.is_some() {
4338 return 5;
4339 }
4340
4341 if self.subdir.is_some() {
4342 return 4;
4343 }
4344
4345 if self.backing_dir.is_some() {
4346 return 3;
4347 }
4348
4349 if self.source.is_some() {
4350 return 2;
4351 }
4352
4353 if self.name.is_some() {
4354 return 1;
4355 }
4356
4357 0
4358 }
4359 }
4360
4361 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Storage<'static>, ___E> for Storage
4362 where
4363 ___E: ::fidl_next::Encoder + ?Sized,
4364 {
4365 #[inline]
4366 fn encode(
4367 mut self,
4368 encoder: &mut ___E,
4369 out: &mut ::core::mem::MaybeUninit<crate::wire::Storage<'static>>,
4370 _: (),
4371 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4372 ::fidl_next::munge!(let crate::wire::Storage { table } = out);
4373
4374 let max_ord = self.__max_ordinal();
4375
4376 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4377 ::fidl_next::Wire::zero_padding(&mut out);
4378
4379 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4380 ::fidl_next::wire::Envelope,
4381 >(encoder, max_ord);
4382
4383 for i in 1..=max_ord {
4384 match i {
4385 5 => {
4386 if let Some(value) = self.storage_id.take() {
4387 ::fidl_next::wire::Envelope::encode_value::<
4388 crate::wire::StorageId,
4389 ___E,
4390 >(
4391 value, preallocated.encoder, &mut out, ()
4392 )?;
4393 } else {
4394 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4395 }
4396 }
4397
4398 4 => {
4399 if let Some(value) = self.subdir.take() {
4400 ::fidl_next::wire::Envelope::encode_value::<
4401 ::fidl_next::wire::String<'static>,
4402 ___E,
4403 >(
4404 value, preallocated.encoder, &mut out, 1024
4405 )?;
4406 } else {
4407 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4408 }
4409 }
4410
4411 3 => {
4412 if let Some(value) = self.backing_dir.take() {
4413 ::fidl_next::wire::Envelope::encode_value::<
4414 ::fidl_next::wire::String<'static>,
4415 ___E,
4416 >(
4417 value, preallocated.encoder, &mut out, 100
4418 )?;
4419 } else {
4420 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4421 }
4422 }
4423
4424 2 => {
4425 if let Some(value) = self.source.take() {
4426 ::fidl_next::wire::Envelope::encode_value::<
4427 crate::wire::Ref<'static>,
4428 ___E,
4429 >(
4430 value, preallocated.encoder, &mut out, ()
4431 )?;
4432 } else {
4433 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4434 }
4435 }
4436
4437 1 => {
4438 if let Some(value) = self.name.take() {
4439 ::fidl_next::wire::Envelope::encode_value::<
4440 ::fidl_next::wire::String<'static>,
4441 ___E,
4442 >(
4443 value, preallocated.encoder, &mut out, 100
4444 )?;
4445 } else {
4446 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4447 }
4448 }
4449
4450 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4451 }
4452 unsafe {
4453 preallocated.write_next(out.assume_init_ref());
4454 }
4455 }
4456
4457 ::fidl_next::wire::Table::encode_len(table, max_ord);
4458
4459 Ok(())
4460 }
4461 }
4462
4463 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Storage<'static>, ___E> for &'a Storage
4464 where
4465 ___E: ::fidl_next::Encoder + ?Sized,
4466 {
4467 #[inline]
4468 fn encode(
4469 self,
4470 encoder: &mut ___E,
4471 out: &mut ::core::mem::MaybeUninit<crate::wire::Storage<'static>>,
4472 _: (),
4473 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4474 ::fidl_next::munge!(let crate::wire::Storage { table } = out);
4475
4476 let max_ord = self.__max_ordinal();
4477
4478 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4479 ::fidl_next::Wire::zero_padding(&mut out);
4480
4481 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4482 ::fidl_next::wire::Envelope,
4483 >(encoder, max_ord);
4484
4485 for i in 1..=max_ord {
4486 match i {
4487 5 => {
4488 if let Some(value) = &self.storage_id {
4489 ::fidl_next::wire::Envelope::encode_value::<
4490 crate::wire::StorageId,
4491 ___E,
4492 >(
4493 value, preallocated.encoder, &mut out, ()
4494 )?;
4495 } else {
4496 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4497 }
4498 }
4499
4500 4 => {
4501 if let Some(value) = &self.subdir {
4502 ::fidl_next::wire::Envelope::encode_value::<
4503 ::fidl_next::wire::String<'static>,
4504 ___E,
4505 >(
4506 value, preallocated.encoder, &mut out, 1024
4507 )?;
4508 } else {
4509 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4510 }
4511 }
4512
4513 3 => {
4514 if let Some(value) = &self.backing_dir {
4515 ::fidl_next::wire::Envelope::encode_value::<
4516 ::fidl_next::wire::String<'static>,
4517 ___E,
4518 >(
4519 value, preallocated.encoder, &mut out, 100
4520 )?;
4521 } else {
4522 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4523 }
4524 }
4525
4526 2 => {
4527 if let Some(value) = &self.source {
4528 ::fidl_next::wire::Envelope::encode_value::<
4529 crate::wire::Ref<'static>,
4530 ___E,
4531 >(
4532 value, preallocated.encoder, &mut out, ()
4533 )?;
4534 } else {
4535 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4536 }
4537 }
4538
4539 1 => {
4540 if let Some(value) = &self.name {
4541 ::fidl_next::wire::Envelope::encode_value::<
4542 ::fidl_next::wire::String<'static>,
4543 ___E,
4544 >(
4545 value, preallocated.encoder, &mut out, 100
4546 )?;
4547 } else {
4548 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4549 }
4550 }
4551
4552 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4553 }
4554 unsafe {
4555 preallocated.write_next(out.assume_init_ref());
4556 }
4557 }
4558
4559 ::fidl_next::wire::Table::encode_len(table, max_ord);
4560
4561 Ok(())
4562 }
4563 }
4564
4565 impl<'de> ::fidl_next::FromWire<crate::wire::Storage<'de>> for Storage {
4566 #[inline]
4567 fn from_wire(wire_: crate::wire::Storage<'de>) -> Self {
4568 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4569
4570 let name = wire_.table.get(1);
4571
4572 let source = wire_.table.get(2);
4573
4574 let backing_dir = wire_.table.get(3);
4575
4576 let subdir = wire_.table.get(4);
4577
4578 let storage_id = wire_.table.get(5);
4579
4580 Self {
4581 name: name.map(|envelope| {
4582 ::fidl_next::FromWire::from_wire(unsafe {
4583 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4584 })
4585 }),
4586
4587 source: source.map(|envelope| {
4588 ::fidl_next::FromWire::from_wire(unsafe {
4589 envelope.read_unchecked::<crate::wire::Ref<'de>>()
4590 })
4591 }),
4592
4593 backing_dir: backing_dir.map(|envelope| {
4594 ::fidl_next::FromWire::from_wire(unsafe {
4595 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4596 })
4597 }),
4598
4599 subdir: subdir.map(|envelope| {
4600 ::fidl_next::FromWire::from_wire(unsafe {
4601 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4602 })
4603 }),
4604
4605 storage_id: storage_id.map(|envelope| {
4606 ::fidl_next::FromWire::from_wire(unsafe {
4607 envelope.read_unchecked::<crate::wire::StorageId>()
4608 })
4609 }),
4610 }
4611 }
4612 }
4613
4614 impl<'de> ::fidl_next::FromWireRef<crate::wire::Storage<'de>> for Storage {
4615 #[inline]
4616 fn from_wire_ref(wire: &crate::wire::Storage<'de>) -> Self {
4617 Self {
4618 name: wire.table.get(1).map(|envelope| {
4619 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4620 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
4621 })
4622 }),
4623
4624 source: wire.table.get(2).map(|envelope| {
4625 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4626 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
4627 })
4628 }),
4629
4630 backing_dir: wire.table.get(3).map(|envelope| {
4631 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4632 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
4633 })
4634 }),
4635
4636 subdir: wire.table.get(4).map(|envelope| {
4637 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4638 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
4639 })
4640 }),
4641
4642 storage_id: wire.table.get(5).map(|envelope| {
4643 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4644 envelope.deref_unchecked::<crate::wire::StorageId>()
4645 })
4646 }),
4647 }
4648 }
4649 }
4650
4651 #[doc = " Declares a dictionary capability.\n"]
4652 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4653 pub struct Dictionary {
4654 pub name: ::core::option::Option<::std::string::String>,
4655
4656 pub source: ::core::option::Option<crate::natural::Ref>,
4657
4658 pub source_dictionary: ::core::option::Option<::std::string::String>,
4659
4660 pub source_path: ::core::option::Option<::std::string::String>,
4661 }
4662
4663 impl Dictionary {
4664 fn __max_ordinal(&self) -> usize {
4665 if self.source_path.is_some() {
4666 return 4;
4667 }
4668
4669 if self.source_dictionary.is_some() {
4670 return 3;
4671 }
4672
4673 if self.source.is_some() {
4674 return 2;
4675 }
4676
4677 if self.name.is_some() {
4678 return 1;
4679 }
4680
4681 0
4682 }
4683 }
4684
4685 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Dictionary<'static>, ___E> for Dictionary
4686 where
4687 ___E: ::fidl_next::Encoder + ?Sized,
4688 {
4689 #[inline]
4690 fn encode(
4691 mut self,
4692 encoder: &mut ___E,
4693 out: &mut ::core::mem::MaybeUninit<crate::wire::Dictionary<'static>>,
4694 _: (),
4695 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4696 ::fidl_next::munge!(let crate::wire::Dictionary { table } = out);
4697
4698 let max_ord = self.__max_ordinal();
4699
4700 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4701 ::fidl_next::Wire::zero_padding(&mut out);
4702
4703 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4704 ::fidl_next::wire::Envelope,
4705 >(encoder, max_ord);
4706
4707 for i in 1..=max_ord {
4708 match i {
4709 4 => {
4710 if let Some(value) = self.source_path.take() {
4711 ::fidl_next::wire::Envelope::encode_value::<
4712 ::fidl_next::wire::String<'static>,
4713 ___E,
4714 >(
4715 value, preallocated.encoder, &mut out, 1024
4716 )?;
4717 } else {
4718 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4719 }
4720 }
4721
4722 3 => {
4723 if let Some(value) = self.source_dictionary.take() {
4724 ::fidl_next::wire::Envelope::encode_value::<
4725 ::fidl_next::wire::String<'static>,
4726 ___E,
4727 >(
4728 value, preallocated.encoder, &mut out, 1024
4729 )?;
4730 } else {
4731 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4732 }
4733 }
4734
4735 2 => {
4736 if let Some(value) = self.source.take() {
4737 ::fidl_next::wire::Envelope::encode_value::<
4738 crate::wire::Ref<'static>,
4739 ___E,
4740 >(
4741 value, preallocated.encoder, &mut out, ()
4742 )?;
4743 } else {
4744 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4745 }
4746 }
4747
4748 1 => {
4749 if let Some(value) = self.name.take() {
4750 ::fidl_next::wire::Envelope::encode_value::<
4751 ::fidl_next::wire::String<'static>,
4752 ___E,
4753 >(
4754 value, preallocated.encoder, &mut out, 100
4755 )?;
4756 } else {
4757 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4758 }
4759 }
4760
4761 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4762 }
4763 unsafe {
4764 preallocated.write_next(out.assume_init_ref());
4765 }
4766 }
4767
4768 ::fidl_next::wire::Table::encode_len(table, max_ord);
4769
4770 Ok(())
4771 }
4772 }
4773
4774 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Dictionary<'static>, ___E> for &'a Dictionary
4775 where
4776 ___E: ::fidl_next::Encoder + ?Sized,
4777 {
4778 #[inline]
4779 fn encode(
4780 self,
4781 encoder: &mut ___E,
4782 out: &mut ::core::mem::MaybeUninit<crate::wire::Dictionary<'static>>,
4783 _: (),
4784 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4785 ::fidl_next::munge!(let crate::wire::Dictionary { table } = out);
4786
4787 let max_ord = self.__max_ordinal();
4788
4789 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
4790 ::fidl_next::Wire::zero_padding(&mut out);
4791
4792 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
4793 ::fidl_next::wire::Envelope,
4794 >(encoder, max_ord);
4795
4796 for i in 1..=max_ord {
4797 match i {
4798 4 => {
4799 if let Some(value) = &self.source_path {
4800 ::fidl_next::wire::Envelope::encode_value::<
4801 ::fidl_next::wire::String<'static>,
4802 ___E,
4803 >(
4804 value, preallocated.encoder, &mut out, 1024
4805 )?;
4806 } else {
4807 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4808 }
4809 }
4810
4811 3 => {
4812 if let Some(value) = &self.source_dictionary {
4813 ::fidl_next::wire::Envelope::encode_value::<
4814 ::fidl_next::wire::String<'static>,
4815 ___E,
4816 >(
4817 value, preallocated.encoder, &mut out, 1024
4818 )?;
4819 } else {
4820 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4821 }
4822 }
4823
4824 2 => {
4825 if let Some(value) = &self.source {
4826 ::fidl_next::wire::Envelope::encode_value::<
4827 crate::wire::Ref<'static>,
4828 ___E,
4829 >(
4830 value, preallocated.encoder, &mut out, ()
4831 )?;
4832 } else {
4833 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4834 }
4835 }
4836
4837 1 => {
4838 if let Some(value) = &self.name {
4839 ::fidl_next::wire::Envelope::encode_value::<
4840 ::fidl_next::wire::String<'static>,
4841 ___E,
4842 >(
4843 value, preallocated.encoder, &mut out, 100
4844 )?;
4845 } else {
4846 ::fidl_next::wire::Envelope::encode_zero(&mut out)
4847 }
4848 }
4849
4850 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
4851 }
4852 unsafe {
4853 preallocated.write_next(out.assume_init_ref());
4854 }
4855 }
4856
4857 ::fidl_next::wire::Table::encode_len(table, max_ord);
4858
4859 Ok(())
4860 }
4861 }
4862
4863 impl<'de> ::fidl_next::FromWire<crate::wire::Dictionary<'de>> for Dictionary {
4864 #[inline]
4865 fn from_wire(wire_: crate::wire::Dictionary<'de>) -> Self {
4866 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4867
4868 let name = wire_.table.get(1);
4869
4870 let source = wire_.table.get(2);
4871
4872 let source_dictionary = wire_.table.get(3);
4873
4874 let source_path = wire_.table.get(4);
4875
4876 Self {
4877 name: name.map(|envelope| {
4878 ::fidl_next::FromWire::from_wire(unsafe {
4879 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4880 })
4881 }),
4882
4883 source: source.map(|envelope| {
4884 ::fidl_next::FromWire::from_wire(unsafe {
4885 envelope.read_unchecked::<crate::wire::Ref<'de>>()
4886 })
4887 }),
4888
4889 source_dictionary: source_dictionary.map(|envelope| {
4890 ::fidl_next::FromWire::from_wire(unsafe {
4891 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4892 })
4893 }),
4894
4895 source_path: source_path.map(|envelope| {
4896 ::fidl_next::FromWire::from_wire(unsafe {
4897 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
4898 })
4899 }),
4900 }
4901 }
4902 }
4903
4904 impl<'de> ::fidl_next::FromWireRef<crate::wire::Dictionary<'de>> for Dictionary {
4905 #[inline]
4906 fn from_wire_ref(wire: &crate::wire::Dictionary<'de>) -> Self {
4907 Self {
4908 name: wire.table.get(1).map(|envelope| {
4909 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4910 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
4911 })
4912 }),
4913
4914 source: wire.table.get(2).map(|envelope| {
4915 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4916 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
4917 })
4918 }),
4919
4920 source_dictionary: wire.table.get(3).map(|envelope| {
4921 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4922 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
4923 })
4924 }),
4925
4926 source_path: wire.table.get(4).map(|envelope| {
4927 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4928 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
4929 })
4930 }),
4931 }
4932 }
4933 }
4934
4935 #[doc = " Declares a capability defined by this component.\n"]
4936 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
4937 pub enum Capability {
4938 Service(crate::natural::Service),
4939
4940 Protocol(crate::natural::Protocol),
4941
4942 Directory(crate::natural::Directory),
4943
4944 Storage(crate::natural::Storage),
4945
4946 Runner(crate::natural::Runner),
4947
4948 Resolver(crate::natural::Resolver),
4949
4950 EventStream(crate::natural::EventStream),
4951
4952 Dictionary(crate::natural::Dictionary),
4953
4954 Config(crate::natural::Configuration),
4955
4956 UnknownOrdinal_(u64),
4957 }
4958
4959 impl Capability {
4960 pub fn is_unknown(&self) -> bool {
4961 #[allow(unreachable_patterns)]
4962 match self {
4963 Self::UnknownOrdinal_(_) => true,
4964 _ => false,
4965 }
4966 }
4967 }
4968
4969 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Capability<'static>, ___E> for Capability
4970 where
4971 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4972 ___E: ::fidl_next::Encoder,
4973 {
4974 #[inline]
4975 fn encode(
4976 self,
4977 encoder: &mut ___E,
4978 out: &mut ::core::mem::MaybeUninit<crate::wire::Capability<'static>>,
4979 _: (),
4980 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4981 ::fidl_next::munge!(let crate::wire::Capability { raw, _phantom: _ } = out);
4982
4983 match self {
4984 Self::Service(value) => ::fidl_next::wire::Union::encode_as::<
4985 ___E,
4986 crate::wire::Service<'static>,
4987 >(value, 1, encoder, raw, ())?,
4988
4989 Self::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
4990 ___E,
4991 crate::wire::Protocol<'static>,
4992 >(value, 2, encoder, raw, ())?,
4993
4994 Self::Directory(value) => ::fidl_next::wire::Union::encode_as::<
4995 ___E,
4996 crate::wire::Directory<'static>,
4997 >(value, 3, encoder, raw, ())?,
4998
4999 Self::Storage(value) => ::fidl_next::wire::Union::encode_as::<
5000 ___E,
5001 crate::wire::Storage<'static>,
5002 >(value, 4, encoder, raw, ())?,
5003
5004 Self::Runner(value) => ::fidl_next::wire::Union::encode_as::<
5005 ___E,
5006 crate::wire::Runner<'static>,
5007 >(value, 5, encoder, raw, ())?,
5008
5009 Self::Resolver(value) => ::fidl_next::wire::Union::encode_as::<
5010 ___E,
5011 crate::wire::Resolver<'static>,
5012 >(value, 6, encoder, raw, ())?,
5013
5014 Self::EventStream(value) => ::fidl_next::wire::Union::encode_as::<
5015 ___E,
5016 crate::wire::EventStream<'static>,
5017 >(value, 8, encoder, raw, ())?,
5018
5019 Self::Dictionary(value) => ::fidl_next::wire::Union::encode_as::<
5020 ___E,
5021 crate::wire::Dictionary<'static>,
5022 >(value, 9, encoder, raw, ())?,
5023
5024 Self::Config(value) => ::fidl_next::wire::Union::encode_as::<
5025 ___E,
5026 crate::wire::Configuration<'static>,
5027 >(value, 10, encoder, raw, ())?,
5028
5029 Self::UnknownOrdinal_(ordinal) => {
5030 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
5031 }
5032 }
5033
5034 Ok(())
5035 }
5036 }
5037
5038 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Capability<'static>, ___E> for &'a Capability
5039 where
5040 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5041 ___E: ::fidl_next::Encoder,
5042 {
5043 #[inline]
5044 fn encode(
5045 self,
5046 encoder: &mut ___E,
5047 out: &mut ::core::mem::MaybeUninit<crate::wire::Capability<'static>>,
5048 _: (),
5049 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5050 ::fidl_next::munge!(let crate::wire::Capability { raw, _phantom: _ } = out);
5051
5052 match self {
5053 Capability::Service(value) => ::fidl_next::wire::Union::encode_as::<
5054 ___E,
5055 crate::wire::Service<'static>,
5056 >(value, 1, encoder, raw, ())?,
5057
5058 Capability::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
5059 ___E,
5060 crate::wire::Protocol<'static>,
5061 >(value, 2, encoder, raw, ())?,
5062
5063 Capability::Directory(value) => ::fidl_next::wire::Union::encode_as::<
5064 ___E,
5065 crate::wire::Directory<'static>,
5066 >(value, 3, encoder, raw, ())?,
5067
5068 Capability::Storage(value) => ::fidl_next::wire::Union::encode_as::<
5069 ___E,
5070 crate::wire::Storage<'static>,
5071 >(value, 4, encoder, raw, ())?,
5072
5073 Capability::Runner(value) => ::fidl_next::wire::Union::encode_as::<
5074 ___E,
5075 crate::wire::Runner<'static>,
5076 >(value, 5, encoder, raw, ())?,
5077
5078 Capability::Resolver(value) => ::fidl_next::wire::Union::encode_as::<
5079 ___E,
5080 crate::wire::Resolver<'static>,
5081 >(value, 6, encoder, raw, ())?,
5082
5083 Capability::EventStream(value) => ::fidl_next::wire::Union::encode_as::<
5084 ___E,
5085 crate::wire::EventStream<'static>,
5086 >(value, 8, encoder, raw, ())?,
5087
5088 Capability::Dictionary(value) => ::fidl_next::wire::Union::encode_as::<
5089 ___E,
5090 crate::wire::Dictionary<'static>,
5091 >(value, 9, encoder, raw, ())?,
5092
5093 Capability::Config(value) => ::fidl_next::wire::Union::encode_as::<
5094 ___E,
5095 crate::wire::Configuration<'static>,
5096 >(value, 10, encoder, raw, ())?,
5097
5098 Capability::UnknownOrdinal_(ordinal) => {
5099 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
5100 }
5101 }
5102
5103 Ok(())
5104 }
5105 }
5106
5107 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::Capability<'static>, ___E>
5108 for Capability
5109 where
5110 ___E: ?Sized,
5111 Capability: ::fidl_next::Encode<crate::wire::Capability<'static>, ___E>,
5112 {
5113 #[inline]
5114 fn encode_option(
5115 this: ::core::option::Option<Self>,
5116 encoder: &mut ___E,
5117 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Capability<'static>>,
5118 _: (),
5119 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5120 ::fidl_next::munge!(let crate::wire_optional::Capability { raw, _phantom: _ } = &mut *out);
5121
5122 if let Some(inner) = this {
5123 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
5124 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
5125 } else {
5126 ::fidl_next::wire::Union::encode_absent(raw);
5127 }
5128
5129 Ok(())
5130 }
5131 }
5132
5133 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::Capability<'static>, ___E>
5134 for &'a Capability
5135 where
5136 ___E: ?Sized,
5137 &'a Capability: ::fidl_next::Encode<crate::wire::Capability<'static>, ___E>,
5138 {
5139 #[inline]
5140 fn encode_option(
5141 this: ::core::option::Option<Self>,
5142 encoder: &mut ___E,
5143 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Capability<'static>>,
5144 _: (),
5145 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5146 ::fidl_next::munge!(let crate::wire_optional::Capability { raw, _phantom: _ } = &mut *out);
5147
5148 if let Some(inner) = this {
5149 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
5150 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
5151 } else {
5152 ::fidl_next::wire::Union::encode_absent(raw);
5153 }
5154
5155 Ok(())
5156 }
5157 }
5158
5159 impl<'de> ::fidl_next::FromWire<crate::wire::Capability<'de>> for Capability {
5160 #[inline]
5161 fn from_wire(wire: crate::wire::Capability<'de>) -> Self {
5162 let wire = ::core::mem::ManuallyDrop::new(wire);
5163 match wire.raw.ordinal() {
5164 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
5165 wire.raw.get().read_unchecked::<crate::wire::Service<'de>>()
5166 })),
5167
5168 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
5169 wire.raw.get().read_unchecked::<crate::wire::Protocol<'de>>()
5170 })),
5171
5172 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
5173 wire.raw.get().read_unchecked::<crate::wire::Directory<'de>>()
5174 })),
5175
5176 4 => Self::Storage(::fidl_next::FromWire::from_wire(unsafe {
5177 wire.raw.get().read_unchecked::<crate::wire::Storage<'de>>()
5178 })),
5179
5180 5 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
5181 wire.raw.get().read_unchecked::<crate::wire::Runner<'de>>()
5182 })),
5183
5184 6 => Self::Resolver(::fidl_next::FromWire::from_wire(unsafe {
5185 wire.raw.get().read_unchecked::<crate::wire::Resolver<'de>>()
5186 })),
5187
5188 8 => Self::EventStream(::fidl_next::FromWire::from_wire(unsafe {
5189 wire.raw.get().read_unchecked::<crate::wire::EventStream<'de>>()
5190 })),
5191
5192 9 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
5193 wire.raw.get().read_unchecked::<crate::wire::Dictionary<'de>>()
5194 })),
5195
5196 10 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
5197 wire.raw.get().read_unchecked::<crate::wire::Configuration<'de>>()
5198 })),
5199
5200 ord => return Self::UnknownOrdinal_(ord as u64),
5201 }
5202 }
5203 }
5204
5205 impl<'de> ::fidl_next::FromWireRef<crate::wire::Capability<'de>> for Capability {
5206 #[inline]
5207 fn from_wire_ref(wire: &crate::wire::Capability<'de>) -> Self {
5208 match wire.raw.ordinal() {
5209 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5210 wire.raw.get().deref_unchecked::<crate::wire::Service<'de>>()
5211 })),
5212
5213 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5214 wire.raw.get().deref_unchecked::<crate::wire::Protocol<'de>>()
5215 })),
5216
5217 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5218 wire.raw.get().deref_unchecked::<crate::wire::Directory<'de>>()
5219 })),
5220
5221 4 => Self::Storage(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5222 wire.raw.get().deref_unchecked::<crate::wire::Storage<'de>>()
5223 })),
5224
5225 5 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5226 wire.raw.get().deref_unchecked::<crate::wire::Runner<'de>>()
5227 })),
5228
5229 6 => Self::Resolver(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5230 wire.raw.get().deref_unchecked::<crate::wire::Resolver<'de>>()
5231 })),
5232
5233 8 => Self::EventStream(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5234 wire.raw.get().deref_unchecked::<crate::wire::EventStream<'de>>()
5235 })),
5236
5237 9 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5238 wire.raw.get().deref_unchecked::<crate::wire::Dictionary<'de>>()
5239 })),
5240
5241 10 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5242 wire.raw.get().deref_unchecked::<crate::wire::Configuration<'de>>()
5243 })),
5244
5245 ord => return Self::UnknownOrdinal_(ord as u64),
5246 }
5247 }
5248 }
5249
5250 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Capability<'de>> for Capability {
5251 #[inline]
5252 fn from_wire_option(
5253 wire: crate::wire_optional::Capability<'de>,
5254 ) -> ::core::option::Option<Self> {
5255 if let Some(inner) = wire.into_option() {
5256 Some(::fidl_next::FromWire::from_wire(inner))
5257 } else {
5258 None
5259 }
5260 }
5261 }
5262
5263 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Capability<'de>> for Box<Capability> {
5264 #[inline]
5265 fn from_wire_option(
5266 wire: crate::wire_optional::Capability<'de>,
5267 ) -> ::core::option::Option<Self> {
5268 <
5269 Capability as ::fidl_next::FromWireOption<crate::wire_optional::Capability<'de>>
5270 >::from_wire_option(wire).map(Box::new)
5271 }
5272 }
5273
5274 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::Capability<'de>>
5275 for Box<Capability>
5276 {
5277 #[inline]
5278 fn from_wire_option_ref(
5279 wire: &crate::wire_optional::Capability<'de>,
5280 ) -> ::core::option::Option<Self> {
5281 if let Some(inner) = wire.as_ref() {
5282 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
5283 } else {
5284 None
5285 }
5286 }
5287 }
5288
5289 #[doc = " Describes under what conditions the component may be started.\n"]
5290 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5291 #[repr(u32)]
5292 pub enum StartupMode {
5293 Lazy = 0,
5294 Eager = 1,
5295 }
5296 impl ::core::convert::TryFrom<u32> for StartupMode {
5297 type Error = ::fidl_next::UnknownStrictEnumMemberError;
5298 fn try_from(
5299 value: u32,
5300 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
5301 match value {
5302 0 => Ok(Self::Lazy),
5303 1 => Ok(Self::Eager),
5304
5305 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
5306 }
5307 }
5308 }
5309
5310 unsafe impl<___E> ::fidl_next::Encode<crate::wire::StartupMode, ___E> for StartupMode
5311 where
5312 ___E: ?Sized,
5313 {
5314 #[inline]
5315 fn encode(
5316 self,
5317 encoder: &mut ___E,
5318 out: &mut ::core::mem::MaybeUninit<crate::wire::StartupMode>,
5319 _: (),
5320 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5321 ::fidl_next::Encode::encode(&self, encoder, out, ())
5322 }
5323 }
5324
5325 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::StartupMode, ___E> for &'a StartupMode
5326 where
5327 ___E: ?Sized,
5328 {
5329 #[inline]
5330 fn encode(
5331 self,
5332 encoder: &mut ___E,
5333 out: &mut ::core::mem::MaybeUninit<crate::wire::StartupMode>,
5334 _: (),
5335 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5336 ::fidl_next::munge!(let crate::wire::StartupMode { value } = out);
5337 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
5338 StartupMode::Lazy => 0,
5339
5340 StartupMode::Eager => 1,
5341 }));
5342
5343 Ok(())
5344 }
5345 }
5346
5347 impl ::core::convert::From<crate::wire::StartupMode> for StartupMode {
5348 fn from(wire: crate::wire::StartupMode) -> Self {
5349 match u32::from(wire.value) {
5350 0 => Self::Lazy,
5351
5352 1 => Self::Eager,
5353
5354 _ => unsafe { ::core::hint::unreachable_unchecked() },
5355 }
5356 }
5357 }
5358
5359 impl ::fidl_next::FromWire<crate::wire::StartupMode> for StartupMode {
5360 #[inline]
5361 fn from_wire(wire: crate::wire::StartupMode) -> Self {
5362 Self::from(wire)
5363 }
5364 }
5365
5366 impl ::fidl_next::FromWireRef<crate::wire::StartupMode> for StartupMode {
5367 #[inline]
5368 fn from_wire_ref(wire: &crate::wire::StartupMode) -> Self {
5369 Self::from(*wire)
5370 }
5371 }
5372
5373 #[doc = " Describes the action to take if this component instance terminates\n unexpectedly.\n"]
5374 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5375 #[repr(u32)]
5376 pub enum OnTerminate {
5377 None = 0,
5378 Reboot = 1,
5379 }
5380 impl ::core::convert::TryFrom<u32> for OnTerminate {
5381 type Error = ::fidl_next::UnknownStrictEnumMemberError;
5382 fn try_from(
5383 value: u32,
5384 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
5385 match value {
5386 0 => Ok(Self::None),
5387 1 => Ok(Self::Reboot),
5388
5389 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
5390 }
5391 }
5392 }
5393
5394 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OnTerminate, ___E> for OnTerminate
5395 where
5396 ___E: ?Sized,
5397 {
5398 #[inline]
5399 fn encode(
5400 self,
5401 encoder: &mut ___E,
5402 out: &mut ::core::mem::MaybeUninit<crate::wire::OnTerminate>,
5403 _: (),
5404 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5405 ::fidl_next::Encode::encode(&self, encoder, out, ())
5406 }
5407 }
5408
5409 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OnTerminate, ___E> for &'a OnTerminate
5410 where
5411 ___E: ?Sized,
5412 {
5413 #[inline]
5414 fn encode(
5415 self,
5416 encoder: &mut ___E,
5417 out: &mut ::core::mem::MaybeUninit<crate::wire::OnTerminate>,
5418 _: (),
5419 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5420 ::fidl_next::munge!(let crate::wire::OnTerminate { value } = out);
5421 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
5422 OnTerminate::None => 0,
5423
5424 OnTerminate::Reboot => 1,
5425 }));
5426
5427 Ok(())
5428 }
5429 }
5430
5431 impl ::core::convert::From<crate::wire::OnTerminate> for OnTerminate {
5432 fn from(wire: crate::wire::OnTerminate) -> Self {
5433 match u32::from(wire.value) {
5434 0 => Self::None,
5435
5436 1 => Self::Reboot,
5437
5438 _ => unsafe { ::core::hint::unreachable_unchecked() },
5439 }
5440 }
5441 }
5442
5443 impl ::fidl_next::FromWire<crate::wire::OnTerminate> for OnTerminate {
5444 #[inline]
5445 fn from_wire(wire: crate::wire::OnTerminate) -> Self {
5446 Self::from(wire)
5447 }
5448 }
5449
5450 impl ::fidl_next::FromWireRef<crate::wire::OnTerminate> for OnTerminate {
5451 #[inline]
5452 fn from_wire_ref(wire: &crate::wire::OnTerminate) -> Self {
5453 Self::from(*wire)
5454 }
5455 }
5456
5457 #[doc = " The string identifier for a config field.\n"]
5458 pub type ConfigKey = ::std::string::String;
5459
5460 #[doc = " A directive to override the value of a particular configuration field in the child.\n"]
5461 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5462 pub struct ConfigOverride {
5463 pub key: ::core::option::Option<::std::string::String>,
5464
5465 pub value: ::core::option::Option<crate::natural::ConfigValue>,
5466 }
5467
5468 impl ConfigOverride {
5469 fn __max_ordinal(&self) -> usize {
5470 if self.value.is_some() {
5471 return 2;
5472 }
5473
5474 if self.key.is_some() {
5475 return 1;
5476 }
5477
5478 0
5479 }
5480 }
5481
5482 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigOverride<'static>, ___E> for ConfigOverride
5483 where
5484 ___E: ::fidl_next::Encoder + ?Sized,
5485 {
5486 #[inline]
5487 fn encode(
5488 mut self,
5489 encoder: &mut ___E,
5490 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigOverride<'static>>,
5491 _: (),
5492 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5493 ::fidl_next::munge!(let crate::wire::ConfigOverride { table } = out);
5494
5495 let max_ord = self.__max_ordinal();
5496
5497 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5498 ::fidl_next::Wire::zero_padding(&mut out);
5499
5500 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5501 ::fidl_next::wire::Envelope,
5502 >(encoder, max_ord);
5503
5504 for i in 1..=max_ord {
5505 match i {
5506 2 => {
5507 if let Some(value) = self.value.take() {
5508 ::fidl_next::wire::Envelope::encode_value::<
5509 crate::wire::ConfigValue<'static>,
5510 ___E,
5511 >(
5512 value, preallocated.encoder, &mut out, ()
5513 )?;
5514 } else {
5515 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5516 }
5517 }
5518
5519 1 => {
5520 if let Some(value) = self.key.take() {
5521 ::fidl_next::wire::Envelope::encode_value::<
5522 ::fidl_next::wire::String<'static>,
5523 ___E,
5524 >(
5525 value, preallocated.encoder, &mut out, 64
5526 )?;
5527 } else {
5528 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5529 }
5530 }
5531
5532 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5533 }
5534 unsafe {
5535 preallocated.write_next(out.assume_init_ref());
5536 }
5537 }
5538
5539 ::fidl_next::wire::Table::encode_len(table, max_ord);
5540
5541 Ok(())
5542 }
5543 }
5544
5545 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigOverride<'static>, ___E>
5546 for &'a ConfigOverride
5547 where
5548 ___E: ::fidl_next::Encoder + ?Sized,
5549 {
5550 #[inline]
5551 fn encode(
5552 self,
5553 encoder: &mut ___E,
5554 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigOverride<'static>>,
5555 _: (),
5556 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5557 ::fidl_next::munge!(let crate::wire::ConfigOverride { table } = out);
5558
5559 let max_ord = self.__max_ordinal();
5560
5561 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5562 ::fidl_next::Wire::zero_padding(&mut out);
5563
5564 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5565 ::fidl_next::wire::Envelope,
5566 >(encoder, max_ord);
5567
5568 for i in 1..=max_ord {
5569 match i {
5570 2 => {
5571 if let Some(value) = &self.value {
5572 ::fidl_next::wire::Envelope::encode_value::<
5573 crate::wire::ConfigValue<'static>,
5574 ___E,
5575 >(
5576 value, preallocated.encoder, &mut out, ()
5577 )?;
5578 } else {
5579 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5580 }
5581 }
5582
5583 1 => {
5584 if let Some(value) = &self.key {
5585 ::fidl_next::wire::Envelope::encode_value::<
5586 ::fidl_next::wire::String<'static>,
5587 ___E,
5588 >(
5589 value, preallocated.encoder, &mut out, 64
5590 )?;
5591 } else {
5592 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5593 }
5594 }
5595
5596 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5597 }
5598 unsafe {
5599 preallocated.write_next(out.assume_init_ref());
5600 }
5601 }
5602
5603 ::fidl_next::wire::Table::encode_len(table, max_ord);
5604
5605 Ok(())
5606 }
5607 }
5608
5609 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigOverride<'de>> for ConfigOverride {
5610 #[inline]
5611 fn from_wire(wire_: crate::wire::ConfigOverride<'de>) -> Self {
5612 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5613
5614 let key = wire_.table.get(1);
5615
5616 let value = wire_.table.get(2);
5617
5618 Self {
5619 key: key.map(|envelope| {
5620 ::fidl_next::FromWire::from_wire(unsafe {
5621 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
5622 })
5623 }),
5624
5625 value: value.map(|envelope| {
5626 ::fidl_next::FromWire::from_wire(unsafe {
5627 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
5628 })
5629 }),
5630 }
5631 }
5632 }
5633
5634 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigOverride<'de>> for ConfigOverride {
5635 #[inline]
5636 fn from_wire_ref(wire: &crate::wire::ConfigOverride<'de>) -> Self {
5637 Self {
5638 key: wire.table.get(1).map(|envelope| {
5639 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5640 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
5641 })
5642 }),
5643
5644 value: wire.table.get(2).map(|envelope| {
5645 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5646 envelope.deref_unchecked::<crate::wire::ConfigValue<'de>>()
5647 })
5648 }),
5649 }
5650 }
5651 }
5652
5653 #[doc = " Statically declares a child component instance.\n"]
5654 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5655 pub struct Child {
5656 pub name: ::core::option::Option<::std::string::String>,
5657
5658 pub url: ::core::option::Option<::std::string::String>,
5659
5660 pub startup: ::core::option::Option<crate::natural::StartupMode>,
5661
5662 pub environment: ::core::option::Option<::std::string::String>,
5663
5664 pub on_terminate: ::core::option::Option<crate::natural::OnTerminate>,
5665
5666 pub config_overrides:
5667 ::core::option::Option<::std::vec::Vec<crate::natural::ConfigOverride>>,
5668 }
5669
5670 impl Child {
5671 fn __max_ordinal(&self) -> usize {
5672 if self.config_overrides.is_some() {
5673 return 6;
5674 }
5675
5676 if self.on_terminate.is_some() {
5677 return 5;
5678 }
5679
5680 if self.environment.is_some() {
5681 return 4;
5682 }
5683
5684 if self.startup.is_some() {
5685 return 3;
5686 }
5687
5688 if self.url.is_some() {
5689 return 2;
5690 }
5691
5692 if self.name.is_some() {
5693 return 1;
5694 }
5695
5696 0
5697 }
5698 }
5699
5700 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Child<'static>, ___E> for Child
5701 where
5702 ___E: ::fidl_next::Encoder + ?Sized,
5703 {
5704 #[inline]
5705 fn encode(
5706 mut self,
5707 encoder: &mut ___E,
5708 out: &mut ::core::mem::MaybeUninit<crate::wire::Child<'static>>,
5709 _: (),
5710 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5711 ::fidl_next::munge!(let crate::wire::Child { table } = out);
5712
5713 let max_ord = self.__max_ordinal();
5714
5715 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5716 ::fidl_next::Wire::zero_padding(&mut out);
5717
5718 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5719 ::fidl_next::wire::Envelope,
5720 >(encoder, max_ord);
5721
5722 for i in 1..=max_ord {
5723 match i {
5724 6 => {
5725 if let Some(value) = self.config_overrides.take() {
5726 ::fidl_next::wire::Envelope::encode_value::<
5727 ::fidl_next::wire::Vector<
5728 'static,
5729 crate::wire::ConfigOverride<'static>,
5730 >,
5731 ___E,
5732 >(
5733 value, preallocated.encoder, &mut out, (4294967295, ())
5734 )?;
5735 } else {
5736 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5737 }
5738 }
5739
5740 5 => {
5741 if let Some(value) = self.on_terminate.take() {
5742 ::fidl_next::wire::Envelope::encode_value::<
5743 crate::wire::OnTerminate,
5744 ___E,
5745 >(
5746 value, preallocated.encoder, &mut out, ()
5747 )?;
5748 } else {
5749 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5750 }
5751 }
5752
5753 4 => {
5754 if let Some(value) = self.environment.take() {
5755 ::fidl_next::wire::Envelope::encode_value::<
5756 ::fidl_next::wire::String<'static>,
5757 ___E,
5758 >(
5759 value, preallocated.encoder, &mut out, 100
5760 )?;
5761 } else {
5762 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5763 }
5764 }
5765
5766 3 => {
5767 if let Some(value) = self.startup.take() {
5768 ::fidl_next::wire::Envelope::encode_value::<
5769 crate::wire::StartupMode,
5770 ___E,
5771 >(
5772 value, preallocated.encoder, &mut out, ()
5773 )?;
5774 } else {
5775 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5776 }
5777 }
5778
5779 2 => {
5780 if let Some(value) = self.url.take() {
5781 ::fidl_next::wire::Envelope::encode_value::<
5782 ::fidl_next::wire::String<'static>,
5783 ___E,
5784 >(
5785 value, preallocated.encoder, &mut out, 4096
5786 )?;
5787 } else {
5788 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5789 }
5790 }
5791
5792 1 => {
5793 if let Some(value) = self.name.take() {
5794 ::fidl_next::wire::Envelope::encode_value::<
5795 ::fidl_next::wire::String<'static>,
5796 ___E,
5797 >(
5798 value, preallocated.encoder, &mut out, 1024
5799 )?;
5800 } else {
5801 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5802 }
5803 }
5804
5805 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5806 }
5807 unsafe {
5808 preallocated.write_next(out.assume_init_ref());
5809 }
5810 }
5811
5812 ::fidl_next::wire::Table::encode_len(table, max_ord);
5813
5814 Ok(())
5815 }
5816 }
5817
5818 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Child<'static>, ___E> for &'a Child
5819 where
5820 ___E: ::fidl_next::Encoder + ?Sized,
5821 {
5822 #[inline]
5823 fn encode(
5824 self,
5825 encoder: &mut ___E,
5826 out: &mut ::core::mem::MaybeUninit<crate::wire::Child<'static>>,
5827 _: (),
5828 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5829 ::fidl_next::munge!(let crate::wire::Child { table } = out);
5830
5831 let max_ord = self.__max_ordinal();
5832
5833 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
5834 ::fidl_next::Wire::zero_padding(&mut out);
5835
5836 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
5837 ::fidl_next::wire::Envelope,
5838 >(encoder, max_ord);
5839
5840 for i in 1..=max_ord {
5841 match i {
5842 6 => {
5843 if let Some(value) = &self.config_overrides {
5844 ::fidl_next::wire::Envelope::encode_value::<
5845 ::fidl_next::wire::Vector<
5846 'static,
5847 crate::wire::ConfigOverride<'static>,
5848 >,
5849 ___E,
5850 >(
5851 value, preallocated.encoder, &mut out, (4294967295, ())
5852 )?;
5853 } else {
5854 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5855 }
5856 }
5857
5858 5 => {
5859 if let Some(value) = &self.on_terminate {
5860 ::fidl_next::wire::Envelope::encode_value::<
5861 crate::wire::OnTerminate,
5862 ___E,
5863 >(
5864 value, preallocated.encoder, &mut out, ()
5865 )?;
5866 } else {
5867 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5868 }
5869 }
5870
5871 4 => {
5872 if let Some(value) = &self.environment {
5873 ::fidl_next::wire::Envelope::encode_value::<
5874 ::fidl_next::wire::String<'static>,
5875 ___E,
5876 >(
5877 value, preallocated.encoder, &mut out, 100
5878 )?;
5879 } else {
5880 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5881 }
5882 }
5883
5884 3 => {
5885 if let Some(value) = &self.startup {
5886 ::fidl_next::wire::Envelope::encode_value::<
5887 crate::wire::StartupMode,
5888 ___E,
5889 >(
5890 value, preallocated.encoder, &mut out, ()
5891 )?;
5892 } else {
5893 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5894 }
5895 }
5896
5897 2 => {
5898 if let Some(value) = &self.url {
5899 ::fidl_next::wire::Envelope::encode_value::<
5900 ::fidl_next::wire::String<'static>,
5901 ___E,
5902 >(
5903 value, preallocated.encoder, &mut out, 4096
5904 )?;
5905 } else {
5906 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5907 }
5908 }
5909
5910 1 => {
5911 if let Some(value) = &self.name {
5912 ::fidl_next::wire::Envelope::encode_value::<
5913 ::fidl_next::wire::String<'static>,
5914 ___E,
5915 >(
5916 value, preallocated.encoder, &mut out, 1024
5917 )?;
5918 } else {
5919 ::fidl_next::wire::Envelope::encode_zero(&mut out)
5920 }
5921 }
5922
5923 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
5924 }
5925 unsafe {
5926 preallocated.write_next(out.assume_init_ref());
5927 }
5928 }
5929
5930 ::fidl_next::wire::Table::encode_len(table, max_ord);
5931
5932 Ok(())
5933 }
5934 }
5935
5936 impl<'de> ::fidl_next::FromWire<crate::wire::Child<'de>> for Child {
5937 #[inline]
5938 fn from_wire(wire_: crate::wire::Child<'de>) -> Self {
5939 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5940
5941 let name = wire_.table.get(1);
5942
5943 let url = wire_.table.get(2);
5944
5945 let startup = wire_.table.get(3);
5946
5947 let environment = wire_.table.get(4);
5948
5949 let on_terminate = wire_.table.get(5);
5950
5951 let config_overrides = wire_.table.get(6);
5952
5953 Self {
5954
5955
5956 name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
5957 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
5958 )),
5959
5960
5961 url: url.map(|envelope| ::fidl_next::FromWire::from_wire(
5962 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
5963 )),
5964
5965
5966 startup: startup.map(|envelope| ::fidl_next::FromWire::from_wire(
5967 unsafe { envelope.read_unchecked::<crate::wire::StartupMode>() }
5968 )),
5969
5970
5971 environment: environment.map(|envelope| ::fidl_next::FromWire::from_wire(
5972 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
5973 )),
5974
5975
5976 on_terminate: on_terminate.map(|envelope| ::fidl_next::FromWire::from_wire(
5977 unsafe { envelope.read_unchecked::<crate::wire::OnTerminate>() }
5978 )),
5979
5980
5981 config_overrides: config_overrides.map(|envelope| ::fidl_next::FromWire::from_wire(
5982 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigOverride<'de>>>() }
5983 )),
5984
5985 }
5986 }
5987 }
5988
5989 impl<'de> ::fidl_next::FromWireRef<crate::wire::Child<'de>> for Child {
5990 #[inline]
5991 fn from_wire_ref(wire: &crate::wire::Child<'de>) -> Self {
5992 Self {
5993
5994
5995 name: wire.table.get(1)
5996 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5997 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
5998 )),
5999
6000
6001 url: wire.table.get(2)
6002 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
6003 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
6004 )),
6005
6006
6007 startup: wire.table.get(3)
6008 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
6009 unsafe { envelope.deref_unchecked::<crate::wire::StartupMode>() }
6010 )),
6011
6012
6013 environment: wire.table.get(4)
6014 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
6015 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
6016 )),
6017
6018
6019 on_terminate: wire.table.get(5)
6020 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
6021 unsafe { envelope.deref_unchecked::<crate::wire::OnTerminate>() }
6022 )),
6023
6024
6025 config_overrides: wire.table.get(6)
6026 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
6027 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigOverride<'de>>>() }
6028 )),
6029
6030 }
6031 }
6032 }
6033
6034 #[doc = " The durability of component instances created in a collection.\n"]
6035 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6036 #[repr(u32)]
6037 pub enum Durability {
6038 Transient = 2,
6039 SingleRun = 3,
6040 }
6041 impl ::core::convert::TryFrom<u32> for Durability {
6042 type Error = ::fidl_next::UnknownStrictEnumMemberError;
6043 fn try_from(
6044 value: u32,
6045 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
6046 match value {
6047 2 => Ok(Self::Transient),
6048 3 => Ok(Self::SingleRun),
6049
6050 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
6051 }
6052 }
6053 }
6054
6055 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Durability, ___E> for Durability
6056 where
6057 ___E: ?Sized,
6058 {
6059 #[inline]
6060 fn encode(
6061 self,
6062 encoder: &mut ___E,
6063 out: &mut ::core::mem::MaybeUninit<crate::wire::Durability>,
6064 _: (),
6065 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6066 ::fidl_next::Encode::encode(&self, encoder, out, ())
6067 }
6068 }
6069
6070 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Durability, ___E> for &'a Durability
6071 where
6072 ___E: ?Sized,
6073 {
6074 #[inline]
6075 fn encode(
6076 self,
6077 encoder: &mut ___E,
6078 out: &mut ::core::mem::MaybeUninit<crate::wire::Durability>,
6079 _: (),
6080 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6081 ::fidl_next::munge!(let crate::wire::Durability { value } = out);
6082 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
6083 Durability::Transient => 2,
6084
6085 Durability::SingleRun => 3,
6086 }));
6087
6088 Ok(())
6089 }
6090 }
6091
6092 impl ::core::convert::From<crate::wire::Durability> for Durability {
6093 fn from(wire: crate::wire::Durability) -> Self {
6094 match u32::from(wire.value) {
6095 2 => Self::Transient,
6096
6097 3 => Self::SingleRun,
6098
6099 _ => unsafe { ::core::hint::unreachable_unchecked() },
6100 }
6101 }
6102 }
6103
6104 impl ::fidl_next::FromWire<crate::wire::Durability> for Durability {
6105 #[inline]
6106 fn from_wire(wire: crate::wire::Durability) -> Self {
6107 Self::from(wire)
6108 }
6109 }
6110
6111 impl ::fidl_next::FromWireRef<crate::wire::Durability> for Durability {
6112 #[inline]
6113 fn from_wire_ref(wire: &crate::wire::Durability) -> Self {
6114 Self::from(*wire)
6115 }
6116 }
6117
6118 #[doc = " Statically declares a component instance collection.\n"]
6119 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6120 pub struct Collection {
6121 pub name: ::core::option::Option<::std::string::String>,
6122
6123 pub durability: ::core::option::Option<crate::natural::Durability>,
6124
6125 pub environment: ::core::option::Option<::std::string::String>,
6126
6127 pub allowed_offers: ::core::option::Option<crate::natural::AllowedOffers>,
6128
6129 pub allow_long_names: ::core::option::Option<bool>,
6130
6131 pub persistent_storage: ::core::option::Option<bool>,
6132 }
6133
6134 impl Collection {
6135 fn __max_ordinal(&self) -> usize {
6136 if self.persistent_storage.is_some() {
6137 return 6;
6138 }
6139
6140 if self.allow_long_names.is_some() {
6141 return 5;
6142 }
6143
6144 if self.allowed_offers.is_some() {
6145 return 4;
6146 }
6147
6148 if self.environment.is_some() {
6149 return 3;
6150 }
6151
6152 if self.durability.is_some() {
6153 return 2;
6154 }
6155
6156 if self.name.is_some() {
6157 return 1;
6158 }
6159
6160 0
6161 }
6162 }
6163
6164 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Collection<'static>, ___E> for Collection
6165 where
6166 ___E: ::fidl_next::Encoder + ?Sized,
6167 {
6168 #[inline]
6169 fn encode(
6170 mut self,
6171 encoder: &mut ___E,
6172 out: &mut ::core::mem::MaybeUninit<crate::wire::Collection<'static>>,
6173 _: (),
6174 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6175 ::fidl_next::munge!(let crate::wire::Collection { table } = out);
6176
6177 let max_ord = self.__max_ordinal();
6178
6179 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6180 ::fidl_next::Wire::zero_padding(&mut out);
6181
6182 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6183 ::fidl_next::wire::Envelope,
6184 >(encoder, max_ord);
6185
6186 for i in 1..=max_ord {
6187 match i {
6188 6 => {
6189 if let Some(value) = self.persistent_storage.take() {
6190 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
6191 value,
6192 preallocated.encoder,
6193 &mut out,
6194 (),
6195 )?;
6196 } else {
6197 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6198 }
6199 }
6200
6201 5 => {
6202 if let Some(value) = self.allow_long_names.take() {
6203 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
6204 value,
6205 preallocated.encoder,
6206 &mut out,
6207 (),
6208 )?;
6209 } else {
6210 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6211 }
6212 }
6213
6214 4 => {
6215 if let Some(value) = self.allowed_offers.take() {
6216 ::fidl_next::wire::Envelope::encode_value::<
6217 crate::wire::AllowedOffers,
6218 ___E,
6219 >(
6220 value, preallocated.encoder, &mut out, ()
6221 )?;
6222 } else {
6223 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6224 }
6225 }
6226
6227 3 => {
6228 if let Some(value) = self.environment.take() {
6229 ::fidl_next::wire::Envelope::encode_value::<
6230 ::fidl_next::wire::String<'static>,
6231 ___E,
6232 >(
6233 value, preallocated.encoder, &mut out, 100
6234 )?;
6235 } else {
6236 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6237 }
6238 }
6239
6240 2 => {
6241 if let Some(value) = self.durability.take() {
6242 ::fidl_next::wire::Envelope::encode_value::<
6243 crate::wire::Durability,
6244 ___E,
6245 >(
6246 value, preallocated.encoder, &mut out, ()
6247 )?;
6248 } else {
6249 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6250 }
6251 }
6252
6253 1 => {
6254 if let Some(value) = self.name.take() {
6255 ::fidl_next::wire::Envelope::encode_value::<
6256 ::fidl_next::wire::String<'static>,
6257 ___E,
6258 >(
6259 value, preallocated.encoder, &mut out, 100
6260 )?;
6261 } else {
6262 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6263 }
6264 }
6265
6266 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6267 }
6268 unsafe {
6269 preallocated.write_next(out.assume_init_ref());
6270 }
6271 }
6272
6273 ::fidl_next::wire::Table::encode_len(table, max_ord);
6274
6275 Ok(())
6276 }
6277 }
6278
6279 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Collection<'static>, ___E> for &'a Collection
6280 where
6281 ___E: ::fidl_next::Encoder + ?Sized,
6282 {
6283 #[inline]
6284 fn encode(
6285 self,
6286 encoder: &mut ___E,
6287 out: &mut ::core::mem::MaybeUninit<crate::wire::Collection<'static>>,
6288 _: (),
6289 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6290 ::fidl_next::munge!(let crate::wire::Collection { table } = out);
6291
6292 let max_ord = self.__max_ordinal();
6293
6294 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
6295 ::fidl_next::Wire::zero_padding(&mut out);
6296
6297 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
6298 ::fidl_next::wire::Envelope,
6299 >(encoder, max_ord);
6300
6301 for i in 1..=max_ord {
6302 match i {
6303 6 => {
6304 if let Some(value) = &self.persistent_storage {
6305 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
6306 value,
6307 preallocated.encoder,
6308 &mut out,
6309 (),
6310 )?;
6311 } else {
6312 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6313 }
6314 }
6315
6316 5 => {
6317 if let Some(value) = &self.allow_long_names {
6318 ::fidl_next::wire::Envelope::encode_value::<bool, ___E>(
6319 value,
6320 preallocated.encoder,
6321 &mut out,
6322 (),
6323 )?;
6324 } else {
6325 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6326 }
6327 }
6328
6329 4 => {
6330 if let Some(value) = &self.allowed_offers {
6331 ::fidl_next::wire::Envelope::encode_value::<
6332 crate::wire::AllowedOffers,
6333 ___E,
6334 >(
6335 value, preallocated.encoder, &mut out, ()
6336 )?;
6337 } else {
6338 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6339 }
6340 }
6341
6342 3 => {
6343 if let Some(value) = &self.environment {
6344 ::fidl_next::wire::Envelope::encode_value::<
6345 ::fidl_next::wire::String<'static>,
6346 ___E,
6347 >(
6348 value, preallocated.encoder, &mut out, 100
6349 )?;
6350 } else {
6351 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6352 }
6353 }
6354
6355 2 => {
6356 if let Some(value) = &self.durability {
6357 ::fidl_next::wire::Envelope::encode_value::<
6358 crate::wire::Durability,
6359 ___E,
6360 >(
6361 value, preallocated.encoder, &mut out, ()
6362 )?;
6363 } else {
6364 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6365 }
6366 }
6367
6368 1 => {
6369 if let Some(value) = &self.name {
6370 ::fidl_next::wire::Envelope::encode_value::<
6371 ::fidl_next::wire::String<'static>,
6372 ___E,
6373 >(
6374 value, preallocated.encoder, &mut out, 100
6375 )?;
6376 } else {
6377 ::fidl_next::wire::Envelope::encode_zero(&mut out)
6378 }
6379 }
6380
6381 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
6382 }
6383 unsafe {
6384 preallocated.write_next(out.assume_init_ref());
6385 }
6386 }
6387
6388 ::fidl_next::wire::Table::encode_len(table, max_ord);
6389
6390 Ok(())
6391 }
6392 }
6393
6394 impl<'de> ::fidl_next::FromWire<crate::wire::Collection<'de>> for Collection {
6395 #[inline]
6396 fn from_wire(wire_: crate::wire::Collection<'de>) -> Self {
6397 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6398
6399 let name = wire_.table.get(1);
6400
6401 let durability = wire_.table.get(2);
6402
6403 let environment = wire_.table.get(3);
6404
6405 let allowed_offers = wire_.table.get(4);
6406
6407 let allow_long_names = wire_.table.get(5);
6408
6409 let persistent_storage = wire_.table.get(6);
6410
6411 Self {
6412 name: name.map(|envelope| {
6413 ::fidl_next::FromWire::from_wire(unsafe {
6414 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
6415 })
6416 }),
6417
6418 durability: durability.map(|envelope| {
6419 ::fidl_next::FromWire::from_wire(unsafe {
6420 envelope.read_unchecked::<crate::wire::Durability>()
6421 })
6422 }),
6423
6424 environment: environment.map(|envelope| {
6425 ::fidl_next::FromWire::from_wire(unsafe {
6426 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
6427 })
6428 }),
6429
6430 allowed_offers: allowed_offers.map(|envelope| {
6431 ::fidl_next::FromWire::from_wire(unsafe {
6432 envelope.read_unchecked::<crate::wire::AllowedOffers>()
6433 })
6434 }),
6435
6436 allow_long_names: allow_long_names.map(|envelope| {
6437 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
6438 }),
6439
6440 persistent_storage: persistent_storage.map(|envelope| {
6441 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
6442 }),
6443 }
6444 }
6445 }
6446
6447 impl<'de> ::fidl_next::FromWireRef<crate::wire::Collection<'de>> for Collection {
6448 #[inline]
6449 fn from_wire_ref(wire: &crate::wire::Collection<'de>) -> Self {
6450 Self {
6451 name: wire.table.get(1).map(|envelope| {
6452 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6453 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
6454 })
6455 }),
6456
6457 durability: wire.table.get(2).map(|envelope| {
6458 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6459 envelope.deref_unchecked::<crate::wire::Durability>()
6460 })
6461 }),
6462
6463 environment: wire.table.get(3).map(|envelope| {
6464 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6465 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
6466 })
6467 }),
6468
6469 allowed_offers: wire.table.get(4).map(|envelope| {
6470 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6471 envelope.deref_unchecked::<crate::wire::AllowedOffers>()
6472 })
6473 }),
6474
6475 allow_long_names: wire.table.get(5).map(|envelope| {
6476 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6477 envelope.deref_unchecked::<bool>()
6478 })
6479 }),
6480
6481 persistent_storage: wire.table.get(6).map(|envelope| {
6482 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6483 envelope.deref_unchecked::<bool>()
6484 })
6485 }),
6486 }
6487 }
6488 }
6489
6490 #[doc = " Describes the type of dependency implied by the capability.\n"]
6491 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6492 #[repr(u32)]
6493 pub enum DependencyType {
6494 Strong = 1,
6495 Weak = 2,
6496 }
6497 impl ::core::convert::TryFrom<u32> for DependencyType {
6498 type Error = ::fidl_next::UnknownStrictEnumMemberError;
6499 fn try_from(
6500 value: u32,
6501 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
6502 match value {
6503 1 => Ok(Self::Strong),
6504 2 => Ok(Self::Weak),
6505
6506 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
6507 }
6508 }
6509 }
6510
6511 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DependencyType, ___E> for DependencyType
6512 where
6513 ___E: ?Sized,
6514 {
6515 #[inline]
6516 fn encode(
6517 self,
6518 encoder: &mut ___E,
6519 out: &mut ::core::mem::MaybeUninit<crate::wire::DependencyType>,
6520 _: (),
6521 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6522 ::fidl_next::Encode::encode(&self, encoder, out, ())
6523 }
6524 }
6525
6526 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DependencyType, ___E> for &'a DependencyType
6527 where
6528 ___E: ?Sized,
6529 {
6530 #[inline]
6531 fn encode(
6532 self,
6533 encoder: &mut ___E,
6534 out: &mut ::core::mem::MaybeUninit<crate::wire::DependencyType>,
6535 _: (),
6536 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6537 ::fidl_next::munge!(let crate::wire::DependencyType { value } = out);
6538 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
6539 DependencyType::Strong => 1,
6540
6541 DependencyType::Weak => 2,
6542 }));
6543
6544 Ok(())
6545 }
6546 }
6547
6548 impl ::core::convert::From<crate::wire::DependencyType> for DependencyType {
6549 fn from(wire: crate::wire::DependencyType) -> Self {
6550 match u32::from(wire.value) {
6551 1 => Self::Strong,
6552
6553 2 => Self::Weak,
6554
6555 _ => unsafe { ::core::hint::unreachable_unchecked() },
6556 }
6557 }
6558 }
6559
6560 impl ::fidl_next::FromWire<crate::wire::DependencyType> for DependencyType {
6561 #[inline]
6562 fn from_wire(wire: crate::wire::DependencyType) -> Self {
6563 Self::from(wire)
6564 }
6565 }
6566
6567 impl ::fidl_next::FromWireRef<crate::wire::DependencyType> for DependencyType {
6568 #[inline]
6569 fn from_wire_ref(wire: &crate::wire::DependencyType) -> Self {
6570 Self::from(*wire)
6571 }
6572 }
6573
6574 #[doc = " Type used to create a mapping between 2 names. Used to rename service or component instances\n in FIDL declarations.\n"]
6575 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6576 pub struct NameMapping {
6577 pub source_name: ::std::string::String,
6578
6579 pub target_name: ::std::string::String,
6580 }
6581
6582 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NameMapping<'static>, ___E> for NameMapping
6583 where
6584 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6585 ___E: ::fidl_next::Encoder,
6586 {
6587 #[inline]
6588 fn encode(
6589 self,
6590 encoder_: &mut ___E,
6591 out_: &mut ::core::mem::MaybeUninit<crate::wire::NameMapping<'static>>,
6592 _: (),
6593 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6594 ::fidl_next::munge! {
6595 let crate::wire::NameMapping {
6596 source_name,
6597 target_name,
6598
6599 } = out_;
6600 }
6601
6602 ::fidl_next::Encode::encode(self.source_name, encoder_, source_name, 100)?;
6603
6604 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(source_name.as_mut_ptr()) };
6605 ::fidl_next::Constrained::validate(_field, 100)?;
6606
6607 ::fidl_next::Encode::encode(self.target_name, encoder_, target_name, 100)?;
6608
6609 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(target_name.as_mut_ptr()) };
6610 ::fidl_next::Constrained::validate(_field, 100)?;
6611
6612 Ok(())
6613 }
6614 }
6615
6616 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NameMapping<'static>, ___E>
6617 for &'a NameMapping
6618 where
6619 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6620 ___E: ::fidl_next::Encoder,
6621 {
6622 #[inline]
6623 fn encode(
6624 self,
6625 encoder_: &mut ___E,
6626 out_: &mut ::core::mem::MaybeUninit<crate::wire::NameMapping<'static>>,
6627 _: (),
6628 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6629 ::fidl_next::munge! {
6630 let crate::wire::NameMapping {
6631
6632 source_name,
6633 target_name,
6634
6635 } = out_;
6636 }
6637
6638 ::fidl_next::Encode::encode(&self.source_name, encoder_, source_name, 100)?;
6639
6640 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(source_name.as_mut_ptr()) };
6641 ::fidl_next::Constrained::validate(_field, 100)?;
6642
6643 ::fidl_next::Encode::encode(&self.target_name, encoder_, target_name, 100)?;
6644
6645 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(target_name.as_mut_ptr()) };
6646 ::fidl_next::Constrained::validate(_field, 100)?;
6647
6648 Ok(())
6649 }
6650 }
6651
6652 unsafe impl<___E>
6653 ::fidl_next::EncodeOption<
6654 ::fidl_next::wire::Box<'static, crate::wire::NameMapping<'static>>,
6655 ___E,
6656 > for NameMapping
6657 where
6658 ___E: ::fidl_next::Encoder + ?Sized,
6659 NameMapping: ::fidl_next::Encode<crate::wire::NameMapping<'static>, ___E>,
6660 {
6661 #[inline]
6662 fn encode_option(
6663 this: ::core::option::Option<Self>,
6664 encoder: &mut ___E,
6665 out: &mut ::core::mem::MaybeUninit<
6666 ::fidl_next::wire::Box<'static, crate::wire::NameMapping<'static>>,
6667 >,
6668 _: (),
6669 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6670 if let Some(inner) = this {
6671 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6672 ::fidl_next::wire::Box::encode_present(out);
6673 } else {
6674 ::fidl_next::wire::Box::encode_absent(out);
6675 }
6676
6677 Ok(())
6678 }
6679 }
6680
6681 unsafe impl<'a, ___E>
6682 ::fidl_next::EncodeOption<
6683 ::fidl_next::wire::Box<'static, crate::wire::NameMapping<'static>>,
6684 ___E,
6685 > for &'a NameMapping
6686 where
6687 ___E: ::fidl_next::Encoder + ?Sized,
6688 &'a NameMapping: ::fidl_next::Encode<crate::wire::NameMapping<'static>, ___E>,
6689 {
6690 #[inline]
6691 fn encode_option(
6692 this: ::core::option::Option<Self>,
6693 encoder: &mut ___E,
6694 out: &mut ::core::mem::MaybeUninit<
6695 ::fidl_next::wire::Box<'static, crate::wire::NameMapping<'static>>,
6696 >,
6697 _: (),
6698 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6699 if let Some(inner) = this {
6700 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6701 ::fidl_next::wire::Box::encode_present(out);
6702 } else {
6703 ::fidl_next::wire::Box::encode_absent(out);
6704 }
6705
6706 Ok(())
6707 }
6708 }
6709
6710 impl<'de> ::fidl_next::FromWire<crate::wire::NameMapping<'de>> for NameMapping {
6711 #[inline]
6712 fn from_wire(wire: crate::wire::NameMapping<'de>) -> Self {
6713 Self {
6714 source_name: ::fidl_next::FromWire::from_wire(wire.source_name),
6715
6716 target_name: ::fidl_next::FromWire::from_wire(wire.target_name),
6717 }
6718 }
6719 }
6720
6721 impl<'de> ::fidl_next::FromWireRef<crate::wire::NameMapping<'de>> for NameMapping {
6722 #[inline]
6723 fn from_wire_ref(wire: &crate::wire::NameMapping<'de>) -> Self {
6724 Self {
6725 source_name: ::fidl_next::FromWireRef::from_wire_ref(&wire.source_name),
6726
6727 target_name: ::fidl_next::FromWireRef::from_wire_ref(&wire.target_name),
6728 }
6729 }
6730 }
6731
6732 #[doc = " Specifies how a declared environment\'s initial set of properties are assigned.\n"]
6733 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6734 #[repr(u32)]
6735 pub enum EnvironmentExtends {
6736 None = 0,
6737 Realm = 1,
6738 }
6739 impl ::core::convert::TryFrom<u32> for EnvironmentExtends {
6740 type Error = ::fidl_next::UnknownStrictEnumMemberError;
6741 fn try_from(
6742 value: u32,
6743 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
6744 match value {
6745 0 => Ok(Self::None),
6746 1 => Ok(Self::Realm),
6747
6748 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
6749 }
6750 }
6751 }
6752
6753 unsafe impl<___E> ::fidl_next::Encode<crate::wire::EnvironmentExtends, ___E> for EnvironmentExtends
6754 where
6755 ___E: ?Sized,
6756 {
6757 #[inline]
6758 fn encode(
6759 self,
6760 encoder: &mut ___E,
6761 out: &mut ::core::mem::MaybeUninit<crate::wire::EnvironmentExtends>,
6762 _: (),
6763 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6764 ::fidl_next::Encode::encode(&self, encoder, out, ())
6765 }
6766 }
6767
6768 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EnvironmentExtends, ___E>
6769 for &'a EnvironmentExtends
6770 where
6771 ___E: ?Sized,
6772 {
6773 #[inline]
6774 fn encode(
6775 self,
6776 encoder: &mut ___E,
6777 out: &mut ::core::mem::MaybeUninit<crate::wire::EnvironmentExtends>,
6778 _: (),
6779 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6780 ::fidl_next::munge!(let crate::wire::EnvironmentExtends { value } = out);
6781 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
6782 EnvironmentExtends::None => 0,
6783
6784 EnvironmentExtends::Realm => 1,
6785 }));
6786
6787 Ok(())
6788 }
6789 }
6790
6791 impl ::core::convert::From<crate::wire::EnvironmentExtends> for EnvironmentExtends {
6792 fn from(wire: crate::wire::EnvironmentExtends) -> Self {
6793 match u32::from(wire.value) {
6794 0 => Self::None,
6795
6796 1 => Self::Realm,
6797
6798 _ => unsafe { ::core::hint::unreachable_unchecked() },
6799 }
6800 }
6801 }
6802
6803 impl ::fidl_next::FromWire<crate::wire::EnvironmentExtends> for EnvironmentExtends {
6804 #[inline]
6805 fn from_wire(wire: crate::wire::EnvironmentExtends) -> Self {
6806 Self::from(wire)
6807 }
6808 }
6809
6810 impl ::fidl_next::FromWireRef<crate::wire::EnvironmentExtends> for EnvironmentExtends {
6811 #[inline]
6812 fn from_wire_ref(wire: &crate::wire::EnvironmentExtends) -> Self {
6813 Self::from(*wire)
6814 }
6815 }
6816
6817 pub type UrlScheme = ::std::string::String;
6818
6819 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6820 #[repr(u32)]
6821 pub enum ConfigTypeLayout {
6822 Bool = 1,
6823 Uint8 = 2,
6824 Uint16 = 3,
6825 Uint32 = 4,
6826 Uint64 = 5,
6827 Int8 = 6,
6828 Int16 = 7,
6829 Int32 = 8,
6830 Int64 = 9,
6831 String = 10,
6832 Vector = 11,
6833 UnknownOrdinal_(u32) = 12,
6834 }
6835 impl ::std::convert::From<u32> for ConfigTypeLayout {
6836 fn from(value: u32) -> Self {
6837 match value {
6838 1 => Self::Bool,
6839 2 => Self::Uint8,
6840 3 => Self::Uint16,
6841 4 => Self::Uint32,
6842 5 => Self::Uint64,
6843 6 => Self::Int8,
6844 7 => Self::Int16,
6845 8 => Self::Int32,
6846 9 => Self::Int64,
6847 10 => Self::String,
6848 11 => Self::Vector,
6849
6850 _ => Self::UnknownOrdinal_(value),
6851 }
6852 }
6853 }
6854
6855 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigTypeLayout, ___E> for ConfigTypeLayout
6856 where
6857 ___E: ?Sized,
6858 {
6859 #[inline]
6860 fn encode(
6861 self,
6862 encoder: &mut ___E,
6863 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigTypeLayout>,
6864 _: (),
6865 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6866 ::fidl_next::Encode::encode(&self, encoder, out, ())
6867 }
6868 }
6869
6870 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigTypeLayout, ___E>
6871 for &'a ConfigTypeLayout
6872 where
6873 ___E: ?Sized,
6874 {
6875 #[inline]
6876 fn encode(
6877 self,
6878 encoder: &mut ___E,
6879 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigTypeLayout>,
6880 _: (),
6881 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6882 ::fidl_next::munge!(let crate::wire::ConfigTypeLayout { value } = out);
6883 let _ = value.write(::fidl_next::wire::Uint32::from(match *self {
6884 ConfigTypeLayout::Bool => 1,
6885
6886 ConfigTypeLayout::Uint8 => 2,
6887
6888 ConfigTypeLayout::Uint16 => 3,
6889
6890 ConfigTypeLayout::Uint32 => 4,
6891
6892 ConfigTypeLayout::Uint64 => 5,
6893
6894 ConfigTypeLayout::Int8 => 6,
6895
6896 ConfigTypeLayout::Int16 => 7,
6897
6898 ConfigTypeLayout::Int32 => 8,
6899
6900 ConfigTypeLayout::Int64 => 9,
6901
6902 ConfigTypeLayout::String => 10,
6903
6904 ConfigTypeLayout::Vector => 11,
6905
6906 ConfigTypeLayout::UnknownOrdinal_(value) => value,
6907 }));
6908
6909 Ok(())
6910 }
6911 }
6912
6913 impl ::core::convert::From<crate::wire::ConfigTypeLayout> for ConfigTypeLayout {
6914 fn from(wire: crate::wire::ConfigTypeLayout) -> Self {
6915 match u32::from(wire.value) {
6916 1 => Self::Bool,
6917
6918 2 => Self::Uint8,
6919
6920 3 => Self::Uint16,
6921
6922 4 => Self::Uint32,
6923
6924 5 => Self::Uint64,
6925
6926 6 => Self::Int8,
6927
6928 7 => Self::Int16,
6929
6930 8 => Self::Int32,
6931
6932 9 => Self::Int64,
6933
6934 10 => Self::String,
6935
6936 11 => Self::Vector,
6937
6938 value => Self::UnknownOrdinal_(value),
6939 }
6940 }
6941 }
6942
6943 impl ::fidl_next::FromWire<crate::wire::ConfigTypeLayout> for ConfigTypeLayout {
6944 #[inline]
6945 fn from_wire(wire: crate::wire::ConfigTypeLayout) -> Self {
6946 Self::from(wire)
6947 }
6948 }
6949
6950 impl ::fidl_next::FromWireRef<crate::wire::ConfigTypeLayout> for ConfigTypeLayout {
6951 #[inline]
6952 fn from_wire_ref(wire: &crate::wire::ConfigTypeLayout) -> Self {
6953 Self::from(*wire)
6954 }
6955 }
6956
6957 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6958 pub enum LayoutConstraint {
6959 MaxSize(u32),
6960
6961 UnknownOrdinal_(u64),
6962 }
6963
6964 impl LayoutConstraint {
6965 pub fn is_unknown(&self) -> bool {
6966 #[allow(unreachable_patterns)]
6967 match self {
6968 Self::UnknownOrdinal_(_) => true,
6969 _ => false,
6970 }
6971 }
6972 }
6973
6974 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LayoutConstraint<'static>, ___E>
6975 for LayoutConstraint
6976 where
6977 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6978 ___E: ::fidl_next::Encoder,
6979 {
6980 #[inline]
6981 fn encode(
6982 self,
6983 encoder: &mut ___E,
6984 out: &mut ::core::mem::MaybeUninit<crate::wire::LayoutConstraint<'static>>,
6985 _: (),
6986 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6987 ::fidl_next::munge!(let crate::wire::LayoutConstraint { raw, _phantom: _ } = out);
6988
6989 match self {
6990 Self::MaxSize(value) => ::fidl_next::wire::Union::encode_as::<
6991 ___E,
6992 ::fidl_next::wire::Uint32,
6993 >(value, 1, encoder, raw, ())?,
6994
6995 Self::UnknownOrdinal_(ordinal) => {
6996 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
6997 }
6998 }
6999
7000 Ok(())
7001 }
7002 }
7003
7004 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LayoutConstraint<'static>, ___E>
7005 for &'a LayoutConstraint
7006 where
7007 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7008 ___E: ::fidl_next::Encoder,
7009 {
7010 #[inline]
7011 fn encode(
7012 self,
7013 encoder: &mut ___E,
7014 out: &mut ::core::mem::MaybeUninit<crate::wire::LayoutConstraint<'static>>,
7015 _: (),
7016 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7017 ::fidl_next::munge!(let crate::wire::LayoutConstraint { raw, _phantom: _ } = out);
7018
7019 match self {
7020 LayoutConstraint::MaxSize(value) => ::fidl_next::wire::Union::encode_as::<
7021 ___E,
7022 ::fidl_next::wire::Uint32,
7023 >(value, 1, encoder, raw, ())?,
7024
7025 LayoutConstraint::UnknownOrdinal_(ordinal) => {
7026 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
7027 }
7028 }
7029
7030 Ok(())
7031 }
7032 }
7033
7034 unsafe impl<___E>
7035 ::fidl_next::EncodeOption<crate::wire_optional::LayoutConstraint<'static>, ___E>
7036 for LayoutConstraint
7037 where
7038 ___E: ?Sized,
7039 LayoutConstraint: ::fidl_next::Encode<crate::wire::LayoutConstraint<'static>, ___E>,
7040 {
7041 #[inline]
7042 fn encode_option(
7043 this: ::core::option::Option<Self>,
7044 encoder: &mut ___E,
7045 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::LayoutConstraint<'static>>,
7046 _: (),
7047 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7048 ::fidl_next::munge!(let crate::wire_optional::LayoutConstraint { raw, _phantom: _ } = &mut *out);
7049
7050 if let Some(inner) = this {
7051 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7052 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
7053 } else {
7054 ::fidl_next::wire::Union::encode_absent(raw);
7055 }
7056
7057 Ok(())
7058 }
7059 }
7060
7061 unsafe impl<'a, ___E>
7062 ::fidl_next::EncodeOption<crate::wire_optional::LayoutConstraint<'static>, ___E>
7063 for &'a LayoutConstraint
7064 where
7065 ___E: ?Sized,
7066 &'a LayoutConstraint: ::fidl_next::Encode<crate::wire::LayoutConstraint<'static>, ___E>,
7067 {
7068 #[inline]
7069 fn encode_option(
7070 this: ::core::option::Option<Self>,
7071 encoder: &mut ___E,
7072 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::LayoutConstraint<'static>>,
7073 _: (),
7074 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7075 ::fidl_next::munge!(let crate::wire_optional::LayoutConstraint { raw, _phantom: _ } = &mut *out);
7076
7077 if let Some(inner) = this {
7078 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7079 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
7080 } else {
7081 ::fidl_next::wire::Union::encode_absent(raw);
7082 }
7083
7084 Ok(())
7085 }
7086 }
7087
7088 impl<'de> ::fidl_next::FromWire<crate::wire::LayoutConstraint<'de>> for LayoutConstraint {
7089 #[inline]
7090 fn from_wire(wire: crate::wire::LayoutConstraint<'de>) -> Self {
7091 let wire = ::core::mem::ManuallyDrop::new(wire);
7092 match wire.raw.ordinal() {
7093 1 => Self::MaxSize(::fidl_next::FromWire::from_wire(unsafe {
7094 wire.raw.get().read_unchecked::<::fidl_next::wire::Uint32>()
7095 })),
7096
7097 ord => return Self::UnknownOrdinal_(ord as u64),
7098 }
7099 }
7100 }
7101
7102 impl<'de> ::fidl_next::FromWireRef<crate::wire::LayoutConstraint<'de>> for LayoutConstraint {
7103 #[inline]
7104 fn from_wire_ref(wire: &crate::wire::LayoutConstraint<'de>) -> Self {
7105 match wire.raw.ordinal() {
7106 1 => Self::MaxSize(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7107 wire.raw.get().deref_unchecked::<::fidl_next::wire::Uint32>()
7108 })),
7109
7110 ord => return Self::UnknownOrdinal_(ord as u64),
7111 }
7112 }
7113 }
7114
7115 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::LayoutConstraint<'de>>
7116 for LayoutConstraint
7117 {
7118 #[inline]
7119 fn from_wire_option(
7120 wire: crate::wire_optional::LayoutConstraint<'de>,
7121 ) -> ::core::option::Option<Self> {
7122 if let Some(inner) = wire.into_option() {
7123 Some(::fidl_next::FromWire::from_wire(inner))
7124 } else {
7125 None
7126 }
7127 }
7128 }
7129
7130 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::LayoutConstraint<'de>>
7131 for Box<LayoutConstraint>
7132 {
7133 #[inline]
7134 fn from_wire_option(
7135 wire: crate::wire_optional::LayoutConstraint<'de>,
7136 ) -> ::core::option::Option<Self> {
7137 <LayoutConstraint as ::fidl_next::FromWireOption<
7138 crate::wire_optional::LayoutConstraint<'de>,
7139 >>::from_wire_option(wire)
7140 .map(Box::new)
7141 }
7142 }
7143
7144 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::LayoutConstraint<'de>>
7145 for Box<LayoutConstraint>
7146 {
7147 #[inline]
7148 fn from_wire_option_ref(
7149 wire: &crate::wire_optional::LayoutConstraint<'de>,
7150 ) -> ::core::option::Option<Self> {
7151 if let Some(inner) = wire.as_ref() {
7152 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
7153 } else {
7154 None
7155 }
7156 }
7157 }
7158
7159 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7160 pub struct ConfigType {
7161 pub layout: crate::natural::ConfigTypeLayout,
7162
7163 pub parameters: ::core::option::Option<::std::vec::Vec<crate::natural::LayoutParameter>>,
7164
7165 pub constraints: ::std::vec::Vec<crate::natural::LayoutConstraint>,
7166 }
7167
7168 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigType<'static>, ___E> for ConfigType
7169 where
7170 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7171 ___E: ::fidl_next::Encoder,
7172 {
7173 #[inline]
7174 fn encode(
7175 self,
7176 encoder_: &mut ___E,
7177 out_: &mut ::core::mem::MaybeUninit<crate::wire::ConfigType<'static>>,
7178 _: (),
7179 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7180 ::fidl_next::munge! {
7181 let crate::wire::ConfigType {
7182 layout,
7183 parameters,
7184 constraints,
7185
7186 } = out_;
7187 }
7188
7189 ::fidl_next::Encode::encode(self.layout, encoder_, layout, ())?;
7190
7191 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(layout.as_mut_ptr()) };
7192
7193 ::fidl_next::Encode::encode(self.parameters, encoder_, parameters, (4294967295, ()))?;
7194
7195 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(parameters.as_mut_ptr()) };
7196 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
7197
7198 ::fidl_next::Encode::encode(self.constraints, encoder_, constraints, (4294967295, ()))?;
7199
7200 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(constraints.as_mut_ptr()) };
7201 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
7202
7203 Ok(())
7204 }
7205 }
7206
7207 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigType<'static>, ___E> for &'a ConfigType
7208 where
7209 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7210 ___E: ::fidl_next::Encoder,
7211 {
7212 #[inline]
7213 fn encode(
7214 self,
7215 encoder_: &mut ___E,
7216 out_: &mut ::core::mem::MaybeUninit<crate::wire::ConfigType<'static>>,
7217 _: (),
7218 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7219 ::fidl_next::munge! {
7220 let crate::wire::ConfigType {
7221
7222 layout,
7223 parameters,
7224 constraints,
7225
7226 } = out_;
7227 }
7228
7229 ::fidl_next::Encode::encode(&self.layout, encoder_, layout, ())?;
7230
7231 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(layout.as_mut_ptr()) };
7232
7233 ::fidl_next::Encode::encode(&self.parameters, encoder_, parameters, (4294967295, ()))?;
7234
7235 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(parameters.as_mut_ptr()) };
7236 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
7237
7238 ::fidl_next::Encode::encode(
7239 &self.constraints,
7240 encoder_,
7241 constraints,
7242 (4294967295, ()),
7243 )?;
7244
7245 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(constraints.as_mut_ptr()) };
7246 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
7247
7248 Ok(())
7249 }
7250 }
7251
7252 unsafe impl<___E>
7253 ::fidl_next::EncodeOption<
7254 ::fidl_next::wire::Box<'static, crate::wire::ConfigType<'static>>,
7255 ___E,
7256 > for ConfigType
7257 where
7258 ___E: ::fidl_next::Encoder + ?Sized,
7259 ConfigType: ::fidl_next::Encode<crate::wire::ConfigType<'static>, ___E>,
7260 {
7261 #[inline]
7262 fn encode_option(
7263 this: ::core::option::Option<Self>,
7264 encoder: &mut ___E,
7265 out: &mut ::core::mem::MaybeUninit<
7266 ::fidl_next::wire::Box<'static, crate::wire::ConfigType<'static>>,
7267 >,
7268 _: (),
7269 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7270 if let Some(inner) = this {
7271 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7272 ::fidl_next::wire::Box::encode_present(out);
7273 } else {
7274 ::fidl_next::wire::Box::encode_absent(out);
7275 }
7276
7277 Ok(())
7278 }
7279 }
7280
7281 unsafe impl<'a, ___E>
7282 ::fidl_next::EncodeOption<
7283 ::fidl_next::wire::Box<'static, crate::wire::ConfigType<'static>>,
7284 ___E,
7285 > for &'a ConfigType
7286 where
7287 ___E: ::fidl_next::Encoder + ?Sized,
7288 &'a ConfigType: ::fidl_next::Encode<crate::wire::ConfigType<'static>, ___E>,
7289 {
7290 #[inline]
7291 fn encode_option(
7292 this: ::core::option::Option<Self>,
7293 encoder: &mut ___E,
7294 out: &mut ::core::mem::MaybeUninit<
7295 ::fidl_next::wire::Box<'static, crate::wire::ConfigType<'static>>,
7296 >,
7297 _: (),
7298 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7299 if let Some(inner) = this {
7300 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7301 ::fidl_next::wire::Box::encode_present(out);
7302 } else {
7303 ::fidl_next::wire::Box::encode_absent(out);
7304 }
7305
7306 Ok(())
7307 }
7308 }
7309
7310 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigType<'de>> for ConfigType {
7311 #[inline]
7312 fn from_wire(wire: crate::wire::ConfigType<'de>) -> Self {
7313 Self {
7314 layout: ::fidl_next::FromWire::from_wire(wire.layout),
7315
7316 parameters: ::fidl_next::FromWire::from_wire(wire.parameters),
7317
7318 constraints: ::fidl_next::FromWire::from_wire(wire.constraints),
7319 }
7320 }
7321 }
7322
7323 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigType<'de>> for ConfigType {
7324 #[inline]
7325 fn from_wire_ref(wire: &crate::wire::ConfigType<'de>) -> Self {
7326 Self {
7327 layout: ::fidl_next::FromWireRef::from_wire_ref(&wire.layout),
7328
7329 parameters: ::fidl_next::FromWireRef::from_wire_ref(&wire.parameters),
7330
7331 constraints: ::fidl_next::FromWireRef::from_wire_ref(&wire.constraints),
7332 }
7333 }
7334 }
7335
7336 #[doc = " The checksum produced for a configuration interface.\n Two configuration interfaces are the same if their checksums are the same.\n"]
7337 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7338 pub enum ConfigChecksum {
7339 Sha256([u8; 32]),
7340
7341 UnknownOrdinal_(u64),
7342 }
7343
7344 impl ConfigChecksum {
7345 pub fn is_unknown(&self) -> bool {
7346 #[allow(unreachable_patterns)]
7347 match self {
7348 Self::UnknownOrdinal_(_) => true,
7349 _ => false,
7350 }
7351 }
7352 }
7353
7354 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigChecksum<'static>, ___E> for ConfigChecksum
7355 where
7356 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7357 ___E: ::fidl_next::Encoder,
7358 {
7359 #[inline]
7360 fn encode(
7361 self,
7362 encoder: &mut ___E,
7363 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigChecksum<'static>>,
7364 _: (),
7365 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7366 ::fidl_next::munge!(let crate::wire::ConfigChecksum { raw, _phantom: _ } = out);
7367
7368 match self {
7369 Self::Sha256(value) => ::fidl_next::wire::Union::encode_as::<___E, [u8; 32]>(
7370 value,
7371 1,
7372 encoder,
7373 raw,
7374 (),
7375 )?,
7376
7377 Self::UnknownOrdinal_(ordinal) => {
7378 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
7379 }
7380 }
7381
7382 Ok(())
7383 }
7384 }
7385
7386 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigChecksum<'static>, ___E>
7387 for &'a ConfigChecksum
7388 where
7389 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7390 ___E: ::fidl_next::Encoder,
7391 {
7392 #[inline]
7393 fn encode(
7394 self,
7395 encoder: &mut ___E,
7396 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigChecksum<'static>>,
7397 _: (),
7398 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7399 ::fidl_next::munge!(let crate::wire::ConfigChecksum { raw, _phantom: _ } = out);
7400
7401 match self {
7402 ConfigChecksum::Sha256(value) => ::fidl_next::wire::Union::encode_as::<
7403 ___E,
7404 [u8; 32],
7405 >(value, 1, encoder, raw, ())?,
7406
7407 ConfigChecksum::UnknownOrdinal_(ordinal) => {
7408 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
7409 }
7410 }
7411
7412 Ok(())
7413 }
7414 }
7415
7416 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::ConfigChecksum<'static>, ___E>
7417 for ConfigChecksum
7418 where
7419 ___E: ?Sized,
7420 ConfigChecksum: ::fidl_next::Encode<crate::wire::ConfigChecksum<'static>, ___E>,
7421 {
7422 #[inline]
7423 fn encode_option(
7424 this: ::core::option::Option<Self>,
7425 encoder: &mut ___E,
7426 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigChecksum<'static>>,
7427 _: (),
7428 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7429 ::fidl_next::munge!(let crate::wire_optional::ConfigChecksum { raw, _phantom: _ } = &mut *out);
7430
7431 if let Some(inner) = this {
7432 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7433 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
7434 } else {
7435 ::fidl_next::wire::Union::encode_absent(raw);
7436 }
7437
7438 Ok(())
7439 }
7440 }
7441
7442 unsafe impl<'a, ___E>
7443 ::fidl_next::EncodeOption<crate::wire_optional::ConfigChecksum<'static>, ___E>
7444 for &'a ConfigChecksum
7445 where
7446 ___E: ?Sized,
7447 &'a ConfigChecksum: ::fidl_next::Encode<crate::wire::ConfigChecksum<'static>, ___E>,
7448 {
7449 #[inline]
7450 fn encode_option(
7451 this: ::core::option::Option<Self>,
7452 encoder: &mut ___E,
7453 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigChecksum<'static>>,
7454 _: (),
7455 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7456 ::fidl_next::munge!(let crate::wire_optional::ConfigChecksum { raw, _phantom: _ } = &mut *out);
7457
7458 if let Some(inner) = this {
7459 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7460 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
7461 } else {
7462 ::fidl_next::wire::Union::encode_absent(raw);
7463 }
7464
7465 Ok(())
7466 }
7467 }
7468
7469 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigChecksum<'de>> for ConfigChecksum {
7470 #[inline]
7471 fn from_wire(wire: crate::wire::ConfigChecksum<'de>) -> Self {
7472 let wire = ::core::mem::ManuallyDrop::new(wire);
7473 match wire.raw.ordinal() {
7474 1 => Self::Sha256(::fidl_next::FromWire::from_wire(unsafe {
7475 wire.raw.get().read_unchecked::<[u8; 32]>()
7476 })),
7477
7478 ord => return Self::UnknownOrdinal_(ord as u64),
7479 }
7480 }
7481 }
7482
7483 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigChecksum<'de>> for ConfigChecksum {
7484 #[inline]
7485 fn from_wire_ref(wire: &crate::wire::ConfigChecksum<'de>) -> Self {
7486 match wire.raw.ordinal() {
7487 1 => Self::Sha256(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7488 wire.raw.get().deref_unchecked::<[u8; 32]>()
7489 })),
7490
7491 ord => return Self::UnknownOrdinal_(ord as u64),
7492 }
7493 }
7494 }
7495
7496 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigChecksum<'de>>
7497 for ConfigChecksum
7498 {
7499 #[inline]
7500 fn from_wire_option(
7501 wire: crate::wire_optional::ConfigChecksum<'de>,
7502 ) -> ::core::option::Option<Self> {
7503 if let Some(inner) = wire.into_option() {
7504 Some(::fidl_next::FromWire::from_wire(inner))
7505 } else {
7506 None
7507 }
7508 }
7509 }
7510
7511 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigChecksum<'de>>
7512 for Box<ConfigChecksum>
7513 {
7514 #[inline]
7515 fn from_wire_option(
7516 wire: crate::wire_optional::ConfigChecksum<'de>,
7517 ) -> ::core::option::Option<Self> {
7518 <ConfigChecksum as ::fidl_next::FromWireOption<
7519 crate::wire_optional::ConfigChecksum<'de>,
7520 >>::from_wire_option(wire)
7521 .map(Box::new)
7522 }
7523 }
7524
7525 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::ConfigChecksum<'de>>
7526 for Box<ConfigChecksum>
7527 {
7528 #[inline]
7529 fn from_wire_option_ref(
7530 wire: &crate::wire_optional::ConfigChecksum<'de>,
7531 ) -> ::core::option::Option<Self> {
7532 if let Some(inner) = wire.as_ref() {
7533 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
7534 } else {
7535 None
7536 }
7537 }
7538 }
7539
7540 #[doc = " Declares storage used by a component, which was offered to it.\n"]
7541 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7542 pub struct UseStorage {
7543 pub source_name: ::core::option::Option<::std::string::String>,
7544
7545 pub target_path: ::core::option::Option<::std::string::String>,
7546
7547 pub availability: ::core::option::Option<crate::natural::Availability>,
7548 }
7549
7550 impl UseStorage {
7551 fn __max_ordinal(&self) -> usize {
7552 if self.availability.is_some() {
7553 return 3;
7554 }
7555
7556 if self.target_path.is_some() {
7557 return 2;
7558 }
7559
7560 if self.source_name.is_some() {
7561 return 1;
7562 }
7563
7564 0
7565 }
7566 }
7567
7568 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseStorage<'static>, ___E> for UseStorage
7569 where
7570 ___E: ::fidl_next::Encoder + ?Sized,
7571 {
7572 #[inline]
7573 fn encode(
7574 mut self,
7575 encoder: &mut ___E,
7576 out: &mut ::core::mem::MaybeUninit<crate::wire::UseStorage<'static>>,
7577 _: (),
7578 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7579 ::fidl_next::munge!(let crate::wire::UseStorage { table } = out);
7580
7581 let max_ord = self.__max_ordinal();
7582
7583 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7584 ::fidl_next::Wire::zero_padding(&mut out);
7585
7586 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7587 ::fidl_next::wire::Envelope,
7588 >(encoder, max_ord);
7589
7590 for i in 1..=max_ord {
7591 match i {
7592 3 => {
7593 if let Some(value) = self.availability.take() {
7594 ::fidl_next::wire::Envelope::encode_value::<
7595 crate::wire::Availability,
7596 ___E,
7597 >(
7598 value, preallocated.encoder, &mut out, ()
7599 )?;
7600 } else {
7601 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7602 }
7603 }
7604
7605 2 => {
7606 if let Some(value) = self.target_path.take() {
7607 ::fidl_next::wire::Envelope::encode_value::<
7608 ::fidl_next::wire::String<'static>,
7609 ___E,
7610 >(
7611 value, preallocated.encoder, &mut out, 1024
7612 )?;
7613 } else {
7614 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7615 }
7616 }
7617
7618 1 => {
7619 if let Some(value) = self.source_name.take() {
7620 ::fidl_next::wire::Envelope::encode_value::<
7621 ::fidl_next::wire::String<'static>,
7622 ___E,
7623 >(
7624 value, preallocated.encoder, &mut out, 100
7625 )?;
7626 } else {
7627 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7628 }
7629 }
7630
7631 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7632 }
7633 unsafe {
7634 preallocated.write_next(out.assume_init_ref());
7635 }
7636 }
7637
7638 ::fidl_next::wire::Table::encode_len(table, max_ord);
7639
7640 Ok(())
7641 }
7642 }
7643
7644 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseStorage<'static>, ___E> for &'a UseStorage
7645 where
7646 ___E: ::fidl_next::Encoder + ?Sized,
7647 {
7648 #[inline]
7649 fn encode(
7650 self,
7651 encoder: &mut ___E,
7652 out: &mut ::core::mem::MaybeUninit<crate::wire::UseStorage<'static>>,
7653 _: (),
7654 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7655 ::fidl_next::munge!(let crate::wire::UseStorage { table } = out);
7656
7657 let max_ord = self.__max_ordinal();
7658
7659 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7660 ::fidl_next::Wire::zero_padding(&mut out);
7661
7662 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7663 ::fidl_next::wire::Envelope,
7664 >(encoder, max_ord);
7665
7666 for i in 1..=max_ord {
7667 match i {
7668 3 => {
7669 if let Some(value) = &self.availability {
7670 ::fidl_next::wire::Envelope::encode_value::<
7671 crate::wire::Availability,
7672 ___E,
7673 >(
7674 value, preallocated.encoder, &mut out, ()
7675 )?;
7676 } else {
7677 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7678 }
7679 }
7680
7681 2 => {
7682 if let Some(value) = &self.target_path {
7683 ::fidl_next::wire::Envelope::encode_value::<
7684 ::fidl_next::wire::String<'static>,
7685 ___E,
7686 >(
7687 value, preallocated.encoder, &mut out, 1024
7688 )?;
7689 } else {
7690 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7691 }
7692 }
7693
7694 1 => {
7695 if let Some(value) = &self.source_name {
7696 ::fidl_next::wire::Envelope::encode_value::<
7697 ::fidl_next::wire::String<'static>,
7698 ___E,
7699 >(
7700 value, preallocated.encoder, &mut out, 100
7701 )?;
7702 } else {
7703 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7704 }
7705 }
7706
7707 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7708 }
7709 unsafe {
7710 preallocated.write_next(out.assume_init_ref());
7711 }
7712 }
7713
7714 ::fidl_next::wire::Table::encode_len(table, max_ord);
7715
7716 Ok(())
7717 }
7718 }
7719
7720 impl<'de> ::fidl_next::FromWire<crate::wire::UseStorage<'de>> for UseStorage {
7721 #[inline]
7722 fn from_wire(wire_: crate::wire::UseStorage<'de>) -> Self {
7723 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7724
7725 let source_name = wire_.table.get(1);
7726
7727 let target_path = wire_.table.get(2);
7728
7729 let availability = wire_.table.get(3);
7730
7731 Self {
7732 source_name: source_name.map(|envelope| {
7733 ::fidl_next::FromWire::from_wire(unsafe {
7734 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
7735 })
7736 }),
7737
7738 target_path: target_path.map(|envelope| {
7739 ::fidl_next::FromWire::from_wire(unsafe {
7740 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
7741 })
7742 }),
7743
7744 availability: availability.map(|envelope| {
7745 ::fidl_next::FromWire::from_wire(unsafe {
7746 envelope.read_unchecked::<crate::wire::Availability>()
7747 })
7748 }),
7749 }
7750 }
7751 }
7752
7753 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseStorage<'de>> for UseStorage {
7754 #[inline]
7755 fn from_wire_ref(wire: &crate::wire::UseStorage<'de>) -> Self {
7756 Self {
7757 source_name: wire.table.get(1).map(|envelope| {
7758 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7759 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
7760 })
7761 }),
7762
7763 target_path: wire.table.get(2).map(|envelope| {
7764 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7765 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
7766 })
7767 }),
7768
7769 availability: wire.table.get(3).map(|envelope| {
7770 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7771 envelope.deref_unchecked::<crate::wire::Availability>()
7772 })
7773 }),
7774 }
7775 }
7776 }
7777
7778 ::fidl_next::bitflags::bitflags! {
7779 #[doc = " Allowed sources for runtime overrides of a config field\'s value.\n"]#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, )]pub struct ConfigMutability: u32 {
7780 #[doc = " Allow parent components to provide overrides for the configuration field.\n"]const PARENT = 1;
7781 const _ = !0;
7782 }
7783 }
7784
7785 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigMutability, ___E> for ConfigMutability
7786 where
7787 ___E: ?Sized,
7788 {
7789 #[inline]
7790 fn encode(
7791 self,
7792 encoder: &mut ___E,
7793 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigMutability>,
7794 _: (),
7795 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7796 ::fidl_next::Encode::encode(&self, encoder, out, ())
7797 }
7798 }
7799
7800 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigMutability, ___E>
7801 for &'a ConfigMutability
7802 where
7803 ___E: ?Sized,
7804 {
7805 #[inline]
7806 fn encode(
7807 self,
7808 _: &mut ___E,
7809 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigMutability>,
7810 _: (),
7811 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7812 ::fidl_next::munge!(let crate::wire::ConfigMutability { value } = out);
7813
7814 let _ = value.write(::fidl_next::wire::Uint32::from(self.bits()));
7815 Ok(())
7816 }
7817 }
7818
7819 impl ::core::convert::From<crate::wire::ConfigMutability> for ConfigMutability {
7820 fn from(wire: crate::wire::ConfigMutability) -> Self {
7821 Self::from_bits_retain(u32::from(wire.value))
7822 }
7823 }
7824
7825 impl ::fidl_next::FromWire<crate::wire::ConfigMutability> for ConfigMutability {
7826 #[inline]
7827 fn from_wire(wire: crate::wire::ConfigMutability) -> Self {
7828 Self::from(wire)
7829 }
7830 }
7831
7832 impl ::fidl_next::FromWireRef<crate::wire::ConfigMutability> for ConfigMutability {
7833 #[inline]
7834 fn from_wire_ref(wire: &crate::wire::ConfigMutability) -> Self {
7835 Self::from(*wire)
7836 }
7837 }
7838
7839 #[doc = " Declares a single config field (key + type)\n"]
7840 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
7841 pub struct ConfigField {
7842 pub key: ::core::option::Option<::std::string::String>,
7843
7844 pub type_: ::core::option::Option<crate::natural::ConfigType>,
7845
7846 pub mutability: ::core::option::Option<crate::natural::ConfigMutability>,
7847 }
7848
7849 impl ConfigField {
7850 fn __max_ordinal(&self) -> usize {
7851 if self.mutability.is_some() {
7852 return 3;
7853 }
7854
7855 if self.type_.is_some() {
7856 return 2;
7857 }
7858
7859 if self.key.is_some() {
7860 return 1;
7861 }
7862
7863 0
7864 }
7865 }
7866
7867 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigField<'static>, ___E> for ConfigField
7868 where
7869 ___E: ::fidl_next::Encoder + ?Sized,
7870 {
7871 #[inline]
7872 fn encode(
7873 mut self,
7874 encoder: &mut ___E,
7875 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigField<'static>>,
7876 _: (),
7877 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7878 ::fidl_next::munge!(let crate::wire::ConfigField { table } = out);
7879
7880 let max_ord = self.__max_ordinal();
7881
7882 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7883 ::fidl_next::Wire::zero_padding(&mut out);
7884
7885 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7886 ::fidl_next::wire::Envelope,
7887 >(encoder, max_ord);
7888
7889 for i in 1..=max_ord {
7890 match i {
7891 3 => {
7892 if let Some(value) = self.mutability.take() {
7893 ::fidl_next::wire::Envelope::encode_value::<
7894 crate::wire::ConfigMutability,
7895 ___E,
7896 >(
7897 value, preallocated.encoder, &mut out, ()
7898 )?;
7899 } else {
7900 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7901 }
7902 }
7903
7904 2 => {
7905 if let Some(value) = self.type_.take() {
7906 ::fidl_next::wire::Envelope::encode_value::<
7907 crate::wire::ConfigType<'static>,
7908 ___E,
7909 >(
7910 value, preallocated.encoder, &mut out, ()
7911 )?;
7912 } else {
7913 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7914 }
7915 }
7916
7917 1 => {
7918 if let Some(value) = self.key.take() {
7919 ::fidl_next::wire::Envelope::encode_value::<
7920 ::fidl_next::wire::String<'static>,
7921 ___E,
7922 >(
7923 value, preallocated.encoder, &mut out, 64
7924 )?;
7925 } else {
7926 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7927 }
7928 }
7929
7930 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
7931 }
7932 unsafe {
7933 preallocated.write_next(out.assume_init_ref());
7934 }
7935 }
7936
7937 ::fidl_next::wire::Table::encode_len(table, max_ord);
7938
7939 Ok(())
7940 }
7941 }
7942
7943 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigField<'static>, ___E>
7944 for &'a ConfigField
7945 where
7946 ___E: ::fidl_next::Encoder + ?Sized,
7947 {
7948 #[inline]
7949 fn encode(
7950 self,
7951 encoder: &mut ___E,
7952 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigField<'static>>,
7953 _: (),
7954 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7955 ::fidl_next::munge!(let crate::wire::ConfigField { table } = out);
7956
7957 let max_ord = self.__max_ordinal();
7958
7959 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
7960 ::fidl_next::Wire::zero_padding(&mut out);
7961
7962 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
7963 ::fidl_next::wire::Envelope,
7964 >(encoder, max_ord);
7965
7966 for i in 1..=max_ord {
7967 match i {
7968 3 => {
7969 if let Some(value) = &self.mutability {
7970 ::fidl_next::wire::Envelope::encode_value::<
7971 crate::wire::ConfigMutability,
7972 ___E,
7973 >(
7974 value, preallocated.encoder, &mut out, ()
7975 )?;
7976 } else {
7977 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7978 }
7979 }
7980
7981 2 => {
7982 if let Some(value) = &self.type_ {
7983 ::fidl_next::wire::Envelope::encode_value::<
7984 crate::wire::ConfigType<'static>,
7985 ___E,
7986 >(
7987 value, preallocated.encoder, &mut out, ()
7988 )?;
7989 } else {
7990 ::fidl_next::wire::Envelope::encode_zero(&mut out)
7991 }
7992 }
7993
7994 1 => {
7995 if let Some(value) = &self.key {
7996 ::fidl_next::wire::Envelope::encode_value::<
7997 ::fidl_next::wire::String<'static>,
7998 ___E,
7999 >(
8000 value, preallocated.encoder, &mut out, 64
8001 )?;
8002 } else {
8003 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8004 }
8005 }
8006
8007 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8008 }
8009 unsafe {
8010 preallocated.write_next(out.assume_init_ref());
8011 }
8012 }
8013
8014 ::fidl_next::wire::Table::encode_len(table, max_ord);
8015
8016 Ok(())
8017 }
8018 }
8019
8020 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigField<'de>> for ConfigField {
8021 #[inline]
8022 fn from_wire(wire_: crate::wire::ConfigField<'de>) -> Self {
8023 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8024
8025 let key = wire_.table.get(1);
8026
8027 let type_ = wire_.table.get(2);
8028
8029 let mutability = wire_.table.get(3);
8030
8031 Self {
8032 key: key.map(|envelope| {
8033 ::fidl_next::FromWire::from_wire(unsafe {
8034 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
8035 })
8036 }),
8037
8038 type_: type_.map(|envelope| {
8039 ::fidl_next::FromWire::from_wire(unsafe {
8040 envelope.read_unchecked::<crate::wire::ConfigType<'de>>()
8041 })
8042 }),
8043
8044 mutability: mutability.map(|envelope| {
8045 ::fidl_next::FromWire::from_wire(unsafe {
8046 envelope.read_unchecked::<crate::wire::ConfigMutability>()
8047 })
8048 }),
8049 }
8050 }
8051 }
8052
8053 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigField<'de>> for ConfigField {
8054 #[inline]
8055 fn from_wire_ref(wire: &crate::wire::ConfigField<'de>) -> Self {
8056 Self {
8057 key: wire.table.get(1).map(|envelope| {
8058 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8059 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
8060 })
8061 }),
8062
8063 type_: wire.table.get(2).map(|envelope| {
8064 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8065 envelope.deref_unchecked::<crate::wire::ConfigType<'de>>()
8066 })
8067 }),
8068
8069 mutability: wire.table.get(3).map(|envelope| {
8070 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8071 envelope.deref_unchecked::<crate::wire::ConfigMutability>()
8072 })
8073 }),
8074 }
8075 }
8076 }
8077
8078 #[doc = " A program declaration.\n\n This declaration is set by executable components to designate the runner to\n use and pass runner-specific program information to it.\n\n To learn more about runners, see:\n https://fuchsia.dev/fuchsia-src/glossary#runner\n"]
8079 #[derive(Debug, Default, PartialEq)]
8080 pub struct Program {
8081 pub runner: ::core::option::Option<::std::string::String>,
8082
8083 pub info: ::core::option::Option<::fidl_next_common_fuchsia_data::natural::Dictionary>,
8084 }
8085
8086 impl Program {
8087 fn __max_ordinal(&self) -> usize {
8088 if self.info.is_some() {
8089 return 2;
8090 }
8091
8092 if self.runner.is_some() {
8093 return 1;
8094 }
8095
8096 0
8097 }
8098 }
8099
8100 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Program<'static>, ___E> for Program
8101 where
8102 ___E: ::fidl_next::Encoder + ?Sized,
8103 {
8104 #[inline]
8105 fn encode(
8106 mut self,
8107 encoder: &mut ___E,
8108 out: &mut ::core::mem::MaybeUninit<crate::wire::Program<'static>>,
8109 _: (),
8110 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8111 ::fidl_next::munge!(let crate::wire::Program { table } = out);
8112
8113 let max_ord = self.__max_ordinal();
8114
8115 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8116 ::fidl_next::Wire::zero_padding(&mut out);
8117
8118 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8119 ::fidl_next::wire::Envelope,
8120 >(encoder, max_ord);
8121
8122 for i in 1..=max_ord {
8123 match i {
8124 2 => {
8125 if let Some(value) = self.info.take() {
8126 ::fidl_next::wire::Envelope::encode_value::<
8127 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
8128 ___E,
8129 >(
8130 value, preallocated.encoder, &mut out, ()
8131 )?;
8132 } else {
8133 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8134 }
8135 }
8136
8137 1 => {
8138 if let Some(value) = self.runner.take() {
8139 ::fidl_next::wire::Envelope::encode_value::<
8140 ::fidl_next::wire::String<'static>,
8141 ___E,
8142 >(
8143 value, preallocated.encoder, &mut out, 100
8144 )?;
8145 } else {
8146 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8147 }
8148 }
8149
8150 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8151 }
8152 unsafe {
8153 preallocated.write_next(out.assume_init_ref());
8154 }
8155 }
8156
8157 ::fidl_next::wire::Table::encode_len(table, max_ord);
8158
8159 Ok(())
8160 }
8161 }
8162
8163 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Program<'static>, ___E> for &'a Program
8164 where
8165 ___E: ::fidl_next::Encoder + ?Sized,
8166 {
8167 #[inline]
8168 fn encode(
8169 self,
8170 encoder: &mut ___E,
8171 out: &mut ::core::mem::MaybeUninit<crate::wire::Program<'static>>,
8172 _: (),
8173 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8174 ::fidl_next::munge!(let crate::wire::Program { table } = out);
8175
8176 let max_ord = self.__max_ordinal();
8177
8178 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8179 ::fidl_next::Wire::zero_padding(&mut out);
8180
8181 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8182 ::fidl_next::wire::Envelope,
8183 >(encoder, max_ord);
8184
8185 for i in 1..=max_ord {
8186 match i {
8187 2 => {
8188 if let Some(value) = &self.info {
8189 ::fidl_next::wire::Envelope::encode_value::<
8190 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
8191 ___E,
8192 >(
8193 value, preallocated.encoder, &mut out, ()
8194 )?;
8195 } else {
8196 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8197 }
8198 }
8199
8200 1 => {
8201 if let Some(value) = &self.runner {
8202 ::fidl_next::wire::Envelope::encode_value::<
8203 ::fidl_next::wire::String<'static>,
8204 ___E,
8205 >(
8206 value, preallocated.encoder, &mut out, 100
8207 )?;
8208 } else {
8209 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8210 }
8211 }
8212
8213 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8214 }
8215 unsafe {
8216 preallocated.write_next(out.assume_init_ref());
8217 }
8218 }
8219
8220 ::fidl_next::wire::Table::encode_len(table, max_ord);
8221
8222 Ok(())
8223 }
8224 }
8225
8226 impl<'de> ::fidl_next::FromWire<crate::wire::Program<'de>> for Program {
8227 #[inline]
8228 fn from_wire(wire_: crate::wire::Program<'de>) -> Self {
8229 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8230
8231 let runner = wire_.table.get(1);
8232
8233 let info = wire_.table.get(2);
8234
8235 Self {
8236
8237
8238 runner: runner.map(|envelope| ::fidl_next::FromWire::from_wire(
8239 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
8240 )),
8241
8242
8243 info: info.map(|envelope| ::fidl_next::FromWire::from_wire(
8244 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
8245 )),
8246
8247 }
8248 }
8249 }
8250
8251 impl<'de> ::fidl_next::FromWireRef<crate::wire::Program<'de>> for Program {
8252 #[inline]
8253 fn from_wire_ref(wire: &crate::wire::Program<'de>) -> Self {
8254 Self {
8255
8256
8257 runner: wire.table.get(1)
8258 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
8259 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
8260 )),
8261
8262
8263 info: wire.table.get(2)
8264 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
8265 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
8266 )),
8267
8268 }
8269 }
8270 }
8271
8272 #[doc = " Debug information about the component.\n"]
8273 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8274 pub struct DebugInfo {
8275 pub manifest_sources: ::core::option::Option<::std::vec::Vec<::std::string::String>>,
8276 }
8277
8278 impl DebugInfo {
8279 fn __max_ordinal(&self) -> usize {
8280 if self.manifest_sources.is_some() {
8281 return 1;
8282 }
8283
8284 0
8285 }
8286 }
8287
8288 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DebugInfo<'static>, ___E> for DebugInfo
8289 where
8290 ___E: ::fidl_next::Encoder + ?Sized,
8291 {
8292 #[inline]
8293 fn encode(
8294 mut self,
8295 encoder: &mut ___E,
8296 out: &mut ::core::mem::MaybeUninit<crate::wire::DebugInfo<'static>>,
8297 _: (),
8298 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8299 ::fidl_next::munge!(let crate::wire::DebugInfo { table } = out);
8300
8301 let max_ord = self.__max_ordinal();
8302
8303 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8304 ::fidl_next::Wire::zero_padding(&mut out);
8305
8306 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8307 ::fidl_next::wire::Envelope,
8308 >(encoder, max_ord);
8309
8310 for i in 1..=max_ord {
8311 match i {
8312 1 => {
8313 if let Some(value) = self.manifest_sources.take() {
8314 ::fidl_next::wire::Envelope::encode_value::<
8315 ::fidl_next::wire::Vector<
8316 'static,
8317 ::fidl_next::wire::String<'static>,
8318 >,
8319 ___E,
8320 >(
8321 value, preallocated.encoder, &mut out, (4294967295, 4294967295)
8322 )?;
8323 } else {
8324 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8325 }
8326 }
8327
8328 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8329 }
8330 unsafe {
8331 preallocated.write_next(out.assume_init_ref());
8332 }
8333 }
8334
8335 ::fidl_next::wire::Table::encode_len(table, max_ord);
8336
8337 Ok(())
8338 }
8339 }
8340
8341 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DebugInfo<'static>, ___E> for &'a DebugInfo
8342 where
8343 ___E: ::fidl_next::Encoder + ?Sized,
8344 {
8345 #[inline]
8346 fn encode(
8347 self,
8348 encoder: &mut ___E,
8349 out: &mut ::core::mem::MaybeUninit<crate::wire::DebugInfo<'static>>,
8350 _: (),
8351 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8352 ::fidl_next::munge!(let crate::wire::DebugInfo { table } = out);
8353
8354 let max_ord = self.__max_ordinal();
8355
8356 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8357 ::fidl_next::Wire::zero_padding(&mut out);
8358
8359 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8360 ::fidl_next::wire::Envelope,
8361 >(encoder, max_ord);
8362
8363 for i in 1..=max_ord {
8364 match i {
8365 1 => {
8366 if let Some(value) = &self.manifest_sources {
8367 ::fidl_next::wire::Envelope::encode_value::<
8368 ::fidl_next::wire::Vector<
8369 'static,
8370 ::fidl_next::wire::String<'static>,
8371 >,
8372 ___E,
8373 >(
8374 value, preallocated.encoder, &mut out, (4294967295, 4294967295)
8375 )?;
8376 } else {
8377 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8378 }
8379 }
8380
8381 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8382 }
8383 unsafe {
8384 preallocated.write_next(out.assume_init_ref());
8385 }
8386 }
8387
8388 ::fidl_next::wire::Table::encode_len(table, max_ord);
8389
8390 Ok(())
8391 }
8392 }
8393
8394 impl<'de> ::fidl_next::FromWire<crate::wire::DebugInfo<'de>> for DebugInfo {
8395 #[inline]
8396 fn from_wire(wire_: crate::wire::DebugInfo<'de>) -> Self {
8397 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8398
8399 let manifest_sources = wire_.table.get(1);
8400
8401 Self {
8402
8403
8404 manifest_sources: manifest_sources.map(|envelope| ::fidl_next::FromWire::from_wire(
8405 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>() }
8406 )),
8407
8408 }
8409 }
8410 }
8411
8412 impl<'de> ::fidl_next::FromWireRef<crate::wire::DebugInfo<'de>> for DebugInfo {
8413 #[inline]
8414 fn from_wire_ref(wire: &crate::wire::DebugInfo<'de>) -> Self {
8415 Self {
8416
8417
8418 manifest_sources: wire.table.get(1)
8419 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
8420 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>() }
8421 )),
8422
8423 }
8424 }
8425 }
8426
8427 #[doc = " Declares a service used by a component, which was offered to it.\n\n To learn more about services, see:\n https://fuchsia.dev/fuchsia-src/glossary#service\n"]
8428 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8429 pub struct UseService {
8430 pub source: ::core::option::Option<crate::natural::Ref>,
8431
8432 pub source_name: ::core::option::Option<::std::string::String>,
8433
8434 pub target_path: ::core::option::Option<::std::string::String>,
8435
8436 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
8437
8438 pub availability: ::core::option::Option<crate::natural::Availability>,
8439
8440 pub source_dictionary: ::core::option::Option<::std::string::String>,
8441 }
8442
8443 impl UseService {
8444 fn __max_ordinal(&self) -> usize {
8445 if self.source_dictionary.is_some() {
8446 return 6;
8447 }
8448
8449 if self.availability.is_some() {
8450 return 5;
8451 }
8452
8453 if self.dependency_type.is_some() {
8454 return 4;
8455 }
8456
8457 if self.target_path.is_some() {
8458 return 3;
8459 }
8460
8461 if self.source_name.is_some() {
8462 return 2;
8463 }
8464
8465 if self.source.is_some() {
8466 return 1;
8467 }
8468
8469 0
8470 }
8471 }
8472
8473 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseService<'static>, ___E> for UseService
8474 where
8475 ___E: ::fidl_next::Encoder + ?Sized,
8476 {
8477 #[inline]
8478 fn encode(
8479 mut self,
8480 encoder: &mut ___E,
8481 out: &mut ::core::mem::MaybeUninit<crate::wire::UseService<'static>>,
8482 _: (),
8483 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8484 ::fidl_next::munge!(let crate::wire::UseService { table } = out);
8485
8486 let max_ord = self.__max_ordinal();
8487
8488 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8489 ::fidl_next::Wire::zero_padding(&mut out);
8490
8491 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8492 ::fidl_next::wire::Envelope,
8493 >(encoder, max_ord);
8494
8495 for i in 1..=max_ord {
8496 match i {
8497 6 => {
8498 if let Some(value) = self.source_dictionary.take() {
8499 ::fidl_next::wire::Envelope::encode_value::<
8500 ::fidl_next::wire::String<'static>,
8501 ___E,
8502 >(
8503 value, preallocated.encoder, &mut out, 1024
8504 )?;
8505 } else {
8506 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8507 }
8508 }
8509
8510 5 => {
8511 if let Some(value) = self.availability.take() {
8512 ::fidl_next::wire::Envelope::encode_value::<
8513 crate::wire::Availability,
8514 ___E,
8515 >(
8516 value, preallocated.encoder, &mut out, ()
8517 )?;
8518 } else {
8519 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8520 }
8521 }
8522
8523 4 => {
8524 if let Some(value) = self.dependency_type.take() {
8525 ::fidl_next::wire::Envelope::encode_value::<
8526 crate::wire::DependencyType,
8527 ___E,
8528 >(
8529 value, preallocated.encoder, &mut out, ()
8530 )?;
8531 } else {
8532 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8533 }
8534 }
8535
8536 3 => {
8537 if let Some(value) = self.target_path.take() {
8538 ::fidl_next::wire::Envelope::encode_value::<
8539 ::fidl_next::wire::String<'static>,
8540 ___E,
8541 >(
8542 value, preallocated.encoder, &mut out, 1024
8543 )?;
8544 } else {
8545 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8546 }
8547 }
8548
8549 2 => {
8550 if let Some(value) = self.source_name.take() {
8551 ::fidl_next::wire::Envelope::encode_value::<
8552 ::fidl_next::wire::String<'static>,
8553 ___E,
8554 >(
8555 value, preallocated.encoder, &mut out, 100
8556 )?;
8557 } else {
8558 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8559 }
8560 }
8561
8562 1 => {
8563 if let Some(value) = self.source.take() {
8564 ::fidl_next::wire::Envelope::encode_value::<
8565 crate::wire::Ref<'static>,
8566 ___E,
8567 >(
8568 value, preallocated.encoder, &mut out, ()
8569 )?;
8570 } else {
8571 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8572 }
8573 }
8574
8575 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8576 }
8577 unsafe {
8578 preallocated.write_next(out.assume_init_ref());
8579 }
8580 }
8581
8582 ::fidl_next::wire::Table::encode_len(table, max_ord);
8583
8584 Ok(())
8585 }
8586 }
8587
8588 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseService<'static>, ___E> for &'a UseService
8589 where
8590 ___E: ::fidl_next::Encoder + ?Sized,
8591 {
8592 #[inline]
8593 fn encode(
8594 self,
8595 encoder: &mut ___E,
8596 out: &mut ::core::mem::MaybeUninit<crate::wire::UseService<'static>>,
8597 _: (),
8598 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8599 ::fidl_next::munge!(let crate::wire::UseService { table } = out);
8600
8601 let max_ord = self.__max_ordinal();
8602
8603 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8604 ::fidl_next::Wire::zero_padding(&mut out);
8605
8606 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8607 ::fidl_next::wire::Envelope,
8608 >(encoder, max_ord);
8609
8610 for i in 1..=max_ord {
8611 match i {
8612 6 => {
8613 if let Some(value) = &self.source_dictionary {
8614 ::fidl_next::wire::Envelope::encode_value::<
8615 ::fidl_next::wire::String<'static>,
8616 ___E,
8617 >(
8618 value, preallocated.encoder, &mut out, 1024
8619 )?;
8620 } else {
8621 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8622 }
8623 }
8624
8625 5 => {
8626 if let Some(value) = &self.availability {
8627 ::fidl_next::wire::Envelope::encode_value::<
8628 crate::wire::Availability,
8629 ___E,
8630 >(
8631 value, preallocated.encoder, &mut out, ()
8632 )?;
8633 } else {
8634 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8635 }
8636 }
8637
8638 4 => {
8639 if let Some(value) = &self.dependency_type {
8640 ::fidl_next::wire::Envelope::encode_value::<
8641 crate::wire::DependencyType,
8642 ___E,
8643 >(
8644 value, preallocated.encoder, &mut out, ()
8645 )?;
8646 } else {
8647 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8648 }
8649 }
8650
8651 3 => {
8652 if let Some(value) = &self.target_path {
8653 ::fidl_next::wire::Envelope::encode_value::<
8654 ::fidl_next::wire::String<'static>,
8655 ___E,
8656 >(
8657 value, preallocated.encoder, &mut out, 1024
8658 )?;
8659 } else {
8660 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8661 }
8662 }
8663
8664 2 => {
8665 if let Some(value) = &self.source_name {
8666 ::fidl_next::wire::Envelope::encode_value::<
8667 ::fidl_next::wire::String<'static>,
8668 ___E,
8669 >(
8670 value, preallocated.encoder, &mut out, 100
8671 )?;
8672 } else {
8673 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8674 }
8675 }
8676
8677 1 => {
8678 if let Some(value) = &self.source {
8679 ::fidl_next::wire::Envelope::encode_value::<
8680 crate::wire::Ref<'static>,
8681 ___E,
8682 >(
8683 value, preallocated.encoder, &mut out, ()
8684 )?;
8685 } else {
8686 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8687 }
8688 }
8689
8690 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8691 }
8692 unsafe {
8693 preallocated.write_next(out.assume_init_ref());
8694 }
8695 }
8696
8697 ::fidl_next::wire::Table::encode_len(table, max_ord);
8698
8699 Ok(())
8700 }
8701 }
8702
8703 impl<'de> ::fidl_next::FromWire<crate::wire::UseService<'de>> for UseService {
8704 #[inline]
8705 fn from_wire(wire_: crate::wire::UseService<'de>) -> Self {
8706 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8707
8708 let source = wire_.table.get(1);
8709
8710 let source_name = wire_.table.get(2);
8711
8712 let target_path = wire_.table.get(3);
8713
8714 let dependency_type = wire_.table.get(4);
8715
8716 let availability = wire_.table.get(5);
8717
8718 let source_dictionary = wire_.table.get(6);
8719
8720 Self {
8721 source: source.map(|envelope| {
8722 ::fidl_next::FromWire::from_wire(unsafe {
8723 envelope.read_unchecked::<crate::wire::Ref<'de>>()
8724 })
8725 }),
8726
8727 source_name: source_name.map(|envelope| {
8728 ::fidl_next::FromWire::from_wire(unsafe {
8729 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
8730 })
8731 }),
8732
8733 target_path: target_path.map(|envelope| {
8734 ::fidl_next::FromWire::from_wire(unsafe {
8735 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
8736 })
8737 }),
8738
8739 dependency_type: dependency_type.map(|envelope| {
8740 ::fidl_next::FromWire::from_wire(unsafe {
8741 envelope.read_unchecked::<crate::wire::DependencyType>()
8742 })
8743 }),
8744
8745 availability: availability.map(|envelope| {
8746 ::fidl_next::FromWire::from_wire(unsafe {
8747 envelope.read_unchecked::<crate::wire::Availability>()
8748 })
8749 }),
8750
8751 source_dictionary: source_dictionary.map(|envelope| {
8752 ::fidl_next::FromWire::from_wire(unsafe {
8753 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
8754 })
8755 }),
8756 }
8757 }
8758 }
8759
8760 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseService<'de>> for UseService {
8761 #[inline]
8762 fn from_wire_ref(wire: &crate::wire::UseService<'de>) -> Self {
8763 Self {
8764 source: wire.table.get(1).map(|envelope| {
8765 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8766 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
8767 })
8768 }),
8769
8770 source_name: wire.table.get(2).map(|envelope| {
8771 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8772 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
8773 })
8774 }),
8775
8776 target_path: wire.table.get(3).map(|envelope| {
8777 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8778 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
8779 })
8780 }),
8781
8782 dependency_type: wire.table.get(4).map(|envelope| {
8783 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8784 envelope.deref_unchecked::<crate::wire::DependencyType>()
8785 })
8786 }),
8787
8788 availability: wire.table.get(5).map(|envelope| {
8789 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8790 envelope.deref_unchecked::<crate::wire::Availability>()
8791 })
8792 }),
8793
8794 source_dictionary: wire.table.get(6).map(|envelope| {
8795 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8796 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
8797 })
8798 }),
8799 }
8800 }
8801 }
8802
8803 #[doc = " Declares a protocol used by a component, which was offered to it.\n\n A protocol is a service with a single instance, provided by a single FIDL\n protocol.\n"]
8804 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8805 pub struct UseProtocol {
8806 pub source: ::core::option::Option<crate::natural::Ref>,
8807
8808 pub source_name: ::core::option::Option<::std::string::String>,
8809
8810 pub target_path: ::core::option::Option<::std::string::String>,
8811
8812 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
8813
8814 pub availability: ::core::option::Option<crate::natural::Availability>,
8815
8816 pub source_dictionary: ::core::option::Option<::std::string::String>,
8817
8818 pub numbered_handle: ::core::option::Option<u8>,
8819 }
8820
8821 impl UseProtocol {
8822 fn __max_ordinal(&self) -> usize {
8823 if self.numbered_handle.is_some() {
8824 return 7;
8825 }
8826
8827 if self.source_dictionary.is_some() {
8828 return 6;
8829 }
8830
8831 if self.availability.is_some() {
8832 return 5;
8833 }
8834
8835 if self.dependency_type.is_some() {
8836 return 4;
8837 }
8838
8839 if self.target_path.is_some() {
8840 return 3;
8841 }
8842
8843 if self.source_name.is_some() {
8844 return 2;
8845 }
8846
8847 if self.source.is_some() {
8848 return 1;
8849 }
8850
8851 0
8852 }
8853 }
8854
8855 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseProtocol<'static>, ___E> for UseProtocol
8856 where
8857 ___E: ::fidl_next::Encoder + ?Sized,
8858 {
8859 #[inline]
8860 fn encode(
8861 mut self,
8862 encoder: &mut ___E,
8863 out: &mut ::core::mem::MaybeUninit<crate::wire::UseProtocol<'static>>,
8864 _: (),
8865 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8866 ::fidl_next::munge!(let crate::wire::UseProtocol { table } = out);
8867
8868 let max_ord = self.__max_ordinal();
8869
8870 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
8871 ::fidl_next::Wire::zero_padding(&mut out);
8872
8873 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
8874 ::fidl_next::wire::Envelope,
8875 >(encoder, max_ord);
8876
8877 for i in 1..=max_ord {
8878 match i {
8879 7 => {
8880 if let Some(value) = self.numbered_handle.take() {
8881 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
8882 value,
8883 preallocated.encoder,
8884 &mut out,
8885 (),
8886 )?;
8887 } else {
8888 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8889 }
8890 }
8891
8892 6 => {
8893 if let Some(value) = self.source_dictionary.take() {
8894 ::fidl_next::wire::Envelope::encode_value::<
8895 ::fidl_next::wire::String<'static>,
8896 ___E,
8897 >(
8898 value, preallocated.encoder, &mut out, 1024
8899 )?;
8900 } else {
8901 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8902 }
8903 }
8904
8905 5 => {
8906 if let Some(value) = self.availability.take() {
8907 ::fidl_next::wire::Envelope::encode_value::<
8908 crate::wire::Availability,
8909 ___E,
8910 >(
8911 value, preallocated.encoder, &mut out, ()
8912 )?;
8913 } else {
8914 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8915 }
8916 }
8917
8918 4 => {
8919 if let Some(value) = self.dependency_type.take() {
8920 ::fidl_next::wire::Envelope::encode_value::<
8921 crate::wire::DependencyType,
8922 ___E,
8923 >(
8924 value, preallocated.encoder, &mut out, ()
8925 )?;
8926 } else {
8927 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8928 }
8929 }
8930
8931 3 => {
8932 if let Some(value) = self.target_path.take() {
8933 ::fidl_next::wire::Envelope::encode_value::<
8934 ::fidl_next::wire::String<'static>,
8935 ___E,
8936 >(
8937 value, preallocated.encoder, &mut out, 1024
8938 )?;
8939 } else {
8940 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8941 }
8942 }
8943
8944 2 => {
8945 if let Some(value) = self.source_name.take() {
8946 ::fidl_next::wire::Envelope::encode_value::<
8947 ::fidl_next::wire::String<'static>,
8948 ___E,
8949 >(
8950 value, preallocated.encoder, &mut out, 100
8951 )?;
8952 } else {
8953 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8954 }
8955 }
8956
8957 1 => {
8958 if let Some(value) = self.source.take() {
8959 ::fidl_next::wire::Envelope::encode_value::<
8960 crate::wire::Ref<'static>,
8961 ___E,
8962 >(
8963 value, preallocated.encoder, &mut out, ()
8964 )?;
8965 } else {
8966 ::fidl_next::wire::Envelope::encode_zero(&mut out)
8967 }
8968 }
8969
8970 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
8971 }
8972 unsafe {
8973 preallocated.write_next(out.assume_init_ref());
8974 }
8975 }
8976
8977 ::fidl_next::wire::Table::encode_len(table, max_ord);
8978
8979 Ok(())
8980 }
8981 }
8982
8983 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseProtocol<'static>, ___E>
8984 for &'a UseProtocol
8985 where
8986 ___E: ::fidl_next::Encoder + ?Sized,
8987 {
8988 #[inline]
8989 fn encode(
8990 self,
8991 encoder: &mut ___E,
8992 out: &mut ::core::mem::MaybeUninit<crate::wire::UseProtocol<'static>>,
8993 _: (),
8994 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8995 ::fidl_next::munge!(let crate::wire::UseProtocol { table } = out);
8996
8997 let max_ord = self.__max_ordinal();
8998
8999 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
9000 ::fidl_next::Wire::zero_padding(&mut out);
9001
9002 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
9003 ::fidl_next::wire::Envelope,
9004 >(encoder, max_ord);
9005
9006 for i in 1..=max_ord {
9007 match i {
9008 7 => {
9009 if let Some(value) = &self.numbered_handle {
9010 ::fidl_next::wire::Envelope::encode_value::<u8, ___E>(
9011 value,
9012 preallocated.encoder,
9013 &mut out,
9014 (),
9015 )?;
9016 } else {
9017 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9018 }
9019 }
9020
9021 6 => {
9022 if let Some(value) = &self.source_dictionary {
9023 ::fidl_next::wire::Envelope::encode_value::<
9024 ::fidl_next::wire::String<'static>,
9025 ___E,
9026 >(
9027 value, preallocated.encoder, &mut out, 1024
9028 )?;
9029 } else {
9030 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9031 }
9032 }
9033
9034 5 => {
9035 if let Some(value) = &self.availability {
9036 ::fidl_next::wire::Envelope::encode_value::<
9037 crate::wire::Availability,
9038 ___E,
9039 >(
9040 value, preallocated.encoder, &mut out, ()
9041 )?;
9042 } else {
9043 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9044 }
9045 }
9046
9047 4 => {
9048 if let Some(value) = &self.dependency_type {
9049 ::fidl_next::wire::Envelope::encode_value::<
9050 crate::wire::DependencyType,
9051 ___E,
9052 >(
9053 value, preallocated.encoder, &mut out, ()
9054 )?;
9055 } else {
9056 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9057 }
9058 }
9059
9060 3 => {
9061 if let Some(value) = &self.target_path {
9062 ::fidl_next::wire::Envelope::encode_value::<
9063 ::fidl_next::wire::String<'static>,
9064 ___E,
9065 >(
9066 value, preallocated.encoder, &mut out, 1024
9067 )?;
9068 } else {
9069 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9070 }
9071 }
9072
9073 2 => {
9074 if let Some(value) = &self.source_name {
9075 ::fidl_next::wire::Envelope::encode_value::<
9076 ::fidl_next::wire::String<'static>,
9077 ___E,
9078 >(
9079 value, preallocated.encoder, &mut out, 100
9080 )?;
9081 } else {
9082 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9083 }
9084 }
9085
9086 1 => {
9087 if let Some(value) = &self.source {
9088 ::fidl_next::wire::Envelope::encode_value::<
9089 crate::wire::Ref<'static>,
9090 ___E,
9091 >(
9092 value, preallocated.encoder, &mut out, ()
9093 )?;
9094 } else {
9095 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9096 }
9097 }
9098
9099 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
9100 }
9101 unsafe {
9102 preallocated.write_next(out.assume_init_ref());
9103 }
9104 }
9105
9106 ::fidl_next::wire::Table::encode_len(table, max_ord);
9107
9108 Ok(())
9109 }
9110 }
9111
9112 impl<'de> ::fidl_next::FromWire<crate::wire::UseProtocol<'de>> for UseProtocol {
9113 #[inline]
9114 fn from_wire(wire_: crate::wire::UseProtocol<'de>) -> Self {
9115 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
9116
9117 let source = wire_.table.get(1);
9118
9119 let source_name = wire_.table.get(2);
9120
9121 let target_path = wire_.table.get(3);
9122
9123 let dependency_type = wire_.table.get(4);
9124
9125 let availability = wire_.table.get(5);
9126
9127 let source_dictionary = wire_.table.get(6);
9128
9129 let numbered_handle = wire_.table.get(7);
9130
9131 Self {
9132 source: source.map(|envelope| {
9133 ::fidl_next::FromWire::from_wire(unsafe {
9134 envelope.read_unchecked::<crate::wire::Ref<'de>>()
9135 })
9136 }),
9137
9138 source_name: source_name.map(|envelope| {
9139 ::fidl_next::FromWire::from_wire(unsafe {
9140 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
9141 })
9142 }),
9143
9144 target_path: target_path.map(|envelope| {
9145 ::fidl_next::FromWire::from_wire(unsafe {
9146 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
9147 })
9148 }),
9149
9150 dependency_type: dependency_type.map(|envelope| {
9151 ::fidl_next::FromWire::from_wire(unsafe {
9152 envelope.read_unchecked::<crate::wire::DependencyType>()
9153 })
9154 }),
9155
9156 availability: availability.map(|envelope| {
9157 ::fidl_next::FromWire::from_wire(unsafe {
9158 envelope.read_unchecked::<crate::wire::Availability>()
9159 })
9160 }),
9161
9162 source_dictionary: source_dictionary.map(|envelope| {
9163 ::fidl_next::FromWire::from_wire(unsafe {
9164 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
9165 })
9166 }),
9167
9168 numbered_handle: numbered_handle.map(|envelope| {
9169 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<u8>() })
9170 }),
9171 }
9172 }
9173 }
9174
9175 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseProtocol<'de>> for UseProtocol {
9176 #[inline]
9177 fn from_wire_ref(wire: &crate::wire::UseProtocol<'de>) -> Self {
9178 Self {
9179 source: wire.table.get(1).map(|envelope| {
9180 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9181 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
9182 })
9183 }),
9184
9185 source_name: wire.table.get(2).map(|envelope| {
9186 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9187 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
9188 })
9189 }),
9190
9191 target_path: wire.table.get(3).map(|envelope| {
9192 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9193 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
9194 })
9195 }),
9196
9197 dependency_type: wire.table.get(4).map(|envelope| {
9198 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9199 envelope.deref_unchecked::<crate::wire::DependencyType>()
9200 })
9201 }),
9202
9203 availability: wire.table.get(5).map(|envelope| {
9204 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9205 envelope.deref_unchecked::<crate::wire::Availability>()
9206 })
9207 }),
9208
9209 source_dictionary: wire.table.get(6).map(|envelope| {
9210 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9211 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
9212 })
9213 }),
9214
9215 numbered_handle: wire.table.get(7).map(|envelope| {
9216 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9217 envelope.deref_unchecked::<u8>()
9218 })
9219 }),
9220 }
9221 }
9222 }
9223
9224 #[doc = " Declares a directory used by a component, which was offered to it.\n"]
9225 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9226 pub struct UseDirectory {
9227 pub source: ::core::option::Option<crate::natural::Ref>,
9228
9229 pub source_name: ::core::option::Option<::std::string::String>,
9230
9231 pub target_path: ::core::option::Option<::std::string::String>,
9232
9233 pub rights: ::core::option::Option<::fidl_next_common_fuchsia_io::natural::Operations>,
9234
9235 pub subdir: ::core::option::Option<::std::string::String>,
9236
9237 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
9238
9239 pub availability: ::core::option::Option<crate::natural::Availability>,
9240
9241 pub source_dictionary: ::core::option::Option<::std::string::String>,
9242 }
9243
9244 impl UseDirectory {
9245 fn __max_ordinal(&self) -> usize {
9246 if self.source_dictionary.is_some() {
9247 return 8;
9248 }
9249
9250 if self.availability.is_some() {
9251 return 7;
9252 }
9253
9254 if self.dependency_type.is_some() {
9255 return 6;
9256 }
9257
9258 if self.subdir.is_some() {
9259 return 5;
9260 }
9261
9262 if self.rights.is_some() {
9263 return 4;
9264 }
9265
9266 if self.target_path.is_some() {
9267 return 3;
9268 }
9269
9270 if self.source_name.is_some() {
9271 return 2;
9272 }
9273
9274 if self.source.is_some() {
9275 return 1;
9276 }
9277
9278 0
9279 }
9280 }
9281
9282 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseDirectory<'static>, ___E> for UseDirectory
9283 where
9284 ___E: ::fidl_next::Encoder + ?Sized,
9285 {
9286 #[inline]
9287 fn encode(
9288 mut self,
9289 encoder: &mut ___E,
9290 out: &mut ::core::mem::MaybeUninit<crate::wire::UseDirectory<'static>>,
9291 _: (),
9292 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9293 ::fidl_next::munge!(let crate::wire::UseDirectory { table } = out);
9294
9295 let max_ord = self.__max_ordinal();
9296
9297 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
9298 ::fidl_next::Wire::zero_padding(&mut out);
9299
9300 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
9301 ::fidl_next::wire::Envelope,
9302 >(encoder, max_ord);
9303
9304 for i in 1..=max_ord {
9305 match i {
9306 8 => {
9307 if let Some(value) = self.source_dictionary.take() {
9308 ::fidl_next::wire::Envelope::encode_value::<
9309 ::fidl_next::wire::String<'static>,
9310 ___E,
9311 >(
9312 value, preallocated.encoder, &mut out, 1024
9313 )?;
9314 } else {
9315 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9316 }
9317 }
9318
9319 7 => {
9320 if let Some(value) = self.availability.take() {
9321 ::fidl_next::wire::Envelope::encode_value::<
9322 crate::wire::Availability,
9323 ___E,
9324 >(
9325 value, preallocated.encoder, &mut out, ()
9326 )?;
9327 } else {
9328 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9329 }
9330 }
9331
9332 6 => {
9333 if let Some(value) = self.dependency_type.take() {
9334 ::fidl_next::wire::Envelope::encode_value::<
9335 crate::wire::DependencyType,
9336 ___E,
9337 >(
9338 value, preallocated.encoder, &mut out, ()
9339 )?;
9340 } else {
9341 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9342 }
9343 }
9344
9345 5 => {
9346 if let Some(value) = self.subdir.take() {
9347 ::fidl_next::wire::Envelope::encode_value::<
9348 ::fidl_next::wire::String<'static>,
9349 ___E,
9350 >(
9351 value, preallocated.encoder, &mut out, 1024
9352 )?;
9353 } else {
9354 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9355 }
9356 }
9357
9358 4 => {
9359 if let Some(value) = self.rights.take() {
9360 ::fidl_next::wire::Envelope::encode_value::<
9361 ::fidl_next_common_fuchsia_io::wire::Operations,
9362 ___E,
9363 >(
9364 value, preallocated.encoder, &mut out, ()
9365 )?;
9366 } else {
9367 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9368 }
9369 }
9370
9371 3 => {
9372 if let Some(value) = self.target_path.take() {
9373 ::fidl_next::wire::Envelope::encode_value::<
9374 ::fidl_next::wire::String<'static>,
9375 ___E,
9376 >(
9377 value, preallocated.encoder, &mut out, 1024
9378 )?;
9379 } else {
9380 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9381 }
9382 }
9383
9384 2 => {
9385 if let Some(value) = self.source_name.take() {
9386 ::fidl_next::wire::Envelope::encode_value::<
9387 ::fidl_next::wire::String<'static>,
9388 ___E,
9389 >(
9390 value, preallocated.encoder, &mut out, 100
9391 )?;
9392 } else {
9393 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9394 }
9395 }
9396
9397 1 => {
9398 if let Some(value) = self.source.take() {
9399 ::fidl_next::wire::Envelope::encode_value::<
9400 crate::wire::Ref<'static>,
9401 ___E,
9402 >(
9403 value, preallocated.encoder, &mut out, ()
9404 )?;
9405 } else {
9406 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9407 }
9408 }
9409
9410 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
9411 }
9412 unsafe {
9413 preallocated.write_next(out.assume_init_ref());
9414 }
9415 }
9416
9417 ::fidl_next::wire::Table::encode_len(table, max_ord);
9418
9419 Ok(())
9420 }
9421 }
9422
9423 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseDirectory<'static>, ___E>
9424 for &'a UseDirectory
9425 where
9426 ___E: ::fidl_next::Encoder + ?Sized,
9427 {
9428 #[inline]
9429 fn encode(
9430 self,
9431 encoder: &mut ___E,
9432 out: &mut ::core::mem::MaybeUninit<crate::wire::UseDirectory<'static>>,
9433 _: (),
9434 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9435 ::fidl_next::munge!(let crate::wire::UseDirectory { table } = out);
9436
9437 let max_ord = self.__max_ordinal();
9438
9439 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
9440 ::fidl_next::Wire::zero_padding(&mut out);
9441
9442 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
9443 ::fidl_next::wire::Envelope,
9444 >(encoder, max_ord);
9445
9446 for i in 1..=max_ord {
9447 match i {
9448 8 => {
9449 if let Some(value) = &self.source_dictionary {
9450 ::fidl_next::wire::Envelope::encode_value::<
9451 ::fidl_next::wire::String<'static>,
9452 ___E,
9453 >(
9454 value, preallocated.encoder, &mut out, 1024
9455 )?;
9456 } else {
9457 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9458 }
9459 }
9460
9461 7 => {
9462 if let Some(value) = &self.availability {
9463 ::fidl_next::wire::Envelope::encode_value::<
9464 crate::wire::Availability,
9465 ___E,
9466 >(
9467 value, preallocated.encoder, &mut out, ()
9468 )?;
9469 } else {
9470 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9471 }
9472 }
9473
9474 6 => {
9475 if let Some(value) = &self.dependency_type {
9476 ::fidl_next::wire::Envelope::encode_value::<
9477 crate::wire::DependencyType,
9478 ___E,
9479 >(
9480 value, preallocated.encoder, &mut out, ()
9481 )?;
9482 } else {
9483 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9484 }
9485 }
9486
9487 5 => {
9488 if let Some(value) = &self.subdir {
9489 ::fidl_next::wire::Envelope::encode_value::<
9490 ::fidl_next::wire::String<'static>,
9491 ___E,
9492 >(
9493 value, preallocated.encoder, &mut out, 1024
9494 )?;
9495 } else {
9496 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9497 }
9498 }
9499
9500 4 => {
9501 if let Some(value) = &self.rights {
9502 ::fidl_next::wire::Envelope::encode_value::<
9503 ::fidl_next_common_fuchsia_io::wire::Operations,
9504 ___E,
9505 >(
9506 value, preallocated.encoder, &mut out, ()
9507 )?;
9508 } else {
9509 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9510 }
9511 }
9512
9513 3 => {
9514 if let Some(value) = &self.target_path {
9515 ::fidl_next::wire::Envelope::encode_value::<
9516 ::fidl_next::wire::String<'static>,
9517 ___E,
9518 >(
9519 value, preallocated.encoder, &mut out, 1024
9520 )?;
9521 } else {
9522 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9523 }
9524 }
9525
9526 2 => {
9527 if let Some(value) = &self.source_name {
9528 ::fidl_next::wire::Envelope::encode_value::<
9529 ::fidl_next::wire::String<'static>,
9530 ___E,
9531 >(
9532 value, preallocated.encoder, &mut out, 100
9533 )?;
9534 } else {
9535 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9536 }
9537 }
9538
9539 1 => {
9540 if let Some(value) = &self.source {
9541 ::fidl_next::wire::Envelope::encode_value::<
9542 crate::wire::Ref<'static>,
9543 ___E,
9544 >(
9545 value, preallocated.encoder, &mut out, ()
9546 )?;
9547 } else {
9548 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9549 }
9550 }
9551
9552 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
9553 }
9554 unsafe {
9555 preallocated.write_next(out.assume_init_ref());
9556 }
9557 }
9558
9559 ::fidl_next::wire::Table::encode_len(table, max_ord);
9560
9561 Ok(())
9562 }
9563 }
9564
9565 impl<'de> ::fidl_next::FromWire<crate::wire::UseDirectory<'de>> for UseDirectory {
9566 #[inline]
9567 fn from_wire(wire_: crate::wire::UseDirectory<'de>) -> Self {
9568 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
9569
9570 let source = wire_.table.get(1);
9571
9572 let source_name = wire_.table.get(2);
9573
9574 let target_path = wire_.table.get(3);
9575
9576 let rights = wire_.table.get(4);
9577
9578 let subdir = wire_.table.get(5);
9579
9580 let dependency_type = wire_.table.get(6);
9581
9582 let availability = wire_.table.get(7);
9583
9584 let source_dictionary = wire_.table.get(8);
9585
9586 Self {
9587 source: source.map(|envelope| {
9588 ::fidl_next::FromWire::from_wire(unsafe {
9589 envelope.read_unchecked::<crate::wire::Ref<'de>>()
9590 })
9591 }),
9592
9593 source_name: source_name.map(|envelope| {
9594 ::fidl_next::FromWire::from_wire(unsafe {
9595 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
9596 })
9597 }),
9598
9599 target_path: target_path.map(|envelope| {
9600 ::fidl_next::FromWire::from_wire(unsafe {
9601 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
9602 })
9603 }),
9604
9605 rights: rights.map(|envelope| {
9606 ::fidl_next::FromWire::from_wire(unsafe {
9607 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
9608 })
9609 }),
9610
9611 subdir: subdir.map(|envelope| {
9612 ::fidl_next::FromWire::from_wire(unsafe {
9613 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
9614 })
9615 }),
9616
9617 dependency_type: dependency_type.map(|envelope| {
9618 ::fidl_next::FromWire::from_wire(unsafe {
9619 envelope.read_unchecked::<crate::wire::DependencyType>()
9620 })
9621 }),
9622
9623 availability: availability.map(|envelope| {
9624 ::fidl_next::FromWire::from_wire(unsafe {
9625 envelope.read_unchecked::<crate::wire::Availability>()
9626 })
9627 }),
9628
9629 source_dictionary: source_dictionary.map(|envelope| {
9630 ::fidl_next::FromWire::from_wire(unsafe {
9631 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
9632 })
9633 }),
9634 }
9635 }
9636 }
9637
9638 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseDirectory<'de>> for UseDirectory {
9639 #[inline]
9640 fn from_wire_ref(wire: &crate::wire::UseDirectory<'de>) -> Self {
9641 Self {
9642 source: wire.table.get(1).map(|envelope| {
9643 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9644 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
9645 })
9646 }),
9647
9648 source_name: wire.table.get(2).map(|envelope| {
9649 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9650 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
9651 })
9652 }),
9653
9654 target_path: wire.table.get(3).map(|envelope| {
9655 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9656 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
9657 })
9658 }),
9659
9660 rights: wire.table.get(4).map(|envelope| {
9661 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9662 envelope
9663 .deref_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
9664 })
9665 }),
9666
9667 subdir: wire.table.get(5).map(|envelope| {
9668 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9669 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
9670 })
9671 }),
9672
9673 dependency_type: wire.table.get(6).map(|envelope| {
9674 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9675 envelope.deref_unchecked::<crate::wire::DependencyType>()
9676 })
9677 }),
9678
9679 availability: wire.table.get(7).map(|envelope| {
9680 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9681 envelope.deref_unchecked::<crate::wire::Availability>()
9682 })
9683 }),
9684
9685 source_dictionary: wire.table.get(8).map(|envelope| {
9686 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9687 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
9688 })
9689 }),
9690 }
9691 }
9692 }
9693
9694 #[doc = " Declares an EventStream used by a component.\n"]
9695 #[derive(Debug, Default, PartialEq)]
9696 pub struct UseEventStream {
9697 pub source_name: ::core::option::Option<::std::string::String>,
9698
9699 pub source: ::core::option::Option<crate::natural::Ref>,
9700
9701 pub scope: ::core::option::Option<::std::vec::Vec<crate::natural::Ref>>,
9702
9703 pub target_path: ::core::option::Option<::std::string::String>,
9704
9705 pub availability: ::core::option::Option<crate::natural::Availability>,
9706
9707 pub filter: ::core::option::Option<::fidl_next_common_fuchsia_data::natural::Dictionary>,
9708 }
9709
9710 impl UseEventStream {
9711 fn __max_ordinal(&self) -> usize {
9712 if self.filter.is_some() {
9713 return 6;
9714 }
9715
9716 if self.availability.is_some() {
9717 return 5;
9718 }
9719
9720 if self.target_path.is_some() {
9721 return 4;
9722 }
9723
9724 if self.scope.is_some() {
9725 return 3;
9726 }
9727
9728 if self.source.is_some() {
9729 return 2;
9730 }
9731
9732 if self.source_name.is_some() {
9733 return 1;
9734 }
9735
9736 0
9737 }
9738 }
9739
9740 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseEventStream<'static>, ___E> for UseEventStream
9741 where
9742 ___E: ::fidl_next::Encoder + ?Sized,
9743 {
9744 #[inline]
9745 fn encode(
9746 mut self,
9747 encoder: &mut ___E,
9748 out: &mut ::core::mem::MaybeUninit<crate::wire::UseEventStream<'static>>,
9749 _: (),
9750 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9751 ::fidl_next::munge!(let crate::wire::UseEventStream { table } = out);
9752
9753 let max_ord = self.__max_ordinal();
9754
9755 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
9756 ::fidl_next::Wire::zero_padding(&mut out);
9757
9758 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
9759 ::fidl_next::wire::Envelope,
9760 >(encoder, max_ord);
9761
9762 for i in 1..=max_ord {
9763 match i {
9764 6 => {
9765 if let Some(value) = self.filter.take() {
9766 ::fidl_next::wire::Envelope::encode_value::<
9767 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
9768 ___E,
9769 >(
9770 value, preallocated.encoder, &mut out, ()
9771 )?;
9772 } else {
9773 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9774 }
9775 }
9776
9777 5 => {
9778 if let Some(value) = self.availability.take() {
9779 ::fidl_next::wire::Envelope::encode_value::<
9780 crate::wire::Availability,
9781 ___E,
9782 >(
9783 value, preallocated.encoder, &mut out, ()
9784 )?;
9785 } else {
9786 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9787 }
9788 }
9789
9790 4 => {
9791 if let Some(value) = self.target_path.take() {
9792 ::fidl_next::wire::Envelope::encode_value::<
9793 ::fidl_next::wire::String<'static>,
9794 ___E,
9795 >(
9796 value, preallocated.encoder, &mut out, 100
9797 )?;
9798 } else {
9799 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9800 }
9801 }
9802
9803 3 => {
9804 if let Some(value) = self.scope.take() {
9805 ::fidl_next::wire::Envelope::encode_value::<
9806 ::fidl_next::wire::Vector<'static, crate::wire::Ref<'static>>,
9807 ___E,
9808 >(
9809 value, preallocated.encoder, &mut out, (4294967295, ())
9810 )?;
9811 } else {
9812 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9813 }
9814 }
9815
9816 2 => {
9817 if let Some(value) = self.source.take() {
9818 ::fidl_next::wire::Envelope::encode_value::<
9819 crate::wire::Ref<'static>,
9820 ___E,
9821 >(
9822 value, preallocated.encoder, &mut out, ()
9823 )?;
9824 } else {
9825 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9826 }
9827 }
9828
9829 1 => {
9830 if let Some(value) = self.source_name.take() {
9831 ::fidl_next::wire::Envelope::encode_value::<
9832 ::fidl_next::wire::String<'static>,
9833 ___E,
9834 >(
9835 value, preallocated.encoder, &mut out, 100
9836 )?;
9837 } else {
9838 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9839 }
9840 }
9841
9842 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
9843 }
9844 unsafe {
9845 preallocated.write_next(out.assume_init_ref());
9846 }
9847 }
9848
9849 ::fidl_next::wire::Table::encode_len(table, max_ord);
9850
9851 Ok(())
9852 }
9853 }
9854
9855 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseEventStream<'static>, ___E>
9856 for &'a UseEventStream
9857 where
9858 ___E: ::fidl_next::Encoder + ?Sized,
9859 {
9860 #[inline]
9861 fn encode(
9862 self,
9863 encoder: &mut ___E,
9864 out: &mut ::core::mem::MaybeUninit<crate::wire::UseEventStream<'static>>,
9865 _: (),
9866 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9867 ::fidl_next::munge!(let crate::wire::UseEventStream { table } = out);
9868
9869 let max_ord = self.__max_ordinal();
9870
9871 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
9872 ::fidl_next::Wire::zero_padding(&mut out);
9873
9874 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
9875 ::fidl_next::wire::Envelope,
9876 >(encoder, max_ord);
9877
9878 for i in 1..=max_ord {
9879 match i {
9880 6 => {
9881 if let Some(value) = &self.filter {
9882 ::fidl_next::wire::Envelope::encode_value::<
9883 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
9884 ___E,
9885 >(
9886 value, preallocated.encoder, &mut out, ()
9887 )?;
9888 } else {
9889 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9890 }
9891 }
9892
9893 5 => {
9894 if let Some(value) = &self.availability {
9895 ::fidl_next::wire::Envelope::encode_value::<
9896 crate::wire::Availability,
9897 ___E,
9898 >(
9899 value, preallocated.encoder, &mut out, ()
9900 )?;
9901 } else {
9902 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9903 }
9904 }
9905
9906 4 => {
9907 if let Some(value) = &self.target_path {
9908 ::fidl_next::wire::Envelope::encode_value::<
9909 ::fidl_next::wire::String<'static>,
9910 ___E,
9911 >(
9912 value, preallocated.encoder, &mut out, 100
9913 )?;
9914 } else {
9915 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9916 }
9917 }
9918
9919 3 => {
9920 if let Some(value) = &self.scope {
9921 ::fidl_next::wire::Envelope::encode_value::<
9922 ::fidl_next::wire::Vector<'static, crate::wire::Ref<'static>>,
9923 ___E,
9924 >(
9925 value, preallocated.encoder, &mut out, (4294967295, ())
9926 )?;
9927 } else {
9928 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9929 }
9930 }
9931
9932 2 => {
9933 if let Some(value) = &self.source {
9934 ::fidl_next::wire::Envelope::encode_value::<
9935 crate::wire::Ref<'static>,
9936 ___E,
9937 >(
9938 value, preallocated.encoder, &mut out, ()
9939 )?;
9940 } else {
9941 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9942 }
9943 }
9944
9945 1 => {
9946 if let Some(value) = &self.source_name {
9947 ::fidl_next::wire::Envelope::encode_value::<
9948 ::fidl_next::wire::String<'static>,
9949 ___E,
9950 >(
9951 value, preallocated.encoder, &mut out, 100
9952 )?;
9953 } else {
9954 ::fidl_next::wire::Envelope::encode_zero(&mut out)
9955 }
9956 }
9957
9958 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
9959 }
9960 unsafe {
9961 preallocated.write_next(out.assume_init_ref());
9962 }
9963 }
9964
9965 ::fidl_next::wire::Table::encode_len(table, max_ord);
9966
9967 Ok(())
9968 }
9969 }
9970
9971 impl<'de> ::fidl_next::FromWire<crate::wire::UseEventStream<'de>> for UseEventStream {
9972 #[inline]
9973 fn from_wire(wire_: crate::wire::UseEventStream<'de>) -> Self {
9974 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
9975
9976 let source_name = wire_.table.get(1);
9977
9978 let source = wire_.table.get(2);
9979
9980 let scope = wire_.table.get(3);
9981
9982 let target_path = wire_.table.get(4);
9983
9984 let availability = wire_.table.get(5);
9985
9986 let filter = wire_.table.get(6);
9987
9988 Self {
9989
9990
9991 source_name: source_name.map(|envelope| ::fidl_next::FromWire::from_wire(
9992 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
9993 )),
9994
9995
9996 source: source.map(|envelope| ::fidl_next::FromWire::from_wire(
9997 unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() }
9998 )),
9999
10000
10001 scope: scope.map(|envelope| ::fidl_next::FromWire::from_wire(
10002 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>>() }
10003 )),
10004
10005
10006 target_path: target_path.map(|envelope| ::fidl_next::FromWire::from_wire(
10007 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
10008 )),
10009
10010
10011 availability: availability.map(|envelope| ::fidl_next::FromWire::from_wire(
10012 unsafe { envelope.read_unchecked::<crate::wire::Availability>() }
10013 )),
10014
10015
10016 filter: filter.map(|envelope| ::fidl_next::FromWire::from_wire(
10017 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
10018 )),
10019
10020 }
10021 }
10022 }
10023
10024 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseEventStream<'de>> for UseEventStream {
10025 #[inline]
10026 fn from_wire_ref(wire: &crate::wire::UseEventStream<'de>) -> Self {
10027 Self {
10028
10029
10030 source_name: wire.table.get(1)
10031 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
10032 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
10033 )),
10034
10035
10036 source: wire.table.get(2)
10037 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
10038 unsafe { envelope.deref_unchecked::<crate::wire::Ref<'de>>() }
10039 )),
10040
10041
10042 scope: wire.table.get(3)
10043 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
10044 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>>() }
10045 )),
10046
10047
10048 target_path: wire.table.get(4)
10049 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
10050 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
10051 )),
10052
10053
10054 availability: wire.table.get(5)
10055 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
10056 unsafe { envelope.deref_unchecked::<crate::wire::Availability>() }
10057 )),
10058
10059
10060 filter: wire.table.get(6)
10061 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
10062 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
10063 )),
10064
10065 }
10066 }
10067 }
10068
10069 #[doc = " Declares runner used by a component.\n"]
10070 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
10071 pub struct UseRunner {
10072 pub source: ::core::option::Option<crate::natural::Ref>,
10073
10074 pub source_name: ::core::option::Option<::std::string::String>,
10075
10076 pub source_dictionary: ::core::option::Option<::std::string::String>,
10077 }
10078
10079 impl UseRunner {
10080 fn __max_ordinal(&self) -> usize {
10081 if self.source_dictionary.is_some() {
10082 return 3;
10083 }
10084
10085 if self.source_name.is_some() {
10086 return 2;
10087 }
10088
10089 if self.source.is_some() {
10090 return 1;
10091 }
10092
10093 0
10094 }
10095 }
10096
10097 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseRunner<'static>, ___E> for UseRunner
10098 where
10099 ___E: ::fidl_next::Encoder + ?Sized,
10100 {
10101 #[inline]
10102 fn encode(
10103 mut self,
10104 encoder: &mut ___E,
10105 out: &mut ::core::mem::MaybeUninit<crate::wire::UseRunner<'static>>,
10106 _: (),
10107 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10108 ::fidl_next::munge!(let crate::wire::UseRunner { table } = out);
10109
10110 let max_ord = self.__max_ordinal();
10111
10112 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
10113 ::fidl_next::Wire::zero_padding(&mut out);
10114
10115 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
10116 ::fidl_next::wire::Envelope,
10117 >(encoder, max_ord);
10118
10119 for i in 1..=max_ord {
10120 match i {
10121 3 => {
10122 if let Some(value) = self.source_dictionary.take() {
10123 ::fidl_next::wire::Envelope::encode_value::<
10124 ::fidl_next::wire::String<'static>,
10125 ___E,
10126 >(
10127 value, preallocated.encoder, &mut out, 1024
10128 )?;
10129 } else {
10130 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10131 }
10132 }
10133
10134 2 => {
10135 if let Some(value) = self.source_name.take() {
10136 ::fidl_next::wire::Envelope::encode_value::<
10137 ::fidl_next::wire::String<'static>,
10138 ___E,
10139 >(
10140 value, preallocated.encoder, &mut out, 100
10141 )?;
10142 } else {
10143 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10144 }
10145 }
10146
10147 1 => {
10148 if let Some(value) = self.source.take() {
10149 ::fidl_next::wire::Envelope::encode_value::<
10150 crate::wire::Ref<'static>,
10151 ___E,
10152 >(
10153 value, preallocated.encoder, &mut out, ()
10154 )?;
10155 } else {
10156 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10157 }
10158 }
10159
10160 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
10161 }
10162 unsafe {
10163 preallocated.write_next(out.assume_init_ref());
10164 }
10165 }
10166
10167 ::fidl_next::wire::Table::encode_len(table, max_ord);
10168
10169 Ok(())
10170 }
10171 }
10172
10173 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseRunner<'static>, ___E> for &'a UseRunner
10174 where
10175 ___E: ::fidl_next::Encoder + ?Sized,
10176 {
10177 #[inline]
10178 fn encode(
10179 self,
10180 encoder: &mut ___E,
10181 out: &mut ::core::mem::MaybeUninit<crate::wire::UseRunner<'static>>,
10182 _: (),
10183 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10184 ::fidl_next::munge!(let crate::wire::UseRunner { table } = out);
10185
10186 let max_ord = self.__max_ordinal();
10187
10188 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
10189 ::fidl_next::Wire::zero_padding(&mut out);
10190
10191 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
10192 ::fidl_next::wire::Envelope,
10193 >(encoder, max_ord);
10194
10195 for i in 1..=max_ord {
10196 match i {
10197 3 => {
10198 if let Some(value) = &self.source_dictionary {
10199 ::fidl_next::wire::Envelope::encode_value::<
10200 ::fidl_next::wire::String<'static>,
10201 ___E,
10202 >(
10203 value, preallocated.encoder, &mut out, 1024
10204 )?;
10205 } else {
10206 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10207 }
10208 }
10209
10210 2 => {
10211 if let Some(value) = &self.source_name {
10212 ::fidl_next::wire::Envelope::encode_value::<
10213 ::fidl_next::wire::String<'static>,
10214 ___E,
10215 >(
10216 value, preallocated.encoder, &mut out, 100
10217 )?;
10218 } else {
10219 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10220 }
10221 }
10222
10223 1 => {
10224 if let Some(value) = &self.source {
10225 ::fidl_next::wire::Envelope::encode_value::<
10226 crate::wire::Ref<'static>,
10227 ___E,
10228 >(
10229 value, preallocated.encoder, &mut out, ()
10230 )?;
10231 } else {
10232 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10233 }
10234 }
10235
10236 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
10237 }
10238 unsafe {
10239 preallocated.write_next(out.assume_init_ref());
10240 }
10241 }
10242
10243 ::fidl_next::wire::Table::encode_len(table, max_ord);
10244
10245 Ok(())
10246 }
10247 }
10248
10249 impl<'de> ::fidl_next::FromWire<crate::wire::UseRunner<'de>> for UseRunner {
10250 #[inline]
10251 fn from_wire(wire_: crate::wire::UseRunner<'de>) -> Self {
10252 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
10253
10254 let source = wire_.table.get(1);
10255
10256 let source_name = wire_.table.get(2);
10257
10258 let source_dictionary = wire_.table.get(3);
10259
10260 Self {
10261 source: source.map(|envelope| {
10262 ::fidl_next::FromWire::from_wire(unsafe {
10263 envelope.read_unchecked::<crate::wire::Ref<'de>>()
10264 })
10265 }),
10266
10267 source_name: source_name.map(|envelope| {
10268 ::fidl_next::FromWire::from_wire(unsafe {
10269 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
10270 })
10271 }),
10272
10273 source_dictionary: source_dictionary.map(|envelope| {
10274 ::fidl_next::FromWire::from_wire(unsafe {
10275 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
10276 })
10277 }),
10278 }
10279 }
10280 }
10281
10282 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseRunner<'de>> for UseRunner {
10283 #[inline]
10284 fn from_wire_ref(wire: &crate::wire::UseRunner<'de>) -> Self {
10285 Self {
10286 source: wire.table.get(1).map(|envelope| {
10287 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10288 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
10289 })
10290 }),
10291
10292 source_name: wire.table.get(2).map(|envelope| {
10293 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10294 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
10295 })
10296 }),
10297
10298 source_dictionary: wire.table.get(3).map(|envelope| {
10299 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10300 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
10301 })
10302 }),
10303 }
10304 }
10305 }
10306
10307 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
10308 pub struct UseConfiguration {
10309 pub source: ::core::option::Option<crate::natural::Ref>,
10310
10311 pub source_name: ::core::option::Option<::std::string::String>,
10312
10313 pub target_name: ::core::option::Option<::std::string::String>,
10314
10315 pub availability: ::core::option::Option<crate::natural::Availability>,
10316
10317 pub type_: ::core::option::Option<crate::natural::ConfigType>,
10318
10319 pub default: ::core::option::Option<crate::natural::ConfigValue>,
10320
10321 pub source_dictionary: ::core::option::Option<::std::string::String>,
10322 }
10323
10324 impl UseConfiguration {
10325 fn __max_ordinal(&self) -> usize {
10326 if self.source_dictionary.is_some() {
10327 return 7;
10328 }
10329
10330 if self.default.is_some() {
10331 return 6;
10332 }
10333
10334 if self.type_.is_some() {
10335 return 5;
10336 }
10337
10338 if self.availability.is_some() {
10339 return 4;
10340 }
10341
10342 if self.target_name.is_some() {
10343 return 3;
10344 }
10345
10346 if self.source_name.is_some() {
10347 return 2;
10348 }
10349
10350 if self.source.is_some() {
10351 return 1;
10352 }
10353
10354 0
10355 }
10356 }
10357
10358 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseConfiguration<'static>, ___E>
10359 for UseConfiguration
10360 where
10361 ___E: ::fidl_next::Encoder + ?Sized,
10362 {
10363 #[inline]
10364 fn encode(
10365 mut self,
10366 encoder: &mut ___E,
10367 out: &mut ::core::mem::MaybeUninit<crate::wire::UseConfiguration<'static>>,
10368 _: (),
10369 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10370 ::fidl_next::munge!(let crate::wire::UseConfiguration { table } = out);
10371
10372 let max_ord = self.__max_ordinal();
10373
10374 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
10375 ::fidl_next::Wire::zero_padding(&mut out);
10376
10377 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
10378 ::fidl_next::wire::Envelope,
10379 >(encoder, max_ord);
10380
10381 for i in 1..=max_ord {
10382 match i {
10383 7 => {
10384 if let Some(value) = self.source_dictionary.take() {
10385 ::fidl_next::wire::Envelope::encode_value::<
10386 ::fidl_next::wire::String<'static>,
10387 ___E,
10388 >(
10389 value, preallocated.encoder, &mut out, 1024
10390 )?;
10391 } else {
10392 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10393 }
10394 }
10395
10396 6 => {
10397 if let Some(value) = self.default.take() {
10398 ::fidl_next::wire::Envelope::encode_value::<
10399 crate::wire::ConfigValue<'static>,
10400 ___E,
10401 >(
10402 value, preallocated.encoder, &mut out, ()
10403 )?;
10404 } else {
10405 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10406 }
10407 }
10408
10409 5 => {
10410 if let Some(value) = self.type_.take() {
10411 ::fidl_next::wire::Envelope::encode_value::<
10412 crate::wire::ConfigType<'static>,
10413 ___E,
10414 >(
10415 value, preallocated.encoder, &mut out, ()
10416 )?;
10417 } else {
10418 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10419 }
10420 }
10421
10422 4 => {
10423 if let Some(value) = self.availability.take() {
10424 ::fidl_next::wire::Envelope::encode_value::<
10425 crate::wire::Availability,
10426 ___E,
10427 >(
10428 value, preallocated.encoder, &mut out, ()
10429 )?;
10430 } else {
10431 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10432 }
10433 }
10434
10435 3 => {
10436 if let Some(value) = self.target_name.take() {
10437 ::fidl_next::wire::Envelope::encode_value::<
10438 ::fidl_next::wire::String<'static>,
10439 ___E,
10440 >(
10441 value, preallocated.encoder, &mut out, 100
10442 )?;
10443 } else {
10444 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10445 }
10446 }
10447
10448 2 => {
10449 if let Some(value) = self.source_name.take() {
10450 ::fidl_next::wire::Envelope::encode_value::<
10451 ::fidl_next::wire::String<'static>,
10452 ___E,
10453 >(
10454 value, preallocated.encoder, &mut out, 100
10455 )?;
10456 } else {
10457 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10458 }
10459 }
10460
10461 1 => {
10462 if let Some(value) = self.source.take() {
10463 ::fidl_next::wire::Envelope::encode_value::<
10464 crate::wire::Ref<'static>,
10465 ___E,
10466 >(
10467 value, preallocated.encoder, &mut out, ()
10468 )?;
10469 } else {
10470 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10471 }
10472 }
10473
10474 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
10475 }
10476 unsafe {
10477 preallocated.write_next(out.assume_init_ref());
10478 }
10479 }
10480
10481 ::fidl_next::wire::Table::encode_len(table, max_ord);
10482
10483 Ok(())
10484 }
10485 }
10486
10487 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseConfiguration<'static>, ___E>
10488 for &'a UseConfiguration
10489 where
10490 ___E: ::fidl_next::Encoder + ?Sized,
10491 {
10492 #[inline]
10493 fn encode(
10494 self,
10495 encoder: &mut ___E,
10496 out: &mut ::core::mem::MaybeUninit<crate::wire::UseConfiguration<'static>>,
10497 _: (),
10498 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10499 ::fidl_next::munge!(let crate::wire::UseConfiguration { table } = out);
10500
10501 let max_ord = self.__max_ordinal();
10502
10503 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
10504 ::fidl_next::Wire::zero_padding(&mut out);
10505
10506 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
10507 ::fidl_next::wire::Envelope,
10508 >(encoder, max_ord);
10509
10510 for i in 1..=max_ord {
10511 match i {
10512 7 => {
10513 if let Some(value) = &self.source_dictionary {
10514 ::fidl_next::wire::Envelope::encode_value::<
10515 ::fidl_next::wire::String<'static>,
10516 ___E,
10517 >(
10518 value, preallocated.encoder, &mut out, 1024
10519 )?;
10520 } else {
10521 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10522 }
10523 }
10524
10525 6 => {
10526 if let Some(value) = &self.default {
10527 ::fidl_next::wire::Envelope::encode_value::<
10528 crate::wire::ConfigValue<'static>,
10529 ___E,
10530 >(
10531 value, preallocated.encoder, &mut out, ()
10532 )?;
10533 } else {
10534 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10535 }
10536 }
10537
10538 5 => {
10539 if let Some(value) = &self.type_ {
10540 ::fidl_next::wire::Envelope::encode_value::<
10541 crate::wire::ConfigType<'static>,
10542 ___E,
10543 >(
10544 value, preallocated.encoder, &mut out, ()
10545 )?;
10546 } else {
10547 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10548 }
10549 }
10550
10551 4 => {
10552 if let Some(value) = &self.availability {
10553 ::fidl_next::wire::Envelope::encode_value::<
10554 crate::wire::Availability,
10555 ___E,
10556 >(
10557 value, preallocated.encoder, &mut out, ()
10558 )?;
10559 } else {
10560 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10561 }
10562 }
10563
10564 3 => {
10565 if let Some(value) = &self.target_name {
10566 ::fidl_next::wire::Envelope::encode_value::<
10567 ::fidl_next::wire::String<'static>,
10568 ___E,
10569 >(
10570 value, preallocated.encoder, &mut out, 100
10571 )?;
10572 } else {
10573 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10574 }
10575 }
10576
10577 2 => {
10578 if let Some(value) = &self.source_name {
10579 ::fidl_next::wire::Envelope::encode_value::<
10580 ::fidl_next::wire::String<'static>,
10581 ___E,
10582 >(
10583 value, preallocated.encoder, &mut out, 100
10584 )?;
10585 } else {
10586 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10587 }
10588 }
10589
10590 1 => {
10591 if let Some(value) = &self.source {
10592 ::fidl_next::wire::Envelope::encode_value::<
10593 crate::wire::Ref<'static>,
10594 ___E,
10595 >(
10596 value, preallocated.encoder, &mut out, ()
10597 )?;
10598 } else {
10599 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10600 }
10601 }
10602
10603 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
10604 }
10605 unsafe {
10606 preallocated.write_next(out.assume_init_ref());
10607 }
10608 }
10609
10610 ::fidl_next::wire::Table::encode_len(table, max_ord);
10611
10612 Ok(())
10613 }
10614 }
10615
10616 impl<'de> ::fidl_next::FromWire<crate::wire::UseConfiguration<'de>> for UseConfiguration {
10617 #[inline]
10618 fn from_wire(wire_: crate::wire::UseConfiguration<'de>) -> Self {
10619 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
10620
10621 let source = wire_.table.get(1);
10622
10623 let source_name = wire_.table.get(2);
10624
10625 let target_name = wire_.table.get(3);
10626
10627 let availability = wire_.table.get(4);
10628
10629 let type_ = wire_.table.get(5);
10630
10631 let default = wire_.table.get(6);
10632
10633 let source_dictionary = wire_.table.get(7);
10634
10635 Self {
10636 source: source.map(|envelope| {
10637 ::fidl_next::FromWire::from_wire(unsafe {
10638 envelope.read_unchecked::<crate::wire::Ref<'de>>()
10639 })
10640 }),
10641
10642 source_name: source_name.map(|envelope| {
10643 ::fidl_next::FromWire::from_wire(unsafe {
10644 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
10645 })
10646 }),
10647
10648 target_name: target_name.map(|envelope| {
10649 ::fidl_next::FromWire::from_wire(unsafe {
10650 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
10651 })
10652 }),
10653
10654 availability: availability.map(|envelope| {
10655 ::fidl_next::FromWire::from_wire(unsafe {
10656 envelope.read_unchecked::<crate::wire::Availability>()
10657 })
10658 }),
10659
10660 type_: type_.map(|envelope| {
10661 ::fidl_next::FromWire::from_wire(unsafe {
10662 envelope.read_unchecked::<crate::wire::ConfigType<'de>>()
10663 })
10664 }),
10665
10666 default: default.map(|envelope| {
10667 ::fidl_next::FromWire::from_wire(unsafe {
10668 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
10669 })
10670 }),
10671
10672 source_dictionary: source_dictionary.map(|envelope| {
10673 ::fidl_next::FromWire::from_wire(unsafe {
10674 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
10675 })
10676 }),
10677 }
10678 }
10679 }
10680
10681 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseConfiguration<'de>> for UseConfiguration {
10682 #[inline]
10683 fn from_wire_ref(wire: &crate::wire::UseConfiguration<'de>) -> Self {
10684 Self {
10685 source: wire.table.get(1).map(|envelope| {
10686 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10687 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
10688 })
10689 }),
10690
10691 source_name: wire.table.get(2).map(|envelope| {
10692 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10693 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
10694 })
10695 }),
10696
10697 target_name: wire.table.get(3).map(|envelope| {
10698 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10699 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
10700 })
10701 }),
10702
10703 availability: wire.table.get(4).map(|envelope| {
10704 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10705 envelope.deref_unchecked::<crate::wire::Availability>()
10706 })
10707 }),
10708
10709 type_: wire.table.get(5).map(|envelope| {
10710 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10711 envelope.deref_unchecked::<crate::wire::ConfigType<'de>>()
10712 })
10713 }),
10714
10715 default: wire.table.get(6).map(|envelope| {
10716 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10717 envelope.deref_unchecked::<crate::wire::ConfigValue<'de>>()
10718 })
10719 }),
10720
10721 source_dictionary: wire.table.get(7).map(|envelope| {
10722 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10723 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
10724 })
10725 }),
10726 }
10727 }
10728 }
10729
10730 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
10731 pub struct UseDictionary {
10732 pub source: ::core::option::Option<crate::natural::Ref>,
10733
10734 pub source_name: ::core::option::Option<::std::string::String>,
10735
10736 pub target_path: ::core::option::Option<::std::string::String>,
10737
10738 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
10739
10740 pub availability: ::core::option::Option<crate::natural::Availability>,
10741
10742 pub source_dictionary: ::core::option::Option<::std::string::String>,
10743 }
10744
10745 impl UseDictionary {
10746 fn __max_ordinal(&self) -> usize {
10747 if self.source_dictionary.is_some() {
10748 return 8;
10749 }
10750
10751 if self.availability.is_some() {
10752 return 7;
10753 }
10754
10755 if self.dependency_type.is_some() {
10756 return 6;
10757 }
10758
10759 if self.target_path.is_some() {
10760 return 3;
10761 }
10762
10763 if self.source_name.is_some() {
10764 return 2;
10765 }
10766
10767 if self.source.is_some() {
10768 return 1;
10769 }
10770
10771 0
10772 }
10773 }
10774
10775 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseDictionary<'static>, ___E> for UseDictionary
10776 where
10777 ___E: ::fidl_next::Encoder + ?Sized,
10778 {
10779 #[inline]
10780 fn encode(
10781 mut self,
10782 encoder: &mut ___E,
10783 out: &mut ::core::mem::MaybeUninit<crate::wire::UseDictionary<'static>>,
10784 _: (),
10785 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10786 ::fidl_next::munge!(let crate::wire::UseDictionary { table } = out);
10787
10788 let max_ord = self.__max_ordinal();
10789
10790 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
10791 ::fidl_next::Wire::zero_padding(&mut out);
10792
10793 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
10794 ::fidl_next::wire::Envelope,
10795 >(encoder, max_ord);
10796
10797 for i in 1..=max_ord {
10798 match i {
10799 8 => {
10800 if let Some(value) = self.source_dictionary.take() {
10801 ::fidl_next::wire::Envelope::encode_value::<
10802 ::fidl_next::wire::String<'static>,
10803 ___E,
10804 >(
10805 value, preallocated.encoder, &mut out, 1024
10806 )?;
10807 } else {
10808 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10809 }
10810 }
10811
10812 7 => {
10813 if let Some(value) = self.availability.take() {
10814 ::fidl_next::wire::Envelope::encode_value::<
10815 crate::wire::Availability,
10816 ___E,
10817 >(
10818 value, preallocated.encoder, &mut out, ()
10819 )?;
10820 } else {
10821 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10822 }
10823 }
10824
10825 6 => {
10826 if let Some(value) = self.dependency_type.take() {
10827 ::fidl_next::wire::Envelope::encode_value::<
10828 crate::wire::DependencyType,
10829 ___E,
10830 >(
10831 value, preallocated.encoder, &mut out, ()
10832 )?;
10833 } else {
10834 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10835 }
10836 }
10837
10838 3 => {
10839 if let Some(value) = self.target_path.take() {
10840 ::fidl_next::wire::Envelope::encode_value::<
10841 ::fidl_next::wire::String<'static>,
10842 ___E,
10843 >(
10844 value, preallocated.encoder, &mut out, 1024
10845 )?;
10846 } else {
10847 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10848 }
10849 }
10850
10851 2 => {
10852 if let Some(value) = self.source_name.take() {
10853 ::fidl_next::wire::Envelope::encode_value::<
10854 ::fidl_next::wire::String<'static>,
10855 ___E,
10856 >(
10857 value, preallocated.encoder, &mut out, 100
10858 )?;
10859 } else {
10860 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10861 }
10862 }
10863
10864 1 => {
10865 if let Some(value) = self.source.take() {
10866 ::fidl_next::wire::Envelope::encode_value::<
10867 crate::wire::Ref<'static>,
10868 ___E,
10869 >(
10870 value, preallocated.encoder, &mut out, ()
10871 )?;
10872 } else {
10873 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10874 }
10875 }
10876
10877 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
10878 }
10879 unsafe {
10880 preallocated.write_next(out.assume_init_ref());
10881 }
10882 }
10883
10884 ::fidl_next::wire::Table::encode_len(table, max_ord);
10885
10886 Ok(())
10887 }
10888 }
10889
10890 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseDictionary<'static>, ___E>
10891 for &'a UseDictionary
10892 where
10893 ___E: ::fidl_next::Encoder + ?Sized,
10894 {
10895 #[inline]
10896 fn encode(
10897 self,
10898 encoder: &mut ___E,
10899 out: &mut ::core::mem::MaybeUninit<crate::wire::UseDictionary<'static>>,
10900 _: (),
10901 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10902 ::fidl_next::munge!(let crate::wire::UseDictionary { table } = out);
10903
10904 let max_ord = self.__max_ordinal();
10905
10906 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
10907 ::fidl_next::Wire::zero_padding(&mut out);
10908
10909 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
10910 ::fidl_next::wire::Envelope,
10911 >(encoder, max_ord);
10912
10913 for i in 1..=max_ord {
10914 match i {
10915 8 => {
10916 if let Some(value) = &self.source_dictionary {
10917 ::fidl_next::wire::Envelope::encode_value::<
10918 ::fidl_next::wire::String<'static>,
10919 ___E,
10920 >(
10921 value, preallocated.encoder, &mut out, 1024
10922 )?;
10923 } else {
10924 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10925 }
10926 }
10927
10928 7 => {
10929 if let Some(value) = &self.availability {
10930 ::fidl_next::wire::Envelope::encode_value::<
10931 crate::wire::Availability,
10932 ___E,
10933 >(
10934 value, preallocated.encoder, &mut out, ()
10935 )?;
10936 } else {
10937 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10938 }
10939 }
10940
10941 6 => {
10942 if let Some(value) = &self.dependency_type {
10943 ::fidl_next::wire::Envelope::encode_value::<
10944 crate::wire::DependencyType,
10945 ___E,
10946 >(
10947 value, preallocated.encoder, &mut out, ()
10948 )?;
10949 } else {
10950 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10951 }
10952 }
10953
10954 3 => {
10955 if let Some(value) = &self.target_path {
10956 ::fidl_next::wire::Envelope::encode_value::<
10957 ::fidl_next::wire::String<'static>,
10958 ___E,
10959 >(
10960 value, preallocated.encoder, &mut out, 1024
10961 )?;
10962 } else {
10963 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10964 }
10965 }
10966
10967 2 => {
10968 if let Some(value) = &self.source_name {
10969 ::fidl_next::wire::Envelope::encode_value::<
10970 ::fidl_next::wire::String<'static>,
10971 ___E,
10972 >(
10973 value, preallocated.encoder, &mut out, 100
10974 )?;
10975 } else {
10976 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10977 }
10978 }
10979
10980 1 => {
10981 if let Some(value) = &self.source {
10982 ::fidl_next::wire::Envelope::encode_value::<
10983 crate::wire::Ref<'static>,
10984 ___E,
10985 >(
10986 value, preallocated.encoder, &mut out, ()
10987 )?;
10988 } else {
10989 ::fidl_next::wire::Envelope::encode_zero(&mut out)
10990 }
10991 }
10992
10993 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
10994 }
10995 unsafe {
10996 preallocated.write_next(out.assume_init_ref());
10997 }
10998 }
10999
11000 ::fidl_next::wire::Table::encode_len(table, max_ord);
11001
11002 Ok(())
11003 }
11004 }
11005
11006 impl<'de> ::fidl_next::FromWire<crate::wire::UseDictionary<'de>> for UseDictionary {
11007 #[inline]
11008 fn from_wire(wire_: crate::wire::UseDictionary<'de>) -> Self {
11009 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
11010
11011 let source = wire_.table.get(1);
11012
11013 let source_name = wire_.table.get(2);
11014
11015 let target_path = wire_.table.get(3);
11016
11017 let dependency_type = wire_.table.get(6);
11018
11019 let availability = wire_.table.get(7);
11020
11021 let source_dictionary = wire_.table.get(8);
11022
11023 Self {
11024 source: source.map(|envelope| {
11025 ::fidl_next::FromWire::from_wire(unsafe {
11026 envelope.read_unchecked::<crate::wire::Ref<'de>>()
11027 })
11028 }),
11029
11030 source_name: source_name.map(|envelope| {
11031 ::fidl_next::FromWire::from_wire(unsafe {
11032 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11033 })
11034 }),
11035
11036 target_path: target_path.map(|envelope| {
11037 ::fidl_next::FromWire::from_wire(unsafe {
11038 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11039 })
11040 }),
11041
11042 dependency_type: dependency_type.map(|envelope| {
11043 ::fidl_next::FromWire::from_wire(unsafe {
11044 envelope.read_unchecked::<crate::wire::DependencyType>()
11045 })
11046 }),
11047
11048 availability: availability.map(|envelope| {
11049 ::fidl_next::FromWire::from_wire(unsafe {
11050 envelope.read_unchecked::<crate::wire::Availability>()
11051 })
11052 }),
11053
11054 source_dictionary: source_dictionary.map(|envelope| {
11055 ::fidl_next::FromWire::from_wire(unsafe {
11056 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11057 })
11058 }),
11059 }
11060 }
11061 }
11062
11063 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseDictionary<'de>> for UseDictionary {
11064 #[inline]
11065 fn from_wire_ref(wire: &crate::wire::UseDictionary<'de>) -> Self {
11066 Self {
11067 source: wire.table.get(1).map(|envelope| {
11068 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11069 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
11070 })
11071 }),
11072
11073 source_name: wire.table.get(2).map(|envelope| {
11074 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11075 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
11076 })
11077 }),
11078
11079 target_path: wire.table.get(3).map(|envelope| {
11080 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11081 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
11082 })
11083 }),
11084
11085 dependency_type: wire.table.get(6).map(|envelope| {
11086 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11087 envelope.deref_unchecked::<crate::wire::DependencyType>()
11088 })
11089 }),
11090
11091 availability: wire.table.get(7).map(|envelope| {
11092 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11093 envelope.deref_unchecked::<crate::wire::Availability>()
11094 })
11095 }),
11096
11097 source_dictionary: wire.table.get(8).map(|envelope| {
11098 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11099 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
11100 })
11101 }),
11102 }
11103 }
11104 }
11105
11106 #[doc = " Declares a capability used by a component, which was offered to it.\n"]
11107 #[derive(Debug, PartialEq)]
11108 pub enum Use {
11109 Service(crate::natural::UseService),
11110
11111 Protocol(crate::natural::UseProtocol),
11112
11113 Directory(crate::natural::UseDirectory),
11114
11115 Storage(crate::natural::UseStorage),
11116
11117 EventStream(crate::natural::UseEventStream),
11118
11119 Runner(crate::natural::UseRunner),
11120
11121 Config(crate::natural::UseConfiguration),
11122
11123 Dictionary(crate::natural::UseDictionary),
11124
11125 UnknownOrdinal_(u64),
11126 }
11127
11128 impl Use {
11129 pub fn is_unknown(&self) -> bool {
11130 #[allow(unreachable_patterns)]
11131 match self {
11132 Self::UnknownOrdinal_(_) => true,
11133 _ => false,
11134 }
11135 }
11136 }
11137
11138 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Use<'static>, ___E> for Use
11139 where
11140 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11141 ___E: ::fidl_next::Encoder,
11142 {
11143 #[inline]
11144 fn encode(
11145 self,
11146 encoder: &mut ___E,
11147 out: &mut ::core::mem::MaybeUninit<crate::wire::Use<'static>>,
11148 _: (),
11149 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11150 ::fidl_next::munge!(let crate::wire::Use { raw, _phantom: _ } = out);
11151
11152 match self {
11153 Self::Service(value) => ::fidl_next::wire::Union::encode_as::<
11154 ___E,
11155 crate::wire::UseService<'static>,
11156 >(value, 1, encoder, raw, ())?,
11157
11158 Self::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
11159 ___E,
11160 crate::wire::UseProtocol<'static>,
11161 >(value, 2, encoder, raw, ())?,
11162
11163 Self::Directory(value) => ::fidl_next::wire::Union::encode_as::<
11164 ___E,
11165 crate::wire::UseDirectory<'static>,
11166 >(value, 3, encoder, raw, ())?,
11167
11168 Self::Storage(value) => ::fidl_next::wire::Union::encode_as::<
11169 ___E,
11170 crate::wire::UseStorage<'static>,
11171 >(value, 4, encoder, raw, ())?,
11172
11173 Self::EventStream(value) => ::fidl_next::wire::Union::encode_as::<
11174 ___E,
11175 crate::wire::UseEventStream<'static>,
11176 >(value, 7, encoder, raw, ())?,
11177
11178 Self::Runner(value) => ::fidl_next::wire::Union::encode_as::<
11179 ___E,
11180 crate::wire::UseRunner<'static>,
11181 >(value, 8, encoder, raw, ())?,
11182
11183 Self::Config(value) => ::fidl_next::wire::Union::encode_as::<
11184 ___E,
11185 crate::wire::UseConfiguration<'static>,
11186 >(value, 9, encoder, raw, ())?,
11187
11188 Self::Dictionary(value) => ::fidl_next::wire::Union::encode_as::<
11189 ___E,
11190 crate::wire::UseDictionary<'static>,
11191 >(value, 10, encoder, raw, ())?,
11192
11193 Self::UnknownOrdinal_(ordinal) => {
11194 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
11195 }
11196 }
11197
11198 Ok(())
11199 }
11200 }
11201
11202 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Use<'static>, ___E> for &'a Use
11203 where
11204 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
11205 ___E: ::fidl_next::Encoder,
11206 {
11207 #[inline]
11208 fn encode(
11209 self,
11210 encoder: &mut ___E,
11211 out: &mut ::core::mem::MaybeUninit<crate::wire::Use<'static>>,
11212 _: (),
11213 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11214 ::fidl_next::munge!(let crate::wire::Use { raw, _phantom: _ } = out);
11215
11216 match self {
11217 Use::Service(value) => ::fidl_next::wire::Union::encode_as::<
11218 ___E,
11219 crate::wire::UseService<'static>,
11220 >(value, 1, encoder, raw, ())?,
11221
11222 Use::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
11223 ___E,
11224 crate::wire::UseProtocol<'static>,
11225 >(value, 2, encoder, raw, ())?,
11226
11227 Use::Directory(value) => ::fidl_next::wire::Union::encode_as::<
11228 ___E,
11229 crate::wire::UseDirectory<'static>,
11230 >(value, 3, encoder, raw, ())?,
11231
11232 Use::Storage(value) => ::fidl_next::wire::Union::encode_as::<
11233 ___E,
11234 crate::wire::UseStorage<'static>,
11235 >(value, 4, encoder, raw, ())?,
11236
11237 Use::EventStream(value) => ::fidl_next::wire::Union::encode_as::<
11238 ___E,
11239 crate::wire::UseEventStream<'static>,
11240 >(value, 7, encoder, raw, ())?,
11241
11242 Use::Runner(value) => ::fidl_next::wire::Union::encode_as::<
11243 ___E,
11244 crate::wire::UseRunner<'static>,
11245 >(value, 8, encoder, raw, ())?,
11246
11247 Use::Config(value) => ::fidl_next::wire::Union::encode_as::<
11248 ___E,
11249 crate::wire::UseConfiguration<'static>,
11250 >(value, 9, encoder, raw, ())?,
11251
11252 Use::Dictionary(value) => ::fidl_next::wire::Union::encode_as::<
11253 ___E,
11254 crate::wire::UseDictionary<'static>,
11255 >(value, 10, encoder, raw, ())?,
11256
11257 Use::UnknownOrdinal_(ordinal) => {
11258 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
11259 }
11260 }
11261
11262 Ok(())
11263 }
11264 }
11265
11266 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::Use<'static>, ___E> for Use
11267 where
11268 ___E: ?Sized,
11269 Use: ::fidl_next::Encode<crate::wire::Use<'static>, ___E>,
11270 {
11271 #[inline]
11272 fn encode_option(
11273 this: ::core::option::Option<Self>,
11274 encoder: &mut ___E,
11275 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Use<'static>>,
11276 _: (),
11277 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11278 ::fidl_next::munge!(let crate::wire_optional::Use { raw, _phantom: _ } = &mut *out);
11279
11280 if let Some(inner) = this {
11281 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
11282 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
11283 } else {
11284 ::fidl_next::wire::Union::encode_absent(raw);
11285 }
11286
11287 Ok(())
11288 }
11289 }
11290
11291 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::Use<'static>, ___E>
11292 for &'a Use
11293 where
11294 ___E: ?Sized,
11295 &'a Use: ::fidl_next::Encode<crate::wire::Use<'static>, ___E>,
11296 {
11297 #[inline]
11298 fn encode_option(
11299 this: ::core::option::Option<Self>,
11300 encoder: &mut ___E,
11301 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Use<'static>>,
11302 _: (),
11303 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11304 ::fidl_next::munge!(let crate::wire_optional::Use { raw, _phantom: _ } = &mut *out);
11305
11306 if let Some(inner) = this {
11307 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
11308 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
11309 } else {
11310 ::fidl_next::wire::Union::encode_absent(raw);
11311 }
11312
11313 Ok(())
11314 }
11315 }
11316
11317 impl<'de> ::fidl_next::FromWire<crate::wire::Use<'de>> for Use {
11318 #[inline]
11319 fn from_wire(wire: crate::wire::Use<'de>) -> Self {
11320 let wire = ::core::mem::ManuallyDrop::new(wire);
11321 match wire.raw.ordinal() {
11322 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
11323 wire.raw.get().read_unchecked::<crate::wire::UseService<'de>>()
11324 })),
11325
11326 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
11327 wire.raw.get().read_unchecked::<crate::wire::UseProtocol<'de>>()
11328 })),
11329
11330 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
11331 wire.raw.get().read_unchecked::<crate::wire::UseDirectory<'de>>()
11332 })),
11333
11334 4 => Self::Storage(::fidl_next::FromWire::from_wire(unsafe {
11335 wire.raw.get().read_unchecked::<crate::wire::UseStorage<'de>>()
11336 })),
11337
11338 7 => Self::EventStream(::fidl_next::FromWire::from_wire(unsafe {
11339 wire.raw.get().read_unchecked::<crate::wire::UseEventStream<'de>>()
11340 })),
11341
11342 8 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
11343 wire.raw.get().read_unchecked::<crate::wire::UseRunner<'de>>()
11344 })),
11345
11346 9 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
11347 wire.raw.get().read_unchecked::<crate::wire::UseConfiguration<'de>>()
11348 })),
11349
11350 10 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
11351 wire.raw.get().read_unchecked::<crate::wire::UseDictionary<'de>>()
11352 })),
11353
11354 ord => return Self::UnknownOrdinal_(ord as u64),
11355 }
11356 }
11357 }
11358
11359 impl<'de> ::fidl_next::FromWireRef<crate::wire::Use<'de>> for Use {
11360 #[inline]
11361 fn from_wire_ref(wire: &crate::wire::Use<'de>) -> Self {
11362 match wire.raw.ordinal() {
11363 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11364 wire.raw.get().deref_unchecked::<crate::wire::UseService<'de>>()
11365 })),
11366
11367 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11368 wire.raw.get().deref_unchecked::<crate::wire::UseProtocol<'de>>()
11369 })),
11370
11371 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11372 wire.raw.get().deref_unchecked::<crate::wire::UseDirectory<'de>>()
11373 })),
11374
11375 4 => Self::Storage(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11376 wire.raw.get().deref_unchecked::<crate::wire::UseStorage<'de>>()
11377 })),
11378
11379 7 => Self::EventStream(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11380 wire.raw.get().deref_unchecked::<crate::wire::UseEventStream<'de>>()
11381 })),
11382
11383 8 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11384 wire.raw.get().deref_unchecked::<crate::wire::UseRunner<'de>>()
11385 })),
11386
11387 9 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11388 wire.raw.get().deref_unchecked::<crate::wire::UseConfiguration<'de>>()
11389 })),
11390
11391 10 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11392 wire.raw.get().deref_unchecked::<crate::wire::UseDictionary<'de>>()
11393 })),
11394
11395 ord => return Self::UnknownOrdinal_(ord as u64),
11396 }
11397 }
11398 }
11399
11400 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Use<'de>> for Use {
11401 #[inline]
11402 fn from_wire_option(wire: crate::wire_optional::Use<'de>) -> ::core::option::Option<Self> {
11403 if let Some(inner) = wire.into_option() {
11404 Some(::fidl_next::FromWire::from_wire(inner))
11405 } else {
11406 None
11407 }
11408 }
11409 }
11410
11411 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Use<'de>> for Box<Use> {
11412 #[inline]
11413 fn from_wire_option(wire: crate::wire_optional::Use<'de>) -> ::core::option::Option<Self> {
11414 <Use as ::fidl_next::FromWireOption<crate::wire_optional::Use<'de>>>::from_wire_option(
11415 wire,
11416 )
11417 .map(Box::new)
11418 }
11419 }
11420
11421 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::Use<'de>> for Box<Use> {
11422 #[inline]
11423 fn from_wire_option_ref(
11424 wire: &crate::wire_optional::Use<'de>,
11425 ) -> ::core::option::Option<Self> {
11426 if let Some(inner) = wire.as_ref() {
11427 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
11428 } else {
11429 None
11430 }
11431 }
11432 }
11433
11434 #[doc = " Declares a service exposed to a component\'s containing realm, such as a\n service exposed by the component or one of its children at runtime.\n\n To learn more about services, see:\n https://fuchsia.dev/fuchsia-src/glossary#service\n"]
11435 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
11436 pub struct ExposeService {
11437 pub source: ::core::option::Option<crate::natural::Ref>,
11438
11439 pub source_name: ::core::option::Option<::std::string::String>,
11440
11441 pub target: ::core::option::Option<crate::natural::Ref>,
11442
11443 pub target_name: ::core::option::Option<::std::string::String>,
11444
11445 pub availability: ::core::option::Option<crate::natural::Availability>,
11446
11447 pub source_dictionary: ::core::option::Option<::std::string::String>,
11448 }
11449
11450 impl ExposeService {
11451 fn __max_ordinal(&self) -> usize {
11452 if self.source_dictionary.is_some() {
11453 return 6;
11454 }
11455
11456 if self.availability.is_some() {
11457 return 5;
11458 }
11459
11460 if self.target_name.is_some() {
11461 return 4;
11462 }
11463
11464 if self.target.is_some() {
11465 return 3;
11466 }
11467
11468 if self.source_name.is_some() {
11469 return 2;
11470 }
11471
11472 if self.source.is_some() {
11473 return 1;
11474 }
11475
11476 0
11477 }
11478 }
11479
11480 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeService<'static>, ___E> for ExposeService
11481 where
11482 ___E: ::fidl_next::Encoder + ?Sized,
11483 {
11484 #[inline]
11485 fn encode(
11486 mut self,
11487 encoder: &mut ___E,
11488 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeService<'static>>,
11489 _: (),
11490 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11491 ::fidl_next::munge!(let crate::wire::ExposeService { table } = out);
11492
11493 let max_ord = self.__max_ordinal();
11494
11495 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
11496 ::fidl_next::Wire::zero_padding(&mut out);
11497
11498 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
11499 ::fidl_next::wire::Envelope,
11500 >(encoder, max_ord);
11501
11502 for i in 1..=max_ord {
11503 match i {
11504 6 => {
11505 if let Some(value) = self.source_dictionary.take() {
11506 ::fidl_next::wire::Envelope::encode_value::<
11507 ::fidl_next::wire::String<'static>,
11508 ___E,
11509 >(
11510 value, preallocated.encoder, &mut out, 1024
11511 )?;
11512 } else {
11513 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11514 }
11515 }
11516
11517 5 => {
11518 if let Some(value) = self.availability.take() {
11519 ::fidl_next::wire::Envelope::encode_value::<
11520 crate::wire::Availability,
11521 ___E,
11522 >(
11523 value, preallocated.encoder, &mut out, ()
11524 )?;
11525 } else {
11526 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11527 }
11528 }
11529
11530 4 => {
11531 if let Some(value) = self.target_name.take() {
11532 ::fidl_next::wire::Envelope::encode_value::<
11533 ::fidl_next::wire::String<'static>,
11534 ___E,
11535 >(
11536 value, preallocated.encoder, &mut out, 100
11537 )?;
11538 } else {
11539 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11540 }
11541 }
11542
11543 3 => {
11544 if let Some(value) = self.target.take() {
11545 ::fidl_next::wire::Envelope::encode_value::<
11546 crate::wire::Ref<'static>,
11547 ___E,
11548 >(
11549 value, preallocated.encoder, &mut out, ()
11550 )?;
11551 } else {
11552 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11553 }
11554 }
11555
11556 2 => {
11557 if let Some(value) = self.source_name.take() {
11558 ::fidl_next::wire::Envelope::encode_value::<
11559 ::fidl_next::wire::String<'static>,
11560 ___E,
11561 >(
11562 value, preallocated.encoder, &mut out, 100
11563 )?;
11564 } else {
11565 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11566 }
11567 }
11568
11569 1 => {
11570 if let Some(value) = self.source.take() {
11571 ::fidl_next::wire::Envelope::encode_value::<
11572 crate::wire::Ref<'static>,
11573 ___E,
11574 >(
11575 value, preallocated.encoder, &mut out, ()
11576 )?;
11577 } else {
11578 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11579 }
11580 }
11581
11582 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
11583 }
11584 unsafe {
11585 preallocated.write_next(out.assume_init_ref());
11586 }
11587 }
11588
11589 ::fidl_next::wire::Table::encode_len(table, max_ord);
11590
11591 Ok(())
11592 }
11593 }
11594
11595 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeService<'static>, ___E>
11596 for &'a ExposeService
11597 where
11598 ___E: ::fidl_next::Encoder + ?Sized,
11599 {
11600 #[inline]
11601 fn encode(
11602 self,
11603 encoder: &mut ___E,
11604 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeService<'static>>,
11605 _: (),
11606 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11607 ::fidl_next::munge!(let crate::wire::ExposeService { table } = out);
11608
11609 let max_ord = self.__max_ordinal();
11610
11611 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
11612 ::fidl_next::Wire::zero_padding(&mut out);
11613
11614 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
11615 ::fidl_next::wire::Envelope,
11616 >(encoder, max_ord);
11617
11618 for i in 1..=max_ord {
11619 match i {
11620 6 => {
11621 if let Some(value) = &self.source_dictionary {
11622 ::fidl_next::wire::Envelope::encode_value::<
11623 ::fidl_next::wire::String<'static>,
11624 ___E,
11625 >(
11626 value, preallocated.encoder, &mut out, 1024
11627 )?;
11628 } else {
11629 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11630 }
11631 }
11632
11633 5 => {
11634 if let Some(value) = &self.availability {
11635 ::fidl_next::wire::Envelope::encode_value::<
11636 crate::wire::Availability,
11637 ___E,
11638 >(
11639 value, preallocated.encoder, &mut out, ()
11640 )?;
11641 } else {
11642 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11643 }
11644 }
11645
11646 4 => {
11647 if let Some(value) = &self.target_name {
11648 ::fidl_next::wire::Envelope::encode_value::<
11649 ::fidl_next::wire::String<'static>,
11650 ___E,
11651 >(
11652 value, preallocated.encoder, &mut out, 100
11653 )?;
11654 } else {
11655 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11656 }
11657 }
11658
11659 3 => {
11660 if let Some(value) = &self.target {
11661 ::fidl_next::wire::Envelope::encode_value::<
11662 crate::wire::Ref<'static>,
11663 ___E,
11664 >(
11665 value, preallocated.encoder, &mut out, ()
11666 )?;
11667 } else {
11668 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11669 }
11670 }
11671
11672 2 => {
11673 if let Some(value) = &self.source_name {
11674 ::fidl_next::wire::Envelope::encode_value::<
11675 ::fidl_next::wire::String<'static>,
11676 ___E,
11677 >(
11678 value, preallocated.encoder, &mut out, 100
11679 )?;
11680 } else {
11681 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11682 }
11683 }
11684
11685 1 => {
11686 if let Some(value) = &self.source {
11687 ::fidl_next::wire::Envelope::encode_value::<
11688 crate::wire::Ref<'static>,
11689 ___E,
11690 >(
11691 value, preallocated.encoder, &mut out, ()
11692 )?;
11693 } else {
11694 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11695 }
11696 }
11697
11698 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
11699 }
11700 unsafe {
11701 preallocated.write_next(out.assume_init_ref());
11702 }
11703 }
11704
11705 ::fidl_next::wire::Table::encode_len(table, max_ord);
11706
11707 Ok(())
11708 }
11709 }
11710
11711 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeService<'de>> for ExposeService {
11712 #[inline]
11713 fn from_wire(wire_: crate::wire::ExposeService<'de>) -> Self {
11714 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
11715
11716 let source = wire_.table.get(1);
11717
11718 let source_name = wire_.table.get(2);
11719
11720 let target = wire_.table.get(3);
11721
11722 let target_name = wire_.table.get(4);
11723
11724 let availability = wire_.table.get(5);
11725
11726 let source_dictionary = wire_.table.get(6);
11727
11728 Self {
11729 source: source.map(|envelope| {
11730 ::fidl_next::FromWire::from_wire(unsafe {
11731 envelope.read_unchecked::<crate::wire::Ref<'de>>()
11732 })
11733 }),
11734
11735 source_name: source_name.map(|envelope| {
11736 ::fidl_next::FromWire::from_wire(unsafe {
11737 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11738 })
11739 }),
11740
11741 target: target.map(|envelope| {
11742 ::fidl_next::FromWire::from_wire(unsafe {
11743 envelope.read_unchecked::<crate::wire::Ref<'de>>()
11744 })
11745 }),
11746
11747 target_name: target_name.map(|envelope| {
11748 ::fidl_next::FromWire::from_wire(unsafe {
11749 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11750 })
11751 }),
11752
11753 availability: availability.map(|envelope| {
11754 ::fidl_next::FromWire::from_wire(unsafe {
11755 envelope.read_unchecked::<crate::wire::Availability>()
11756 })
11757 }),
11758
11759 source_dictionary: source_dictionary.map(|envelope| {
11760 ::fidl_next::FromWire::from_wire(unsafe {
11761 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
11762 })
11763 }),
11764 }
11765 }
11766 }
11767
11768 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeService<'de>> for ExposeService {
11769 #[inline]
11770 fn from_wire_ref(wire: &crate::wire::ExposeService<'de>) -> Self {
11771 Self {
11772 source: wire.table.get(1).map(|envelope| {
11773 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11774 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
11775 })
11776 }),
11777
11778 source_name: wire.table.get(2).map(|envelope| {
11779 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11780 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
11781 })
11782 }),
11783
11784 target: wire.table.get(3).map(|envelope| {
11785 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11786 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
11787 })
11788 }),
11789
11790 target_name: wire.table.get(4).map(|envelope| {
11791 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11792 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
11793 })
11794 }),
11795
11796 availability: wire.table.get(5).map(|envelope| {
11797 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11798 envelope.deref_unchecked::<crate::wire::Availability>()
11799 })
11800 }),
11801
11802 source_dictionary: wire.table.get(6).map(|envelope| {
11803 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11804 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
11805 })
11806 }),
11807 }
11808 }
11809 }
11810
11811 #[doc = " Declares a protocol exposed to a component\'s containing realm, such as\n a protocol exposed by the component or one of its children at runtime.\n\n To learn more about protocols, see:\n https://fuchsia.dev/fuchsia-src/glossary#protocol\n"]
11812 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
11813 pub struct ExposeProtocol {
11814 pub source: ::core::option::Option<crate::natural::Ref>,
11815
11816 pub source_name: ::core::option::Option<::std::string::String>,
11817
11818 pub target: ::core::option::Option<crate::natural::Ref>,
11819
11820 pub target_name: ::core::option::Option<::std::string::String>,
11821
11822 pub availability: ::core::option::Option<crate::natural::Availability>,
11823
11824 pub source_dictionary: ::core::option::Option<::std::string::String>,
11825 }
11826
11827 impl ExposeProtocol {
11828 fn __max_ordinal(&self) -> usize {
11829 if self.source_dictionary.is_some() {
11830 return 6;
11831 }
11832
11833 if self.availability.is_some() {
11834 return 5;
11835 }
11836
11837 if self.target_name.is_some() {
11838 return 4;
11839 }
11840
11841 if self.target.is_some() {
11842 return 3;
11843 }
11844
11845 if self.source_name.is_some() {
11846 return 2;
11847 }
11848
11849 if self.source.is_some() {
11850 return 1;
11851 }
11852
11853 0
11854 }
11855 }
11856
11857 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeProtocol<'static>, ___E> for ExposeProtocol
11858 where
11859 ___E: ::fidl_next::Encoder + ?Sized,
11860 {
11861 #[inline]
11862 fn encode(
11863 mut self,
11864 encoder: &mut ___E,
11865 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeProtocol<'static>>,
11866 _: (),
11867 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11868 ::fidl_next::munge!(let crate::wire::ExposeProtocol { table } = out);
11869
11870 let max_ord = self.__max_ordinal();
11871
11872 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
11873 ::fidl_next::Wire::zero_padding(&mut out);
11874
11875 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
11876 ::fidl_next::wire::Envelope,
11877 >(encoder, max_ord);
11878
11879 for i in 1..=max_ord {
11880 match i {
11881 6 => {
11882 if let Some(value) = self.source_dictionary.take() {
11883 ::fidl_next::wire::Envelope::encode_value::<
11884 ::fidl_next::wire::String<'static>,
11885 ___E,
11886 >(
11887 value, preallocated.encoder, &mut out, 1024
11888 )?;
11889 } else {
11890 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11891 }
11892 }
11893
11894 5 => {
11895 if let Some(value) = self.availability.take() {
11896 ::fidl_next::wire::Envelope::encode_value::<
11897 crate::wire::Availability,
11898 ___E,
11899 >(
11900 value, preallocated.encoder, &mut out, ()
11901 )?;
11902 } else {
11903 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11904 }
11905 }
11906
11907 4 => {
11908 if let Some(value) = self.target_name.take() {
11909 ::fidl_next::wire::Envelope::encode_value::<
11910 ::fidl_next::wire::String<'static>,
11911 ___E,
11912 >(
11913 value, preallocated.encoder, &mut out, 100
11914 )?;
11915 } else {
11916 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11917 }
11918 }
11919
11920 3 => {
11921 if let Some(value) = self.target.take() {
11922 ::fidl_next::wire::Envelope::encode_value::<
11923 crate::wire::Ref<'static>,
11924 ___E,
11925 >(
11926 value, preallocated.encoder, &mut out, ()
11927 )?;
11928 } else {
11929 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11930 }
11931 }
11932
11933 2 => {
11934 if let Some(value) = self.source_name.take() {
11935 ::fidl_next::wire::Envelope::encode_value::<
11936 ::fidl_next::wire::String<'static>,
11937 ___E,
11938 >(
11939 value, preallocated.encoder, &mut out, 100
11940 )?;
11941 } else {
11942 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11943 }
11944 }
11945
11946 1 => {
11947 if let Some(value) = self.source.take() {
11948 ::fidl_next::wire::Envelope::encode_value::<
11949 crate::wire::Ref<'static>,
11950 ___E,
11951 >(
11952 value, preallocated.encoder, &mut out, ()
11953 )?;
11954 } else {
11955 ::fidl_next::wire::Envelope::encode_zero(&mut out)
11956 }
11957 }
11958
11959 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
11960 }
11961 unsafe {
11962 preallocated.write_next(out.assume_init_ref());
11963 }
11964 }
11965
11966 ::fidl_next::wire::Table::encode_len(table, max_ord);
11967
11968 Ok(())
11969 }
11970 }
11971
11972 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeProtocol<'static>, ___E>
11973 for &'a ExposeProtocol
11974 where
11975 ___E: ::fidl_next::Encoder + ?Sized,
11976 {
11977 #[inline]
11978 fn encode(
11979 self,
11980 encoder: &mut ___E,
11981 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeProtocol<'static>>,
11982 _: (),
11983 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11984 ::fidl_next::munge!(let crate::wire::ExposeProtocol { table } = out);
11985
11986 let max_ord = self.__max_ordinal();
11987
11988 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
11989 ::fidl_next::Wire::zero_padding(&mut out);
11990
11991 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
11992 ::fidl_next::wire::Envelope,
11993 >(encoder, max_ord);
11994
11995 for i in 1..=max_ord {
11996 match i {
11997 6 => {
11998 if let Some(value) = &self.source_dictionary {
11999 ::fidl_next::wire::Envelope::encode_value::<
12000 ::fidl_next::wire::String<'static>,
12001 ___E,
12002 >(
12003 value, preallocated.encoder, &mut out, 1024
12004 )?;
12005 } else {
12006 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12007 }
12008 }
12009
12010 5 => {
12011 if let Some(value) = &self.availability {
12012 ::fidl_next::wire::Envelope::encode_value::<
12013 crate::wire::Availability,
12014 ___E,
12015 >(
12016 value, preallocated.encoder, &mut out, ()
12017 )?;
12018 } else {
12019 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12020 }
12021 }
12022
12023 4 => {
12024 if let Some(value) = &self.target_name {
12025 ::fidl_next::wire::Envelope::encode_value::<
12026 ::fidl_next::wire::String<'static>,
12027 ___E,
12028 >(
12029 value, preallocated.encoder, &mut out, 100
12030 )?;
12031 } else {
12032 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12033 }
12034 }
12035
12036 3 => {
12037 if let Some(value) = &self.target {
12038 ::fidl_next::wire::Envelope::encode_value::<
12039 crate::wire::Ref<'static>,
12040 ___E,
12041 >(
12042 value, preallocated.encoder, &mut out, ()
12043 )?;
12044 } else {
12045 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12046 }
12047 }
12048
12049 2 => {
12050 if let Some(value) = &self.source_name {
12051 ::fidl_next::wire::Envelope::encode_value::<
12052 ::fidl_next::wire::String<'static>,
12053 ___E,
12054 >(
12055 value, preallocated.encoder, &mut out, 100
12056 )?;
12057 } else {
12058 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12059 }
12060 }
12061
12062 1 => {
12063 if let Some(value) = &self.source {
12064 ::fidl_next::wire::Envelope::encode_value::<
12065 crate::wire::Ref<'static>,
12066 ___E,
12067 >(
12068 value, preallocated.encoder, &mut out, ()
12069 )?;
12070 } else {
12071 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12072 }
12073 }
12074
12075 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
12076 }
12077 unsafe {
12078 preallocated.write_next(out.assume_init_ref());
12079 }
12080 }
12081
12082 ::fidl_next::wire::Table::encode_len(table, max_ord);
12083
12084 Ok(())
12085 }
12086 }
12087
12088 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeProtocol<'de>> for ExposeProtocol {
12089 #[inline]
12090 fn from_wire(wire_: crate::wire::ExposeProtocol<'de>) -> Self {
12091 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
12092
12093 let source = wire_.table.get(1);
12094
12095 let source_name = wire_.table.get(2);
12096
12097 let target = wire_.table.get(3);
12098
12099 let target_name = wire_.table.get(4);
12100
12101 let availability = wire_.table.get(5);
12102
12103 let source_dictionary = wire_.table.get(6);
12104
12105 Self {
12106 source: source.map(|envelope| {
12107 ::fidl_next::FromWire::from_wire(unsafe {
12108 envelope.read_unchecked::<crate::wire::Ref<'de>>()
12109 })
12110 }),
12111
12112 source_name: source_name.map(|envelope| {
12113 ::fidl_next::FromWire::from_wire(unsafe {
12114 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12115 })
12116 }),
12117
12118 target: target.map(|envelope| {
12119 ::fidl_next::FromWire::from_wire(unsafe {
12120 envelope.read_unchecked::<crate::wire::Ref<'de>>()
12121 })
12122 }),
12123
12124 target_name: target_name.map(|envelope| {
12125 ::fidl_next::FromWire::from_wire(unsafe {
12126 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12127 })
12128 }),
12129
12130 availability: availability.map(|envelope| {
12131 ::fidl_next::FromWire::from_wire(unsafe {
12132 envelope.read_unchecked::<crate::wire::Availability>()
12133 })
12134 }),
12135
12136 source_dictionary: source_dictionary.map(|envelope| {
12137 ::fidl_next::FromWire::from_wire(unsafe {
12138 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12139 })
12140 }),
12141 }
12142 }
12143 }
12144
12145 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeProtocol<'de>> for ExposeProtocol {
12146 #[inline]
12147 fn from_wire_ref(wire: &crate::wire::ExposeProtocol<'de>) -> Self {
12148 Self {
12149 source: wire.table.get(1).map(|envelope| {
12150 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12151 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
12152 })
12153 }),
12154
12155 source_name: wire.table.get(2).map(|envelope| {
12156 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12157 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12158 })
12159 }),
12160
12161 target: wire.table.get(3).map(|envelope| {
12162 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12163 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
12164 })
12165 }),
12166
12167 target_name: wire.table.get(4).map(|envelope| {
12168 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12169 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12170 })
12171 }),
12172
12173 availability: wire.table.get(5).map(|envelope| {
12174 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12175 envelope.deref_unchecked::<crate::wire::Availability>()
12176 })
12177 }),
12178
12179 source_dictionary: wire.table.get(6).map(|envelope| {
12180 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12181 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12182 })
12183 }),
12184 }
12185 }
12186 }
12187
12188 #[doc = " Declares a directory exposed to a component\'s containing realm, such as a\n directory exposed by the component or one of its children at runtime.\n"]
12189 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
12190 pub struct ExposeDirectory {
12191 pub source: ::core::option::Option<crate::natural::Ref>,
12192
12193 pub source_name: ::core::option::Option<::std::string::String>,
12194
12195 pub target: ::core::option::Option<crate::natural::Ref>,
12196
12197 pub target_name: ::core::option::Option<::std::string::String>,
12198
12199 pub rights: ::core::option::Option<::fidl_next_common_fuchsia_io::natural::Operations>,
12200
12201 pub subdir: ::core::option::Option<::std::string::String>,
12202
12203 pub availability: ::core::option::Option<crate::natural::Availability>,
12204
12205 pub source_dictionary: ::core::option::Option<::std::string::String>,
12206 }
12207
12208 impl ExposeDirectory {
12209 fn __max_ordinal(&self) -> usize {
12210 if self.source_dictionary.is_some() {
12211 return 8;
12212 }
12213
12214 if self.availability.is_some() {
12215 return 7;
12216 }
12217
12218 if self.subdir.is_some() {
12219 return 6;
12220 }
12221
12222 if self.rights.is_some() {
12223 return 5;
12224 }
12225
12226 if self.target_name.is_some() {
12227 return 4;
12228 }
12229
12230 if self.target.is_some() {
12231 return 3;
12232 }
12233
12234 if self.source_name.is_some() {
12235 return 2;
12236 }
12237
12238 if self.source.is_some() {
12239 return 1;
12240 }
12241
12242 0
12243 }
12244 }
12245
12246 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeDirectory<'static>, ___E>
12247 for ExposeDirectory
12248 where
12249 ___E: ::fidl_next::Encoder + ?Sized,
12250 {
12251 #[inline]
12252 fn encode(
12253 mut self,
12254 encoder: &mut ___E,
12255 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeDirectory<'static>>,
12256 _: (),
12257 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12258 ::fidl_next::munge!(let crate::wire::ExposeDirectory { table } = out);
12259
12260 let max_ord = self.__max_ordinal();
12261
12262 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
12263 ::fidl_next::Wire::zero_padding(&mut out);
12264
12265 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
12266 ::fidl_next::wire::Envelope,
12267 >(encoder, max_ord);
12268
12269 for i in 1..=max_ord {
12270 match i {
12271 8 => {
12272 if let Some(value) = self.source_dictionary.take() {
12273 ::fidl_next::wire::Envelope::encode_value::<
12274 ::fidl_next::wire::String<'static>,
12275 ___E,
12276 >(
12277 value, preallocated.encoder, &mut out, 1024
12278 )?;
12279 } else {
12280 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12281 }
12282 }
12283
12284 7 => {
12285 if let Some(value) = self.availability.take() {
12286 ::fidl_next::wire::Envelope::encode_value::<
12287 crate::wire::Availability,
12288 ___E,
12289 >(
12290 value, preallocated.encoder, &mut out, ()
12291 )?;
12292 } else {
12293 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12294 }
12295 }
12296
12297 6 => {
12298 if let Some(value) = self.subdir.take() {
12299 ::fidl_next::wire::Envelope::encode_value::<
12300 ::fidl_next::wire::String<'static>,
12301 ___E,
12302 >(
12303 value, preallocated.encoder, &mut out, 1024
12304 )?;
12305 } else {
12306 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12307 }
12308 }
12309
12310 5 => {
12311 if let Some(value) = self.rights.take() {
12312 ::fidl_next::wire::Envelope::encode_value::<
12313 ::fidl_next_common_fuchsia_io::wire::Operations,
12314 ___E,
12315 >(
12316 value, preallocated.encoder, &mut out, ()
12317 )?;
12318 } else {
12319 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12320 }
12321 }
12322
12323 4 => {
12324 if let Some(value) = self.target_name.take() {
12325 ::fidl_next::wire::Envelope::encode_value::<
12326 ::fidl_next::wire::String<'static>,
12327 ___E,
12328 >(
12329 value, preallocated.encoder, &mut out, 100
12330 )?;
12331 } else {
12332 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12333 }
12334 }
12335
12336 3 => {
12337 if let Some(value) = self.target.take() {
12338 ::fidl_next::wire::Envelope::encode_value::<
12339 crate::wire::Ref<'static>,
12340 ___E,
12341 >(
12342 value, preallocated.encoder, &mut out, ()
12343 )?;
12344 } else {
12345 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12346 }
12347 }
12348
12349 2 => {
12350 if let Some(value) = self.source_name.take() {
12351 ::fidl_next::wire::Envelope::encode_value::<
12352 ::fidl_next::wire::String<'static>,
12353 ___E,
12354 >(
12355 value, preallocated.encoder, &mut out, 100
12356 )?;
12357 } else {
12358 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12359 }
12360 }
12361
12362 1 => {
12363 if let Some(value) = self.source.take() {
12364 ::fidl_next::wire::Envelope::encode_value::<
12365 crate::wire::Ref<'static>,
12366 ___E,
12367 >(
12368 value, preallocated.encoder, &mut out, ()
12369 )?;
12370 } else {
12371 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12372 }
12373 }
12374
12375 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
12376 }
12377 unsafe {
12378 preallocated.write_next(out.assume_init_ref());
12379 }
12380 }
12381
12382 ::fidl_next::wire::Table::encode_len(table, max_ord);
12383
12384 Ok(())
12385 }
12386 }
12387
12388 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeDirectory<'static>, ___E>
12389 for &'a ExposeDirectory
12390 where
12391 ___E: ::fidl_next::Encoder + ?Sized,
12392 {
12393 #[inline]
12394 fn encode(
12395 self,
12396 encoder: &mut ___E,
12397 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeDirectory<'static>>,
12398 _: (),
12399 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12400 ::fidl_next::munge!(let crate::wire::ExposeDirectory { table } = out);
12401
12402 let max_ord = self.__max_ordinal();
12403
12404 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
12405 ::fidl_next::Wire::zero_padding(&mut out);
12406
12407 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
12408 ::fidl_next::wire::Envelope,
12409 >(encoder, max_ord);
12410
12411 for i in 1..=max_ord {
12412 match i {
12413 8 => {
12414 if let Some(value) = &self.source_dictionary {
12415 ::fidl_next::wire::Envelope::encode_value::<
12416 ::fidl_next::wire::String<'static>,
12417 ___E,
12418 >(
12419 value, preallocated.encoder, &mut out, 1024
12420 )?;
12421 } else {
12422 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12423 }
12424 }
12425
12426 7 => {
12427 if let Some(value) = &self.availability {
12428 ::fidl_next::wire::Envelope::encode_value::<
12429 crate::wire::Availability,
12430 ___E,
12431 >(
12432 value, preallocated.encoder, &mut out, ()
12433 )?;
12434 } else {
12435 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12436 }
12437 }
12438
12439 6 => {
12440 if let Some(value) = &self.subdir {
12441 ::fidl_next::wire::Envelope::encode_value::<
12442 ::fidl_next::wire::String<'static>,
12443 ___E,
12444 >(
12445 value, preallocated.encoder, &mut out, 1024
12446 )?;
12447 } else {
12448 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12449 }
12450 }
12451
12452 5 => {
12453 if let Some(value) = &self.rights {
12454 ::fidl_next::wire::Envelope::encode_value::<
12455 ::fidl_next_common_fuchsia_io::wire::Operations,
12456 ___E,
12457 >(
12458 value, preallocated.encoder, &mut out, ()
12459 )?;
12460 } else {
12461 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12462 }
12463 }
12464
12465 4 => {
12466 if let Some(value) = &self.target_name {
12467 ::fidl_next::wire::Envelope::encode_value::<
12468 ::fidl_next::wire::String<'static>,
12469 ___E,
12470 >(
12471 value, preallocated.encoder, &mut out, 100
12472 )?;
12473 } else {
12474 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12475 }
12476 }
12477
12478 3 => {
12479 if let Some(value) = &self.target {
12480 ::fidl_next::wire::Envelope::encode_value::<
12481 crate::wire::Ref<'static>,
12482 ___E,
12483 >(
12484 value, preallocated.encoder, &mut out, ()
12485 )?;
12486 } else {
12487 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12488 }
12489 }
12490
12491 2 => {
12492 if let Some(value) = &self.source_name {
12493 ::fidl_next::wire::Envelope::encode_value::<
12494 ::fidl_next::wire::String<'static>,
12495 ___E,
12496 >(
12497 value, preallocated.encoder, &mut out, 100
12498 )?;
12499 } else {
12500 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12501 }
12502 }
12503
12504 1 => {
12505 if let Some(value) = &self.source {
12506 ::fidl_next::wire::Envelope::encode_value::<
12507 crate::wire::Ref<'static>,
12508 ___E,
12509 >(
12510 value, preallocated.encoder, &mut out, ()
12511 )?;
12512 } else {
12513 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12514 }
12515 }
12516
12517 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
12518 }
12519 unsafe {
12520 preallocated.write_next(out.assume_init_ref());
12521 }
12522 }
12523
12524 ::fidl_next::wire::Table::encode_len(table, max_ord);
12525
12526 Ok(())
12527 }
12528 }
12529
12530 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeDirectory<'de>> for ExposeDirectory {
12531 #[inline]
12532 fn from_wire(wire_: crate::wire::ExposeDirectory<'de>) -> Self {
12533 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
12534
12535 let source = wire_.table.get(1);
12536
12537 let source_name = wire_.table.get(2);
12538
12539 let target = wire_.table.get(3);
12540
12541 let target_name = wire_.table.get(4);
12542
12543 let rights = wire_.table.get(5);
12544
12545 let subdir = wire_.table.get(6);
12546
12547 let availability = wire_.table.get(7);
12548
12549 let source_dictionary = wire_.table.get(8);
12550
12551 Self {
12552 source: source.map(|envelope| {
12553 ::fidl_next::FromWire::from_wire(unsafe {
12554 envelope.read_unchecked::<crate::wire::Ref<'de>>()
12555 })
12556 }),
12557
12558 source_name: source_name.map(|envelope| {
12559 ::fidl_next::FromWire::from_wire(unsafe {
12560 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12561 })
12562 }),
12563
12564 target: target.map(|envelope| {
12565 ::fidl_next::FromWire::from_wire(unsafe {
12566 envelope.read_unchecked::<crate::wire::Ref<'de>>()
12567 })
12568 }),
12569
12570 target_name: target_name.map(|envelope| {
12571 ::fidl_next::FromWire::from_wire(unsafe {
12572 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12573 })
12574 }),
12575
12576 rights: rights.map(|envelope| {
12577 ::fidl_next::FromWire::from_wire(unsafe {
12578 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
12579 })
12580 }),
12581
12582 subdir: subdir.map(|envelope| {
12583 ::fidl_next::FromWire::from_wire(unsafe {
12584 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12585 })
12586 }),
12587
12588 availability: availability.map(|envelope| {
12589 ::fidl_next::FromWire::from_wire(unsafe {
12590 envelope.read_unchecked::<crate::wire::Availability>()
12591 })
12592 }),
12593
12594 source_dictionary: source_dictionary.map(|envelope| {
12595 ::fidl_next::FromWire::from_wire(unsafe {
12596 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12597 })
12598 }),
12599 }
12600 }
12601 }
12602
12603 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeDirectory<'de>> for ExposeDirectory {
12604 #[inline]
12605 fn from_wire_ref(wire: &crate::wire::ExposeDirectory<'de>) -> Self {
12606 Self {
12607 source: wire.table.get(1).map(|envelope| {
12608 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12609 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
12610 })
12611 }),
12612
12613 source_name: wire.table.get(2).map(|envelope| {
12614 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12615 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12616 })
12617 }),
12618
12619 target: wire.table.get(3).map(|envelope| {
12620 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12621 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
12622 })
12623 }),
12624
12625 target_name: wire.table.get(4).map(|envelope| {
12626 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12627 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12628 })
12629 }),
12630
12631 rights: wire.table.get(5).map(|envelope| {
12632 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12633 envelope
12634 .deref_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
12635 })
12636 }),
12637
12638 subdir: wire.table.get(6).map(|envelope| {
12639 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12640 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12641 })
12642 }),
12643
12644 availability: wire.table.get(7).map(|envelope| {
12645 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12646 envelope.deref_unchecked::<crate::wire::Availability>()
12647 })
12648 }),
12649
12650 source_dictionary: wire.table.get(8).map(|envelope| {
12651 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12652 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12653 })
12654 }),
12655 }
12656 }
12657 }
12658
12659 #[doc = " Declares a runner exposed to a component\'s containing realm, such as a\n runner exposed by the component or one of its children at runtime.\n"]
12660 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
12661 pub struct ExposeRunner {
12662 pub source: ::core::option::Option<crate::natural::Ref>,
12663
12664 pub source_name: ::core::option::Option<::std::string::String>,
12665
12666 pub target: ::core::option::Option<crate::natural::Ref>,
12667
12668 pub target_name: ::core::option::Option<::std::string::String>,
12669
12670 pub source_dictionary: ::core::option::Option<::std::string::String>,
12671 }
12672
12673 impl ExposeRunner {
12674 fn __max_ordinal(&self) -> usize {
12675 if self.source_dictionary.is_some() {
12676 return 6;
12677 }
12678
12679 if self.target_name.is_some() {
12680 return 4;
12681 }
12682
12683 if self.target.is_some() {
12684 return 3;
12685 }
12686
12687 if self.source_name.is_some() {
12688 return 2;
12689 }
12690
12691 if self.source.is_some() {
12692 return 1;
12693 }
12694
12695 0
12696 }
12697 }
12698
12699 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeRunner<'static>, ___E> for ExposeRunner
12700 where
12701 ___E: ::fidl_next::Encoder + ?Sized,
12702 {
12703 #[inline]
12704 fn encode(
12705 mut self,
12706 encoder: &mut ___E,
12707 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeRunner<'static>>,
12708 _: (),
12709 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12710 ::fidl_next::munge!(let crate::wire::ExposeRunner { table } = out);
12711
12712 let max_ord = self.__max_ordinal();
12713
12714 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
12715 ::fidl_next::Wire::zero_padding(&mut out);
12716
12717 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
12718 ::fidl_next::wire::Envelope,
12719 >(encoder, max_ord);
12720
12721 for i in 1..=max_ord {
12722 match i {
12723 6 => {
12724 if let Some(value) = self.source_dictionary.take() {
12725 ::fidl_next::wire::Envelope::encode_value::<
12726 ::fidl_next::wire::String<'static>,
12727 ___E,
12728 >(
12729 value, preallocated.encoder, &mut out, 1024
12730 )?;
12731 } else {
12732 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12733 }
12734 }
12735
12736 4 => {
12737 if let Some(value) = self.target_name.take() {
12738 ::fidl_next::wire::Envelope::encode_value::<
12739 ::fidl_next::wire::String<'static>,
12740 ___E,
12741 >(
12742 value, preallocated.encoder, &mut out, 100
12743 )?;
12744 } else {
12745 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12746 }
12747 }
12748
12749 3 => {
12750 if let Some(value) = self.target.take() {
12751 ::fidl_next::wire::Envelope::encode_value::<
12752 crate::wire::Ref<'static>,
12753 ___E,
12754 >(
12755 value, preallocated.encoder, &mut out, ()
12756 )?;
12757 } else {
12758 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12759 }
12760 }
12761
12762 2 => {
12763 if let Some(value) = self.source_name.take() {
12764 ::fidl_next::wire::Envelope::encode_value::<
12765 ::fidl_next::wire::String<'static>,
12766 ___E,
12767 >(
12768 value, preallocated.encoder, &mut out, 100
12769 )?;
12770 } else {
12771 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12772 }
12773 }
12774
12775 1 => {
12776 if let Some(value) = self.source.take() {
12777 ::fidl_next::wire::Envelope::encode_value::<
12778 crate::wire::Ref<'static>,
12779 ___E,
12780 >(
12781 value, preallocated.encoder, &mut out, ()
12782 )?;
12783 } else {
12784 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12785 }
12786 }
12787
12788 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
12789 }
12790 unsafe {
12791 preallocated.write_next(out.assume_init_ref());
12792 }
12793 }
12794
12795 ::fidl_next::wire::Table::encode_len(table, max_ord);
12796
12797 Ok(())
12798 }
12799 }
12800
12801 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeRunner<'static>, ___E>
12802 for &'a ExposeRunner
12803 where
12804 ___E: ::fidl_next::Encoder + ?Sized,
12805 {
12806 #[inline]
12807 fn encode(
12808 self,
12809 encoder: &mut ___E,
12810 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeRunner<'static>>,
12811 _: (),
12812 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12813 ::fidl_next::munge!(let crate::wire::ExposeRunner { table } = out);
12814
12815 let max_ord = self.__max_ordinal();
12816
12817 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
12818 ::fidl_next::Wire::zero_padding(&mut out);
12819
12820 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
12821 ::fidl_next::wire::Envelope,
12822 >(encoder, max_ord);
12823
12824 for i in 1..=max_ord {
12825 match i {
12826 6 => {
12827 if let Some(value) = &self.source_dictionary {
12828 ::fidl_next::wire::Envelope::encode_value::<
12829 ::fidl_next::wire::String<'static>,
12830 ___E,
12831 >(
12832 value, preallocated.encoder, &mut out, 1024
12833 )?;
12834 } else {
12835 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12836 }
12837 }
12838
12839 4 => {
12840 if let Some(value) = &self.target_name {
12841 ::fidl_next::wire::Envelope::encode_value::<
12842 ::fidl_next::wire::String<'static>,
12843 ___E,
12844 >(
12845 value, preallocated.encoder, &mut out, 100
12846 )?;
12847 } else {
12848 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12849 }
12850 }
12851
12852 3 => {
12853 if let Some(value) = &self.target {
12854 ::fidl_next::wire::Envelope::encode_value::<
12855 crate::wire::Ref<'static>,
12856 ___E,
12857 >(
12858 value, preallocated.encoder, &mut out, ()
12859 )?;
12860 } else {
12861 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12862 }
12863 }
12864
12865 2 => {
12866 if let Some(value) = &self.source_name {
12867 ::fidl_next::wire::Envelope::encode_value::<
12868 ::fidl_next::wire::String<'static>,
12869 ___E,
12870 >(
12871 value, preallocated.encoder, &mut out, 100
12872 )?;
12873 } else {
12874 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12875 }
12876 }
12877
12878 1 => {
12879 if let Some(value) = &self.source {
12880 ::fidl_next::wire::Envelope::encode_value::<
12881 crate::wire::Ref<'static>,
12882 ___E,
12883 >(
12884 value, preallocated.encoder, &mut out, ()
12885 )?;
12886 } else {
12887 ::fidl_next::wire::Envelope::encode_zero(&mut out)
12888 }
12889 }
12890
12891 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
12892 }
12893 unsafe {
12894 preallocated.write_next(out.assume_init_ref());
12895 }
12896 }
12897
12898 ::fidl_next::wire::Table::encode_len(table, max_ord);
12899
12900 Ok(())
12901 }
12902 }
12903
12904 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeRunner<'de>> for ExposeRunner {
12905 #[inline]
12906 fn from_wire(wire_: crate::wire::ExposeRunner<'de>) -> Self {
12907 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
12908
12909 let source = wire_.table.get(1);
12910
12911 let source_name = wire_.table.get(2);
12912
12913 let target = wire_.table.get(3);
12914
12915 let target_name = wire_.table.get(4);
12916
12917 let source_dictionary = wire_.table.get(6);
12918
12919 Self {
12920 source: source.map(|envelope| {
12921 ::fidl_next::FromWire::from_wire(unsafe {
12922 envelope.read_unchecked::<crate::wire::Ref<'de>>()
12923 })
12924 }),
12925
12926 source_name: source_name.map(|envelope| {
12927 ::fidl_next::FromWire::from_wire(unsafe {
12928 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12929 })
12930 }),
12931
12932 target: target.map(|envelope| {
12933 ::fidl_next::FromWire::from_wire(unsafe {
12934 envelope.read_unchecked::<crate::wire::Ref<'de>>()
12935 })
12936 }),
12937
12938 target_name: target_name.map(|envelope| {
12939 ::fidl_next::FromWire::from_wire(unsafe {
12940 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12941 })
12942 }),
12943
12944 source_dictionary: source_dictionary.map(|envelope| {
12945 ::fidl_next::FromWire::from_wire(unsafe {
12946 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
12947 })
12948 }),
12949 }
12950 }
12951 }
12952
12953 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeRunner<'de>> for ExposeRunner {
12954 #[inline]
12955 fn from_wire_ref(wire: &crate::wire::ExposeRunner<'de>) -> Self {
12956 Self {
12957 source: wire.table.get(1).map(|envelope| {
12958 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12959 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
12960 })
12961 }),
12962
12963 source_name: wire.table.get(2).map(|envelope| {
12964 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12965 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12966 })
12967 }),
12968
12969 target: wire.table.get(3).map(|envelope| {
12970 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12971 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
12972 })
12973 }),
12974
12975 target_name: wire.table.get(4).map(|envelope| {
12976 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12977 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12978 })
12979 }),
12980
12981 source_dictionary: wire.table.get(6).map(|envelope| {
12982 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12983 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
12984 })
12985 }),
12986 }
12987 }
12988 }
12989
12990 #[doc = " Declares a resolver exposed to a component\'s containing realm, such as a\n resolver exposed by the component or one of its children at runtime.\n"]
12991 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
12992 pub struct ExposeResolver {
12993 pub source: ::core::option::Option<crate::natural::Ref>,
12994
12995 pub source_name: ::core::option::Option<::std::string::String>,
12996
12997 pub target: ::core::option::Option<crate::natural::Ref>,
12998
12999 pub target_name: ::core::option::Option<::std::string::String>,
13000
13001 pub source_dictionary: ::core::option::Option<::std::string::String>,
13002 }
13003
13004 impl ExposeResolver {
13005 fn __max_ordinal(&self) -> usize {
13006 if self.source_dictionary.is_some() {
13007 return 6;
13008 }
13009
13010 if self.target_name.is_some() {
13011 return 4;
13012 }
13013
13014 if self.target.is_some() {
13015 return 3;
13016 }
13017
13018 if self.source_name.is_some() {
13019 return 2;
13020 }
13021
13022 if self.source.is_some() {
13023 return 1;
13024 }
13025
13026 0
13027 }
13028 }
13029
13030 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeResolver<'static>, ___E> for ExposeResolver
13031 where
13032 ___E: ::fidl_next::Encoder + ?Sized,
13033 {
13034 #[inline]
13035 fn encode(
13036 mut self,
13037 encoder: &mut ___E,
13038 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeResolver<'static>>,
13039 _: (),
13040 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13041 ::fidl_next::munge!(let crate::wire::ExposeResolver { table } = out);
13042
13043 let max_ord = self.__max_ordinal();
13044
13045 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
13046 ::fidl_next::Wire::zero_padding(&mut out);
13047
13048 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
13049 ::fidl_next::wire::Envelope,
13050 >(encoder, max_ord);
13051
13052 for i in 1..=max_ord {
13053 match i {
13054 6 => {
13055 if let Some(value) = self.source_dictionary.take() {
13056 ::fidl_next::wire::Envelope::encode_value::<
13057 ::fidl_next::wire::String<'static>,
13058 ___E,
13059 >(
13060 value, preallocated.encoder, &mut out, 1024
13061 )?;
13062 } else {
13063 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13064 }
13065 }
13066
13067 4 => {
13068 if let Some(value) = self.target_name.take() {
13069 ::fidl_next::wire::Envelope::encode_value::<
13070 ::fidl_next::wire::String<'static>,
13071 ___E,
13072 >(
13073 value, preallocated.encoder, &mut out, 100
13074 )?;
13075 } else {
13076 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13077 }
13078 }
13079
13080 3 => {
13081 if let Some(value) = self.target.take() {
13082 ::fidl_next::wire::Envelope::encode_value::<
13083 crate::wire::Ref<'static>,
13084 ___E,
13085 >(
13086 value, preallocated.encoder, &mut out, ()
13087 )?;
13088 } else {
13089 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13090 }
13091 }
13092
13093 2 => {
13094 if let Some(value) = self.source_name.take() {
13095 ::fidl_next::wire::Envelope::encode_value::<
13096 ::fidl_next::wire::String<'static>,
13097 ___E,
13098 >(
13099 value, preallocated.encoder, &mut out, 100
13100 )?;
13101 } else {
13102 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13103 }
13104 }
13105
13106 1 => {
13107 if let Some(value) = self.source.take() {
13108 ::fidl_next::wire::Envelope::encode_value::<
13109 crate::wire::Ref<'static>,
13110 ___E,
13111 >(
13112 value, preallocated.encoder, &mut out, ()
13113 )?;
13114 } else {
13115 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13116 }
13117 }
13118
13119 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
13120 }
13121 unsafe {
13122 preallocated.write_next(out.assume_init_ref());
13123 }
13124 }
13125
13126 ::fidl_next::wire::Table::encode_len(table, max_ord);
13127
13128 Ok(())
13129 }
13130 }
13131
13132 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeResolver<'static>, ___E>
13133 for &'a ExposeResolver
13134 where
13135 ___E: ::fidl_next::Encoder + ?Sized,
13136 {
13137 #[inline]
13138 fn encode(
13139 self,
13140 encoder: &mut ___E,
13141 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeResolver<'static>>,
13142 _: (),
13143 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13144 ::fidl_next::munge!(let crate::wire::ExposeResolver { table } = out);
13145
13146 let max_ord = self.__max_ordinal();
13147
13148 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
13149 ::fidl_next::Wire::zero_padding(&mut out);
13150
13151 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
13152 ::fidl_next::wire::Envelope,
13153 >(encoder, max_ord);
13154
13155 for i in 1..=max_ord {
13156 match i {
13157 6 => {
13158 if let Some(value) = &self.source_dictionary {
13159 ::fidl_next::wire::Envelope::encode_value::<
13160 ::fidl_next::wire::String<'static>,
13161 ___E,
13162 >(
13163 value, preallocated.encoder, &mut out, 1024
13164 )?;
13165 } else {
13166 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13167 }
13168 }
13169
13170 4 => {
13171 if let Some(value) = &self.target_name {
13172 ::fidl_next::wire::Envelope::encode_value::<
13173 ::fidl_next::wire::String<'static>,
13174 ___E,
13175 >(
13176 value, preallocated.encoder, &mut out, 100
13177 )?;
13178 } else {
13179 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13180 }
13181 }
13182
13183 3 => {
13184 if let Some(value) = &self.target {
13185 ::fidl_next::wire::Envelope::encode_value::<
13186 crate::wire::Ref<'static>,
13187 ___E,
13188 >(
13189 value, preallocated.encoder, &mut out, ()
13190 )?;
13191 } else {
13192 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13193 }
13194 }
13195
13196 2 => {
13197 if let Some(value) = &self.source_name {
13198 ::fidl_next::wire::Envelope::encode_value::<
13199 ::fidl_next::wire::String<'static>,
13200 ___E,
13201 >(
13202 value, preallocated.encoder, &mut out, 100
13203 )?;
13204 } else {
13205 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13206 }
13207 }
13208
13209 1 => {
13210 if let Some(value) = &self.source {
13211 ::fidl_next::wire::Envelope::encode_value::<
13212 crate::wire::Ref<'static>,
13213 ___E,
13214 >(
13215 value, preallocated.encoder, &mut out, ()
13216 )?;
13217 } else {
13218 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13219 }
13220 }
13221
13222 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
13223 }
13224 unsafe {
13225 preallocated.write_next(out.assume_init_ref());
13226 }
13227 }
13228
13229 ::fidl_next::wire::Table::encode_len(table, max_ord);
13230
13231 Ok(())
13232 }
13233 }
13234
13235 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeResolver<'de>> for ExposeResolver {
13236 #[inline]
13237 fn from_wire(wire_: crate::wire::ExposeResolver<'de>) -> Self {
13238 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
13239
13240 let source = wire_.table.get(1);
13241
13242 let source_name = wire_.table.get(2);
13243
13244 let target = wire_.table.get(3);
13245
13246 let target_name = wire_.table.get(4);
13247
13248 let source_dictionary = wire_.table.get(6);
13249
13250 Self {
13251 source: source.map(|envelope| {
13252 ::fidl_next::FromWire::from_wire(unsafe {
13253 envelope.read_unchecked::<crate::wire::Ref<'de>>()
13254 })
13255 }),
13256
13257 source_name: source_name.map(|envelope| {
13258 ::fidl_next::FromWire::from_wire(unsafe {
13259 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
13260 })
13261 }),
13262
13263 target: target.map(|envelope| {
13264 ::fidl_next::FromWire::from_wire(unsafe {
13265 envelope.read_unchecked::<crate::wire::Ref<'de>>()
13266 })
13267 }),
13268
13269 target_name: target_name.map(|envelope| {
13270 ::fidl_next::FromWire::from_wire(unsafe {
13271 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
13272 })
13273 }),
13274
13275 source_dictionary: source_dictionary.map(|envelope| {
13276 ::fidl_next::FromWire::from_wire(unsafe {
13277 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
13278 })
13279 }),
13280 }
13281 }
13282 }
13283
13284 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeResolver<'de>> for ExposeResolver {
13285 #[inline]
13286 fn from_wire_ref(wire: &crate::wire::ExposeResolver<'de>) -> Self {
13287 Self {
13288 source: wire.table.get(1).map(|envelope| {
13289 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13290 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
13291 })
13292 }),
13293
13294 source_name: wire.table.get(2).map(|envelope| {
13295 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13296 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
13297 })
13298 }),
13299
13300 target: wire.table.get(3).map(|envelope| {
13301 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13302 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
13303 })
13304 }),
13305
13306 target_name: wire.table.get(4).map(|envelope| {
13307 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13308 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
13309 })
13310 }),
13311
13312 source_dictionary: wire.table.get(6).map(|envelope| {
13313 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13314 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
13315 })
13316 }),
13317 }
13318 }
13319 }
13320
13321 #[doc = " Declares a dictionary exposed to a component\'s containing realm, such as\n a dictionary exposed by the component or one of its children at runtime.\n\n To learn more about dictionarys, see:\n https://fuchsia.dev/fuchsia-src/glossary#dictionary\n"]
13322 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
13323 pub struct ExposeDictionary {
13324 pub source: ::core::option::Option<crate::natural::Ref>,
13325
13326 pub source_name: ::core::option::Option<::std::string::String>,
13327
13328 pub target: ::core::option::Option<crate::natural::Ref>,
13329
13330 pub target_name: ::core::option::Option<::std::string::String>,
13331
13332 pub availability: ::core::option::Option<crate::natural::Availability>,
13333
13334 pub source_dictionary: ::core::option::Option<::std::string::String>,
13335 }
13336
13337 impl ExposeDictionary {
13338 fn __max_ordinal(&self) -> usize {
13339 if self.source_dictionary.is_some() {
13340 return 6;
13341 }
13342
13343 if self.availability.is_some() {
13344 return 5;
13345 }
13346
13347 if self.target_name.is_some() {
13348 return 4;
13349 }
13350
13351 if self.target.is_some() {
13352 return 3;
13353 }
13354
13355 if self.source_name.is_some() {
13356 return 2;
13357 }
13358
13359 if self.source.is_some() {
13360 return 1;
13361 }
13362
13363 0
13364 }
13365 }
13366
13367 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeDictionary<'static>, ___E>
13368 for ExposeDictionary
13369 where
13370 ___E: ::fidl_next::Encoder + ?Sized,
13371 {
13372 #[inline]
13373 fn encode(
13374 mut self,
13375 encoder: &mut ___E,
13376 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeDictionary<'static>>,
13377 _: (),
13378 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13379 ::fidl_next::munge!(let crate::wire::ExposeDictionary { table } = out);
13380
13381 let max_ord = self.__max_ordinal();
13382
13383 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
13384 ::fidl_next::Wire::zero_padding(&mut out);
13385
13386 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
13387 ::fidl_next::wire::Envelope,
13388 >(encoder, max_ord);
13389
13390 for i in 1..=max_ord {
13391 match i {
13392 6 => {
13393 if let Some(value) = self.source_dictionary.take() {
13394 ::fidl_next::wire::Envelope::encode_value::<
13395 ::fidl_next::wire::String<'static>,
13396 ___E,
13397 >(
13398 value, preallocated.encoder, &mut out, 1024
13399 )?;
13400 } else {
13401 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13402 }
13403 }
13404
13405 5 => {
13406 if let Some(value) = self.availability.take() {
13407 ::fidl_next::wire::Envelope::encode_value::<
13408 crate::wire::Availability,
13409 ___E,
13410 >(
13411 value, preallocated.encoder, &mut out, ()
13412 )?;
13413 } else {
13414 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13415 }
13416 }
13417
13418 4 => {
13419 if let Some(value) = self.target_name.take() {
13420 ::fidl_next::wire::Envelope::encode_value::<
13421 ::fidl_next::wire::String<'static>,
13422 ___E,
13423 >(
13424 value, preallocated.encoder, &mut out, 100
13425 )?;
13426 } else {
13427 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13428 }
13429 }
13430
13431 3 => {
13432 if let Some(value) = self.target.take() {
13433 ::fidl_next::wire::Envelope::encode_value::<
13434 crate::wire::Ref<'static>,
13435 ___E,
13436 >(
13437 value, preallocated.encoder, &mut out, ()
13438 )?;
13439 } else {
13440 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13441 }
13442 }
13443
13444 2 => {
13445 if let Some(value) = self.source_name.take() {
13446 ::fidl_next::wire::Envelope::encode_value::<
13447 ::fidl_next::wire::String<'static>,
13448 ___E,
13449 >(
13450 value, preallocated.encoder, &mut out, 100
13451 )?;
13452 } else {
13453 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13454 }
13455 }
13456
13457 1 => {
13458 if let Some(value) = self.source.take() {
13459 ::fidl_next::wire::Envelope::encode_value::<
13460 crate::wire::Ref<'static>,
13461 ___E,
13462 >(
13463 value, preallocated.encoder, &mut out, ()
13464 )?;
13465 } else {
13466 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13467 }
13468 }
13469
13470 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
13471 }
13472 unsafe {
13473 preallocated.write_next(out.assume_init_ref());
13474 }
13475 }
13476
13477 ::fidl_next::wire::Table::encode_len(table, max_ord);
13478
13479 Ok(())
13480 }
13481 }
13482
13483 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeDictionary<'static>, ___E>
13484 for &'a ExposeDictionary
13485 where
13486 ___E: ::fidl_next::Encoder + ?Sized,
13487 {
13488 #[inline]
13489 fn encode(
13490 self,
13491 encoder: &mut ___E,
13492 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeDictionary<'static>>,
13493 _: (),
13494 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13495 ::fidl_next::munge!(let crate::wire::ExposeDictionary { table } = out);
13496
13497 let max_ord = self.__max_ordinal();
13498
13499 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
13500 ::fidl_next::Wire::zero_padding(&mut out);
13501
13502 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
13503 ::fidl_next::wire::Envelope,
13504 >(encoder, max_ord);
13505
13506 for i in 1..=max_ord {
13507 match i {
13508 6 => {
13509 if let Some(value) = &self.source_dictionary {
13510 ::fidl_next::wire::Envelope::encode_value::<
13511 ::fidl_next::wire::String<'static>,
13512 ___E,
13513 >(
13514 value, preallocated.encoder, &mut out, 1024
13515 )?;
13516 } else {
13517 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13518 }
13519 }
13520
13521 5 => {
13522 if let Some(value) = &self.availability {
13523 ::fidl_next::wire::Envelope::encode_value::<
13524 crate::wire::Availability,
13525 ___E,
13526 >(
13527 value, preallocated.encoder, &mut out, ()
13528 )?;
13529 } else {
13530 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13531 }
13532 }
13533
13534 4 => {
13535 if let Some(value) = &self.target_name {
13536 ::fidl_next::wire::Envelope::encode_value::<
13537 ::fidl_next::wire::String<'static>,
13538 ___E,
13539 >(
13540 value, preallocated.encoder, &mut out, 100
13541 )?;
13542 } else {
13543 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13544 }
13545 }
13546
13547 3 => {
13548 if let Some(value) = &self.target {
13549 ::fidl_next::wire::Envelope::encode_value::<
13550 crate::wire::Ref<'static>,
13551 ___E,
13552 >(
13553 value, preallocated.encoder, &mut out, ()
13554 )?;
13555 } else {
13556 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13557 }
13558 }
13559
13560 2 => {
13561 if let Some(value) = &self.source_name {
13562 ::fidl_next::wire::Envelope::encode_value::<
13563 ::fidl_next::wire::String<'static>,
13564 ___E,
13565 >(
13566 value, preallocated.encoder, &mut out, 100
13567 )?;
13568 } else {
13569 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13570 }
13571 }
13572
13573 1 => {
13574 if let Some(value) = &self.source {
13575 ::fidl_next::wire::Envelope::encode_value::<
13576 crate::wire::Ref<'static>,
13577 ___E,
13578 >(
13579 value, preallocated.encoder, &mut out, ()
13580 )?;
13581 } else {
13582 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13583 }
13584 }
13585
13586 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
13587 }
13588 unsafe {
13589 preallocated.write_next(out.assume_init_ref());
13590 }
13591 }
13592
13593 ::fidl_next::wire::Table::encode_len(table, max_ord);
13594
13595 Ok(())
13596 }
13597 }
13598
13599 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeDictionary<'de>> for ExposeDictionary {
13600 #[inline]
13601 fn from_wire(wire_: crate::wire::ExposeDictionary<'de>) -> Self {
13602 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
13603
13604 let source = wire_.table.get(1);
13605
13606 let source_name = wire_.table.get(2);
13607
13608 let target = wire_.table.get(3);
13609
13610 let target_name = wire_.table.get(4);
13611
13612 let availability = wire_.table.get(5);
13613
13614 let source_dictionary = wire_.table.get(6);
13615
13616 Self {
13617 source: source.map(|envelope| {
13618 ::fidl_next::FromWire::from_wire(unsafe {
13619 envelope.read_unchecked::<crate::wire::Ref<'de>>()
13620 })
13621 }),
13622
13623 source_name: source_name.map(|envelope| {
13624 ::fidl_next::FromWire::from_wire(unsafe {
13625 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
13626 })
13627 }),
13628
13629 target: target.map(|envelope| {
13630 ::fidl_next::FromWire::from_wire(unsafe {
13631 envelope.read_unchecked::<crate::wire::Ref<'de>>()
13632 })
13633 }),
13634
13635 target_name: target_name.map(|envelope| {
13636 ::fidl_next::FromWire::from_wire(unsafe {
13637 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
13638 })
13639 }),
13640
13641 availability: availability.map(|envelope| {
13642 ::fidl_next::FromWire::from_wire(unsafe {
13643 envelope.read_unchecked::<crate::wire::Availability>()
13644 })
13645 }),
13646
13647 source_dictionary: source_dictionary.map(|envelope| {
13648 ::fidl_next::FromWire::from_wire(unsafe {
13649 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
13650 })
13651 }),
13652 }
13653 }
13654 }
13655
13656 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeDictionary<'de>> for ExposeDictionary {
13657 #[inline]
13658 fn from_wire_ref(wire: &crate::wire::ExposeDictionary<'de>) -> Self {
13659 Self {
13660 source: wire.table.get(1).map(|envelope| {
13661 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13662 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
13663 })
13664 }),
13665
13666 source_name: wire.table.get(2).map(|envelope| {
13667 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13668 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
13669 })
13670 }),
13671
13672 target: wire.table.get(3).map(|envelope| {
13673 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13674 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
13675 })
13676 }),
13677
13678 target_name: wire.table.get(4).map(|envelope| {
13679 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13680 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
13681 })
13682 }),
13683
13684 availability: wire.table.get(5).map(|envelope| {
13685 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13686 envelope.deref_unchecked::<crate::wire::Availability>()
13687 })
13688 }),
13689
13690 source_dictionary: wire.table.get(6).map(|envelope| {
13691 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13692 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
13693 })
13694 }),
13695 }
13696 }
13697 }
13698
13699 #[doc = " Declares a configuration capability exposed to a component\'s containing realm, such as\n a capability exposed by the component or one of its children at runtime.\n"]
13700 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
13701 pub struct ExposeConfiguration {
13702 pub source: ::core::option::Option<crate::natural::Ref>,
13703
13704 pub source_name: ::core::option::Option<::std::string::String>,
13705
13706 pub target: ::core::option::Option<crate::natural::Ref>,
13707
13708 pub target_name: ::core::option::Option<::std::string::String>,
13709
13710 pub availability: ::core::option::Option<crate::natural::Availability>,
13711
13712 pub source_dictionary: ::core::option::Option<::std::string::String>,
13713 }
13714
13715 impl ExposeConfiguration {
13716 fn __max_ordinal(&self) -> usize {
13717 if self.source_dictionary.is_some() {
13718 return 6;
13719 }
13720
13721 if self.availability.is_some() {
13722 return 5;
13723 }
13724
13725 if self.target_name.is_some() {
13726 return 4;
13727 }
13728
13729 if self.target.is_some() {
13730 return 3;
13731 }
13732
13733 if self.source_name.is_some() {
13734 return 2;
13735 }
13736
13737 if self.source.is_some() {
13738 return 1;
13739 }
13740
13741 0
13742 }
13743 }
13744
13745 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeConfiguration<'static>, ___E>
13746 for ExposeConfiguration
13747 where
13748 ___E: ::fidl_next::Encoder + ?Sized,
13749 {
13750 #[inline]
13751 fn encode(
13752 mut self,
13753 encoder: &mut ___E,
13754 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeConfiguration<'static>>,
13755 _: (),
13756 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13757 ::fidl_next::munge!(let crate::wire::ExposeConfiguration { table } = out);
13758
13759 let max_ord = self.__max_ordinal();
13760
13761 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
13762 ::fidl_next::Wire::zero_padding(&mut out);
13763
13764 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
13765 ::fidl_next::wire::Envelope,
13766 >(encoder, max_ord);
13767
13768 for i in 1..=max_ord {
13769 match i {
13770 6 => {
13771 if let Some(value) = self.source_dictionary.take() {
13772 ::fidl_next::wire::Envelope::encode_value::<
13773 ::fidl_next::wire::String<'static>,
13774 ___E,
13775 >(
13776 value, preallocated.encoder, &mut out, 1024
13777 )?;
13778 } else {
13779 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13780 }
13781 }
13782
13783 5 => {
13784 if let Some(value) = self.availability.take() {
13785 ::fidl_next::wire::Envelope::encode_value::<
13786 crate::wire::Availability,
13787 ___E,
13788 >(
13789 value, preallocated.encoder, &mut out, ()
13790 )?;
13791 } else {
13792 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13793 }
13794 }
13795
13796 4 => {
13797 if let Some(value) = self.target_name.take() {
13798 ::fidl_next::wire::Envelope::encode_value::<
13799 ::fidl_next::wire::String<'static>,
13800 ___E,
13801 >(
13802 value, preallocated.encoder, &mut out, 100
13803 )?;
13804 } else {
13805 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13806 }
13807 }
13808
13809 3 => {
13810 if let Some(value) = self.target.take() {
13811 ::fidl_next::wire::Envelope::encode_value::<
13812 crate::wire::Ref<'static>,
13813 ___E,
13814 >(
13815 value, preallocated.encoder, &mut out, ()
13816 )?;
13817 } else {
13818 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13819 }
13820 }
13821
13822 2 => {
13823 if let Some(value) = self.source_name.take() {
13824 ::fidl_next::wire::Envelope::encode_value::<
13825 ::fidl_next::wire::String<'static>,
13826 ___E,
13827 >(
13828 value, preallocated.encoder, &mut out, 100
13829 )?;
13830 } else {
13831 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13832 }
13833 }
13834
13835 1 => {
13836 if let Some(value) = self.source.take() {
13837 ::fidl_next::wire::Envelope::encode_value::<
13838 crate::wire::Ref<'static>,
13839 ___E,
13840 >(
13841 value, preallocated.encoder, &mut out, ()
13842 )?;
13843 } else {
13844 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13845 }
13846 }
13847
13848 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
13849 }
13850 unsafe {
13851 preallocated.write_next(out.assume_init_ref());
13852 }
13853 }
13854
13855 ::fidl_next::wire::Table::encode_len(table, max_ord);
13856
13857 Ok(())
13858 }
13859 }
13860
13861 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeConfiguration<'static>, ___E>
13862 for &'a ExposeConfiguration
13863 where
13864 ___E: ::fidl_next::Encoder + ?Sized,
13865 {
13866 #[inline]
13867 fn encode(
13868 self,
13869 encoder: &mut ___E,
13870 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeConfiguration<'static>>,
13871 _: (),
13872 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13873 ::fidl_next::munge!(let crate::wire::ExposeConfiguration { table } = out);
13874
13875 let max_ord = self.__max_ordinal();
13876
13877 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
13878 ::fidl_next::Wire::zero_padding(&mut out);
13879
13880 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
13881 ::fidl_next::wire::Envelope,
13882 >(encoder, max_ord);
13883
13884 for i in 1..=max_ord {
13885 match i {
13886 6 => {
13887 if let Some(value) = &self.source_dictionary {
13888 ::fidl_next::wire::Envelope::encode_value::<
13889 ::fidl_next::wire::String<'static>,
13890 ___E,
13891 >(
13892 value, preallocated.encoder, &mut out, 1024
13893 )?;
13894 } else {
13895 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13896 }
13897 }
13898
13899 5 => {
13900 if let Some(value) = &self.availability {
13901 ::fidl_next::wire::Envelope::encode_value::<
13902 crate::wire::Availability,
13903 ___E,
13904 >(
13905 value, preallocated.encoder, &mut out, ()
13906 )?;
13907 } else {
13908 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13909 }
13910 }
13911
13912 4 => {
13913 if let Some(value) = &self.target_name {
13914 ::fidl_next::wire::Envelope::encode_value::<
13915 ::fidl_next::wire::String<'static>,
13916 ___E,
13917 >(
13918 value, preallocated.encoder, &mut out, 100
13919 )?;
13920 } else {
13921 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13922 }
13923 }
13924
13925 3 => {
13926 if let Some(value) = &self.target {
13927 ::fidl_next::wire::Envelope::encode_value::<
13928 crate::wire::Ref<'static>,
13929 ___E,
13930 >(
13931 value, preallocated.encoder, &mut out, ()
13932 )?;
13933 } else {
13934 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13935 }
13936 }
13937
13938 2 => {
13939 if let Some(value) = &self.source_name {
13940 ::fidl_next::wire::Envelope::encode_value::<
13941 ::fidl_next::wire::String<'static>,
13942 ___E,
13943 >(
13944 value, preallocated.encoder, &mut out, 100
13945 )?;
13946 } else {
13947 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13948 }
13949 }
13950
13951 1 => {
13952 if let Some(value) = &self.source {
13953 ::fidl_next::wire::Envelope::encode_value::<
13954 crate::wire::Ref<'static>,
13955 ___E,
13956 >(
13957 value, preallocated.encoder, &mut out, ()
13958 )?;
13959 } else {
13960 ::fidl_next::wire::Envelope::encode_zero(&mut out)
13961 }
13962 }
13963
13964 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
13965 }
13966 unsafe {
13967 preallocated.write_next(out.assume_init_ref());
13968 }
13969 }
13970
13971 ::fidl_next::wire::Table::encode_len(table, max_ord);
13972
13973 Ok(())
13974 }
13975 }
13976
13977 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeConfiguration<'de>> for ExposeConfiguration {
13978 #[inline]
13979 fn from_wire(wire_: crate::wire::ExposeConfiguration<'de>) -> Self {
13980 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
13981
13982 let source = wire_.table.get(1);
13983
13984 let source_name = wire_.table.get(2);
13985
13986 let target = wire_.table.get(3);
13987
13988 let target_name = wire_.table.get(4);
13989
13990 let availability = wire_.table.get(5);
13991
13992 let source_dictionary = wire_.table.get(6);
13993
13994 Self {
13995 source: source.map(|envelope| {
13996 ::fidl_next::FromWire::from_wire(unsafe {
13997 envelope.read_unchecked::<crate::wire::Ref<'de>>()
13998 })
13999 }),
14000
14001 source_name: source_name.map(|envelope| {
14002 ::fidl_next::FromWire::from_wire(unsafe {
14003 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
14004 })
14005 }),
14006
14007 target: target.map(|envelope| {
14008 ::fidl_next::FromWire::from_wire(unsafe {
14009 envelope.read_unchecked::<crate::wire::Ref<'de>>()
14010 })
14011 }),
14012
14013 target_name: target_name.map(|envelope| {
14014 ::fidl_next::FromWire::from_wire(unsafe {
14015 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
14016 })
14017 }),
14018
14019 availability: availability.map(|envelope| {
14020 ::fidl_next::FromWire::from_wire(unsafe {
14021 envelope.read_unchecked::<crate::wire::Availability>()
14022 })
14023 }),
14024
14025 source_dictionary: source_dictionary.map(|envelope| {
14026 ::fidl_next::FromWire::from_wire(unsafe {
14027 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
14028 })
14029 }),
14030 }
14031 }
14032 }
14033
14034 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeConfiguration<'de>> for ExposeConfiguration {
14035 #[inline]
14036 fn from_wire_ref(wire: &crate::wire::ExposeConfiguration<'de>) -> Self {
14037 Self {
14038 source: wire.table.get(1).map(|envelope| {
14039 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14040 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
14041 })
14042 }),
14043
14044 source_name: wire.table.get(2).map(|envelope| {
14045 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14046 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
14047 })
14048 }),
14049
14050 target: wire.table.get(3).map(|envelope| {
14051 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14052 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
14053 })
14054 }),
14055
14056 target_name: wire.table.get(4).map(|envelope| {
14057 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14058 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
14059 })
14060 }),
14061
14062 availability: wire.table.get(5).map(|envelope| {
14063 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14064 envelope.deref_unchecked::<crate::wire::Availability>()
14065 })
14066 }),
14067
14068 source_dictionary: wire.table.get(6).map(|envelope| {
14069 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
14070 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
14071 })
14072 }),
14073 }
14074 }
14075 }
14076
14077 #[doc = " Declares a capability exposed to either a component\'s containing realm or to\n the framework. For example, a legacy service exposed by the component at\n runtime.\n"]
14078 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
14079 pub enum Expose {
14080 Service(crate::natural::ExposeService),
14081
14082 Protocol(crate::natural::ExposeProtocol),
14083
14084 Directory(crate::natural::ExposeDirectory),
14085
14086 Runner(crate::natural::ExposeRunner),
14087
14088 Resolver(crate::natural::ExposeResolver),
14089
14090 Dictionary(crate::natural::ExposeDictionary),
14091
14092 Config(crate::natural::ExposeConfiguration),
14093
14094 UnknownOrdinal_(u64),
14095 }
14096
14097 impl Expose {
14098 pub fn is_unknown(&self) -> bool {
14099 #[allow(unreachable_patterns)]
14100 match self {
14101 Self::UnknownOrdinal_(_) => true,
14102 _ => false,
14103 }
14104 }
14105 }
14106
14107 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Expose<'static>, ___E> for Expose
14108 where
14109 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14110 ___E: ::fidl_next::Encoder,
14111 {
14112 #[inline]
14113 fn encode(
14114 self,
14115 encoder: &mut ___E,
14116 out: &mut ::core::mem::MaybeUninit<crate::wire::Expose<'static>>,
14117 _: (),
14118 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14119 ::fidl_next::munge!(let crate::wire::Expose { raw, _phantom: _ } = out);
14120
14121 match self {
14122 Self::Service(value) => ::fidl_next::wire::Union::encode_as::<
14123 ___E,
14124 crate::wire::ExposeService<'static>,
14125 >(value, 1, encoder, raw, ())?,
14126
14127 Self::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
14128 ___E,
14129 crate::wire::ExposeProtocol<'static>,
14130 >(value, 2, encoder, raw, ())?,
14131
14132 Self::Directory(value) => ::fidl_next::wire::Union::encode_as::<
14133 ___E,
14134 crate::wire::ExposeDirectory<'static>,
14135 >(value, 3, encoder, raw, ())?,
14136
14137 Self::Runner(value) => ::fidl_next::wire::Union::encode_as::<
14138 ___E,
14139 crate::wire::ExposeRunner<'static>,
14140 >(value, 4, encoder, raw, ())?,
14141
14142 Self::Resolver(value) => ::fidl_next::wire::Union::encode_as::<
14143 ___E,
14144 crate::wire::ExposeResolver<'static>,
14145 >(value, 5, encoder, raw, ())?,
14146
14147 Self::Dictionary(value) => ::fidl_next::wire::Union::encode_as::<
14148 ___E,
14149 crate::wire::ExposeDictionary<'static>,
14150 >(value, 7, encoder, raw, ())?,
14151
14152 Self::Config(value) => ::fidl_next::wire::Union::encode_as::<
14153 ___E,
14154 crate::wire::ExposeConfiguration<'static>,
14155 >(value, 8, encoder, raw, ())?,
14156
14157 Self::UnknownOrdinal_(ordinal) => {
14158 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
14159 }
14160 }
14161
14162 Ok(())
14163 }
14164 }
14165
14166 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Expose<'static>, ___E> for &'a Expose
14167 where
14168 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
14169 ___E: ::fidl_next::Encoder,
14170 {
14171 #[inline]
14172 fn encode(
14173 self,
14174 encoder: &mut ___E,
14175 out: &mut ::core::mem::MaybeUninit<crate::wire::Expose<'static>>,
14176 _: (),
14177 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14178 ::fidl_next::munge!(let crate::wire::Expose { raw, _phantom: _ } = out);
14179
14180 match self {
14181 Expose::Service(value) => ::fidl_next::wire::Union::encode_as::<
14182 ___E,
14183 crate::wire::ExposeService<'static>,
14184 >(value, 1, encoder, raw, ())?,
14185
14186 Expose::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
14187 ___E,
14188 crate::wire::ExposeProtocol<'static>,
14189 >(value, 2, encoder, raw, ())?,
14190
14191 Expose::Directory(value) => ::fidl_next::wire::Union::encode_as::<
14192 ___E,
14193 crate::wire::ExposeDirectory<'static>,
14194 >(value, 3, encoder, raw, ())?,
14195
14196 Expose::Runner(value) => ::fidl_next::wire::Union::encode_as::<
14197 ___E,
14198 crate::wire::ExposeRunner<'static>,
14199 >(value, 4, encoder, raw, ())?,
14200
14201 Expose::Resolver(value) => ::fidl_next::wire::Union::encode_as::<
14202 ___E,
14203 crate::wire::ExposeResolver<'static>,
14204 >(value, 5, encoder, raw, ())?,
14205
14206 Expose::Dictionary(value) => ::fidl_next::wire::Union::encode_as::<
14207 ___E,
14208 crate::wire::ExposeDictionary<'static>,
14209 >(value, 7, encoder, raw, ())?,
14210
14211 Expose::Config(value) => ::fidl_next::wire::Union::encode_as::<
14212 ___E,
14213 crate::wire::ExposeConfiguration<'static>,
14214 >(value, 8, encoder, raw, ())?,
14215
14216 Expose::UnknownOrdinal_(ordinal) => {
14217 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
14218 }
14219 }
14220
14221 Ok(())
14222 }
14223 }
14224
14225 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::Expose<'static>, ___E> for Expose
14226 where
14227 ___E: ?Sized,
14228 Expose: ::fidl_next::Encode<crate::wire::Expose<'static>, ___E>,
14229 {
14230 #[inline]
14231 fn encode_option(
14232 this: ::core::option::Option<Self>,
14233 encoder: &mut ___E,
14234 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Expose<'static>>,
14235 _: (),
14236 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14237 ::fidl_next::munge!(let crate::wire_optional::Expose { raw, _phantom: _ } = &mut *out);
14238
14239 if let Some(inner) = this {
14240 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
14241 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
14242 } else {
14243 ::fidl_next::wire::Union::encode_absent(raw);
14244 }
14245
14246 Ok(())
14247 }
14248 }
14249
14250 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::Expose<'static>, ___E>
14251 for &'a Expose
14252 where
14253 ___E: ?Sized,
14254 &'a Expose: ::fidl_next::Encode<crate::wire::Expose<'static>, ___E>,
14255 {
14256 #[inline]
14257 fn encode_option(
14258 this: ::core::option::Option<Self>,
14259 encoder: &mut ___E,
14260 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Expose<'static>>,
14261 _: (),
14262 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14263 ::fidl_next::munge!(let crate::wire_optional::Expose { raw, _phantom: _ } = &mut *out);
14264
14265 if let Some(inner) = this {
14266 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
14267 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
14268 } else {
14269 ::fidl_next::wire::Union::encode_absent(raw);
14270 }
14271
14272 Ok(())
14273 }
14274 }
14275
14276 impl<'de> ::fidl_next::FromWire<crate::wire::Expose<'de>> for Expose {
14277 #[inline]
14278 fn from_wire(wire: crate::wire::Expose<'de>) -> Self {
14279 let wire = ::core::mem::ManuallyDrop::new(wire);
14280 match wire.raw.ordinal() {
14281 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
14282 wire.raw.get().read_unchecked::<crate::wire::ExposeService<'de>>()
14283 })),
14284
14285 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
14286 wire.raw.get().read_unchecked::<crate::wire::ExposeProtocol<'de>>()
14287 })),
14288
14289 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
14290 wire.raw.get().read_unchecked::<crate::wire::ExposeDirectory<'de>>()
14291 })),
14292
14293 4 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
14294 wire.raw.get().read_unchecked::<crate::wire::ExposeRunner<'de>>()
14295 })),
14296
14297 5 => Self::Resolver(::fidl_next::FromWire::from_wire(unsafe {
14298 wire.raw.get().read_unchecked::<crate::wire::ExposeResolver<'de>>()
14299 })),
14300
14301 7 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
14302 wire.raw.get().read_unchecked::<crate::wire::ExposeDictionary<'de>>()
14303 })),
14304
14305 8 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
14306 wire.raw.get().read_unchecked::<crate::wire::ExposeConfiguration<'de>>()
14307 })),
14308
14309 ord => return Self::UnknownOrdinal_(ord as u64),
14310 }
14311 }
14312 }
14313
14314 impl<'de> ::fidl_next::FromWireRef<crate::wire::Expose<'de>> for Expose {
14315 #[inline]
14316 fn from_wire_ref(wire: &crate::wire::Expose<'de>) -> Self {
14317 match wire.raw.ordinal() {
14318 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
14319 wire.raw.get().deref_unchecked::<crate::wire::ExposeService<'de>>()
14320 })),
14321
14322 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
14323 wire.raw.get().deref_unchecked::<crate::wire::ExposeProtocol<'de>>()
14324 })),
14325
14326 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
14327 wire.raw.get().deref_unchecked::<crate::wire::ExposeDirectory<'de>>()
14328 })),
14329
14330 4 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
14331 wire.raw.get().deref_unchecked::<crate::wire::ExposeRunner<'de>>()
14332 })),
14333
14334 5 => Self::Resolver(::fidl_next::FromWireRef::from_wire_ref(unsafe {
14335 wire.raw.get().deref_unchecked::<crate::wire::ExposeResolver<'de>>()
14336 })),
14337
14338 7 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
14339 wire.raw.get().deref_unchecked::<crate::wire::ExposeDictionary<'de>>()
14340 })),
14341
14342 8 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
14343 wire.raw.get().deref_unchecked::<crate::wire::ExposeConfiguration<'de>>()
14344 })),
14345
14346 ord => return Self::UnknownOrdinal_(ord as u64),
14347 }
14348 }
14349 }
14350
14351 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Expose<'de>> for Expose {
14352 #[inline]
14353 fn from_wire_option(
14354 wire: crate::wire_optional::Expose<'de>,
14355 ) -> ::core::option::Option<Self> {
14356 if let Some(inner) = wire.into_option() {
14357 Some(::fidl_next::FromWire::from_wire(inner))
14358 } else {
14359 None
14360 }
14361 }
14362 }
14363
14364 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Expose<'de>> for Box<Expose> {
14365 #[inline]
14366 fn from_wire_option(
14367 wire: crate::wire_optional::Expose<'de>,
14368 ) -> ::core::option::Option<Self> {
14369 <
14370 Expose as ::fidl_next::FromWireOption<crate::wire_optional::Expose<'de>>
14371 >::from_wire_option(wire).map(Box::new)
14372 }
14373 }
14374
14375 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::Expose<'de>> for Box<Expose> {
14376 #[inline]
14377 fn from_wire_option_ref(
14378 wire: &crate::wire_optional::Expose<'de>,
14379 ) -> ::core::option::Option<Self> {
14380 if let Some(inner) = wire.as_ref() {
14381 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
14382 } else {
14383 None
14384 }
14385 }
14386 }
14387
14388 #[doc = " Declares a service offered by a component to one of its children, which may\n have been offered by the component\'s containing realm, the component itself,\n or one of its other children.\n\n To learn more about services, see:\n https://fuchsia.dev/fuchsia-src/glossary#service\n"]
14389 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
14390 pub struct OfferService {
14391 pub source: ::core::option::Option<crate::natural::Ref>,
14392
14393 pub source_name: ::core::option::Option<::std::string::String>,
14394
14395 pub target: ::core::option::Option<crate::natural::Ref>,
14396
14397 pub target_name: ::core::option::Option<::std::string::String>,
14398
14399 pub source_instance_filter: ::core::option::Option<::std::vec::Vec<::std::string::String>>,
14400
14401 pub renamed_instances: ::core::option::Option<::std::vec::Vec<crate::natural::NameMapping>>,
14402
14403 pub availability: ::core::option::Option<crate::natural::Availability>,
14404
14405 pub source_dictionary: ::core::option::Option<::std::string::String>,
14406
14407 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
14408 }
14409
14410 impl OfferService {
14411 fn __max_ordinal(&self) -> usize {
14412 if self.dependency_type.is_some() {
14413 return 9;
14414 }
14415
14416 if self.source_dictionary.is_some() {
14417 return 8;
14418 }
14419
14420 if self.availability.is_some() {
14421 return 7;
14422 }
14423
14424 if self.renamed_instances.is_some() {
14425 return 6;
14426 }
14427
14428 if self.source_instance_filter.is_some() {
14429 return 5;
14430 }
14431
14432 if self.target_name.is_some() {
14433 return 4;
14434 }
14435
14436 if self.target.is_some() {
14437 return 3;
14438 }
14439
14440 if self.source_name.is_some() {
14441 return 2;
14442 }
14443
14444 if self.source.is_some() {
14445 return 1;
14446 }
14447
14448 0
14449 }
14450 }
14451
14452 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferService<'static>, ___E> for OfferService
14453 where
14454 ___E: ::fidl_next::Encoder + ?Sized,
14455 {
14456 #[inline]
14457 fn encode(
14458 mut self,
14459 encoder: &mut ___E,
14460 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferService<'static>>,
14461 _: (),
14462 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14463 ::fidl_next::munge!(let crate::wire::OfferService { table } = out);
14464
14465 let max_ord = self.__max_ordinal();
14466
14467 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
14468 ::fidl_next::Wire::zero_padding(&mut out);
14469
14470 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
14471 ::fidl_next::wire::Envelope,
14472 >(encoder, max_ord);
14473
14474 for i in 1..=max_ord {
14475 match i {
14476 9 => {
14477 if let Some(value) = self.dependency_type.take() {
14478 ::fidl_next::wire::Envelope::encode_value::<
14479 crate::wire::DependencyType,
14480 ___E,
14481 >(
14482 value, preallocated.encoder, &mut out, ()
14483 )?;
14484 } else {
14485 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14486 }
14487 }
14488
14489 8 => {
14490 if let Some(value) = self.source_dictionary.take() {
14491 ::fidl_next::wire::Envelope::encode_value::<
14492 ::fidl_next::wire::String<'static>,
14493 ___E,
14494 >(
14495 value, preallocated.encoder, &mut out, 1024
14496 )?;
14497 } else {
14498 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14499 }
14500 }
14501
14502 7 => {
14503 if let Some(value) = self.availability.take() {
14504 ::fidl_next::wire::Envelope::encode_value::<
14505 crate::wire::Availability,
14506 ___E,
14507 >(
14508 value, preallocated.encoder, &mut out, ()
14509 )?;
14510 } else {
14511 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14512 }
14513 }
14514
14515 6 => {
14516 if let Some(value) = self.renamed_instances.take() {
14517 ::fidl_next::wire::Envelope::encode_value::<
14518 ::fidl_next::wire::Vector<
14519 'static,
14520 crate::wire::NameMapping<'static>,
14521 >,
14522 ___E,
14523 >(
14524 value, preallocated.encoder, &mut out, (4294967295, ())
14525 )?;
14526 } else {
14527 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14528 }
14529 }
14530
14531 5 => {
14532 if let Some(value) = self.source_instance_filter.take() {
14533 ::fidl_next::wire::Envelope::encode_value::<
14534 ::fidl_next::wire::Vector<
14535 'static,
14536 ::fidl_next::wire::String<'static>,
14537 >,
14538 ___E,
14539 >(
14540 value, preallocated.encoder, &mut out, (4294967295, 100)
14541 )?;
14542 } else {
14543 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14544 }
14545 }
14546
14547 4 => {
14548 if let Some(value) = self.target_name.take() {
14549 ::fidl_next::wire::Envelope::encode_value::<
14550 ::fidl_next::wire::String<'static>,
14551 ___E,
14552 >(
14553 value, preallocated.encoder, &mut out, 100
14554 )?;
14555 } else {
14556 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14557 }
14558 }
14559
14560 3 => {
14561 if let Some(value) = self.target.take() {
14562 ::fidl_next::wire::Envelope::encode_value::<
14563 crate::wire::Ref<'static>,
14564 ___E,
14565 >(
14566 value, preallocated.encoder, &mut out, ()
14567 )?;
14568 } else {
14569 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14570 }
14571 }
14572
14573 2 => {
14574 if let Some(value) = self.source_name.take() {
14575 ::fidl_next::wire::Envelope::encode_value::<
14576 ::fidl_next::wire::String<'static>,
14577 ___E,
14578 >(
14579 value, preallocated.encoder, &mut out, 100
14580 )?;
14581 } else {
14582 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14583 }
14584 }
14585
14586 1 => {
14587 if let Some(value) = self.source.take() {
14588 ::fidl_next::wire::Envelope::encode_value::<
14589 crate::wire::Ref<'static>,
14590 ___E,
14591 >(
14592 value, preallocated.encoder, &mut out, ()
14593 )?;
14594 } else {
14595 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14596 }
14597 }
14598
14599 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
14600 }
14601 unsafe {
14602 preallocated.write_next(out.assume_init_ref());
14603 }
14604 }
14605
14606 ::fidl_next::wire::Table::encode_len(table, max_ord);
14607
14608 Ok(())
14609 }
14610 }
14611
14612 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferService<'static>, ___E>
14613 for &'a OfferService
14614 where
14615 ___E: ::fidl_next::Encoder + ?Sized,
14616 {
14617 #[inline]
14618 fn encode(
14619 self,
14620 encoder: &mut ___E,
14621 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferService<'static>>,
14622 _: (),
14623 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14624 ::fidl_next::munge!(let crate::wire::OfferService { table } = out);
14625
14626 let max_ord = self.__max_ordinal();
14627
14628 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
14629 ::fidl_next::Wire::zero_padding(&mut out);
14630
14631 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
14632 ::fidl_next::wire::Envelope,
14633 >(encoder, max_ord);
14634
14635 for i in 1..=max_ord {
14636 match i {
14637 9 => {
14638 if let Some(value) = &self.dependency_type {
14639 ::fidl_next::wire::Envelope::encode_value::<
14640 crate::wire::DependencyType,
14641 ___E,
14642 >(
14643 value, preallocated.encoder, &mut out, ()
14644 )?;
14645 } else {
14646 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14647 }
14648 }
14649
14650 8 => {
14651 if let Some(value) = &self.source_dictionary {
14652 ::fidl_next::wire::Envelope::encode_value::<
14653 ::fidl_next::wire::String<'static>,
14654 ___E,
14655 >(
14656 value, preallocated.encoder, &mut out, 1024
14657 )?;
14658 } else {
14659 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14660 }
14661 }
14662
14663 7 => {
14664 if let Some(value) = &self.availability {
14665 ::fidl_next::wire::Envelope::encode_value::<
14666 crate::wire::Availability,
14667 ___E,
14668 >(
14669 value, preallocated.encoder, &mut out, ()
14670 )?;
14671 } else {
14672 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14673 }
14674 }
14675
14676 6 => {
14677 if let Some(value) = &self.renamed_instances {
14678 ::fidl_next::wire::Envelope::encode_value::<
14679 ::fidl_next::wire::Vector<
14680 'static,
14681 crate::wire::NameMapping<'static>,
14682 >,
14683 ___E,
14684 >(
14685 value, preallocated.encoder, &mut out, (4294967295, ())
14686 )?;
14687 } else {
14688 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14689 }
14690 }
14691
14692 5 => {
14693 if let Some(value) = &self.source_instance_filter {
14694 ::fidl_next::wire::Envelope::encode_value::<
14695 ::fidl_next::wire::Vector<
14696 'static,
14697 ::fidl_next::wire::String<'static>,
14698 >,
14699 ___E,
14700 >(
14701 value, preallocated.encoder, &mut out, (4294967295, 100)
14702 )?;
14703 } else {
14704 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14705 }
14706 }
14707
14708 4 => {
14709 if let Some(value) = &self.target_name {
14710 ::fidl_next::wire::Envelope::encode_value::<
14711 ::fidl_next::wire::String<'static>,
14712 ___E,
14713 >(
14714 value, preallocated.encoder, &mut out, 100
14715 )?;
14716 } else {
14717 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14718 }
14719 }
14720
14721 3 => {
14722 if let Some(value) = &self.target {
14723 ::fidl_next::wire::Envelope::encode_value::<
14724 crate::wire::Ref<'static>,
14725 ___E,
14726 >(
14727 value, preallocated.encoder, &mut out, ()
14728 )?;
14729 } else {
14730 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14731 }
14732 }
14733
14734 2 => {
14735 if let Some(value) = &self.source_name {
14736 ::fidl_next::wire::Envelope::encode_value::<
14737 ::fidl_next::wire::String<'static>,
14738 ___E,
14739 >(
14740 value, preallocated.encoder, &mut out, 100
14741 )?;
14742 } else {
14743 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14744 }
14745 }
14746
14747 1 => {
14748 if let Some(value) = &self.source {
14749 ::fidl_next::wire::Envelope::encode_value::<
14750 crate::wire::Ref<'static>,
14751 ___E,
14752 >(
14753 value, preallocated.encoder, &mut out, ()
14754 )?;
14755 } else {
14756 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14757 }
14758 }
14759
14760 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
14761 }
14762 unsafe {
14763 preallocated.write_next(out.assume_init_ref());
14764 }
14765 }
14766
14767 ::fidl_next::wire::Table::encode_len(table, max_ord);
14768
14769 Ok(())
14770 }
14771 }
14772
14773 impl<'de> ::fidl_next::FromWire<crate::wire::OfferService<'de>> for OfferService {
14774 #[inline]
14775 fn from_wire(wire_: crate::wire::OfferService<'de>) -> Self {
14776 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
14777
14778 let source = wire_.table.get(1);
14779
14780 let source_name = wire_.table.get(2);
14781
14782 let target = wire_.table.get(3);
14783
14784 let target_name = wire_.table.get(4);
14785
14786 let source_instance_filter = wire_.table.get(5);
14787
14788 let renamed_instances = wire_.table.get(6);
14789
14790 let availability = wire_.table.get(7);
14791
14792 let source_dictionary = wire_.table.get(8);
14793
14794 let dependency_type = wire_.table.get(9);
14795
14796 Self {
14797
14798
14799 source: source.map(|envelope| ::fidl_next::FromWire::from_wire(
14800 unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() }
14801 )),
14802
14803
14804 source_name: source_name.map(|envelope| ::fidl_next::FromWire::from_wire(
14805 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
14806 )),
14807
14808
14809 target: target.map(|envelope| ::fidl_next::FromWire::from_wire(
14810 unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() }
14811 )),
14812
14813
14814 target_name: target_name.map(|envelope| ::fidl_next::FromWire::from_wire(
14815 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
14816 )),
14817
14818
14819 source_instance_filter: source_instance_filter.map(|envelope| ::fidl_next::FromWire::from_wire(
14820 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>() }
14821 )),
14822
14823
14824 renamed_instances: renamed_instances.map(|envelope| ::fidl_next::FromWire::from_wire(
14825 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::NameMapping<'de>>>() }
14826 )),
14827
14828
14829 availability: availability.map(|envelope| ::fidl_next::FromWire::from_wire(
14830 unsafe { envelope.read_unchecked::<crate::wire::Availability>() }
14831 )),
14832
14833
14834 source_dictionary: source_dictionary.map(|envelope| ::fidl_next::FromWire::from_wire(
14835 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
14836 )),
14837
14838
14839 dependency_type: dependency_type.map(|envelope| ::fidl_next::FromWire::from_wire(
14840 unsafe { envelope.read_unchecked::<crate::wire::DependencyType>() }
14841 )),
14842
14843 }
14844 }
14845 }
14846
14847 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferService<'de>> for OfferService {
14848 #[inline]
14849 fn from_wire_ref(wire: &crate::wire::OfferService<'de>) -> Self {
14850 Self {
14851
14852
14853 source: wire.table.get(1)
14854 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14855 unsafe { envelope.deref_unchecked::<crate::wire::Ref<'de>>() }
14856 )),
14857
14858
14859 source_name: wire.table.get(2)
14860 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14861 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
14862 )),
14863
14864
14865 target: wire.table.get(3)
14866 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14867 unsafe { envelope.deref_unchecked::<crate::wire::Ref<'de>>() }
14868 )),
14869
14870
14871 target_name: wire.table.get(4)
14872 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14873 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
14874 )),
14875
14876
14877 source_instance_filter: wire.table.get(5)
14878 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14879 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>() }
14880 )),
14881
14882
14883 renamed_instances: wire.table.get(6)
14884 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14885 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::NameMapping<'de>>>() }
14886 )),
14887
14888
14889 availability: wire.table.get(7)
14890 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14891 unsafe { envelope.deref_unchecked::<crate::wire::Availability>() }
14892 )),
14893
14894
14895 source_dictionary: wire.table.get(8)
14896 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14897 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
14898 )),
14899
14900
14901 dependency_type: wire.table.get(9)
14902 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14903 unsafe { envelope.deref_unchecked::<crate::wire::DependencyType>() }
14904 )),
14905
14906 }
14907 }
14908 }
14909
14910 #[doc = " Declares a protocol offered by a component to one of its children,\n which may have been offered by the component\'s containing realm, the\n component itself, or one of its other children.\n\n To learn more about protocols, see:\n https://fuchsia.dev/fuchsia-src/glossary#protocol\n"]
14911 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
14912 pub struct OfferProtocol {
14913 pub source: ::core::option::Option<crate::natural::Ref>,
14914
14915 pub source_name: ::core::option::Option<::std::string::String>,
14916
14917 pub target: ::core::option::Option<crate::natural::Ref>,
14918
14919 pub target_name: ::core::option::Option<::std::string::String>,
14920
14921 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
14922
14923 pub availability: ::core::option::Option<crate::natural::Availability>,
14924
14925 pub source_dictionary: ::core::option::Option<::std::string::String>,
14926 }
14927
14928 impl OfferProtocol {
14929 fn __max_ordinal(&self) -> usize {
14930 if self.source_dictionary.is_some() {
14931 return 7;
14932 }
14933
14934 if self.availability.is_some() {
14935 return 6;
14936 }
14937
14938 if self.dependency_type.is_some() {
14939 return 5;
14940 }
14941
14942 if self.target_name.is_some() {
14943 return 4;
14944 }
14945
14946 if self.target.is_some() {
14947 return 3;
14948 }
14949
14950 if self.source_name.is_some() {
14951 return 2;
14952 }
14953
14954 if self.source.is_some() {
14955 return 1;
14956 }
14957
14958 0
14959 }
14960 }
14961
14962 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferProtocol<'static>, ___E> for OfferProtocol
14963 where
14964 ___E: ::fidl_next::Encoder + ?Sized,
14965 {
14966 #[inline]
14967 fn encode(
14968 mut self,
14969 encoder: &mut ___E,
14970 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferProtocol<'static>>,
14971 _: (),
14972 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14973 ::fidl_next::munge!(let crate::wire::OfferProtocol { table } = out);
14974
14975 let max_ord = self.__max_ordinal();
14976
14977 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
14978 ::fidl_next::Wire::zero_padding(&mut out);
14979
14980 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
14981 ::fidl_next::wire::Envelope,
14982 >(encoder, max_ord);
14983
14984 for i in 1..=max_ord {
14985 match i {
14986 7 => {
14987 if let Some(value) = self.source_dictionary.take() {
14988 ::fidl_next::wire::Envelope::encode_value::<
14989 ::fidl_next::wire::String<'static>,
14990 ___E,
14991 >(
14992 value, preallocated.encoder, &mut out, 1024
14993 )?;
14994 } else {
14995 ::fidl_next::wire::Envelope::encode_zero(&mut out)
14996 }
14997 }
14998
14999 6 => {
15000 if let Some(value) = self.availability.take() {
15001 ::fidl_next::wire::Envelope::encode_value::<
15002 crate::wire::Availability,
15003 ___E,
15004 >(
15005 value, preallocated.encoder, &mut out, ()
15006 )?;
15007 } else {
15008 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15009 }
15010 }
15011
15012 5 => {
15013 if let Some(value) = self.dependency_type.take() {
15014 ::fidl_next::wire::Envelope::encode_value::<
15015 crate::wire::DependencyType,
15016 ___E,
15017 >(
15018 value, preallocated.encoder, &mut out, ()
15019 )?;
15020 } else {
15021 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15022 }
15023 }
15024
15025 4 => {
15026 if let Some(value) = self.target_name.take() {
15027 ::fidl_next::wire::Envelope::encode_value::<
15028 ::fidl_next::wire::String<'static>,
15029 ___E,
15030 >(
15031 value, preallocated.encoder, &mut out, 100
15032 )?;
15033 } else {
15034 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15035 }
15036 }
15037
15038 3 => {
15039 if let Some(value) = self.target.take() {
15040 ::fidl_next::wire::Envelope::encode_value::<
15041 crate::wire::Ref<'static>,
15042 ___E,
15043 >(
15044 value, preallocated.encoder, &mut out, ()
15045 )?;
15046 } else {
15047 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15048 }
15049 }
15050
15051 2 => {
15052 if let Some(value) = self.source_name.take() {
15053 ::fidl_next::wire::Envelope::encode_value::<
15054 ::fidl_next::wire::String<'static>,
15055 ___E,
15056 >(
15057 value, preallocated.encoder, &mut out, 100
15058 )?;
15059 } else {
15060 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15061 }
15062 }
15063
15064 1 => {
15065 if let Some(value) = self.source.take() {
15066 ::fidl_next::wire::Envelope::encode_value::<
15067 crate::wire::Ref<'static>,
15068 ___E,
15069 >(
15070 value, preallocated.encoder, &mut out, ()
15071 )?;
15072 } else {
15073 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15074 }
15075 }
15076
15077 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
15078 }
15079 unsafe {
15080 preallocated.write_next(out.assume_init_ref());
15081 }
15082 }
15083
15084 ::fidl_next::wire::Table::encode_len(table, max_ord);
15085
15086 Ok(())
15087 }
15088 }
15089
15090 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferProtocol<'static>, ___E>
15091 for &'a OfferProtocol
15092 where
15093 ___E: ::fidl_next::Encoder + ?Sized,
15094 {
15095 #[inline]
15096 fn encode(
15097 self,
15098 encoder: &mut ___E,
15099 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferProtocol<'static>>,
15100 _: (),
15101 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15102 ::fidl_next::munge!(let crate::wire::OfferProtocol { table } = out);
15103
15104 let max_ord = self.__max_ordinal();
15105
15106 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
15107 ::fidl_next::Wire::zero_padding(&mut out);
15108
15109 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
15110 ::fidl_next::wire::Envelope,
15111 >(encoder, max_ord);
15112
15113 for i in 1..=max_ord {
15114 match i {
15115 7 => {
15116 if let Some(value) = &self.source_dictionary {
15117 ::fidl_next::wire::Envelope::encode_value::<
15118 ::fidl_next::wire::String<'static>,
15119 ___E,
15120 >(
15121 value, preallocated.encoder, &mut out, 1024
15122 )?;
15123 } else {
15124 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15125 }
15126 }
15127
15128 6 => {
15129 if let Some(value) = &self.availability {
15130 ::fidl_next::wire::Envelope::encode_value::<
15131 crate::wire::Availability,
15132 ___E,
15133 >(
15134 value, preallocated.encoder, &mut out, ()
15135 )?;
15136 } else {
15137 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15138 }
15139 }
15140
15141 5 => {
15142 if let Some(value) = &self.dependency_type {
15143 ::fidl_next::wire::Envelope::encode_value::<
15144 crate::wire::DependencyType,
15145 ___E,
15146 >(
15147 value, preallocated.encoder, &mut out, ()
15148 )?;
15149 } else {
15150 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15151 }
15152 }
15153
15154 4 => {
15155 if let Some(value) = &self.target_name {
15156 ::fidl_next::wire::Envelope::encode_value::<
15157 ::fidl_next::wire::String<'static>,
15158 ___E,
15159 >(
15160 value, preallocated.encoder, &mut out, 100
15161 )?;
15162 } else {
15163 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15164 }
15165 }
15166
15167 3 => {
15168 if let Some(value) = &self.target {
15169 ::fidl_next::wire::Envelope::encode_value::<
15170 crate::wire::Ref<'static>,
15171 ___E,
15172 >(
15173 value, preallocated.encoder, &mut out, ()
15174 )?;
15175 } else {
15176 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15177 }
15178 }
15179
15180 2 => {
15181 if let Some(value) = &self.source_name {
15182 ::fidl_next::wire::Envelope::encode_value::<
15183 ::fidl_next::wire::String<'static>,
15184 ___E,
15185 >(
15186 value, preallocated.encoder, &mut out, 100
15187 )?;
15188 } else {
15189 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15190 }
15191 }
15192
15193 1 => {
15194 if let Some(value) = &self.source {
15195 ::fidl_next::wire::Envelope::encode_value::<
15196 crate::wire::Ref<'static>,
15197 ___E,
15198 >(
15199 value, preallocated.encoder, &mut out, ()
15200 )?;
15201 } else {
15202 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15203 }
15204 }
15205
15206 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
15207 }
15208 unsafe {
15209 preallocated.write_next(out.assume_init_ref());
15210 }
15211 }
15212
15213 ::fidl_next::wire::Table::encode_len(table, max_ord);
15214
15215 Ok(())
15216 }
15217 }
15218
15219 impl<'de> ::fidl_next::FromWire<crate::wire::OfferProtocol<'de>> for OfferProtocol {
15220 #[inline]
15221 fn from_wire(wire_: crate::wire::OfferProtocol<'de>) -> Self {
15222 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
15223
15224 let source = wire_.table.get(1);
15225
15226 let source_name = wire_.table.get(2);
15227
15228 let target = wire_.table.get(3);
15229
15230 let target_name = wire_.table.get(4);
15231
15232 let dependency_type = wire_.table.get(5);
15233
15234 let availability = wire_.table.get(6);
15235
15236 let source_dictionary = wire_.table.get(7);
15237
15238 Self {
15239 source: source.map(|envelope| {
15240 ::fidl_next::FromWire::from_wire(unsafe {
15241 envelope.read_unchecked::<crate::wire::Ref<'de>>()
15242 })
15243 }),
15244
15245 source_name: source_name.map(|envelope| {
15246 ::fidl_next::FromWire::from_wire(unsafe {
15247 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
15248 })
15249 }),
15250
15251 target: target.map(|envelope| {
15252 ::fidl_next::FromWire::from_wire(unsafe {
15253 envelope.read_unchecked::<crate::wire::Ref<'de>>()
15254 })
15255 }),
15256
15257 target_name: target_name.map(|envelope| {
15258 ::fidl_next::FromWire::from_wire(unsafe {
15259 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
15260 })
15261 }),
15262
15263 dependency_type: dependency_type.map(|envelope| {
15264 ::fidl_next::FromWire::from_wire(unsafe {
15265 envelope.read_unchecked::<crate::wire::DependencyType>()
15266 })
15267 }),
15268
15269 availability: availability.map(|envelope| {
15270 ::fidl_next::FromWire::from_wire(unsafe {
15271 envelope.read_unchecked::<crate::wire::Availability>()
15272 })
15273 }),
15274
15275 source_dictionary: source_dictionary.map(|envelope| {
15276 ::fidl_next::FromWire::from_wire(unsafe {
15277 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
15278 })
15279 }),
15280 }
15281 }
15282 }
15283
15284 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferProtocol<'de>> for OfferProtocol {
15285 #[inline]
15286 fn from_wire_ref(wire: &crate::wire::OfferProtocol<'de>) -> Self {
15287 Self {
15288 source: wire.table.get(1).map(|envelope| {
15289 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15290 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
15291 })
15292 }),
15293
15294 source_name: wire.table.get(2).map(|envelope| {
15295 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15296 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
15297 })
15298 }),
15299
15300 target: wire.table.get(3).map(|envelope| {
15301 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15302 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
15303 })
15304 }),
15305
15306 target_name: wire.table.get(4).map(|envelope| {
15307 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15308 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
15309 })
15310 }),
15311
15312 dependency_type: wire.table.get(5).map(|envelope| {
15313 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15314 envelope.deref_unchecked::<crate::wire::DependencyType>()
15315 })
15316 }),
15317
15318 availability: wire.table.get(6).map(|envelope| {
15319 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15320 envelope.deref_unchecked::<crate::wire::Availability>()
15321 })
15322 }),
15323
15324 source_dictionary: wire.table.get(7).map(|envelope| {
15325 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15326 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
15327 })
15328 }),
15329 }
15330 }
15331 }
15332
15333 #[doc = " Declares a directory offered by a component to one of its children, which\n may have been offered by the component\'s containing realm, the component\n itself, or one of its other children.\n"]
15334 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
15335 pub struct OfferDirectory {
15336 pub source: ::core::option::Option<crate::natural::Ref>,
15337
15338 pub source_name: ::core::option::Option<::std::string::String>,
15339
15340 pub target: ::core::option::Option<crate::natural::Ref>,
15341
15342 pub target_name: ::core::option::Option<::std::string::String>,
15343
15344 pub rights: ::core::option::Option<::fidl_next_common_fuchsia_io::natural::Operations>,
15345
15346 pub subdir: ::core::option::Option<::std::string::String>,
15347
15348 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
15349
15350 pub availability: ::core::option::Option<crate::natural::Availability>,
15351
15352 pub source_dictionary: ::core::option::Option<::std::string::String>,
15353 }
15354
15355 impl OfferDirectory {
15356 fn __max_ordinal(&self) -> usize {
15357 if self.source_dictionary.is_some() {
15358 return 9;
15359 }
15360
15361 if self.availability.is_some() {
15362 return 8;
15363 }
15364
15365 if self.dependency_type.is_some() {
15366 return 7;
15367 }
15368
15369 if self.subdir.is_some() {
15370 return 6;
15371 }
15372
15373 if self.rights.is_some() {
15374 return 5;
15375 }
15376
15377 if self.target_name.is_some() {
15378 return 4;
15379 }
15380
15381 if self.target.is_some() {
15382 return 3;
15383 }
15384
15385 if self.source_name.is_some() {
15386 return 2;
15387 }
15388
15389 if self.source.is_some() {
15390 return 1;
15391 }
15392
15393 0
15394 }
15395 }
15396
15397 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferDirectory<'static>, ___E> for OfferDirectory
15398 where
15399 ___E: ::fidl_next::Encoder + ?Sized,
15400 {
15401 #[inline]
15402 fn encode(
15403 mut self,
15404 encoder: &mut ___E,
15405 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferDirectory<'static>>,
15406 _: (),
15407 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15408 ::fidl_next::munge!(let crate::wire::OfferDirectory { table } = out);
15409
15410 let max_ord = self.__max_ordinal();
15411
15412 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
15413 ::fidl_next::Wire::zero_padding(&mut out);
15414
15415 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
15416 ::fidl_next::wire::Envelope,
15417 >(encoder, max_ord);
15418
15419 for i in 1..=max_ord {
15420 match i {
15421 9 => {
15422 if let Some(value) = self.source_dictionary.take() {
15423 ::fidl_next::wire::Envelope::encode_value::<
15424 ::fidl_next::wire::String<'static>,
15425 ___E,
15426 >(
15427 value, preallocated.encoder, &mut out, 1024
15428 )?;
15429 } else {
15430 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15431 }
15432 }
15433
15434 8 => {
15435 if let Some(value) = self.availability.take() {
15436 ::fidl_next::wire::Envelope::encode_value::<
15437 crate::wire::Availability,
15438 ___E,
15439 >(
15440 value, preallocated.encoder, &mut out, ()
15441 )?;
15442 } else {
15443 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15444 }
15445 }
15446
15447 7 => {
15448 if let Some(value) = self.dependency_type.take() {
15449 ::fidl_next::wire::Envelope::encode_value::<
15450 crate::wire::DependencyType,
15451 ___E,
15452 >(
15453 value, preallocated.encoder, &mut out, ()
15454 )?;
15455 } else {
15456 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15457 }
15458 }
15459
15460 6 => {
15461 if let Some(value) = self.subdir.take() {
15462 ::fidl_next::wire::Envelope::encode_value::<
15463 ::fidl_next::wire::String<'static>,
15464 ___E,
15465 >(
15466 value, preallocated.encoder, &mut out, 1024
15467 )?;
15468 } else {
15469 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15470 }
15471 }
15472
15473 5 => {
15474 if let Some(value) = self.rights.take() {
15475 ::fidl_next::wire::Envelope::encode_value::<
15476 ::fidl_next_common_fuchsia_io::wire::Operations,
15477 ___E,
15478 >(
15479 value, preallocated.encoder, &mut out, ()
15480 )?;
15481 } else {
15482 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15483 }
15484 }
15485
15486 4 => {
15487 if let Some(value) = self.target_name.take() {
15488 ::fidl_next::wire::Envelope::encode_value::<
15489 ::fidl_next::wire::String<'static>,
15490 ___E,
15491 >(
15492 value, preallocated.encoder, &mut out, 100
15493 )?;
15494 } else {
15495 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15496 }
15497 }
15498
15499 3 => {
15500 if let Some(value) = self.target.take() {
15501 ::fidl_next::wire::Envelope::encode_value::<
15502 crate::wire::Ref<'static>,
15503 ___E,
15504 >(
15505 value, preallocated.encoder, &mut out, ()
15506 )?;
15507 } else {
15508 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15509 }
15510 }
15511
15512 2 => {
15513 if let Some(value) = self.source_name.take() {
15514 ::fidl_next::wire::Envelope::encode_value::<
15515 ::fidl_next::wire::String<'static>,
15516 ___E,
15517 >(
15518 value, preallocated.encoder, &mut out, 100
15519 )?;
15520 } else {
15521 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15522 }
15523 }
15524
15525 1 => {
15526 if let Some(value) = self.source.take() {
15527 ::fidl_next::wire::Envelope::encode_value::<
15528 crate::wire::Ref<'static>,
15529 ___E,
15530 >(
15531 value, preallocated.encoder, &mut out, ()
15532 )?;
15533 } else {
15534 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15535 }
15536 }
15537
15538 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
15539 }
15540 unsafe {
15541 preallocated.write_next(out.assume_init_ref());
15542 }
15543 }
15544
15545 ::fidl_next::wire::Table::encode_len(table, max_ord);
15546
15547 Ok(())
15548 }
15549 }
15550
15551 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferDirectory<'static>, ___E>
15552 for &'a OfferDirectory
15553 where
15554 ___E: ::fidl_next::Encoder + ?Sized,
15555 {
15556 #[inline]
15557 fn encode(
15558 self,
15559 encoder: &mut ___E,
15560 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferDirectory<'static>>,
15561 _: (),
15562 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15563 ::fidl_next::munge!(let crate::wire::OfferDirectory { table } = out);
15564
15565 let max_ord = self.__max_ordinal();
15566
15567 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
15568 ::fidl_next::Wire::zero_padding(&mut out);
15569
15570 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
15571 ::fidl_next::wire::Envelope,
15572 >(encoder, max_ord);
15573
15574 for i in 1..=max_ord {
15575 match i {
15576 9 => {
15577 if let Some(value) = &self.source_dictionary {
15578 ::fidl_next::wire::Envelope::encode_value::<
15579 ::fidl_next::wire::String<'static>,
15580 ___E,
15581 >(
15582 value, preallocated.encoder, &mut out, 1024
15583 )?;
15584 } else {
15585 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15586 }
15587 }
15588
15589 8 => {
15590 if let Some(value) = &self.availability {
15591 ::fidl_next::wire::Envelope::encode_value::<
15592 crate::wire::Availability,
15593 ___E,
15594 >(
15595 value, preallocated.encoder, &mut out, ()
15596 )?;
15597 } else {
15598 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15599 }
15600 }
15601
15602 7 => {
15603 if let Some(value) = &self.dependency_type {
15604 ::fidl_next::wire::Envelope::encode_value::<
15605 crate::wire::DependencyType,
15606 ___E,
15607 >(
15608 value, preallocated.encoder, &mut out, ()
15609 )?;
15610 } else {
15611 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15612 }
15613 }
15614
15615 6 => {
15616 if let Some(value) = &self.subdir {
15617 ::fidl_next::wire::Envelope::encode_value::<
15618 ::fidl_next::wire::String<'static>,
15619 ___E,
15620 >(
15621 value, preallocated.encoder, &mut out, 1024
15622 )?;
15623 } else {
15624 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15625 }
15626 }
15627
15628 5 => {
15629 if let Some(value) = &self.rights {
15630 ::fidl_next::wire::Envelope::encode_value::<
15631 ::fidl_next_common_fuchsia_io::wire::Operations,
15632 ___E,
15633 >(
15634 value, preallocated.encoder, &mut out, ()
15635 )?;
15636 } else {
15637 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15638 }
15639 }
15640
15641 4 => {
15642 if let Some(value) = &self.target_name {
15643 ::fidl_next::wire::Envelope::encode_value::<
15644 ::fidl_next::wire::String<'static>,
15645 ___E,
15646 >(
15647 value, preallocated.encoder, &mut out, 100
15648 )?;
15649 } else {
15650 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15651 }
15652 }
15653
15654 3 => {
15655 if let Some(value) = &self.target {
15656 ::fidl_next::wire::Envelope::encode_value::<
15657 crate::wire::Ref<'static>,
15658 ___E,
15659 >(
15660 value, preallocated.encoder, &mut out, ()
15661 )?;
15662 } else {
15663 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15664 }
15665 }
15666
15667 2 => {
15668 if let Some(value) = &self.source_name {
15669 ::fidl_next::wire::Envelope::encode_value::<
15670 ::fidl_next::wire::String<'static>,
15671 ___E,
15672 >(
15673 value, preallocated.encoder, &mut out, 100
15674 )?;
15675 } else {
15676 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15677 }
15678 }
15679
15680 1 => {
15681 if let Some(value) = &self.source {
15682 ::fidl_next::wire::Envelope::encode_value::<
15683 crate::wire::Ref<'static>,
15684 ___E,
15685 >(
15686 value, preallocated.encoder, &mut out, ()
15687 )?;
15688 } else {
15689 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15690 }
15691 }
15692
15693 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
15694 }
15695 unsafe {
15696 preallocated.write_next(out.assume_init_ref());
15697 }
15698 }
15699
15700 ::fidl_next::wire::Table::encode_len(table, max_ord);
15701
15702 Ok(())
15703 }
15704 }
15705
15706 impl<'de> ::fidl_next::FromWire<crate::wire::OfferDirectory<'de>> for OfferDirectory {
15707 #[inline]
15708 fn from_wire(wire_: crate::wire::OfferDirectory<'de>) -> Self {
15709 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
15710
15711 let source = wire_.table.get(1);
15712
15713 let source_name = wire_.table.get(2);
15714
15715 let target = wire_.table.get(3);
15716
15717 let target_name = wire_.table.get(4);
15718
15719 let rights = wire_.table.get(5);
15720
15721 let subdir = wire_.table.get(6);
15722
15723 let dependency_type = wire_.table.get(7);
15724
15725 let availability = wire_.table.get(8);
15726
15727 let source_dictionary = wire_.table.get(9);
15728
15729 Self {
15730 source: source.map(|envelope| {
15731 ::fidl_next::FromWire::from_wire(unsafe {
15732 envelope.read_unchecked::<crate::wire::Ref<'de>>()
15733 })
15734 }),
15735
15736 source_name: source_name.map(|envelope| {
15737 ::fidl_next::FromWire::from_wire(unsafe {
15738 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
15739 })
15740 }),
15741
15742 target: target.map(|envelope| {
15743 ::fidl_next::FromWire::from_wire(unsafe {
15744 envelope.read_unchecked::<crate::wire::Ref<'de>>()
15745 })
15746 }),
15747
15748 target_name: target_name.map(|envelope| {
15749 ::fidl_next::FromWire::from_wire(unsafe {
15750 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
15751 })
15752 }),
15753
15754 rights: rights.map(|envelope| {
15755 ::fidl_next::FromWire::from_wire(unsafe {
15756 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
15757 })
15758 }),
15759
15760 subdir: subdir.map(|envelope| {
15761 ::fidl_next::FromWire::from_wire(unsafe {
15762 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
15763 })
15764 }),
15765
15766 dependency_type: dependency_type.map(|envelope| {
15767 ::fidl_next::FromWire::from_wire(unsafe {
15768 envelope.read_unchecked::<crate::wire::DependencyType>()
15769 })
15770 }),
15771
15772 availability: availability.map(|envelope| {
15773 ::fidl_next::FromWire::from_wire(unsafe {
15774 envelope.read_unchecked::<crate::wire::Availability>()
15775 })
15776 }),
15777
15778 source_dictionary: source_dictionary.map(|envelope| {
15779 ::fidl_next::FromWire::from_wire(unsafe {
15780 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
15781 })
15782 }),
15783 }
15784 }
15785 }
15786
15787 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferDirectory<'de>> for OfferDirectory {
15788 #[inline]
15789 fn from_wire_ref(wire: &crate::wire::OfferDirectory<'de>) -> Self {
15790 Self {
15791 source: wire.table.get(1).map(|envelope| {
15792 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15793 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
15794 })
15795 }),
15796
15797 source_name: wire.table.get(2).map(|envelope| {
15798 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15799 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
15800 })
15801 }),
15802
15803 target: wire.table.get(3).map(|envelope| {
15804 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15805 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
15806 })
15807 }),
15808
15809 target_name: wire.table.get(4).map(|envelope| {
15810 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15811 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
15812 })
15813 }),
15814
15815 rights: wire.table.get(5).map(|envelope| {
15816 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15817 envelope
15818 .deref_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
15819 })
15820 }),
15821
15822 subdir: wire.table.get(6).map(|envelope| {
15823 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15824 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
15825 })
15826 }),
15827
15828 dependency_type: wire.table.get(7).map(|envelope| {
15829 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15830 envelope.deref_unchecked::<crate::wire::DependencyType>()
15831 })
15832 }),
15833
15834 availability: wire.table.get(8).map(|envelope| {
15835 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15836 envelope.deref_unchecked::<crate::wire::Availability>()
15837 })
15838 }),
15839
15840 source_dictionary: wire.table.get(9).map(|envelope| {
15841 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15842 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
15843 })
15844 }),
15845 }
15846 }
15847 }
15848
15849 #[doc = " Declares a storage capability offered by a component to one of its children,\n such as meta storage offered by the component\'s containing realm or cache\n storage offered by the component itself.\n"]
15850 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
15851 pub struct OfferStorage {
15852 pub source_name: ::core::option::Option<::std::string::String>,
15853
15854 pub source: ::core::option::Option<crate::natural::Ref>,
15855
15856 pub target: ::core::option::Option<crate::natural::Ref>,
15857
15858 pub target_name: ::core::option::Option<::std::string::String>,
15859
15860 pub availability: ::core::option::Option<crate::natural::Availability>,
15861 }
15862
15863 impl OfferStorage {
15864 fn __max_ordinal(&self) -> usize {
15865 if self.availability.is_some() {
15866 return 5;
15867 }
15868
15869 if self.target_name.is_some() {
15870 return 4;
15871 }
15872
15873 if self.target.is_some() {
15874 return 3;
15875 }
15876
15877 if self.source.is_some() {
15878 return 2;
15879 }
15880
15881 if self.source_name.is_some() {
15882 return 1;
15883 }
15884
15885 0
15886 }
15887 }
15888
15889 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferStorage<'static>, ___E> for OfferStorage
15890 where
15891 ___E: ::fidl_next::Encoder + ?Sized,
15892 {
15893 #[inline]
15894 fn encode(
15895 mut self,
15896 encoder: &mut ___E,
15897 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferStorage<'static>>,
15898 _: (),
15899 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15900 ::fidl_next::munge!(let crate::wire::OfferStorage { table } = out);
15901
15902 let max_ord = self.__max_ordinal();
15903
15904 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
15905 ::fidl_next::Wire::zero_padding(&mut out);
15906
15907 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
15908 ::fidl_next::wire::Envelope,
15909 >(encoder, max_ord);
15910
15911 for i in 1..=max_ord {
15912 match i {
15913 5 => {
15914 if let Some(value) = self.availability.take() {
15915 ::fidl_next::wire::Envelope::encode_value::<
15916 crate::wire::Availability,
15917 ___E,
15918 >(
15919 value, preallocated.encoder, &mut out, ()
15920 )?;
15921 } else {
15922 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15923 }
15924 }
15925
15926 4 => {
15927 if let Some(value) = self.target_name.take() {
15928 ::fidl_next::wire::Envelope::encode_value::<
15929 ::fidl_next::wire::String<'static>,
15930 ___E,
15931 >(
15932 value, preallocated.encoder, &mut out, 100
15933 )?;
15934 } else {
15935 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15936 }
15937 }
15938
15939 3 => {
15940 if let Some(value) = self.target.take() {
15941 ::fidl_next::wire::Envelope::encode_value::<
15942 crate::wire::Ref<'static>,
15943 ___E,
15944 >(
15945 value, preallocated.encoder, &mut out, ()
15946 )?;
15947 } else {
15948 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15949 }
15950 }
15951
15952 2 => {
15953 if let Some(value) = self.source.take() {
15954 ::fidl_next::wire::Envelope::encode_value::<
15955 crate::wire::Ref<'static>,
15956 ___E,
15957 >(
15958 value, preallocated.encoder, &mut out, ()
15959 )?;
15960 } else {
15961 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15962 }
15963 }
15964
15965 1 => {
15966 if let Some(value) = self.source_name.take() {
15967 ::fidl_next::wire::Envelope::encode_value::<
15968 ::fidl_next::wire::String<'static>,
15969 ___E,
15970 >(
15971 value, preallocated.encoder, &mut out, 100
15972 )?;
15973 } else {
15974 ::fidl_next::wire::Envelope::encode_zero(&mut out)
15975 }
15976 }
15977
15978 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
15979 }
15980 unsafe {
15981 preallocated.write_next(out.assume_init_ref());
15982 }
15983 }
15984
15985 ::fidl_next::wire::Table::encode_len(table, max_ord);
15986
15987 Ok(())
15988 }
15989 }
15990
15991 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferStorage<'static>, ___E>
15992 for &'a OfferStorage
15993 where
15994 ___E: ::fidl_next::Encoder + ?Sized,
15995 {
15996 #[inline]
15997 fn encode(
15998 self,
15999 encoder: &mut ___E,
16000 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferStorage<'static>>,
16001 _: (),
16002 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16003 ::fidl_next::munge!(let crate::wire::OfferStorage { table } = out);
16004
16005 let max_ord = self.__max_ordinal();
16006
16007 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
16008 ::fidl_next::Wire::zero_padding(&mut out);
16009
16010 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
16011 ::fidl_next::wire::Envelope,
16012 >(encoder, max_ord);
16013
16014 for i in 1..=max_ord {
16015 match i {
16016 5 => {
16017 if let Some(value) = &self.availability {
16018 ::fidl_next::wire::Envelope::encode_value::<
16019 crate::wire::Availability,
16020 ___E,
16021 >(
16022 value, preallocated.encoder, &mut out, ()
16023 )?;
16024 } else {
16025 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16026 }
16027 }
16028
16029 4 => {
16030 if let Some(value) = &self.target_name {
16031 ::fidl_next::wire::Envelope::encode_value::<
16032 ::fidl_next::wire::String<'static>,
16033 ___E,
16034 >(
16035 value, preallocated.encoder, &mut out, 100
16036 )?;
16037 } else {
16038 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16039 }
16040 }
16041
16042 3 => {
16043 if let Some(value) = &self.target {
16044 ::fidl_next::wire::Envelope::encode_value::<
16045 crate::wire::Ref<'static>,
16046 ___E,
16047 >(
16048 value, preallocated.encoder, &mut out, ()
16049 )?;
16050 } else {
16051 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16052 }
16053 }
16054
16055 2 => {
16056 if let Some(value) = &self.source {
16057 ::fidl_next::wire::Envelope::encode_value::<
16058 crate::wire::Ref<'static>,
16059 ___E,
16060 >(
16061 value, preallocated.encoder, &mut out, ()
16062 )?;
16063 } else {
16064 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16065 }
16066 }
16067
16068 1 => {
16069 if let Some(value) = &self.source_name {
16070 ::fidl_next::wire::Envelope::encode_value::<
16071 ::fidl_next::wire::String<'static>,
16072 ___E,
16073 >(
16074 value, preallocated.encoder, &mut out, 100
16075 )?;
16076 } else {
16077 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16078 }
16079 }
16080
16081 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
16082 }
16083 unsafe {
16084 preallocated.write_next(out.assume_init_ref());
16085 }
16086 }
16087
16088 ::fidl_next::wire::Table::encode_len(table, max_ord);
16089
16090 Ok(())
16091 }
16092 }
16093
16094 impl<'de> ::fidl_next::FromWire<crate::wire::OfferStorage<'de>> for OfferStorage {
16095 #[inline]
16096 fn from_wire(wire_: crate::wire::OfferStorage<'de>) -> Self {
16097 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
16098
16099 let source_name = wire_.table.get(1);
16100
16101 let source = wire_.table.get(2);
16102
16103 let target = wire_.table.get(3);
16104
16105 let target_name = wire_.table.get(4);
16106
16107 let availability = wire_.table.get(5);
16108
16109 Self {
16110 source_name: source_name.map(|envelope| {
16111 ::fidl_next::FromWire::from_wire(unsafe {
16112 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
16113 })
16114 }),
16115
16116 source: source.map(|envelope| {
16117 ::fidl_next::FromWire::from_wire(unsafe {
16118 envelope.read_unchecked::<crate::wire::Ref<'de>>()
16119 })
16120 }),
16121
16122 target: target.map(|envelope| {
16123 ::fidl_next::FromWire::from_wire(unsafe {
16124 envelope.read_unchecked::<crate::wire::Ref<'de>>()
16125 })
16126 }),
16127
16128 target_name: target_name.map(|envelope| {
16129 ::fidl_next::FromWire::from_wire(unsafe {
16130 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
16131 })
16132 }),
16133
16134 availability: availability.map(|envelope| {
16135 ::fidl_next::FromWire::from_wire(unsafe {
16136 envelope.read_unchecked::<crate::wire::Availability>()
16137 })
16138 }),
16139 }
16140 }
16141 }
16142
16143 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferStorage<'de>> for OfferStorage {
16144 #[inline]
16145 fn from_wire_ref(wire: &crate::wire::OfferStorage<'de>) -> Self {
16146 Self {
16147 source_name: wire.table.get(1).map(|envelope| {
16148 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16149 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
16150 })
16151 }),
16152
16153 source: wire.table.get(2).map(|envelope| {
16154 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16155 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
16156 })
16157 }),
16158
16159 target: wire.table.get(3).map(|envelope| {
16160 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16161 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
16162 })
16163 }),
16164
16165 target_name: wire.table.get(4).map(|envelope| {
16166 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16167 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
16168 })
16169 }),
16170
16171 availability: wire.table.get(5).map(|envelope| {
16172 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16173 envelope.deref_unchecked::<crate::wire::Availability>()
16174 })
16175 }),
16176 }
16177 }
16178 }
16179
16180 #[doc = " Declares a runner offered by a component to one of its children, which may\n have been offered by the component\'s containing realm, the component itself,\n or one of its other children.\n"]
16181 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
16182 pub struct OfferRunner {
16183 pub source: ::core::option::Option<crate::natural::Ref>,
16184
16185 pub source_name: ::core::option::Option<::std::string::String>,
16186
16187 pub target: ::core::option::Option<crate::natural::Ref>,
16188
16189 pub target_name: ::core::option::Option<::std::string::String>,
16190
16191 pub source_dictionary: ::core::option::Option<::std::string::String>,
16192 }
16193
16194 impl OfferRunner {
16195 fn __max_ordinal(&self) -> usize {
16196 if self.source_dictionary.is_some() {
16197 return 5;
16198 }
16199
16200 if self.target_name.is_some() {
16201 return 4;
16202 }
16203
16204 if self.target.is_some() {
16205 return 3;
16206 }
16207
16208 if self.source_name.is_some() {
16209 return 2;
16210 }
16211
16212 if self.source.is_some() {
16213 return 1;
16214 }
16215
16216 0
16217 }
16218 }
16219
16220 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferRunner<'static>, ___E> for OfferRunner
16221 where
16222 ___E: ::fidl_next::Encoder + ?Sized,
16223 {
16224 #[inline]
16225 fn encode(
16226 mut self,
16227 encoder: &mut ___E,
16228 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferRunner<'static>>,
16229 _: (),
16230 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16231 ::fidl_next::munge!(let crate::wire::OfferRunner { table } = out);
16232
16233 let max_ord = self.__max_ordinal();
16234
16235 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
16236 ::fidl_next::Wire::zero_padding(&mut out);
16237
16238 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
16239 ::fidl_next::wire::Envelope,
16240 >(encoder, max_ord);
16241
16242 for i in 1..=max_ord {
16243 match i {
16244 5 => {
16245 if let Some(value) = self.source_dictionary.take() {
16246 ::fidl_next::wire::Envelope::encode_value::<
16247 ::fidl_next::wire::String<'static>,
16248 ___E,
16249 >(
16250 value, preallocated.encoder, &mut out, 1024
16251 )?;
16252 } else {
16253 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16254 }
16255 }
16256
16257 4 => {
16258 if let Some(value) = self.target_name.take() {
16259 ::fidl_next::wire::Envelope::encode_value::<
16260 ::fidl_next::wire::String<'static>,
16261 ___E,
16262 >(
16263 value, preallocated.encoder, &mut out, 100
16264 )?;
16265 } else {
16266 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16267 }
16268 }
16269
16270 3 => {
16271 if let Some(value) = self.target.take() {
16272 ::fidl_next::wire::Envelope::encode_value::<
16273 crate::wire::Ref<'static>,
16274 ___E,
16275 >(
16276 value, preallocated.encoder, &mut out, ()
16277 )?;
16278 } else {
16279 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16280 }
16281 }
16282
16283 2 => {
16284 if let Some(value) = self.source_name.take() {
16285 ::fidl_next::wire::Envelope::encode_value::<
16286 ::fidl_next::wire::String<'static>,
16287 ___E,
16288 >(
16289 value, preallocated.encoder, &mut out, 100
16290 )?;
16291 } else {
16292 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16293 }
16294 }
16295
16296 1 => {
16297 if let Some(value) = self.source.take() {
16298 ::fidl_next::wire::Envelope::encode_value::<
16299 crate::wire::Ref<'static>,
16300 ___E,
16301 >(
16302 value, preallocated.encoder, &mut out, ()
16303 )?;
16304 } else {
16305 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16306 }
16307 }
16308
16309 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
16310 }
16311 unsafe {
16312 preallocated.write_next(out.assume_init_ref());
16313 }
16314 }
16315
16316 ::fidl_next::wire::Table::encode_len(table, max_ord);
16317
16318 Ok(())
16319 }
16320 }
16321
16322 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferRunner<'static>, ___E>
16323 for &'a OfferRunner
16324 where
16325 ___E: ::fidl_next::Encoder + ?Sized,
16326 {
16327 #[inline]
16328 fn encode(
16329 self,
16330 encoder: &mut ___E,
16331 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferRunner<'static>>,
16332 _: (),
16333 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16334 ::fidl_next::munge!(let crate::wire::OfferRunner { table } = out);
16335
16336 let max_ord = self.__max_ordinal();
16337
16338 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
16339 ::fidl_next::Wire::zero_padding(&mut out);
16340
16341 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
16342 ::fidl_next::wire::Envelope,
16343 >(encoder, max_ord);
16344
16345 for i in 1..=max_ord {
16346 match i {
16347 5 => {
16348 if let Some(value) = &self.source_dictionary {
16349 ::fidl_next::wire::Envelope::encode_value::<
16350 ::fidl_next::wire::String<'static>,
16351 ___E,
16352 >(
16353 value, preallocated.encoder, &mut out, 1024
16354 )?;
16355 } else {
16356 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16357 }
16358 }
16359
16360 4 => {
16361 if let Some(value) = &self.target_name {
16362 ::fidl_next::wire::Envelope::encode_value::<
16363 ::fidl_next::wire::String<'static>,
16364 ___E,
16365 >(
16366 value, preallocated.encoder, &mut out, 100
16367 )?;
16368 } else {
16369 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16370 }
16371 }
16372
16373 3 => {
16374 if let Some(value) = &self.target {
16375 ::fidl_next::wire::Envelope::encode_value::<
16376 crate::wire::Ref<'static>,
16377 ___E,
16378 >(
16379 value, preallocated.encoder, &mut out, ()
16380 )?;
16381 } else {
16382 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16383 }
16384 }
16385
16386 2 => {
16387 if let Some(value) = &self.source_name {
16388 ::fidl_next::wire::Envelope::encode_value::<
16389 ::fidl_next::wire::String<'static>,
16390 ___E,
16391 >(
16392 value, preallocated.encoder, &mut out, 100
16393 )?;
16394 } else {
16395 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16396 }
16397 }
16398
16399 1 => {
16400 if let Some(value) = &self.source {
16401 ::fidl_next::wire::Envelope::encode_value::<
16402 crate::wire::Ref<'static>,
16403 ___E,
16404 >(
16405 value, preallocated.encoder, &mut out, ()
16406 )?;
16407 } else {
16408 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16409 }
16410 }
16411
16412 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
16413 }
16414 unsafe {
16415 preallocated.write_next(out.assume_init_ref());
16416 }
16417 }
16418
16419 ::fidl_next::wire::Table::encode_len(table, max_ord);
16420
16421 Ok(())
16422 }
16423 }
16424
16425 impl<'de> ::fidl_next::FromWire<crate::wire::OfferRunner<'de>> for OfferRunner {
16426 #[inline]
16427 fn from_wire(wire_: crate::wire::OfferRunner<'de>) -> Self {
16428 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
16429
16430 let source = wire_.table.get(1);
16431
16432 let source_name = wire_.table.get(2);
16433
16434 let target = wire_.table.get(3);
16435
16436 let target_name = wire_.table.get(4);
16437
16438 let source_dictionary = wire_.table.get(5);
16439
16440 Self {
16441 source: source.map(|envelope| {
16442 ::fidl_next::FromWire::from_wire(unsafe {
16443 envelope.read_unchecked::<crate::wire::Ref<'de>>()
16444 })
16445 }),
16446
16447 source_name: source_name.map(|envelope| {
16448 ::fidl_next::FromWire::from_wire(unsafe {
16449 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
16450 })
16451 }),
16452
16453 target: target.map(|envelope| {
16454 ::fidl_next::FromWire::from_wire(unsafe {
16455 envelope.read_unchecked::<crate::wire::Ref<'de>>()
16456 })
16457 }),
16458
16459 target_name: target_name.map(|envelope| {
16460 ::fidl_next::FromWire::from_wire(unsafe {
16461 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
16462 })
16463 }),
16464
16465 source_dictionary: source_dictionary.map(|envelope| {
16466 ::fidl_next::FromWire::from_wire(unsafe {
16467 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
16468 })
16469 }),
16470 }
16471 }
16472 }
16473
16474 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferRunner<'de>> for OfferRunner {
16475 #[inline]
16476 fn from_wire_ref(wire: &crate::wire::OfferRunner<'de>) -> Self {
16477 Self {
16478 source: wire.table.get(1).map(|envelope| {
16479 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16480 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
16481 })
16482 }),
16483
16484 source_name: wire.table.get(2).map(|envelope| {
16485 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16486 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
16487 })
16488 }),
16489
16490 target: wire.table.get(3).map(|envelope| {
16491 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16492 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
16493 })
16494 }),
16495
16496 target_name: wire.table.get(4).map(|envelope| {
16497 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16498 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
16499 })
16500 }),
16501
16502 source_dictionary: wire.table.get(5).map(|envelope| {
16503 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16504 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
16505 })
16506 }),
16507 }
16508 }
16509 }
16510
16511 #[doc = " Declares a resolver capability offered by a component to one of its children, which\n may have been offered by the component\'s containing realm, the component itself,\n or one of its other children.\n"]
16512 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
16513 pub struct OfferResolver {
16514 pub source: ::core::option::Option<crate::natural::Ref>,
16515
16516 pub source_name: ::core::option::Option<::std::string::String>,
16517
16518 pub target: ::core::option::Option<crate::natural::Ref>,
16519
16520 pub target_name: ::core::option::Option<::std::string::String>,
16521
16522 pub source_dictionary: ::core::option::Option<::std::string::String>,
16523 }
16524
16525 impl OfferResolver {
16526 fn __max_ordinal(&self) -> usize {
16527 if self.source_dictionary.is_some() {
16528 return 5;
16529 }
16530
16531 if self.target_name.is_some() {
16532 return 4;
16533 }
16534
16535 if self.target.is_some() {
16536 return 3;
16537 }
16538
16539 if self.source_name.is_some() {
16540 return 2;
16541 }
16542
16543 if self.source.is_some() {
16544 return 1;
16545 }
16546
16547 0
16548 }
16549 }
16550
16551 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferResolver<'static>, ___E> for OfferResolver
16552 where
16553 ___E: ::fidl_next::Encoder + ?Sized,
16554 {
16555 #[inline]
16556 fn encode(
16557 mut self,
16558 encoder: &mut ___E,
16559 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferResolver<'static>>,
16560 _: (),
16561 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16562 ::fidl_next::munge!(let crate::wire::OfferResolver { table } = out);
16563
16564 let max_ord = self.__max_ordinal();
16565
16566 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
16567 ::fidl_next::Wire::zero_padding(&mut out);
16568
16569 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
16570 ::fidl_next::wire::Envelope,
16571 >(encoder, max_ord);
16572
16573 for i in 1..=max_ord {
16574 match i {
16575 5 => {
16576 if let Some(value) = self.source_dictionary.take() {
16577 ::fidl_next::wire::Envelope::encode_value::<
16578 ::fidl_next::wire::String<'static>,
16579 ___E,
16580 >(
16581 value, preallocated.encoder, &mut out, 1024
16582 )?;
16583 } else {
16584 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16585 }
16586 }
16587
16588 4 => {
16589 if let Some(value) = self.target_name.take() {
16590 ::fidl_next::wire::Envelope::encode_value::<
16591 ::fidl_next::wire::String<'static>,
16592 ___E,
16593 >(
16594 value, preallocated.encoder, &mut out, 100
16595 )?;
16596 } else {
16597 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16598 }
16599 }
16600
16601 3 => {
16602 if let Some(value) = self.target.take() {
16603 ::fidl_next::wire::Envelope::encode_value::<
16604 crate::wire::Ref<'static>,
16605 ___E,
16606 >(
16607 value, preallocated.encoder, &mut out, ()
16608 )?;
16609 } else {
16610 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16611 }
16612 }
16613
16614 2 => {
16615 if let Some(value) = self.source_name.take() {
16616 ::fidl_next::wire::Envelope::encode_value::<
16617 ::fidl_next::wire::String<'static>,
16618 ___E,
16619 >(
16620 value, preallocated.encoder, &mut out, 100
16621 )?;
16622 } else {
16623 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16624 }
16625 }
16626
16627 1 => {
16628 if let Some(value) = self.source.take() {
16629 ::fidl_next::wire::Envelope::encode_value::<
16630 crate::wire::Ref<'static>,
16631 ___E,
16632 >(
16633 value, preallocated.encoder, &mut out, ()
16634 )?;
16635 } else {
16636 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16637 }
16638 }
16639
16640 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
16641 }
16642 unsafe {
16643 preallocated.write_next(out.assume_init_ref());
16644 }
16645 }
16646
16647 ::fidl_next::wire::Table::encode_len(table, max_ord);
16648
16649 Ok(())
16650 }
16651 }
16652
16653 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferResolver<'static>, ___E>
16654 for &'a OfferResolver
16655 where
16656 ___E: ::fidl_next::Encoder + ?Sized,
16657 {
16658 #[inline]
16659 fn encode(
16660 self,
16661 encoder: &mut ___E,
16662 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferResolver<'static>>,
16663 _: (),
16664 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16665 ::fidl_next::munge!(let crate::wire::OfferResolver { table } = out);
16666
16667 let max_ord = self.__max_ordinal();
16668
16669 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
16670 ::fidl_next::Wire::zero_padding(&mut out);
16671
16672 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
16673 ::fidl_next::wire::Envelope,
16674 >(encoder, max_ord);
16675
16676 for i in 1..=max_ord {
16677 match i {
16678 5 => {
16679 if let Some(value) = &self.source_dictionary {
16680 ::fidl_next::wire::Envelope::encode_value::<
16681 ::fidl_next::wire::String<'static>,
16682 ___E,
16683 >(
16684 value, preallocated.encoder, &mut out, 1024
16685 )?;
16686 } else {
16687 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16688 }
16689 }
16690
16691 4 => {
16692 if let Some(value) = &self.target_name {
16693 ::fidl_next::wire::Envelope::encode_value::<
16694 ::fidl_next::wire::String<'static>,
16695 ___E,
16696 >(
16697 value, preallocated.encoder, &mut out, 100
16698 )?;
16699 } else {
16700 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16701 }
16702 }
16703
16704 3 => {
16705 if let Some(value) = &self.target {
16706 ::fidl_next::wire::Envelope::encode_value::<
16707 crate::wire::Ref<'static>,
16708 ___E,
16709 >(
16710 value, preallocated.encoder, &mut out, ()
16711 )?;
16712 } else {
16713 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16714 }
16715 }
16716
16717 2 => {
16718 if let Some(value) = &self.source_name {
16719 ::fidl_next::wire::Envelope::encode_value::<
16720 ::fidl_next::wire::String<'static>,
16721 ___E,
16722 >(
16723 value, preallocated.encoder, &mut out, 100
16724 )?;
16725 } else {
16726 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16727 }
16728 }
16729
16730 1 => {
16731 if let Some(value) = &self.source {
16732 ::fidl_next::wire::Envelope::encode_value::<
16733 crate::wire::Ref<'static>,
16734 ___E,
16735 >(
16736 value, preallocated.encoder, &mut out, ()
16737 )?;
16738 } else {
16739 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16740 }
16741 }
16742
16743 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
16744 }
16745 unsafe {
16746 preallocated.write_next(out.assume_init_ref());
16747 }
16748 }
16749
16750 ::fidl_next::wire::Table::encode_len(table, max_ord);
16751
16752 Ok(())
16753 }
16754 }
16755
16756 impl<'de> ::fidl_next::FromWire<crate::wire::OfferResolver<'de>> for OfferResolver {
16757 #[inline]
16758 fn from_wire(wire_: crate::wire::OfferResolver<'de>) -> Self {
16759 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
16760
16761 let source = wire_.table.get(1);
16762
16763 let source_name = wire_.table.get(2);
16764
16765 let target = wire_.table.get(3);
16766
16767 let target_name = wire_.table.get(4);
16768
16769 let source_dictionary = wire_.table.get(5);
16770
16771 Self {
16772 source: source.map(|envelope| {
16773 ::fidl_next::FromWire::from_wire(unsafe {
16774 envelope.read_unchecked::<crate::wire::Ref<'de>>()
16775 })
16776 }),
16777
16778 source_name: source_name.map(|envelope| {
16779 ::fidl_next::FromWire::from_wire(unsafe {
16780 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
16781 })
16782 }),
16783
16784 target: target.map(|envelope| {
16785 ::fidl_next::FromWire::from_wire(unsafe {
16786 envelope.read_unchecked::<crate::wire::Ref<'de>>()
16787 })
16788 }),
16789
16790 target_name: target_name.map(|envelope| {
16791 ::fidl_next::FromWire::from_wire(unsafe {
16792 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
16793 })
16794 }),
16795
16796 source_dictionary: source_dictionary.map(|envelope| {
16797 ::fidl_next::FromWire::from_wire(unsafe {
16798 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
16799 })
16800 }),
16801 }
16802 }
16803 }
16804
16805 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferResolver<'de>> for OfferResolver {
16806 #[inline]
16807 fn from_wire_ref(wire: &crate::wire::OfferResolver<'de>) -> Self {
16808 Self {
16809 source: wire.table.get(1).map(|envelope| {
16810 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16811 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
16812 })
16813 }),
16814
16815 source_name: wire.table.get(2).map(|envelope| {
16816 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16817 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
16818 })
16819 }),
16820
16821 target: wire.table.get(3).map(|envelope| {
16822 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16823 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
16824 })
16825 }),
16826
16827 target_name: wire.table.get(4).map(|envelope| {
16828 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16829 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
16830 })
16831 }),
16832
16833 source_dictionary: wire.table.get(5).map(|envelope| {
16834 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16835 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
16836 })
16837 }),
16838 }
16839 }
16840 }
16841
16842 #[doc = " Declares an event stream offered by a component.\n"]
16843 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
16844 pub struct OfferEventStream {
16845 pub source: ::core::option::Option<crate::natural::Ref>,
16846
16847 pub source_name: ::core::option::Option<::std::string::String>,
16848
16849 pub scope: ::core::option::Option<::std::vec::Vec<crate::natural::Ref>>,
16850
16851 pub target: ::core::option::Option<crate::natural::Ref>,
16852
16853 pub target_name: ::core::option::Option<::std::string::String>,
16854
16855 pub availability: ::core::option::Option<crate::natural::Availability>,
16856 }
16857
16858 impl OfferEventStream {
16859 fn __max_ordinal(&self) -> usize {
16860 if self.availability.is_some() {
16861 return 7;
16862 }
16863
16864 if self.target_name.is_some() {
16865 return 5;
16866 }
16867
16868 if self.target.is_some() {
16869 return 4;
16870 }
16871
16872 if self.scope.is_some() {
16873 return 3;
16874 }
16875
16876 if self.source_name.is_some() {
16877 return 2;
16878 }
16879
16880 if self.source.is_some() {
16881 return 1;
16882 }
16883
16884 0
16885 }
16886 }
16887
16888 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferEventStream<'static>, ___E>
16889 for OfferEventStream
16890 where
16891 ___E: ::fidl_next::Encoder + ?Sized,
16892 {
16893 #[inline]
16894 fn encode(
16895 mut self,
16896 encoder: &mut ___E,
16897 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferEventStream<'static>>,
16898 _: (),
16899 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16900 ::fidl_next::munge!(let crate::wire::OfferEventStream { table } = out);
16901
16902 let max_ord = self.__max_ordinal();
16903
16904 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
16905 ::fidl_next::Wire::zero_padding(&mut out);
16906
16907 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
16908 ::fidl_next::wire::Envelope,
16909 >(encoder, max_ord);
16910
16911 for i in 1..=max_ord {
16912 match i {
16913 7 => {
16914 if let Some(value) = self.availability.take() {
16915 ::fidl_next::wire::Envelope::encode_value::<
16916 crate::wire::Availability,
16917 ___E,
16918 >(
16919 value, preallocated.encoder, &mut out, ()
16920 )?;
16921 } else {
16922 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16923 }
16924 }
16925
16926 5 => {
16927 if let Some(value) = self.target_name.take() {
16928 ::fidl_next::wire::Envelope::encode_value::<
16929 ::fidl_next::wire::String<'static>,
16930 ___E,
16931 >(
16932 value, preallocated.encoder, &mut out, 100
16933 )?;
16934 } else {
16935 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16936 }
16937 }
16938
16939 4 => {
16940 if let Some(value) = self.target.take() {
16941 ::fidl_next::wire::Envelope::encode_value::<
16942 crate::wire::Ref<'static>,
16943 ___E,
16944 >(
16945 value, preallocated.encoder, &mut out, ()
16946 )?;
16947 } else {
16948 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16949 }
16950 }
16951
16952 3 => {
16953 if let Some(value) = self.scope.take() {
16954 ::fidl_next::wire::Envelope::encode_value::<
16955 ::fidl_next::wire::Vector<'static, crate::wire::Ref<'static>>,
16956 ___E,
16957 >(
16958 value, preallocated.encoder, &mut out, (4294967295, ())
16959 )?;
16960 } else {
16961 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16962 }
16963 }
16964
16965 2 => {
16966 if let Some(value) = self.source_name.take() {
16967 ::fidl_next::wire::Envelope::encode_value::<
16968 ::fidl_next::wire::String<'static>,
16969 ___E,
16970 >(
16971 value, preallocated.encoder, &mut out, 100
16972 )?;
16973 } else {
16974 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16975 }
16976 }
16977
16978 1 => {
16979 if let Some(value) = self.source.take() {
16980 ::fidl_next::wire::Envelope::encode_value::<
16981 crate::wire::Ref<'static>,
16982 ___E,
16983 >(
16984 value, preallocated.encoder, &mut out, ()
16985 )?;
16986 } else {
16987 ::fidl_next::wire::Envelope::encode_zero(&mut out)
16988 }
16989 }
16990
16991 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
16992 }
16993 unsafe {
16994 preallocated.write_next(out.assume_init_ref());
16995 }
16996 }
16997
16998 ::fidl_next::wire::Table::encode_len(table, max_ord);
16999
17000 Ok(())
17001 }
17002 }
17003
17004 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferEventStream<'static>, ___E>
17005 for &'a OfferEventStream
17006 where
17007 ___E: ::fidl_next::Encoder + ?Sized,
17008 {
17009 #[inline]
17010 fn encode(
17011 self,
17012 encoder: &mut ___E,
17013 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferEventStream<'static>>,
17014 _: (),
17015 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17016 ::fidl_next::munge!(let crate::wire::OfferEventStream { table } = out);
17017
17018 let max_ord = self.__max_ordinal();
17019
17020 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
17021 ::fidl_next::Wire::zero_padding(&mut out);
17022
17023 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
17024 ::fidl_next::wire::Envelope,
17025 >(encoder, max_ord);
17026
17027 for i in 1..=max_ord {
17028 match i {
17029 7 => {
17030 if let Some(value) = &self.availability {
17031 ::fidl_next::wire::Envelope::encode_value::<
17032 crate::wire::Availability,
17033 ___E,
17034 >(
17035 value, preallocated.encoder, &mut out, ()
17036 )?;
17037 } else {
17038 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17039 }
17040 }
17041
17042 5 => {
17043 if let Some(value) = &self.target_name {
17044 ::fidl_next::wire::Envelope::encode_value::<
17045 ::fidl_next::wire::String<'static>,
17046 ___E,
17047 >(
17048 value, preallocated.encoder, &mut out, 100
17049 )?;
17050 } else {
17051 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17052 }
17053 }
17054
17055 4 => {
17056 if let Some(value) = &self.target {
17057 ::fidl_next::wire::Envelope::encode_value::<
17058 crate::wire::Ref<'static>,
17059 ___E,
17060 >(
17061 value, preallocated.encoder, &mut out, ()
17062 )?;
17063 } else {
17064 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17065 }
17066 }
17067
17068 3 => {
17069 if let Some(value) = &self.scope {
17070 ::fidl_next::wire::Envelope::encode_value::<
17071 ::fidl_next::wire::Vector<'static, crate::wire::Ref<'static>>,
17072 ___E,
17073 >(
17074 value, preallocated.encoder, &mut out, (4294967295, ())
17075 )?;
17076 } else {
17077 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17078 }
17079 }
17080
17081 2 => {
17082 if let Some(value) = &self.source_name {
17083 ::fidl_next::wire::Envelope::encode_value::<
17084 ::fidl_next::wire::String<'static>,
17085 ___E,
17086 >(
17087 value, preallocated.encoder, &mut out, 100
17088 )?;
17089 } else {
17090 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17091 }
17092 }
17093
17094 1 => {
17095 if let Some(value) = &self.source {
17096 ::fidl_next::wire::Envelope::encode_value::<
17097 crate::wire::Ref<'static>,
17098 ___E,
17099 >(
17100 value, preallocated.encoder, &mut out, ()
17101 )?;
17102 } else {
17103 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17104 }
17105 }
17106
17107 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
17108 }
17109 unsafe {
17110 preallocated.write_next(out.assume_init_ref());
17111 }
17112 }
17113
17114 ::fidl_next::wire::Table::encode_len(table, max_ord);
17115
17116 Ok(())
17117 }
17118 }
17119
17120 impl<'de> ::fidl_next::FromWire<crate::wire::OfferEventStream<'de>> for OfferEventStream {
17121 #[inline]
17122 fn from_wire(wire_: crate::wire::OfferEventStream<'de>) -> Self {
17123 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
17124
17125 let source = wire_.table.get(1);
17126
17127 let source_name = wire_.table.get(2);
17128
17129 let scope = wire_.table.get(3);
17130
17131 let target = wire_.table.get(4);
17132
17133 let target_name = wire_.table.get(5);
17134
17135 let availability = wire_.table.get(7);
17136
17137 Self {
17138
17139
17140 source: source.map(|envelope| ::fidl_next::FromWire::from_wire(
17141 unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() }
17142 )),
17143
17144
17145 source_name: source_name.map(|envelope| ::fidl_next::FromWire::from_wire(
17146 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
17147 )),
17148
17149
17150 scope: scope.map(|envelope| ::fidl_next::FromWire::from_wire(
17151 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>>() }
17152 )),
17153
17154
17155 target: target.map(|envelope| ::fidl_next::FromWire::from_wire(
17156 unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() }
17157 )),
17158
17159
17160 target_name: target_name.map(|envelope| ::fidl_next::FromWire::from_wire(
17161 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
17162 )),
17163
17164
17165 availability: availability.map(|envelope| ::fidl_next::FromWire::from_wire(
17166 unsafe { envelope.read_unchecked::<crate::wire::Availability>() }
17167 )),
17168
17169 }
17170 }
17171 }
17172
17173 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferEventStream<'de>> for OfferEventStream {
17174 #[inline]
17175 fn from_wire_ref(wire: &crate::wire::OfferEventStream<'de>) -> Self {
17176 Self {
17177
17178
17179 source: wire.table.get(1)
17180 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
17181 unsafe { envelope.deref_unchecked::<crate::wire::Ref<'de>>() }
17182 )),
17183
17184
17185 source_name: wire.table.get(2)
17186 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
17187 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
17188 )),
17189
17190
17191 scope: wire.table.get(3)
17192 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
17193 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>>() }
17194 )),
17195
17196
17197 target: wire.table.get(4)
17198 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
17199 unsafe { envelope.deref_unchecked::<crate::wire::Ref<'de>>() }
17200 )),
17201
17202
17203 target_name: wire.table.get(5)
17204 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
17205 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
17206 )),
17207
17208
17209 availability: wire.table.get(7)
17210 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
17211 unsafe { envelope.deref_unchecked::<crate::wire::Availability>() }
17212 )),
17213
17214 }
17215 }
17216 }
17217
17218 #[doc = " Declares a dictionary offered by a component to one of its children,\n which may have been offered by the component\'s containing realm, the\n component itself, or one of its other children.\n\n To learn more about dictionaries, see:\n https://fuchsia.dev/fuchsia-src/glossary#dictionary\n"]
17219 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
17220 pub struct OfferDictionary {
17221 pub source: ::core::option::Option<crate::natural::Ref>,
17222
17223 pub source_name: ::core::option::Option<::std::string::String>,
17224
17225 pub target: ::core::option::Option<crate::natural::Ref>,
17226
17227 pub target_name: ::core::option::Option<::std::string::String>,
17228
17229 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
17230
17231 pub availability: ::core::option::Option<crate::natural::Availability>,
17232
17233 pub source_dictionary: ::core::option::Option<::std::string::String>,
17234 }
17235
17236 impl OfferDictionary {
17237 fn __max_ordinal(&self) -> usize {
17238 if self.source_dictionary.is_some() {
17239 return 7;
17240 }
17241
17242 if self.availability.is_some() {
17243 return 6;
17244 }
17245
17246 if self.dependency_type.is_some() {
17247 return 5;
17248 }
17249
17250 if self.target_name.is_some() {
17251 return 4;
17252 }
17253
17254 if self.target.is_some() {
17255 return 3;
17256 }
17257
17258 if self.source_name.is_some() {
17259 return 2;
17260 }
17261
17262 if self.source.is_some() {
17263 return 1;
17264 }
17265
17266 0
17267 }
17268 }
17269
17270 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferDictionary<'static>, ___E>
17271 for OfferDictionary
17272 where
17273 ___E: ::fidl_next::Encoder + ?Sized,
17274 {
17275 #[inline]
17276 fn encode(
17277 mut self,
17278 encoder: &mut ___E,
17279 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferDictionary<'static>>,
17280 _: (),
17281 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17282 ::fidl_next::munge!(let crate::wire::OfferDictionary { table } = out);
17283
17284 let max_ord = self.__max_ordinal();
17285
17286 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
17287 ::fidl_next::Wire::zero_padding(&mut out);
17288
17289 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
17290 ::fidl_next::wire::Envelope,
17291 >(encoder, max_ord);
17292
17293 for i in 1..=max_ord {
17294 match i {
17295 7 => {
17296 if let Some(value) = self.source_dictionary.take() {
17297 ::fidl_next::wire::Envelope::encode_value::<
17298 ::fidl_next::wire::String<'static>,
17299 ___E,
17300 >(
17301 value, preallocated.encoder, &mut out, 1024
17302 )?;
17303 } else {
17304 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17305 }
17306 }
17307
17308 6 => {
17309 if let Some(value) = self.availability.take() {
17310 ::fidl_next::wire::Envelope::encode_value::<
17311 crate::wire::Availability,
17312 ___E,
17313 >(
17314 value, preallocated.encoder, &mut out, ()
17315 )?;
17316 } else {
17317 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17318 }
17319 }
17320
17321 5 => {
17322 if let Some(value) = self.dependency_type.take() {
17323 ::fidl_next::wire::Envelope::encode_value::<
17324 crate::wire::DependencyType,
17325 ___E,
17326 >(
17327 value, preallocated.encoder, &mut out, ()
17328 )?;
17329 } else {
17330 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17331 }
17332 }
17333
17334 4 => {
17335 if let Some(value) = self.target_name.take() {
17336 ::fidl_next::wire::Envelope::encode_value::<
17337 ::fidl_next::wire::String<'static>,
17338 ___E,
17339 >(
17340 value, preallocated.encoder, &mut out, 100
17341 )?;
17342 } else {
17343 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17344 }
17345 }
17346
17347 3 => {
17348 if let Some(value) = self.target.take() {
17349 ::fidl_next::wire::Envelope::encode_value::<
17350 crate::wire::Ref<'static>,
17351 ___E,
17352 >(
17353 value, preallocated.encoder, &mut out, ()
17354 )?;
17355 } else {
17356 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17357 }
17358 }
17359
17360 2 => {
17361 if let Some(value) = self.source_name.take() {
17362 ::fidl_next::wire::Envelope::encode_value::<
17363 ::fidl_next::wire::String<'static>,
17364 ___E,
17365 >(
17366 value, preallocated.encoder, &mut out, 100
17367 )?;
17368 } else {
17369 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17370 }
17371 }
17372
17373 1 => {
17374 if let Some(value) = self.source.take() {
17375 ::fidl_next::wire::Envelope::encode_value::<
17376 crate::wire::Ref<'static>,
17377 ___E,
17378 >(
17379 value, preallocated.encoder, &mut out, ()
17380 )?;
17381 } else {
17382 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17383 }
17384 }
17385
17386 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
17387 }
17388 unsafe {
17389 preallocated.write_next(out.assume_init_ref());
17390 }
17391 }
17392
17393 ::fidl_next::wire::Table::encode_len(table, max_ord);
17394
17395 Ok(())
17396 }
17397 }
17398
17399 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferDictionary<'static>, ___E>
17400 for &'a OfferDictionary
17401 where
17402 ___E: ::fidl_next::Encoder + ?Sized,
17403 {
17404 #[inline]
17405 fn encode(
17406 self,
17407 encoder: &mut ___E,
17408 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferDictionary<'static>>,
17409 _: (),
17410 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17411 ::fidl_next::munge!(let crate::wire::OfferDictionary { table } = out);
17412
17413 let max_ord = self.__max_ordinal();
17414
17415 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
17416 ::fidl_next::Wire::zero_padding(&mut out);
17417
17418 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
17419 ::fidl_next::wire::Envelope,
17420 >(encoder, max_ord);
17421
17422 for i in 1..=max_ord {
17423 match i {
17424 7 => {
17425 if let Some(value) = &self.source_dictionary {
17426 ::fidl_next::wire::Envelope::encode_value::<
17427 ::fidl_next::wire::String<'static>,
17428 ___E,
17429 >(
17430 value, preallocated.encoder, &mut out, 1024
17431 )?;
17432 } else {
17433 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17434 }
17435 }
17436
17437 6 => {
17438 if let Some(value) = &self.availability {
17439 ::fidl_next::wire::Envelope::encode_value::<
17440 crate::wire::Availability,
17441 ___E,
17442 >(
17443 value, preallocated.encoder, &mut out, ()
17444 )?;
17445 } else {
17446 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17447 }
17448 }
17449
17450 5 => {
17451 if let Some(value) = &self.dependency_type {
17452 ::fidl_next::wire::Envelope::encode_value::<
17453 crate::wire::DependencyType,
17454 ___E,
17455 >(
17456 value, preallocated.encoder, &mut out, ()
17457 )?;
17458 } else {
17459 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17460 }
17461 }
17462
17463 4 => {
17464 if let Some(value) = &self.target_name {
17465 ::fidl_next::wire::Envelope::encode_value::<
17466 ::fidl_next::wire::String<'static>,
17467 ___E,
17468 >(
17469 value, preallocated.encoder, &mut out, 100
17470 )?;
17471 } else {
17472 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17473 }
17474 }
17475
17476 3 => {
17477 if let Some(value) = &self.target {
17478 ::fidl_next::wire::Envelope::encode_value::<
17479 crate::wire::Ref<'static>,
17480 ___E,
17481 >(
17482 value, preallocated.encoder, &mut out, ()
17483 )?;
17484 } else {
17485 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17486 }
17487 }
17488
17489 2 => {
17490 if let Some(value) = &self.source_name {
17491 ::fidl_next::wire::Envelope::encode_value::<
17492 ::fidl_next::wire::String<'static>,
17493 ___E,
17494 >(
17495 value, preallocated.encoder, &mut out, 100
17496 )?;
17497 } else {
17498 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17499 }
17500 }
17501
17502 1 => {
17503 if let Some(value) = &self.source {
17504 ::fidl_next::wire::Envelope::encode_value::<
17505 crate::wire::Ref<'static>,
17506 ___E,
17507 >(
17508 value, preallocated.encoder, &mut out, ()
17509 )?;
17510 } else {
17511 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17512 }
17513 }
17514
17515 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
17516 }
17517 unsafe {
17518 preallocated.write_next(out.assume_init_ref());
17519 }
17520 }
17521
17522 ::fidl_next::wire::Table::encode_len(table, max_ord);
17523
17524 Ok(())
17525 }
17526 }
17527
17528 impl<'de> ::fidl_next::FromWire<crate::wire::OfferDictionary<'de>> for OfferDictionary {
17529 #[inline]
17530 fn from_wire(wire_: crate::wire::OfferDictionary<'de>) -> Self {
17531 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
17532
17533 let source = wire_.table.get(1);
17534
17535 let source_name = wire_.table.get(2);
17536
17537 let target = wire_.table.get(3);
17538
17539 let target_name = wire_.table.get(4);
17540
17541 let dependency_type = wire_.table.get(5);
17542
17543 let availability = wire_.table.get(6);
17544
17545 let source_dictionary = wire_.table.get(7);
17546
17547 Self {
17548 source: source.map(|envelope| {
17549 ::fidl_next::FromWire::from_wire(unsafe {
17550 envelope.read_unchecked::<crate::wire::Ref<'de>>()
17551 })
17552 }),
17553
17554 source_name: source_name.map(|envelope| {
17555 ::fidl_next::FromWire::from_wire(unsafe {
17556 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
17557 })
17558 }),
17559
17560 target: target.map(|envelope| {
17561 ::fidl_next::FromWire::from_wire(unsafe {
17562 envelope.read_unchecked::<crate::wire::Ref<'de>>()
17563 })
17564 }),
17565
17566 target_name: target_name.map(|envelope| {
17567 ::fidl_next::FromWire::from_wire(unsafe {
17568 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
17569 })
17570 }),
17571
17572 dependency_type: dependency_type.map(|envelope| {
17573 ::fidl_next::FromWire::from_wire(unsafe {
17574 envelope.read_unchecked::<crate::wire::DependencyType>()
17575 })
17576 }),
17577
17578 availability: availability.map(|envelope| {
17579 ::fidl_next::FromWire::from_wire(unsafe {
17580 envelope.read_unchecked::<crate::wire::Availability>()
17581 })
17582 }),
17583
17584 source_dictionary: source_dictionary.map(|envelope| {
17585 ::fidl_next::FromWire::from_wire(unsafe {
17586 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
17587 })
17588 }),
17589 }
17590 }
17591 }
17592
17593 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferDictionary<'de>> for OfferDictionary {
17594 #[inline]
17595 fn from_wire_ref(wire: &crate::wire::OfferDictionary<'de>) -> Self {
17596 Self {
17597 source: wire.table.get(1).map(|envelope| {
17598 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17599 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
17600 })
17601 }),
17602
17603 source_name: wire.table.get(2).map(|envelope| {
17604 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17605 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
17606 })
17607 }),
17608
17609 target: wire.table.get(3).map(|envelope| {
17610 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17611 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
17612 })
17613 }),
17614
17615 target_name: wire.table.get(4).map(|envelope| {
17616 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17617 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
17618 })
17619 }),
17620
17621 dependency_type: wire.table.get(5).map(|envelope| {
17622 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17623 envelope.deref_unchecked::<crate::wire::DependencyType>()
17624 })
17625 }),
17626
17627 availability: wire.table.get(6).map(|envelope| {
17628 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17629 envelope.deref_unchecked::<crate::wire::Availability>()
17630 })
17631 }),
17632
17633 source_dictionary: wire.table.get(7).map(|envelope| {
17634 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17635 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
17636 })
17637 }),
17638 }
17639 }
17640 }
17641
17642 #[doc = " Declares a configuration capability offered by a component to one of its children,\n which may have been offered by the component\'s containing realm, the\n component itself, or one of its other children.\n"]
17643 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
17644 pub struct OfferConfiguration {
17645 pub source: ::core::option::Option<crate::natural::Ref>,
17646
17647 pub source_name: ::core::option::Option<::std::string::String>,
17648
17649 pub target: ::core::option::Option<crate::natural::Ref>,
17650
17651 pub target_name: ::core::option::Option<::std::string::String>,
17652
17653 pub availability: ::core::option::Option<crate::natural::Availability>,
17654
17655 pub source_dictionary: ::core::option::Option<::std::string::String>,
17656 }
17657
17658 impl OfferConfiguration {
17659 fn __max_ordinal(&self) -> usize {
17660 if self.source_dictionary.is_some() {
17661 return 6;
17662 }
17663
17664 if self.availability.is_some() {
17665 return 5;
17666 }
17667
17668 if self.target_name.is_some() {
17669 return 4;
17670 }
17671
17672 if self.target.is_some() {
17673 return 3;
17674 }
17675
17676 if self.source_name.is_some() {
17677 return 2;
17678 }
17679
17680 if self.source.is_some() {
17681 return 1;
17682 }
17683
17684 0
17685 }
17686 }
17687
17688 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferConfiguration<'static>, ___E>
17689 for OfferConfiguration
17690 where
17691 ___E: ::fidl_next::Encoder + ?Sized,
17692 {
17693 #[inline]
17694 fn encode(
17695 mut self,
17696 encoder: &mut ___E,
17697 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferConfiguration<'static>>,
17698 _: (),
17699 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17700 ::fidl_next::munge!(let crate::wire::OfferConfiguration { table } = out);
17701
17702 let max_ord = self.__max_ordinal();
17703
17704 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
17705 ::fidl_next::Wire::zero_padding(&mut out);
17706
17707 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
17708 ::fidl_next::wire::Envelope,
17709 >(encoder, max_ord);
17710
17711 for i in 1..=max_ord {
17712 match i {
17713 6 => {
17714 if let Some(value) = self.source_dictionary.take() {
17715 ::fidl_next::wire::Envelope::encode_value::<
17716 ::fidl_next::wire::String<'static>,
17717 ___E,
17718 >(
17719 value, preallocated.encoder, &mut out, 1024
17720 )?;
17721 } else {
17722 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17723 }
17724 }
17725
17726 5 => {
17727 if let Some(value) = self.availability.take() {
17728 ::fidl_next::wire::Envelope::encode_value::<
17729 crate::wire::Availability,
17730 ___E,
17731 >(
17732 value, preallocated.encoder, &mut out, ()
17733 )?;
17734 } else {
17735 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17736 }
17737 }
17738
17739 4 => {
17740 if let Some(value) = self.target_name.take() {
17741 ::fidl_next::wire::Envelope::encode_value::<
17742 ::fidl_next::wire::String<'static>,
17743 ___E,
17744 >(
17745 value, preallocated.encoder, &mut out, 100
17746 )?;
17747 } else {
17748 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17749 }
17750 }
17751
17752 3 => {
17753 if let Some(value) = self.target.take() {
17754 ::fidl_next::wire::Envelope::encode_value::<
17755 crate::wire::Ref<'static>,
17756 ___E,
17757 >(
17758 value, preallocated.encoder, &mut out, ()
17759 )?;
17760 } else {
17761 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17762 }
17763 }
17764
17765 2 => {
17766 if let Some(value) = self.source_name.take() {
17767 ::fidl_next::wire::Envelope::encode_value::<
17768 ::fidl_next::wire::String<'static>,
17769 ___E,
17770 >(
17771 value, preallocated.encoder, &mut out, 100
17772 )?;
17773 } else {
17774 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17775 }
17776 }
17777
17778 1 => {
17779 if let Some(value) = self.source.take() {
17780 ::fidl_next::wire::Envelope::encode_value::<
17781 crate::wire::Ref<'static>,
17782 ___E,
17783 >(
17784 value, preallocated.encoder, &mut out, ()
17785 )?;
17786 } else {
17787 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17788 }
17789 }
17790
17791 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
17792 }
17793 unsafe {
17794 preallocated.write_next(out.assume_init_ref());
17795 }
17796 }
17797
17798 ::fidl_next::wire::Table::encode_len(table, max_ord);
17799
17800 Ok(())
17801 }
17802 }
17803
17804 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferConfiguration<'static>, ___E>
17805 for &'a OfferConfiguration
17806 where
17807 ___E: ::fidl_next::Encoder + ?Sized,
17808 {
17809 #[inline]
17810 fn encode(
17811 self,
17812 encoder: &mut ___E,
17813 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferConfiguration<'static>>,
17814 _: (),
17815 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17816 ::fidl_next::munge!(let crate::wire::OfferConfiguration { table } = out);
17817
17818 let max_ord = self.__max_ordinal();
17819
17820 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
17821 ::fidl_next::Wire::zero_padding(&mut out);
17822
17823 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
17824 ::fidl_next::wire::Envelope,
17825 >(encoder, max_ord);
17826
17827 for i in 1..=max_ord {
17828 match i {
17829 6 => {
17830 if let Some(value) = &self.source_dictionary {
17831 ::fidl_next::wire::Envelope::encode_value::<
17832 ::fidl_next::wire::String<'static>,
17833 ___E,
17834 >(
17835 value, preallocated.encoder, &mut out, 1024
17836 )?;
17837 } else {
17838 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17839 }
17840 }
17841
17842 5 => {
17843 if let Some(value) = &self.availability {
17844 ::fidl_next::wire::Envelope::encode_value::<
17845 crate::wire::Availability,
17846 ___E,
17847 >(
17848 value, preallocated.encoder, &mut out, ()
17849 )?;
17850 } else {
17851 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17852 }
17853 }
17854
17855 4 => {
17856 if let Some(value) = &self.target_name {
17857 ::fidl_next::wire::Envelope::encode_value::<
17858 ::fidl_next::wire::String<'static>,
17859 ___E,
17860 >(
17861 value, preallocated.encoder, &mut out, 100
17862 )?;
17863 } else {
17864 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17865 }
17866 }
17867
17868 3 => {
17869 if let Some(value) = &self.target {
17870 ::fidl_next::wire::Envelope::encode_value::<
17871 crate::wire::Ref<'static>,
17872 ___E,
17873 >(
17874 value, preallocated.encoder, &mut out, ()
17875 )?;
17876 } else {
17877 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17878 }
17879 }
17880
17881 2 => {
17882 if let Some(value) = &self.source_name {
17883 ::fidl_next::wire::Envelope::encode_value::<
17884 ::fidl_next::wire::String<'static>,
17885 ___E,
17886 >(
17887 value, preallocated.encoder, &mut out, 100
17888 )?;
17889 } else {
17890 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17891 }
17892 }
17893
17894 1 => {
17895 if let Some(value) = &self.source {
17896 ::fidl_next::wire::Envelope::encode_value::<
17897 crate::wire::Ref<'static>,
17898 ___E,
17899 >(
17900 value, preallocated.encoder, &mut out, ()
17901 )?;
17902 } else {
17903 ::fidl_next::wire::Envelope::encode_zero(&mut out)
17904 }
17905 }
17906
17907 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
17908 }
17909 unsafe {
17910 preallocated.write_next(out.assume_init_ref());
17911 }
17912 }
17913
17914 ::fidl_next::wire::Table::encode_len(table, max_ord);
17915
17916 Ok(())
17917 }
17918 }
17919
17920 impl<'de> ::fidl_next::FromWire<crate::wire::OfferConfiguration<'de>> for OfferConfiguration {
17921 #[inline]
17922 fn from_wire(wire_: crate::wire::OfferConfiguration<'de>) -> Self {
17923 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
17924
17925 let source = wire_.table.get(1);
17926
17927 let source_name = wire_.table.get(2);
17928
17929 let target = wire_.table.get(3);
17930
17931 let target_name = wire_.table.get(4);
17932
17933 let availability = wire_.table.get(5);
17934
17935 let source_dictionary = wire_.table.get(6);
17936
17937 Self {
17938 source: source.map(|envelope| {
17939 ::fidl_next::FromWire::from_wire(unsafe {
17940 envelope.read_unchecked::<crate::wire::Ref<'de>>()
17941 })
17942 }),
17943
17944 source_name: source_name.map(|envelope| {
17945 ::fidl_next::FromWire::from_wire(unsafe {
17946 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
17947 })
17948 }),
17949
17950 target: target.map(|envelope| {
17951 ::fidl_next::FromWire::from_wire(unsafe {
17952 envelope.read_unchecked::<crate::wire::Ref<'de>>()
17953 })
17954 }),
17955
17956 target_name: target_name.map(|envelope| {
17957 ::fidl_next::FromWire::from_wire(unsafe {
17958 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
17959 })
17960 }),
17961
17962 availability: availability.map(|envelope| {
17963 ::fidl_next::FromWire::from_wire(unsafe {
17964 envelope.read_unchecked::<crate::wire::Availability>()
17965 })
17966 }),
17967
17968 source_dictionary: source_dictionary.map(|envelope| {
17969 ::fidl_next::FromWire::from_wire(unsafe {
17970 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
17971 })
17972 }),
17973 }
17974 }
17975 }
17976
17977 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferConfiguration<'de>> for OfferConfiguration {
17978 #[inline]
17979 fn from_wire_ref(wire: &crate::wire::OfferConfiguration<'de>) -> Self {
17980 Self {
17981 source: wire.table.get(1).map(|envelope| {
17982 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17983 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
17984 })
17985 }),
17986
17987 source_name: wire.table.get(2).map(|envelope| {
17988 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17989 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
17990 })
17991 }),
17992
17993 target: wire.table.get(3).map(|envelope| {
17994 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17995 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
17996 })
17997 }),
17998
17999 target_name: wire.table.get(4).map(|envelope| {
18000 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18001 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
18002 })
18003 }),
18004
18005 availability: wire.table.get(5).map(|envelope| {
18006 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18007 envelope.deref_unchecked::<crate::wire::Availability>()
18008 })
18009 }),
18010
18011 source_dictionary: wire.table.get(6).map(|envelope| {
18012 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18013 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
18014 })
18015 }),
18016 }
18017 }
18018 }
18019
18020 #[doc = " Declares a capability offered by a component to one of its children, which\n may have been offered by the component\'s containing realm, the component\n itself, or one of its other children.\n"]
18021 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
18022 pub enum Offer {
18023 Service(crate::natural::OfferService),
18024
18025 Protocol(crate::natural::OfferProtocol),
18026
18027 Directory(crate::natural::OfferDirectory),
18028
18029 Storage(crate::natural::OfferStorage),
18030
18031 Runner(crate::natural::OfferRunner),
18032
18033 Resolver(crate::natural::OfferResolver),
18034
18035 EventStream(crate::natural::OfferEventStream),
18036
18037 Dictionary(crate::natural::OfferDictionary),
18038
18039 Config(crate::natural::OfferConfiguration),
18040
18041 UnknownOrdinal_(u64),
18042 }
18043
18044 impl Offer {
18045 pub fn is_unknown(&self) -> bool {
18046 #[allow(unreachable_patterns)]
18047 match self {
18048 Self::UnknownOrdinal_(_) => true,
18049 _ => false,
18050 }
18051 }
18052 }
18053
18054 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Offer<'static>, ___E> for Offer
18055 where
18056 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18057 ___E: ::fidl_next::Encoder,
18058 {
18059 #[inline]
18060 fn encode(
18061 self,
18062 encoder: &mut ___E,
18063 out: &mut ::core::mem::MaybeUninit<crate::wire::Offer<'static>>,
18064 _: (),
18065 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18066 ::fidl_next::munge!(let crate::wire::Offer { raw, _phantom: _ } = out);
18067
18068 match self {
18069 Self::Service(value) => ::fidl_next::wire::Union::encode_as::<
18070 ___E,
18071 crate::wire::OfferService<'static>,
18072 >(value, 1, encoder, raw, ())?,
18073
18074 Self::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
18075 ___E,
18076 crate::wire::OfferProtocol<'static>,
18077 >(value, 2, encoder, raw, ())?,
18078
18079 Self::Directory(value) => ::fidl_next::wire::Union::encode_as::<
18080 ___E,
18081 crate::wire::OfferDirectory<'static>,
18082 >(value, 3, encoder, raw, ())?,
18083
18084 Self::Storage(value) => ::fidl_next::wire::Union::encode_as::<
18085 ___E,
18086 crate::wire::OfferStorage<'static>,
18087 >(value, 4, encoder, raw, ())?,
18088
18089 Self::Runner(value) => ::fidl_next::wire::Union::encode_as::<
18090 ___E,
18091 crate::wire::OfferRunner<'static>,
18092 >(value, 5, encoder, raw, ())?,
18093
18094 Self::Resolver(value) => ::fidl_next::wire::Union::encode_as::<
18095 ___E,
18096 crate::wire::OfferResolver<'static>,
18097 >(value, 6, encoder, raw, ())?,
18098
18099 Self::EventStream(value) => ::fidl_next::wire::Union::encode_as::<
18100 ___E,
18101 crate::wire::OfferEventStream<'static>,
18102 >(value, 8, encoder, raw, ())?,
18103
18104 Self::Dictionary(value) => ::fidl_next::wire::Union::encode_as::<
18105 ___E,
18106 crate::wire::OfferDictionary<'static>,
18107 >(value, 9, encoder, raw, ())?,
18108
18109 Self::Config(value) => ::fidl_next::wire::Union::encode_as::<
18110 ___E,
18111 crate::wire::OfferConfiguration<'static>,
18112 >(value, 10, encoder, raw, ())?,
18113
18114 Self::UnknownOrdinal_(ordinal) => {
18115 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
18116 }
18117 }
18118
18119 Ok(())
18120 }
18121 }
18122
18123 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Offer<'static>, ___E> for &'a Offer
18124 where
18125 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18126 ___E: ::fidl_next::Encoder,
18127 {
18128 #[inline]
18129 fn encode(
18130 self,
18131 encoder: &mut ___E,
18132 out: &mut ::core::mem::MaybeUninit<crate::wire::Offer<'static>>,
18133 _: (),
18134 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18135 ::fidl_next::munge!(let crate::wire::Offer { raw, _phantom: _ } = out);
18136
18137 match self {
18138 Offer::Service(value) => ::fidl_next::wire::Union::encode_as::<
18139 ___E,
18140 crate::wire::OfferService<'static>,
18141 >(value, 1, encoder, raw, ())?,
18142
18143 Offer::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
18144 ___E,
18145 crate::wire::OfferProtocol<'static>,
18146 >(value, 2, encoder, raw, ())?,
18147
18148 Offer::Directory(value) => ::fidl_next::wire::Union::encode_as::<
18149 ___E,
18150 crate::wire::OfferDirectory<'static>,
18151 >(value, 3, encoder, raw, ())?,
18152
18153 Offer::Storage(value) => ::fidl_next::wire::Union::encode_as::<
18154 ___E,
18155 crate::wire::OfferStorage<'static>,
18156 >(value, 4, encoder, raw, ())?,
18157
18158 Offer::Runner(value) => ::fidl_next::wire::Union::encode_as::<
18159 ___E,
18160 crate::wire::OfferRunner<'static>,
18161 >(value, 5, encoder, raw, ())?,
18162
18163 Offer::Resolver(value) => ::fidl_next::wire::Union::encode_as::<
18164 ___E,
18165 crate::wire::OfferResolver<'static>,
18166 >(value, 6, encoder, raw, ())?,
18167
18168 Offer::EventStream(value) => ::fidl_next::wire::Union::encode_as::<
18169 ___E,
18170 crate::wire::OfferEventStream<'static>,
18171 >(value, 8, encoder, raw, ())?,
18172
18173 Offer::Dictionary(value) => ::fidl_next::wire::Union::encode_as::<
18174 ___E,
18175 crate::wire::OfferDictionary<'static>,
18176 >(value, 9, encoder, raw, ())?,
18177
18178 Offer::Config(value) => ::fidl_next::wire::Union::encode_as::<
18179 ___E,
18180 crate::wire::OfferConfiguration<'static>,
18181 >(value, 10, encoder, raw, ())?,
18182
18183 Offer::UnknownOrdinal_(ordinal) => {
18184 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
18185 }
18186 }
18187
18188 Ok(())
18189 }
18190 }
18191
18192 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::Offer<'static>, ___E> for Offer
18193 where
18194 ___E: ?Sized,
18195 Offer: ::fidl_next::Encode<crate::wire::Offer<'static>, ___E>,
18196 {
18197 #[inline]
18198 fn encode_option(
18199 this: ::core::option::Option<Self>,
18200 encoder: &mut ___E,
18201 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Offer<'static>>,
18202 _: (),
18203 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18204 ::fidl_next::munge!(let crate::wire_optional::Offer { raw, _phantom: _ } = &mut *out);
18205
18206 if let Some(inner) = this {
18207 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
18208 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
18209 } else {
18210 ::fidl_next::wire::Union::encode_absent(raw);
18211 }
18212
18213 Ok(())
18214 }
18215 }
18216
18217 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::Offer<'static>, ___E>
18218 for &'a Offer
18219 where
18220 ___E: ?Sized,
18221 &'a Offer: ::fidl_next::Encode<crate::wire::Offer<'static>, ___E>,
18222 {
18223 #[inline]
18224 fn encode_option(
18225 this: ::core::option::Option<Self>,
18226 encoder: &mut ___E,
18227 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Offer<'static>>,
18228 _: (),
18229 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18230 ::fidl_next::munge!(let crate::wire_optional::Offer { raw, _phantom: _ } = &mut *out);
18231
18232 if let Some(inner) = this {
18233 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
18234 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
18235 } else {
18236 ::fidl_next::wire::Union::encode_absent(raw);
18237 }
18238
18239 Ok(())
18240 }
18241 }
18242
18243 impl<'de> ::fidl_next::FromWire<crate::wire::Offer<'de>> for Offer {
18244 #[inline]
18245 fn from_wire(wire: crate::wire::Offer<'de>) -> Self {
18246 let wire = ::core::mem::ManuallyDrop::new(wire);
18247 match wire.raw.ordinal() {
18248 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
18249 wire.raw.get().read_unchecked::<crate::wire::OfferService<'de>>()
18250 })),
18251
18252 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
18253 wire.raw.get().read_unchecked::<crate::wire::OfferProtocol<'de>>()
18254 })),
18255
18256 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
18257 wire.raw.get().read_unchecked::<crate::wire::OfferDirectory<'de>>()
18258 })),
18259
18260 4 => Self::Storage(::fidl_next::FromWire::from_wire(unsafe {
18261 wire.raw.get().read_unchecked::<crate::wire::OfferStorage<'de>>()
18262 })),
18263
18264 5 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
18265 wire.raw.get().read_unchecked::<crate::wire::OfferRunner<'de>>()
18266 })),
18267
18268 6 => Self::Resolver(::fidl_next::FromWire::from_wire(unsafe {
18269 wire.raw.get().read_unchecked::<crate::wire::OfferResolver<'de>>()
18270 })),
18271
18272 8 => Self::EventStream(::fidl_next::FromWire::from_wire(unsafe {
18273 wire.raw.get().read_unchecked::<crate::wire::OfferEventStream<'de>>()
18274 })),
18275
18276 9 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
18277 wire.raw.get().read_unchecked::<crate::wire::OfferDictionary<'de>>()
18278 })),
18279
18280 10 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
18281 wire.raw.get().read_unchecked::<crate::wire::OfferConfiguration<'de>>()
18282 })),
18283
18284 ord => return Self::UnknownOrdinal_(ord as u64),
18285 }
18286 }
18287 }
18288
18289 impl<'de> ::fidl_next::FromWireRef<crate::wire::Offer<'de>> for Offer {
18290 #[inline]
18291 fn from_wire_ref(wire: &crate::wire::Offer<'de>) -> Self {
18292 match wire.raw.ordinal() {
18293 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18294 wire.raw.get().deref_unchecked::<crate::wire::OfferService<'de>>()
18295 })),
18296
18297 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18298 wire.raw.get().deref_unchecked::<crate::wire::OfferProtocol<'de>>()
18299 })),
18300
18301 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18302 wire.raw.get().deref_unchecked::<crate::wire::OfferDirectory<'de>>()
18303 })),
18304
18305 4 => Self::Storage(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18306 wire.raw.get().deref_unchecked::<crate::wire::OfferStorage<'de>>()
18307 })),
18308
18309 5 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18310 wire.raw.get().deref_unchecked::<crate::wire::OfferRunner<'de>>()
18311 })),
18312
18313 6 => Self::Resolver(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18314 wire.raw.get().deref_unchecked::<crate::wire::OfferResolver<'de>>()
18315 })),
18316
18317 8 => Self::EventStream(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18318 wire.raw.get().deref_unchecked::<crate::wire::OfferEventStream<'de>>()
18319 })),
18320
18321 9 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18322 wire.raw.get().deref_unchecked::<crate::wire::OfferDictionary<'de>>()
18323 })),
18324
18325 10 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18326 wire.raw.get().deref_unchecked::<crate::wire::OfferConfiguration<'de>>()
18327 })),
18328
18329 ord => return Self::UnknownOrdinal_(ord as u64),
18330 }
18331 }
18332 }
18333
18334 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Offer<'de>> for Offer {
18335 #[inline]
18336 fn from_wire_option(
18337 wire: crate::wire_optional::Offer<'de>,
18338 ) -> ::core::option::Option<Self> {
18339 if let Some(inner) = wire.into_option() {
18340 Some(::fidl_next::FromWire::from_wire(inner))
18341 } else {
18342 None
18343 }
18344 }
18345 }
18346
18347 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Offer<'de>> for Box<Offer> {
18348 #[inline]
18349 fn from_wire_option(
18350 wire: crate::wire_optional::Offer<'de>,
18351 ) -> ::core::option::Option<Self> {
18352 <
18353 Offer as ::fidl_next::FromWireOption<crate::wire_optional::Offer<'de>>
18354 >::from_wire_option(wire).map(Box::new)
18355 }
18356 }
18357
18358 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::Offer<'de>> for Box<Offer> {
18359 #[inline]
18360 fn from_wire_option_ref(
18361 wire: &crate::wire_optional::Offer<'de>,
18362 ) -> ::core::option::Option<Self> {
18363 if let Some(inner) = wire.as_ref() {
18364 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
18365 } else {
18366 None
18367 }
18368 }
18369 }
18370
18371 #[doc = " A repository of the runners available in an environment.\n"]
18372 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
18373 pub struct RunnerRegistration {
18374 pub source_name: ::core::option::Option<::std::string::String>,
18375
18376 pub source: ::core::option::Option<crate::natural::Ref>,
18377
18378 pub target_name: ::core::option::Option<::std::string::String>,
18379 }
18380
18381 impl RunnerRegistration {
18382 fn __max_ordinal(&self) -> usize {
18383 if self.target_name.is_some() {
18384 return 3;
18385 }
18386
18387 if self.source.is_some() {
18388 return 2;
18389 }
18390
18391 if self.source_name.is_some() {
18392 return 1;
18393 }
18394
18395 0
18396 }
18397 }
18398
18399 unsafe impl<___E> ::fidl_next::Encode<crate::wire::RunnerRegistration<'static>, ___E>
18400 for RunnerRegistration
18401 where
18402 ___E: ::fidl_next::Encoder + ?Sized,
18403 {
18404 #[inline]
18405 fn encode(
18406 mut self,
18407 encoder: &mut ___E,
18408 out: &mut ::core::mem::MaybeUninit<crate::wire::RunnerRegistration<'static>>,
18409 _: (),
18410 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18411 ::fidl_next::munge!(let crate::wire::RunnerRegistration { table } = out);
18412
18413 let max_ord = self.__max_ordinal();
18414
18415 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
18416 ::fidl_next::Wire::zero_padding(&mut out);
18417
18418 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
18419 ::fidl_next::wire::Envelope,
18420 >(encoder, max_ord);
18421
18422 for i in 1..=max_ord {
18423 match i {
18424 3 => {
18425 if let Some(value) = self.target_name.take() {
18426 ::fidl_next::wire::Envelope::encode_value::<
18427 ::fidl_next::wire::String<'static>,
18428 ___E,
18429 >(
18430 value, preallocated.encoder, &mut out, 100
18431 )?;
18432 } else {
18433 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18434 }
18435 }
18436
18437 2 => {
18438 if let Some(value) = self.source.take() {
18439 ::fidl_next::wire::Envelope::encode_value::<
18440 crate::wire::Ref<'static>,
18441 ___E,
18442 >(
18443 value, preallocated.encoder, &mut out, ()
18444 )?;
18445 } else {
18446 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18447 }
18448 }
18449
18450 1 => {
18451 if let Some(value) = self.source_name.take() {
18452 ::fidl_next::wire::Envelope::encode_value::<
18453 ::fidl_next::wire::String<'static>,
18454 ___E,
18455 >(
18456 value, preallocated.encoder, &mut out, 100
18457 )?;
18458 } else {
18459 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18460 }
18461 }
18462
18463 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
18464 }
18465 unsafe {
18466 preallocated.write_next(out.assume_init_ref());
18467 }
18468 }
18469
18470 ::fidl_next::wire::Table::encode_len(table, max_ord);
18471
18472 Ok(())
18473 }
18474 }
18475
18476 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::RunnerRegistration<'static>, ___E>
18477 for &'a RunnerRegistration
18478 where
18479 ___E: ::fidl_next::Encoder + ?Sized,
18480 {
18481 #[inline]
18482 fn encode(
18483 self,
18484 encoder: &mut ___E,
18485 out: &mut ::core::mem::MaybeUninit<crate::wire::RunnerRegistration<'static>>,
18486 _: (),
18487 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18488 ::fidl_next::munge!(let crate::wire::RunnerRegistration { table } = out);
18489
18490 let max_ord = self.__max_ordinal();
18491
18492 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
18493 ::fidl_next::Wire::zero_padding(&mut out);
18494
18495 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
18496 ::fidl_next::wire::Envelope,
18497 >(encoder, max_ord);
18498
18499 for i in 1..=max_ord {
18500 match i {
18501 3 => {
18502 if let Some(value) = &self.target_name {
18503 ::fidl_next::wire::Envelope::encode_value::<
18504 ::fidl_next::wire::String<'static>,
18505 ___E,
18506 >(
18507 value, preallocated.encoder, &mut out, 100
18508 )?;
18509 } else {
18510 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18511 }
18512 }
18513
18514 2 => {
18515 if let Some(value) = &self.source {
18516 ::fidl_next::wire::Envelope::encode_value::<
18517 crate::wire::Ref<'static>,
18518 ___E,
18519 >(
18520 value, preallocated.encoder, &mut out, ()
18521 )?;
18522 } else {
18523 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18524 }
18525 }
18526
18527 1 => {
18528 if let Some(value) = &self.source_name {
18529 ::fidl_next::wire::Envelope::encode_value::<
18530 ::fidl_next::wire::String<'static>,
18531 ___E,
18532 >(
18533 value, preallocated.encoder, &mut out, 100
18534 )?;
18535 } else {
18536 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18537 }
18538 }
18539
18540 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
18541 }
18542 unsafe {
18543 preallocated.write_next(out.assume_init_ref());
18544 }
18545 }
18546
18547 ::fidl_next::wire::Table::encode_len(table, max_ord);
18548
18549 Ok(())
18550 }
18551 }
18552
18553 impl<'de> ::fidl_next::FromWire<crate::wire::RunnerRegistration<'de>> for RunnerRegistration {
18554 #[inline]
18555 fn from_wire(wire_: crate::wire::RunnerRegistration<'de>) -> Self {
18556 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
18557
18558 let source_name = wire_.table.get(1);
18559
18560 let source = wire_.table.get(2);
18561
18562 let target_name = wire_.table.get(3);
18563
18564 Self {
18565 source_name: source_name.map(|envelope| {
18566 ::fidl_next::FromWire::from_wire(unsafe {
18567 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
18568 })
18569 }),
18570
18571 source: source.map(|envelope| {
18572 ::fidl_next::FromWire::from_wire(unsafe {
18573 envelope.read_unchecked::<crate::wire::Ref<'de>>()
18574 })
18575 }),
18576
18577 target_name: target_name.map(|envelope| {
18578 ::fidl_next::FromWire::from_wire(unsafe {
18579 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
18580 })
18581 }),
18582 }
18583 }
18584 }
18585
18586 impl<'de> ::fidl_next::FromWireRef<crate::wire::RunnerRegistration<'de>> for RunnerRegistration {
18587 #[inline]
18588 fn from_wire_ref(wire: &crate::wire::RunnerRegistration<'de>) -> Self {
18589 Self {
18590 source_name: wire.table.get(1).map(|envelope| {
18591 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18592 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
18593 })
18594 }),
18595
18596 source: wire.table.get(2).map(|envelope| {
18597 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18598 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
18599 })
18600 }),
18601
18602 target_name: wire.table.get(3).map(|envelope| {
18603 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18604 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
18605 })
18606 }),
18607 }
18608 }
18609 }
18610
18611 #[doc = " A mapping of URL scheme to resolver name.\n"]
18612 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
18613 pub struct ResolverRegistration {
18614 pub resolver: ::core::option::Option<::std::string::String>,
18615
18616 pub source: ::core::option::Option<crate::natural::Ref>,
18617
18618 pub scheme: ::core::option::Option<::std::string::String>,
18619 }
18620
18621 impl ResolverRegistration {
18622 fn __max_ordinal(&self) -> usize {
18623 if self.scheme.is_some() {
18624 return 3;
18625 }
18626
18627 if self.source.is_some() {
18628 return 2;
18629 }
18630
18631 if self.resolver.is_some() {
18632 return 1;
18633 }
18634
18635 0
18636 }
18637 }
18638
18639 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ResolverRegistration<'static>, ___E>
18640 for ResolverRegistration
18641 where
18642 ___E: ::fidl_next::Encoder + ?Sized,
18643 {
18644 #[inline]
18645 fn encode(
18646 mut self,
18647 encoder: &mut ___E,
18648 out: &mut ::core::mem::MaybeUninit<crate::wire::ResolverRegistration<'static>>,
18649 _: (),
18650 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18651 ::fidl_next::munge!(let crate::wire::ResolverRegistration { table } = out);
18652
18653 let max_ord = self.__max_ordinal();
18654
18655 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
18656 ::fidl_next::Wire::zero_padding(&mut out);
18657
18658 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
18659 ::fidl_next::wire::Envelope,
18660 >(encoder, max_ord);
18661
18662 for i in 1..=max_ord {
18663 match i {
18664 3 => {
18665 if let Some(value) = self.scheme.take() {
18666 ::fidl_next::wire::Envelope::encode_value::<
18667 ::fidl_next::wire::String<'static>,
18668 ___E,
18669 >(
18670 value, preallocated.encoder, &mut out, 100
18671 )?;
18672 } else {
18673 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18674 }
18675 }
18676
18677 2 => {
18678 if let Some(value) = self.source.take() {
18679 ::fidl_next::wire::Envelope::encode_value::<
18680 crate::wire::Ref<'static>,
18681 ___E,
18682 >(
18683 value, preallocated.encoder, &mut out, ()
18684 )?;
18685 } else {
18686 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18687 }
18688 }
18689
18690 1 => {
18691 if let Some(value) = self.resolver.take() {
18692 ::fidl_next::wire::Envelope::encode_value::<
18693 ::fidl_next::wire::String<'static>,
18694 ___E,
18695 >(
18696 value, preallocated.encoder, &mut out, 100
18697 )?;
18698 } else {
18699 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18700 }
18701 }
18702
18703 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
18704 }
18705 unsafe {
18706 preallocated.write_next(out.assume_init_ref());
18707 }
18708 }
18709
18710 ::fidl_next::wire::Table::encode_len(table, max_ord);
18711
18712 Ok(())
18713 }
18714 }
18715
18716 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ResolverRegistration<'static>, ___E>
18717 for &'a ResolverRegistration
18718 where
18719 ___E: ::fidl_next::Encoder + ?Sized,
18720 {
18721 #[inline]
18722 fn encode(
18723 self,
18724 encoder: &mut ___E,
18725 out: &mut ::core::mem::MaybeUninit<crate::wire::ResolverRegistration<'static>>,
18726 _: (),
18727 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18728 ::fidl_next::munge!(let crate::wire::ResolverRegistration { table } = out);
18729
18730 let max_ord = self.__max_ordinal();
18731
18732 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
18733 ::fidl_next::Wire::zero_padding(&mut out);
18734
18735 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
18736 ::fidl_next::wire::Envelope,
18737 >(encoder, max_ord);
18738
18739 for i in 1..=max_ord {
18740 match i {
18741 3 => {
18742 if let Some(value) = &self.scheme {
18743 ::fidl_next::wire::Envelope::encode_value::<
18744 ::fidl_next::wire::String<'static>,
18745 ___E,
18746 >(
18747 value, preallocated.encoder, &mut out, 100
18748 )?;
18749 } else {
18750 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18751 }
18752 }
18753
18754 2 => {
18755 if let Some(value) = &self.source {
18756 ::fidl_next::wire::Envelope::encode_value::<
18757 crate::wire::Ref<'static>,
18758 ___E,
18759 >(
18760 value, preallocated.encoder, &mut out, ()
18761 )?;
18762 } else {
18763 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18764 }
18765 }
18766
18767 1 => {
18768 if let Some(value) = &self.resolver {
18769 ::fidl_next::wire::Envelope::encode_value::<
18770 ::fidl_next::wire::String<'static>,
18771 ___E,
18772 >(
18773 value, preallocated.encoder, &mut out, 100
18774 )?;
18775 } else {
18776 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18777 }
18778 }
18779
18780 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
18781 }
18782 unsafe {
18783 preallocated.write_next(out.assume_init_ref());
18784 }
18785 }
18786
18787 ::fidl_next::wire::Table::encode_len(table, max_ord);
18788
18789 Ok(())
18790 }
18791 }
18792
18793 impl<'de> ::fidl_next::FromWire<crate::wire::ResolverRegistration<'de>> for ResolverRegistration {
18794 #[inline]
18795 fn from_wire(wire_: crate::wire::ResolverRegistration<'de>) -> Self {
18796 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
18797
18798 let resolver = wire_.table.get(1);
18799
18800 let source = wire_.table.get(2);
18801
18802 let scheme = wire_.table.get(3);
18803
18804 Self {
18805 resolver: resolver.map(|envelope| {
18806 ::fidl_next::FromWire::from_wire(unsafe {
18807 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
18808 })
18809 }),
18810
18811 source: source.map(|envelope| {
18812 ::fidl_next::FromWire::from_wire(unsafe {
18813 envelope.read_unchecked::<crate::wire::Ref<'de>>()
18814 })
18815 }),
18816
18817 scheme: scheme.map(|envelope| {
18818 ::fidl_next::FromWire::from_wire(unsafe {
18819 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
18820 })
18821 }),
18822 }
18823 }
18824 }
18825
18826 impl<'de> ::fidl_next::FromWireRef<crate::wire::ResolverRegistration<'de>>
18827 for ResolverRegistration
18828 {
18829 #[inline]
18830 fn from_wire_ref(wire: &crate::wire::ResolverRegistration<'de>) -> Self {
18831 Self {
18832 resolver: wire.table.get(1).map(|envelope| {
18833 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18834 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
18835 })
18836 }),
18837
18838 source: wire.table.get(2).map(|envelope| {
18839 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18840 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
18841 })
18842 }),
18843
18844 scheme: wire.table.get(3).map(|envelope| {
18845 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18846 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
18847 })
18848 }),
18849 }
18850 }
18851 }
18852
18853 #[doc = " Registers a protocol in the environment as a debug capability. This makes\n it available to any component in the environment that uses it with\n `source == debug`.\n\n To learn more about protocols, see:\n https://fuchsia.dev/fuchsia-src/glossary#protocol\n"]
18854 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
18855 pub struct DebugProtocolRegistration {
18856 pub source: ::core::option::Option<crate::natural::Ref>,
18857
18858 pub source_name: ::core::option::Option<::std::string::String>,
18859
18860 pub target_name: ::core::option::Option<::std::string::String>,
18861 }
18862
18863 impl DebugProtocolRegistration {
18864 fn __max_ordinal(&self) -> usize {
18865 if self.target_name.is_some() {
18866 return 3;
18867 }
18868
18869 if self.source_name.is_some() {
18870 return 2;
18871 }
18872
18873 if self.source.is_some() {
18874 return 1;
18875 }
18876
18877 0
18878 }
18879 }
18880
18881 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DebugProtocolRegistration<'static>, ___E>
18882 for DebugProtocolRegistration
18883 where
18884 ___E: ::fidl_next::Encoder + ?Sized,
18885 {
18886 #[inline]
18887 fn encode(
18888 mut self,
18889 encoder: &mut ___E,
18890 out: &mut ::core::mem::MaybeUninit<crate::wire::DebugProtocolRegistration<'static>>,
18891 _: (),
18892 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18893 ::fidl_next::munge!(let crate::wire::DebugProtocolRegistration { table } = out);
18894
18895 let max_ord = self.__max_ordinal();
18896
18897 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
18898 ::fidl_next::Wire::zero_padding(&mut out);
18899
18900 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
18901 ::fidl_next::wire::Envelope,
18902 >(encoder, max_ord);
18903
18904 for i in 1..=max_ord {
18905 match i {
18906 3 => {
18907 if let Some(value) = self.target_name.take() {
18908 ::fidl_next::wire::Envelope::encode_value::<
18909 ::fidl_next::wire::String<'static>,
18910 ___E,
18911 >(
18912 value, preallocated.encoder, &mut out, 100
18913 )?;
18914 } else {
18915 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18916 }
18917 }
18918
18919 2 => {
18920 if let Some(value) = self.source_name.take() {
18921 ::fidl_next::wire::Envelope::encode_value::<
18922 ::fidl_next::wire::String<'static>,
18923 ___E,
18924 >(
18925 value, preallocated.encoder, &mut out, 100
18926 )?;
18927 } else {
18928 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18929 }
18930 }
18931
18932 1 => {
18933 if let Some(value) = self.source.take() {
18934 ::fidl_next::wire::Envelope::encode_value::<
18935 crate::wire::Ref<'static>,
18936 ___E,
18937 >(
18938 value, preallocated.encoder, &mut out, ()
18939 )?;
18940 } else {
18941 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18942 }
18943 }
18944
18945 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
18946 }
18947 unsafe {
18948 preallocated.write_next(out.assume_init_ref());
18949 }
18950 }
18951
18952 ::fidl_next::wire::Table::encode_len(table, max_ord);
18953
18954 Ok(())
18955 }
18956 }
18957
18958 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DebugProtocolRegistration<'static>, ___E>
18959 for &'a DebugProtocolRegistration
18960 where
18961 ___E: ::fidl_next::Encoder + ?Sized,
18962 {
18963 #[inline]
18964 fn encode(
18965 self,
18966 encoder: &mut ___E,
18967 out: &mut ::core::mem::MaybeUninit<crate::wire::DebugProtocolRegistration<'static>>,
18968 _: (),
18969 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18970 ::fidl_next::munge!(let crate::wire::DebugProtocolRegistration { table } = out);
18971
18972 let max_ord = self.__max_ordinal();
18973
18974 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
18975 ::fidl_next::Wire::zero_padding(&mut out);
18976
18977 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
18978 ::fidl_next::wire::Envelope,
18979 >(encoder, max_ord);
18980
18981 for i in 1..=max_ord {
18982 match i {
18983 3 => {
18984 if let Some(value) = &self.target_name {
18985 ::fidl_next::wire::Envelope::encode_value::<
18986 ::fidl_next::wire::String<'static>,
18987 ___E,
18988 >(
18989 value, preallocated.encoder, &mut out, 100
18990 )?;
18991 } else {
18992 ::fidl_next::wire::Envelope::encode_zero(&mut out)
18993 }
18994 }
18995
18996 2 => {
18997 if let Some(value) = &self.source_name {
18998 ::fidl_next::wire::Envelope::encode_value::<
18999 ::fidl_next::wire::String<'static>,
19000 ___E,
19001 >(
19002 value, preallocated.encoder, &mut out, 100
19003 )?;
19004 } else {
19005 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19006 }
19007 }
19008
19009 1 => {
19010 if let Some(value) = &self.source {
19011 ::fidl_next::wire::Envelope::encode_value::<
19012 crate::wire::Ref<'static>,
19013 ___E,
19014 >(
19015 value, preallocated.encoder, &mut out, ()
19016 )?;
19017 } else {
19018 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19019 }
19020 }
19021
19022 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
19023 }
19024 unsafe {
19025 preallocated.write_next(out.assume_init_ref());
19026 }
19027 }
19028
19029 ::fidl_next::wire::Table::encode_len(table, max_ord);
19030
19031 Ok(())
19032 }
19033 }
19034
19035 impl<'de> ::fidl_next::FromWire<crate::wire::DebugProtocolRegistration<'de>>
19036 for DebugProtocolRegistration
19037 {
19038 #[inline]
19039 fn from_wire(wire_: crate::wire::DebugProtocolRegistration<'de>) -> Self {
19040 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
19041
19042 let source = wire_.table.get(1);
19043
19044 let source_name = wire_.table.get(2);
19045
19046 let target_name = wire_.table.get(3);
19047
19048 Self {
19049 source: source.map(|envelope| {
19050 ::fidl_next::FromWire::from_wire(unsafe {
19051 envelope.read_unchecked::<crate::wire::Ref<'de>>()
19052 })
19053 }),
19054
19055 source_name: source_name.map(|envelope| {
19056 ::fidl_next::FromWire::from_wire(unsafe {
19057 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
19058 })
19059 }),
19060
19061 target_name: target_name.map(|envelope| {
19062 ::fidl_next::FromWire::from_wire(unsafe {
19063 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
19064 })
19065 }),
19066 }
19067 }
19068 }
19069
19070 impl<'de> ::fidl_next::FromWireRef<crate::wire::DebugProtocolRegistration<'de>>
19071 for DebugProtocolRegistration
19072 {
19073 #[inline]
19074 fn from_wire_ref(wire: &crate::wire::DebugProtocolRegistration<'de>) -> Self {
19075 Self {
19076 source: wire.table.get(1).map(|envelope| {
19077 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19078 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
19079 })
19080 }),
19081
19082 source_name: wire.table.get(2).map(|envelope| {
19083 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19084 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
19085 })
19086 }),
19087
19088 target_name: wire.table.get(3).map(|envelope| {
19089 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
19090 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
19091 })
19092 }),
19093 }
19094 }
19095 }
19096
19097 #[doc = " Declares a capability registered in the debug section of an environment.\n"]
19098 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
19099 pub enum DebugRegistration {
19100 Protocol(crate::natural::DebugProtocolRegistration),
19101
19102 UnknownOrdinal_(u64),
19103 }
19104
19105 impl DebugRegistration {
19106 pub fn is_unknown(&self) -> bool {
19107 #[allow(unreachable_patterns)]
19108 match self {
19109 Self::UnknownOrdinal_(_) => true,
19110 _ => false,
19111 }
19112 }
19113 }
19114
19115 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DebugRegistration<'static>, ___E>
19116 for DebugRegistration
19117 where
19118 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19119 ___E: ::fidl_next::Encoder,
19120 {
19121 #[inline]
19122 fn encode(
19123 self,
19124 encoder: &mut ___E,
19125 out: &mut ::core::mem::MaybeUninit<crate::wire::DebugRegistration<'static>>,
19126 _: (),
19127 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19128 ::fidl_next::munge!(let crate::wire::DebugRegistration { raw, _phantom: _ } = out);
19129
19130 match self {
19131 Self::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
19132 ___E,
19133 crate::wire::DebugProtocolRegistration<'static>,
19134 >(value, 1, encoder, raw, ())?,
19135
19136 Self::UnknownOrdinal_(ordinal) => {
19137 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
19138 }
19139 }
19140
19141 Ok(())
19142 }
19143 }
19144
19145 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DebugRegistration<'static>, ___E>
19146 for &'a DebugRegistration
19147 where
19148 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19149 ___E: ::fidl_next::Encoder,
19150 {
19151 #[inline]
19152 fn encode(
19153 self,
19154 encoder: &mut ___E,
19155 out: &mut ::core::mem::MaybeUninit<crate::wire::DebugRegistration<'static>>,
19156 _: (),
19157 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19158 ::fidl_next::munge!(let crate::wire::DebugRegistration { raw, _phantom: _ } = out);
19159
19160 match self {
19161 DebugRegistration::Protocol(value) => ::fidl_next::wire::Union::encode_as::<
19162 ___E,
19163 crate::wire::DebugProtocolRegistration<'static>,
19164 >(value, 1, encoder, raw, ())?,
19165
19166 DebugRegistration::UnknownOrdinal_(ordinal) => {
19167 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
19168 }
19169 }
19170
19171 Ok(())
19172 }
19173 }
19174
19175 unsafe impl<___E>
19176 ::fidl_next::EncodeOption<crate::wire_optional::DebugRegistration<'static>, ___E>
19177 for DebugRegistration
19178 where
19179 ___E: ?Sized,
19180 DebugRegistration: ::fidl_next::Encode<crate::wire::DebugRegistration<'static>, ___E>,
19181 {
19182 #[inline]
19183 fn encode_option(
19184 this: ::core::option::Option<Self>,
19185 encoder: &mut ___E,
19186 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::DebugRegistration<'static>>,
19187 _: (),
19188 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19189 ::fidl_next::munge!(let crate::wire_optional::DebugRegistration { raw, _phantom: _ } = &mut *out);
19190
19191 if let Some(inner) = this {
19192 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
19193 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
19194 } else {
19195 ::fidl_next::wire::Union::encode_absent(raw);
19196 }
19197
19198 Ok(())
19199 }
19200 }
19201
19202 unsafe impl<'a, ___E>
19203 ::fidl_next::EncodeOption<crate::wire_optional::DebugRegistration<'static>, ___E>
19204 for &'a DebugRegistration
19205 where
19206 ___E: ?Sized,
19207 &'a DebugRegistration: ::fidl_next::Encode<crate::wire::DebugRegistration<'static>, ___E>,
19208 {
19209 #[inline]
19210 fn encode_option(
19211 this: ::core::option::Option<Self>,
19212 encoder: &mut ___E,
19213 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::DebugRegistration<'static>>,
19214 _: (),
19215 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19216 ::fidl_next::munge!(let crate::wire_optional::DebugRegistration { raw, _phantom: _ } = &mut *out);
19217
19218 if let Some(inner) = this {
19219 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
19220 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
19221 } else {
19222 ::fidl_next::wire::Union::encode_absent(raw);
19223 }
19224
19225 Ok(())
19226 }
19227 }
19228
19229 impl<'de> ::fidl_next::FromWire<crate::wire::DebugRegistration<'de>> for DebugRegistration {
19230 #[inline]
19231 fn from_wire(wire: crate::wire::DebugRegistration<'de>) -> Self {
19232 let wire = ::core::mem::ManuallyDrop::new(wire);
19233 match wire.raw.ordinal() {
19234 1 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
19235 wire.raw.get().read_unchecked::<crate::wire::DebugProtocolRegistration<'de>>()
19236 })),
19237
19238 ord => return Self::UnknownOrdinal_(ord as u64),
19239 }
19240 }
19241 }
19242
19243 impl<'de> ::fidl_next::FromWireRef<crate::wire::DebugRegistration<'de>> for DebugRegistration {
19244 #[inline]
19245 fn from_wire_ref(wire: &crate::wire::DebugRegistration<'de>) -> Self {
19246 match wire.raw.ordinal() {
19247 1 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
19248 wire.raw.get().deref_unchecked::<crate::wire::DebugProtocolRegistration<'de>>()
19249 })),
19250
19251 ord => return Self::UnknownOrdinal_(ord as u64),
19252 }
19253 }
19254 }
19255
19256 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::DebugRegistration<'de>>
19257 for DebugRegistration
19258 {
19259 #[inline]
19260 fn from_wire_option(
19261 wire: crate::wire_optional::DebugRegistration<'de>,
19262 ) -> ::core::option::Option<Self> {
19263 if let Some(inner) = wire.into_option() {
19264 Some(::fidl_next::FromWire::from_wire(inner))
19265 } else {
19266 None
19267 }
19268 }
19269 }
19270
19271 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::DebugRegistration<'de>>
19272 for Box<DebugRegistration>
19273 {
19274 #[inline]
19275 fn from_wire_option(
19276 wire: crate::wire_optional::DebugRegistration<'de>,
19277 ) -> ::core::option::Option<Self> {
19278 <DebugRegistration as ::fidl_next::FromWireOption<
19279 crate::wire_optional::DebugRegistration<'de>,
19280 >>::from_wire_option(wire)
19281 .map(Box::new)
19282 }
19283 }
19284
19285 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::DebugRegistration<'de>>
19286 for Box<DebugRegistration>
19287 {
19288 #[inline]
19289 fn from_wire_option_ref(
19290 wire: &crate::wire_optional::DebugRegistration<'de>,
19291 ) -> ::core::option::Option<Self> {
19292 if let Some(inner) = wire.as_ref() {
19293 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
19294 } else {
19295 None
19296 }
19297 }
19298 }
19299
19300 #[doc = " Declares an environment which configures a realm.\n"]
19301 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
19302 pub struct Environment {
19303 pub name: ::core::option::Option<::std::string::String>,
19304
19305 pub extends: ::core::option::Option<crate::natural::EnvironmentExtends>,
19306
19307 pub runners: ::core::option::Option<::std::vec::Vec<crate::natural::RunnerRegistration>>,
19308
19309 pub resolvers:
19310 ::core::option::Option<::std::vec::Vec<crate::natural::ResolverRegistration>>,
19311
19312 pub debug_capabilities:
19313 ::core::option::Option<::std::vec::Vec<crate::natural::DebugRegistration>>,
19314
19315 pub stop_timeout_ms: ::core::option::Option<u32>,
19316 }
19317
19318 impl Environment {
19319 fn __max_ordinal(&self) -> usize {
19320 if self.stop_timeout_ms.is_some() {
19321 return 6;
19322 }
19323
19324 if self.debug_capabilities.is_some() {
19325 return 5;
19326 }
19327
19328 if self.resolvers.is_some() {
19329 return 4;
19330 }
19331
19332 if self.runners.is_some() {
19333 return 3;
19334 }
19335
19336 if self.extends.is_some() {
19337 return 2;
19338 }
19339
19340 if self.name.is_some() {
19341 return 1;
19342 }
19343
19344 0
19345 }
19346 }
19347
19348 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Environment<'static>, ___E> for Environment
19349 where
19350 ___E: ::fidl_next::Encoder + ?Sized,
19351 {
19352 #[inline]
19353 fn encode(
19354 mut self,
19355 encoder: &mut ___E,
19356 out: &mut ::core::mem::MaybeUninit<crate::wire::Environment<'static>>,
19357 _: (),
19358 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19359 ::fidl_next::munge!(let crate::wire::Environment { table } = out);
19360
19361 let max_ord = self.__max_ordinal();
19362
19363 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
19364 ::fidl_next::Wire::zero_padding(&mut out);
19365
19366 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
19367 ::fidl_next::wire::Envelope,
19368 >(encoder, max_ord);
19369
19370 for i in 1..=max_ord {
19371 match i {
19372 6 => {
19373 if let Some(value) = self.stop_timeout_ms.take() {
19374 ::fidl_next::wire::Envelope::encode_value::<
19375 ::fidl_next::wire::Uint32,
19376 ___E,
19377 >(
19378 value, preallocated.encoder, &mut out, ()
19379 )?;
19380 } else {
19381 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19382 }
19383 }
19384
19385 5 => {
19386 if let Some(value) = self.debug_capabilities.take() {
19387 ::fidl_next::wire::Envelope::encode_value::<
19388 ::fidl_next::wire::Vector<
19389 'static,
19390 crate::wire::DebugRegistration<'static>,
19391 >,
19392 ___E,
19393 >(
19394 value, preallocated.encoder, &mut out, (4294967295, ())
19395 )?;
19396 } else {
19397 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19398 }
19399 }
19400
19401 4 => {
19402 if let Some(value) = self.resolvers.take() {
19403 ::fidl_next::wire::Envelope::encode_value::<
19404 ::fidl_next::wire::Vector<
19405 'static,
19406 crate::wire::ResolverRegistration<'static>,
19407 >,
19408 ___E,
19409 >(
19410 value, preallocated.encoder, &mut out, (4294967295, ())
19411 )?;
19412 } else {
19413 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19414 }
19415 }
19416
19417 3 => {
19418 if let Some(value) = self.runners.take() {
19419 ::fidl_next::wire::Envelope::encode_value::<
19420 ::fidl_next::wire::Vector<
19421 'static,
19422 crate::wire::RunnerRegistration<'static>,
19423 >,
19424 ___E,
19425 >(
19426 value, preallocated.encoder, &mut out, (4294967295, ())
19427 )?;
19428 } else {
19429 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19430 }
19431 }
19432
19433 2 => {
19434 if let Some(value) = self.extends.take() {
19435 ::fidl_next::wire::Envelope::encode_value::<
19436 crate::wire::EnvironmentExtends,
19437 ___E,
19438 >(
19439 value, preallocated.encoder, &mut out, ()
19440 )?;
19441 } else {
19442 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19443 }
19444 }
19445
19446 1 => {
19447 if let Some(value) = self.name.take() {
19448 ::fidl_next::wire::Envelope::encode_value::<
19449 ::fidl_next::wire::String<'static>,
19450 ___E,
19451 >(
19452 value, preallocated.encoder, &mut out, 100
19453 )?;
19454 } else {
19455 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19456 }
19457 }
19458
19459 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
19460 }
19461 unsafe {
19462 preallocated.write_next(out.assume_init_ref());
19463 }
19464 }
19465
19466 ::fidl_next::wire::Table::encode_len(table, max_ord);
19467
19468 Ok(())
19469 }
19470 }
19471
19472 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Environment<'static>, ___E>
19473 for &'a Environment
19474 where
19475 ___E: ::fidl_next::Encoder + ?Sized,
19476 {
19477 #[inline]
19478 fn encode(
19479 self,
19480 encoder: &mut ___E,
19481 out: &mut ::core::mem::MaybeUninit<crate::wire::Environment<'static>>,
19482 _: (),
19483 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19484 ::fidl_next::munge!(let crate::wire::Environment { table } = out);
19485
19486 let max_ord = self.__max_ordinal();
19487
19488 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
19489 ::fidl_next::Wire::zero_padding(&mut out);
19490
19491 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
19492 ::fidl_next::wire::Envelope,
19493 >(encoder, max_ord);
19494
19495 for i in 1..=max_ord {
19496 match i {
19497 6 => {
19498 if let Some(value) = &self.stop_timeout_ms {
19499 ::fidl_next::wire::Envelope::encode_value::<
19500 ::fidl_next::wire::Uint32,
19501 ___E,
19502 >(
19503 value, preallocated.encoder, &mut out, ()
19504 )?;
19505 } else {
19506 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19507 }
19508 }
19509
19510 5 => {
19511 if let Some(value) = &self.debug_capabilities {
19512 ::fidl_next::wire::Envelope::encode_value::<
19513 ::fidl_next::wire::Vector<
19514 'static,
19515 crate::wire::DebugRegistration<'static>,
19516 >,
19517 ___E,
19518 >(
19519 value, preallocated.encoder, &mut out, (4294967295, ())
19520 )?;
19521 } else {
19522 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19523 }
19524 }
19525
19526 4 => {
19527 if let Some(value) = &self.resolvers {
19528 ::fidl_next::wire::Envelope::encode_value::<
19529 ::fidl_next::wire::Vector<
19530 'static,
19531 crate::wire::ResolverRegistration<'static>,
19532 >,
19533 ___E,
19534 >(
19535 value, preallocated.encoder, &mut out, (4294967295, ())
19536 )?;
19537 } else {
19538 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19539 }
19540 }
19541
19542 3 => {
19543 if let Some(value) = &self.runners {
19544 ::fidl_next::wire::Envelope::encode_value::<
19545 ::fidl_next::wire::Vector<
19546 'static,
19547 crate::wire::RunnerRegistration<'static>,
19548 >,
19549 ___E,
19550 >(
19551 value, preallocated.encoder, &mut out, (4294967295, ())
19552 )?;
19553 } else {
19554 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19555 }
19556 }
19557
19558 2 => {
19559 if let Some(value) = &self.extends {
19560 ::fidl_next::wire::Envelope::encode_value::<
19561 crate::wire::EnvironmentExtends,
19562 ___E,
19563 >(
19564 value, preallocated.encoder, &mut out, ()
19565 )?;
19566 } else {
19567 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19568 }
19569 }
19570
19571 1 => {
19572 if let Some(value) = &self.name {
19573 ::fidl_next::wire::Envelope::encode_value::<
19574 ::fidl_next::wire::String<'static>,
19575 ___E,
19576 >(
19577 value, preallocated.encoder, &mut out, 100
19578 )?;
19579 } else {
19580 ::fidl_next::wire::Envelope::encode_zero(&mut out)
19581 }
19582 }
19583
19584 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
19585 }
19586 unsafe {
19587 preallocated.write_next(out.assume_init_ref());
19588 }
19589 }
19590
19591 ::fidl_next::wire::Table::encode_len(table, max_ord);
19592
19593 Ok(())
19594 }
19595 }
19596
19597 impl<'de> ::fidl_next::FromWire<crate::wire::Environment<'de>> for Environment {
19598 #[inline]
19599 fn from_wire(wire_: crate::wire::Environment<'de>) -> Self {
19600 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
19601
19602 let name = wire_.table.get(1);
19603
19604 let extends = wire_.table.get(2);
19605
19606 let runners = wire_.table.get(3);
19607
19608 let resolvers = wire_.table.get(4);
19609
19610 let debug_capabilities = wire_.table.get(5);
19611
19612 let stop_timeout_ms = wire_.table.get(6);
19613
19614 Self {
19615
19616
19617 name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
19618 unsafe { envelope.read_unchecked::<::fidl_next::wire::String<'de>>() }
19619 )),
19620
19621
19622 extends: extends.map(|envelope| ::fidl_next::FromWire::from_wire(
19623 unsafe { envelope.read_unchecked::<crate::wire::EnvironmentExtends>() }
19624 )),
19625
19626
19627 runners: runners.map(|envelope| ::fidl_next::FromWire::from_wire(
19628 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::RunnerRegistration<'de>>>() }
19629 )),
19630
19631
19632 resolvers: resolvers.map(|envelope| ::fidl_next::FromWire::from_wire(
19633 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ResolverRegistration<'de>>>() }
19634 )),
19635
19636
19637 debug_capabilities: debug_capabilities.map(|envelope| ::fidl_next::FromWire::from_wire(
19638 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DebugRegistration<'de>>>() }
19639 )),
19640
19641
19642 stop_timeout_ms: stop_timeout_ms.map(|envelope| ::fidl_next::FromWire::from_wire(
19643 unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() }
19644 )),
19645
19646 }
19647 }
19648 }
19649
19650 impl<'de> ::fidl_next::FromWireRef<crate::wire::Environment<'de>> for Environment {
19651 #[inline]
19652 fn from_wire_ref(wire: &crate::wire::Environment<'de>) -> Self {
19653 Self {
19654
19655
19656 name: wire.table.get(1)
19657 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19658 unsafe { envelope.deref_unchecked::<::fidl_next::wire::String<'de>>() }
19659 )),
19660
19661
19662 extends: wire.table.get(2)
19663 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19664 unsafe { envelope.deref_unchecked::<crate::wire::EnvironmentExtends>() }
19665 )),
19666
19667
19668 runners: wire.table.get(3)
19669 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19670 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::RunnerRegistration<'de>>>() }
19671 )),
19672
19673
19674 resolvers: wire.table.get(4)
19675 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19676 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ResolverRegistration<'de>>>() }
19677 )),
19678
19679
19680 debug_capabilities: wire.table.get(5)
19681 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19682 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DebugRegistration<'de>>>() }
19683 )),
19684
19685
19686 stop_timeout_ms: wire.table.get(6)
19687 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19688 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Uint32>() }
19689 )),
19690
19691 }
19692 }
19693 }
19694
19695 #[derive(Debug, Default, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
19696 pub struct ConfigSourceCapabilities {}
19697
19698 impl ConfigSourceCapabilities {
19699 fn __max_ordinal(&self) -> usize {
19700 0
19701 }
19702 }
19703
19704 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigSourceCapabilities<'static>, ___E>
19705 for ConfigSourceCapabilities
19706 where
19707 ___E: ::fidl_next::Encoder + ?Sized,
19708 {
19709 #[inline]
19710 fn encode(
19711 mut self,
19712 encoder: &mut ___E,
19713 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSourceCapabilities<'static>>,
19714 _: (),
19715 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19716 ::fidl_next::munge!(let crate::wire::ConfigSourceCapabilities { table } = out);
19717
19718 let max_ord = self.__max_ordinal();
19719
19720 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
19721 ::fidl_next::Wire::zero_padding(&mut out);
19722
19723 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
19724 ::fidl_next::wire::Envelope,
19725 >(encoder, max_ord);
19726
19727 for i in 1..=max_ord {
19728 match i {
19729 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
19730 }
19731 unsafe {
19732 preallocated.write_next(out.assume_init_ref());
19733 }
19734 }
19735
19736 ::fidl_next::wire::Table::encode_len(table, max_ord);
19737
19738 Ok(())
19739 }
19740 }
19741
19742 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigSourceCapabilities<'static>, ___E>
19743 for &'a ConfigSourceCapabilities
19744 where
19745 ___E: ::fidl_next::Encoder + ?Sized,
19746 {
19747 #[inline]
19748 fn encode(
19749 self,
19750 encoder: &mut ___E,
19751 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSourceCapabilities<'static>>,
19752 _: (),
19753 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19754 ::fidl_next::munge!(let crate::wire::ConfigSourceCapabilities { table } = out);
19755
19756 let max_ord = self.__max_ordinal();
19757
19758 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
19759 ::fidl_next::Wire::zero_padding(&mut out);
19760
19761 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
19762 ::fidl_next::wire::Envelope,
19763 >(encoder, max_ord);
19764
19765 for i in 1..=max_ord {
19766 match i {
19767 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
19768 }
19769 unsafe {
19770 preallocated.write_next(out.assume_init_ref());
19771 }
19772 }
19773
19774 ::fidl_next::wire::Table::encode_len(table, max_ord);
19775
19776 Ok(())
19777 }
19778 }
19779
19780 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigSourceCapabilities<'de>>
19781 for ConfigSourceCapabilities
19782 {
19783 #[inline]
19784 fn from_wire(wire_: crate::wire::ConfigSourceCapabilities<'de>) -> Self {
19785 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
19786
19787 Self {}
19788 }
19789 }
19790
19791 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigSourceCapabilities<'de>>
19792 for ConfigSourceCapabilities
19793 {
19794 #[inline]
19795 fn from_wire_ref(wire: &crate::wire::ConfigSourceCapabilities<'de>) -> Self {
19796 Self {}
19797 }
19798 }
19799
19800 #[doc = " Strategies available for resolving configuration values.\n"]
19801 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
19802 pub enum ConfigValueSource {
19803 PackagePath(::std::string::String),
19804
19805 Capabilities(crate::natural::ConfigSourceCapabilities),
19806
19807 UnknownOrdinal_(u64),
19808 }
19809
19810 impl ConfigValueSource {
19811 pub fn is_unknown(&self) -> bool {
19812 #[allow(unreachable_patterns)]
19813 match self {
19814 Self::UnknownOrdinal_(_) => true,
19815 _ => false,
19816 }
19817 }
19818 }
19819
19820 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigValueSource<'static>, ___E>
19821 for ConfigValueSource
19822 where
19823 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19824 ___E: ::fidl_next::Encoder,
19825 {
19826 #[inline]
19827 fn encode(
19828 self,
19829 encoder: &mut ___E,
19830 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValueSource<'static>>,
19831 _: (),
19832 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19833 ::fidl_next::munge!(let crate::wire::ConfigValueSource { raw, _phantom: _ } = out);
19834
19835 match self {
19836 Self::PackagePath(value) => ::fidl_next::wire::Union::encode_as::<
19837 ___E,
19838 ::fidl_next::wire::String<'static>,
19839 >(value, 1, encoder, raw, 4294967295)?,
19840
19841 Self::Capabilities(value) => ::fidl_next::wire::Union::encode_as::<
19842 ___E,
19843 crate::wire::ConfigSourceCapabilities<'static>,
19844 >(value, 2, encoder, raw, ())?,
19845
19846 Self::UnknownOrdinal_(ordinal) => {
19847 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
19848 }
19849 }
19850
19851 Ok(())
19852 }
19853 }
19854
19855 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigValueSource<'static>, ___E>
19856 for &'a ConfigValueSource
19857 where
19858 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19859 ___E: ::fidl_next::Encoder,
19860 {
19861 #[inline]
19862 fn encode(
19863 self,
19864 encoder: &mut ___E,
19865 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValueSource<'static>>,
19866 _: (),
19867 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19868 ::fidl_next::munge!(let crate::wire::ConfigValueSource { raw, _phantom: _ } = out);
19869
19870 match self {
19871 ConfigValueSource::PackagePath(value) => {
19872 ::fidl_next::wire::Union::encode_as::<___E, ::fidl_next::wire::String<'static>>(
19873 value, 1, encoder, raw, 4294967295,
19874 )?
19875 }
19876
19877 ConfigValueSource::Capabilities(value) => {
19878 ::fidl_next::wire::Union::encode_as::<
19879 ___E,
19880 crate::wire::ConfigSourceCapabilities<'static>,
19881 >(value, 2, encoder, raw, ())?
19882 }
19883
19884 ConfigValueSource::UnknownOrdinal_(ordinal) => {
19885 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
19886 }
19887 }
19888
19889 Ok(())
19890 }
19891 }
19892
19893 unsafe impl<___E>
19894 ::fidl_next::EncodeOption<crate::wire_optional::ConfigValueSource<'static>, ___E>
19895 for ConfigValueSource
19896 where
19897 ___E: ?Sized,
19898 ConfigValueSource: ::fidl_next::Encode<crate::wire::ConfigValueSource<'static>, ___E>,
19899 {
19900 #[inline]
19901 fn encode_option(
19902 this: ::core::option::Option<Self>,
19903 encoder: &mut ___E,
19904 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigValueSource<'static>>,
19905 _: (),
19906 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19907 ::fidl_next::munge!(let crate::wire_optional::ConfigValueSource { raw, _phantom: _ } = &mut *out);
19908
19909 if let Some(inner) = this {
19910 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
19911 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
19912 } else {
19913 ::fidl_next::wire::Union::encode_absent(raw);
19914 }
19915
19916 Ok(())
19917 }
19918 }
19919
19920 unsafe impl<'a, ___E>
19921 ::fidl_next::EncodeOption<crate::wire_optional::ConfigValueSource<'static>, ___E>
19922 for &'a ConfigValueSource
19923 where
19924 ___E: ?Sized,
19925 &'a ConfigValueSource: ::fidl_next::Encode<crate::wire::ConfigValueSource<'static>, ___E>,
19926 {
19927 #[inline]
19928 fn encode_option(
19929 this: ::core::option::Option<Self>,
19930 encoder: &mut ___E,
19931 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigValueSource<'static>>,
19932 _: (),
19933 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19934 ::fidl_next::munge!(let crate::wire_optional::ConfigValueSource { raw, _phantom: _ } = &mut *out);
19935
19936 if let Some(inner) = this {
19937 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
19938 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
19939 } else {
19940 ::fidl_next::wire::Union::encode_absent(raw);
19941 }
19942
19943 Ok(())
19944 }
19945 }
19946
19947 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigValueSource<'de>> for ConfigValueSource {
19948 #[inline]
19949 fn from_wire(wire: crate::wire::ConfigValueSource<'de>) -> Self {
19950 let wire = ::core::mem::ManuallyDrop::new(wire);
19951 match wire.raw.ordinal() {
19952 1 => Self::PackagePath(::fidl_next::FromWire::from_wire(unsafe {
19953 wire.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
19954 })),
19955
19956 2 => Self::Capabilities(::fidl_next::FromWire::from_wire(unsafe {
19957 wire.raw.get().read_unchecked::<crate::wire::ConfigSourceCapabilities<'de>>()
19958 })),
19959
19960 ord => return Self::UnknownOrdinal_(ord as u64),
19961 }
19962 }
19963 }
19964
19965 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigValueSource<'de>> for ConfigValueSource {
19966 #[inline]
19967 fn from_wire_ref(wire: &crate::wire::ConfigValueSource<'de>) -> Self {
19968 match wire.raw.ordinal() {
19969 1 => Self::PackagePath(::fidl_next::FromWireRef::from_wire_ref(unsafe {
19970 wire.raw.get().deref_unchecked::<::fidl_next::wire::String<'de>>()
19971 })),
19972
19973 2 => Self::Capabilities(::fidl_next::FromWireRef::from_wire_ref(unsafe {
19974 wire.raw.get().deref_unchecked::<crate::wire::ConfigSourceCapabilities<'de>>()
19975 })),
19976
19977 ord => return Self::UnknownOrdinal_(ord as u64),
19978 }
19979 }
19980 }
19981
19982 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigValueSource<'de>>
19983 for ConfigValueSource
19984 {
19985 #[inline]
19986 fn from_wire_option(
19987 wire: crate::wire_optional::ConfigValueSource<'de>,
19988 ) -> ::core::option::Option<Self> {
19989 if let Some(inner) = wire.into_option() {
19990 Some(::fidl_next::FromWire::from_wire(inner))
19991 } else {
19992 None
19993 }
19994 }
19995 }
19996
19997 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigValueSource<'de>>
19998 for Box<ConfigValueSource>
19999 {
20000 #[inline]
20001 fn from_wire_option(
20002 wire: crate::wire_optional::ConfigValueSource<'de>,
20003 ) -> ::core::option::Option<Self> {
20004 <ConfigValueSource as ::fidl_next::FromWireOption<
20005 crate::wire_optional::ConfigValueSource<'de>,
20006 >>::from_wire_option(wire)
20007 .map(Box::new)
20008 }
20009 }
20010
20011 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::ConfigValueSource<'de>>
20012 for Box<ConfigValueSource>
20013 {
20014 #[inline]
20015 fn from_wire_option_ref(
20016 wire: &crate::wire_optional::ConfigValueSource<'de>,
20017 ) -> ::core::option::Option<Self> {
20018 if let Some(inner) = wire.as_ref() {
20019 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
20020 } else {
20021 None
20022 }
20023 }
20024 }
20025
20026 #[doc = " The schema of a component\'s configuration interface.\n"]
20027 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
20028 pub struct ConfigSchema {
20029 pub fields: ::core::option::Option<::std::vec::Vec<crate::natural::ConfigField>>,
20030
20031 pub checksum: ::core::option::Option<crate::natural::ConfigChecksum>,
20032
20033 pub value_source: ::core::option::Option<crate::natural::ConfigValueSource>,
20034 }
20035
20036 impl ConfigSchema {
20037 fn __max_ordinal(&self) -> usize {
20038 if self.value_source.is_some() {
20039 return 3;
20040 }
20041
20042 if self.checksum.is_some() {
20043 return 2;
20044 }
20045
20046 if self.fields.is_some() {
20047 return 1;
20048 }
20049
20050 0
20051 }
20052 }
20053
20054 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigSchema<'static>, ___E> for ConfigSchema
20055 where
20056 ___E: ::fidl_next::Encoder + ?Sized,
20057 {
20058 #[inline]
20059 fn encode(
20060 mut self,
20061 encoder: &mut ___E,
20062 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSchema<'static>>,
20063 _: (),
20064 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20065 ::fidl_next::munge!(let crate::wire::ConfigSchema { table } = out);
20066
20067 let max_ord = self.__max_ordinal();
20068
20069 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
20070 ::fidl_next::Wire::zero_padding(&mut out);
20071
20072 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
20073 ::fidl_next::wire::Envelope,
20074 >(encoder, max_ord);
20075
20076 for i in 1..=max_ord {
20077 match i {
20078 3 => {
20079 if let Some(value) = self.value_source.take() {
20080 ::fidl_next::wire::Envelope::encode_value::<
20081 crate::wire::ConfigValueSource<'static>,
20082 ___E,
20083 >(
20084 value, preallocated.encoder, &mut out, ()
20085 )?;
20086 } else {
20087 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20088 }
20089 }
20090
20091 2 => {
20092 if let Some(value) = self.checksum.take() {
20093 ::fidl_next::wire::Envelope::encode_value::<
20094 crate::wire::ConfigChecksum<'static>,
20095 ___E,
20096 >(
20097 value, preallocated.encoder, &mut out, ()
20098 )?;
20099 } else {
20100 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20101 }
20102 }
20103
20104 1 => {
20105 if let Some(value) = self.fields.take() {
20106 ::fidl_next::wire::Envelope::encode_value::<
20107 ::fidl_next::wire::Vector<
20108 'static,
20109 crate::wire::ConfigField<'static>,
20110 >,
20111 ___E,
20112 >(
20113 value, preallocated.encoder, &mut out, (4294967295, ())
20114 )?;
20115 } else {
20116 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20117 }
20118 }
20119
20120 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
20121 }
20122 unsafe {
20123 preallocated.write_next(out.assume_init_ref());
20124 }
20125 }
20126
20127 ::fidl_next::wire::Table::encode_len(table, max_ord);
20128
20129 Ok(())
20130 }
20131 }
20132
20133 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigSchema<'static>, ___E>
20134 for &'a ConfigSchema
20135 where
20136 ___E: ::fidl_next::Encoder + ?Sized,
20137 {
20138 #[inline]
20139 fn encode(
20140 self,
20141 encoder: &mut ___E,
20142 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSchema<'static>>,
20143 _: (),
20144 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20145 ::fidl_next::munge!(let crate::wire::ConfigSchema { table } = out);
20146
20147 let max_ord = self.__max_ordinal();
20148
20149 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
20150 ::fidl_next::Wire::zero_padding(&mut out);
20151
20152 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
20153 ::fidl_next::wire::Envelope,
20154 >(encoder, max_ord);
20155
20156 for i in 1..=max_ord {
20157 match i {
20158 3 => {
20159 if let Some(value) = &self.value_source {
20160 ::fidl_next::wire::Envelope::encode_value::<
20161 crate::wire::ConfigValueSource<'static>,
20162 ___E,
20163 >(
20164 value, preallocated.encoder, &mut out, ()
20165 )?;
20166 } else {
20167 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20168 }
20169 }
20170
20171 2 => {
20172 if let Some(value) = &self.checksum {
20173 ::fidl_next::wire::Envelope::encode_value::<
20174 crate::wire::ConfigChecksum<'static>,
20175 ___E,
20176 >(
20177 value, preallocated.encoder, &mut out, ()
20178 )?;
20179 } else {
20180 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20181 }
20182 }
20183
20184 1 => {
20185 if let Some(value) = &self.fields {
20186 ::fidl_next::wire::Envelope::encode_value::<
20187 ::fidl_next::wire::Vector<
20188 'static,
20189 crate::wire::ConfigField<'static>,
20190 >,
20191 ___E,
20192 >(
20193 value, preallocated.encoder, &mut out, (4294967295, ())
20194 )?;
20195 } else {
20196 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20197 }
20198 }
20199
20200 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
20201 }
20202 unsafe {
20203 preallocated.write_next(out.assume_init_ref());
20204 }
20205 }
20206
20207 ::fidl_next::wire::Table::encode_len(table, max_ord);
20208
20209 Ok(())
20210 }
20211 }
20212
20213 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigSchema<'de>> for ConfigSchema {
20214 #[inline]
20215 fn from_wire(wire_: crate::wire::ConfigSchema<'de>) -> Self {
20216 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
20217
20218 let fields = wire_.table.get(1);
20219
20220 let checksum = wire_.table.get(2);
20221
20222 let value_source = wire_.table.get(3);
20223
20224 Self {
20225
20226
20227 fields: fields.map(|envelope| ::fidl_next::FromWire::from_wire(
20228 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigField<'de>>>() }
20229 )),
20230
20231
20232 checksum: checksum.map(|envelope| ::fidl_next::FromWire::from_wire(
20233 unsafe { envelope.read_unchecked::<crate::wire::ConfigChecksum<'de>>() }
20234 )),
20235
20236
20237 value_source: value_source.map(|envelope| ::fidl_next::FromWire::from_wire(
20238 unsafe { envelope.read_unchecked::<crate::wire::ConfigValueSource<'de>>() }
20239 )),
20240
20241 }
20242 }
20243 }
20244
20245 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigSchema<'de>> for ConfigSchema {
20246 #[inline]
20247 fn from_wire_ref(wire: &crate::wire::ConfigSchema<'de>) -> Self {
20248 Self {
20249
20250
20251 fields: wire.table.get(1)
20252 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20253 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigField<'de>>>() }
20254 )),
20255
20256
20257 checksum: wire.table.get(2)
20258 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20259 unsafe { envelope.deref_unchecked::<crate::wire::ConfigChecksum<'de>>() }
20260 )),
20261
20262
20263 value_source: wire.table.get(3)
20264 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20265 unsafe { envelope.deref_unchecked::<crate::wire::ConfigValueSource<'de>>() }
20266 )),
20267
20268 }
20269 }
20270 }
20271
20272 #[doc = " A component declaration.\n\n This information is typically encoded in the component manifest (.cm file)\n if it has one or may be generated at runtime by a component resolver for\n those that don\'t.\n"]
20273 #[derive(Debug, Default, PartialEq)]
20274 pub struct Component {
20275 pub program: ::core::option::Option<crate::natural::Program>,
20276
20277 pub uses: ::core::option::Option<::std::vec::Vec<crate::natural::Use>>,
20278
20279 pub exposes: ::core::option::Option<::std::vec::Vec<crate::natural::Expose>>,
20280
20281 pub offers: ::core::option::Option<::std::vec::Vec<crate::natural::Offer>>,
20282
20283 pub capabilities: ::core::option::Option<::std::vec::Vec<crate::natural::Capability>>,
20284
20285 pub children: ::core::option::Option<::std::vec::Vec<crate::natural::Child>>,
20286
20287 pub collections: ::core::option::Option<::std::vec::Vec<crate::natural::Collection>>,
20288
20289 pub environments: ::core::option::Option<::std::vec::Vec<crate::natural::Environment>>,
20290
20291 pub facets: ::core::option::Option<::fidl_next_common_fuchsia_data::natural::Dictionary>,
20292
20293 pub config: ::core::option::Option<crate::natural::ConfigSchema>,
20294
20295 pub debug_info: ::core::option::Option<crate::natural::DebugInfo>,
20296 }
20297
20298 impl Component {
20299 fn __max_ordinal(&self) -> usize {
20300 if self.debug_info.is_some() {
20301 return 11;
20302 }
20303
20304 if self.config.is_some() {
20305 return 10;
20306 }
20307
20308 if self.facets.is_some() {
20309 return 9;
20310 }
20311
20312 if self.environments.is_some() {
20313 return 8;
20314 }
20315
20316 if self.collections.is_some() {
20317 return 7;
20318 }
20319
20320 if self.children.is_some() {
20321 return 6;
20322 }
20323
20324 if self.capabilities.is_some() {
20325 return 5;
20326 }
20327
20328 if self.offers.is_some() {
20329 return 4;
20330 }
20331
20332 if self.exposes.is_some() {
20333 return 3;
20334 }
20335
20336 if self.uses.is_some() {
20337 return 2;
20338 }
20339
20340 if self.program.is_some() {
20341 return 1;
20342 }
20343
20344 0
20345 }
20346 }
20347
20348 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Component<'static>, ___E> for Component
20349 where
20350 ___E: ::fidl_next::Encoder + ?Sized,
20351 {
20352 #[inline]
20353 fn encode(
20354 mut self,
20355 encoder: &mut ___E,
20356 out: &mut ::core::mem::MaybeUninit<crate::wire::Component<'static>>,
20357 _: (),
20358 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20359 ::fidl_next::munge!(let crate::wire::Component { table } = out);
20360
20361 let max_ord = self.__max_ordinal();
20362
20363 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
20364 ::fidl_next::Wire::zero_padding(&mut out);
20365
20366 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
20367 ::fidl_next::wire::Envelope,
20368 >(encoder, max_ord);
20369
20370 for i in 1..=max_ord {
20371 match i {
20372 11 => {
20373 if let Some(value) = self.debug_info.take() {
20374 ::fidl_next::wire::Envelope::encode_value::<
20375 crate::wire::DebugInfo<'static>,
20376 ___E,
20377 >(
20378 value, preallocated.encoder, &mut out, ()
20379 )?;
20380 } else {
20381 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20382 }
20383 }
20384
20385 10 => {
20386 if let Some(value) = self.config.take() {
20387 ::fidl_next::wire::Envelope::encode_value::<
20388 crate::wire::ConfigSchema<'static>,
20389 ___E,
20390 >(
20391 value, preallocated.encoder, &mut out, ()
20392 )?;
20393 } else {
20394 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20395 }
20396 }
20397
20398 9 => {
20399 if let Some(value) = self.facets.take() {
20400 ::fidl_next::wire::Envelope::encode_value::<
20401 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
20402 ___E,
20403 >(
20404 value, preallocated.encoder, &mut out, ()
20405 )?;
20406 } else {
20407 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20408 }
20409 }
20410
20411 8 => {
20412 if let Some(value) = self.environments.take() {
20413 ::fidl_next::wire::Envelope::encode_value::<
20414 ::fidl_next::wire::Vector<
20415 'static,
20416 crate::wire::Environment<'static>,
20417 >,
20418 ___E,
20419 >(
20420 value, preallocated.encoder, &mut out, (4294967295, ())
20421 )?;
20422 } else {
20423 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20424 }
20425 }
20426
20427 7 => {
20428 if let Some(value) = self.collections.take() {
20429 ::fidl_next::wire::Envelope::encode_value::<
20430 ::fidl_next::wire::Vector<
20431 'static,
20432 crate::wire::Collection<'static>,
20433 >,
20434 ___E,
20435 >(
20436 value, preallocated.encoder, &mut out, (4294967295, ())
20437 )?;
20438 } else {
20439 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20440 }
20441 }
20442
20443 6 => {
20444 if let Some(value) = self.children.take() {
20445 ::fidl_next::wire::Envelope::encode_value::<
20446 ::fidl_next::wire::Vector<'static, crate::wire::Child<'static>>,
20447 ___E,
20448 >(
20449 value, preallocated.encoder, &mut out, (4294967295, ())
20450 )?;
20451 } else {
20452 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20453 }
20454 }
20455
20456 5 => {
20457 if let Some(value) = self.capabilities.take() {
20458 ::fidl_next::wire::Envelope::encode_value::<
20459 ::fidl_next::wire::Vector<
20460 'static,
20461 crate::wire::Capability<'static>,
20462 >,
20463 ___E,
20464 >(
20465 value, preallocated.encoder, &mut out, (4294967295, ())
20466 )?;
20467 } else {
20468 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20469 }
20470 }
20471
20472 4 => {
20473 if let Some(value) = self.offers.take() {
20474 ::fidl_next::wire::Envelope::encode_value::<
20475 ::fidl_next::wire::Vector<'static, crate::wire::Offer<'static>>,
20476 ___E,
20477 >(
20478 value, preallocated.encoder, &mut out, (4294967295, ())
20479 )?;
20480 } else {
20481 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20482 }
20483 }
20484
20485 3 => {
20486 if let Some(value) = self.exposes.take() {
20487 ::fidl_next::wire::Envelope::encode_value::<
20488 ::fidl_next::wire::Vector<'static, crate::wire::Expose<'static>>,
20489 ___E,
20490 >(
20491 value, preallocated.encoder, &mut out, (4294967295, ())
20492 )?;
20493 } else {
20494 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20495 }
20496 }
20497
20498 2 => {
20499 if let Some(value) = self.uses.take() {
20500 ::fidl_next::wire::Envelope::encode_value::<
20501 ::fidl_next::wire::Vector<'static, crate::wire::Use<'static>>,
20502 ___E,
20503 >(
20504 value, preallocated.encoder, &mut out, (4294967295, ())
20505 )?;
20506 } else {
20507 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20508 }
20509 }
20510
20511 1 => {
20512 if let Some(value) = self.program.take() {
20513 ::fidl_next::wire::Envelope::encode_value::<
20514 crate::wire::Program<'static>,
20515 ___E,
20516 >(
20517 value, preallocated.encoder, &mut out, ()
20518 )?;
20519 } else {
20520 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20521 }
20522 }
20523
20524 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
20525 }
20526 unsafe {
20527 preallocated.write_next(out.assume_init_ref());
20528 }
20529 }
20530
20531 ::fidl_next::wire::Table::encode_len(table, max_ord);
20532
20533 Ok(())
20534 }
20535 }
20536
20537 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Component<'static>, ___E> for &'a Component
20538 where
20539 ___E: ::fidl_next::Encoder + ?Sized,
20540 {
20541 #[inline]
20542 fn encode(
20543 self,
20544 encoder: &mut ___E,
20545 out: &mut ::core::mem::MaybeUninit<crate::wire::Component<'static>>,
20546 _: (),
20547 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20548 ::fidl_next::munge!(let crate::wire::Component { table } = out);
20549
20550 let max_ord = self.__max_ordinal();
20551
20552 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
20553 ::fidl_next::Wire::zero_padding(&mut out);
20554
20555 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
20556 ::fidl_next::wire::Envelope,
20557 >(encoder, max_ord);
20558
20559 for i in 1..=max_ord {
20560 match i {
20561 11 => {
20562 if let Some(value) = &self.debug_info {
20563 ::fidl_next::wire::Envelope::encode_value::<
20564 crate::wire::DebugInfo<'static>,
20565 ___E,
20566 >(
20567 value, preallocated.encoder, &mut out, ()
20568 )?;
20569 } else {
20570 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20571 }
20572 }
20573
20574 10 => {
20575 if let Some(value) = &self.config {
20576 ::fidl_next::wire::Envelope::encode_value::<
20577 crate::wire::ConfigSchema<'static>,
20578 ___E,
20579 >(
20580 value, preallocated.encoder, &mut out, ()
20581 )?;
20582 } else {
20583 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20584 }
20585 }
20586
20587 9 => {
20588 if let Some(value) = &self.facets {
20589 ::fidl_next::wire::Envelope::encode_value::<
20590 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
20591 ___E,
20592 >(
20593 value, preallocated.encoder, &mut out, ()
20594 )?;
20595 } else {
20596 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20597 }
20598 }
20599
20600 8 => {
20601 if let Some(value) = &self.environments {
20602 ::fidl_next::wire::Envelope::encode_value::<
20603 ::fidl_next::wire::Vector<
20604 'static,
20605 crate::wire::Environment<'static>,
20606 >,
20607 ___E,
20608 >(
20609 value, preallocated.encoder, &mut out, (4294967295, ())
20610 )?;
20611 } else {
20612 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20613 }
20614 }
20615
20616 7 => {
20617 if let Some(value) = &self.collections {
20618 ::fidl_next::wire::Envelope::encode_value::<
20619 ::fidl_next::wire::Vector<
20620 'static,
20621 crate::wire::Collection<'static>,
20622 >,
20623 ___E,
20624 >(
20625 value, preallocated.encoder, &mut out, (4294967295, ())
20626 )?;
20627 } else {
20628 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20629 }
20630 }
20631
20632 6 => {
20633 if let Some(value) = &self.children {
20634 ::fidl_next::wire::Envelope::encode_value::<
20635 ::fidl_next::wire::Vector<'static, crate::wire::Child<'static>>,
20636 ___E,
20637 >(
20638 value, preallocated.encoder, &mut out, (4294967295, ())
20639 )?;
20640 } else {
20641 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20642 }
20643 }
20644
20645 5 => {
20646 if let Some(value) = &self.capabilities {
20647 ::fidl_next::wire::Envelope::encode_value::<
20648 ::fidl_next::wire::Vector<
20649 'static,
20650 crate::wire::Capability<'static>,
20651 >,
20652 ___E,
20653 >(
20654 value, preallocated.encoder, &mut out, (4294967295, ())
20655 )?;
20656 } else {
20657 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20658 }
20659 }
20660
20661 4 => {
20662 if let Some(value) = &self.offers {
20663 ::fidl_next::wire::Envelope::encode_value::<
20664 ::fidl_next::wire::Vector<'static, crate::wire::Offer<'static>>,
20665 ___E,
20666 >(
20667 value, preallocated.encoder, &mut out, (4294967295, ())
20668 )?;
20669 } else {
20670 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20671 }
20672 }
20673
20674 3 => {
20675 if let Some(value) = &self.exposes {
20676 ::fidl_next::wire::Envelope::encode_value::<
20677 ::fidl_next::wire::Vector<'static, crate::wire::Expose<'static>>,
20678 ___E,
20679 >(
20680 value, preallocated.encoder, &mut out, (4294967295, ())
20681 )?;
20682 } else {
20683 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20684 }
20685 }
20686
20687 2 => {
20688 if let Some(value) = &self.uses {
20689 ::fidl_next::wire::Envelope::encode_value::<
20690 ::fidl_next::wire::Vector<'static, crate::wire::Use<'static>>,
20691 ___E,
20692 >(
20693 value, preallocated.encoder, &mut out, (4294967295, ())
20694 )?;
20695 } else {
20696 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20697 }
20698 }
20699
20700 1 => {
20701 if let Some(value) = &self.program {
20702 ::fidl_next::wire::Envelope::encode_value::<
20703 crate::wire::Program<'static>,
20704 ___E,
20705 >(
20706 value, preallocated.encoder, &mut out, ()
20707 )?;
20708 } else {
20709 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20710 }
20711 }
20712
20713 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
20714 }
20715 unsafe {
20716 preallocated.write_next(out.assume_init_ref());
20717 }
20718 }
20719
20720 ::fidl_next::wire::Table::encode_len(table, max_ord);
20721
20722 Ok(())
20723 }
20724 }
20725
20726 impl<'de> ::fidl_next::FromWire<crate::wire::Component<'de>> for Component {
20727 #[inline]
20728 fn from_wire(wire_: crate::wire::Component<'de>) -> Self {
20729 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
20730
20731 let program = wire_.table.get(1);
20732
20733 let uses = wire_.table.get(2);
20734
20735 let exposes = wire_.table.get(3);
20736
20737 let offers = wire_.table.get(4);
20738
20739 let capabilities = wire_.table.get(5);
20740
20741 let children = wire_.table.get(6);
20742
20743 let collections = wire_.table.get(7);
20744
20745 let environments = wire_.table.get(8);
20746
20747 let facets = wire_.table.get(9);
20748
20749 let config = wire_.table.get(10);
20750
20751 let debug_info = wire_.table.get(11);
20752
20753 Self {
20754
20755
20756 program: program.map(|envelope| ::fidl_next::FromWire::from_wire(
20757 unsafe { envelope.read_unchecked::<crate::wire::Program<'de>>() }
20758 )),
20759
20760
20761 uses: uses.map(|envelope| ::fidl_next::FromWire::from_wire(
20762 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Use<'de>>>() }
20763 )),
20764
20765
20766 exposes: exposes.map(|envelope| ::fidl_next::FromWire::from_wire(
20767 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Expose<'de>>>() }
20768 )),
20769
20770
20771 offers: offers.map(|envelope| ::fidl_next::FromWire::from_wire(
20772 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Offer<'de>>>() }
20773 )),
20774
20775
20776 capabilities: capabilities.map(|envelope| ::fidl_next::FromWire::from_wire(
20777 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Capability<'de>>>() }
20778 )),
20779
20780
20781 children: children.map(|envelope| ::fidl_next::FromWire::from_wire(
20782 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Child<'de>>>() }
20783 )),
20784
20785
20786 collections: collections.map(|envelope| ::fidl_next::FromWire::from_wire(
20787 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Collection<'de>>>() }
20788 )),
20789
20790
20791 environments: environments.map(|envelope| ::fidl_next::FromWire::from_wire(
20792 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Environment<'de>>>() }
20793 )),
20794
20795
20796 facets: facets.map(|envelope| ::fidl_next::FromWire::from_wire(
20797 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
20798 )),
20799
20800
20801 config: config.map(|envelope| ::fidl_next::FromWire::from_wire(
20802 unsafe { envelope.read_unchecked::<crate::wire::ConfigSchema<'de>>() }
20803 )),
20804
20805
20806 debug_info: debug_info.map(|envelope| ::fidl_next::FromWire::from_wire(
20807 unsafe { envelope.read_unchecked::<crate::wire::DebugInfo<'de>>() }
20808 )),
20809
20810 }
20811 }
20812 }
20813
20814 impl<'de> ::fidl_next::FromWireRef<crate::wire::Component<'de>> for Component {
20815 #[inline]
20816 fn from_wire_ref(wire: &crate::wire::Component<'de>) -> Self {
20817 Self {
20818
20819
20820 program: wire.table.get(1)
20821 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20822 unsafe { envelope.deref_unchecked::<crate::wire::Program<'de>>() }
20823 )),
20824
20825
20826 uses: wire.table.get(2)
20827 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20828 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Use<'de>>>() }
20829 )),
20830
20831
20832 exposes: wire.table.get(3)
20833 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20834 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Expose<'de>>>() }
20835 )),
20836
20837
20838 offers: wire.table.get(4)
20839 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20840 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Offer<'de>>>() }
20841 )),
20842
20843
20844 capabilities: wire.table.get(5)
20845 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20846 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Capability<'de>>>() }
20847 )),
20848
20849
20850 children: wire.table.get(6)
20851 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20852 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Child<'de>>>() }
20853 )),
20854
20855
20856 collections: wire.table.get(7)
20857 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20858 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Collection<'de>>>() }
20859 )),
20860
20861
20862 environments: wire.table.get(8)
20863 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20864 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Environment<'de>>>() }
20865 )),
20866
20867
20868 facets: wire.table.get(9)
20869 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20870 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
20871 )),
20872
20873
20874 config: wire.table.get(10)
20875 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20876 unsafe { envelope.deref_unchecked::<crate::wire::ConfigSchema<'de>>() }
20877 )),
20878
20879
20880 debug_info: wire.table.get(11)
20881 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20882 unsafe { envelope.deref_unchecked::<crate::wire::DebugInfo<'de>>() }
20883 )),
20884
20885 }
20886 }
20887 }
20888
20889 #[doc = " An individual configuration value. It is matched against a specific configuration field based\n on its offset within `ValuesData.values`.\n"]
20890 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
20891 pub struct ConfigValueSpec {
20892 pub value: ::core::option::Option<crate::natural::ConfigValue>,
20893 }
20894
20895 impl ConfigValueSpec {
20896 fn __max_ordinal(&self) -> usize {
20897 if self.value.is_some() {
20898 return 1;
20899 }
20900
20901 0
20902 }
20903 }
20904
20905 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigValueSpec<'static>, ___E>
20906 for ConfigValueSpec
20907 where
20908 ___E: ::fidl_next::Encoder + ?Sized,
20909 {
20910 #[inline]
20911 fn encode(
20912 mut self,
20913 encoder: &mut ___E,
20914 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValueSpec<'static>>,
20915 _: (),
20916 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20917 ::fidl_next::munge!(let crate::wire::ConfigValueSpec { table } = out);
20918
20919 let max_ord = self.__max_ordinal();
20920
20921 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
20922 ::fidl_next::Wire::zero_padding(&mut out);
20923
20924 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
20925 ::fidl_next::wire::Envelope,
20926 >(encoder, max_ord);
20927
20928 for i in 1..=max_ord {
20929 match i {
20930 1 => {
20931 if let Some(value) = self.value.take() {
20932 ::fidl_next::wire::Envelope::encode_value::<
20933 crate::wire::ConfigValue<'static>,
20934 ___E,
20935 >(
20936 value, preallocated.encoder, &mut out, ()
20937 )?;
20938 } else {
20939 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20940 }
20941 }
20942
20943 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
20944 }
20945 unsafe {
20946 preallocated.write_next(out.assume_init_ref());
20947 }
20948 }
20949
20950 ::fidl_next::wire::Table::encode_len(table, max_ord);
20951
20952 Ok(())
20953 }
20954 }
20955
20956 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigValueSpec<'static>, ___E>
20957 for &'a ConfigValueSpec
20958 where
20959 ___E: ::fidl_next::Encoder + ?Sized,
20960 {
20961 #[inline]
20962 fn encode(
20963 self,
20964 encoder: &mut ___E,
20965 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValueSpec<'static>>,
20966 _: (),
20967 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20968 ::fidl_next::munge!(let crate::wire::ConfigValueSpec { table } = out);
20969
20970 let max_ord = self.__max_ordinal();
20971
20972 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
20973 ::fidl_next::Wire::zero_padding(&mut out);
20974
20975 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
20976 ::fidl_next::wire::Envelope,
20977 >(encoder, max_ord);
20978
20979 for i in 1..=max_ord {
20980 match i {
20981 1 => {
20982 if let Some(value) = &self.value {
20983 ::fidl_next::wire::Envelope::encode_value::<
20984 crate::wire::ConfigValue<'static>,
20985 ___E,
20986 >(
20987 value, preallocated.encoder, &mut out, ()
20988 )?;
20989 } else {
20990 ::fidl_next::wire::Envelope::encode_zero(&mut out)
20991 }
20992 }
20993
20994 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
20995 }
20996 unsafe {
20997 preallocated.write_next(out.assume_init_ref());
20998 }
20999 }
21000
21001 ::fidl_next::wire::Table::encode_len(table, max_ord);
21002
21003 Ok(())
21004 }
21005 }
21006
21007 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigValueSpec<'de>> for ConfigValueSpec {
21008 #[inline]
21009 fn from_wire(wire_: crate::wire::ConfigValueSpec<'de>) -> Self {
21010 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
21011
21012 let value = wire_.table.get(1);
21013
21014 Self {
21015 value: value.map(|envelope| {
21016 ::fidl_next::FromWire::from_wire(unsafe {
21017 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
21018 })
21019 }),
21020 }
21021 }
21022 }
21023
21024 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigValueSpec<'de>> for ConfigValueSpec {
21025 #[inline]
21026 fn from_wire_ref(wire: &crate::wire::ConfigValueSpec<'de>) -> Self {
21027 Self {
21028 value: wire.table.get(1).map(|envelope| {
21029 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
21030 envelope.deref_unchecked::<crate::wire::ConfigValue<'de>>()
21031 })
21032 }),
21033 }
21034 }
21035 }
21036
21037 #[doc = " Contents of the configuration value file. Defines the base values for a component\'s config.\n"]
21038 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21039 pub struct ConfigValuesData {
21040 pub values: ::core::option::Option<::std::vec::Vec<crate::natural::ConfigValueSpec>>,
21041
21042 pub checksum: ::core::option::Option<crate::natural::ConfigChecksum>,
21043 }
21044
21045 impl ConfigValuesData {
21046 fn __max_ordinal(&self) -> usize {
21047 if self.checksum.is_some() {
21048 return 2;
21049 }
21050
21051 if self.values.is_some() {
21052 return 1;
21053 }
21054
21055 0
21056 }
21057 }
21058
21059 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigValuesData<'static>, ___E>
21060 for ConfigValuesData
21061 where
21062 ___E: ::fidl_next::Encoder + ?Sized,
21063 {
21064 #[inline]
21065 fn encode(
21066 mut self,
21067 encoder: &mut ___E,
21068 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValuesData<'static>>,
21069 _: (),
21070 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21071 ::fidl_next::munge!(let crate::wire::ConfigValuesData { table } = out);
21072
21073 let max_ord = self.__max_ordinal();
21074
21075 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
21076 ::fidl_next::Wire::zero_padding(&mut out);
21077
21078 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
21079 ::fidl_next::wire::Envelope,
21080 >(encoder, max_ord);
21081
21082 for i in 1..=max_ord {
21083 match i {
21084 2 => {
21085 if let Some(value) = self.checksum.take() {
21086 ::fidl_next::wire::Envelope::encode_value::<
21087 crate::wire::ConfigChecksum<'static>,
21088 ___E,
21089 >(
21090 value, preallocated.encoder, &mut out, ()
21091 )?;
21092 } else {
21093 ::fidl_next::wire::Envelope::encode_zero(&mut out)
21094 }
21095 }
21096
21097 1 => {
21098 if let Some(value) = self.values.take() {
21099 ::fidl_next::wire::Envelope::encode_value::<
21100 ::fidl_next::wire::Vector<
21101 'static,
21102 crate::wire::ConfigValueSpec<'static>,
21103 >,
21104 ___E,
21105 >(
21106 value, preallocated.encoder, &mut out, (4294967295, ())
21107 )?;
21108 } else {
21109 ::fidl_next::wire::Envelope::encode_zero(&mut out)
21110 }
21111 }
21112
21113 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
21114 }
21115 unsafe {
21116 preallocated.write_next(out.assume_init_ref());
21117 }
21118 }
21119
21120 ::fidl_next::wire::Table::encode_len(table, max_ord);
21121
21122 Ok(())
21123 }
21124 }
21125
21126 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigValuesData<'static>, ___E>
21127 for &'a ConfigValuesData
21128 where
21129 ___E: ::fidl_next::Encoder + ?Sized,
21130 {
21131 #[inline]
21132 fn encode(
21133 self,
21134 encoder: &mut ___E,
21135 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValuesData<'static>>,
21136 _: (),
21137 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21138 ::fidl_next::munge!(let crate::wire::ConfigValuesData { table } = out);
21139
21140 let max_ord = self.__max_ordinal();
21141
21142 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
21143 ::fidl_next::Wire::zero_padding(&mut out);
21144
21145 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
21146 ::fidl_next::wire::Envelope,
21147 >(encoder, max_ord);
21148
21149 for i in 1..=max_ord {
21150 match i {
21151 2 => {
21152 if let Some(value) = &self.checksum {
21153 ::fidl_next::wire::Envelope::encode_value::<
21154 crate::wire::ConfigChecksum<'static>,
21155 ___E,
21156 >(
21157 value, preallocated.encoder, &mut out, ()
21158 )?;
21159 } else {
21160 ::fidl_next::wire::Envelope::encode_zero(&mut out)
21161 }
21162 }
21163
21164 1 => {
21165 if let Some(value) = &self.values {
21166 ::fidl_next::wire::Envelope::encode_value::<
21167 ::fidl_next::wire::Vector<
21168 'static,
21169 crate::wire::ConfigValueSpec<'static>,
21170 >,
21171 ___E,
21172 >(
21173 value, preallocated.encoder, &mut out, (4294967295, ())
21174 )?;
21175 } else {
21176 ::fidl_next::wire::Envelope::encode_zero(&mut out)
21177 }
21178 }
21179
21180 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
21181 }
21182 unsafe {
21183 preallocated.write_next(out.assume_init_ref());
21184 }
21185 }
21186
21187 ::fidl_next::wire::Table::encode_len(table, max_ord);
21188
21189 Ok(())
21190 }
21191 }
21192
21193 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigValuesData<'de>> for ConfigValuesData {
21194 #[inline]
21195 fn from_wire(wire_: crate::wire::ConfigValuesData<'de>) -> Self {
21196 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
21197
21198 let values = wire_.table.get(1);
21199
21200 let checksum = wire_.table.get(2);
21201
21202 Self {
21203
21204
21205 values: values.map(|envelope| ::fidl_next::FromWire::from_wire(
21206 unsafe { envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigValueSpec<'de>>>() }
21207 )),
21208
21209
21210 checksum: checksum.map(|envelope| ::fidl_next::FromWire::from_wire(
21211 unsafe { envelope.read_unchecked::<crate::wire::ConfigChecksum<'de>>() }
21212 )),
21213
21214 }
21215 }
21216 }
21217
21218 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigValuesData<'de>> for ConfigValuesData {
21219 #[inline]
21220 fn from_wire_ref(wire: &crate::wire::ConfigValuesData<'de>) -> Self {
21221 Self {
21222
21223
21224 values: wire.table.get(1)
21225 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
21226 unsafe { envelope.deref_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigValueSpec<'de>>>() }
21227 )),
21228
21229
21230 checksum: wire.table.get(2)
21231 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
21232 unsafe { envelope.deref_unchecked::<crate::wire::ConfigChecksum<'de>>() }
21233 )),
21234
21235 }
21236 }
21237 }
21238
21239 #[doc = " Indicates the event name to subscribe to with a given event mode.\n"]
21240 #[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21241 pub struct EventSubscription {
21242 pub event_name: ::core::option::Option<::std::string::String>,
21243 }
21244
21245 impl EventSubscription {
21246 fn __max_ordinal(&self) -> usize {
21247 if self.event_name.is_some() {
21248 return 1;
21249 }
21250
21251 0
21252 }
21253 }
21254
21255 unsafe impl<___E> ::fidl_next::Encode<crate::wire::EventSubscription<'static>, ___E>
21256 for EventSubscription
21257 where
21258 ___E: ::fidl_next::Encoder + ?Sized,
21259 {
21260 #[inline]
21261 fn encode(
21262 mut self,
21263 encoder: &mut ___E,
21264 out: &mut ::core::mem::MaybeUninit<crate::wire::EventSubscription<'static>>,
21265 _: (),
21266 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21267 ::fidl_next::munge!(let crate::wire::EventSubscription { table } = out);
21268
21269 let max_ord = self.__max_ordinal();
21270
21271 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
21272 ::fidl_next::Wire::zero_padding(&mut out);
21273
21274 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
21275 ::fidl_next::wire::Envelope,
21276 >(encoder, max_ord);
21277
21278 for i in 1..=max_ord {
21279 match i {
21280 1 => {
21281 if let Some(value) = self.event_name.take() {
21282 ::fidl_next::wire::Envelope::encode_value::<
21283 ::fidl_next::wire::String<'static>,
21284 ___E,
21285 >(
21286 value, preallocated.encoder, &mut out, 100
21287 )?;
21288 } else {
21289 ::fidl_next::wire::Envelope::encode_zero(&mut out)
21290 }
21291 }
21292
21293 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
21294 }
21295 unsafe {
21296 preallocated.write_next(out.assume_init_ref());
21297 }
21298 }
21299
21300 ::fidl_next::wire::Table::encode_len(table, max_ord);
21301
21302 Ok(())
21303 }
21304 }
21305
21306 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EventSubscription<'static>, ___E>
21307 for &'a EventSubscription
21308 where
21309 ___E: ::fidl_next::Encoder + ?Sized,
21310 {
21311 #[inline]
21312 fn encode(
21313 self,
21314 encoder: &mut ___E,
21315 out: &mut ::core::mem::MaybeUninit<crate::wire::EventSubscription<'static>>,
21316 _: (),
21317 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21318 ::fidl_next::munge!(let crate::wire::EventSubscription { table } = out);
21319
21320 let max_ord = self.__max_ordinal();
21321
21322 let mut out = ::core::mem::MaybeUninit::<::fidl_next::wire::Envelope>::uninit();
21323 ::fidl_next::Wire::zero_padding(&mut out);
21324
21325 let mut preallocated = ::fidl_next::EncoderExt::preallocate::<
21326 ::fidl_next::wire::Envelope,
21327 >(encoder, max_ord);
21328
21329 for i in 1..=max_ord {
21330 match i {
21331 1 => {
21332 if let Some(value) = &self.event_name {
21333 ::fidl_next::wire::Envelope::encode_value::<
21334 ::fidl_next::wire::String<'static>,
21335 ___E,
21336 >(
21337 value, preallocated.encoder, &mut out, 100
21338 )?;
21339 } else {
21340 ::fidl_next::wire::Envelope::encode_zero(&mut out)
21341 }
21342 }
21343
21344 _ => ::fidl_next::wire::Envelope::encode_zero(&mut out),
21345 }
21346 unsafe {
21347 preallocated.write_next(out.assume_init_ref());
21348 }
21349 }
21350
21351 ::fidl_next::wire::Table::encode_len(table, max_ord);
21352
21353 Ok(())
21354 }
21355 }
21356
21357 impl<'de> ::fidl_next::FromWire<crate::wire::EventSubscription<'de>> for EventSubscription {
21358 #[inline]
21359 fn from_wire(wire_: crate::wire::EventSubscription<'de>) -> Self {
21360 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
21361
21362 let event_name = wire_.table.get(1);
21363
21364 Self {
21365 event_name: event_name.map(|envelope| {
21366 ::fidl_next::FromWire::from_wire(unsafe {
21367 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
21368 })
21369 }),
21370 }
21371 }
21372 }
21373
21374 impl<'de> ::fidl_next::FromWireRef<crate::wire::EventSubscription<'de>> for EventSubscription {
21375 #[inline]
21376 fn from_wire_ref(wire: &crate::wire::EventSubscription<'de>) -> Self {
21377 Self {
21378 event_name: wire.table.get(1).map(|envelope| {
21379 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
21380 envelope.deref_unchecked::<::fidl_next::wire::String<'de>>()
21381 })
21382 }),
21383 }
21384 }
21385 }
21386
21387 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21388 pub enum LayoutParameter {
21389 NestedType(crate::natural::ConfigType),
21390
21391 UnknownOrdinal_(u64),
21392 }
21393
21394 impl LayoutParameter {
21395 pub fn is_unknown(&self) -> bool {
21396 #[allow(unreachable_patterns)]
21397 match self {
21398 Self::UnknownOrdinal_(_) => true,
21399 _ => false,
21400 }
21401 }
21402 }
21403
21404 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LayoutParameter<'static>, ___E>
21405 for LayoutParameter
21406 where
21407 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21408 ___E: ::fidl_next::Encoder,
21409 {
21410 #[inline]
21411 fn encode(
21412 self,
21413 encoder: &mut ___E,
21414 out: &mut ::core::mem::MaybeUninit<crate::wire::LayoutParameter<'static>>,
21415 _: (),
21416 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21417 ::fidl_next::munge!(let crate::wire::LayoutParameter { raw, _phantom: _ } = out);
21418
21419 match self {
21420 Self::NestedType(value) => ::fidl_next::wire::Union::encode_as::<
21421 ___E,
21422 crate::wire::ConfigType<'static>,
21423 >(value, 1, encoder, raw, ())?,
21424
21425 Self::UnknownOrdinal_(ordinal) => {
21426 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
21427 }
21428 }
21429
21430 Ok(())
21431 }
21432 }
21433
21434 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LayoutParameter<'static>, ___E>
21435 for &'a LayoutParameter
21436 where
21437 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21438 ___E: ::fidl_next::Encoder,
21439 {
21440 #[inline]
21441 fn encode(
21442 self,
21443 encoder: &mut ___E,
21444 out: &mut ::core::mem::MaybeUninit<crate::wire::LayoutParameter<'static>>,
21445 _: (),
21446 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21447 ::fidl_next::munge!(let crate::wire::LayoutParameter { raw, _phantom: _ } = out);
21448
21449 match self {
21450 LayoutParameter::NestedType(value) => ::fidl_next::wire::Union::encode_as::<
21451 ___E,
21452 crate::wire::ConfigType<'static>,
21453 >(value, 1, encoder, raw, ())?,
21454
21455 LayoutParameter::UnknownOrdinal_(ordinal) => {
21456 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
21457 }
21458 }
21459
21460 Ok(())
21461 }
21462 }
21463
21464 unsafe impl<___E>
21465 ::fidl_next::EncodeOption<crate::wire_optional::LayoutParameter<'static>, ___E>
21466 for LayoutParameter
21467 where
21468 ___E: ?Sized,
21469 LayoutParameter: ::fidl_next::Encode<crate::wire::LayoutParameter<'static>, ___E>,
21470 {
21471 #[inline]
21472 fn encode_option(
21473 this: ::core::option::Option<Self>,
21474 encoder: &mut ___E,
21475 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::LayoutParameter<'static>>,
21476 _: (),
21477 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21478 ::fidl_next::munge!(let crate::wire_optional::LayoutParameter { raw, _phantom: _ } = &mut *out);
21479
21480 if let Some(inner) = this {
21481 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
21482 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
21483 } else {
21484 ::fidl_next::wire::Union::encode_absent(raw);
21485 }
21486
21487 Ok(())
21488 }
21489 }
21490
21491 unsafe impl<'a, ___E>
21492 ::fidl_next::EncodeOption<crate::wire_optional::LayoutParameter<'static>, ___E>
21493 for &'a LayoutParameter
21494 where
21495 ___E: ?Sized,
21496 &'a LayoutParameter: ::fidl_next::Encode<crate::wire::LayoutParameter<'static>, ___E>,
21497 {
21498 #[inline]
21499 fn encode_option(
21500 this: ::core::option::Option<Self>,
21501 encoder: &mut ___E,
21502 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::LayoutParameter<'static>>,
21503 _: (),
21504 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21505 ::fidl_next::munge!(let crate::wire_optional::LayoutParameter { raw, _phantom: _ } = &mut *out);
21506
21507 if let Some(inner) = this {
21508 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
21509 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
21510 } else {
21511 ::fidl_next::wire::Union::encode_absent(raw);
21512 }
21513
21514 Ok(())
21515 }
21516 }
21517
21518 impl<'de> ::fidl_next::FromWire<crate::wire::LayoutParameter<'de>> for LayoutParameter {
21519 #[inline]
21520 fn from_wire(wire: crate::wire::LayoutParameter<'de>) -> Self {
21521 let wire = ::core::mem::ManuallyDrop::new(wire);
21522 match wire.raw.ordinal() {
21523 1 => Self::NestedType(::fidl_next::FromWire::from_wire(unsafe {
21524 wire.raw.get().read_unchecked::<crate::wire::ConfigType<'de>>()
21525 })),
21526
21527 ord => return Self::UnknownOrdinal_(ord as u64),
21528 }
21529 }
21530 }
21531
21532 impl<'de> ::fidl_next::FromWireRef<crate::wire::LayoutParameter<'de>> for LayoutParameter {
21533 #[inline]
21534 fn from_wire_ref(wire: &crate::wire::LayoutParameter<'de>) -> Self {
21535 match wire.raw.ordinal() {
21536 1 => Self::NestedType(::fidl_next::FromWireRef::from_wire_ref(unsafe {
21537 wire.raw.get().deref_unchecked::<crate::wire::ConfigType<'de>>()
21538 })),
21539
21540 ord => return Self::UnknownOrdinal_(ord as u64),
21541 }
21542 }
21543 }
21544
21545 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::LayoutParameter<'de>>
21546 for LayoutParameter
21547 {
21548 #[inline]
21549 fn from_wire_option(
21550 wire: crate::wire_optional::LayoutParameter<'de>,
21551 ) -> ::core::option::Option<Self> {
21552 if let Some(inner) = wire.into_option() {
21553 Some(::fidl_next::FromWire::from_wire(inner))
21554 } else {
21555 None
21556 }
21557 }
21558 }
21559
21560 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::LayoutParameter<'de>>
21561 for Box<LayoutParameter>
21562 {
21563 #[inline]
21564 fn from_wire_option(
21565 wire: crate::wire_optional::LayoutParameter<'de>,
21566 ) -> ::core::option::Option<Self> {
21567 <LayoutParameter as ::fidl_next::FromWireOption<
21568 crate::wire_optional::LayoutParameter<'de>,
21569 >>::from_wire_option(wire)
21570 .map(Box::new)
21571 }
21572 }
21573
21574 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::LayoutParameter<'de>>
21575 for Box<LayoutParameter>
21576 {
21577 #[inline]
21578 fn from_wire_option_ref(
21579 wire: &crate::wire_optional::LayoutParameter<'de>,
21580 ) -> ::core::option::Option<Self> {
21581 if let Some(inner) = wire.as_ref() {
21582 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
21583 } else {
21584 None
21585 }
21586 }
21587 }
21588
21589 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21590 pub struct ResolvedConfigField {
21591 pub key: ::std::string::String,
21592
21593 pub value: crate::natural::ConfigValue,
21594 }
21595
21596 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ResolvedConfigField<'static>, ___E>
21597 for ResolvedConfigField
21598 where
21599 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21600 ___E: ::fidl_next::Encoder,
21601 {
21602 #[inline]
21603 fn encode(
21604 self,
21605 encoder_: &mut ___E,
21606 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfigField<'static>>,
21607 _: (),
21608 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21609 ::fidl_next::munge! {
21610 let crate::wire::ResolvedConfigField {
21611 key,
21612 value,
21613
21614 } = out_;
21615 }
21616
21617 ::fidl_next::Encode::encode(self.key, encoder_, key, 4294967295)?;
21618
21619 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(key.as_mut_ptr()) };
21620 ::fidl_next::Constrained::validate(_field, 4294967295)?;
21621
21622 ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
21623
21624 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
21625
21626 Ok(())
21627 }
21628 }
21629
21630 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ResolvedConfigField<'static>, ___E>
21631 for &'a ResolvedConfigField
21632 where
21633 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21634 ___E: ::fidl_next::Encoder,
21635 {
21636 #[inline]
21637 fn encode(
21638 self,
21639 encoder_: &mut ___E,
21640 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfigField<'static>>,
21641 _: (),
21642 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21643 ::fidl_next::munge! {
21644 let crate::wire::ResolvedConfigField {
21645
21646 key,
21647 value,
21648
21649 } = out_;
21650 }
21651
21652 ::fidl_next::Encode::encode(&self.key, encoder_, key, 4294967295)?;
21653
21654 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(key.as_mut_ptr()) };
21655 ::fidl_next::Constrained::validate(_field, 4294967295)?;
21656
21657 ::fidl_next::Encode::encode(&self.value, encoder_, value, ())?;
21658
21659 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
21660
21661 Ok(())
21662 }
21663 }
21664
21665 unsafe impl<___E>
21666 ::fidl_next::EncodeOption<
21667 ::fidl_next::wire::Box<'static, crate::wire::ResolvedConfigField<'static>>,
21668 ___E,
21669 > for ResolvedConfigField
21670 where
21671 ___E: ::fidl_next::Encoder + ?Sized,
21672 ResolvedConfigField: ::fidl_next::Encode<crate::wire::ResolvedConfigField<'static>, ___E>,
21673 {
21674 #[inline]
21675 fn encode_option(
21676 this: ::core::option::Option<Self>,
21677 encoder: &mut ___E,
21678 out: &mut ::core::mem::MaybeUninit<
21679 ::fidl_next::wire::Box<'static, crate::wire::ResolvedConfigField<'static>>,
21680 >,
21681 _: (),
21682 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21683 if let Some(inner) = this {
21684 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21685 ::fidl_next::wire::Box::encode_present(out);
21686 } else {
21687 ::fidl_next::wire::Box::encode_absent(out);
21688 }
21689
21690 Ok(())
21691 }
21692 }
21693
21694 unsafe impl<'a, ___E>
21695 ::fidl_next::EncodeOption<
21696 ::fidl_next::wire::Box<'static, crate::wire::ResolvedConfigField<'static>>,
21697 ___E,
21698 > for &'a ResolvedConfigField
21699 where
21700 ___E: ::fidl_next::Encoder + ?Sized,
21701 &'a ResolvedConfigField:
21702 ::fidl_next::Encode<crate::wire::ResolvedConfigField<'static>, ___E>,
21703 {
21704 #[inline]
21705 fn encode_option(
21706 this: ::core::option::Option<Self>,
21707 encoder: &mut ___E,
21708 out: &mut ::core::mem::MaybeUninit<
21709 ::fidl_next::wire::Box<'static, crate::wire::ResolvedConfigField<'static>>,
21710 >,
21711 _: (),
21712 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21713 if let Some(inner) = this {
21714 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21715 ::fidl_next::wire::Box::encode_present(out);
21716 } else {
21717 ::fidl_next::wire::Box::encode_absent(out);
21718 }
21719
21720 Ok(())
21721 }
21722 }
21723
21724 impl<'de> ::fidl_next::FromWire<crate::wire::ResolvedConfigField<'de>> for ResolvedConfigField {
21725 #[inline]
21726 fn from_wire(wire: crate::wire::ResolvedConfigField<'de>) -> Self {
21727 Self {
21728 key: ::fidl_next::FromWire::from_wire(wire.key),
21729
21730 value: ::fidl_next::FromWire::from_wire(wire.value),
21731 }
21732 }
21733 }
21734
21735 impl<'de> ::fidl_next::FromWireRef<crate::wire::ResolvedConfigField<'de>> for ResolvedConfigField {
21736 #[inline]
21737 fn from_wire_ref(wire: &crate::wire::ResolvedConfigField<'de>) -> Self {
21738 Self {
21739 key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
21740
21741 value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value),
21742 }
21743 }
21744 }
21745
21746 #[doc = " A configuration that has been completely resolved by component manager.\n"]
21747 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
21748 pub struct ResolvedConfig {
21749 pub fields: ::std::vec::Vec<crate::natural::ResolvedConfigField>,
21750
21751 pub checksum: crate::natural::ConfigChecksum,
21752 }
21753
21754 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ResolvedConfig<'static>, ___E> for ResolvedConfig
21755 where
21756 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21757 ___E: ::fidl_next::Encoder,
21758 {
21759 #[inline]
21760 fn encode(
21761 self,
21762 encoder_: &mut ___E,
21763 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfig<'static>>,
21764 _: (),
21765 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21766 ::fidl_next::munge! {
21767 let crate::wire::ResolvedConfig {
21768 fields,
21769 checksum,
21770
21771 } = out_;
21772 }
21773
21774 ::fidl_next::Encode::encode(self.fields, encoder_, fields, (4294967295, ()))?;
21775
21776 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(fields.as_mut_ptr()) };
21777 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
21778
21779 ::fidl_next::Encode::encode(self.checksum, encoder_, checksum, ())?;
21780
21781 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(checksum.as_mut_ptr()) };
21782
21783 Ok(())
21784 }
21785 }
21786
21787 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ResolvedConfig<'static>, ___E>
21788 for &'a ResolvedConfig
21789 where
21790 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21791 ___E: ::fidl_next::Encoder,
21792 {
21793 #[inline]
21794 fn encode(
21795 self,
21796 encoder_: &mut ___E,
21797 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfig<'static>>,
21798 _: (),
21799 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21800 ::fidl_next::munge! {
21801 let crate::wire::ResolvedConfig {
21802
21803 fields,
21804 checksum,
21805
21806 } = out_;
21807 }
21808
21809 ::fidl_next::Encode::encode(&self.fields, encoder_, fields, (4294967295, ()))?;
21810
21811 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(fields.as_mut_ptr()) };
21812 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
21813
21814 ::fidl_next::Encode::encode(&self.checksum, encoder_, checksum, ())?;
21815
21816 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(checksum.as_mut_ptr()) };
21817
21818 Ok(())
21819 }
21820 }
21821
21822 unsafe impl<___E>
21823 ::fidl_next::EncodeOption<
21824 ::fidl_next::wire::Box<'static, crate::wire::ResolvedConfig<'static>>,
21825 ___E,
21826 > for ResolvedConfig
21827 where
21828 ___E: ::fidl_next::Encoder + ?Sized,
21829 ResolvedConfig: ::fidl_next::Encode<crate::wire::ResolvedConfig<'static>, ___E>,
21830 {
21831 #[inline]
21832 fn encode_option(
21833 this: ::core::option::Option<Self>,
21834 encoder: &mut ___E,
21835 out: &mut ::core::mem::MaybeUninit<
21836 ::fidl_next::wire::Box<'static, crate::wire::ResolvedConfig<'static>>,
21837 >,
21838 _: (),
21839 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21840 if let Some(inner) = this {
21841 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21842 ::fidl_next::wire::Box::encode_present(out);
21843 } else {
21844 ::fidl_next::wire::Box::encode_absent(out);
21845 }
21846
21847 Ok(())
21848 }
21849 }
21850
21851 unsafe impl<'a, ___E>
21852 ::fidl_next::EncodeOption<
21853 ::fidl_next::wire::Box<'static, crate::wire::ResolvedConfig<'static>>,
21854 ___E,
21855 > for &'a ResolvedConfig
21856 where
21857 ___E: ::fidl_next::Encoder + ?Sized,
21858 &'a ResolvedConfig: ::fidl_next::Encode<crate::wire::ResolvedConfig<'static>, ___E>,
21859 {
21860 #[inline]
21861 fn encode_option(
21862 this: ::core::option::Option<Self>,
21863 encoder: &mut ___E,
21864 out: &mut ::core::mem::MaybeUninit<
21865 ::fidl_next::wire::Box<'static, crate::wire::ResolvedConfig<'static>>,
21866 >,
21867 _: (),
21868 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21869 if let Some(inner) = this {
21870 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
21871 ::fidl_next::wire::Box::encode_present(out);
21872 } else {
21873 ::fidl_next::wire::Box::encode_absent(out);
21874 }
21875
21876 Ok(())
21877 }
21878 }
21879
21880 impl<'de> ::fidl_next::FromWire<crate::wire::ResolvedConfig<'de>> for ResolvedConfig {
21881 #[inline]
21882 fn from_wire(wire: crate::wire::ResolvedConfig<'de>) -> Self {
21883 Self {
21884 fields: ::fidl_next::FromWire::from_wire(wire.fields),
21885
21886 checksum: ::fidl_next::FromWire::from_wire(wire.checksum),
21887 }
21888 }
21889 }
21890
21891 impl<'de> ::fidl_next::FromWireRef<crate::wire::ResolvedConfig<'de>> for ResolvedConfig {
21892 #[inline]
21893 fn from_wire_ref(wire: &crate::wire::ResolvedConfig<'de>) -> Self {
21894 Self {
21895 fields: ::fidl_next::FromWireRef::from_wire_ref(&wire.fields),
21896
21897 checksum: ::fidl_next::FromWireRef::from_wire_ref(&wire.checksum),
21898 }
21899 }
21900 }
21901}
21902
21903pub mod wire {
21904
21905 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
21907 #[repr(transparent)]
21908 pub struct AllowedOffers {
21909 pub(crate) value: ::fidl_next::wire::Uint32,
21910 }
21911
21912 impl ::fidl_next::Constrained for AllowedOffers {
21913 type Constraint = ();
21914
21915 fn validate(
21916 _: ::fidl_next::Slot<'_, Self>,
21917 _: Self::Constraint,
21918 ) -> Result<(), ::fidl_next::ValidationError> {
21919 Ok(())
21920 }
21921 }
21922
21923 unsafe impl ::fidl_next::Wire for AllowedOffers {
21924 type Narrowed<'de> = Self;
21925
21926 #[inline]
21927 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
21928 }
21930 }
21931
21932 impl AllowedOffers {
21933 pub const STATIC_ONLY: AllowedOffers =
21934 AllowedOffers { value: ::fidl_next::wire::Uint32(1) };
21935
21936 pub const STATIC_AND_DYNAMIC: AllowedOffers =
21937 AllowedOffers { value: ::fidl_next::wire::Uint32(2) };
21938 }
21939
21940 unsafe impl<___D> ::fidl_next::Decode<___D> for AllowedOffers
21941 where
21942 ___D: ?Sized,
21943 {
21944 fn decode(
21945 slot: ::fidl_next::Slot<'_, Self>,
21946 _: &mut ___D,
21947 _: (),
21948 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21949 ::fidl_next::munge!(let Self { value } = slot);
21950
21951 match u32::from(*value) {
21952 1 | 2 => (),
21953 unknown => {
21954 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
21955 }
21956 }
21957
21958 Ok(())
21959 }
21960 }
21961
21962 impl ::core::convert::From<crate::natural::AllowedOffers> for AllowedOffers {
21963 fn from(natural: crate::natural::AllowedOffers) -> Self {
21964 match natural {
21965 crate::natural::AllowedOffers::StaticOnly => AllowedOffers::STATIC_ONLY,
21966
21967 crate::natural::AllowedOffers::StaticAndDynamic => {
21968 AllowedOffers::STATIC_AND_DYNAMIC
21969 }
21970 }
21971 }
21972 }
21973
21974 impl ::fidl_next::IntoNatural for AllowedOffers {
21975 type Natural = crate::natural::AllowedOffers;
21976 }
21977
21978 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
21980 #[repr(transparent)]
21981 pub struct Availability {
21982 pub(crate) value: ::fidl_next::wire::Uint32,
21983 }
21984
21985 impl ::fidl_next::Constrained for Availability {
21986 type Constraint = ();
21987
21988 fn validate(
21989 _: ::fidl_next::Slot<'_, Self>,
21990 _: Self::Constraint,
21991 ) -> Result<(), ::fidl_next::ValidationError> {
21992 Ok(())
21993 }
21994 }
21995
21996 unsafe impl ::fidl_next::Wire for Availability {
21997 type Narrowed<'de> = Self;
21998
21999 #[inline]
22000 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
22001 }
22003 }
22004
22005 impl Availability {
22006 pub const REQUIRED: Availability = Availability { value: ::fidl_next::wire::Uint32(1) };
22007
22008 pub const OPTIONAL: Availability = Availability { value: ::fidl_next::wire::Uint32(2) };
22009
22010 pub const SAME_AS_TARGET: Availability =
22011 Availability { value: ::fidl_next::wire::Uint32(3) };
22012
22013 pub const TRANSITIONAL: Availability = Availability { value: ::fidl_next::wire::Uint32(4) };
22014 }
22015
22016 unsafe impl<___D> ::fidl_next::Decode<___D> for Availability
22017 where
22018 ___D: ?Sized,
22019 {
22020 fn decode(
22021 slot: ::fidl_next::Slot<'_, Self>,
22022 _: &mut ___D,
22023 _: (),
22024 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22025 ::fidl_next::munge!(let Self { value } = slot);
22026
22027 match u32::from(*value) {
22028 1 | 2 | 3 | 4 => (),
22029 unknown => {
22030 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
22031 }
22032 }
22033
22034 Ok(())
22035 }
22036 }
22037
22038 impl ::core::convert::From<crate::natural::Availability> for Availability {
22039 fn from(natural: crate::natural::Availability) -> Self {
22040 match natural {
22041 crate::natural::Availability::Required => Availability::REQUIRED,
22042
22043 crate::natural::Availability::Optional => Availability::OPTIONAL,
22044
22045 crate::natural::Availability::SameAsTarget => Availability::SAME_AS_TARGET,
22046
22047 crate::natural::Availability::Transitional => Availability::TRANSITIONAL,
22048 }
22049 }
22050 }
22051
22052 impl ::fidl_next::IntoNatural for Availability {
22053 type Natural = crate::natural::Availability;
22054 }
22055
22056 pub type Name<'de> = ::fidl_next::wire::String<'de>;
22058
22059 #[repr(C)]
22061 pub struct Service<'de> {
22062 pub(crate) table: ::fidl_next::wire::Table<'de>,
22063 }
22064
22065 impl<'de> Drop for Service<'de> {
22066 fn drop(&mut self) {
22067 let _ = self.table.get(1).map(|envelope| unsafe {
22068 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
22069 });
22070
22071 let _ = self.table.get(2).map(|envelope| unsafe {
22072 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
22073 });
22074 }
22075 }
22076
22077 impl ::fidl_next::Constrained for Service<'_> {
22078 type Constraint = ();
22079
22080 fn validate(
22081 _: ::fidl_next::Slot<'_, Self>,
22082 _: Self::Constraint,
22083 ) -> Result<(), ::fidl_next::ValidationError> {
22084 Ok(())
22085 }
22086 }
22087
22088 unsafe impl ::fidl_next::Wire for Service<'static> {
22089 type Narrowed<'de> = Service<'de>;
22090
22091 #[inline]
22092 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
22093 ::fidl_next::munge!(let Self { table } = out);
22094 ::fidl_next::wire::Table::zero_padding(table);
22095 }
22096 }
22097
22098 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Service<'de>
22099 where
22100 ___D: ::fidl_next::Decoder<'de> + ?Sized,
22101 {
22102 fn decode(
22103 slot: ::fidl_next::Slot<'_, Self>,
22104 decoder: &mut ___D,
22105 _: (),
22106 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22107 ::fidl_next::munge!(let Self { table } = slot);
22108
22109 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
22110 match ordinal {
22111 0 => unsafe { ::core::hint::unreachable_unchecked() },
22112
22113 1 => {
22114 ::fidl_next::wire::Envelope::decode_as::<
22115 ___D,
22116 ::fidl_next::wire::String<'de>,
22117 >(slot.as_mut(), decoder, 100)?;
22118
22119 let value = unsafe {
22120 slot.deref_unchecked()
22121 .deref_unchecked::<::fidl_next::wire::String<'_>>()
22122 };
22123
22124 if value.len() > 100 {
22125 return Err(::fidl_next::DecodeError::VectorTooLong {
22126 size: value.len() as u64,
22127 limit: 100,
22128 });
22129 }
22130
22131 Ok(())
22132 }
22133
22134 2 => {
22135 ::fidl_next::wire::Envelope::decode_as::<
22136 ___D,
22137 ::fidl_next::wire::String<'de>,
22138 >(slot.as_mut(), decoder, 1024)?;
22139
22140 let value = unsafe {
22141 slot.deref_unchecked()
22142 .deref_unchecked::<::fidl_next::wire::String<'_>>()
22143 };
22144
22145 if value.len() > 1024 {
22146 return Err(::fidl_next::DecodeError::VectorTooLong {
22147 size: value.len() as u64,
22148 limit: 1024,
22149 });
22150 }
22151
22152 Ok(())
22153 }
22154
22155 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
22156 }
22157 })
22158 }
22159 }
22160
22161 impl<'de> Service<'de> {
22162 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
22163 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
22164 }
22165
22166 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
22167 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
22168 }
22169 }
22170
22171 impl<'de> ::core::fmt::Debug for Service<'de> {
22172 fn fmt(
22173 &self,
22174 f: &mut ::core::fmt::Formatter<'_>,
22175 ) -> ::core::result::Result<(), ::core::fmt::Error> {
22176 f.debug_struct("Service")
22177 .field("name", &self.name())
22178 .field("source_path", &self.source_path())
22179 .finish()
22180 }
22181 }
22182
22183 impl<'de> ::fidl_next::IntoNatural for Service<'de> {
22184 type Natural = crate::natural::Service;
22185 }
22186
22187 #[repr(C)]
22189 pub struct Directory<'de> {
22190 pub(crate) table: ::fidl_next::wire::Table<'de>,
22191 }
22192
22193 impl<'de> Drop for Directory<'de> {
22194 fn drop(&mut self) {
22195 let _ = self.table.get(1).map(|envelope| unsafe {
22196 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
22197 });
22198
22199 let _ = self.table.get(2).map(|envelope| unsafe {
22200 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
22201 });
22202
22203 let _ = self.table.get(3).map(|envelope| unsafe {
22204 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
22205 });
22206 }
22207 }
22208
22209 impl ::fidl_next::Constrained for Directory<'_> {
22210 type Constraint = ();
22211
22212 fn validate(
22213 _: ::fidl_next::Slot<'_, Self>,
22214 _: Self::Constraint,
22215 ) -> Result<(), ::fidl_next::ValidationError> {
22216 Ok(())
22217 }
22218 }
22219
22220 unsafe impl ::fidl_next::Wire for Directory<'static> {
22221 type Narrowed<'de> = Directory<'de>;
22222
22223 #[inline]
22224 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
22225 ::fidl_next::munge!(let Self { table } = out);
22226 ::fidl_next::wire::Table::zero_padding(table);
22227 }
22228 }
22229
22230 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Directory<'de>
22231 where
22232 ___D: ::fidl_next::Decoder<'de> + ?Sized,
22233 {
22234 fn decode(
22235 slot: ::fidl_next::Slot<'_, Self>,
22236 decoder: &mut ___D,
22237 _: (),
22238 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22239 ::fidl_next::munge!(let Self { table } = slot);
22240
22241 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
22242 match ordinal {
22243 0 => unsafe { ::core::hint::unreachable_unchecked() },
22244
22245 1 => {
22246 ::fidl_next::wire::Envelope::decode_as::<
22247 ___D,
22248 ::fidl_next::wire::String<'de>,
22249 >(slot.as_mut(), decoder, 100)?;
22250
22251 let value = unsafe {
22252 slot.deref_unchecked()
22253 .deref_unchecked::<::fidl_next::wire::String<'_>>()
22254 };
22255
22256 if value.len() > 100 {
22257 return Err(::fidl_next::DecodeError::VectorTooLong {
22258 size: value.len() as u64,
22259 limit: 100,
22260 });
22261 }
22262
22263 Ok(())
22264 }
22265
22266 2 => {
22267 ::fidl_next::wire::Envelope::decode_as::<
22268 ___D,
22269 ::fidl_next::wire::String<'de>,
22270 >(slot.as_mut(), decoder, 1024)?;
22271
22272 let value = unsafe {
22273 slot.deref_unchecked()
22274 .deref_unchecked::<::fidl_next::wire::String<'_>>()
22275 };
22276
22277 if value.len() > 1024 {
22278 return Err(::fidl_next::DecodeError::VectorTooLong {
22279 size: value.len() as u64,
22280 limit: 1024,
22281 });
22282 }
22283
22284 Ok(())
22285 }
22286
22287 3 => {
22288 ::fidl_next::wire::Envelope::decode_as::<
22289 ___D,
22290 ::fidl_next_common_fuchsia_io::wire::Operations,
22291 >(slot.as_mut(), decoder, ())?;
22292
22293 Ok(())
22294 }
22295
22296 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
22297 }
22298 })
22299 }
22300 }
22301
22302 impl<'de> Directory<'de> {
22303 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
22304 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
22305 }
22306
22307 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
22308 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
22309 }
22310
22311 pub fn rights(
22312 &self,
22313 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_io::wire::Operations> {
22314 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
22315 }
22316 }
22317
22318 impl<'de> ::core::fmt::Debug for Directory<'de> {
22319 fn fmt(
22320 &self,
22321 f: &mut ::core::fmt::Formatter<'_>,
22322 ) -> ::core::result::Result<(), ::core::fmt::Error> {
22323 f.debug_struct("Directory")
22324 .field("name", &self.name())
22325 .field("source_path", &self.source_path())
22326 .field("rights", &self.rights())
22327 .finish()
22328 }
22329 }
22330
22331 impl<'de> ::fidl_next::IntoNatural for Directory<'de> {
22332 type Natural = crate::natural::Directory;
22333 }
22334
22335 #[derive(Clone, Debug)]
22337 #[repr(C)]
22338 pub struct ParentRef {
22339 pub(crate) _empty: fidl_next::wire::EmptyStruct,
22340 }
22341
22342 static_assertions::const_assert_eq!(std::mem::size_of::<ParentRef>(), 1);
22343 static_assertions::const_assert_eq!(std::mem::align_of::<ParentRef>(), 1);
22344
22345 impl ::fidl_next::Constrained for ParentRef {
22346 type Constraint = ();
22347
22348 fn validate(
22349 _: ::fidl_next::Slot<'_, Self>,
22350 _: Self::Constraint,
22351 ) -> Result<(), ::fidl_next::ValidationError> {
22352 Ok(())
22353 }
22354 }
22355
22356 unsafe impl ::fidl_next::Wire for ParentRef {
22357 type Narrowed<'de> = ParentRef;
22358
22359 #[inline]
22360 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22361 ::fidl_next::munge! {
22362 let Self {
22363
22364 _empty,
22365
22366
22367 } = &mut *out_;
22368 }
22369 }
22370 }
22371
22372 unsafe impl<___D> ::fidl_next::Decode<___D> for ParentRef
22373 where
22374 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22375 {
22376 fn decode(
22377 slot_: ::fidl_next::Slot<'_, Self>,
22378 decoder_: &mut ___D,
22379 _: (),
22380 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22381 ::fidl_next::munge! {
22382 let Self {
22383
22384 mut _empty,
22385
22386
22387 } = slot_;
22388 }
22389
22390 if _empty.as_bytes() != &[0u8] {
22391 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
22392 }
22393
22394 Ok(())
22395 }
22396 }
22397
22398 impl ::fidl_next::IntoNatural for ParentRef {
22399 type Natural = crate::natural::ParentRef;
22400 }
22401
22402 #[derive(Clone, Debug)]
22404 #[repr(C)]
22405 pub struct SelfRef {
22406 pub(crate) _empty: fidl_next::wire::EmptyStruct,
22407 }
22408
22409 static_assertions::const_assert_eq!(std::mem::size_of::<SelfRef>(), 1);
22410 static_assertions::const_assert_eq!(std::mem::align_of::<SelfRef>(), 1);
22411
22412 impl ::fidl_next::Constrained for SelfRef {
22413 type Constraint = ();
22414
22415 fn validate(
22416 _: ::fidl_next::Slot<'_, Self>,
22417 _: Self::Constraint,
22418 ) -> Result<(), ::fidl_next::ValidationError> {
22419 Ok(())
22420 }
22421 }
22422
22423 unsafe impl ::fidl_next::Wire for SelfRef {
22424 type Narrowed<'de> = SelfRef;
22425
22426 #[inline]
22427 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22428 ::fidl_next::munge! {
22429 let Self {
22430
22431 _empty,
22432
22433
22434 } = &mut *out_;
22435 }
22436 }
22437 }
22438
22439 unsafe impl<___D> ::fidl_next::Decode<___D> for SelfRef
22440 where
22441 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22442 {
22443 fn decode(
22444 slot_: ::fidl_next::Slot<'_, Self>,
22445 decoder_: &mut ___D,
22446 _: (),
22447 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22448 ::fidl_next::munge! {
22449 let Self {
22450
22451 mut _empty,
22452
22453
22454 } = slot_;
22455 }
22456
22457 if _empty.as_bytes() != &[0u8] {
22458 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
22459 }
22460
22461 Ok(())
22462 }
22463 }
22464
22465 impl ::fidl_next::IntoNatural for SelfRef {
22466 type Natural = crate::natural::SelfRef;
22467 }
22468
22469 pub type ChildName<'de> = ::fidl_next::wire::String<'de>;
22471
22472 #[derive(Debug)]
22474 #[repr(C)]
22475 pub struct ChildRef<'de> {
22476 pub name: ::fidl_next::wire::String<'de>,
22477
22478 pub collection: ::fidl_next::wire::OptionalString<'de>,
22479 }
22480
22481 static_assertions::const_assert_eq!(std::mem::size_of::<ChildRef<'_>>(), 32);
22482 static_assertions::const_assert_eq!(std::mem::align_of::<ChildRef<'_>>(), 8);
22483
22484 static_assertions::const_assert_eq!(std::mem::offset_of!(ChildRef<'_>, name), 0);
22485
22486 static_assertions::const_assert_eq!(std::mem::offset_of!(ChildRef<'_>, collection), 16);
22487
22488 impl ::fidl_next::Constrained for ChildRef<'_> {
22489 type Constraint = ();
22490
22491 fn validate(
22492 _: ::fidl_next::Slot<'_, Self>,
22493 _: Self::Constraint,
22494 ) -> Result<(), ::fidl_next::ValidationError> {
22495 Ok(())
22496 }
22497 }
22498
22499 unsafe impl ::fidl_next::Wire for ChildRef<'static> {
22500 type Narrowed<'de> = ChildRef<'de>;
22501
22502 #[inline]
22503 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22504 ::fidl_next::munge! {
22505 let Self {
22506
22507 name,
22508 collection,
22509
22510 } = &mut *out_;
22511 }
22512
22513 ::fidl_next::Wire::zero_padding(name);
22514
22515 ::fidl_next::Wire::zero_padding(collection);
22516 }
22517 }
22518
22519 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ChildRef<'de>
22520 where
22521 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22522 ___D: ::fidl_next::Decoder<'de>,
22523 {
22524 fn decode(
22525 slot_: ::fidl_next::Slot<'_, Self>,
22526 decoder_: &mut ___D,
22527 _: (),
22528 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22529 ::fidl_next::munge! {
22530 let Self {
22531
22532 mut name,
22533 mut collection,
22534
22535 } = slot_;
22536 }
22537
22538 let _field = name.as_mut();
22539 ::fidl_next::Constrained::validate(_field, 1024)?;
22540 ::fidl_next::Decode::decode(name.as_mut(), decoder_, 1024)?;
22541
22542 let name = unsafe { name.deref_unchecked() };
22543
22544 if name.len() > 1024 {
22545 return Err(::fidl_next::DecodeError::VectorTooLong {
22546 size: name.len() as u64,
22547 limit: 1024,
22548 });
22549 }
22550
22551 let _field = collection.as_mut();
22552 ::fidl_next::Constrained::validate(_field, 100)?;
22553 ::fidl_next::Decode::decode(collection.as_mut(), decoder_, 100)?;
22554
22555 let collection = unsafe { collection.deref_unchecked() };
22556
22557 if let Some(collection) = collection.as_ref() {
22558 if collection.len() > 100 {
22559 return Err(::fidl_next::DecodeError::VectorTooLong {
22560 size: collection.len() as u64,
22561 limit: 100,
22562 });
22563 }
22564 }
22565
22566 Ok(())
22567 }
22568 }
22569
22570 impl<'de> ::fidl_next::IntoNatural for ChildRef<'de> {
22571 type Natural = crate::natural::ChildRef;
22572 }
22573
22574 #[derive(Debug)]
22576 #[repr(C)]
22577 pub struct CollectionRef<'de> {
22578 pub name: ::fidl_next::wire::String<'de>,
22579 }
22580
22581 static_assertions::const_assert_eq!(std::mem::size_of::<CollectionRef<'_>>(), 16);
22582 static_assertions::const_assert_eq!(std::mem::align_of::<CollectionRef<'_>>(), 8);
22583
22584 static_assertions::const_assert_eq!(std::mem::offset_of!(CollectionRef<'_>, name), 0);
22585
22586 impl ::fidl_next::Constrained for CollectionRef<'_> {
22587 type Constraint = ();
22588
22589 fn validate(
22590 _: ::fidl_next::Slot<'_, Self>,
22591 _: Self::Constraint,
22592 ) -> Result<(), ::fidl_next::ValidationError> {
22593 Ok(())
22594 }
22595 }
22596
22597 unsafe impl ::fidl_next::Wire for CollectionRef<'static> {
22598 type Narrowed<'de> = CollectionRef<'de>;
22599
22600 #[inline]
22601 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22602 ::fidl_next::munge! {
22603 let Self {
22604
22605 name,
22606
22607 } = &mut *out_;
22608 }
22609
22610 ::fidl_next::Wire::zero_padding(name);
22611 }
22612 }
22613
22614 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for CollectionRef<'de>
22615 where
22616 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22617 ___D: ::fidl_next::Decoder<'de>,
22618 {
22619 fn decode(
22620 slot_: ::fidl_next::Slot<'_, Self>,
22621 decoder_: &mut ___D,
22622 _: (),
22623 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22624 ::fidl_next::munge! {
22625 let Self {
22626
22627 mut name,
22628
22629 } = slot_;
22630 }
22631
22632 let _field = name.as_mut();
22633 ::fidl_next::Constrained::validate(_field, 100)?;
22634 ::fidl_next::Decode::decode(name.as_mut(), decoder_, 100)?;
22635
22636 let name = unsafe { name.deref_unchecked() };
22637
22638 if name.len() > 100 {
22639 return Err(::fidl_next::DecodeError::VectorTooLong {
22640 size: name.len() as u64,
22641 limit: 100,
22642 });
22643 }
22644
22645 Ok(())
22646 }
22647 }
22648
22649 impl<'de> ::fidl_next::IntoNatural for CollectionRef<'de> {
22650 type Natural = crate::natural::CollectionRef;
22651 }
22652
22653 #[derive(Clone, Debug)]
22655 #[repr(C)]
22656 pub struct FrameworkRef {
22657 pub(crate) _empty: fidl_next::wire::EmptyStruct,
22658 }
22659
22660 static_assertions::const_assert_eq!(std::mem::size_of::<FrameworkRef>(), 1);
22661 static_assertions::const_assert_eq!(std::mem::align_of::<FrameworkRef>(), 1);
22662
22663 impl ::fidl_next::Constrained for FrameworkRef {
22664 type Constraint = ();
22665
22666 fn validate(
22667 _: ::fidl_next::Slot<'_, Self>,
22668 _: Self::Constraint,
22669 ) -> Result<(), ::fidl_next::ValidationError> {
22670 Ok(())
22671 }
22672 }
22673
22674 unsafe impl ::fidl_next::Wire for FrameworkRef {
22675 type Narrowed<'de> = FrameworkRef;
22676
22677 #[inline]
22678 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22679 ::fidl_next::munge! {
22680 let Self {
22681
22682 _empty,
22683
22684
22685 } = &mut *out_;
22686 }
22687 }
22688 }
22689
22690 unsafe impl<___D> ::fidl_next::Decode<___D> for FrameworkRef
22691 where
22692 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22693 {
22694 fn decode(
22695 slot_: ::fidl_next::Slot<'_, Self>,
22696 decoder_: &mut ___D,
22697 _: (),
22698 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22699 ::fidl_next::munge! {
22700 let Self {
22701
22702 mut _empty,
22703
22704
22705 } = slot_;
22706 }
22707
22708 if _empty.as_bytes() != &[0u8] {
22709 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
22710 }
22711
22712 Ok(())
22713 }
22714 }
22715
22716 impl ::fidl_next::IntoNatural for FrameworkRef {
22717 type Natural = crate::natural::FrameworkRef;
22718 }
22719
22720 #[derive(Debug)]
22722 #[repr(C)]
22723 pub struct CapabilityRef<'de> {
22724 pub name: ::fidl_next::wire::String<'de>,
22725 }
22726
22727 static_assertions::const_assert_eq!(std::mem::size_of::<CapabilityRef<'_>>(), 16);
22728 static_assertions::const_assert_eq!(std::mem::align_of::<CapabilityRef<'_>>(), 8);
22729
22730 static_assertions::const_assert_eq!(std::mem::offset_of!(CapabilityRef<'_>, name), 0);
22731
22732 impl ::fidl_next::Constrained for CapabilityRef<'_> {
22733 type Constraint = ();
22734
22735 fn validate(
22736 _: ::fidl_next::Slot<'_, Self>,
22737 _: Self::Constraint,
22738 ) -> Result<(), ::fidl_next::ValidationError> {
22739 Ok(())
22740 }
22741 }
22742
22743 unsafe impl ::fidl_next::Wire for CapabilityRef<'static> {
22744 type Narrowed<'de> = CapabilityRef<'de>;
22745
22746 #[inline]
22747 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22748 ::fidl_next::munge! {
22749 let Self {
22750
22751 name,
22752
22753 } = &mut *out_;
22754 }
22755
22756 ::fidl_next::Wire::zero_padding(name);
22757 }
22758 }
22759
22760 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for CapabilityRef<'de>
22761 where
22762 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22763 ___D: ::fidl_next::Decoder<'de>,
22764 {
22765 fn decode(
22766 slot_: ::fidl_next::Slot<'_, Self>,
22767 decoder_: &mut ___D,
22768 _: (),
22769 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22770 ::fidl_next::munge! {
22771 let Self {
22772
22773 mut name,
22774
22775 } = slot_;
22776 }
22777
22778 let _field = name.as_mut();
22779 ::fidl_next::Constrained::validate(_field, 100)?;
22780 ::fidl_next::Decode::decode(name.as_mut(), decoder_, 100)?;
22781
22782 let name = unsafe { name.deref_unchecked() };
22783
22784 if name.len() > 100 {
22785 return Err(::fidl_next::DecodeError::VectorTooLong {
22786 size: name.len() as u64,
22787 limit: 100,
22788 });
22789 }
22790
22791 Ok(())
22792 }
22793 }
22794
22795 impl<'de> ::fidl_next::IntoNatural for CapabilityRef<'de> {
22796 type Natural = crate::natural::CapabilityRef;
22797 }
22798
22799 #[derive(Clone, Debug)]
22801 #[repr(C)]
22802 pub struct DebugRef {
22803 pub(crate) _empty: fidl_next::wire::EmptyStruct,
22804 }
22805
22806 static_assertions::const_assert_eq!(std::mem::size_of::<DebugRef>(), 1);
22807 static_assertions::const_assert_eq!(std::mem::align_of::<DebugRef>(), 1);
22808
22809 impl ::fidl_next::Constrained for DebugRef {
22810 type Constraint = ();
22811
22812 fn validate(
22813 _: ::fidl_next::Slot<'_, Self>,
22814 _: Self::Constraint,
22815 ) -> Result<(), ::fidl_next::ValidationError> {
22816 Ok(())
22817 }
22818 }
22819
22820 unsafe impl ::fidl_next::Wire for DebugRef {
22821 type Narrowed<'de> = DebugRef;
22822
22823 #[inline]
22824 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22825 ::fidl_next::munge! {
22826 let Self {
22827
22828 _empty,
22829
22830
22831 } = &mut *out_;
22832 }
22833 }
22834 }
22835
22836 unsafe impl<___D> ::fidl_next::Decode<___D> for DebugRef
22837 where
22838 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22839 {
22840 fn decode(
22841 slot_: ::fidl_next::Slot<'_, Self>,
22842 decoder_: &mut ___D,
22843 _: (),
22844 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22845 ::fidl_next::munge! {
22846 let Self {
22847
22848 mut _empty,
22849
22850
22851 } = slot_;
22852 }
22853
22854 if _empty.as_bytes() != &[0u8] {
22855 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
22856 }
22857
22858 Ok(())
22859 }
22860 }
22861
22862 impl ::fidl_next::IntoNatural for DebugRef {
22863 type Natural = crate::natural::DebugRef;
22864 }
22865
22866 #[derive(Clone, Debug)]
22868 #[repr(C)]
22869 pub struct VoidRef {
22870 pub(crate) _empty: fidl_next::wire::EmptyStruct,
22871 }
22872
22873 static_assertions::const_assert_eq!(std::mem::size_of::<VoidRef>(), 1);
22874 static_assertions::const_assert_eq!(std::mem::align_of::<VoidRef>(), 1);
22875
22876 impl ::fidl_next::Constrained for VoidRef {
22877 type Constraint = ();
22878
22879 fn validate(
22880 _: ::fidl_next::Slot<'_, Self>,
22881 _: Self::Constraint,
22882 ) -> Result<(), ::fidl_next::ValidationError> {
22883 Ok(())
22884 }
22885 }
22886
22887 unsafe impl ::fidl_next::Wire for VoidRef {
22888 type Narrowed<'de> = VoidRef;
22889
22890 #[inline]
22891 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22892 ::fidl_next::munge! {
22893 let Self {
22894
22895 _empty,
22896
22897
22898 } = &mut *out_;
22899 }
22900 }
22901 }
22902
22903 unsafe impl<___D> ::fidl_next::Decode<___D> for VoidRef
22904 where
22905 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22906 {
22907 fn decode(
22908 slot_: ::fidl_next::Slot<'_, Self>,
22909 decoder_: &mut ___D,
22910 _: (),
22911 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22912 ::fidl_next::munge! {
22913 let Self {
22914
22915 mut _empty,
22916
22917
22918 } = slot_;
22919 }
22920
22921 if _empty.as_bytes() != &[0u8] {
22922 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
22923 }
22924
22925 Ok(())
22926 }
22927 }
22928
22929 impl ::fidl_next::IntoNatural for VoidRef {
22930 type Natural = crate::natural::VoidRef;
22931 }
22932
22933 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
22935 #[repr(transparent)]
22936 pub struct StorageId {
22937 pub(crate) value: ::fidl_next::wire::Uint32,
22938 }
22939
22940 impl ::fidl_next::Constrained for StorageId {
22941 type Constraint = ();
22942
22943 fn validate(
22944 _: ::fidl_next::Slot<'_, Self>,
22945 _: Self::Constraint,
22946 ) -> Result<(), ::fidl_next::ValidationError> {
22947 Ok(())
22948 }
22949 }
22950
22951 unsafe impl ::fidl_next::Wire for StorageId {
22952 type Narrowed<'de> = Self;
22953
22954 #[inline]
22955 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
22956 }
22958 }
22959
22960 impl StorageId {
22961 pub const STATIC_INSTANCE_ID: StorageId = StorageId { value: ::fidl_next::wire::Uint32(1) };
22962
22963 pub const STATIC_INSTANCE_ID_OR_MONIKER: StorageId =
22964 StorageId { value: ::fidl_next::wire::Uint32(2) };
22965 }
22966
22967 unsafe impl<___D> ::fidl_next::Decode<___D> for StorageId
22968 where
22969 ___D: ?Sized,
22970 {
22971 fn decode(
22972 slot: ::fidl_next::Slot<'_, Self>,
22973 _: &mut ___D,
22974 _: (),
22975 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22976 ::fidl_next::munge!(let Self { value } = slot);
22977
22978 match u32::from(*value) {
22979 1 | 2 => (),
22980 unknown => {
22981 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
22982 }
22983 }
22984
22985 Ok(())
22986 }
22987 }
22988
22989 impl ::core::convert::From<crate::natural::StorageId> for StorageId {
22990 fn from(natural: crate::natural::StorageId) -> Self {
22991 match natural {
22992 crate::natural::StorageId::StaticInstanceId => StorageId::STATIC_INSTANCE_ID,
22993
22994 crate::natural::StorageId::StaticInstanceIdOrMoniker => {
22995 StorageId::STATIC_INSTANCE_ID_OR_MONIKER
22996 }
22997 }
22998 }
22999 }
23000
23001 impl ::fidl_next::IntoNatural for StorageId {
23002 type Natural = crate::natural::StorageId;
23003 }
23004
23005 #[repr(C)]
23007 pub struct Runner<'de> {
23008 pub(crate) table: ::fidl_next::wire::Table<'de>,
23009 }
23010
23011 impl<'de> Drop for Runner<'de> {
23012 fn drop(&mut self) {
23013 let _ = self.table.get(1).map(|envelope| unsafe {
23014 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
23015 });
23016
23017 let _ = self.table.get(2).map(|envelope| unsafe {
23018 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
23019 });
23020 }
23021 }
23022
23023 impl ::fidl_next::Constrained for Runner<'_> {
23024 type Constraint = ();
23025
23026 fn validate(
23027 _: ::fidl_next::Slot<'_, Self>,
23028 _: Self::Constraint,
23029 ) -> Result<(), ::fidl_next::ValidationError> {
23030 Ok(())
23031 }
23032 }
23033
23034 unsafe impl ::fidl_next::Wire for Runner<'static> {
23035 type Narrowed<'de> = Runner<'de>;
23036
23037 #[inline]
23038 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23039 ::fidl_next::munge!(let Self { table } = out);
23040 ::fidl_next::wire::Table::zero_padding(table);
23041 }
23042 }
23043
23044 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Runner<'de>
23045 where
23046 ___D: ::fidl_next::Decoder<'de> + ?Sized,
23047 {
23048 fn decode(
23049 slot: ::fidl_next::Slot<'_, Self>,
23050 decoder: &mut ___D,
23051 _: (),
23052 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23053 ::fidl_next::munge!(let Self { table } = slot);
23054
23055 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
23056 match ordinal {
23057 0 => unsafe { ::core::hint::unreachable_unchecked() },
23058
23059 1 => {
23060 ::fidl_next::wire::Envelope::decode_as::<
23061 ___D,
23062 ::fidl_next::wire::String<'de>,
23063 >(slot.as_mut(), decoder, 100)?;
23064
23065 let value = unsafe {
23066 slot.deref_unchecked()
23067 .deref_unchecked::<::fidl_next::wire::String<'_>>()
23068 };
23069
23070 if value.len() > 100 {
23071 return Err(::fidl_next::DecodeError::VectorTooLong {
23072 size: value.len() as u64,
23073 limit: 100,
23074 });
23075 }
23076
23077 Ok(())
23078 }
23079
23080 2 => {
23081 ::fidl_next::wire::Envelope::decode_as::<
23082 ___D,
23083 ::fidl_next::wire::String<'de>,
23084 >(slot.as_mut(), decoder, 1024)?;
23085
23086 let value = unsafe {
23087 slot.deref_unchecked()
23088 .deref_unchecked::<::fidl_next::wire::String<'_>>()
23089 };
23090
23091 if value.len() > 1024 {
23092 return Err(::fidl_next::DecodeError::VectorTooLong {
23093 size: value.len() as u64,
23094 limit: 1024,
23095 });
23096 }
23097
23098 Ok(())
23099 }
23100
23101 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
23102 }
23103 })
23104 }
23105 }
23106
23107 impl<'de> Runner<'de> {
23108 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
23109 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
23110 }
23111
23112 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
23113 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
23114 }
23115 }
23116
23117 impl<'de> ::core::fmt::Debug for Runner<'de> {
23118 fn fmt(
23119 &self,
23120 f: &mut ::core::fmt::Formatter<'_>,
23121 ) -> ::core::result::Result<(), ::core::fmt::Error> {
23122 f.debug_struct("Runner")
23123 .field("name", &self.name())
23124 .field("source_path", &self.source_path())
23125 .finish()
23126 }
23127 }
23128
23129 impl<'de> ::fidl_next::IntoNatural for Runner<'de> {
23130 type Natural = crate::natural::Runner;
23131 }
23132
23133 #[repr(C)]
23135 pub struct Resolver<'de> {
23136 pub(crate) table: ::fidl_next::wire::Table<'de>,
23137 }
23138
23139 impl<'de> Drop for Resolver<'de> {
23140 fn drop(&mut self) {
23141 let _ = self.table.get(1).map(|envelope| unsafe {
23142 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
23143 });
23144
23145 let _ = self.table.get(2).map(|envelope| unsafe {
23146 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
23147 });
23148 }
23149 }
23150
23151 impl ::fidl_next::Constrained for Resolver<'_> {
23152 type Constraint = ();
23153
23154 fn validate(
23155 _: ::fidl_next::Slot<'_, Self>,
23156 _: Self::Constraint,
23157 ) -> Result<(), ::fidl_next::ValidationError> {
23158 Ok(())
23159 }
23160 }
23161
23162 unsafe impl ::fidl_next::Wire for Resolver<'static> {
23163 type Narrowed<'de> = Resolver<'de>;
23164
23165 #[inline]
23166 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23167 ::fidl_next::munge!(let Self { table } = out);
23168 ::fidl_next::wire::Table::zero_padding(table);
23169 }
23170 }
23171
23172 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Resolver<'de>
23173 where
23174 ___D: ::fidl_next::Decoder<'de> + ?Sized,
23175 {
23176 fn decode(
23177 slot: ::fidl_next::Slot<'_, Self>,
23178 decoder: &mut ___D,
23179 _: (),
23180 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23181 ::fidl_next::munge!(let Self { table } = slot);
23182
23183 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
23184 match ordinal {
23185 0 => unsafe { ::core::hint::unreachable_unchecked() },
23186
23187 1 => {
23188 ::fidl_next::wire::Envelope::decode_as::<
23189 ___D,
23190 ::fidl_next::wire::String<'de>,
23191 >(slot.as_mut(), decoder, 100)?;
23192
23193 let value = unsafe {
23194 slot.deref_unchecked()
23195 .deref_unchecked::<::fidl_next::wire::String<'_>>()
23196 };
23197
23198 if value.len() > 100 {
23199 return Err(::fidl_next::DecodeError::VectorTooLong {
23200 size: value.len() as u64,
23201 limit: 100,
23202 });
23203 }
23204
23205 Ok(())
23206 }
23207
23208 2 => {
23209 ::fidl_next::wire::Envelope::decode_as::<
23210 ___D,
23211 ::fidl_next::wire::String<'de>,
23212 >(slot.as_mut(), decoder, 1024)?;
23213
23214 let value = unsafe {
23215 slot.deref_unchecked()
23216 .deref_unchecked::<::fidl_next::wire::String<'_>>()
23217 };
23218
23219 if value.len() > 1024 {
23220 return Err(::fidl_next::DecodeError::VectorTooLong {
23221 size: value.len() as u64,
23222 limit: 1024,
23223 });
23224 }
23225
23226 Ok(())
23227 }
23228
23229 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
23230 }
23231 })
23232 }
23233 }
23234
23235 impl<'de> Resolver<'de> {
23236 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
23237 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
23238 }
23239
23240 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
23241 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
23242 }
23243 }
23244
23245 impl<'de> ::core::fmt::Debug for Resolver<'de> {
23246 fn fmt(
23247 &self,
23248 f: &mut ::core::fmt::Formatter<'_>,
23249 ) -> ::core::result::Result<(), ::core::fmt::Error> {
23250 f.debug_struct("Resolver")
23251 .field("name", &self.name())
23252 .field("source_path", &self.source_path())
23253 .finish()
23254 }
23255 }
23256
23257 impl<'de> ::fidl_next::IntoNatural for Resolver<'de> {
23258 type Natural = crate::natural::Resolver;
23259 }
23260
23261 #[repr(C)]
23263 pub struct EventStream<'de> {
23264 pub(crate) table: ::fidl_next::wire::Table<'de>,
23265 }
23266
23267 impl<'de> Drop for EventStream<'de> {
23268 fn drop(&mut self) {
23269 let _ = self.table.get(1).map(|envelope| unsafe {
23270 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
23271 });
23272 }
23273 }
23274
23275 impl ::fidl_next::Constrained for EventStream<'_> {
23276 type Constraint = ();
23277
23278 fn validate(
23279 _: ::fidl_next::Slot<'_, Self>,
23280 _: Self::Constraint,
23281 ) -> Result<(), ::fidl_next::ValidationError> {
23282 Ok(())
23283 }
23284 }
23285
23286 unsafe impl ::fidl_next::Wire for EventStream<'static> {
23287 type Narrowed<'de> = EventStream<'de>;
23288
23289 #[inline]
23290 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23291 ::fidl_next::munge!(let Self { table } = out);
23292 ::fidl_next::wire::Table::zero_padding(table);
23293 }
23294 }
23295
23296 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for EventStream<'de>
23297 where
23298 ___D: ::fidl_next::Decoder<'de> + ?Sized,
23299 {
23300 fn decode(
23301 slot: ::fidl_next::Slot<'_, Self>,
23302 decoder: &mut ___D,
23303 _: (),
23304 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23305 ::fidl_next::munge!(let Self { table } = slot);
23306
23307 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
23308 match ordinal {
23309 0 => unsafe { ::core::hint::unreachable_unchecked() },
23310
23311 1 => {
23312 ::fidl_next::wire::Envelope::decode_as::<
23313 ___D,
23314 ::fidl_next::wire::String<'de>,
23315 >(slot.as_mut(), decoder, 100)?;
23316
23317 let value = unsafe {
23318 slot.deref_unchecked()
23319 .deref_unchecked::<::fidl_next::wire::String<'_>>()
23320 };
23321
23322 if value.len() > 100 {
23323 return Err(::fidl_next::DecodeError::VectorTooLong {
23324 size: value.len() as u64,
23325 limit: 100,
23326 });
23327 }
23328
23329 Ok(())
23330 }
23331
23332 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
23333 }
23334 })
23335 }
23336 }
23337
23338 impl<'de> EventStream<'de> {
23339 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
23340 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
23341 }
23342 }
23343
23344 impl<'de> ::core::fmt::Debug for EventStream<'de> {
23345 fn fmt(
23346 &self,
23347 f: &mut ::core::fmt::Formatter<'_>,
23348 ) -> ::core::result::Result<(), ::core::fmt::Error> {
23349 f.debug_struct("EventStream").field("name", &self.name()).finish()
23350 }
23351 }
23352
23353 impl<'de> ::fidl_next::IntoNatural for EventStream<'de> {
23354 type Natural = crate::natural::EventStream;
23355 }
23356
23357 #[repr(transparent)]
23359 pub struct ConfigSingleValue<'de> {
23360 pub(crate) raw: ::fidl_next::wire::Union,
23361 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
23362 }
23363
23364 impl<'de> Drop for ConfigSingleValue<'de> {
23365 fn drop(&mut self) {
23366 match self.raw.ordinal() {
23367 1 => {
23368 let _ = unsafe { self.raw.get().read_unchecked::<bool>() };
23369 }
23370
23371 2 => {
23372 let _ = unsafe { self.raw.get().read_unchecked::<u8>() };
23373 }
23374
23375 3 => {
23376 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Uint16>() };
23377 }
23378
23379 4 => {
23380 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Uint32>() };
23381 }
23382
23383 5 => {
23384 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Uint64>() };
23385 }
23386
23387 6 => {
23388 let _ = unsafe { self.raw.get().read_unchecked::<i8>() };
23389 }
23390
23391 7 => {
23392 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Int16>() };
23393 }
23394
23395 8 => {
23396 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Int32>() };
23397 }
23398
23399 9 => {
23400 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Int64>() };
23401 }
23402
23403 10 => {
23404 let _ = unsafe {
23405 self.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
23406 };
23407 }
23408
23409 _ => (),
23410 }
23411 }
23412 }
23413
23414 impl ::fidl_next::Constrained for ConfigSingleValue<'_> {
23415 type Constraint = ();
23416
23417 fn validate(
23418 _: ::fidl_next::Slot<'_, Self>,
23419 _: Self::Constraint,
23420 ) -> Result<(), ::fidl_next::ValidationError> {
23421 Ok(())
23422 }
23423 }
23424
23425 unsafe impl ::fidl_next::Wire for ConfigSingleValue<'static> {
23426 type Narrowed<'de> = ConfigSingleValue<'de>;
23427
23428 #[inline]
23429 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23430 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
23431 ::fidl_next::wire::Union::zero_padding(raw);
23432 }
23433 }
23434
23435 pub mod config_single_value {
23436 pub enum Ref<'de> {
23437 Bool(&'de bool),
23438
23439 Uint8(&'de u8),
23440
23441 Uint16(&'de ::fidl_next::wire::Uint16),
23442
23443 Uint32(&'de ::fidl_next::wire::Uint32),
23444
23445 Uint64(&'de ::fidl_next::wire::Uint64),
23446
23447 Int8(&'de i8),
23448
23449 Int16(&'de ::fidl_next::wire::Int16),
23450
23451 Int32(&'de ::fidl_next::wire::Int32),
23452
23453 Int64(&'de ::fidl_next::wire::Int64),
23454
23455 String(&'de ::fidl_next::wire::String<'de>),
23456
23457 UnknownOrdinal_(u64),
23458 }
23459 }
23460
23461 impl<'de> ConfigSingleValue<'de> {
23462 pub fn as_ref(&self) -> crate::wire::config_single_value::Ref<'_> {
23463 match self.raw.ordinal() {
23464 1 => crate::wire::config_single_value::Ref::Bool(unsafe {
23465 self.raw.get().deref_unchecked::<bool>()
23466 }),
23467
23468 2 => crate::wire::config_single_value::Ref::Uint8(unsafe {
23469 self.raw.get().deref_unchecked::<u8>()
23470 }),
23471
23472 3 => crate::wire::config_single_value::Ref::Uint16(unsafe {
23473 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint16>()
23474 }),
23475
23476 4 => crate::wire::config_single_value::Ref::Uint32(unsafe {
23477 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint32>()
23478 }),
23479
23480 5 => crate::wire::config_single_value::Ref::Uint64(unsafe {
23481 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint64>()
23482 }),
23483
23484 6 => crate::wire::config_single_value::Ref::Int8(unsafe {
23485 self.raw.get().deref_unchecked::<i8>()
23486 }),
23487
23488 7 => crate::wire::config_single_value::Ref::Int16(unsafe {
23489 self.raw.get().deref_unchecked::<::fidl_next::wire::Int16>()
23490 }),
23491
23492 8 => crate::wire::config_single_value::Ref::Int32(unsafe {
23493 self.raw.get().deref_unchecked::<::fidl_next::wire::Int32>()
23494 }),
23495
23496 9 => crate::wire::config_single_value::Ref::Int64(unsafe {
23497 self.raw.get().deref_unchecked::<::fidl_next::wire::Int64>()
23498 }),
23499
23500 10 => crate::wire::config_single_value::Ref::String(unsafe {
23501 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>()
23502 }),
23503
23504 unknown => crate::wire::config_single_value::Ref::UnknownOrdinal_(unknown),
23505 }
23506 }
23507 }
23508
23509 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigSingleValue<'de>
23510 where
23511 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
23512 ___D: ::fidl_next::Decoder<'de>,
23513 {
23514 fn decode(
23515 mut slot: ::fidl_next::Slot<'_, Self>,
23516 decoder: &mut ___D,
23517 _: (),
23518 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23519 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
23520 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
23521 1 => ::fidl_next::wire::Union::decode_as::<___D, bool>(raw, decoder, ())?,
23522
23523 2 => ::fidl_next::wire::Union::decode_as::<___D, u8>(raw, decoder, ())?,
23524
23525 3 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint16>(
23526 raw,
23527 decoder,
23528 (),
23529 )?,
23530
23531 4 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint32>(
23532 raw,
23533 decoder,
23534 (),
23535 )?,
23536
23537 5 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint64>(
23538 raw,
23539 decoder,
23540 (),
23541 )?,
23542
23543 6 => ::fidl_next::wire::Union::decode_as::<___D, i8>(raw, decoder, ())?,
23544
23545 7 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int16>(
23546 raw,
23547 decoder,
23548 (),
23549 )?,
23550
23551 8 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int32>(
23552 raw,
23553 decoder,
23554 (),
23555 )?,
23556
23557 9 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int64>(
23558 raw,
23559 decoder,
23560 (),
23561 )?,
23562
23563 10 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
23564 raw, decoder, 4294967295,
23565 )?,
23566
23567 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
23568 }
23569
23570 Ok(())
23571 }
23572 }
23573
23574 impl<'de> ::core::fmt::Debug for ConfigSingleValue<'de> {
23575 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
23576 match self.raw.ordinal() {
23577 1 => unsafe { self.raw.get().deref_unchecked::<bool>().fmt(f) },
23578 2 => unsafe { self.raw.get().deref_unchecked::<u8>().fmt(f) },
23579 3 => unsafe {
23580 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint16>().fmt(f)
23581 },
23582 4 => unsafe {
23583 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint32>().fmt(f)
23584 },
23585 5 => unsafe {
23586 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint64>().fmt(f)
23587 },
23588 6 => unsafe { self.raw.get().deref_unchecked::<i8>().fmt(f) },
23589 7 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::wire::Int16>().fmt(f) },
23590 8 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::wire::Int32>().fmt(f) },
23591 9 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::wire::Int64>().fmt(f) },
23592 10 => unsafe {
23593 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>().fmt(f)
23594 },
23595 _ => unsafe { ::core::hint::unreachable_unchecked() },
23596 }
23597 }
23598 }
23599
23600 impl<'de> ::fidl_next::IntoNatural for ConfigSingleValue<'de> {
23601 type Natural = crate::natural::ConfigSingleValue;
23602 }
23603
23604 #[repr(transparent)]
23606 pub struct ConfigVectorValue<'de> {
23607 pub(crate) raw: ::fidl_next::wire::Union,
23608 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
23609 }
23610
23611 impl<'de> Drop for ConfigVectorValue<'de> {
23612 fn drop(&mut self) {
23613 match self.raw.ordinal() {
23614 1 => {
23615 let _ = unsafe {
23616 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, bool>>()
23617 };
23618 }
23619
23620 2 => {
23621 let _ = unsafe {
23622 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, u8>>()
23623 };
23624 }
23625
23626 3 => {
23627 let _ = unsafe {
23628 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint16>>()
23629 };
23630 }
23631
23632 4 => {
23633 let _ = unsafe {
23634 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>>()
23635 };
23636 }
23637
23638 5 => {
23639 let _ = unsafe {
23640 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint64>>()
23641 };
23642 }
23643
23644 6 => {
23645 let _ = unsafe {
23646 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, i8>>()
23647 };
23648 }
23649
23650 7 => {
23651 let _ = unsafe {
23652 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int16>>()
23653 };
23654 }
23655
23656 8 => {
23657 let _ = unsafe {
23658 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int32>>()
23659 };
23660 }
23661
23662 9 => {
23663 let _ = unsafe {
23664 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>>()
23665 };
23666 }
23667
23668 10 => {
23669 let _ = unsafe {
23670 self.raw.get().read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
23671 };
23672 }
23673
23674 _ => (),
23675 }
23676 }
23677 }
23678
23679 impl ::fidl_next::Constrained for ConfigVectorValue<'_> {
23680 type Constraint = ();
23681
23682 fn validate(
23683 _: ::fidl_next::Slot<'_, Self>,
23684 _: Self::Constraint,
23685 ) -> Result<(), ::fidl_next::ValidationError> {
23686 Ok(())
23687 }
23688 }
23689
23690 unsafe impl ::fidl_next::Wire for ConfigVectorValue<'static> {
23691 type Narrowed<'de> = ConfigVectorValue<'de>;
23692
23693 #[inline]
23694 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23695 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
23696 ::fidl_next::wire::Union::zero_padding(raw);
23697 }
23698 }
23699
23700 pub mod config_vector_value {
23701 pub enum Ref<'de> {
23702 BoolVector(&'de ::fidl_next::wire::Vector<'de, bool>),
23703
23704 Uint8Vector(&'de ::fidl_next::wire::Vector<'de, u8>),
23705
23706 Uint16Vector(&'de ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint16>),
23707
23708 Uint32Vector(&'de ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>),
23709
23710 Uint64Vector(&'de ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint64>),
23711
23712 Int8Vector(&'de ::fidl_next::wire::Vector<'de, i8>),
23713
23714 Int16Vector(&'de ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int16>),
23715
23716 Int32Vector(&'de ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int32>),
23717
23718 Int64Vector(&'de ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>),
23719
23720 StringVector(&'de ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>),
23721
23722 UnknownOrdinal_(u64),
23723 }
23724 }
23725
23726 impl<'de> ConfigVectorValue<'de> {
23727 pub fn as_ref(&self) -> crate::wire::config_vector_value::Ref<'_> {
23728 match self.raw.ordinal() {
23729 1 => crate::wire::config_vector_value::Ref::BoolVector(unsafe {
23730 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, bool>>()
23731 }),
23732
23733 2 => crate::wire::config_vector_value::Ref::Uint8Vector(unsafe {
23734 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, u8>>()
23735 }),
23736
23737 3 => crate::wire::config_vector_value::Ref::Uint16Vector(unsafe {
23738 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Uint16>>()
23739 }),
23740
23741 4 => crate::wire::config_vector_value::Ref::Uint32Vector(unsafe {
23742 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Uint32>>()
23743 }),
23744
23745 5 => crate::wire::config_vector_value::Ref::Uint64Vector(unsafe {
23746 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Uint64>>()
23747 }),
23748
23749 6 => crate::wire::config_vector_value::Ref::Int8Vector(unsafe {
23750 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, i8>>()
23751 }),
23752
23753 7 => {
23754 crate::wire::config_vector_value::Ref::Int16Vector(unsafe {
23755 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Int16>>()
23756 })
23757 }
23758
23759 8 => {
23760 crate::wire::config_vector_value::Ref::Int32Vector(unsafe {
23761 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Int32>>()
23762 })
23763 }
23764
23765 9 => {
23766 crate::wire::config_vector_value::Ref::Int64Vector(unsafe {
23767 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Int64>>()
23768 })
23769 }
23770
23771 10 => crate::wire::config_vector_value::Ref::StringVector(unsafe {
23772 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::String<'_>>>()
23773 }),
23774
23775 unknown => crate::wire::config_vector_value::Ref::UnknownOrdinal_(unknown),
23776 }
23777 }
23778 }
23779
23780 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigVectorValue<'de>
23781 where
23782 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
23783 ___D: ::fidl_next::Decoder<'de>,
23784 {
23785 fn decode(
23786 mut slot: ::fidl_next::Slot<'_, Self>,
23787 decoder: &mut ___D,
23788 _: (),
23789 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23790 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
23791 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
23792 1 => ::fidl_next::wire::Union::decode_as::<
23793 ___D,
23794 ::fidl_next::wire::Vector<'de, bool>,
23795 >(raw, decoder, (4294967295, ()))?,
23796
23797 2 => {
23798 ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Vector<'de, u8>>(
23799 raw,
23800 decoder,
23801 (4294967295, ()),
23802 )?
23803 }
23804
23805 3 => ::fidl_next::wire::Union::decode_as::<
23806 ___D,
23807 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint16>,
23808 >(raw, decoder, (4294967295, ()))?,
23809
23810 4 => ::fidl_next::wire::Union::decode_as::<
23811 ___D,
23812 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>,
23813 >(raw, decoder, (4294967295, ()))?,
23814
23815 5 => ::fidl_next::wire::Union::decode_as::<
23816 ___D,
23817 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint64>,
23818 >(raw, decoder, (4294967295, ()))?,
23819
23820 6 => {
23821 ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Vector<'de, i8>>(
23822 raw,
23823 decoder,
23824 (4294967295, ()),
23825 )?
23826 }
23827
23828 7 => ::fidl_next::wire::Union::decode_as::<
23829 ___D,
23830 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int16>,
23831 >(raw, decoder, (4294967295, ()))?,
23832
23833 8 => ::fidl_next::wire::Union::decode_as::<
23834 ___D,
23835 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int32>,
23836 >(raw, decoder, (4294967295, ()))?,
23837
23838 9 => ::fidl_next::wire::Union::decode_as::<
23839 ___D,
23840 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>,
23841 >(raw, decoder, (4294967295, ()))?,
23842
23843 10 => ::fidl_next::wire::Union::decode_as::<
23844 ___D,
23845 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>,
23846 >(raw, decoder, (4294967295, 4294967295))?,
23847
23848 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
23849 }
23850
23851 Ok(())
23852 }
23853 }
23854
23855 impl<'de> ::core::fmt::Debug for ConfigVectorValue<'de> {
23856 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
23857 match self.raw.ordinal() {
23858 1 => unsafe {
23859 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, bool>>().fmt(f)
23860 },
23861 2 => unsafe {
23862 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, u8>>().fmt(f)
23863 },
23864 3 => unsafe {
23865 self.raw.get().deref_unchecked::<
23866 ::fidl_next::wire::Vector<'_, ::fidl_next::wire::Uint16>
23867 >().fmt(f)
23868 },
23869 4 => unsafe {
23870 self.raw.get().deref_unchecked::<
23871 ::fidl_next::wire::Vector<'_, ::fidl_next::wire::Uint32>
23872 >().fmt(f)
23873 },
23874 5 => unsafe {
23875 self.raw.get().deref_unchecked::<
23876 ::fidl_next::wire::Vector<'_, ::fidl_next::wire::Uint64>
23877 >().fmt(f)
23878 },
23879 6 => unsafe {
23880 self.raw.get().deref_unchecked::<::fidl_next::wire::Vector<'_, i8>>().fmt(f)
23881 },
23882 7 => unsafe {
23883 self.raw
23884 .get()
23885 .deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Int16>>(
23886 )
23887 .fmt(f)
23888 },
23889 8 => unsafe {
23890 self.raw
23891 .get()
23892 .deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Int32>>(
23893 )
23894 .fmt(f)
23895 },
23896 9 => unsafe {
23897 self.raw
23898 .get()
23899 .deref_unchecked::<::fidl_next::wire::Vector<'_, ::fidl_next::wire::Int64>>(
23900 )
23901 .fmt(f)
23902 },
23903 10 => unsafe {
23904 self.raw.get().deref_unchecked::<
23905 ::fidl_next::wire::Vector<'_, ::fidl_next::wire::String<'_>>
23906 >().fmt(f)
23907 },
23908 _ => unsafe { ::core::hint::unreachable_unchecked() },
23909 }
23910 }
23911 }
23912
23913 impl<'de> ::fidl_next::IntoNatural for ConfigVectorValue<'de> {
23914 type Natural = crate::natural::ConfigVectorValue;
23915 }
23916
23917 #[repr(transparent)]
23919 pub struct ConfigValue<'de> {
23920 pub(crate) raw: ::fidl_next::wire::Union,
23921 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
23922 }
23923
23924 impl<'de> Drop for ConfigValue<'de> {
23925 fn drop(&mut self) {
23926 match self.raw.ordinal() {
23927 1 => {
23928 let _ = unsafe {
23929 self.raw.get().read_unchecked::<crate::wire::ConfigSingleValue<'de>>()
23930 };
23931 }
23932
23933 2 => {
23934 let _ = unsafe {
23935 self.raw.get().read_unchecked::<crate::wire::ConfigVectorValue<'de>>()
23936 };
23937 }
23938
23939 _ => (),
23940 }
23941 }
23942 }
23943
23944 impl ::fidl_next::Constrained for ConfigValue<'_> {
23945 type Constraint = ();
23946
23947 fn validate(
23948 _: ::fidl_next::Slot<'_, Self>,
23949 _: Self::Constraint,
23950 ) -> Result<(), ::fidl_next::ValidationError> {
23951 Ok(())
23952 }
23953 }
23954
23955 unsafe impl ::fidl_next::Wire for ConfigValue<'static> {
23956 type Narrowed<'de> = ConfigValue<'de>;
23957
23958 #[inline]
23959 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23960 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
23961 ::fidl_next::wire::Union::zero_padding(raw);
23962 }
23963 }
23964
23965 pub mod config_value {
23966 pub enum Ref<'de> {
23967 Single(&'de crate::wire::ConfigSingleValue<'de>),
23968
23969 Vector(&'de crate::wire::ConfigVectorValue<'de>),
23970
23971 UnknownOrdinal_(u64),
23972 }
23973 }
23974
23975 impl<'de> ConfigValue<'de> {
23976 pub fn as_ref(&self) -> crate::wire::config_value::Ref<'_> {
23977 match self.raw.ordinal() {
23978 1 => crate::wire::config_value::Ref::Single(unsafe {
23979 self.raw.get().deref_unchecked::<crate::wire::ConfigSingleValue<'_>>()
23980 }),
23981
23982 2 => crate::wire::config_value::Ref::Vector(unsafe {
23983 self.raw.get().deref_unchecked::<crate::wire::ConfigVectorValue<'_>>()
23984 }),
23985
23986 unknown => crate::wire::config_value::Ref::UnknownOrdinal_(unknown),
23987 }
23988 }
23989 }
23990
23991 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigValue<'de>
23992 where
23993 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
23994 ___D: ::fidl_next::Decoder<'de>,
23995 {
23996 fn decode(
23997 mut slot: ::fidl_next::Slot<'_, Self>,
23998 decoder: &mut ___D,
23999 _: (),
24000 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24001 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
24002 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
24003 1 => ::fidl_next::wire::Union::decode_as::<
24004 ___D,
24005 crate::wire::ConfigSingleValue<'de>,
24006 >(raw, decoder, ())?,
24007
24008 2 => ::fidl_next::wire::Union::decode_as::<
24009 ___D,
24010 crate::wire::ConfigVectorValue<'de>,
24011 >(raw, decoder, ())?,
24012
24013 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
24014 }
24015
24016 Ok(())
24017 }
24018 }
24019
24020 impl<'de> ::core::fmt::Debug for ConfigValue<'de> {
24021 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
24022 match self.raw.ordinal() {
24023 1 => unsafe {
24024 self.raw.get().deref_unchecked::<crate::wire::ConfigSingleValue<'_>>().fmt(f)
24025 },
24026 2 => unsafe {
24027 self.raw.get().deref_unchecked::<crate::wire::ConfigVectorValue<'_>>().fmt(f)
24028 },
24029 _ => unsafe { ::core::hint::unreachable_unchecked() },
24030 }
24031 }
24032 }
24033
24034 impl<'de> ::fidl_next::IntoNatural for ConfigValue<'de> {
24035 type Natural = crate::natural::ConfigValue;
24036 }
24037
24038 #[repr(C)]
24040 pub struct Configuration<'de> {
24041 pub(crate) table: ::fidl_next::wire::Table<'de>,
24042 }
24043
24044 impl<'de> Drop for Configuration<'de> {
24045 fn drop(&mut self) {
24046 let _ = self.table.get(1).map(|envelope| unsafe {
24047 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
24048 });
24049
24050 let _ = self.table.get(2).map(|envelope| unsafe {
24051 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
24052 });
24053 }
24054 }
24055
24056 impl ::fidl_next::Constrained for Configuration<'_> {
24057 type Constraint = ();
24058
24059 fn validate(
24060 _: ::fidl_next::Slot<'_, Self>,
24061 _: Self::Constraint,
24062 ) -> Result<(), ::fidl_next::ValidationError> {
24063 Ok(())
24064 }
24065 }
24066
24067 unsafe impl ::fidl_next::Wire for Configuration<'static> {
24068 type Narrowed<'de> = Configuration<'de>;
24069
24070 #[inline]
24071 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
24072 ::fidl_next::munge!(let Self { table } = out);
24073 ::fidl_next::wire::Table::zero_padding(table);
24074 }
24075 }
24076
24077 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Configuration<'de>
24078 where
24079 ___D: ::fidl_next::Decoder<'de> + ?Sized,
24080 {
24081 fn decode(
24082 slot: ::fidl_next::Slot<'_, Self>,
24083 decoder: &mut ___D,
24084 _: (),
24085 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24086 ::fidl_next::munge!(let Self { table } = slot);
24087
24088 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
24089 match ordinal {
24090 0 => unsafe { ::core::hint::unreachable_unchecked() },
24091
24092 1 => {
24093 ::fidl_next::wire::Envelope::decode_as::<
24094 ___D,
24095 ::fidl_next::wire::String<'de>,
24096 >(slot.as_mut(), decoder, 100)?;
24097
24098 let value = unsafe {
24099 slot.deref_unchecked()
24100 .deref_unchecked::<::fidl_next::wire::String<'_>>()
24101 };
24102
24103 if value.len() > 100 {
24104 return Err(::fidl_next::DecodeError::VectorTooLong {
24105 size: value.len() as u64,
24106 limit: 100,
24107 });
24108 }
24109
24110 Ok(())
24111 }
24112
24113 2 => {
24114 ::fidl_next::wire::Envelope::decode_as::<
24115 ___D,
24116 crate::wire::ConfigValue<'de>,
24117 >(slot.as_mut(), decoder, ())?;
24118
24119 Ok(())
24120 }
24121
24122 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
24123 }
24124 })
24125 }
24126 }
24127
24128 impl<'de> Configuration<'de> {
24129 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
24130 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
24131 }
24132
24133 pub fn value(&self) -> ::core::option::Option<&crate::wire::ConfigValue<'de>> {
24134 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
24135 }
24136 }
24137
24138 impl<'de> ::core::fmt::Debug for Configuration<'de> {
24139 fn fmt(
24140 &self,
24141 f: &mut ::core::fmt::Formatter<'_>,
24142 ) -> ::core::result::Result<(), ::core::fmt::Error> {
24143 f.debug_struct("Configuration")
24144 .field("name", &self.name())
24145 .field("value", &self.value())
24146 .finish()
24147 }
24148 }
24149
24150 impl<'de> ::fidl_next::IntoNatural for Configuration<'de> {
24151 type Natural = crate::natural::Configuration;
24152 }
24153
24154 pub type DictionaryPath<'de> = ::fidl_next::wire::String<'de>;
24156
24157 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
24159 #[repr(transparent)]
24160 pub struct DeliveryType {
24161 pub(crate) value: ::fidl_next::wire::Uint32,
24162 }
24163
24164 impl ::fidl_next::Constrained for DeliveryType {
24165 type Constraint = ();
24166
24167 fn validate(
24168 _: ::fidl_next::Slot<'_, Self>,
24169 _: Self::Constraint,
24170 ) -> Result<(), ::fidl_next::ValidationError> {
24171 Ok(())
24172 }
24173 }
24174
24175 unsafe impl ::fidl_next::Wire for DeliveryType {
24176 type Narrowed<'de> = Self;
24177
24178 #[inline]
24179 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
24180 }
24182 }
24183
24184 impl DeliveryType {
24185 pub const IMMEDIATE: DeliveryType = DeliveryType { value: ::fidl_next::wire::Uint32(0) };
24186
24187 pub const ON_READABLE: DeliveryType = DeliveryType { value: ::fidl_next::wire::Uint32(1) };
24188 }
24189
24190 unsafe impl<___D> ::fidl_next::Decode<___D> for DeliveryType
24191 where
24192 ___D: ?Sized,
24193 {
24194 fn decode(
24195 slot: ::fidl_next::Slot<'_, Self>,
24196 _: &mut ___D,
24197 _: (),
24198 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24199 Ok(())
24200 }
24201 }
24202
24203 impl ::core::convert::From<crate::natural::DeliveryType> for DeliveryType {
24204 fn from(natural: crate::natural::DeliveryType) -> Self {
24205 match natural {
24206 crate::natural::DeliveryType::Immediate => DeliveryType::IMMEDIATE,
24207
24208 crate::natural::DeliveryType::OnReadable => DeliveryType::ON_READABLE,
24209
24210 crate::natural::DeliveryType::UnknownOrdinal_(value) => {
24211 DeliveryType { value: ::fidl_next::wire::Uint32::from(value) }
24212 }
24213 }
24214 }
24215 }
24216
24217 impl ::fidl_next::IntoNatural for DeliveryType {
24218 type Natural = crate::natural::DeliveryType;
24219 }
24220
24221 #[repr(C)]
24223 pub struct Protocol<'de> {
24224 pub(crate) table: ::fidl_next::wire::Table<'de>,
24225 }
24226
24227 impl<'de> Drop for Protocol<'de> {
24228 fn drop(&mut self) {
24229 let _ = self.table.get(1).map(|envelope| unsafe {
24230 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
24231 });
24232
24233 let _ = self.table.get(2).map(|envelope| unsafe {
24234 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
24235 });
24236
24237 let _ = self
24238 .table
24239 .get(3)
24240 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::DeliveryType>() });
24241 }
24242 }
24243
24244 impl ::fidl_next::Constrained for Protocol<'_> {
24245 type Constraint = ();
24246
24247 fn validate(
24248 _: ::fidl_next::Slot<'_, Self>,
24249 _: Self::Constraint,
24250 ) -> Result<(), ::fidl_next::ValidationError> {
24251 Ok(())
24252 }
24253 }
24254
24255 unsafe impl ::fidl_next::Wire for Protocol<'static> {
24256 type Narrowed<'de> = Protocol<'de>;
24257
24258 #[inline]
24259 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
24260 ::fidl_next::munge!(let Self { table } = out);
24261 ::fidl_next::wire::Table::zero_padding(table);
24262 }
24263 }
24264
24265 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Protocol<'de>
24266 where
24267 ___D: ::fidl_next::Decoder<'de> + ?Sized,
24268 {
24269 fn decode(
24270 slot: ::fidl_next::Slot<'_, Self>,
24271 decoder: &mut ___D,
24272 _: (),
24273 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24274 ::fidl_next::munge!(let Self { table } = slot);
24275
24276 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
24277 match ordinal {
24278 0 => unsafe { ::core::hint::unreachable_unchecked() },
24279
24280 1 => {
24281 ::fidl_next::wire::Envelope::decode_as::<
24282 ___D,
24283 ::fidl_next::wire::String<'de>,
24284 >(slot.as_mut(), decoder, 100)?;
24285
24286 let value = unsafe {
24287 slot.deref_unchecked()
24288 .deref_unchecked::<::fidl_next::wire::String<'_>>()
24289 };
24290
24291 if value.len() > 100 {
24292 return Err(::fidl_next::DecodeError::VectorTooLong {
24293 size: value.len() as u64,
24294 limit: 100,
24295 });
24296 }
24297
24298 Ok(())
24299 }
24300
24301 2 => {
24302 ::fidl_next::wire::Envelope::decode_as::<
24303 ___D,
24304 ::fidl_next::wire::String<'de>,
24305 >(slot.as_mut(), decoder, 1024)?;
24306
24307 let value = unsafe {
24308 slot.deref_unchecked()
24309 .deref_unchecked::<::fidl_next::wire::String<'_>>()
24310 };
24311
24312 if value.len() > 1024 {
24313 return Err(::fidl_next::DecodeError::VectorTooLong {
24314 size: value.len() as u64,
24315 limit: 1024,
24316 });
24317 }
24318
24319 Ok(())
24320 }
24321
24322 3 => {
24323 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DeliveryType>(
24324 slot.as_mut(),
24325 decoder,
24326 (),
24327 )?;
24328
24329 Ok(())
24330 }
24331
24332 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
24333 }
24334 })
24335 }
24336 }
24337
24338 impl<'de> Protocol<'de> {
24339 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
24340 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
24341 }
24342
24343 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
24344 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
24345 }
24346
24347 pub fn delivery(&self) -> ::core::option::Option<&crate::wire::DeliveryType> {
24348 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
24349 }
24350 }
24351
24352 impl<'de> ::core::fmt::Debug for Protocol<'de> {
24353 fn fmt(
24354 &self,
24355 f: &mut ::core::fmt::Formatter<'_>,
24356 ) -> ::core::result::Result<(), ::core::fmt::Error> {
24357 f.debug_struct("Protocol")
24358 .field("name", &self.name())
24359 .field("source_path", &self.source_path())
24360 .field("delivery", &self.delivery())
24361 .finish()
24362 }
24363 }
24364
24365 impl<'de> ::fidl_next::IntoNatural for Protocol<'de> {
24366 type Natural = crate::natural::Protocol;
24367 }
24368
24369 #[derive(Clone, Debug)]
24371 #[repr(C)]
24372 pub struct EnvironmentRef {
24373 pub(crate) _empty: fidl_next::wire::EmptyStruct,
24374 }
24375
24376 static_assertions::const_assert_eq!(std::mem::size_of::<EnvironmentRef>(), 1);
24377 static_assertions::const_assert_eq!(std::mem::align_of::<EnvironmentRef>(), 1);
24378
24379 impl ::fidl_next::Constrained for EnvironmentRef {
24380 type Constraint = ();
24381
24382 fn validate(
24383 _: ::fidl_next::Slot<'_, Self>,
24384 _: Self::Constraint,
24385 ) -> Result<(), ::fidl_next::ValidationError> {
24386 Ok(())
24387 }
24388 }
24389
24390 unsafe impl ::fidl_next::Wire for EnvironmentRef {
24391 type Narrowed<'de> = EnvironmentRef;
24392
24393 #[inline]
24394 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
24395 ::fidl_next::munge! {
24396 let Self {
24397
24398 _empty,
24399
24400
24401 } = &mut *out_;
24402 }
24403 }
24404 }
24405
24406 unsafe impl<___D> ::fidl_next::Decode<___D> for EnvironmentRef
24407 where
24408 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
24409 {
24410 fn decode(
24411 slot_: ::fidl_next::Slot<'_, Self>,
24412 decoder_: &mut ___D,
24413 _: (),
24414 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24415 ::fidl_next::munge! {
24416 let Self {
24417
24418 mut _empty,
24419
24420
24421 } = slot_;
24422 }
24423
24424 if _empty.as_bytes() != &[0u8] {
24425 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
24426 }
24427
24428 Ok(())
24429 }
24430 }
24431
24432 impl ::fidl_next::IntoNatural for EnvironmentRef {
24433 type Natural = crate::natural::EnvironmentRef;
24434 }
24435
24436 #[repr(transparent)]
24438 pub struct Ref<'de> {
24439 pub(crate) raw: ::fidl_next::wire::Union,
24440 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
24441 }
24442
24443 impl<'de> Drop for Ref<'de> {
24444 fn drop(&mut self) {
24445 match self.raw.ordinal() {
24446 1 => {
24447 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::ParentRef>() };
24448 }
24449
24450 2 => {
24451 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::SelfRef>() };
24452 }
24453
24454 3 => {
24455 let _ =
24456 unsafe { self.raw.get().read_unchecked::<crate::wire::ChildRef<'de>>() };
24457 }
24458
24459 4 => {
24460 let _ = unsafe {
24461 self.raw.get().read_unchecked::<crate::wire::CollectionRef<'de>>()
24462 };
24463 }
24464
24465 5 => {
24466 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::FrameworkRef>() };
24467 }
24468
24469 6 => {
24470 let _ = unsafe {
24471 self.raw.get().read_unchecked::<crate::wire::CapabilityRef<'de>>()
24472 };
24473 }
24474
24475 7 => {
24476 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::DebugRef>() };
24477 }
24478
24479 8 => {
24480 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::VoidRef>() };
24481 }
24482
24483 9 => {
24484 let _ =
24485 unsafe { self.raw.get().read_unchecked::<crate::wire::EnvironmentRef>() };
24486 }
24487
24488 _ => (),
24489 }
24490 }
24491 }
24492
24493 impl ::fidl_next::Constrained for Ref<'_> {
24494 type Constraint = ();
24495
24496 fn validate(
24497 _: ::fidl_next::Slot<'_, Self>,
24498 _: Self::Constraint,
24499 ) -> Result<(), ::fidl_next::ValidationError> {
24500 Ok(())
24501 }
24502 }
24503
24504 unsafe impl ::fidl_next::Wire for Ref<'static> {
24505 type Narrowed<'de> = Ref<'de>;
24506
24507 #[inline]
24508 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
24509 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
24510 ::fidl_next::wire::Union::zero_padding(raw);
24511 }
24512 }
24513
24514 pub mod ref_ {
24515 pub enum Ref<'de> {
24516 Parent(&'de crate::wire::ParentRef),
24517
24518 Self_(&'de crate::wire::SelfRef),
24519
24520 Child(&'de crate::wire::ChildRef<'de>),
24521
24522 Collection(&'de crate::wire::CollectionRef<'de>),
24523
24524 Framework(&'de crate::wire::FrameworkRef),
24525
24526 Capability(&'de crate::wire::CapabilityRef<'de>),
24527
24528 Debug(&'de crate::wire::DebugRef),
24529
24530 VoidType(&'de crate::wire::VoidRef),
24531
24532 Environment(&'de crate::wire::EnvironmentRef),
24533
24534 UnknownOrdinal_(u64),
24535 }
24536 }
24537
24538 impl<'de> Ref<'de> {
24539 pub fn as_ref(&self) -> crate::wire::ref_::Ref<'_> {
24540 match self.raw.ordinal() {
24541 1 => crate::wire::ref_::Ref::Parent(unsafe {
24542 self.raw.get().deref_unchecked::<crate::wire::ParentRef>()
24543 }),
24544
24545 2 => crate::wire::ref_::Ref::Self_(unsafe {
24546 self.raw.get().deref_unchecked::<crate::wire::SelfRef>()
24547 }),
24548
24549 3 => crate::wire::ref_::Ref::Child(unsafe {
24550 self.raw.get().deref_unchecked::<crate::wire::ChildRef<'_>>()
24551 }),
24552
24553 4 => crate::wire::ref_::Ref::Collection(unsafe {
24554 self.raw.get().deref_unchecked::<crate::wire::CollectionRef<'_>>()
24555 }),
24556
24557 5 => crate::wire::ref_::Ref::Framework(unsafe {
24558 self.raw.get().deref_unchecked::<crate::wire::FrameworkRef>()
24559 }),
24560
24561 6 => crate::wire::ref_::Ref::Capability(unsafe {
24562 self.raw.get().deref_unchecked::<crate::wire::CapabilityRef<'_>>()
24563 }),
24564
24565 7 => crate::wire::ref_::Ref::Debug(unsafe {
24566 self.raw.get().deref_unchecked::<crate::wire::DebugRef>()
24567 }),
24568
24569 8 => crate::wire::ref_::Ref::VoidType(unsafe {
24570 self.raw.get().deref_unchecked::<crate::wire::VoidRef>()
24571 }),
24572
24573 9 => crate::wire::ref_::Ref::Environment(unsafe {
24574 self.raw.get().deref_unchecked::<crate::wire::EnvironmentRef>()
24575 }),
24576
24577 unknown => crate::wire::ref_::Ref::UnknownOrdinal_(unknown),
24578 }
24579 }
24580 }
24581
24582 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Ref<'de>
24583 where
24584 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
24585 ___D: ::fidl_next::Decoder<'de>,
24586 {
24587 fn decode(
24588 mut slot: ::fidl_next::Slot<'_, Self>,
24589 decoder: &mut ___D,
24590 _: (),
24591 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24592 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
24593 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
24594 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ParentRef>(
24595 raw,
24596 decoder,
24597 (),
24598 )?,
24599
24600 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::SelfRef>(
24601 raw,
24602 decoder,
24603 (),
24604 )?,
24605
24606 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ChildRef<'de>>(
24607 raw,
24608 decoder,
24609 (),
24610 )?,
24611
24612 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::CollectionRef<'de>>(
24613 raw,
24614 decoder,
24615 (),
24616 )?,
24617
24618 5 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::FrameworkRef>(
24619 raw,
24620 decoder,
24621 (),
24622 )?,
24623
24624 6 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::CapabilityRef<'de>>(
24625 raw,
24626 decoder,
24627 (),
24628 )?,
24629
24630 7 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::DebugRef>(
24631 raw,
24632 decoder,
24633 (),
24634 )?,
24635
24636 8 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::VoidRef>(
24637 raw,
24638 decoder,
24639 (),
24640 )?,
24641
24642 9 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::EnvironmentRef>(
24643 raw,
24644 decoder,
24645 (),
24646 )?,
24647
24648 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
24649 }
24650
24651 Ok(())
24652 }
24653 }
24654
24655 impl<'de> ::core::fmt::Debug for Ref<'de> {
24656 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
24657 match self.raw.ordinal() {
24658 1 => unsafe { self.raw.get().deref_unchecked::<crate::wire::ParentRef>().fmt(f) },
24659 2 => unsafe { self.raw.get().deref_unchecked::<crate::wire::SelfRef>().fmt(f) },
24660 3 => unsafe {
24661 self.raw.get().deref_unchecked::<crate::wire::ChildRef<'_>>().fmt(f)
24662 },
24663 4 => unsafe {
24664 self.raw.get().deref_unchecked::<crate::wire::CollectionRef<'_>>().fmt(f)
24665 },
24666 5 => unsafe {
24667 self.raw.get().deref_unchecked::<crate::wire::FrameworkRef>().fmt(f)
24668 },
24669 6 => unsafe {
24670 self.raw.get().deref_unchecked::<crate::wire::CapabilityRef<'_>>().fmt(f)
24671 },
24672 7 => unsafe { self.raw.get().deref_unchecked::<crate::wire::DebugRef>().fmt(f) },
24673 8 => unsafe { self.raw.get().deref_unchecked::<crate::wire::VoidRef>().fmt(f) },
24674 9 => unsafe {
24675 self.raw.get().deref_unchecked::<crate::wire::EnvironmentRef>().fmt(f)
24676 },
24677 _ => unsafe { ::core::hint::unreachable_unchecked() },
24678 }
24679 }
24680 }
24681
24682 impl<'de> ::fidl_next::IntoNatural for Ref<'de> {
24683 type Natural = crate::natural::Ref;
24684 }
24685
24686 #[repr(C)]
24688 pub struct Storage<'de> {
24689 pub(crate) table: ::fidl_next::wire::Table<'de>,
24690 }
24691
24692 impl<'de> Drop for Storage<'de> {
24693 fn drop(&mut self) {
24694 let _ = self.table.get(1).map(|envelope| unsafe {
24695 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
24696 });
24697
24698 let _ = self
24699 .table
24700 .get(2)
24701 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
24702
24703 let _ = self.table.get(3).map(|envelope| unsafe {
24704 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
24705 });
24706
24707 let _ = self.table.get(4).map(|envelope| unsafe {
24708 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
24709 });
24710
24711 let _ = self
24712 .table
24713 .get(5)
24714 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::StorageId>() });
24715 }
24716 }
24717
24718 impl ::fidl_next::Constrained for Storage<'_> {
24719 type Constraint = ();
24720
24721 fn validate(
24722 _: ::fidl_next::Slot<'_, Self>,
24723 _: Self::Constraint,
24724 ) -> Result<(), ::fidl_next::ValidationError> {
24725 Ok(())
24726 }
24727 }
24728
24729 unsafe impl ::fidl_next::Wire for Storage<'static> {
24730 type Narrowed<'de> = Storage<'de>;
24731
24732 #[inline]
24733 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
24734 ::fidl_next::munge!(let Self { table } = out);
24735 ::fidl_next::wire::Table::zero_padding(table);
24736 }
24737 }
24738
24739 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Storage<'de>
24740 where
24741 ___D: ::fidl_next::Decoder<'de> + ?Sized,
24742 {
24743 fn decode(
24744 slot: ::fidl_next::Slot<'_, Self>,
24745 decoder: &mut ___D,
24746 _: (),
24747 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24748 ::fidl_next::munge!(let Self { table } = slot);
24749
24750 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
24751 match ordinal {
24752 0 => unsafe { ::core::hint::unreachable_unchecked() },
24753
24754 1 => {
24755 ::fidl_next::wire::Envelope::decode_as::<
24756 ___D,
24757 ::fidl_next::wire::String<'de>,
24758 >(slot.as_mut(), decoder, 100)?;
24759
24760 let value = unsafe {
24761 slot.deref_unchecked()
24762 .deref_unchecked::<::fidl_next::wire::String<'_>>()
24763 };
24764
24765 if value.len() > 100 {
24766 return Err(::fidl_next::DecodeError::VectorTooLong {
24767 size: value.len() as u64,
24768 limit: 100,
24769 });
24770 }
24771
24772 Ok(())
24773 }
24774
24775 2 => {
24776 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
24777 slot.as_mut(),
24778 decoder,
24779 (),
24780 )?;
24781
24782 Ok(())
24783 }
24784
24785 3 => {
24786 ::fidl_next::wire::Envelope::decode_as::<
24787 ___D,
24788 ::fidl_next::wire::String<'de>,
24789 >(slot.as_mut(), decoder, 100)?;
24790
24791 let value = unsafe {
24792 slot.deref_unchecked()
24793 .deref_unchecked::<::fidl_next::wire::String<'_>>()
24794 };
24795
24796 if value.len() > 100 {
24797 return Err(::fidl_next::DecodeError::VectorTooLong {
24798 size: value.len() as u64,
24799 limit: 100,
24800 });
24801 }
24802
24803 Ok(())
24804 }
24805
24806 4 => {
24807 ::fidl_next::wire::Envelope::decode_as::<
24808 ___D,
24809 ::fidl_next::wire::String<'de>,
24810 >(slot.as_mut(), decoder, 1024)?;
24811
24812 let value = unsafe {
24813 slot.deref_unchecked()
24814 .deref_unchecked::<::fidl_next::wire::String<'_>>()
24815 };
24816
24817 if value.len() > 1024 {
24818 return Err(::fidl_next::DecodeError::VectorTooLong {
24819 size: value.len() as u64,
24820 limit: 1024,
24821 });
24822 }
24823
24824 Ok(())
24825 }
24826
24827 5 => {
24828 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::StorageId>(
24829 slot.as_mut(),
24830 decoder,
24831 (),
24832 )?;
24833
24834 Ok(())
24835 }
24836
24837 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
24838 }
24839 })
24840 }
24841 }
24842
24843 impl<'de> Storage<'de> {
24844 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
24845 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
24846 }
24847
24848 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
24849 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
24850 }
24851
24852 pub fn backing_dir(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
24853 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
24854 }
24855
24856 pub fn subdir(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
24857 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
24858 }
24859
24860 pub fn storage_id(&self) -> ::core::option::Option<&crate::wire::StorageId> {
24861 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
24862 }
24863 }
24864
24865 impl<'de> ::core::fmt::Debug for Storage<'de> {
24866 fn fmt(
24867 &self,
24868 f: &mut ::core::fmt::Formatter<'_>,
24869 ) -> ::core::result::Result<(), ::core::fmt::Error> {
24870 f.debug_struct("Storage")
24871 .field("name", &self.name())
24872 .field("source", &self.source())
24873 .field("backing_dir", &self.backing_dir())
24874 .field("subdir", &self.subdir())
24875 .field("storage_id", &self.storage_id())
24876 .finish()
24877 }
24878 }
24879
24880 impl<'de> ::fidl_next::IntoNatural for Storage<'de> {
24881 type Natural = crate::natural::Storage;
24882 }
24883
24884 #[repr(C)]
24886 pub struct Dictionary<'de> {
24887 pub(crate) table: ::fidl_next::wire::Table<'de>,
24888 }
24889
24890 impl<'de> Drop for Dictionary<'de> {
24891 fn drop(&mut self) {
24892 let _ = self.table.get(1).map(|envelope| unsafe {
24893 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
24894 });
24895
24896 let _ = self
24897 .table
24898 .get(2)
24899 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
24900
24901 let _ = self.table.get(3).map(|envelope| unsafe {
24902 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
24903 });
24904
24905 let _ = self.table.get(4).map(|envelope| unsafe {
24906 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
24907 });
24908 }
24909 }
24910
24911 impl ::fidl_next::Constrained for Dictionary<'_> {
24912 type Constraint = ();
24913
24914 fn validate(
24915 _: ::fidl_next::Slot<'_, Self>,
24916 _: Self::Constraint,
24917 ) -> Result<(), ::fidl_next::ValidationError> {
24918 Ok(())
24919 }
24920 }
24921
24922 unsafe impl ::fidl_next::Wire for Dictionary<'static> {
24923 type Narrowed<'de> = Dictionary<'de>;
24924
24925 #[inline]
24926 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
24927 ::fidl_next::munge!(let Self { table } = out);
24928 ::fidl_next::wire::Table::zero_padding(table);
24929 }
24930 }
24931
24932 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Dictionary<'de>
24933 where
24934 ___D: ::fidl_next::Decoder<'de> + ?Sized,
24935 {
24936 fn decode(
24937 slot: ::fidl_next::Slot<'_, Self>,
24938 decoder: &mut ___D,
24939 _: (),
24940 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24941 ::fidl_next::munge!(let Self { table } = slot);
24942
24943 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
24944 match ordinal {
24945 0 => unsafe { ::core::hint::unreachable_unchecked() },
24946
24947 1 => {
24948 ::fidl_next::wire::Envelope::decode_as::<
24949 ___D,
24950 ::fidl_next::wire::String<'de>,
24951 >(slot.as_mut(), decoder, 100)?;
24952
24953 let value = unsafe {
24954 slot.deref_unchecked()
24955 .deref_unchecked::<::fidl_next::wire::String<'_>>()
24956 };
24957
24958 if value.len() > 100 {
24959 return Err(::fidl_next::DecodeError::VectorTooLong {
24960 size: value.len() as u64,
24961 limit: 100,
24962 });
24963 }
24964
24965 Ok(())
24966 }
24967
24968 2 => {
24969 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
24970 slot.as_mut(),
24971 decoder,
24972 (),
24973 )?;
24974
24975 Ok(())
24976 }
24977
24978 3 => {
24979 ::fidl_next::wire::Envelope::decode_as::<
24980 ___D,
24981 ::fidl_next::wire::String<'de>,
24982 >(slot.as_mut(), decoder, 1024)?;
24983
24984 let value = unsafe {
24985 slot.deref_unchecked()
24986 .deref_unchecked::<::fidl_next::wire::String<'_>>()
24987 };
24988
24989 if value.len() > 1024 {
24990 return Err(::fidl_next::DecodeError::VectorTooLong {
24991 size: value.len() as u64,
24992 limit: 1024,
24993 });
24994 }
24995
24996 Ok(())
24997 }
24998
24999 4 => {
25000 ::fidl_next::wire::Envelope::decode_as::<
25001 ___D,
25002 ::fidl_next::wire::String<'de>,
25003 >(slot.as_mut(), decoder, 1024)?;
25004
25005 let value = unsafe {
25006 slot.deref_unchecked()
25007 .deref_unchecked::<::fidl_next::wire::String<'_>>()
25008 };
25009
25010 if value.len() > 1024 {
25011 return Err(::fidl_next::DecodeError::VectorTooLong {
25012 size: value.len() as u64,
25013 limit: 1024,
25014 });
25015 }
25016
25017 Ok(())
25018 }
25019
25020 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
25021 }
25022 })
25023 }
25024 }
25025
25026 impl<'de> Dictionary<'de> {
25027 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
25028 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
25029 }
25030
25031 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
25032 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
25033 }
25034
25035 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
25036 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
25037 }
25038
25039 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
25040 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
25041 }
25042 }
25043
25044 impl<'de> ::core::fmt::Debug for Dictionary<'de> {
25045 fn fmt(
25046 &self,
25047 f: &mut ::core::fmt::Formatter<'_>,
25048 ) -> ::core::result::Result<(), ::core::fmt::Error> {
25049 f.debug_struct("Dictionary")
25050 .field("name", &self.name())
25051 .field("source", &self.source())
25052 .field("source_dictionary", &self.source_dictionary())
25053 .field("source_path", &self.source_path())
25054 .finish()
25055 }
25056 }
25057
25058 impl<'de> ::fidl_next::IntoNatural for Dictionary<'de> {
25059 type Natural = crate::natural::Dictionary;
25060 }
25061
25062 #[repr(transparent)]
25064 pub struct Capability<'de> {
25065 pub(crate) raw: ::fidl_next::wire::Union,
25066 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
25067 }
25068
25069 impl<'de> Drop for Capability<'de> {
25070 fn drop(&mut self) {
25071 match self.raw.ordinal() {
25072 1 => {
25073 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::Service<'de>>() };
25074 }
25075
25076 2 => {
25077 let _ =
25078 unsafe { self.raw.get().read_unchecked::<crate::wire::Protocol<'de>>() };
25079 }
25080
25081 3 => {
25082 let _ =
25083 unsafe { self.raw.get().read_unchecked::<crate::wire::Directory<'de>>() };
25084 }
25085
25086 4 => {
25087 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::Storage<'de>>() };
25088 }
25089
25090 5 => {
25091 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::Runner<'de>>() };
25092 }
25093
25094 6 => {
25095 let _ =
25096 unsafe { self.raw.get().read_unchecked::<crate::wire::Resolver<'de>>() };
25097 }
25098
25099 8 => {
25100 let _ =
25101 unsafe { self.raw.get().read_unchecked::<crate::wire::EventStream<'de>>() };
25102 }
25103
25104 9 => {
25105 let _ =
25106 unsafe { self.raw.get().read_unchecked::<crate::wire::Dictionary<'de>>() };
25107 }
25108
25109 10 => {
25110 let _ = unsafe {
25111 self.raw.get().read_unchecked::<crate::wire::Configuration<'de>>()
25112 };
25113 }
25114
25115 _ => (),
25116 }
25117 }
25118 }
25119
25120 impl ::fidl_next::Constrained for Capability<'_> {
25121 type Constraint = ();
25122
25123 fn validate(
25124 _: ::fidl_next::Slot<'_, Self>,
25125 _: Self::Constraint,
25126 ) -> Result<(), ::fidl_next::ValidationError> {
25127 Ok(())
25128 }
25129 }
25130
25131 unsafe impl ::fidl_next::Wire for Capability<'static> {
25132 type Narrowed<'de> = Capability<'de>;
25133
25134 #[inline]
25135 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25136 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
25137 ::fidl_next::wire::Union::zero_padding(raw);
25138 }
25139 }
25140
25141 pub mod capability {
25142 pub enum Ref<'de> {
25143 Service(&'de crate::wire::Service<'de>),
25144
25145 Protocol(&'de crate::wire::Protocol<'de>),
25146
25147 Directory(&'de crate::wire::Directory<'de>),
25148
25149 Storage(&'de crate::wire::Storage<'de>),
25150
25151 Runner(&'de crate::wire::Runner<'de>),
25152
25153 Resolver(&'de crate::wire::Resolver<'de>),
25154
25155 EventStream(&'de crate::wire::EventStream<'de>),
25156
25157 Dictionary(&'de crate::wire::Dictionary<'de>),
25158
25159 Config(&'de crate::wire::Configuration<'de>),
25160
25161 UnknownOrdinal_(u64),
25162 }
25163 }
25164
25165 impl<'de> Capability<'de> {
25166 pub fn as_ref(&self) -> crate::wire::capability::Ref<'_> {
25167 match self.raw.ordinal() {
25168 1 => crate::wire::capability::Ref::Service(unsafe {
25169 self.raw.get().deref_unchecked::<crate::wire::Service<'_>>()
25170 }),
25171
25172 2 => crate::wire::capability::Ref::Protocol(unsafe {
25173 self.raw.get().deref_unchecked::<crate::wire::Protocol<'_>>()
25174 }),
25175
25176 3 => crate::wire::capability::Ref::Directory(unsafe {
25177 self.raw.get().deref_unchecked::<crate::wire::Directory<'_>>()
25178 }),
25179
25180 4 => crate::wire::capability::Ref::Storage(unsafe {
25181 self.raw.get().deref_unchecked::<crate::wire::Storage<'_>>()
25182 }),
25183
25184 5 => crate::wire::capability::Ref::Runner(unsafe {
25185 self.raw.get().deref_unchecked::<crate::wire::Runner<'_>>()
25186 }),
25187
25188 6 => crate::wire::capability::Ref::Resolver(unsafe {
25189 self.raw.get().deref_unchecked::<crate::wire::Resolver<'_>>()
25190 }),
25191
25192 8 => crate::wire::capability::Ref::EventStream(unsafe {
25193 self.raw.get().deref_unchecked::<crate::wire::EventStream<'_>>()
25194 }),
25195
25196 9 => crate::wire::capability::Ref::Dictionary(unsafe {
25197 self.raw.get().deref_unchecked::<crate::wire::Dictionary<'_>>()
25198 }),
25199
25200 10 => crate::wire::capability::Ref::Config(unsafe {
25201 self.raw.get().deref_unchecked::<crate::wire::Configuration<'_>>()
25202 }),
25203
25204 unknown => crate::wire::capability::Ref::UnknownOrdinal_(unknown),
25205 }
25206 }
25207 }
25208
25209 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Capability<'de>
25210 where
25211 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
25212 ___D: ::fidl_next::Decoder<'de>,
25213 {
25214 fn decode(
25215 mut slot: ::fidl_next::Slot<'_, Self>,
25216 decoder: &mut ___D,
25217 _: (),
25218 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25219 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
25220 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
25221 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Service<'de>>(
25222 raw,
25223 decoder,
25224 (),
25225 )?,
25226
25227 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Protocol<'de>>(
25228 raw,
25229 decoder,
25230 (),
25231 )?,
25232
25233 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Directory<'de>>(
25234 raw,
25235 decoder,
25236 (),
25237 )?,
25238
25239 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Storage<'de>>(
25240 raw,
25241 decoder,
25242 (),
25243 )?,
25244
25245 5 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Runner<'de>>(
25246 raw,
25247 decoder,
25248 (),
25249 )?,
25250
25251 6 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Resolver<'de>>(
25252 raw,
25253 decoder,
25254 (),
25255 )?,
25256
25257 8 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::EventStream<'de>>(
25258 raw,
25259 decoder,
25260 (),
25261 )?,
25262
25263 9 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Dictionary<'de>>(
25264 raw,
25265 decoder,
25266 (),
25267 )?,
25268
25269 10 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Configuration<'de>>(
25270 raw,
25271 decoder,
25272 (),
25273 )?,
25274
25275 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
25276 }
25277
25278 Ok(())
25279 }
25280 }
25281
25282 impl<'de> ::core::fmt::Debug for Capability<'de> {
25283 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
25284 match self.raw.ordinal() {
25285 1 => unsafe { self.raw.get().deref_unchecked::<crate::wire::Service<'_>>().fmt(f) },
25286 2 => unsafe {
25287 self.raw.get().deref_unchecked::<crate::wire::Protocol<'_>>().fmt(f)
25288 },
25289 3 => unsafe {
25290 self.raw.get().deref_unchecked::<crate::wire::Directory<'_>>().fmt(f)
25291 },
25292 4 => unsafe { self.raw.get().deref_unchecked::<crate::wire::Storage<'_>>().fmt(f) },
25293 5 => unsafe { self.raw.get().deref_unchecked::<crate::wire::Runner<'_>>().fmt(f) },
25294 6 => unsafe {
25295 self.raw.get().deref_unchecked::<crate::wire::Resolver<'_>>().fmt(f)
25296 },
25297 8 => unsafe {
25298 self.raw.get().deref_unchecked::<crate::wire::EventStream<'_>>().fmt(f)
25299 },
25300 9 => unsafe {
25301 self.raw.get().deref_unchecked::<crate::wire::Dictionary<'_>>().fmt(f)
25302 },
25303 10 => unsafe {
25304 self.raw.get().deref_unchecked::<crate::wire::Configuration<'_>>().fmt(f)
25305 },
25306 _ => unsafe { ::core::hint::unreachable_unchecked() },
25307 }
25308 }
25309 }
25310
25311 impl<'de> ::fidl_next::IntoNatural for Capability<'de> {
25312 type Natural = crate::natural::Capability;
25313 }
25314
25315 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
25317 #[repr(transparent)]
25318 pub struct StartupMode {
25319 pub(crate) value: ::fidl_next::wire::Uint32,
25320 }
25321
25322 impl ::fidl_next::Constrained for StartupMode {
25323 type Constraint = ();
25324
25325 fn validate(
25326 _: ::fidl_next::Slot<'_, Self>,
25327 _: Self::Constraint,
25328 ) -> Result<(), ::fidl_next::ValidationError> {
25329 Ok(())
25330 }
25331 }
25332
25333 unsafe impl ::fidl_next::Wire for StartupMode {
25334 type Narrowed<'de> = Self;
25335
25336 #[inline]
25337 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
25338 }
25340 }
25341
25342 impl StartupMode {
25343 pub const LAZY: StartupMode = StartupMode { value: ::fidl_next::wire::Uint32(0) };
25344
25345 pub const EAGER: StartupMode = StartupMode { value: ::fidl_next::wire::Uint32(1) };
25346 }
25347
25348 unsafe impl<___D> ::fidl_next::Decode<___D> for StartupMode
25349 where
25350 ___D: ?Sized,
25351 {
25352 fn decode(
25353 slot: ::fidl_next::Slot<'_, Self>,
25354 _: &mut ___D,
25355 _: (),
25356 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25357 ::fidl_next::munge!(let Self { value } = slot);
25358
25359 match u32::from(*value) {
25360 0 | 1 => (),
25361 unknown => {
25362 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
25363 }
25364 }
25365
25366 Ok(())
25367 }
25368 }
25369
25370 impl ::core::convert::From<crate::natural::StartupMode> for StartupMode {
25371 fn from(natural: crate::natural::StartupMode) -> Self {
25372 match natural {
25373 crate::natural::StartupMode::Lazy => StartupMode::LAZY,
25374
25375 crate::natural::StartupMode::Eager => StartupMode::EAGER,
25376 }
25377 }
25378 }
25379
25380 impl ::fidl_next::IntoNatural for StartupMode {
25381 type Natural = crate::natural::StartupMode;
25382 }
25383
25384 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
25386 #[repr(transparent)]
25387 pub struct OnTerminate {
25388 pub(crate) value: ::fidl_next::wire::Uint32,
25389 }
25390
25391 impl ::fidl_next::Constrained for OnTerminate {
25392 type Constraint = ();
25393
25394 fn validate(
25395 _: ::fidl_next::Slot<'_, Self>,
25396 _: Self::Constraint,
25397 ) -> Result<(), ::fidl_next::ValidationError> {
25398 Ok(())
25399 }
25400 }
25401
25402 unsafe impl ::fidl_next::Wire for OnTerminate {
25403 type Narrowed<'de> = Self;
25404
25405 #[inline]
25406 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
25407 }
25409 }
25410
25411 impl OnTerminate {
25412 pub const NONE: OnTerminate = OnTerminate { value: ::fidl_next::wire::Uint32(0) };
25413
25414 pub const REBOOT: OnTerminate = OnTerminate { value: ::fidl_next::wire::Uint32(1) };
25415 }
25416
25417 unsafe impl<___D> ::fidl_next::Decode<___D> for OnTerminate
25418 where
25419 ___D: ?Sized,
25420 {
25421 fn decode(
25422 slot: ::fidl_next::Slot<'_, Self>,
25423 _: &mut ___D,
25424 _: (),
25425 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25426 ::fidl_next::munge!(let Self { value } = slot);
25427
25428 match u32::from(*value) {
25429 0 | 1 => (),
25430 unknown => {
25431 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
25432 }
25433 }
25434
25435 Ok(())
25436 }
25437 }
25438
25439 impl ::core::convert::From<crate::natural::OnTerminate> for OnTerminate {
25440 fn from(natural: crate::natural::OnTerminate) -> Self {
25441 match natural {
25442 crate::natural::OnTerminate::None => OnTerminate::NONE,
25443
25444 crate::natural::OnTerminate::Reboot => OnTerminate::REBOOT,
25445 }
25446 }
25447 }
25448
25449 impl ::fidl_next::IntoNatural for OnTerminate {
25450 type Natural = crate::natural::OnTerminate;
25451 }
25452
25453 pub type ConfigKey<'de> = ::fidl_next::wire::String<'de>;
25455
25456 #[repr(C)]
25458 pub struct ConfigOverride<'de> {
25459 pub(crate) table: ::fidl_next::wire::Table<'de>,
25460 }
25461
25462 impl<'de> Drop for ConfigOverride<'de> {
25463 fn drop(&mut self) {
25464 let _ = self.table.get(1).map(|envelope| unsafe {
25465 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
25466 });
25467
25468 let _ = self.table.get(2).map(|envelope| unsafe {
25469 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
25470 });
25471 }
25472 }
25473
25474 impl ::fidl_next::Constrained for ConfigOverride<'_> {
25475 type Constraint = ();
25476
25477 fn validate(
25478 _: ::fidl_next::Slot<'_, Self>,
25479 _: Self::Constraint,
25480 ) -> Result<(), ::fidl_next::ValidationError> {
25481 Ok(())
25482 }
25483 }
25484
25485 unsafe impl ::fidl_next::Wire for ConfigOverride<'static> {
25486 type Narrowed<'de> = ConfigOverride<'de>;
25487
25488 #[inline]
25489 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25490 ::fidl_next::munge!(let Self { table } = out);
25491 ::fidl_next::wire::Table::zero_padding(table);
25492 }
25493 }
25494
25495 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigOverride<'de>
25496 where
25497 ___D: ::fidl_next::Decoder<'de> + ?Sized,
25498 {
25499 fn decode(
25500 slot: ::fidl_next::Slot<'_, Self>,
25501 decoder: &mut ___D,
25502 _: (),
25503 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25504 ::fidl_next::munge!(let Self { table } = slot);
25505
25506 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
25507 match ordinal {
25508 0 => unsafe { ::core::hint::unreachable_unchecked() },
25509
25510 1 => {
25511 ::fidl_next::wire::Envelope::decode_as::<
25512 ___D,
25513 ::fidl_next::wire::String<'de>,
25514 >(slot.as_mut(), decoder, 64)?;
25515
25516 let value = unsafe {
25517 slot.deref_unchecked()
25518 .deref_unchecked::<::fidl_next::wire::String<'_>>()
25519 };
25520
25521 if value.len() > 64 {
25522 return Err(::fidl_next::DecodeError::VectorTooLong {
25523 size: value.len() as u64,
25524 limit: 64,
25525 });
25526 }
25527
25528 Ok(())
25529 }
25530
25531 2 => {
25532 ::fidl_next::wire::Envelope::decode_as::<
25533 ___D,
25534 crate::wire::ConfigValue<'de>,
25535 >(slot.as_mut(), decoder, ())?;
25536
25537 Ok(())
25538 }
25539
25540 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
25541 }
25542 })
25543 }
25544 }
25545
25546 impl<'de> ConfigOverride<'de> {
25547 pub fn key(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
25548 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
25549 }
25550
25551 pub fn value(&self) -> ::core::option::Option<&crate::wire::ConfigValue<'de>> {
25552 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
25553 }
25554 }
25555
25556 impl<'de> ::core::fmt::Debug for ConfigOverride<'de> {
25557 fn fmt(
25558 &self,
25559 f: &mut ::core::fmt::Formatter<'_>,
25560 ) -> ::core::result::Result<(), ::core::fmt::Error> {
25561 f.debug_struct("ConfigOverride")
25562 .field("key", &self.key())
25563 .field("value", &self.value())
25564 .finish()
25565 }
25566 }
25567
25568 impl<'de> ::fidl_next::IntoNatural for ConfigOverride<'de> {
25569 type Natural = crate::natural::ConfigOverride;
25570 }
25571
25572 #[repr(C)]
25574 pub struct Child<'de> {
25575 pub(crate) table: ::fidl_next::wire::Table<'de>,
25576 }
25577
25578 impl<'de> Drop for Child<'de> {
25579 fn drop(&mut self) {
25580 let _ = self.table.get(1).map(|envelope| unsafe {
25581 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
25582 });
25583
25584 let _ = self.table.get(2).map(|envelope| unsafe {
25585 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
25586 });
25587
25588 let _ = self
25589 .table
25590 .get(3)
25591 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::StartupMode>() });
25592
25593 let _ = self.table.get(4).map(|envelope| unsafe {
25594 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
25595 });
25596
25597 let _ = self
25598 .table
25599 .get(5)
25600 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::OnTerminate>() });
25601
25602 let _ = self.table.get(6)
25603 .map(|envelope| unsafe {
25604 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigOverride<'de>>>()
25605 });
25606 }
25607 }
25608
25609 impl ::fidl_next::Constrained for Child<'_> {
25610 type Constraint = ();
25611
25612 fn validate(
25613 _: ::fidl_next::Slot<'_, Self>,
25614 _: Self::Constraint,
25615 ) -> Result<(), ::fidl_next::ValidationError> {
25616 Ok(())
25617 }
25618 }
25619
25620 unsafe impl ::fidl_next::Wire for Child<'static> {
25621 type Narrowed<'de> = Child<'de>;
25622
25623 #[inline]
25624 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25625 ::fidl_next::munge!(let Self { table } = out);
25626 ::fidl_next::wire::Table::zero_padding(table);
25627 }
25628 }
25629
25630 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Child<'de>
25631 where
25632 ___D: ::fidl_next::Decoder<'de> + ?Sized,
25633 {
25634 fn decode(
25635 slot: ::fidl_next::Slot<'_, Self>,
25636 decoder: &mut ___D,
25637 _: (),
25638 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25639 ::fidl_next::munge!(let Self { table } = slot);
25640
25641 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
25642 match ordinal {
25643 0 => unsafe { ::core::hint::unreachable_unchecked() },
25644
25645 1 => {
25646 ::fidl_next::wire::Envelope::decode_as::<
25647 ___D,
25648 ::fidl_next::wire::String<'de>,
25649 >(slot.as_mut(), decoder, 1024)?;
25650
25651 let value = unsafe {
25652 slot.deref_unchecked()
25653 .deref_unchecked::<::fidl_next::wire::String<'_>>()
25654 };
25655
25656 if value.len() > 1024 {
25657 return Err(::fidl_next::DecodeError::VectorTooLong {
25658 size: value.len() as u64,
25659 limit: 1024,
25660 });
25661 }
25662
25663 Ok(())
25664 }
25665
25666 2 => {
25667 ::fidl_next::wire::Envelope::decode_as::<
25668 ___D,
25669 ::fidl_next::wire::String<'de>,
25670 >(slot.as_mut(), decoder, 4096)?;
25671
25672 let value = unsafe {
25673 slot.deref_unchecked()
25674 .deref_unchecked::<::fidl_next::wire::String<'_>>()
25675 };
25676
25677 if value.len() > 4096 {
25678 return Err(::fidl_next::DecodeError::VectorTooLong {
25679 size: value.len() as u64,
25680 limit: 4096,
25681 });
25682 }
25683
25684 Ok(())
25685 }
25686
25687 3 => {
25688 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::StartupMode>(
25689 slot.as_mut(),
25690 decoder,
25691 (),
25692 )?;
25693
25694 Ok(())
25695 }
25696
25697 4 => {
25698 ::fidl_next::wire::Envelope::decode_as::<
25699 ___D,
25700 ::fidl_next::wire::String<'de>,
25701 >(slot.as_mut(), decoder, 100)?;
25702
25703 let value = unsafe {
25704 slot.deref_unchecked()
25705 .deref_unchecked::<::fidl_next::wire::String<'_>>()
25706 };
25707
25708 if value.len() > 100 {
25709 return Err(::fidl_next::DecodeError::VectorTooLong {
25710 size: value.len() as u64,
25711 limit: 100,
25712 });
25713 }
25714
25715 Ok(())
25716 }
25717
25718 5 => {
25719 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::OnTerminate>(
25720 slot.as_mut(),
25721 decoder,
25722 (),
25723 )?;
25724
25725 Ok(())
25726 }
25727
25728 6 => {
25729 ::fidl_next::wire::Envelope::decode_as::<
25730 ___D,
25731 ::fidl_next::wire::Vector<'de, crate::wire::ConfigOverride<'de>>,
25732 >(slot.as_mut(), decoder, (4294967295, ()))?;
25733
25734 Ok(())
25735 }
25736
25737 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
25738 }
25739 })
25740 }
25741 }
25742
25743 impl<'de> Child<'de> {
25744 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
25745 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
25746 }
25747
25748 pub fn url(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
25749 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
25750 }
25751
25752 pub fn startup(&self) -> ::core::option::Option<&crate::wire::StartupMode> {
25753 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
25754 }
25755
25756 pub fn environment(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
25757 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
25758 }
25759
25760 pub fn on_terminate(&self) -> ::core::option::Option<&crate::wire::OnTerminate> {
25761 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
25762 }
25763
25764 pub fn config_overrides(
25765 &self,
25766 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::ConfigOverride<'de>>>
25767 {
25768 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
25769 }
25770 }
25771
25772 impl<'de> ::core::fmt::Debug for Child<'de> {
25773 fn fmt(
25774 &self,
25775 f: &mut ::core::fmt::Formatter<'_>,
25776 ) -> ::core::result::Result<(), ::core::fmt::Error> {
25777 f.debug_struct("Child")
25778 .field("name", &self.name())
25779 .field("url", &self.url())
25780 .field("startup", &self.startup())
25781 .field("environment", &self.environment())
25782 .field("on_terminate", &self.on_terminate())
25783 .field("config_overrides", &self.config_overrides())
25784 .finish()
25785 }
25786 }
25787
25788 impl<'de> ::fidl_next::IntoNatural for Child<'de> {
25789 type Natural = crate::natural::Child;
25790 }
25791
25792 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
25794 #[repr(transparent)]
25795 pub struct Durability {
25796 pub(crate) value: ::fidl_next::wire::Uint32,
25797 }
25798
25799 impl ::fidl_next::Constrained for Durability {
25800 type Constraint = ();
25801
25802 fn validate(
25803 _: ::fidl_next::Slot<'_, Self>,
25804 _: Self::Constraint,
25805 ) -> Result<(), ::fidl_next::ValidationError> {
25806 Ok(())
25807 }
25808 }
25809
25810 unsafe impl ::fidl_next::Wire for Durability {
25811 type Narrowed<'de> = Self;
25812
25813 #[inline]
25814 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
25815 }
25817 }
25818
25819 impl Durability {
25820 pub const TRANSIENT: Durability = Durability { value: ::fidl_next::wire::Uint32(2) };
25821
25822 pub const SINGLE_RUN: Durability = Durability { value: ::fidl_next::wire::Uint32(3) };
25823 }
25824
25825 unsafe impl<___D> ::fidl_next::Decode<___D> for Durability
25826 where
25827 ___D: ?Sized,
25828 {
25829 fn decode(
25830 slot: ::fidl_next::Slot<'_, Self>,
25831 _: &mut ___D,
25832 _: (),
25833 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25834 ::fidl_next::munge!(let Self { value } = slot);
25835
25836 match u32::from(*value) {
25837 2 | 3 => (),
25838 unknown => {
25839 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
25840 }
25841 }
25842
25843 Ok(())
25844 }
25845 }
25846
25847 impl ::core::convert::From<crate::natural::Durability> for Durability {
25848 fn from(natural: crate::natural::Durability) -> Self {
25849 match natural {
25850 crate::natural::Durability::Transient => Durability::TRANSIENT,
25851
25852 crate::natural::Durability::SingleRun => Durability::SINGLE_RUN,
25853 }
25854 }
25855 }
25856
25857 impl ::fidl_next::IntoNatural for Durability {
25858 type Natural = crate::natural::Durability;
25859 }
25860
25861 #[repr(C)]
25863 pub struct Collection<'de> {
25864 pub(crate) table: ::fidl_next::wire::Table<'de>,
25865 }
25866
25867 impl<'de> Drop for Collection<'de> {
25868 fn drop(&mut self) {
25869 let _ = self.table.get(1).map(|envelope| unsafe {
25870 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
25871 });
25872
25873 let _ = self
25874 .table
25875 .get(2)
25876 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Durability>() });
25877
25878 let _ = self.table.get(3).map(|envelope| unsafe {
25879 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
25880 });
25881
25882 let _ = self
25883 .table
25884 .get(4)
25885 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::AllowedOffers>() });
25886
25887 let _ = self.table.get(5).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
25888
25889 let _ = self.table.get(6).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
25890 }
25891 }
25892
25893 impl ::fidl_next::Constrained for Collection<'_> {
25894 type Constraint = ();
25895
25896 fn validate(
25897 _: ::fidl_next::Slot<'_, Self>,
25898 _: Self::Constraint,
25899 ) -> Result<(), ::fidl_next::ValidationError> {
25900 Ok(())
25901 }
25902 }
25903
25904 unsafe impl ::fidl_next::Wire for Collection<'static> {
25905 type Narrowed<'de> = Collection<'de>;
25906
25907 #[inline]
25908 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25909 ::fidl_next::munge!(let Self { table } = out);
25910 ::fidl_next::wire::Table::zero_padding(table);
25911 }
25912 }
25913
25914 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Collection<'de>
25915 where
25916 ___D: ::fidl_next::Decoder<'de> + ?Sized,
25917 {
25918 fn decode(
25919 slot: ::fidl_next::Slot<'_, Self>,
25920 decoder: &mut ___D,
25921 _: (),
25922 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25923 ::fidl_next::munge!(let Self { table } = slot);
25924
25925 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
25926 match ordinal {
25927 0 => unsafe { ::core::hint::unreachable_unchecked() },
25928
25929 1 => {
25930 ::fidl_next::wire::Envelope::decode_as::<
25931 ___D,
25932 ::fidl_next::wire::String<'de>,
25933 >(slot.as_mut(), decoder, 100)?;
25934
25935 let value = unsafe {
25936 slot.deref_unchecked()
25937 .deref_unchecked::<::fidl_next::wire::String<'_>>()
25938 };
25939
25940 if value.len() > 100 {
25941 return Err(::fidl_next::DecodeError::VectorTooLong {
25942 size: value.len() as u64,
25943 limit: 100,
25944 });
25945 }
25946
25947 Ok(())
25948 }
25949
25950 2 => {
25951 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Durability>(
25952 slot.as_mut(),
25953 decoder,
25954 (),
25955 )?;
25956
25957 Ok(())
25958 }
25959
25960 3 => {
25961 ::fidl_next::wire::Envelope::decode_as::<
25962 ___D,
25963 ::fidl_next::wire::String<'de>,
25964 >(slot.as_mut(), decoder, 100)?;
25965
25966 let value = unsafe {
25967 slot.deref_unchecked()
25968 .deref_unchecked::<::fidl_next::wire::String<'_>>()
25969 };
25970
25971 if value.len() > 100 {
25972 return Err(::fidl_next::DecodeError::VectorTooLong {
25973 size: value.len() as u64,
25974 limit: 100,
25975 });
25976 }
25977
25978 Ok(())
25979 }
25980
25981 4 => {
25982 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::AllowedOffers>(
25983 slot.as_mut(),
25984 decoder,
25985 (),
25986 )?;
25987
25988 Ok(())
25989 }
25990
25991 5 => {
25992 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
25993 slot.as_mut(),
25994 decoder,
25995 (),
25996 )?;
25997
25998 Ok(())
25999 }
26000
26001 6 => {
26002 ::fidl_next::wire::Envelope::decode_as::<___D, bool>(
26003 slot.as_mut(),
26004 decoder,
26005 (),
26006 )?;
26007
26008 Ok(())
26009 }
26010
26011 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
26012 }
26013 })
26014 }
26015 }
26016
26017 impl<'de> Collection<'de> {
26018 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
26019 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
26020 }
26021
26022 pub fn durability(&self) -> ::core::option::Option<&crate::wire::Durability> {
26023 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
26024 }
26025
26026 pub fn environment(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
26027 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
26028 }
26029
26030 pub fn allowed_offers(&self) -> ::core::option::Option<&crate::wire::AllowedOffers> {
26031 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
26032 }
26033
26034 pub fn allow_long_names(&self) -> ::core::option::Option<&bool> {
26035 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
26036 }
26037
26038 pub fn persistent_storage(&self) -> ::core::option::Option<&bool> {
26039 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
26040 }
26041 }
26042
26043 impl<'de> ::core::fmt::Debug for Collection<'de> {
26044 fn fmt(
26045 &self,
26046 f: &mut ::core::fmt::Formatter<'_>,
26047 ) -> ::core::result::Result<(), ::core::fmt::Error> {
26048 f.debug_struct("Collection")
26049 .field("name", &self.name())
26050 .field("durability", &self.durability())
26051 .field("environment", &self.environment())
26052 .field("allowed_offers", &self.allowed_offers())
26053 .field("allow_long_names", &self.allow_long_names())
26054 .field("persistent_storage", &self.persistent_storage())
26055 .finish()
26056 }
26057 }
26058
26059 impl<'de> ::fidl_next::IntoNatural for Collection<'de> {
26060 type Natural = crate::natural::Collection;
26061 }
26062
26063 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
26065 #[repr(transparent)]
26066 pub struct DependencyType {
26067 pub(crate) value: ::fidl_next::wire::Uint32,
26068 }
26069
26070 impl ::fidl_next::Constrained for DependencyType {
26071 type Constraint = ();
26072
26073 fn validate(
26074 _: ::fidl_next::Slot<'_, Self>,
26075 _: Self::Constraint,
26076 ) -> Result<(), ::fidl_next::ValidationError> {
26077 Ok(())
26078 }
26079 }
26080
26081 unsafe impl ::fidl_next::Wire for DependencyType {
26082 type Narrowed<'de> = Self;
26083
26084 #[inline]
26085 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
26086 }
26088 }
26089
26090 impl DependencyType {
26091 pub const STRONG: DependencyType = DependencyType { value: ::fidl_next::wire::Uint32(1) };
26092
26093 pub const WEAK: DependencyType = DependencyType { value: ::fidl_next::wire::Uint32(2) };
26094 }
26095
26096 unsafe impl<___D> ::fidl_next::Decode<___D> for DependencyType
26097 where
26098 ___D: ?Sized,
26099 {
26100 fn decode(
26101 slot: ::fidl_next::Slot<'_, Self>,
26102 _: &mut ___D,
26103 _: (),
26104 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26105 ::fidl_next::munge!(let Self { value } = slot);
26106
26107 match u32::from(*value) {
26108 1 | 2 => (),
26109 unknown => {
26110 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
26111 }
26112 }
26113
26114 Ok(())
26115 }
26116 }
26117
26118 impl ::core::convert::From<crate::natural::DependencyType> for DependencyType {
26119 fn from(natural: crate::natural::DependencyType) -> Self {
26120 match natural {
26121 crate::natural::DependencyType::Strong => DependencyType::STRONG,
26122
26123 crate::natural::DependencyType::Weak => DependencyType::WEAK,
26124 }
26125 }
26126 }
26127
26128 impl ::fidl_next::IntoNatural for DependencyType {
26129 type Natural = crate::natural::DependencyType;
26130 }
26131
26132 #[derive(Debug)]
26134 #[repr(C)]
26135 pub struct NameMapping<'de> {
26136 pub source_name: ::fidl_next::wire::String<'de>,
26137
26138 pub target_name: ::fidl_next::wire::String<'de>,
26139 }
26140
26141 static_assertions::const_assert_eq!(std::mem::size_of::<NameMapping<'_>>(), 32);
26142 static_assertions::const_assert_eq!(std::mem::align_of::<NameMapping<'_>>(), 8);
26143
26144 static_assertions::const_assert_eq!(std::mem::offset_of!(NameMapping<'_>, source_name), 0);
26145
26146 static_assertions::const_assert_eq!(std::mem::offset_of!(NameMapping<'_>, target_name), 16);
26147
26148 impl ::fidl_next::Constrained for NameMapping<'_> {
26149 type Constraint = ();
26150
26151 fn validate(
26152 _: ::fidl_next::Slot<'_, Self>,
26153 _: Self::Constraint,
26154 ) -> Result<(), ::fidl_next::ValidationError> {
26155 Ok(())
26156 }
26157 }
26158
26159 unsafe impl ::fidl_next::Wire for NameMapping<'static> {
26160 type Narrowed<'de> = NameMapping<'de>;
26161
26162 #[inline]
26163 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
26164 ::fidl_next::munge! {
26165 let Self {
26166
26167 source_name,
26168 target_name,
26169
26170 } = &mut *out_;
26171 }
26172
26173 ::fidl_next::Wire::zero_padding(source_name);
26174
26175 ::fidl_next::Wire::zero_padding(target_name);
26176 }
26177 }
26178
26179 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for NameMapping<'de>
26180 where
26181 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
26182 ___D: ::fidl_next::Decoder<'de>,
26183 {
26184 fn decode(
26185 slot_: ::fidl_next::Slot<'_, Self>,
26186 decoder_: &mut ___D,
26187 _: (),
26188 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26189 ::fidl_next::munge! {
26190 let Self {
26191
26192 mut source_name,
26193 mut target_name,
26194
26195 } = slot_;
26196 }
26197
26198 let _field = source_name.as_mut();
26199 ::fidl_next::Constrained::validate(_field, 100)?;
26200 ::fidl_next::Decode::decode(source_name.as_mut(), decoder_, 100)?;
26201
26202 let source_name = unsafe { source_name.deref_unchecked() };
26203
26204 if source_name.len() > 100 {
26205 return Err(::fidl_next::DecodeError::VectorTooLong {
26206 size: source_name.len() as u64,
26207 limit: 100,
26208 });
26209 }
26210
26211 let _field = target_name.as_mut();
26212 ::fidl_next::Constrained::validate(_field, 100)?;
26213 ::fidl_next::Decode::decode(target_name.as_mut(), decoder_, 100)?;
26214
26215 let target_name = unsafe { target_name.deref_unchecked() };
26216
26217 if target_name.len() > 100 {
26218 return Err(::fidl_next::DecodeError::VectorTooLong {
26219 size: target_name.len() as u64,
26220 limit: 100,
26221 });
26222 }
26223
26224 Ok(())
26225 }
26226 }
26227
26228 impl<'de> ::fidl_next::IntoNatural for NameMapping<'de> {
26229 type Natural = crate::natural::NameMapping;
26230 }
26231
26232 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
26234 #[repr(transparent)]
26235 pub struct EnvironmentExtends {
26236 pub(crate) value: ::fidl_next::wire::Uint32,
26237 }
26238
26239 impl ::fidl_next::Constrained for EnvironmentExtends {
26240 type Constraint = ();
26241
26242 fn validate(
26243 _: ::fidl_next::Slot<'_, Self>,
26244 _: Self::Constraint,
26245 ) -> Result<(), ::fidl_next::ValidationError> {
26246 Ok(())
26247 }
26248 }
26249
26250 unsafe impl ::fidl_next::Wire for EnvironmentExtends {
26251 type Narrowed<'de> = Self;
26252
26253 #[inline]
26254 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
26255 }
26257 }
26258
26259 impl EnvironmentExtends {
26260 pub const NONE: EnvironmentExtends =
26261 EnvironmentExtends { value: ::fidl_next::wire::Uint32(0) };
26262
26263 pub const REALM: EnvironmentExtends =
26264 EnvironmentExtends { value: ::fidl_next::wire::Uint32(1) };
26265 }
26266
26267 unsafe impl<___D> ::fidl_next::Decode<___D> for EnvironmentExtends
26268 where
26269 ___D: ?Sized,
26270 {
26271 fn decode(
26272 slot: ::fidl_next::Slot<'_, Self>,
26273 _: &mut ___D,
26274 _: (),
26275 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26276 ::fidl_next::munge!(let Self { value } = slot);
26277
26278 match u32::from(*value) {
26279 0 | 1 => (),
26280 unknown => {
26281 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
26282 }
26283 }
26284
26285 Ok(())
26286 }
26287 }
26288
26289 impl ::core::convert::From<crate::natural::EnvironmentExtends> for EnvironmentExtends {
26290 fn from(natural: crate::natural::EnvironmentExtends) -> Self {
26291 match natural {
26292 crate::natural::EnvironmentExtends::None => EnvironmentExtends::NONE,
26293
26294 crate::natural::EnvironmentExtends::Realm => EnvironmentExtends::REALM,
26295 }
26296 }
26297 }
26298
26299 impl ::fidl_next::IntoNatural for EnvironmentExtends {
26300 type Natural = crate::natural::EnvironmentExtends;
26301 }
26302
26303 pub type UrlScheme<'de> = ::fidl_next::wire::String<'de>;
26305
26306 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
26308 #[repr(transparent)]
26309 pub struct ConfigTypeLayout {
26310 pub(crate) value: ::fidl_next::wire::Uint32,
26311 }
26312
26313 impl ::fidl_next::Constrained for ConfigTypeLayout {
26314 type Constraint = ();
26315
26316 fn validate(
26317 _: ::fidl_next::Slot<'_, Self>,
26318 _: Self::Constraint,
26319 ) -> Result<(), ::fidl_next::ValidationError> {
26320 Ok(())
26321 }
26322 }
26323
26324 unsafe impl ::fidl_next::Wire for ConfigTypeLayout {
26325 type Narrowed<'de> = Self;
26326
26327 #[inline]
26328 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
26329 }
26331 }
26332
26333 impl ConfigTypeLayout {
26334 pub const BOOL: ConfigTypeLayout = ConfigTypeLayout { value: ::fidl_next::wire::Uint32(1) };
26335
26336 pub const UINT8: ConfigTypeLayout =
26337 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(2) };
26338
26339 pub const UINT16: ConfigTypeLayout =
26340 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(3) };
26341
26342 pub const UINT32: ConfigTypeLayout =
26343 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(4) };
26344
26345 pub const UINT64: ConfigTypeLayout =
26346 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(5) };
26347
26348 pub const INT8: ConfigTypeLayout = ConfigTypeLayout { value: ::fidl_next::wire::Uint32(6) };
26349
26350 pub const INT16: ConfigTypeLayout =
26351 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(7) };
26352
26353 pub const INT32: ConfigTypeLayout =
26354 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(8) };
26355
26356 pub const INT64: ConfigTypeLayout =
26357 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(9) };
26358
26359 pub const STRING: ConfigTypeLayout =
26360 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(10) };
26361
26362 pub const VECTOR: ConfigTypeLayout =
26363 ConfigTypeLayout { value: ::fidl_next::wire::Uint32(11) };
26364 }
26365
26366 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigTypeLayout
26367 where
26368 ___D: ?Sized,
26369 {
26370 fn decode(
26371 slot: ::fidl_next::Slot<'_, Self>,
26372 _: &mut ___D,
26373 _: (),
26374 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26375 Ok(())
26376 }
26377 }
26378
26379 impl ::core::convert::From<crate::natural::ConfigTypeLayout> for ConfigTypeLayout {
26380 fn from(natural: crate::natural::ConfigTypeLayout) -> Self {
26381 match natural {
26382 crate::natural::ConfigTypeLayout::Bool => ConfigTypeLayout::BOOL,
26383
26384 crate::natural::ConfigTypeLayout::Uint8 => ConfigTypeLayout::UINT8,
26385
26386 crate::natural::ConfigTypeLayout::Uint16 => ConfigTypeLayout::UINT16,
26387
26388 crate::natural::ConfigTypeLayout::Uint32 => ConfigTypeLayout::UINT32,
26389
26390 crate::natural::ConfigTypeLayout::Uint64 => ConfigTypeLayout::UINT64,
26391
26392 crate::natural::ConfigTypeLayout::Int8 => ConfigTypeLayout::INT8,
26393
26394 crate::natural::ConfigTypeLayout::Int16 => ConfigTypeLayout::INT16,
26395
26396 crate::natural::ConfigTypeLayout::Int32 => ConfigTypeLayout::INT32,
26397
26398 crate::natural::ConfigTypeLayout::Int64 => ConfigTypeLayout::INT64,
26399
26400 crate::natural::ConfigTypeLayout::String => ConfigTypeLayout::STRING,
26401
26402 crate::natural::ConfigTypeLayout::Vector => ConfigTypeLayout::VECTOR,
26403
26404 crate::natural::ConfigTypeLayout::UnknownOrdinal_(value) => {
26405 ConfigTypeLayout { value: ::fidl_next::wire::Uint32::from(value) }
26406 }
26407 }
26408 }
26409 }
26410
26411 impl ::fidl_next::IntoNatural for ConfigTypeLayout {
26412 type Natural = crate::natural::ConfigTypeLayout;
26413 }
26414
26415 #[repr(transparent)]
26417 pub struct LayoutConstraint<'de> {
26418 pub(crate) raw: ::fidl_next::wire::Union,
26419 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
26420 }
26421
26422 impl<'de> Drop for LayoutConstraint<'de> {
26423 fn drop(&mut self) {
26424 match self.raw.ordinal() {
26425 1 => {
26426 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::wire::Uint32>() };
26427 }
26428
26429 _ => (),
26430 }
26431 }
26432 }
26433
26434 impl ::fidl_next::Constrained for LayoutConstraint<'_> {
26435 type Constraint = ();
26436
26437 fn validate(
26438 _: ::fidl_next::Slot<'_, Self>,
26439 _: Self::Constraint,
26440 ) -> Result<(), ::fidl_next::ValidationError> {
26441 Ok(())
26442 }
26443 }
26444
26445 unsafe impl ::fidl_next::Wire for LayoutConstraint<'static> {
26446 type Narrowed<'de> = LayoutConstraint<'de>;
26447
26448 #[inline]
26449 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26450 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
26451 ::fidl_next::wire::Union::zero_padding(raw);
26452 }
26453 }
26454
26455 pub mod layout_constraint {
26456 pub enum Ref<'de> {
26457 MaxSize(&'de ::fidl_next::wire::Uint32),
26458
26459 UnknownOrdinal_(u64),
26460 }
26461 }
26462
26463 impl<'de> LayoutConstraint<'de> {
26464 pub fn as_ref(&self) -> crate::wire::layout_constraint::Ref<'_> {
26465 match self.raw.ordinal() {
26466 1 => crate::wire::layout_constraint::Ref::MaxSize(unsafe {
26467 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint32>()
26468 }),
26469
26470 unknown => crate::wire::layout_constraint::Ref::UnknownOrdinal_(unknown),
26471 }
26472 }
26473 }
26474
26475 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LayoutConstraint<'de>
26476 where
26477 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
26478 ___D: ::fidl_next::Decoder<'de>,
26479 {
26480 fn decode(
26481 mut slot: ::fidl_next::Slot<'_, Self>,
26482 decoder: &mut ___D,
26483 _: (),
26484 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26485 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
26486 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
26487 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint32>(
26488 raw,
26489 decoder,
26490 (),
26491 )?,
26492
26493 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
26494 }
26495
26496 Ok(())
26497 }
26498 }
26499
26500 impl<'de> ::core::fmt::Debug for LayoutConstraint<'de> {
26501 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
26502 match self.raw.ordinal() {
26503 1 => unsafe {
26504 self.raw.get().deref_unchecked::<::fidl_next::wire::Uint32>().fmt(f)
26505 },
26506 _ => unsafe { ::core::hint::unreachable_unchecked() },
26507 }
26508 }
26509 }
26510
26511 impl<'de> ::fidl_next::IntoNatural for LayoutConstraint<'de> {
26512 type Natural = crate::natural::LayoutConstraint;
26513 }
26514
26515 #[derive(Debug)]
26517 #[repr(C)]
26518 pub struct ConfigType<'de> {
26519 pub layout: crate::wire::ConfigTypeLayout,
26520
26521 pub parameters: ::fidl_next::wire::OptionalVector<'de, crate::wire::LayoutParameter<'de>>,
26522
26523 pub constraints: ::fidl_next::wire::Vector<'de, crate::wire::LayoutConstraint<'de>>,
26524 }
26525
26526 static_assertions::const_assert_eq!(std::mem::size_of::<ConfigType<'_>>(), 40);
26527 static_assertions::const_assert_eq!(std::mem::align_of::<ConfigType<'_>>(), 8);
26528
26529 static_assertions::const_assert_eq!(std::mem::offset_of!(ConfigType<'_>, layout), 0);
26530
26531 static_assertions::const_assert_eq!(std::mem::offset_of!(ConfigType<'_>, parameters), 8);
26532
26533 static_assertions::const_assert_eq!(std::mem::offset_of!(ConfigType<'_>, constraints), 24);
26534
26535 impl ::fidl_next::Constrained for ConfigType<'_> {
26536 type Constraint = ();
26537
26538 fn validate(
26539 _: ::fidl_next::Slot<'_, Self>,
26540 _: Self::Constraint,
26541 ) -> Result<(), ::fidl_next::ValidationError> {
26542 Ok(())
26543 }
26544 }
26545
26546 unsafe impl ::fidl_next::Wire for ConfigType<'static> {
26547 type Narrowed<'de> = ConfigType<'de>;
26548
26549 #[inline]
26550 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
26551 ::fidl_next::munge! {
26552 let Self {
26553
26554 layout,
26555 parameters,
26556 constraints,
26557
26558 } = &mut *out_;
26559 }
26560
26561 ::fidl_next::Wire::zero_padding(layout);
26562
26563 ::fidl_next::Wire::zero_padding(parameters);
26564
26565 ::fidl_next::Wire::zero_padding(constraints);
26566
26567 unsafe {
26568 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
26569 }
26570 }
26571 }
26572
26573 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigType<'de>
26574 where
26575 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
26576 ___D: ::fidl_next::Decoder<'de>,
26577 {
26578 fn decode(
26579 slot_: ::fidl_next::Slot<'_, Self>,
26580 decoder_: &mut ___D,
26581 _: (),
26582 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26583 if slot_.as_bytes()[4..8] != [0u8; 4] {
26584 return Err(::fidl_next::DecodeError::InvalidPadding);
26585 }
26586
26587 ::fidl_next::munge! {
26588 let Self {
26589
26590 mut layout,
26591 mut parameters,
26592 mut constraints,
26593
26594 } = slot_;
26595 }
26596
26597 let _field = layout.as_mut();
26598
26599 ::fidl_next::Decode::decode(layout.as_mut(), decoder_, ())?;
26600
26601 let _field = parameters.as_mut();
26602 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
26603 ::fidl_next::Decode::decode(parameters.as_mut(), decoder_, (4294967295, ()))?;
26604
26605 let _field = constraints.as_mut();
26606 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
26607 ::fidl_next::Decode::decode(constraints.as_mut(), decoder_, (4294967295, ()))?;
26608
26609 Ok(())
26610 }
26611 }
26612
26613 impl<'de> ::fidl_next::IntoNatural for ConfigType<'de> {
26614 type Natural = crate::natural::ConfigType;
26615 }
26616
26617 #[repr(transparent)]
26619 pub struct ConfigChecksum<'de> {
26620 pub(crate) raw: ::fidl_next::wire::Union,
26621 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
26622 }
26623
26624 impl<'de> Drop for ConfigChecksum<'de> {
26625 fn drop(&mut self) {
26626 match self.raw.ordinal() {
26627 1 => {
26628 let _ = unsafe { self.raw.get().read_unchecked::<[u8; 32]>() };
26629 }
26630
26631 _ => (),
26632 }
26633 }
26634 }
26635
26636 impl ::fidl_next::Constrained for ConfigChecksum<'_> {
26637 type Constraint = ();
26638
26639 fn validate(
26640 _: ::fidl_next::Slot<'_, Self>,
26641 _: Self::Constraint,
26642 ) -> Result<(), ::fidl_next::ValidationError> {
26643 Ok(())
26644 }
26645 }
26646
26647 unsafe impl ::fidl_next::Wire for ConfigChecksum<'static> {
26648 type Narrowed<'de> = ConfigChecksum<'de>;
26649
26650 #[inline]
26651 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26652 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
26653 ::fidl_next::wire::Union::zero_padding(raw);
26654 }
26655 }
26656
26657 pub mod config_checksum {
26658 pub enum Ref<'de> {
26659 Sha256(&'de [u8; 32]),
26660
26661 UnknownOrdinal_(u64),
26662 }
26663 }
26664
26665 impl<'de> ConfigChecksum<'de> {
26666 pub fn as_ref(&self) -> crate::wire::config_checksum::Ref<'_> {
26667 match self.raw.ordinal() {
26668 1 => crate::wire::config_checksum::Ref::Sha256(unsafe {
26669 self.raw.get().deref_unchecked::<[u8; 32]>()
26670 }),
26671
26672 unknown => crate::wire::config_checksum::Ref::UnknownOrdinal_(unknown),
26673 }
26674 }
26675 }
26676
26677 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigChecksum<'de>
26678 where
26679 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
26680 ___D: ::fidl_next::Decoder<'de>,
26681 {
26682 fn decode(
26683 mut slot: ::fidl_next::Slot<'_, Self>,
26684 decoder: &mut ___D,
26685 _: (),
26686 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26687 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
26688 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
26689 1 => ::fidl_next::wire::Union::decode_as::<___D, [u8; 32]>(raw, decoder, ())?,
26690
26691 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
26692 }
26693
26694 Ok(())
26695 }
26696 }
26697
26698 impl<'de> ::core::fmt::Debug for ConfigChecksum<'de> {
26699 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
26700 match self.raw.ordinal() {
26701 1 => unsafe { self.raw.get().deref_unchecked::<[u8; 32]>().fmt(f) },
26702 _ => unsafe { ::core::hint::unreachable_unchecked() },
26703 }
26704 }
26705 }
26706
26707 impl<'de> ::fidl_next::IntoNatural for ConfigChecksum<'de> {
26708 type Natural = crate::natural::ConfigChecksum;
26709 }
26710
26711 #[repr(C)]
26713 pub struct UseStorage<'de> {
26714 pub(crate) table: ::fidl_next::wire::Table<'de>,
26715 }
26716
26717 impl<'de> Drop for UseStorage<'de> {
26718 fn drop(&mut self) {
26719 let _ = self.table.get(1).map(|envelope| unsafe {
26720 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
26721 });
26722
26723 let _ = self.table.get(2).map(|envelope| unsafe {
26724 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
26725 });
26726
26727 let _ = self
26728 .table
26729 .get(3)
26730 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
26731 }
26732 }
26733
26734 impl ::fidl_next::Constrained for UseStorage<'_> {
26735 type Constraint = ();
26736
26737 fn validate(
26738 _: ::fidl_next::Slot<'_, Self>,
26739 _: Self::Constraint,
26740 ) -> Result<(), ::fidl_next::ValidationError> {
26741 Ok(())
26742 }
26743 }
26744
26745 unsafe impl ::fidl_next::Wire for UseStorage<'static> {
26746 type Narrowed<'de> = UseStorage<'de>;
26747
26748 #[inline]
26749 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26750 ::fidl_next::munge!(let Self { table } = out);
26751 ::fidl_next::wire::Table::zero_padding(table);
26752 }
26753 }
26754
26755 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for UseStorage<'de>
26756 where
26757 ___D: ::fidl_next::Decoder<'de> + ?Sized,
26758 {
26759 fn decode(
26760 slot: ::fidl_next::Slot<'_, Self>,
26761 decoder: &mut ___D,
26762 _: (),
26763 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26764 ::fidl_next::munge!(let Self { table } = slot);
26765
26766 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
26767 match ordinal {
26768 0 => unsafe { ::core::hint::unreachable_unchecked() },
26769
26770 1 => {
26771 ::fidl_next::wire::Envelope::decode_as::<
26772 ___D,
26773 ::fidl_next::wire::String<'de>,
26774 >(slot.as_mut(), decoder, 100)?;
26775
26776 let value = unsafe {
26777 slot.deref_unchecked()
26778 .deref_unchecked::<::fidl_next::wire::String<'_>>()
26779 };
26780
26781 if value.len() > 100 {
26782 return Err(::fidl_next::DecodeError::VectorTooLong {
26783 size: value.len() as u64,
26784 limit: 100,
26785 });
26786 }
26787
26788 Ok(())
26789 }
26790
26791 2 => {
26792 ::fidl_next::wire::Envelope::decode_as::<
26793 ___D,
26794 ::fidl_next::wire::String<'de>,
26795 >(slot.as_mut(), decoder, 1024)?;
26796
26797 let value = unsafe {
26798 slot.deref_unchecked()
26799 .deref_unchecked::<::fidl_next::wire::String<'_>>()
26800 };
26801
26802 if value.len() > 1024 {
26803 return Err(::fidl_next::DecodeError::VectorTooLong {
26804 size: value.len() as u64,
26805 limit: 1024,
26806 });
26807 }
26808
26809 Ok(())
26810 }
26811
26812 3 => {
26813 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
26814 slot.as_mut(),
26815 decoder,
26816 (),
26817 )?;
26818
26819 Ok(())
26820 }
26821
26822 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
26823 }
26824 })
26825 }
26826 }
26827
26828 impl<'de> UseStorage<'de> {
26829 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
26830 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
26831 }
26832
26833 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
26834 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
26835 }
26836
26837 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
26838 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
26839 }
26840 }
26841
26842 impl<'de> ::core::fmt::Debug for UseStorage<'de> {
26843 fn fmt(
26844 &self,
26845 f: &mut ::core::fmt::Formatter<'_>,
26846 ) -> ::core::result::Result<(), ::core::fmt::Error> {
26847 f.debug_struct("UseStorage")
26848 .field("source_name", &self.source_name())
26849 .field("target_path", &self.target_path())
26850 .field("availability", &self.availability())
26851 .finish()
26852 }
26853 }
26854
26855 impl<'de> ::fidl_next::IntoNatural for UseStorage<'de> {
26856 type Natural = crate::natural::UseStorage;
26857 }
26858
26859 #[derive(Clone, Copy, Debug)]
26861 #[repr(transparent)]
26862 pub struct ConfigMutability {
26863 pub(crate) value: ::fidl_next::wire::Uint32,
26864 }
26865
26866 impl ::fidl_next::Constrained for ConfigMutability {
26867 type Constraint = ();
26868
26869 fn validate(
26870 _: ::fidl_next::Slot<'_, Self>,
26871 _: Self::Constraint,
26872 ) -> Result<(), ::fidl_next::ValidationError> {
26873 Ok(())
26874 }
26875 }
26876
26877 unsafe impl ::fidl_next::Wire for ConfigMutability {
26878 type Narrowed<'de> = Self;
26879
26880 #[inline]
26881 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
26882 }
26884 }
26885
26886 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigMutability
26887 where
26888 ___D: ?Sized,
26889 {
26890 fn decode(
26891 slot: ::fidl_next::Slot<'_, Self>,
26892 _: &mut ___D,
26893 _: (),
26894 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26895 Ok(())
26896 }
26897 }
26898
26899 impl ::core::convert::From<crate::natural::ConfigMutability> for ConfigMutability {
26900 fn from(natural: crate::natural::ConfigMutability) -> Self {
26901 Self { value: ::fidl_next::wire::Uint32::from(natural.bits()) }
26902 }
26903 }
26904
26905 impl ::fidl_next::IntoNatural for ConfigMutability {
26906 type Natural = crate::natural::ConfigMutability;
26907 }
26908
26909 #[repr(C)]
26911 pub struct ConfigField<'de> {
26912 pub(crate) table: ::fidl_next::wire::Table<'de>,
26913 }
26914
26915 impl<'de> Drop for ConfigField<'de> {
26916 fn drop(&mut self) {
26917 let _ = self.table.get(1).map(|envelope| unsafe {
26918 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
26919 });
26920
26921 let _ = self.table.get(2).map(|envelope| unsafe {
26922 envelope.read_unchecked::<crate::wire::ConfigType<'de>>()
26923 });
26924
26925 let _ = self.table.get(3).map(|envelope| unsafe {
26926 envelope.read_unchecked::<crate::wire::ConfigMutability>()
26927 });
26928 }
26929 }
26930
26931 impl ::fidl_next::Constrained for ConfigField<'_> {
26932 type Constraint = ();
26933
26934 fn validate(
26935 _: ::fidl_next::Slot<'_, Self>,
26936 _: Self::Constraint,
26937 ) -> Result<(), ::fidl_next::ValidationError> {
26938 Ok(())
26939 }
26940 }
26941
26942 unsafe impl ::fidl_next::Wire for ConfigField<'static> {
26943 type Narrowed<'de> = ConfigField<'de>;
26944
26945 #[inline]
26946 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26947 ::fidl_next::munge!(let Self { table } = out);
26948 ::fidl_next::wire::Table::zero_padding(table);
26949 }
26950 }
26951
26952 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigField<'de>
26953 where
26954 ___D: ::fidl_next::Decoder<'de> + ?Sized,
26955 {
26956 fn decode(
26957 slot: ::fidl_next::Slot<'_, Self>,
26958 decoder: &mut ___D,
26959 _: (),
26960 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26961 ::fidl_next::munge!(let Self { table } = slot);
26962
26963 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
26964 match ordinal {
26965 0 => unsafe { ::core::hint::unreachable_unchecked() },
26966
26967 1 => {
26968 ::fidl_next::wire::Envelope::decode_as::<
26969 ___D,
26970 ::fidl_next::wire::String<'de>,
26971 >(slot.as_mut(), decoder, 64)?;
26972
26973 let value = unsafe {
26974 slot.deref_unchecked()
26975 .deref_unchecked::<::fidl_next::wire::String<'_>>()
26976 };
26977
26978 if value.len() > 64 {
26979 return Err(::fidl_next::DecodeError::VectorTooLong {
26980 size: value.len() as u64,
26981 limit: 64,
26982 });
26983 }
26984
26985 Ok(())
26986 }
26987
26988 2 => {
26989 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::ConfigType<'de>>(
26990 slot.as_mut(),
26991 decoder,
26992 (),
26993 )?;
26994
26995 Ok(())
26996 }
26997
26998 3 => {
26999 ::fidl_next::wire::Envelope::decode_as::<
27000 ___D,
27001 crate::wire::ConfigMutability,
27002 >(slot.as_mut(), decoder, ())?;
27003
27004 Ok(())
27005 }
27006
27007 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
27008 }
27009 })
27010 }
27011 }
27012
27013 impl<'de> ConfigField<'de> {
27014 pub fn key(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27015 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
27016 }
27017
27018 pub fn type_(&self) -> ::core::option::Option<&crate::wire::ConfigType<'de>> {
27019 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
27020 }
27021
27022 pub fn mutability(&self) -> ::core::option::Option<&crate::wire::ConfigMutability> {
27023 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
27024 }
27025 }
27026
27027 impl<'de> ::core::fmt::Debug for ConfigField<'de> {
27028 fn fmt(
27029 &self,
27030 f: &mut ::core::fmt::Formatter<'_>,
27031 ) -> ::core::result::Result<(), ::core::fmt::Error> {
27032 f.debug_struct("ConfigField")
27033 .field("key", &self.key())
27034 .field("type_", &self.type_())
27035 .field("mutability", &self.mutability())
27036 .finish()
27037 }
27038 }
27039
27040 impl<'de> ::fidl_next::IntoNatural for ConfigField<'de> {
27041 type Natural = crate::natural::ConfigField;
27042 }
27043
27044 #[repr(C)]
27046 pub struct Program<'de> {
27047 pub(crate) table: ::fidl_next::wire::Table<'de>,
27048 }
27049
27050 impl<'de> Drop for Program<'de> {
27051 fn drop(&mut self) {
27052 let _ = self.table.get(1).map(|envelope| unsafe {
27053 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27054 });
27055
27056 let _ = self.table.get(2).map(|envelope| unsafe {
27057 envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>()
27058 });
27059 }
27060 }
27061
27062 impl ::fidl_next::Constrained for Program<'_> {
27063 type Constraint = ();
27064
27065 fn validate(
27066 _: ::fidl_next::Slot<'_, Self>,
27067 _: Self::Constraint,
27068 ) -> Result<(), ::fidl_next::ValidationError> {
27069 Ok(())
27070 }
27071 }
27072
27073 unsafe impl ::fidl_next::Wire for Program<'static> {
27074 type Narrowed<'de> = Program<'de>;
27075
27076 #[inline]
27077 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27078 ::fidl_next::munge!(let Self { table } = out);
27079 ::fidl_next::wire::Table::zero_padding(table);
27080 }
27081 }
27082
27083 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Program<'de>
27084 where
27085 ___D: ::fidl_next::Decoder<'de> + ?Sized,
27086 {
27087 fn decode(
27088 slot: ::fidl_next::Slot<'_, Self>,
27089 decoder: &mut ___D,
27090 _: (),
27091 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27092 ::fidl_next::munge!(let Self { table } = slot);
27093
27094 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
27095 match ordinal {
27096 0 => unsafe { ::core::hint::unreachable_unchecked() },
27097
27098 1 => {
27099 ::fidl_next::wire::Envelope::decode_as::<
27100 ___D,
27101 ::fidl_next::wire::String<'de>,
27102 >(slot.as_mut(), decoder, 100)?;
27103
27104 let value = unsafe {
27105 slot.deref_unchecked()
27106 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27107 };
27108
27109 if value.len() > 100 {
27110 return Err(::fidl_next::DecodeError::VectorTooLong {
27111 size: value.len() as u64,
27112 limit: 100,
27113 });
27114 }
27115
27116 Ok(())
27117 }
27118
27119 2 => {
27120 ::fidl_next::wire::Envelope::decode_as::<
27121 ___D,
27122 ::fidl_next_common_fuchsia_data::wire::Dictionary<'de>,
27123 >(slot.as_mut(), decoder, ())?;
27124
27125 Ok(())
27126 }
27127
27128 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
27129 }
27130 })
27131 }
27132 }
27133
27134 impl<'de> Program<'de> {
27135 pub fn runner(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27136 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
27137 }
27138
27139 pub fn info(
27140 &self,
27141 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>
27142 {
27143 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
27144 }
27145 }
27146
27147 impl<'de> ::core::fmt::Debug for Program<'de> {
27148 fn fmt(
27149 &self,
27150 f: &mut ::core::fmt::Formatter<'_>,
27151 ) -> ::core::result::Result<(), ::core::fmt::Error> {
27152 f.debug_struct("Program")
27153 .field("runner", &self.runner())
27154 .field("info", &self.info())
27155 .finish()
27156 }
27157 }
27158
27159 impl<'de> ::fidl_next::IntoNatural for Program<'de> {
27160 type Natural = crate::natural::Program;
27161 }
27162
27163 #[repr(C)]
27165 pub struct DebugInfo<'de> {
27166 pub(crate) table: ::fidl_next::wire::Table<'de>,
27167 }
27168
27169 impl<'de> Drop for DebugInfo<'de> {
27170 fn drop(&mut self) {
27171 let _ = self.table.get(1)
27172 .map(|envelope| unsafe {
27173 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
27174 });
27175 }
27176 }
27177
27178 impl ::fidl_next::Constrained for DebugInfo<'_> {
27179 type Constraint = ();
27180
27181 fn validate(
27182 _: ::fidl_next::Slot<'_, Self>,
27183 _: Self::Constraint,
27184 ) -> Result<(), ::fidl_next::ValidationError> {
27185 Ok(())
27186 }
27187 }
27188
27189 unsafe impl ::fidl_next::Wire for DebugInfo<'static> {
27190 type Narrowed<'de> = DebugInfo<'de>;
27191
27192 #[inline]
27193 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27194 ::fidl_next::munge!(let Self { table } = out);
27195 ::fidl_next::wire::Table::zero_padding(table);
27196 }
27197 }
27198
27199 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DebugInfo<'de>
27200 where
27201 ___D: ::fidl_next::Decoder<'de> + ?Sized,
27202 {
27203 fn decode(
27204 slot: ::fidl_next::Slot<'_, Self>,
27205 decoder: &mut ___D,
27206 _: (),
27207 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27208 ::fidl_next::munge!(let Self { table } = slot);
27209
27210 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
27211 match ordinal {
27212 0 => unsafe { ::core::hint::unreachable_unchecked() },
27213
27214 1 => {
27215 ::fidl_next::wire::Envelope::decode_as::<
27216 ___D,
27217 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>,
27218 >(slot.as_mut(), decoder, (4294967295, 4294967295))?;
27219
27220 Ok(())
27221 }
27222
27223 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
27224 }
27225 })
27226 }
27227 }
27228
27229 impl<'de> DebugInfo<'de> {
27230 pub fn manifest_sources(
27231 &self,
27232 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>
27233 {
27234 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
27235 }
27236 }
27237
27238 impl<'de> ::core::fmt::Debug for DebugInfo<'de> {
27239 fn fmt(
27240 &self,
27241 f: &mut ::core::fmt::Formatter<'_>,
27242 ) -> ::core::result::Result<(), ::core::fmt::Error> {
27243 f.debug_struct("DebugInfo").field("manifest_sources", &self.manifest_sources()).finish()
27244 }
27245 }
27246
27247 impl<'de> ::fidl_next::IntoNatural for DebugInfo<'de> {
27248 type Natural = crate::natural::DebugInfo;
27249 }
27250
27251 #[repr(C)]
27253 pub struct UseService<'de> {
27254 pub(crate) table: ::fidl_next::wire::Table<'de>,
27255 }
27256
27257 impl<'de> Drop for UseService<'de> {
27258 fn drop(&mut self) {
27259 let _ = self
27260 .table
27261 .get(1)
27262 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
27263
27264 let _ = self.table.get(2).map(|envelope| unsafe {
27265 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27266 });
27267
27268 let _ = self.table.get(3).map(|envelope| unsafe {
27269 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27270 });
27271
27272 let _ = self.table.get(4).map(|envelope| unsafe {
27273 envelope.read_unchecked::<crate::wire::DependencyType>()
27274 });
27275
27276 let _ = self
27277 .table
27278 .get(5)
27279 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
27280
27281 let _ = self.table.get(6).map(|envelope| unsafe {
27282 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27283 });
27284 }
27285 }
27286
27287 impl ::fidl_next::Constrained for UseService<'_> {
27288 type Constraint = ();
27289
27290 fn validate(
27291 _: ::fidl_next::Slot<'_, Self>,
27292 _: Self::Constraint,
27293 ) -> Result<(), ::fidl_next::ValidationError> {
27294 Ok(())
27295 }
27296 }
27297
27298 unsafe impl ::fidl_next::Wire for UseService<'static> {
27299 type Narrowed<'de> = UseService<'de>;
27300
27301 #[inline]
27302 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27303 ::fidl_next::munge!(let Self { table } = out);
27304 ::fidl_next::wire::Table::zero_padding(table);
27305 }
27306 }
27307
27308 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for UseService<'de>
27309 where
27310 ___D: ::fidl_next::Decoder<'de> + ?Sized,
27311 {
27312 fn decode(
27313 slot: ::fidl_next::Slot<'_, Self>,
27314 decoder: &mut ___D,
27315 _: (),
27316 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27317 ::fidl_next::munge!(let Self { table } = slot);
27318
27319 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
27320 match ordinal {
27321 0 => unsafe { ::core::hint::unreachable_unchecked() },
27322
27323 1 => {
27324 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
27325 slot.as_mut(),
27326 decoder,
27327 (),
27328 )?;
27329
27330 Ok(())
27331 }
27332
27333 2 => {
27334 ::fidl_next::wire::Envelope::decode_as::<
27335 ___D,
27336 ::fidl_next::wire::String<'de>,
27337 >(slot.as_mut(), decoder, 100)?;
27338
27339 let value = unsafe {
27340 slot.deref_unchecked()
27341 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27342 };
27343
27344 if value.len() > 100 {
27345 return Err(::fidl_next::DecodeError::VectorTooLong {
27346 size: value.len() as u64,
27347 limit: 100,
27348 });
27349 }
27350
27351 Ok(())
27352 }
27353
27354 3 => {
27355 ::fidl_next::wire::Envelope::decode_as::<
27356 ___D,
27357 ::fidl_next::wire::String<'de>,
27358 >(slot.as_mut(), decoder, 1024)?;
27359
27360 let value = unsafe {
27361 slot.deref_unchecked()
27362 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27363 };
27364
27365 if value.len() > 1024 {
27366 return Err(::fidl_next::DecodeError::VectorTooLong {
27367 size: value.len() as u64,
27368 limit: 1024,
27369 });
27370 }
27371
27372 Ok(())
27373 }
27374
27375 4 => {
27376 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DependencyType>(
27377 slot.as_mut(),
27378 decoder,
27379 (),
27380 )?;
27381
27382 Ok(())
27383 }
27384
27385 5 => {
27386 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
27387 slot.as_mut(),
27388 decoder,
27389 (),
27390 )?;
27391
27392 Ok(())
27393 }
27394
27395 6 => {
27396 ::fidl_next::wire::Envelope::decode_as::<
27397 ___D,
27398 ::fidl_next::wire::String<'de>,
27399 >(slot.as_mut(), decoder, 1024)?;
27400
27401 let value = unsafe {
27402 slot.deref_unchecked()
27403 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27404 };
27405
27406 if value.len() > 1024 {
27407 return Err(::fidl_next::DecodeError::VectorTooLong {
27408 size: value.len() as u64,
27409 limit: 1024,
27410 });
27411 }
27412
27413 Ok(())
27414 }
27415
27416 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
27417 }
27418 })
27419 }
27420 }
27421
27422 impl<'de> UseService<'de> {
27423 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
27424 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
27425 }
27426
27427 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27428 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
27429 }
27430
27431 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27432 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
27433 }
27434
27435 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
27436 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
27437 }
27438
27439 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
27440 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
27441 }
27442
27443 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27444 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
27445 }
27446 }
27447
27448 impl<'de> ::core::fmt::Debug for UseService<'de> {
27449 fn fmt(
27450 &self,
27451 f: &mut ::core::fmt::Formatter<'_>,
27452 ) -> ::core::result::Result<(), ::core::fmt::Error> {
27453 f.debug_struct("UseService")
27454 .field("source", &self.source())
27455 .field("source_name", &self.source_name())
27456 .field("target_path", &self.target_path())
27457 .field("dependency_type", &self.dependency_type())
27458 .field("availability", &self.availability())
27459 .field("source_dictionary", &self.source_dictionary())
27460 .finish()
27461 }
27462 }
27463
27464 impl<'de> ::fidl_next::IntoNatural for UseService<'de> {
27465 type Natural = crate::natural::UseService;
27466 }
27467
27468 #[repr(C)]
27470 pub struct UseProtocol<'de> {
27471 pub(crate) table: ::fidl_next::wire::Table<'de>,
27472 }
27473
27474 impl<'de> Drop for UseProtocol<'de> {
27475 fn drop(&mut self) {
27476 let _ = self
27477 .table
27478 .get(1)
27479 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
27480
27481 let _ = self.table.get(2).map(|envelope| unsafe {
27482 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27483 });
27484
27485 let _ = self.table.get(3).map(|envelope| unsafe {
27486 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27487 });
27488
27489 let _ = self.table.get(4).map(|envelope| unsafe {
27490 envelope.read_unchecked::<crate::wire::DependencyType>()
27491 });
27492
27493 let _ = self
27494 .table
27495 .get(5)
27496 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
27497
27498 let _ = self.table.get(6).map(|envelope| unsafe {
27499 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27500 });
27501
27502 let _ = self.table.get(7).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
27503 }
27504 }
27505
27506 impl ::fidl_next::Constrained for UseProtocol<'_> {
27507 type Constraint = ();
27508
27509 fn validate(
27510 _: ::fidl_next::Slot<'_, Self>,
27511 _: Self::Constraint,
27512 ) -> Result<(), ::fidl_next::ValidationError> {
27513 Ok(())
27514 }
27515 }
27516
27517 unsafe impl ::fidl_next::Wire for UseProtocol<'static> {
27518 type Narrowed<'de> = UseProtocol<'de>;
27519
27520 #[inline]
27521 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27522 ::fidl_next::munge!(let Self { table } = out);
27523 ::fidl_next::wire::Table::zero_padding(table);
27524 }
27525 }
27526
27527 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for UseProtocol<'de>
27528 where
27529 ___D: ::fidl_next::Decoder<'de> + ?Sized,
27530 {
27531 fn decode(
27532 slot: ::fidl_next::Slot<'_, Self>,
27533 decoder: &mut ___D,
27534 _: (),
27535 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27536 ::fidl_next::munge!(let Self { table } = slot);
27537
27538 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
27539 match ordinal {
27540 0 => unsafe { ::core::hint::unreachable_unchecked() },
27541
27542 1 => {
27543 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
27544 slot.as_mut(),
27545 decoder,
27546 (),
27547 )?;
27548
27549 Ok(())
27550 }
27551
27552 2 => {
27553 ::fidl_next::wire::Envelope::decode_as::<
27554 ___D,
27555 ::fidl_next::wire::String<'de>,
27556 >(slot.as_mut(), decoder, 100)?;
27557
27558 let value = unsafe {
27559 slot.deref_unchecked()
27560 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27561 };
27562
27563 if value.len() > 100 {
27564 return Err(::fidl_next::DecodeError::VectorTooLong {
27565 size: value.len() as u64,
27566 limit: 100,
27567 });
27568 }
27569
27570 Ok(())
27571 }
27572
27573 3 => {
27574 ::fidl_next::wire::Envelope::decode_as::<
27575 ___D,
27576 ::fidl_next::wire::String<'de>,
27577 >(slot.as_mut(), decoder, 1024)?;
27578
27579 let value = unsafe {
27580 slot.deref_unchecked()
27581 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27582 };
27583
27584 if value.len() > 1024 {
27585 return Err(::fidl_next::DecodeError::VectorTooLong {
27586 size: value.len() as u64,
27587 limit: 1024,
27588 });
27589 }
27590
27591 Ok(())
27592 }
27593
27594 4 => {
27595 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DependencyType>(
27596 slot.as_mut(),
27597 decoder,
27598 (),
27599 )?;
27600
27601 Ok(())
27602 }
27603
27604 5 => {
27605 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
27606 slot.as_mut(),
27607 decoder,
27608 (),
27609 )?;
27610
27611 Ok(())
27612 }
27613
27614 6 => {
27615 ::fidl_next::wire::Envelope::decode_as::<
27616 ___D,
27617 ::fidl_next::wire::String<'de>,
27618 >(slot.as_mut(), decoder, 1024)?;
27619
27620 let value = unsafe {
27621 slot.deref_unchecked()
27622 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27623 };
27624
27625 if value.len() > 1024 {
27626 return Err(::fidl_next::DecodeError::VectorTooLong {
27627 size: value.len() as u64,
27628 limit: 1024,
27629 });
27630 }
27631
27632 Ok(())
27633 }
27634
27635 7 => {
27636 ::fidl_next::wire::Envelope::decode_as::<___D, u8>(
27637 slot.as_mut(),
27638 decoder,
27639 (),
27640 )?;
27641
27642 Ok(())
27643 }
27644
27645 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
27646 }
27647 })
27648 }
27649 }
27650
27651 impl<'de> UseProtocol<'de> {
27652 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
27653 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
27654 }
27655
27656 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27657 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
27658 }
27659
27660 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27661 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
27662 }
27663
27664 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
27665 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
27666 }
27667
27668 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
27669 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
27670 }
27671
27672 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27673 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
27674 }
27675
27676 pub fn numbered_handle(&self) -> ::core::option::Option<&u8> {
27677 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
27678 }
27679 }
27680
27681 impl<'de> ::core::fmt::Debug for UseProtocol<'de> {
27682 fn fmt(
27683 &self,
27684 f: &mut ::core::fmt::Formatter<'_>,
27685 ) -> ::core::result::Result<(), ::core::fmt::Error> {
27686 f.debug_struct("UseProtocol")
27687 .field("source", &self.source())
27688 .field("source_name", &self.source_name())
27689 .field("target_path", &self.target_path())
27690 .field("dependency_type", &self.dependency_type())
27691 .field("availability", &self.availability())
27692 .field("source_dictionary", &self.source_dictionary())
27693 .field("numbered_handle", &self.numbered_handle())
27694 .finish()
27695 }
27696 }
27697
27698 impl<'de> ::fidl_next::IntoNatural for UseProtocol<'de> {
27699 type Natural = crate::natural::UseProtocol;
27700 }
27701
27702 #[repr(C)]
27704 pub struct UseDirectory<'de> {
27705 pub(crate) table: ::fidl_next::wire::Table<'de>,
27706 }
27707
27708 impl<'de> Drop for UseDirectory<'de> {
27709 fn drop(&mut self) {
27710 let _ = self
27711 .table
27712 .get(1)
27713 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
27714
27715 let _ = self.table.get(2).map(|envelope| unsafe {
27716 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27717 });
27718
27719 let _ = self.table.get(3).map(|envelope| unsafe {
27720 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27721 });
27722
27723 let _ = self.table.get(4).map(|envelope| unsafe {
27724 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
27725 });
27726
27727 let _ = self.table.get(5).map(|envelope| unsafe {
27728 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27729 });
27730
27731 let _ = self.table.get(6).map(|envelope| unsafe {
27732 envelope.read_unchecked::<crate::wire::DependencyType>()
27733 });
27734
27735 let _ = self
27736 .table
27737 .get(7)
27738 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
27739
27740 let _ = self.table.get(8).map(|envelope| unsafe {
27741 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27742 });
27743 }
27744 }
27745
27746 impl ::fidl_next::Constrained for UseDirectory<'_> {
27747 type Constraint = ();
27748
27749 fn validate(
27750 _: ::fidl_next::Slot<'_, Self>,
27751 _: Self::Constraint,
27752 ) -> Result<(), ::fidl_next::ValidationError> {
27753 Ok(())
27754 }
27755 }
27756
27757 unsafe impl ::fidl_next::Wire for UseDirectory<'static> {
27758 type Narrowed<'de> = UseDirectory<'de>;
27759
27760 #[inline]
27761 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27762 ::fidl_next::munge!(let Self { table } = out);
27763 ::fidl_next::wire::Table::zero_padding(table);
27764 }
27765 }
27766
27767 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for UseDirectory<'de>
27768 where
27769 ___D: ::fidl_next::Decoder<'de> + ?Sized,
27770 {
27771 fn decode(
27772 slot: ::fidl_next::Slot<'_, Self>,
27773 decoder: &mut ___D,
27774 _: (),
27775 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27776 ::fidl_next::munge!(let Self { table } = slot);
27777
27778 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
27779 match ordinal {
27780 0 => unsafe { ::core::hint::unreachable_unchecked() },
27781
27782 1 => {
27783 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
27784 slot.as_mut(),
27785 decoder,
27786 (),
27787 )?;
27788
27789 Ok(())
27790 }
27791
27792 2 => {
27793 ::fidl_next::wire::Envelope::decode_as::<
27794 ___D,
27795 ::fidl_next::wire::String<'de>,
27796 >(slot.as_mut(), decoder, 100)?;
27797
27798 let value = unsafe {
27799 slot.deref_unchecked()
27800 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27801 };
27802
27803 if value.len() > 100 {
27804 return Err(::fidl_next::DecodeError::VectorTooLong {
27805 size: value.len() as u64,
27806 limit: 100,
27807 });
27808 }
27809
27810 Ok(())
27811 }
27812
27813 3 => {
27814 ::fidl_next::wire::Envelope::decode_as::<
27815 ___D,
27816 ::fidl_next::wire::String<'de>,
27817 >(slot.as_mut(), decoder, 1024)?;
27818
27819 let value = unsafe {
27820 slot.deref_unchecked()
27821 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27822 };
27823
27824 if value.len() > 1024 {
27825 return Err(::fidl_next::DecodeError::VectorTooLong {
27826 size: value.len() as u64,
27827 limit: 1024,
27828 });
27829 }
27830
27831 Ok(())
27832 }
27833
27834 4 => {
27835 ::fidl_next::wire::Envelope::decode_as::<
27836 ___D,
27837 ::fidl_next_common_fuchsia_io::wire::Operations,
27838 >(slot.as_mut(), decoder, ())?;
27839
27840 Ok(())
27841 }
27842
27843 5 => {
27844 ::fidl_next::wire::Envelope::decode_as::<
27845 ___D,
27846 ::fidl_next::wire::String<'de>,
27847 >(slot.as_mut(), decoder, 1024)?;
27848
27849 let value = unsafe {
27850 slot.deref_unchecked()
27851 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27852 };
27853
27854 if value.len() > 1024 {
27855 return Err(::fidl_next::DecodeError::VectorTooLong {
27856 size: value.len() as u64,
27857 limit: 1024,
27858 });
27859 }
27860
27861 Ok(())
27862 }
27863
27864 6 => {
27865 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DependencyType>(
27866 slot.as_mut(),
27867 decoder,
27868 (),
27869 )?;
27870
27871 Ok(())
27872 }
27873
27874 7 => {
27875 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
27876 slot.as_mut(),
27877 decoder,
27878 (),
27879 )?;
27880
27881 Ok(())
27882 }
27883
27884 8 => {
27885 ::fidl_next::wire::Envelope::decode_as::<
27886 ___D,
27887 ::fidl_next::wire::String<'de>,
27888 >(slot.as_mut(), decoder, 1024)?;
27889
27890 let value = unsafe {
27891 slot.deref_unchecked()
27892 .deref_unchecked::<::fidl_next::wire::String<'_>>()
27893 };
27894
27895 if value.len() > 1024 {
27896 return Err(::fidl_next::DecodeError::VectorTooLong {
27897 size: value.len() as u64,
27898 limit: 1024,
27899 });
27900 }
27901
27902 Ok(())
27903 }
27904
27905 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
27906 }
27907 })
27908 }
27909 }
27910
27911 impl<'de> UseDirectory<'de> {
27912 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
27913 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
27914 }
27915
27916 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27917 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
27918 }
27919
27920 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27921 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
27922 }
27923
27924 pub fn rights(
27925 &self,
27926 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_io::wire::Operations> {
27927 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
27928 }
27929
27930 pub fn subdir(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27931 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
27932 }
27933
27934 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
27935 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
27936 }
27937
27938 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
27939 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
27940 }
27941
27942 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
27943 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
27944 }
27945 }
27946
27947 impl<'de> ::core::fmt::Debug for UseDirectory<'de> {
27948 fn fmt(
27949 &self,
27950 f: &mut ::core::fmt::Formatter<'_>,
27951 ) -> ::core::result::Result<(), ::core::fmt::Error> {
27952 f.debug_struct("UseDirectory")
27953 .field("source", &self.source())
27954 .field("source_name", &self.source_name())
27955 .field("target_path", &self.target_path())
27956 .field("rights", &self.rights())
27957 .field("subdir", &self.subdir())
27958 .field("dependency_type", &self.dependency_type())
27959 .field("availability", &self.availability())
27960 .field("source_dictionary", &self.source_dictionary())
27961 .finish()
27962 }
27963 }
27964
27965 impl<'de> ::fidl_next::IntoNatural for UseDirectory<'de> {
27966 type Natural = crate::natural::UseDirectory;
27967 }
27968
27969 #[repr(C)]
27971 pub struct UseEventStream<'de> {
27972 pub(crate) table: ::fidl_next::wire::Table<'de>,
27973 }
27974
27975 impl<'de> Drop for UseEventStream<'de> {
27976 fn drop(&mut self) {
27977 let _ = self.table.get(1).map(|envelope| unsafe {
27978 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27979 });
27980
27981 let _ = self
27982 .table
27983 .get(2)
27984 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
27985
27986 let _ = self.table.get(3).map(|envelope| unsafe {
27987 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>>()
27988 });
27989
27990 let _ = self.table.get(4).map(|envelope| unsafe {
27991 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
27992 });
27993
27994 let _ = self
27995 .table
27996 .get(5)
27997 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
27998
27999 let _ = self.table.get(6).map(|envelope| unsafe {
28000 envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>()
28001 });
28002 }
28003 }
28004
28005 impl ::fidl_next::Constrained for UseEventStream<'_> {
28006 type Constraint = ();
28007
28008 fn validate(
28009 _: ::fidl_next::Slot<'_, Self>,
28010 _: Self::Constraint,
28011 ) -> Result<(), ::fidl_next::ValidationError> {
28012 Ok(())
28013 }
28014 }
28015
28016 unsafe impl ::fidl_next::Wire for UseEventStream<'static> {
28017 type Narrowed<'de> = UseEventStream<'de>;
28018
28019 #[inline]
28020 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28021 ::fidl_next::munge!(let Self { table } = out);
28022 ::fidl_next::wire::Table::zero_padding(table);
28023 }
28024 }
28025
28026 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for UseEventStream<'de>
28027 where
28028 ___D: ::fidl_next::Decoder<'de> + ?Sized,
28029 {
28030 fn decode(
28031 slot: ::fidl_next::Slot<'_, Self>,
28032 decoder: &mut ___D,
28033 _: (),
28034 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28035 ::fidl_next::munge!(let Self { table } = slot);
28036
28037 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
28038 match ordinal {
28039 0 => unsafe { ::core::hint::unreachable_unchecked() },
28040
28041 1 => {
28042 ::fidl_next::wire::Envelope::decode_as::<
28043 ___D,
28044 ::fidl_next::wire::String<'de>,
28045 >(slot.as_mut(), decoder, 100)?;
28046
28047 let value = unsafe {
28048 slot.deref_unchecked()
28049 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28050 };
28051
28052 if value.len() > 100 {
28053 return Err(::fidl_next::DecodeError::VectorTooLong {
28054 size: value.len() as u64,
28055 limit: 100,
28056 });
28057 }
28058
28059 Ok(())
28060 }
28061
28062 2 => {
28063 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
28064 slot.as_mut(),
28065 decoder,
28066 (),
28067 )?;
28068
28069 Ok(())
28070 }
28071
28072 3 => {
28073 ::fidl_next::wire::Envelope::decode_as::<
28074 ___D,
28075 ::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>,
28076 >(slot.as_mut(), decoder, (4294967295, ()))?;
28077
28078 Ok(())
28079 }
28080
28081 4 => {
28082 ::fidl_next::wire::Envelope::decode_as::<
28083 ___D,
28084 ::fidl_next::wire::String<'de>,
28085 >(slot.as_mut(), decoder, 100)?;
28086
28087 let value = unsafe {
28088 slot.deref_unchecked()
28089 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28090 };
28091
28092 if value.len() > 100 {
28093 return Err(::fidl_next::DecodeError::VectorTooLong {
28094 size: value.len() as u64,
28095 limit: 100,
28096 });
28097 }
28098
28099 Ok(())
28100 }
28101
28102 5 => {
28103 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
28104 slot.as_mut(),
28105 decoder,
28106 (),
28107 )?;
28108
28109 Ok(())
28110 }
28111
28112 6 => {
28113 ::fidl_next::wire::Envelope::decode_as::<
28114 ___D,
28115 ::fidl_next_common_fuchsia_data::wire::Dictionary<'de>,
28116 >(slot.as_mut(), decoder, ())?;
28117
28118 Ok(())
28119 }
28120
28121 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
28122 }
28123 })
28124 }
28125 }
28126
28127 impl<'de> UseEventStream<'de> {
28128 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28129 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
28130 }
28131
28132 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28133 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
28134 }
28135
28136 pub fn scope(
28137 &self,
28138 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>>
28139 {
28140 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
28141 }
28142
28143 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28144 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
28145 }
28146
28147 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
28148 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
28149 }
28150
28151 pub fn filter(
28152 &self,
28153 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>
28154 {
28155 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
28156 }
28157 }
28158
28159 impl<'de> ::core::fmt::Debug for UseEventStream<'de> {
28160 fn fmt(
28161 &self,
28162 f: &mut ::core::fmt::Formatter<'_>,
28163 ) -> ::core::result::Result<(), ::core::fmt::Error> {
28164 f.debug_struct("UseEventStream")
28165 .field("source_name", &self.source_name())
28166 .field("source", &self.source())
28167 .field("scope", &self.scope())
28168 .field("target_path", &self.target_path())
28169 .field("availability", &self.availability())
28170 .field("filter", &self.filter())
28171 .finish()
28172 }
28173 }
28174
28175 impl<'de> ::fidl_next::IntoNatural for UseEventStream<'de> {
28176 type Natural = crate::natural::UseEventStream;
28177 }
28178
28179 #[repr(C)]
28181 pub struct UseRunner<'de> {
28182 pub(crate) table: ::fidl_next::wire::Table<'de>,
28183 }
28184
28185 impl<'de> Drop for UseRunner<'de> {
28186 fn drop(&mut self) {
28187 let _ = self
28188 .table
28189 .get(1)
28190 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28191
28192 let _ = self.table.get(2).map(|envelope| unsafe {
28193 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28194 });
28195
28196 let _ = self.table.get(3).map(|envelope| unsafe {
28197 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28198 });
28199 }
28200 }
28201
28202 impl ::fidl_next::Constrained for UseRunner<'_> {
28203 type Constraint = ();
28204
28205 fn validate(
28206 _: ::fidl_next::Slot<'_, Self>,
28207 _: Self::Constraint,
28208 ) -> Result<(), ::fidl_next::ValidationError> {
28209 Ok(())
28210 }
28211 }
28212
28213 unsafe impl ::fidl_next::Wire for UseRunner<'static> {
28214 type Narrowed<'de> = UseRunner<'de>;
28215
28216 #[inline]
28217 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28218 ::fidl_next::munge!(let Self { table } = out);
28219 ::fidl_next::wire::Table::zero_padding(table);
28220 }
28221 }
28222
28223 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for UseRunner<'de>
28224 where
28225 ___D: ::fidl_next::Decoder<'de> + ?Sized,
28226 {
28227 fn decode(
28228 slot: ::fidl_next::Slot<'_, Self>,
28229 decoder: &mut ___D,
28230 _: (),
28231 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28232 ::fidl_next::munge!(let Self { table } = slot);
28233
28234 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
28235 match ordinal {
28236 0 => unsafe { ::core::hint::unreachable_unchecked() },
28237
28238 1 => {
28239 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
28240 slot.as_mut(),
28241 decoder,
28242 (),
28243 )?;
28244
28245 Ok(())
28246 }
28247
28248 2 => {
28249 ::fidl_next::wire::Envelope::decode_as::<
28250 ___D,
28251 ::fidl_next::wire::String<'de>,
28252 >(slot.as_mut(), decoder, 100)?;
28253
28254 let value = unsafe {
28255 slot.deref_unchecked()
28256 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28257 };
28258
28259 if value.len() > 100 {
28260 return Err(::fidl_next::DecodeError::VectorTooLong {
28261 size: value.len() as u64,
28262 limit: 100,
28263 });
28264 }
28265
28266 Ok(())
28267 }
28268
28269 3 => {
28270 ::fidl_next::wire::Envelope::decode_as::<
28271 ___D,
28272 ::fidl_next::wire::String<'de>,
28273 >(slot.as_mut(), decoder, 1024)?;
28274
28275 let value = unsafe {
28276 slot.deref_unchecked()
28277 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28278 };
28279
28280 if value.len() > 1024 {
28281 return Err(::fidl_next::DecodeError::VectorTooLong {
28282 size: value.len() as u64,
28283 limit: 1024,
28284 });
28285 }
28286
28287 Ok(())
28288 }
28289
28290 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
28291 }
28292 })
28293 }
28294 }
28295
28296 impl<'de> UseRunner<'de> {
28297 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28298 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
28299 }
28300
28301 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28302 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
28303 }
28304
28305 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28306 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
28307 }
28308 }
28309
28310 impl<'de> ::core::fmt::Debug for UseRunner<'de> {
28311 fn fmt(
28312 &self,
28313 f: &mut ::core::fmt::Formatter<'_>,
28314 ) -> ::core::result::Result<(), ::core::fmt::Error> {
28315 f.debug_struct("UseRunner")
28316 .field("source", &self.source())
28317 .field("source_name", &self.source_name())
28318 .field("source_dictionary", &self.source_dictionary())
28319 .finish()
28320 }
28321 }
28322
28323 impl<'de> ::fidl_next::IntoNatural for UseRunner<'de> {
28324 type Natural = crate::natural::UseRunner;
28325 }
28326
28327 #[repr(C)]
28329 pub struct UseConfiguration<'de> {
28330 pub(crate) table: ::fidl_next::wire::Table<'de>,
28331 }
28332
28333 impl<'de> Drop for UseConfiguration<'de> {
28334 fn drop(&mut self) {
28335 let _ = self
28336 .table
28337 .get(1)
28338 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28339
28340 let _ = self.table.get(2).map(|envelope| unsafe {
28341 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28342 });
28343
28344 let _ = self.table.get(3).map(|envelope| unsafe {
28345 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28346 });
28347
28348 let _ = self
28349 .table
28350 .get(4)
28351 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
28352
28353 let _ = self.table.get(5).map(|envelope| unsafe {
28354 envelope.read_unchecked::<crate::wire::ConfigType<'de>>()
28355 });
28356
28357 let _ = self.table.get(6).map(|envelope| unsafe {
28358 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
28359 });
28360
28361 let _ = self.table.get(7).map(|envelope| unsafe {
28362 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28363 });
28364 }
28365 }
28366
28367 impl ::fidl_next::Constrained for UseConfiguration<'_> {
28368 type Constraint = ();
28369
28370 fn validate(
28371 _: ::fidl_next::Slot<'_, Self>,
28372 _: Self::Constraint,
28373 ) -> Result<(), ::fidl_next::ValidationError> {
28374 Ok(())
28375 }
28376 }
28377
28378 unsafe impl ::fidl_next::Wire for UseConfiguration<'static> {
28379 type Narrowed<'de> = UseConfiguration<'de>;
28380
28381 #[inline]
28382 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28383 ::fidl_next::munge!(let Self { table } = out);
28384 ::fidl_next::wire::Table::zero_padding(table);
28385 }
28386 }
28387
28388 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for UseConfiguration<'de>
28389 where
28390 ___D: ::fidl_next::Decoder<'de> + ?Sized,
28391 {
28392 fn decode(
28393 slot: ::fidl_next::Slot<'_, Self>,
28394 decoder: &mut ___D,
28395 _: (),
28396 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28397 ::fidl_next::munge!(let Self { table } = slot);
28398
28399 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
28400 match ordinal {
28401 0 => unsafe { ::core::hint::unreachable_unchecked() },
28402
28403 1 => {
28404 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
28405 slot.as_mut(),
28406 decoder,
28407 (),
28408 )?;
28409
28410 Ok(())
28411 }
28412
28413 2 => {
28414 ::fidl_next::wire::Envelope::decode_as::<
28415 ___D,
28416 ::fidl_next::wire::String<'de>,
28417 >(slot.as_mut(), decoder, 100)?;
28418
28419 let value = unsafe {
28420 slot.deref_unchecked()
28421 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28422 };
28423
28424 if value.len() > 100 {
28425 return Err(::fidl_next::DecodeError::VectorTooLong {
28426 size: value.len() as u64,
28427 limit: 100,
28428 });
28429 }
28430
28431 Ok(())
28432 }
28433
28434 3 => {
28435 ::fidl_next::wire::Envelope::decode_as::<
28436 ___D,
28437 ::fidl_next::wire::String<'de>,
28438 >(slot.as_mut(), decoder, 100)?;
28439
28440 let value = unsafe {
28441 slot.deref_unchecked()
28442 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28443 };
28444
28445 if value.len() > 100 {
28446 return Err(::fidl_next::DecodeError::VectorTooLong {
28447 size: value.len() as u64,
28448 limit: 100,
28449 });
28450 }
28451
28452 Ok(())
28453 }
28454
28455 4 => {
28456 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
28457 slot.as_mut(),
28458 decoder,
28459 (),
28460 )?;
28461
28462 Ok(())
28463 }
28464
28465 5 => {
28466 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::ConfigType<'de>>(
28467 slot.as_mut(),
28468 decoder,
28469 (),
28470 )?;
28471
28472 Ok(())
28473 }
28474
28475 6 => {
28476 ::fidl_next::wire::Envelope::decode_as::<
28477 ___D,
28478 crate::wire::ConfigValue<'de>,
28479 >(slot.as_mut(), decoder, ())?;
28480
28481 Ok(())
28482 }
28483
28484 7 => {
28485 ::fidl_next::wire::Envelope::decode_as::<
28486 ___D,
28487 ::fidl_next::wire::String<'de>,
28488 >(slot.as_mut(), decoder, 1024)?;
28489
28490 let value = unsafe {
28491 slot.deref_unchecked()
28492 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28493 };
28494
28495 if value.len() > 1024 {
28496 return Err(::fidl_next::DecodeError::VectorTooLong {
28497 size: value.len() as u64,
28498 limit: 1024,
28499 });
28500 }
28501
28502 Ok(())
28503 }
28504
28505 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
28506 }
28507 })
28508 }
28509 }
28510
28511 impl<'de> UseConfiguration<'de> {
28512 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28513 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
28514 }
28515
28516 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28517 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
28518 }
28519
28520 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28521 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
28522 }
28523
28524 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
28525 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
28526 }
28527
28528 pub fn type_(&self) -> ::core::option::Option<&crate::wire::ConfigType<'de>> {
28529 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
28530 }
28531
28532 pub fn default(&self) -> ::core::option::Option<&crate::wire::ConfigValue<'de>> {
28533 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
28534 }
28535
28536 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28537 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
28538 }
28539 }
28540
28541 impl<'de> ::core::fmt::Debug for UseConfiguration<'de> {
28542 fn fmt(
28543 &self,
28544 f: &mut ::core::fmt::Formatter<'_>,
28545 ) -> ::core::result::Result<(), ::core::fmt::Error> {
28546 f.debug_struct("UseConfiguration")
28547 .field("source", &self.source())
28548 .field("source_name", &self.source_name())
28549 .field("target_name", &self.target_name())
28550 .field("availability", &self.availability())
28551 .field("type_", &self.type_())
28552 .field("default", &self.default())
28553 .field("source_dictionary", &self.source_dictionary())
28554 .finish()
28555 }
28556 }
28557
28558 impl<'de> ::fidl_next::IntoNatural for UseConfiguration<'de> {
28559 type Natural = crate::natural::UseConfiguration;
28560 }
28561
28562 #[repr(C)]
28564 pub struct UseDictionary<'de> {
28565 pub(crate) table: ::fidl_next::wire::Table<'de>,
28566 }
28567
28568 impl<'de> Drop for UseDictionary<'de> {
28569 fn drop(&mut self) {
28570 let _ = self
28571 .table
28572 .get(1)
28573 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28574
28575 let _ = self.table.get(2).map(|envelope| unsafe {
28576 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28577 });
28578
28579 let _ = self.table.get(3).map(|envelope| unsafe {
28580 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28581 });
28582
28583 let _ = self.table.get(6).map(|envelope| unsafe {
28584 envelope.read_unchecked::<crate::wire::DependencyType>()
28585 });
28586
28587 let _ = self
28588 .table
28589 .get(7)
28590 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
28591
28592 let _ = self.table.get(8).map(|envelope| unsafe {
28593 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
28594 });
28595 }
28596 }
28597
28598 impl ::fidl_next::Constrained for UseDictionary<'_> {
28599 type Constraint = ();
28600
28601 fn validate(
28602 _: ::fidl_next::Slot<'_, Self>,
28603 _: Self::Constraint,
28604 ) -> Result<(), ::fidl_next::ValidationError> {
28605 Ok(())
28606 }
28607 }
28608
28609 unsafe impl ::fidl_next::Wire for UseDictionary<'static> {
28610 type Narrowed<'de> = UseDictionary<'de>;
28611
28612 #[inline]
28613 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28614 ::fidl_next::munge!(let Self { table } = out);
28615 ::fidl_next::wire::Table::zero_padding(table);
28616 }
28617 }
28618
28619 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for UseDictionary<'de>
28620 where
28621 ___D: ::fidl_next::Decoder<'de> + ?Sized,
28622 {
28623 fn decode(
28624 slot: ::fidl_next::Slot<'_, Self>,
28625 decoder: &mut ___D,
28626 _: (),
28627 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28628 ::fidl_next::munge!(let Self { table } = slot);
28629
28630 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
28631 match ordinal {
28632 0 => unsafe { ::core::hint::unreachable_unchecked() },
28633
28634 1 => {
28635 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
28636 slot.as_mut(),
28637 decoder,
28638 (),
28639 )?;
28640
28641 Ok(())
28642 }
28643
28644 2 => {
28645 ::fidl_next::wire::Envelope::decode_as::<
28646 ___D,
28647 ::fidl_next::wire::String<'de>,
28648 >(slot.as_mut(), decoder, 100)?;
28649
28650 let value = unsafe {
28651 slot.deref_unchecked()
28652 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28653 };
28654
28655 if value.len() > 100 {
28656 return Err(::fidl_next::DecodeError::VectorTooLong {
28657 size: value.len() as u64,
28658 limit: 100,
28659 });
28660 }
28661
28662 Ok(())
28663 }
28664
28665 3 => {
28666 ::fidl_next::wire::Envelope::decode_as::<
28667 ___D,
28668 ::fidl_next::wire::String<'de>,
28669 >(slot.as_mut(), decoder, 1024)?;
28670
28671 let value = unsafe {
28672 slot.deref_unchecked()
28673 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28674 };
28675
28676 if value.len() > 1024 {
28677 return Err(::fidl_next::DecodeError::VectorTooLong {
28678 size: value.len() as u64,
28679 limit: 1024,
28680 });
28681 }
28682
28683 Ok(())
28684 }
28685
28686 6 => {
28687 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DependencyType>(
28688 slot.as_mut(),
28689 decoder,
28690 (),
28691 )?;
28692
28693 Ok(())
28694 }
28695
28696 7 => {
28697 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
28698 slot.as_mut(),
28699 decoder,
28700 (),
28701 )?;
28702
28703 Ok(())
28704 }
28705
28706 8 => {
28707 ::fidl_next::wire::Envelope::decode_as::<
28708 ___D,
28709 ::fidl_next::wire::String<'de>,
28710 >(slot.as_mut(), decoder, 1024)?;
28711
28712 let value = unsafe {
28713 slot.deref_unchecked()
28714 .deref_unchecked::<::fidl_next::wire::String<'_>>()
28715 };
28716
28717 if value.len() > 1024 {
28718 return Err(::fidl_next::DecodeError::VectorTooLong {
28719 size: value.len() as u64,
28720 limit: 1024,
28721 });
28722 }
28723
28724 Ok(())
28725 }
28726
28727 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
28728 }
28729 })
28730 }
28731 }
28732
28733 impl<'de> UseDictionary<'de> {
28734 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28735 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
28736 }
28737
28738 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28739 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
28740 }
28741
28742 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28743 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
28744 }
28745
28746 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
28747 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
28748 }
28749
28750 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
28751 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
28752 }
28753
28754 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
28755 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
28756 }
28757 }
28758
28759 impl<'de> ::core::fmt::Debug for UseDictionary<'de> {
28760 fn fmt(
28761 &self,
28762 f: &mut ::core::fmt::Formatter<'_>,
28763 ) -> ::core::result::Result<(), ::core::fmt::Error> {
28764 f.debug_struct("UseDictionary")
28765 .field("source", &self.source())
28766 .field("source_name", &self.source_name())
28767 .field("target_path", &self.target_path())
28768 .field("dependency_type", &self.dependency_type())
28769 .field("availability", &self.availability())
28770 .field("source_dictionary", &self.source_dictionary())
28771 .finish()
28772 }
28773 }
28774
28775 impl<'de> ::fidl_next::IntoNatural for UseDictionary<'de> {
28776 type Natural = crate::natural::UseDictionary;
28777 }
28778
28779 #[repr(transparent)]
28781 pub struct Use<'de> {
28782 pub(crate) raw: ::fidl_next::wire::Union,
28783 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
28784 }
28785
28786 impl<'de> Drop for Use<'de> {
28787 fn drop(&mut self) {
28788 match self.raw.ordinal() {
28789 1 => {
28790 let _ =
28791 unsafe { self.raw.get().read_unchecked::<crate::wire::UseService<'de>>() };
28792 }
28793
28794 2 => {
28795 let _ =
28796 unsafe { self.raw.get().read_unchecked::<crate::wire::UseProtocol<'de>>() };
28797 }
28798
28799 3 => {
28800 let _ = unsafe {
28801 self.raw.get().read_unchecked::<crate::wire::UseDirectory<'de>>()
28802 };
28803 }
28804
28805 4 => {
28806 let _ =
28807 unsafe { self.raw.get().read_unchecked::<crate::wire::UseStorage<'de>>() };
28808 }
28809
28810 7 => {
28811 let _ = unsafe {
28812 self.raw.get().read_unchecked::<crate::wire::UseEventStream<'de>>()
28813 };
28814 }
28815
28816 8 => {
28817 let _ =
28818 unsafe { self.raw.get().read_unchecked::<crate::wire::UseRunner<'de>>() };
28819 }
28820
28821 9 => {
28822 let _ = unsafe {
28823 self.raw.get().read_unchecked::<crate::wire::UseConfiguration<'de>>()
28824 };
28825 }
28826
28827 10 => {
28828 let _ = unsafe {
28829 self.raw.get().read_unchecked::<crate::wire::UseDictionary<'de>>()
28830 };
28831 }
28832
28833 _ => (),
28834 }
28835 }
28836 }
28837
28838 impl ::fidl_next::Constrained for Use<'_> {
28839 type Constraint = ();
28840
28841 fn validate(
28842 _: ::fidl_next::Slot<'_, Self>,
28843 _: Self::Constraint,
28844 ) -> Result<(), ::fidl_next::ValidationError> {
28845 Ok(())
28846 }
28847 }
28848
28849 unsafe impl ::fidl_next::Wire for Use<'static> {
28850 type Narrowed<'de> = Use<'de>;
28851
28852 #[inline]
28853 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28854 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
28855 ::fidl_next::wire::Union::zero_padding(raw);
28856 }
28857 }
28858
28859 pub mod use_ {
28860 pub enum Ref<'de> {
28861 Service(&'de crate::wire::UseService<'de>),
28862
28863 Protocol(&'de crate::wire::UseProtocol<'de>),
28864
28865 Directory(&'de crate::wire::UseDirectory<'de>),
28866
28867 Storage(&'de crate::wire::UseStorage<'de>),
28868
28869 EventStream(&'de crate::wire::UseEventStream<'de>),
28870
28871 Runner(&'de crate::wire::UseRunner<'de>),
28872
28873 Config(&'de crate::wire::UseConfiguration<'de>),
28874
28875 Dictionary(&'de crate::wire::UseDictionary<'de>),
28876
28877 UnknownOrdinal_(u64),
28878 }
28879 }
28880
28881 impl<'de> Use<'de> {
28882 pub fn as_ref(&self) -> crate::wire::use_::Ref<'_> {
28883 match self.raw.ordinal() {
28884 1 => crate::wire::use_::Ref::Service(unsafe {
28885 self.raw.get().deref_unchecked::<crate::wire::UseService<'_>>()
28886 }),
28887
28888 2 => crate::wire::use_::Ref::Protocol(unsafe {
28889 self.raw.get().deref_unchecked::<crate::wire::UseProtocol<'_>>()
28890 }),
28891
28892 3 => crate::wire::use_::Ref::Directory(unsafe {
28893 self.raw.get().deref_unchecked::<crate::wire::UseDirectory<'_>>()
28894 }),
28895
28896 4 => crate::wire::use_::Ref::Storage(unsafe {
28897 self.raw.get().deref_unchecked::<crate::wire::UseStorage<'_>>()
28898 }),
28899
28900 7 => crate::wire::use_::Ref::EventStream(unsafe {
28901 self.raw.get().deref_unchecked::<crate::wire::UseEventStream<'_>>()
28902 }),
28903
28904 8 => crate::wire::use_::Ref::Runner(unsafe {
28905 self.raw.get().deref_unchecked::<crate::wire::UseRunner<'_>>()
28906 }),
28907
28908 9 => crate::wire::use_::Ref::Config(unsafe {
28909 self.raw.get().deref_unchecked::<crate::wire::UseConfiguration<'_>>()
28910 }),
28911
28912 10 => crate::wire::use_::Ref::Dictionary(unsafe {
28913 self.raw.get().deref_unchecked::<crate::wire::UseDictionary<'_>>()
28914 }),
28915
28916 unknown => crate::wire::use_::Ref::UnknownOrdinal_(unknown),
28917 }
28918 }
28919 }
28920
28921 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Use<'de>
28922 where
28923 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
28924 ___D: ::fidl_next::Decoder<'de>,
28925 {
28926 fn decode(
28927 mut slot: ::fidl_next::Slot<'_, Self>,
28928 decoder: &mut ___D,
28929 _: (),
28930 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28931 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
28932 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
28933 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseService<'de>>(
28934 raw,
28935 decoder,
28936 (),
28937 )?,
28938
28939 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseProtocol<'de>>(
28940 raw,
28941 decoder,
28942 (),
28943 )?,
28944
28945 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseDirectory<'de>>(
28946 raw,
28947 decoder,
28948 (),
28949 )?,
28950
28951 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseStorage<'de>>(
28952 raw,
28953 decoder,
28954 (),
28955 )?,
28956
28957 7 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseEventStream<'de>>(
28958 raw,
28959 decoder,
28960 (),
28961 )?,
28962
28963 8 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseRunner<'de>>(
28964 raw,
28965 decoder,
28966 (),
28967 )?,
28968
28969 9 => {
28970 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseConfiguration<'de>>(
28971 raw,
28972 decoder,
28973 (),
28974 )?
28975 }
28976
28977 10 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseDictionary<'de>>(
28978 raw,
28979 decoder,
28980 (),
28981 )?,
28982
28983 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
28984 }
28985
28986 Ok(())
28987 }
28988 }
28989
28990 impl<'de> ::core::fmt::Debug for Use<'de> {
28991 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
28992 match self.raw.ordinal() {
28993 1 => unsafe {
28994 self.raw.get().deref_unchecked::<crate::wire::UseService<'_>>().fmt(f)
28995 },
28996 2 => unsafe {
28997 self.raw.get().deref_unchecked::<crate::wire::UseProtocol<'_>>().fmt(f)
28998 },
28999 3 => unsafe {
29000 self.raw.get().deref_unchecked::<crate::wire::UseDirectory<'_>>().fmt(f)
29001 },
29002 4 => unsafe {
29003 self.raw.get().deref_unchecked::<crate::wire::UseStorage<'_>>().fmt(f)
29004 },
29005 7 => unsafe {
29006 self.raw.get().deref_unchecked::<crate::wire::UseEventStream<'_>>().fmt(f)
29007 },
29008 8 => unsafe {
29009 self.raw.get().deref_unchecked::<crate::wire::UseRunner<'_>>().fmt(f)
29010 },
29011 9 => unsafe {
29012 self.raw.get().deref_unchecked::<crate::wire::UseConfiguration<'_>>().fmt(f)
29013 },
29014 10 => unsafe {
29015 self.raw.get().deref_unchecked::<crate::wire::UseDictionary<'_>>().fmt(f)
29016 },
29017 _ => unsafe { ::core::hint::unreachable_unchecked() },
29018 }
29019 }
29020 }
29021
29022 impl<'de> ::fidl_next::IntoNatural for Use<'de> {
29023 type Natural = crate::natural::Use;
29024 }
29025
29026 #[repr(C)]
29028 pub struct ExposeService<'de> {
29029 pub(crate) table: ::fidl_next::wire::Table<'de>,
29030 }
29031
29032 impl<'de> Drop for ExposeService<'de> {
29033 fn drop(&mut self) {
29034 let _ = self
29035 .table
29036 .get(1)
29037 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29038
29039 let _ = self.table.get(2).map(|envelope| unsafe {
29040 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29041 });
29042
29043 let _ = self
29044 .table
29045 .get(3)
29046 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29047
29048 let _ = self.table.get(4).map(|envelope| unsafe {
29049 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29050 });
29051
29052 let _ = self
29053 .table
29054 .get(5)
29055 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
29056
29057 let _ = self.table.get(6).map(|envelope| unsafe {
29058 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29059 });
29060 }
29061 }
29062
29063 impl ::fidl_next::Constrained for ExposeService<'_> {
29064 type Constraint = ();
29065
29066 fn validate(
29067 _: ::fidl_next::Slot<'_, Self>,
29068 _: Self::Constraint,
29069 ) -> Result<(), ::fidl_next::ValidationError> {
29070 Ok(())
29071 }
29072 }
29073
29074 unsafe impl ::fidl_next::Wire for ExposeService<'static> {
29075 type Narrowed<'de> = ExposeService<'de>;
29076
29077 #[inline]
29078 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29079 ::fidl_next::munge!(let Self { table } = out);
29080 ::fidl_next::wire::Table::zero_padding(table);
29081 }
29082 }
29083
29084 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ExposeService<'de>
29085 where
29086 ___D: ::fidl_next::Decoder<'de> + ?Sized,
29087 {
29088 fn decode(
29089 slot: ::fidl_next::Slot<'_, Self>,
29090 decoder: &mut ___D,
29091 _: (),
29092 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
29093 ::fidl_next::munge!(let Self { table } = slot);
29094
29095 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
29096 match ordinal {
29097 0 => unsafe { ::core::hint::unreachable_unchecked() },
29098
29099 1 => {
29100 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
29101 slot.as_mut(),
29102 decoder,
29103 (),
29104 )?;
29105
29106 Ok(())
29107 }
29108
29109 2 => {
29110 ::fidl_next::wire::Envelope::decode_as::<
29111 ___D,
29112 ::fidl_next::wire::String<'de>,
29113 >(slot.as_mut(), decoder, 100)?;
29114
29115 let value = unsafe {
29116 slot.deref_unchecked()
29117 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29118 };
29119
29120 if value.len() > 100 {
29121 return Err(::fidl_next::DecodeError::VectorTooLong {
29122 size: value.len() as u64,
29123 limit: 100,
29124 });
29125 }
29126
29127 Ok(())
29128 }
29129
29130 3 => {
29131 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
29132 slot.as_mut(),
29133 decoder,
29134 (),
29135 )?;
29136
29137 Ok(())
29138 }
29139
29140 4 => {
29141 ::fidl_next::wire::Envelope::decode_as::<
29142 ___D,
29143 ::fidl_next::wire::String<'de>,
29144 >(slot.as_mut(), decoder, 100)?;
29145
29146 let value = unsafe {
29147 slot.deref_unchecked()
29148 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29149 };
29150
29151 if value.len() > 100 {
29152 return Err(::fidl_next::DecodeError::VectorTooLong {
29153 size: value.len() as u64,
29154 limit: 100,
29155 });
29156 }
29157
29158 Ok(())
29159 }
29160
29161 5 => {
29162 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
29163 slot.as_mut(),
29164 decoder,
29165 (),
29166 )?;
29167
29168 Ok(())
29169 }
29170
29171 6 => {
29172 ::fidl_next::wire::Envelope::decode_as::<
29173 ___D,
29174 ::fidl_next::wire::String<'de>,
29175 >(slot.as_mut(), decoder, 1024)?;
29176
29177 let value = unsafe {
29178 slot.deref_unchecked()
29179 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29180 };
29181
29182 if value.len() > 1024 {
29183 return Err(::fidl_next::DecodeError::VectorTooLong {
29184 size: value.len() as u64,
29185 limit: 1024,
29186 });
29187 }
29188
29189 Ok(())
29190 }
29191
29192 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
29193 }
29194 })
29195 }
29196 }
29197
29198 impl<'de> ExposeService<'de> {
29199 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29200 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
29201 }
29202
29203 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29204 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
29205 }
29206
29207 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29208 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
29209 }
29210
29211 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29212 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
29213 }
29214
29215 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
29216 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
29217 }
29218
29219 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29220 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
29221 }
29222 }
29223
29224 impl<'de> ::core::fmt::Debug for ExposeService<'de> {
29225 fn fmt(
29226 &self,
29227 f: &mut ::core::fmt::Formatter<'_>,
29228 ) -> ::core::result::Result<(), ::core::fmt::Error> {
29229 f.debug_struct("ExposeService")
29230 .field("source", &self.source())
29231 .field("source_name", &self.source_name())
29232 .field("target", &self.target())
29233 .field("target_name", &self.target_name())
29234 .field("availability", &self.availability())
29235 .field("source_dictionary", &self.source_dictionary())
29236 .finish()
29237 }
29238 }
29239
29240 impl<'de> ::fidl_next::IntoNatural for ExposeService<'de> {
29241 type Natural = crate::natural::ExposeService;
29242 }
29243
29244 #[repr(C)]
29246 pub struct ExposeProtocol<'de> {
29247 pub(crate) table: ::fidl_next::wire::Table<'de>,
29248 }
29249
29250 impl<'de> Drop for ExposeProtocol<'de> {
29251 fn drop(&mut self) {
29252 let _ = self
29253 .table
29254 .get(1)
29255 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29256
29257 let _ = self.table.get(2).map(|envelope| unsafe {
29258 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29259 });
29260
29261 let _ = self
29262 .table
29263 .get(3)
29264 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29265
29266 let _ = self.table.get(4).map(|envelope| unsafe {
29267 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29268 });
29269
29270 let _ = self
29271 .table
29272 .get(5)
29273 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
29274
29275 let _ = self.table.get(6).map(|envelope| unsafe {
29276 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29277 });
29278 }
29279 }
29280
29281 impl ::fidl_next::Constrained for ExposeProtocol<'_> {
29282 type Constraint = ();
29283
29284 fn validate(
29285 _: ::fidl_next::Slot<'_, Self>,
29286 _: Self::Constraint,
29287 ) -> Result<(), ::fidl_next::ValidationError> {
29288 Ok(())
29289 }
29290 }
29291
29292 unsafe impl ::fidl_next::Wire for ExposeProtocol<'static> {
29293 type Narrowed<'de> = ExposeProtocol<'de>;
29294
29295 #[inline]
29296 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29297 ::fidl_next::munge!(let Self { table } = out);
29298 ::fidl_next::wire::Table::zero_padding(table);
29299 }
29300 }
29301
29302 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ExposeProtocol<'de>
29303 where
29304 ___D: ::fidl_next::Decoder<'de> + ?Sized,
29305 {
29306 fn decode(
29307 slot: ::fidl_next::Slot<'_, Self>,
29308 decoder: &mut ___D,
29309 _: (),
29310 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
29311 ::fidl_next::munge!(let Self { table } = slot);
29312
29313 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
29314 match ordinal {
29315 0 => unsafe { ::core::hint::unreachable_unchecked() },
29316
29317 1 => {
29318 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
29319 slot.as_mut(),
29320 decoder,
29321 (),
29322 )?;
29323
29324 Ok(())
29325 }
29326
29327 2 => {
29328 ::fidl_next::wire::Envelope::decode_as::<
29329 ___D,
29330 ::fidl_next::wire::String<'de>,
29331 >(slot.as_mut(), decoder, 100)?;
29332
29333 let value = unsafe {
29334 slot.deref_unchecked()
29335 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29336 };
29337
29338 if value.len() > 100 {
29339 return Err(::fidl_next::DecodeError::VectorTooLong {
29340 size: value.len() as u64,
29341 limit: 100,
29342 });
29343 }
29344
29345 Ok(())
29346 }
29347
29348 3 => {
29349 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
29350 slot.as_mut(),
29351 decoder,
29352 (),
29353 )?;
29354
29355 Ok(())
29356 }
29357
29358 4 => {
29359 ::fidl_next::wire::Envelope::decode_as::<
29360 ___D,
29361 ::fidl_next::wire::String<'de>,
29362 >(slot.as_mut(), decoder, 100)?;
29363
29364 let value = unsafe {
29365 slot.deref_unchecked()
29366 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29367 };
29368
29369 if value.len() > 100 {
29370 return Err(::fidl_next::DecodeError::VectorTooLong {
29371 size: value.len() as u64,
29372 limit: 100,
29373 });
29374 }
29375
29376 Ok(())
29377 }
29378
29379 5 => {
29380 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
29381 slot.as_mut(),
29382 decoder,
29383 (),
29384 )?;
29385
29386 Ok(())
29387 }
29388
29389 6 => {
29390 ::fidl_next::wire::Envelope::decode_as::<
29391 ___D,
29392 ::fidl_next::wire::String<'de>,
29393 >(slot.as_mut(), decoder, 1024)?;
29394
29395 let value = unsafe {
29396 slot.deref_unchecked()
29397 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29398 };
29399
29400 if value.len() > 1024 {
29401 return Err(::fidl_next::DecodeError::VectorTooLong {
29402 size: value.len() as u64,
29403 limit: 1024,
29404 });
29405 }
29406
29407 Ok(())
29408 }
29409
29410 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
29411 }
29412 })
29413 }
29414 }
29415
29416 impl<'de> ExposeProtocol<'de> {
29417 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29418 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
29419 }
29420
29421 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29422 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
29423 }
29424
29425 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29426 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
29427 }
29428
29429 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29430 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
29431 }
29432
29433 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
29434 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
29435 }
29436
29437 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29438 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
29439 }
29440 }
29441
29442 impl<'de> ::core::fmt::Debug for ExposeProtocol<'de> {
29443 fn fmt(
29444 &self,
29445 f: &mut ::core::fmt::Formatter<'_>,
29446 ) -> ::core::result::Result<(), ::core::fmt::Error> {
29447 f.debug_struct("ExposeProtocol")
29448 .field("source", &self.source())
29449 .field("source_name", &self.source_name())
29450 .field("target", &self.target())
29451 .field("target_name", &self.target_name())
29452 .field("availability", &self.availability())
29453 .field("source_dictionary", &self.source_dictionary())
29454 .finish()
29455 }
29456 }
29457
29458 impl<'de> ::fidl_next::IntoNatural for ExposeProtocol<'de> {
29459 type Natural = crate::natural::ExposeProtocol;
29460 }
29461
29462 #[repr(C)]
29464 pub struct ExposeDirectory<'de> {
29465 pub(crate) table: ::fidl_next::wire::Table<'de>,
29466 }
29467
29468 impl<'de> Drop for ExposeDirectory<'de> {
29469 fn drop(&mut self) {
29470 let _ = self
29471 .table
29472 .get(1)
29473 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29474
29475 let _ = self.table.get(2).map(|envelope| unsafe {
29476 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29477 });
29478
29479 let _ = self
29480 .table
29481 .get(3)
29482 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29483
29484 let _ = self.table.get(4).map(|envelope| unsafe {
29485 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29486 });
29487
29488 let _ = self.table.get(5).map(|envelope| unsafe {
29489 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
29490 });
29491
29492 let _ = self.table.get(6).map(|envelope| unsafe {
29493 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29494 });
29495
29496 let _ = self
29497 .table
29498 .get(7)
29499 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
29500
29501 let _ = self.table.get(8).map(|envelope| unsafe {
29502 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29503 });
29504 }
29505 }
29506
29507 impl ::fidl_next::Constrained for ExposeDirectory<'_> {
29508 type Constraint = ();
29509
29510 fn validate(
29511 _: ::fidl_next::Slot<'_, Self>,
29512 _: Self::Constraint,
29513 ) -> Result<(), ::fidl_next::ValidationError> {
29514 Ok(())
29515 }
29516 }
29517
29518 unsafe impl ::fidl_next::Wire for ExposeDirectory<'static> {
29519 type Narrowed<'de> = ExposeDirectory<'de>;
29520
29521 #[inline]
29522 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29523 ::fidl_next::munge!(let Self { table } = out);
29524 ::fidl_next::wire::Table::zero_padding(table);
29525 }
29526 }
29527
29528 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ExposeDirectory<'de>
29529 where
29530 ___D: ::fidl_next::Decoder<'de> + ?Sized,
29531 {
29532 fn decode(
29533 slot: ::fidl_next::Slot<'_, Self>,
29534 decoder: &mut ___D,
29535 _: (),
29536 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
29537 ::fidl_next::munge!(let Self { table } = slot);
29538
29539 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
29540 match ordinal {
29541 0 => unsafe { ::core::hint::unreachable_unchecked() },
29542
29543 1 => {
29544 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
29545 slot.as_mut(),
29546 decoder,
29547 (),
29548 )?;
29549
29550 Ok(())
29551 }
29552
29553 2 => {
29554 ::fidl_next::wire::Envelope::decode_as::<
29555 ___D,
29556 ::fidl_next::wire::String<'de>,
29557 >(slot.as_mut(), decoder, 100)?;
29558
29559 let value = unsafe {
29560 slot.deref_unchecked()
29561 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29562 };
29563
29564 if value.len() > 100 {
29565 return Err(::fidl_next::DecodeError::VectorTooLong {
29566 size: value.len() as u64,
29567 limit: 100,
29568 });
29569 }
29570
29571 Ok(())
29572 }
29573
29574 3 => {
29575 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
29576 slot.as_mut(),
29577 decoder,
29578 (),
29579 )?;
29580
29581 Ok(())
29582 }
29583
29584 4 => {
29585 ::fidl_next::wire::Envelope::decode_as::<
29586 ___D,
29587 ::fidl_next::wire::String<'de>,
29588 >(slot.as_mut(), decoder, 100)?;
29589
29590 let value = unsafe {
29591 slot.deref_unchecked()
29592 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29593 };
29594
29595 if value.len() > 100 {
29596 return Err(::fidl_next::DecodeError::VectorTooLong {
29597 size: value.len() as u64,
29598 limit: 100,
29599 });
29600 }
29601
29602 Ok(())
29603 }
29604
29605 5 => {
29606 ::fidl_next::wire::Envelope::decode_as::<
29607 ___D,
29608 ::fidl_next_common_fuchsia_io::wire::Operations,
29609 >(slot.as_mut(), decoder, ())?;
29610
29611 Ok(())
29612 }
29613
29614 6 => {
29615 ::fidl_next::wire::Envelope::decode_as::<
29616 ___D,
29617 ::fidl_next::wire::String<'de>,
29618 >(slot.as_mut(), decoder, 1024)?;
29619
29620 let value = unsafe {
29621 slot.deref_unchecked()
29622 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29623 };
29624
29625 if value.len() > 1024 {
29626 return Err(::fidl_next::DecodeError::VectorTooLong {
29627 size: value.len() as u64,
29628 limit: 1024,
29629 });
29630 }
29631
29632 Ok(())
29633 }
29634
29635 7 => {
29636 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
29637 slot.as_mut(),
29638 decoder,
29639 (),
29640 )?;
29641
29642 Ok(())
29643 }
29644
29645 8 => {
29646 ::fidl_next::wire::Envelope::decode_as::<
29647 ___D,
29648 ::fidl_next::wire::String<'de>,
29649 >(slot.as_mut(), decoder, 1024)?;
29650
29651 let value = unsafe {
29652 slot.deref_unchecked()
29653 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29654 };
29655
29656 if value.len() > 1024 {
29657 return Err(::fidl_next::DecodeError::VectorTooLong {
29658 size: value.len() as u64,
29659 limit: 1024,
29660 });
29661 }
29662
29663 Ok(())
29664 }
29665
29666 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
29667 }
29668 })
29669 }
29670 }
29671
29672 impl<'de> ExposeDirectory<'de> {
29673 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29674 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
29675 }
29676
29677 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29678 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
29679 }
29680
29681 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29682 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
29683 }
29684
29685 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29686 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
29687 }
29688
29689 pub fn rights(
29690 &self,
29691 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_io::wire::Operations> {
29692 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
29693 }
29694
29695 pub fn subdir(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29696 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
29697 }
29698
29699 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
29700 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
29701 }
29702
29703 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29704 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
29705 }
29706 }
29707
29708 impl<'de> ::core::fmt::Debug for ExposeDirectory<'de> {
29709 fn fmt(
29710 &self,
29711 f: &mut ::core::fmt::Formatter<'_>,
29712 ) -> ::core::result::Result<(), ::core::fmt::Error> {
29713 f.debug_struct("ExposeDirectory")
29714 .field("source", &self.source())
29715 .field("source_name", &self.source_name())
29716 .field("target", &self.target())
29717 .field("target_name", &self.target_name())
29718 .field("rights", &self.rights())
29719 .field("subdir", &self.subdir())
29720 .field("availability", &self.availability())
29721 .field("source_dictionary", &self.source_dictionary())
29722 .finish()
29723 }
29724 }
29725
29726 impl<'de> ::fidl_next::IntoNatural for ExposeDirectory<'de> {
29727 type Natural = crate::natural::ExposeDirectory;
29728 }
29729
29730 #[repr(C)]
29732 pub struct ExposeRunner<'de> {
29733 pub(crate) table: ::fidl_next::wire::Table<'de>,
29734 }
29735
29736 impl<'de> Drop for ExposeRunner<'de> {
29737 fn drop(&mut self) {
29738 let _ = self
29739 .table
29740 .get(1)
29741 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29742
29743 let _ = self.table.get(2).map(|envelope| unsafe {
29744 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29745 });
29746
29747 let _ = self
29748 .table
29749 .get(3)
29750 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29751
29752 let _ = self.table.get(4).map(|envelope| unsafe {
29753 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29754 });
29755
29756 let _ = self.table.get(6).map(|envelope| unsafe {
29757 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29758 });
29759 }
29760 }
29761
29762 impl ::fidl_next::Constrained for ExposeRunner<'_> {
29763 type Constraint = ();
29764
29765 fn validate(
29766 _: ::fidl_next::Slot<'_, Self>,
29767 _: Self::Constraint,
29768 ) -> Result<(), ::fidl_next::ValidationError> {
29769 Ok(())
29770 }
29771 }
29772
29773 unsafe impl ::fidl_next::Wire for ExposeRunner<'static> {
29774 type Narrowed<'de> = ExposeRunner<'de>;
29775
29776 #[inline]
29777 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29778 ::fidl_next::munge!(let Self { table } = out);
29779 ::fidl_next::wire::Table::zero_padding(table);
29780 }
29781 }
29782
29783 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ExposeRunner<'de>
29784 where
29785 ___D: ::fidl_next::Decoder<'de> + ?Sized,
29786 {
29787 fn decode(
29788 slot: ::fidl_next::Slot<'_, Self>,
29789 decoder: &mut ___D,
29790 _: (),
29791 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
29792 ::fidl_next::munge!(let Self { table } = slot);
29793
29794 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
29795 match ordinal {
29796 0 => unsafe { ::core::hint::unreachable_unchecked() },
29797
29798 1 => {
29799 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
29800 slot.as_mut(),
29801 decoder,
29802 (),
29803 )?;
29804
29805 Ok(())
29806 }
29807
29808 2 => {
29809 ::fidl_next::wire::Envelope::decode_as::<
29810 ___D,
29811 ::fidl_next::wire::String<'de>,
29812 >(slot.as_mut(), decoder, 100)?;
29813
29814 let value = unsafe {
29815 slot.deref_unchecked()
29816 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29817 };
29818
29819 if value.len() > 100 {
29820 return Err(::fidl_next::DecodeError::VectorTooLong {
29821 size: value.len() as u64,
29822 limit: 100,
29823 });
29824 }
29825
29826 Ok(())
29827 }
29828
29829 3 => {
29830 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
29831 slot.as_mut(),
29832 decoder,
29833 (),
29834 )?;
29835
29836 Ok(())
29837 }
29838
29839 4 => {
29840 ::fidl_next::wire::Envelope::decode_as::<
29841 ___D,
29842 ::fidl_next::wire::String<'de>,
29843 >(slot.as_mut(), decoder, 100)?;
29844
29845 let value = unsafe {
29846 slot.deref_unchecked()
29847 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29848 };
29849
29850 if value.len() > 100 {
29851 return Err(::fidl_next::DecodeError::VectorTooLong {
29852 size: value.len() as u64,
29853 limit: 100,
29854 });
29855 }
29856
29857 Ok(())
29858 }
29859
29860 6 => {
29861 ::fidl_next::wire::Envelope::decode_as::<
29862 ___D,
29863 ::fidl_next::wire::String<'de>,
29864 >(slot.as_mut(), decoder, 1024)?;
29865
29866 let value = unsafe {
29867 slot.deref_unchecked()
29868 .deref_unchecked::<::fidl_next::wire::String<'_>>()
29869 };
29870
29871 if value.len() > 1024 {
29872 return Err(::fidl_next::DecodeError::VectorTooLong {
29873 size: value.len() as u64,
29874 limit: 1024,
29875 });
29876 }
29877
29878 Ok(())
29879 }
29880
29881 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
29882 }
29883 })
29884 }
29885 }
29886
29887 impl<'de> ExposeRunner<'de> {
29888 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29889 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
29890 }
29891
29892 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29893 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
29894 }
29895
29896 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29897 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
29898 }
29899
29900 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29901 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
29902 }
29903
29904 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
29905 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
29906 }
29907 }
29908
29909 impl<'de> ::core::fmt::Debug for ExposeRunner<'de> {
29910 fn fmt(
29911 &self,
29912 f: &mut ::core::fmt::Formatter<'_>,
29913 ) -> ::core::result::Result<(), ::core::fmt::Error> {
29914 f.debug_struct("ExposeRunner")
29915 .field("source", &self.source())
29916 .field("source_name", &self.source_name())
29917 .field("target", &self.target())
29918 .field("target_name", &self.target_name())
29919 .field("source_dictionary", &self.source_dictionary())
29920 .finish()
29921 }
29922 }
29923
29924 impl<'de> ::fidl_next::IntoNatural for ExposeRunner<'de> {
29925 type Natural = crate::natural::ExposeRunner;
29926 }
29927
29928 #[repr(C)]
29930 pub struct ExposeResolver<'de> {
29931 pub(crate) table: ::fidl_next::wire::Table<'de>,
29932 }
29933
29934 impl<'de> Drop for ExposeResolver<'de> {
29935 fn drop(&mut self) {
29936 let _ = self
29937 .table
29938 .get(1)
29939 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29940
29941 let _ = self.table.get(2).map(|envelope| unsafe {
29942 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29943 });
29944
29945 let _ = self
29946 .table
29947 .get(3)
29948 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29949
29950 let _ = self.table.get(4).map(|envelope| unsafe {
29951 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29952 });
29953
29954 let _ = self.table.get(6).map(|envelope| unsafe {
29955 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
29956 });
29957 }
29958 }
29959
29960 impl ::fidl_next::Constrained for ExposeResolver<'_> {
29961 type Constraint = ();
29962
29963 fn validate(
29964 _: ::fidl_next::Slot<'_, Self>,
29965 _: Self::Constraint,
29966 ) -> Result<(), ::fidl_next::ValidationError> {
29967 Ok(())
29968 }
29969 }
29970
29971 unsafe impl ::fidl_next::Wire for ExposeResolver<'static> {
29972 type Narrowed<'de> = ExposeResolver<'de>;
29973
29974 #[inline]
29975 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29976 ::fidl_next::munge!(let Self { table } = out);
29977 ::fidl_next::wire::Table::zero_padding(table);
29978 }
29979 }
29980
29981 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ExposeResolver<'de>
29982 where
29983 ___D: ::fidl_next::Decoder<'de> + ?Sized,
29984 {
29985 fn decode(
29986 slot: ::fidl_next::Slot<'_, Self>,
29987 decoder: &mut ___D,
29988 _: (),
29989 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
29990 ::fidl_next::munge!(let Self { table } = slot);
29991
29992 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
29993 match ordinal {
29994 0 => unsafe { ::core::hint::unreachable_unchecked() },
29995
29996 1 => {
29997 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
29998 slot.as_mut(),
29999 decoder,
30000 (),
30001 )?;
30002
30003 Ok(())
30004 }
30005
30006 2 => {
30007 ::fidl_next::wire::Envelope::decode_as::<
30008 ___D,
30009 ::fidl_next::wire::String<'de>,
30010 >(slot.as_mut(), decoder, 100)?;
30011
30012 let value = unsafe {
30013 slot.deref_unchecked()
30014 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30015 };
30016
30017 if value.len() > 100 {
30018 return Err(::fidl_next::DecodeError::VectorTooLong {
30019 size: value.len() as u64,
30020 limit: 100,
30021 });
30022 }
30023
30024 Ok(())
30025 }
30026
30027 3 => {
30028 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
30029 slot.as_mut(),
30030 decoder,
30031 (),
30032 )?;
30033
30034 Ok(())
30035 }
30036
30037 4 => {
30038 ::fidl_next::wire::Envelope::decode_as::<
30039 ___D,
30040 ::fidl_next::wire::String<'de>,
30041 >(slot.as_mut(), decoder, 100)?;
30042
30043 let value = unsafe {
30044 slot.deref_unchecked()
30045 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30046 };
30047
30048 if value.len() > 100 {
30049 return Err(::fidl_next::DecodeError::VectorTooLong {
30050 size: value.len() as u64,
30051 limit: 100,
30052 });
30053 }
30054
30055 Ok(())
30056 }
30057
30058 6 => {
30059 ::fidl_next::wire::Envelope::decode_as::<
30060 ___D,
30061 ::fidl_next::wire::String<'de>,
30062 >(slot.as_mut(), decoder, 1024)?;
30063
30064 let value = unsafe {
30065 slot.deref_unchecked()
30066 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30067 };
30068
30069 if value.len() > 1024 {
30070 return Err(::fidl_next::DecodeError::VectorTooLong {
30071 size: value.len() as u64,
30072 limit: 1024,
30073 });
30074 }
30075
30076 Ok(())
30077 }
30078
30079 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
30080 }
30081 })
30082 }
30083 }
30084
30085 impl<'de> ExposeResolver<'de> {
30086 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30087 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
30088 }
30089
30090 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30091 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
30092 }
30093
30094 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30095 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
30096 }
30097
30098 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30099 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
30100 }
30101
30102 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30103 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
30104 }
30105 }
30106
30107 impl<'de> ::core::fmt::Debug for ExposeResolver<'de> {
30108 fn fmt(
30109 &self,
30110 f: &mut ::core::fmt::Formatter<'_>,
30111 ) -> ::core::result::Result<(), ::core::fmt::Error> {
30112 f.debug_struct("ExposeResolver")
30113 .field("source", &self.source())
30114 .field("source_name", &self.source_name())
30115 .field("target", &self.target())
30116 .field("target_name", &self.target_name())
30117 .field("source_dictionary", &self.source_dictionary())
30118 .finish()
30119 }
30120 }
30121
30122 impl<'de> ::fidl_next::IntoNatural for ExposeResolver<'de> {
30123 type Natural = crate::natural::ExposeResolver;
30124 }
30125
30126 #[repr(C)]
30128 pub struct ExposeDictionary<'de> {
30129 pub(crate) table: ::fidl_next::wire::Table<'de>,
30130 }
30131
30132 impl<'de> Drop for ExposeDictionary<'de> {
30133 fn drop(&mut self) {
30134 let _ = self
30135 .table
30136 .get(1)
30137 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30138
30139 let _ = self.table.get(2).map(|envelope| unsafe {
30140 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30141 });
30142
30143 let _ = self
30144 .table
30145 .get(3)
30146 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30147
30148 let _ = self.table.get(4).map(|envelope| unsafe {
30149 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30150 });
30151
30152 let _ = self
30153 .table
30154 .get(5)
30155 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
30156
30157 let _ = self.table.get(6).map(|envelope| unsafe {
30158 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30159 });
30160 }
30161 }
30162
30163 impl ::fidl_next::Constrained for ExposeDictionary<'_> {
30164 type Constraint = ();
30165
30166 fn validate(
30167 _: ::fidl_next::Slot<'_, Self>,
30168 _: Self::Constraint,
30169 ) -> Result<(), ::fidl_next::ValidationError> {
30170 Ok(())
30171 }
30172 }
30173
30174 unsafe impl ::fidl_next::Wire for ExposeDictionary<'static> {
30175 type Narrowed<'de> = ExposeDictionary<'de>;
30176
30177 #[inline]
30178 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30179 ::fidl_next::munge!(let Self { table } = out);
30180 ::fidl_next::wire::Table::zero_padding(table);
30181 }
30182 }
30183
30184 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ExposeDictionary<'de>
30185 where
30186 ___D: ::fidl_next::Decoder<'de> + ?Sized,
30187 {
30188 fn decode(
30189 slot: ::fidl_next::Slot<'_, Self>,
30190 decoder: &mut ___D,
30191 _: (),
30192 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
30193 ::fidl_next::munge!(let Self { table } = slot);
30194
30195 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
30196 match ordinal {
30197 0 => unsafe { ::core::hint::unreachable_unchecked() },
30198
30199 1 => {
30200 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
30201 slot.as_mut(),
30202 decoder,
30203 (),
30204 )?;
30205
30206 Ok(())
30207 }
30208
30209 2 => {
30210 ::fidl_next::wire::Envelope::decode_as::<
30211 ___D,
30212 ::fidl_next::wire::String<'de>,
30213 >(slot.as_mut(), decoder, 100)?;
30214
30215 let value = unsafe {
30216 slot.deref_unchecked()
30217 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30218 };
30219
30220 if value.len() > 100 {
30221 return Err(::fidl_next::DecodeError::VectorTooLong {
30222 size: value.len() as u64,
30223 limit: 100,
30224 });
30225 }
30226
30227 Ok(())
30228 }
30229
30230 3 => {
30231 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
30232 slot.as_mut(),
30233 decoder,
30234 (),
30235 )?;
30236
30237 Ok(())
30238 }
30239
30240 4 => {
30241 ::fidl_next::wire::Envelope::decode_as::<
30242 ___D,
30243 ::fidl_next::wire::String<'de>,
30244 >(slot.as_mut(), decoder, 100)?;
30245
30246 let value = unsafe {
30247 slot.deref_unchecked()
30248 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30249 };
30250
30251 if value.len() > 100 {
30252 return Err(::fidl_next::DecodeError::VectorTooLong {
30253 size: value.len() as u64,
30254 limit: 100,
30255 });
30256 }
30257
30258 Ok(())
30259 }
30260
30261 5 => {
30262 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
30263 slot.as_mut(),
30264 decoder,
30265 (),
30266 )?;
30267
30268 Ok(())
30269 }
30270
30271 6 => {
30272 ::fidl_next::wire::Envelope::decode_as::<
30273 ___D,
30274 ::fidl_next::wire::String<'de>,
30275 >(slot.as_mut(), decoder, 1024)?;
30276
30277 let value = unsafe {
30278 slot.deref_unchecked()
30279 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30280 };
30281
30282 if value.len() > 1024 {
30283 return Err(::fidl_next::DecodeError::VectorTooLong {
30284 size: value.len() as u64,
30285 limit: 1024,
30286 });
30287 }
30288
30289 Ok(())
30290 }
30291
30292 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
30293 }
30294 })
30295 }
30296 }
30297
30298 impl<'de> ExposeDictionary<'de> {
30299 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30300 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
30301 }
30302
30303 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30304 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
30305 }
30306
30307 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30308 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
30309 }
30310
30311 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30312 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
30313 }
30314
30315 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
30316 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
30317 }
30318
30319 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30320 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
30321 }
30322 }
30323
30324 impl<'de> ::core::fmt::Debug for ExposeDictionary<'de> {
30325 fn fmt(
30326 &self,
30327 f: &mut ::core::fmt::Formatter<'_>,
30328 ) -> ::core::result::Result<(), ::core::fmt::Error> {
30329 f.debug_struct("ExposeDictionary")
30330 .field("source", &self.source())
30331 .field("source_name", &self.source_name())
30332 .field("target", &self.target())
30333 .field("target_name", &self.target_name())
30334 .field("availability", &self.availability())
30335 .field("source_dictionary", &self.source_dictionary())
30336 .finish()
30337 }
30338 }
30339
30340 impl<'de> ::fidl_next::IntoNatural for ExposeDictionary<'de> {
30341 type Natural = crate::natural::ExposeDictionary;
30342 }
30343
30344 #[repr(C)]
30346 pub struct ExposeConfiguration<'de> {
30347 pub(crate) table: ::fidl_next::wire::Table<'de>,
30348 }
30349
30350 impl<'de> Drop for ExposeConfiguration<'de> {
30351 fn drop(&mut self) {
30352 let _ = self
30353 .table
30354 .get(1)
30355 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30356
30357 let _ = self.table.get(2).map(|envelope| unsafe {
30358 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30359 });
30360
30361 let _ = self
30362 .table
30363 .get(3)
30364 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30365
30366 let _ = self.table.get(4).map(|envelope| unsafe {
30367 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30368 });
30369
30370 let _ = self
30371 .table
30372 .get(5)
30373 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
30374
30375 let _ = self.table.get(6).map(|envelope| unsafe {
30376 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30377 });
30378 }
30379 }
30380
30381 impl ::fidl_next::Constrained for ExposeConfiguration<'_> {
30382 type Constraint = ();
30383
30384 fn validate(
30385 _: ::fidl_next::Slot<'_, Self>,
30386 _: Self::Constraint,
30387 ) -> Result<(), ::fidl_next::ValidationError> {
30388 Ok(())
30389 }
30390 }
30391
30392 unsafe impl ::fidl_next::Wire for ExposeConfiguration<'static> {
30393 type Narrowed<'de> = ExposeConfiguration<'de>;
30394
30395 #[inline]
30396 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30397 ::fidl_next::munge!(let Self { table } = out);
30398 ::fidl_next::wire::Table::zero_padding(table);
30399 }
30400 }
30401
30402 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ExposeConfiguration<'de>
30403 where
30404 ___D: ::fidl_next::Decoder<'de> + ?Sized,
30405 {
30406 fn decode(
30407 slot: ::fidl_next::Slot<'_, Self>,
30408 decoder: &mut ___D,
30409 _: (),
30410 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
30411 ::fidl_next::munge!(let Self { table } = slot);
30412
30413 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
30414 match ordinal {
30415 0 => unsafe { ::core::hint::unreachable_unchecked() },
30416
30417 1 => {
30418 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
30419 slot.as_mut(),
30420 decoder,
30421 (),
30422 )?;
30423
30424 Ok(())
30425 }
30426
30427 2 => {
30428 ::fidl_next::wire::Envelope::decode_as::<
30429 ___D,
30430 ::fidl_next::wire::String<'de>,
30431 >(slot.as_mut(), decoder, 100)?;
30432
30433 let value = unsafe {
30434 slot.deref_unchecked()
30435 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30436 };
30437
30438 if value.len() > 100 {
30439 return Err(::fidl_next::DecodeError::VectorTooLong {
30440 size: value.len() as u64,
30441 limit: 100,
30442 });
30443 }
30444
30445 Ok(())
30446 }
30447
30448 3 => {
30449 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
30450 slot.as_mut(),
30451 decoder,
30452 (),
30453 )?;
30454
30455 Ok(())
30456 }
30457
30458 4 => {
30459 ::fidl_next::wire::Envelope::decode_as::<
30460 ___D,
30461 ::fidl_next::wire::String<'de>,
30462 >(slot.as_mut(), decoder, 100)?;
30463
30464 let value = unsafe {
30465 slot.deref_unchecked()
30466 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30467 };
30468
30469 if value.len() > 100 {
30470 return Err(::fidl_next::DecodeError::VectorTooLong {
30471 size: value.len() as u64,
30472 limit: 100,
30473 });
30474 }
30475
30476 Ok(())
30477 }
30478
30479 5 => {
30480 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
30481 slot.as_mut(),
30482 decoder,
30483 (),
30484 )?;
30485
30486 Ok(())
30487 }
30488
30489 6 => {
30490 ::fidl_next::wire::Envelope::decode_as::<
30491 ___D,
30492 ::fidl_next::wire::String<'de>,
30493 >(slot.as_mut(), decoder, 1024)?;
30494
30495 let value = unsafe {
30496 slot.deref_unchecked()
30497 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30498 };
30499
30500 if value.len() > 1024 {
30501 return Err(::fidl_next::DecodeError::VectorTooLong {
30502 size: value.len() as u64,
30503 limit: 1024,
30504 });
30505 }
30506
30507 Ok(())
30508 }
30509
30510 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
30511 }
30512 })
30513 }
30514 }
30515
30516 impl<'de> ExposeConfiguration<'de> {
30517 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30518 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
30519 }
30520
30521 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30522 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
30523 }
30524
30525 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30526 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
30527 }
30528
30529 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30530 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
30531 }
30532
30533 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
30534 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
30535 }
30536
30537 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
30538 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
30539 }
30540 }
30541
30542 impl<'de> ::core::fmt::Debug for ExposeConfiguration<'de> {
30543 fn fmt(
30544 &self,
30545 f: &mut ::core::fmt::Formatter<'_>,
30546 ) -> ::core::result::Result<(), ::core::fmt::Error> {
30547 f.debug_struct("ExposeConfiguration")
30548 .field("source", &self.source())
30549 .field("source_name", &self.source_name())
30550 .field("target", &self.target())
30551 .field("target_name", &self.target_name())
30552 .field("availability", &self.availability())
30553 .field("source_dictionary", &self.source_dictionary())
30554 .finish()
30555 }
30556 }
30557
30558 impl<'de> ::fidl_next::IntoNatural for ExposeConfiguration<'de> {
30559 type Natural = crate::natural::ExposeConfiguration;
30560 }
30561
30562 #[repr(transparent)]
30564 pub struct Expose<'de> {
30565 pub(crate) raw: ::fidl_next::wire::Union,
30566 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
30567 }
30568
30569 impl<'de> Drop for Expose<'de> {
30570 fn drop(&mut self) {
30571 match self.raw.ordinal() {
30572 1 => {
30573 let _ = unsafe {
30574 self.raw.get().read_unchecked::<crate::wire::ExposeService<'de>>()
30575 };
30576 }
30577
30578 2 => {
30579 let _ = unsafe {
30580 self.raw.get().read_unchecked::<crate::wire::ExposeProtocol<'de>>()
30581 };
30582 }
30583
30584 3 => {
30585 let _ = unsafe {
30586 self.raw.get().read_unchecked::<crate::wire::ExposeDirectory<'de>>()
30587 };
30588 }
30589
30590 4 => {
30591 let _ = unsafe {
30592 self.raw.get().read_unchecked::<crate::wire::ExposeRunner<'de>>()
30593 };
30594 }
30595
30596 5 => {
30597 let _ = unsafe {
30598 self.raw.get().read_unchecked::<crate::wire::ExposeResolver<'de>>()
30599 };
30600 }
30601
30602 7 => {
30603 let _ = unsafe {
30604 self.raw.get().read_unchecked::<crate::wire::ExposeDictionary<'de>>()
30605 };
30606 }
30607
30608 8 => {
30609 let _ = unsafe {
30610 self.raw.get().read_unchecked::<crate::wire::ExposeConfiguration<'de>>()
30611 };
30612 }
30613
30614 _ => (),
30615 }
30616 }
30617 }
30618
30619 impl ::fidl_next::Constrained for Expose<'_> {
30620 type Constraint = ();
30621
30622 fn validate(
30623 _: ::fidl_next::Slot<'_, Self>,
30624 _: Self::Constraint,
30625 ) -> Result<(), ::fidl_next::ValidationError> {
30626 Ok(())
30627 }
30628 }
30629
30630 unsafe impl ::fidl_next::Wire for Expose<'static> {
30631 type Narrowed<'de> = Expose<'de>;
30632
30633 #[inline]
30634 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30635 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
30636 ::fidl_next::wire::Union::zero_padding(raw);
30637 }
30638 }
30639
30640 pub mod expose {
30641 pub enum Ref<'de> {
30642 Service(&'de crate::wire::ExposeService<'de>),
30643
30644 Protocol(&'de crate::wire::ExposeProtocol<'de>),
30645
30646 Directory(&'de crate::wire::ExposeDirectory<'de>),
30647
30648 Runner(&'de crate::wire::ExposeRunner<'de>),
30649
30650 Resolver(&'de crate::wire::ExposeResolver<'de>),
30651
30652 Dictionary(&'de crate::wire::ExposeDictionary<'de>),
30653
30654 Config(&'de crate::wire::ExposeConfiguration<'de>),
30655
30656 UnknownOrdinal_(u64),
30657 }
30658 }
30659
30660 impl<'de> Expose<'de> {
30661 pub fn as_ref(&self) -> crate::wire::expose::Ref<'_> {
30662 match self.raw.ordinal() {
30663 1 => crate::wire::expose::Ref::Service(unsafe {
30664 self.raw.get().deref_unchecked::<crate::wire::ExposeService<'_>>()
30665 }),
30666
30667 2 => crate::wire::expose::Ref::Protocol(unsafe {
30668 self.raw.get().deref_unchecked::<crate::wire::ExposeProtocol<'_>>()
30669 }),
30670
30671 3 => crate::wire::expose::Ref::Directory(unsafe {
30672 self.raw.get().deref_unchecked::<crate::wire::ExposeDirectory<'_>>()
30673 }),
30674
30675 4 => crate::wire::expose::Ref::Runner(unsafe {
30676 self.raw.get().deref_unchecked::<crate::wire::ExposeRunner<'_>>()
30677 }),
30678
30679 5 => crate::wire::expose::Ref::Resolver(unsafe {
30680 self.raw.get().deref_unchecked::<crate::wire::ExposeResolver<'_>>()
30681 }),
30682
30683 7 => crate::wire::expose::Ref::Dictionary(unsafe {
30684 self.raw.get().deref_unchecked::<crate::wire::ExposeDictionary<'_>>()
30685 }),
30686
30687 8 => crate::wire::expose::Ref::Config(unsafe {
30688 self.raw.get().deref_unchecked::<crate::wire::ExposeConfiguration<'_>>()
30689 }),
30690
30691 unknown => crate::wire::expose::Ref::UnknownOrdinal_(unknown),
30692 }
30693 }
30694 }
30695
30696 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Expose<'de>
30697 where
30698 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
30699 ___D: ::fidl_next::Decoder<'de>,
30700 {
30701 fn decode(
30702 mut slot: ::fidl_next::Slot<'_, Self>,
30703 decoder: &mut ___D,
30704 _: (),
30705 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
30706 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
30707 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
30708 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeService<'de>>(
30709 raw,
30710 decoder,
30711 (),
30712 )?,
30713
30714 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeProtocol<'de>>(
30715 raw,
30716 decoder,
30717 (),
30718 )?,
30719
30720 3 => {
30721 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeDirectory<'de>>(
30722 raw,
30723 decoder,
30724 (),
30725 )?
30726 }
30727
30728 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeRunner<'de>>(
30729 raw,
30730 decoder,
30731 (),
30732 )?,
30733
30734 5 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeResolver<'de>>(
30735 raw,
30736 decoder,
30737 (),
30738 )?,
30739
30740 7 => {
30741 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeDictionary<'de>>(
30742 raw,
30743 decoder,
30744 (),
30745 )?
30746 }
30747
30748 8 => ::fidl_next::wire::Union::decode_as::<
30749 ___D,
30750 crate::wire::ExposeConfiguration<'de>,
30751 >(raw, decoder, ())?,
30752
30753 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
30754 }
30755
30756 Ok(())
30757 }
30758 }
30759
30760 impl<'de> ::core::fmt::Debug for Expose<'de> {
30761 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
30762 match self.raw.ordinal() {
30763 1 => unsafe {
30764 self.raw.get().deref_unchecked::<crate::wire::ExposeService<'_>>().fmt(f)
30765 },
30766 2 => unsafe {
30767 self.raw.get().deref_unchecked::<crate::wire::ExposeProtocol<'_>>().fmt(f)
30768 },
30769 3 => unsafe {
30770 self.raw.get().deref_unchecked::<crate::wire::ExposeDirectory<'_>>().fmt(f)
30771 },
30772 4 => unsafe {
30773 self.raw.get().deref_unchecked::<crate::wire::ExposeRunner<'_>>().fmt(f)
30774 },
30775 5 => unsafe {
30776 self.raw.get().deref_unchecked::<crate::wire::ExposeResolver<'_>>().fmt(f)
30777 },
30778 7 => unsafe {
30779 self.raw.get().deref_unchecked::<crate::wire::ExposeDictionary<'_>>().fmt(f)
30780 },
30781 8 => unsafe {
30782 self.raw.get().deref_unchecked::<crate::wire::ExposeConfiguration<'_>>().fmt(f)
30783 },
30784 _ => unsafe { ::core::hint::unreachable_unchecked() },
30785 }
30786 }
30787 }
30788
30789 impl<'de> ::fidl_next::IntoNatural for Expose<'de> {
30790 type Natural = crate::natural::Expose;
30791 }
30792
30793 #[repr(C)]
30795 pub struct OfferService<'de> {
30796 pub(crate) table: ::fidl_next::wire::Table<'de>,
30797 }
30798
30799 impl<'de> Drop for OfferService<'de> {
30800 fn drop(&mut self) {
30801 let _ = self
30802 .table
30803 .get(1)
30804 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30805
30806 let _ = self.table.get(2).map(|envelope| unsafe {
30807 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30808 });
30809
30810 let _ = self
30811 .table
30812 .get(3)
30813 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30814
30815 let _ = self.table.get(4).map(|envelope| unsafe {
30816 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30817 });
30818
30819 let _ = self.table.get(5)
30820 .map(|envelope| unsafe {
30821 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>()
30822 });
30823
30824 let _ = self.table.get(6)
30825 .map(|envelope| unsafe {
30826 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::NameMapping<'de>>>()
30827 });
30828
30829 let _ = self
30830 .table
30831 .get(7)
30832 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
30833
30834 let _ = self.table.get(8).map(|envelope| unsafe {
30835 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
30836 });
30837
30838 let _ = self.table.get(9).map(|envelope| unsafe {
30839 envelope.read_unchecked::<crate::wire::DependencyType>()
30840 });
30841 }
30842 }
30843
30844 impl ::fidl_next::Constrained for OfferService<'_> {
30845 type Constraint = ();
30846
30847 fn validate(
30848 _: ::fidl_next::Slot<'_, Self>,
30849 _: Self::Constraint,
30850 ) -> Result<(), ::fidl_next::ValidationError> {
30851 Ok(())
30852 }
30853 }
30854
30855 unsafe impl ::fidl_next::Wire for OfferService<'static> {
30856 type Narrowed<'de> = OfferService<'de>;
30857
30858 #[inline]
30859 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30860 ::fidl_next::munge!(let Self { table } = out);
30861 ::fidl_next::wire::Table::zero_padding(table);
30862 }
30863 }
30864
30865 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferService<'de>
30866 where
30867 ___D: ::fidl_next::Decoder<'de> + ?Sized,
30868 {
30869 fn decode(
30870 slot: ::fidl_next::Slot<'_, Self>,
30871 decoder: &mut ___D,
30872 _: (),
30873 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
30874 ::fidl_next::munge!(let Self { table } = slot);
30875
30876 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
30877 match ordinal {
30878 0 => unsafe { ::core::hint::unreachable_unchecked() },
30879
30880 1 => {
30881 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
30882 slot.as_mut(),
30883 decoder,
30884 (),
30885 )?;
30886
30887 Ok(())
30888 }
30889
30890 2 => {
30891 ::fidl_next::wire::Envelope::decode_as::<
30892 ___D,
30893 ::fidl_next::wire::String<'de>,
30894 >(slot.as_mut(), decoder, 100)?;
30895
30896 let value = unsafe {
30897 slot.deref_unchecked()
30898 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30899 };
30900
30901 if value.len() > 100 {
30902 return Err(::fidl_next::DecodeError::VectorTooLong {
30903 size: value.len() as u64,
30904 limit: 100,
30905 });
30906 }
30907
30908 Ok(())
30909 }
30910
30911 3 => {
30912 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
30913 slot.as_mut(),
30914 decoder,
30915 (),
30916 )?;
30917
30918 Ok(())
30919 }
30920
30921 4 => {
30922 ::fidl_next::wire::Envelope::decode_as::<
30923 ___D,
30924 ::fidl_next::wire::String<'de>,
30925 >(slot.as_mut(), decoder, 100)?;
30926
30927 let value = unsafe {
30928 slot.deref_unchecked()
30929 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30930 };
30931
30932 if value.len() > 100 {
30933 return Err(::fidl_next::DecodeError::VectorTooLong {
30934 size: value.len() as u64,
30935 limit: 100,
30936 });
30937 }
30938
30939 Ok(())
30940 }
30941
30942 5 => {
30943 ::fidl_next::wire::Envelope::decode_as::<
30944 ___D,
30945 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>,
30946 >(slot.as_mut(), decoder, (4294967295, 100))?;
30947
30948 Ok(())
30949 }
30950
30951 6 => {
30952 ::fidl_next::wire::Envelope::decode_as::<
30953 ___D,
30954 ::fidl_next::wire::Vector<'de, crate::wire::NameMapping<'de>>,
30955 >(slot.as_mut(), decoder, (4294967295, ()))?;
30956
30957 Ok(())
30958 }
30959
30960 7 => {
30961 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
30962 slot.as_mut(),
30963 decoder,
30964 (),
30965 )?;
30966
30967 Ok(())
30968 }
30969
30970 8 => {
30971 ::fidl_next::wire::Envelope::decode_as::<
30972 ___D,
30973 ::fidl_next::wire::String<'de>,
30974 >(slot.as_mut(), decoder, 1024)?;
30975
30976 let value = unsafe {
30977 slot.deref_unchecked()
30978 .deref_unchecked::<::fidl_next::wire::String<'_>>()
30979 };
30980
30981 if value.len() > 1024 {
30982 return Err(::fidl_next::DecodeError::VectorTooLong {
30983 size: value.len() as u64,
30984 limit: 1024,
30985 });
30986 }
30987
30988 Ok(())
30989 }
30990
30991 9 => {
30992 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DependencyType>(
30993 slot.as_mut(),
30994 decoder,
30995 (),
30996 )?;
30997
30998 Ok(())
30999 }
31000
31001 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
31002 }
31003 })
31004 }
31005 }
31006
31007 impl<'de> OfferService<'de> {
31008 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31009 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
31010 }
31011
31012 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31013 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
31014 }
31015
31016 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31017 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
31018 }
31019
31020 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31021 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
31022 }
31023
31024 pub fn source_instance_filter(
31025 &self,
31026 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>>
31027 {
31028 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
31029 }
31030
31031 pub fn renamed_instances(
31032 &self,
31033 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::NameMapping<'de>>>
31034 {
31035 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
31036 }
31037
31038 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
31039 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
31040 }
31041
31042 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31043 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
31044 }
31045
31046 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
31047 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
31048 }
31049 }
31050
31051 impl<'de> ::core::fmt::Debug for OfferService<'de> {
31052 fn fmt(
31053 &self,
31054 f: &mut ::core::fmt::Formatter<'_>,
31055 ) -> ::core::result::Result<(), ::core::fmt::Error> {
31056 f.debug_struct("OfferService")
31057 .field("source", &self.source())
31058 .field("source_name", &self.source_name())
31059 .field("target", &self.target())
31060 .field("target_name", &self.target_name())
31061 .field("source_instance_filter", &self.source_instance_filter())
31062 .field("renamed_instances", &self.renamed_instances())
31063 .field("availability", &self.availability())
31064 .field("source_dictionary", &self.source_dictionary())
31065 .field("dependency_type", &self.dependency_type())
31066 .finish()
31067 }
31068 }
31069
31070 impl<'de> ::fidl_next::IntoNatural for OfferService<'de> {
31071 type Natural = crate::natural::OfferService;
31072 }
31073
31074 #[repr(C)]
31076 pub struct OfferProtocol<'de> {
31077 pub(crate) table: ::fidl_next::wire::Table<'de>,
31078 }
31079
31080 impl<'de> Drop for OfferProtocol<'de> {
31081 fn drop(&mut self) {
31082 let _ = self
31083 .table
31084 .get(1)
31085 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31086
31087 let _ = self.table.get(2).map(|envelope| unsafe {
31088 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31089 });
31090
31091 let _ = self
31092 .table
31093 .get(3)
31094 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31095
31096 let _ = self.table.get(4).map(|envelope| unsafe {
31097 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31098 });
31099
31100 let _ = self.table.get(5).map(|envelope| unsafe {
31101 envelope.read_unchecked::<crate::wire::DependencyType>()
31102 });
31103
31104 let _ = self
31105 .table
31106 .get(6)
31107 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
31108
31109 let _ = self.table.get(7).map(|envelope| unsafe {
31110 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31111 });
31112 }
31113 }
31114
31115 impl ::fidl_next::Constrained for OfferProtocol<'_> {
31116 type Constraint = ();
31117
31118 fn validate(
31119 _: ::fidl_next::Slot<'_, Self>,
31120 _: Self::Constraint,
31121 ) -> Result<(), ::fidl_next::ValidationError> {
31122 Ok(())
31123 }
31124 }
31125
31126 unsafe impl ::fidl_next::Wire for OfferProtocol<'static> {
31127 type Narrowed<'de> = OfferProtocol<'de>;
31128
31129 #[inline]
31130 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31131 ::fidl_next::munge!(let Self { table } = out);
31132 ::fidl_next::wire::Table::zero_padding(table);
31133 }
31134 }
31135
31136 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferProtocol<'de>
31137 where
31138 ___D: ::fidl_next::Decoder<'de> + ?Sized,
31139 {
31140 fn decode(
31141 slot: ::fidl_next::Slot<'_, Self>,
31142 decoder: &mut ___D,
31143 _: (),
31144 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
31145 ::fidl_next::munge!(let Self { table } = slot);
31146
31147 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
31148 match ordinal {
31149 0 => unsafe { ::core::hint::unreachable_unchecked() },
31150
31151 1 => {
31152 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
31153 slot.as_mut(),
31154 decoder,
31155 (),
31156 )?;
31157
31158 Ok(())
31159 }
31160
31161 2 => {
31162 ::fidl_next::wire::Envelope::decode_as::<
31163 ___D,
31164 ::fidl_next::wire::String<'de>,
31165 >(slot.as_mut(), decoder, 100)?;
31166
31167 let value = unsafe {
31168 slot.deref_unchecked()
31169 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31170 };
31171
31172 if value.len() > 100 {
31173 return Err(::fidl_next::DecodeError::VectorTooLong {
31174 size: value.len() as u64,
31175 limit: 100,
31176 });
31177 }
31178
31179 Ok(())
31180 }
31181
31182 3 => {
31183 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
31184 slot.as_mut(),
31185 decoder,
31186 (),
31187 )?;
31188
31189 Ok(())
31190 }
31191
31192 4 => {
31193 ::fidl_next::wire::Envelope::decode_as::<
31194 ___D,
31195 ::fidl_next::wire::String<'de>,
31196 >(slot.as_mut(), decoder, 100)?;
31197
31198 let value = unsafe {
31199 slot.deref_unchecked()
31200 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31201 };
31202
31203 if value.len() > 100 {
31204 return Err(::fidl_next::DecodeError::VectorTooLong {
31205 size: value.len() as u64,
31206 limit: 100,
31207 });
31208 }
31209
31210 Ok(())
31211 }
31212
31213 5 => {
31214 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DependencyType>(
31215 slot.as_mut(),
31216 decoder,
31217 (),
31218 )?;
31219
31220 Ok(())
31221 }
31222
31223 6 => {
31224 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
31225 slot.as_mut(),
31226 decoder,
31227 (),
31228 )?;
31229
31230 Ok(())
31231 }
31232
31233 7 => {
31234 ::fidl_next::wire::Envelope::decode_as::<
31235 ___D,
31236 ::fidl_next::wire::String<'de>,
31237 >(slot.as_mut(), decoder, 1024)?;
31238
31239 let value = unsafe {
31240 slot.deref_unchecked()
31241 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31242 };
31243
31244 if value.len() > 1024 {
31245 return Err(::fidl_next::DecodeError::VectorTooLong {
31246 size: value.len() as u64,
31247 limit: 1024,
31248 });
31249 }
31250
31251 Ok(())
31252 }
31253
31254 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
31255 }
31256 })
31257 }
31258 }
31259
31260 impl<'de> OfferProtocol<'de> {
31261 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31262 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
31263 }
31264
31265 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31266 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
31267 }
31268
31269 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31270 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
31271 }
31272
31273 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31274 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
31275 }
31276
31277 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
31278 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
31279 }
31280
31281 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
31282 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
31283 }
31284
31285 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31286 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
31287 }
31288 }
31289
31290 impl<'de> ::core::fmt::Debug for OfferProtocol<'de> {
31291 fn fmt(
31292 &self,
31293 f: &mut ::core::fmt::Formatter<'_>,
31294 ) -> ::core::result::Result<(), ::core::fmt::Error> {
31295 f.debug_struct("OfferProtocol")
31296 .field("source", &self.source())
31297 .field("source_name", &self.source_name())
31298 .field("target", &self.target())
31299 .field("target_name", &self.target_name())
31300 .field("dependency_type", &self.dependency_type())
31301 .field("availability", &self.availability())
31302 .field("source_dictionary", &self.source_dictionary())
31303 .finish()
31304 }
31305 }
31306
31307 impl<'de> ::fidl_next::IntoNatural for OfferProtocol<'de> {
31308 type Natural = crate::natural::OfferProtocol;
31309 }
31310
31311 #[repr(C)]
31313 pub struct OfferDirectory<'de> {
31314 pub(crate) table: ::fidl_next::wire::Table<'de>,
31315 }
31316
31317 impl<'de> Drop for OfferDirectory<'de> {
31318 fn drop(&mut self) {
31319 let _ = self
31320 .table
31321 .get(1)
31322 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31323
31324 let _ = self.table.get(2).map(|envelope| unsafe {
31325 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31326 });
31327
31328 let _ = self
31329 .table
31330 .get(3)
31331 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31332
31333 let _ = self.table.get(4).map(|envelope| unsafe {
31334 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31335 });
31336
31337 let _ = self.table.get(5).map(|envelope| unsafe {
31338 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
31339 });
31340
31341 let _ = self.table.get(6).map(|envelope| unsafe {
31342 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31343 });
31344
31345 let _ = self.table.get(7).map(|envelope| unsafe {
31346 envelope.read_unchecked::<crate::wire::DependencyType>()
31347 });
31348
31349 let _ = self
31350 .table
31351 .get(8)
31352 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
31353
31354 let _ = self.table.get(9).map(|envelope| unsafe {
31355 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31356 });
31357 }
31358 }
31359
31360 impl ::fidl_next::Constrained for OfferDirectory<'_> {
31361 type Constraint = ();
31362
31363 fn validate(
31364 _: ::fidl_next::Slot<'_, Self>,
31365 _: Self::Constraint,
31366 ) -> Result<(), ::fidl_next::ValidationError> {
31367 Ok(())
31368 }
31369 }
31370
31371 unsafe impl ::fidl_next::Wire for OfferDirectory<'static> {
31372 type Narrowed<'de> = OfferDirectory<'de>;
31373
31374 #[inline]
31375 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31376 ::fidl_next::munge!(let Self { table } = out);
31377 ::fidl_next::wire::Table::zero_padding(table);
31378 }
31379 }
31380
31381 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferDirectory<'de>
31382 where
31383 ___D: ::fidl_next::Decoder<'de> + ?Sized,
31384 {
31385 fn decode(
31386 slot: ::fidl_next::Slot<'_, Self>,
31387 decoder: &mut ___D,
31388 _: (),
31389 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
31390 ::fidl_next::munge!(let Self { table } = slot);
31391
31392 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
31393 match ordinal {
31394 0 => unsafe { ::core::hint::unreachable_unchecked() },
31395
31396 1 => {
31397 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
31398 slot.as_mut(),
31399 decoder,
31400 (),
31401 )?;
31402
31403 Ok(())
31404 }
31405
31406 2 => {
31407 ::fidl_next::wire::Envelope::decode_as::<
31408 ___D,
31409 ::fidl_next::wire::String<'de>,
31410 >(slot.as_mut(), decoder, 100)?;
31411
31412 let value = unsafe {
31413 slot.deref_unchecked()
31414 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31415 };
31416
31417 if value.len() > 100 {
31418 return Err(::fidl_next::DecodeError::VectorTooLong {
31419 size: value.len() as u64,
31420 limit: 100,
31421 });
31422 }
31423
31424 Ok(())
31425 }
31426
31427 3 => {
31428 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
31429 slot.as_mut(),
31430 decoder,
31431 (),
31432 )?;
31433
31434 Ok(())
31435 }
31436
31437 4 => {
31438 ::fidl_next::wire::Envelope::decode_as::<
31439 ___D,
31440 ::fidl_next::wire::String<'de>,
31441 >(slot.as_mut(), decoder, 100)?;
31442
31443 let value = unsafe {
31444 slot.deref_unchecked()
31445 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31446 };
31447
31448 if value.len() > 100 {
31449 return Err(::fidl_next::DecodeError::VectorTooLong {
31450 size: value.len() as u64,
31451 limit: 100,
31452 });
31453 }
31454
31455 Ok(())
31456 }
31457
31458 5 => {
31459 ::fidl_next::wire::Envelope::decode_as::<
31460 ___D,
31461 ::fidl_next_common_fuchsia_io::wire::Operations,
31462 >(slot.as_mut(), decoder, ())?;
31463
31464 Ok(())
31465 }
31466
31467 6 => {
31468 ::fidl_next::wire::Envelope::decode_as::<
31469 ___D,
31470 ::fidl_next::wire::String<'de>,
31471 >(slot.as_mut(), decoder, 1024)?;
31472
31473 let value = unsafe {
31474 slot.deref_unchecked()
31475 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31476 };
31477
31478 if value.len() > 1024 {
31479 return Err(::fidl_next::DecodeError::VectorTooLong {
31480 size: value.len() as u64,
31481 limit: 1024,
31482 });
31483 }
31484
31485 Ok(())
31486 }
31487
31488 7 => {
31489 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DependencyType>(
31490 slot.as_mut(),
31491 decoder,
31492 (),
31493 )?;
31494
31495 Ok(())
31496 }
31497
31498 8 => {
31499 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
31500 slot.as_mut(),
31501 decoder,
31502 (),
31503 )?;
31504
31505 Ok(())
31506 }
31507
31508 9 => {
31509 ::fidl_next::wire::Envelope::decode_as::<
31510 ___D,
31511 ::fidl_next::wire::String<'de>,
31512 >(slot.as_mut(), decoder, 1024)?;
31513
31514 let value = unsafe {
31515 slot.deref_unchecked()
31516 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31517 };
31518
31519 if value.len() > 1024 {
31520 return Err(::fidl_next::DecodeError::VectorTooLong {
31521 size: value.len() as u64,
31522 limit: 1024,
31523 });
31524 }
31525
31526 Ok(())
31527 }
31528
31529 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
31530 }
31531 })
31532 }
31533 }
31534
31535 impl<'de> OfferDirectory<'de> {
31536 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31537 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
31538 }
31539
31540 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31541 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
31542 }
31543
31544 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31545 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
31546 }
31547
31548 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31549 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
31550 }
31551
31552 pub fn rights(
31553 &self,
31554 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_io::wire::Operations> {
31555 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
31556 }
31557
31558 pub fn subdir(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31559 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
31560 }
31561
31562 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
31563 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
31564 }
31565
31566 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
31567 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
31568 }
31569
31570 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31571 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
31572 }
31573 }
31574
31575 impl<'de> ::core::fmt::Debug for OfferDirectory<'de> {
31576 fn fmt(
31577 &self,
31578 f: &mut ::core::fmt::Formatter<'_>,
31579 ) -> ::core::result::Result<(), ::core::fmt::Error> {
31580 f.debug_struct("OfferDirectory")
31581 .field("source", &self.source())
31582 .field("source_name", &self.source_name())
31583 .field("target", &self.target())
31584 .field("target_name", &self.target_name())
31585 .field("rights", &self.rights())
31586 .field("subdir", &self.subdir())
31587 .field("dependency_type", &self.dependency_type())
31588 .field("availability", &self.availability())
31589 .field("source_dictionary", &self.source_dictionary())
31590 .finish()
31591 }
31592 }
31593
31594 impl<'de> ::fidl_next::IntoNatural for OfferDirectory<'de> {
31595 type Natural = crate::natural::OfferDirectory;
31596 }
31597
31598 #[repr(C)]
31600 pub struct OfferStorage<'de> {
31601 pub(crate) table: ::fidl_next::wire::Table<'de>,
31602 }
31603
31604 impl<'de> Drop for OfferStorage<'de> {
31605 fn drop(&mut self) {
31606 let _ = self.table.get(1).map(|envelope| unsafe {
31607 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31608 });
31609
31610 let _ = self
31611 .table
31612 .get(2)
31613 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31614
31615 let _ = self
31616 .table
31617 .get(3)
31618 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31619
31620 let _ = self.table.get(4).map(|envelope| unsafe {
31621 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31622 });
31623
31624 let _ = self
31625 .table
31626 .get(5)
31627 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
31628 }
31629 }
31630
31631 impl ::fidl_next::Constrained for OfferStorage<'_> {
31632 type Constraint = ();
31633
31634 fn validate(
31635 _: ::fidl_next::Slot<'_, Self>,
31636 _: Self::Constraint,
31637 ) -> Result<(), ::fidl_next::ValidationError> {
31638 Ok(())
31639 }
31640 }
31641
31642 unsafe impl ::fidl_next::Wire for OfferStorage<'static> {
31643 type Narrowed<'de> = OfferStorage<'de>;
31644
31645 #[inline]
31646 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31647 ::fidl_next::munge!(let Self { table } = out);
31648 ::fidl_next::wire::Table::zero_padding(table);
31649 }
31650 }
31651
31652 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferStorage<'de>
31653 where
31654 ___D: ::fidl_next::Decoder<'de> + ?Sized,
31655 {
31656 fn decode(
31657 slot: ::fidl_next::Slot<'_, Self>,
31658 decoder: &mut ___D,
31659 _: (),
31660 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
31661 ::fidl_next::munge!(let Self { table } = slot);
31662
31663 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
31664 match ordinal {
31665 0 => unsafe { ::core::hint::unreachable_unchecked() },
31666
31667 1 => {
31668 ::fidl_next::wire::Envelope::decode_as::<
31669 ___D,
31670 ::fidl_next::wire::String<'de>,
31671 >(slot.as_mut(), decoder, 100)?;
31672
31673 let value = unsafe {
31674 slot.deref_unchecked()
31675 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31676 };
31677
31678 if value.len() > 100 {
31679 return Err(::fidl_next::DecodeError::VectorTooLong {
31680 size: value.len() as u64,
31681 limit: 100,
31682 });
31683 }
31684
31685 Ok(())
31686 }
31687
31688 2 => {
31689 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
31690 slot.as_mut(),
31691 decoder,
31692 (),
31693 )?;
31694
31695 Ok(())
31696 }
31697
31698 3 => {
31699 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
31700 slot.as_mut(),
31701 decoder,
31702 (),
31703 )?;
31704
31705 Ok(())
31706 }
31707
31708 4 => {
31709 ::fidl_next::wire::Envelope::decode_as::<
31710 ___D,
31711 ::fidl_next::wire::String<'de>,
31712 >(slot.as_mut(), decoder, 100)?;
31713
31714 let value = unsafe {
31715 slot.deref_unchecked()
31716 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31717 };
31718
31719 if value.len() > 100 {
31720 return Err(::fidl_next::DecodeError::VectorTooLong {
31721 size: value.len() as u64,
31722 limit: 100,
31723 });
31724 }
31725
31726 Ok(())
31727 }
31728
31729 5 => {
31730 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
31731 slot.as_mut(),
31732 decoder,
31733 (),
31734 )?;
31735
31736 Ok(())
31737 }
31738
31739 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
31740 }
31741 })
31742 }
31743 }
31744
31745 impl<'de> OfferStorage<'de> {
31746 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31747 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
31748 }
31749
31750 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31751 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
31752 }
31753
31754 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31755 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
31756 }
31757
31758 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31759 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
31760 }
31761
31762 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
31763 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
31764 }
31765 }
31766
31767 impl<'de> ::core::fmt::Debug for OfferStorage<'de> {
31768 fn fmt(
31769 &self,
31770 f: &mut ::core::fmt::Formatter<'_>,
31771 ) -> ::core::result::Result<(), ::core::fmt::Error> {
31772 f.debug_struct("OfferStorage")
31773 .field("source_name", &self.source_name())
31774 .field("source", &self.source())
31775 .field("target", &self.target())
31776 .field("target_name", &self.target_name())
31777 .field("availability", &self.availability())
31778 .finish()
31779 }
31780 }
31781
31782 impl<'de> ::fidl_next::IntoNatural for OfferStorage<'de> {
31783 type Natural = crate::natural::OfferStorage;
31784 }
31785
31786 #[repr(C)]
31788 pub struct OfferRunner<'de> {
31789 pub(crate) table: ::fidl_next::wire::Table<'de>,
31790 }
31791
31792 impl<'de> Drop for OfferRunner<'de> {
31793 fn drop(&mut self) {
31794 let _ = self
31795 .table
31796 .get(1)
31797 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31798
31799 let _ = self.table.get(2).map(|envelope| unsafe {
31800 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31801 });
31802
31803 let _ = self
31804 .table
31805 .get(3)
31806 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31807
31808 let _ = self.table.get(4).map(|envelope| unsafe {
31809 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31810 });
31811
31812 let _ = self.table.get(5).map(|envelope| unsafe {
31813 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31814 });
31815 }
31816 }
31817
31818 impl ::fidl_next::Constrained for OfferRunner<'_> {
31819 type Constraint = ();
31820
31821 fn validate(
31822 _: ::fidl_next::Slot<'_, Self>,
31823 _: Self::Constraint,
31824 ) -> Result<(), ::fidl_next::ValidationError> {
31825 Ok(())
31826 }
31827 }
31828
31829 unsafe impl ::fidl_next::Wire for OfferRunner<'static> {
31830 type Narrowed<'de> = OfferRunner<'de>;
31831
31832 #[inline]
31833 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31834 ::fidl_next::munge!(let Self { table } = out);
31835 ::fidl_next::wire::Table::zero_padding(table);
31836 }
31837 }
31838
31839 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferRunner<'de>
31840 where
31841 ___D: ::fidl_next::Decoder<'de> + ?Sized,
31842 {
31843 fn decode(
31844 slot: ::fidl_next::Slot<'_, Self>,
31845 decoder: &mut ___D,
31846 _: (),
31847 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
31848 ::fidl_next::munge!(let Self { table } = slot);
31849
31850 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
31851 match ordinal {
31852 0 => unsafe { ::core::hint::unreachable_unchecked() },
31853
31854 1 => {
31855 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
31856 slot.as_mut(),
31857 decoder,
31858 (),
31859 )?;
31860
31861 Ok(())
31862 }
31863
31864 2 => {
31865 ::fidl_next::wire::Envelope::decode_as::<
31866 ___D,
31867 ::fidl_next::wire::String<'de>,
31868 >(slot.as_mut(), decoder, 100)?;
31869
31870 let value = unsafe {
31871 slot.deref_unchecked()
31872 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31873 };
31874
31875 if value.len() > 100 {
31876 return Err(::fidl_next::DecodeError::VectorTooLong {
31877 size: value.len() as u64,
31878 limit: 100,
31879 });
31880 }
31881
31882 Ok(())
31883 }
31884
31885 3 => {
31886 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
31887 slot.as_mut(),
31888 decoder,
31889 (),
31890 )?;
31891
31892 Ok(())
31893 }
31894
31895 4 => {
31896 ::fidl_next::wire::Envelope::decode_as::<
31897 ___D,
31898 ::fidl_next::wire::String<'de>,
31899 >(slot.as_mut(), decoder, 100)?;
31900
31901 let value = unsafe {
31902 slot.deref_unchecked()
31903 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31904 };
31905
31906 if value.len() > 100 {
31907 return Err(::fidl_next::DecodeError::VectorTooLong {
31908 size: value.len() as u64,
31909 limit: 100,
31910 });
31911 }
31912
31913 Ok(())
31914 }
31915
31916 5 => {
31917 ::fidl_next::wire::Envelope::decode_as::<
31918 ___D,
31919 ::fidl_next::wire::String<'de>,
31920 >(slot.as_mut(), decoder, 1024)?;
31921
31922 let value = unsafe {
31923 slot.deref_unchecked()
31924 .deref_unchecked::<::fidl_next::wire::String<'_>>()
31925 };
31926
31927 if value.len() > 1024 {
31928 return Err(::fidl_next::DecodeError::VectorTooLong {
31929 size: value.len() as u64,
31930 limit: 1024,
31931 });
31932 }
31933
31934 Ok(())
31935 }
31936
31937 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
31938 }
31939 })
31940 }
31941 }
31942
31943 impl<'de> OfferRunner<'de> {
31944 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31945 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
31946 }
31947
31948 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31949 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
31950 }
31951
31952 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31953 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
31954 }
31955
31956 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31957 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
31958 }
31959
31960 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
31961 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
31962 }
31963 }
31964
31965 impl<'de> ::core::fmt::Debug for OfferRunner<'de> {
31966 fn fmt(
31967 &self,
31968 f: &mut ::core::fmt::Formatter<'_>,
31969 ) -> ::core::result::Result<(), ::core::fmt::Error> {
31970 f.debug_struct("OfferRunner")
31971 .field("source", &self.source())
31972 .field("source_name", &self.source_name())
31973 .field("target", &self.target())
31974 .field("target_name", &self.target_name())
31975 .field("source_dictionary", &self.source_dictionary())
31976 .finish()
31977 }
31978 }
31979
31980 impl<'de> ::fidl_next::IntoNatural for OfferRunner<'de> {
31981 type Natural = crate::natural::OfferRunner;
31982 }
31983
31984 #[repr(C)]
31986 pub struct OfferResolver<'de> {
31987 pub(crate) table: ::fidl_next::wire::Table<'de>,
31988 }
31989
31990 impl<'de> Drop for OfferResolver<'de> {
31991 fn drop(&mut self) {
31992 let _ = self
31993 .table
31994 .get(1)
31995 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31996
31997 let _ = self.table.get(2).map(|envelope| unsafe {
31998 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
31999 });
32000
32001 let _ = self
32002 .table
32003 .get(3)
32004 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
32005
32006 let _ = self.table.get(4).map(|envelope| unsafe {
32007 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
32008 });
32009
32010 let _ = self.table.get(5).map(|envelope| unsafe {
32011 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
32012 });
32013 }
32014 }
32015
32016 impl ::fidl_next::Constrained for OfferResolver<'_> {
32017 type Constraint = ();
32018
32019 fn validate(
32020 _: ::fidl_next::Slot<'_, Self>,
32021 _: Self::Constraint,
32022 ) -> Result<(), ::fidl_next::ValidationError> {
32023 Ok(())
32024 }
32025 }
32026
32027 unsafe impl ::fidl_next::Wire for OfferResolver<'static> {
32028 type Narrowed<'de> = OfferResolver<'de>;
32029
32030 #[inline]
32031 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32032 ::fidl_next::munge!(let Self { table } = out);
32033 ::fidl_next::wire::Table::zero_padding(table);
32034 }
32035 }
32036
32037 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferResolver<'de>
32038 where
32039 ___D: ::fidl_next::Decoder<'de> + ?Sized,
32040 {
32041 fn decode(
32042 slot: ::fidl_next::Slot<'_, Self>,
32043 decoder: &mut ___D,
32044 _: (),
32045 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32046 ::fidl_next::munge!(let Self { table } = slot);
32047
32048 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32049 match ordinal {
32050 0 => unsafe { ::core::hint::unreachable_unchecked() },
32051
32052 1 => {
32053 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
32054 slot.as_mut(),
32055 decoder,
32056 (),
32057 )?;
32058
32059 Ok(())
32060 }
32061
32062 2 => {
32063 ::fidl_next::wire::Envelope::decode_as::<
32064 ___D,
32065 ::fidl_next::wire::String<'de>,
32066 >(slot.as_mut(), decoder, 100)?;
32067
32068 let value = unsafe {
32069 slot.deref_unchecked()
32070 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32071 };
32072
32073 if value.len() > 100 {
32074 return Err(::fidl_next::DecodeError::VectorTooLong {
32075 size: value.len() as u64,
32076 limit: 100,
32077 });
32078 }
32079
32080 Ok(())
32081 }
32082
32083 3 => {
32084 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
32085 slot.as_mut(),
32086 decoder,
32087 (),
32088 )?;
32089
32090 Ok(())
32091 }
32092
32093 4 => {
32094 ::fidl_next::wire::Envelope::decode_as::<
32095 ___D,
32096 ::fidl_next::wire::String<'de>,
32097 >(slot.as_mut(), decoder, 100)?;
32098
32099 let value = unsafe {
32100 slot.deref_unchecked()
32101 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32102 };
32103
32104 if value.len() > 100 {
32105 return Err(::fidl_next::DecodeError::VectorTooLong {
32106 size: value.len() as u64,
32107 limit: 100,
32108 });
32109 }
32110
32111 Ok(())
32112 }
32113
32114 5 => {
32115 ::fidl_next::wire::Envelope::decode_as::<
32116 ___D,
32117 ::fidl_next::wire::String<'de>,
32118 >(slot.as_mut(), decoder, 1024)?;
32119
32120 let value = unsafe {
32121 slot.deref_unchecked()
32122 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32123 };
32124
32125 if value.len() > 1024 {
32126 return Err(::fidl_next::DecodeError::VectorTooLong {
32127 size: value.len() as u64,
32128 limit: 1024,
32129 });
32130 }
32131
32132 Ok(())
32133 }
32134
32135 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
32136 }
32137 })
32138 }
32139 }
32140
32141 impl<'de> OfferResolver<'de> {
32142 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
32143 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
32144 }
32145
32146 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32147 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
32148 }
32149
32150 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
32151 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
32152 }
32153
32154 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32155 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
32156 }
32157
32158 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32159 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
32160 }
32161 }
32162
32163 impl<'de> ::core::fmt::Debug for OfferResolver<'de> {
32164 fn fmt(
32165 &self,
32166 f: &mut ::core::fmt::Formatter<'_>,
32167 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32168 f.debug_struct("OfferResolver")
32169 .field("source", &self.source())
32170 .field("source_name", &self.source_name())
32171 .field("target", &self.target())
32172 .field("target_name", &self.target_name())
32173 .field("source_dictionary", &self.source_dictionary())
32174 .finish()
32175 }
32176 }
32177
32178 impl<'de> ::fidl_next::IntoNatural for OfferResolver<'de> {
32179 type Natural = crate::natural::OfferResolver;
32180 }
32181
32182 #[repr(C)]
32184 pub struct OfferEventStream<'de> {
32185 pub(crate) table: ::fidl_next::wire::Table<'de>,
32186 }
32187
32188 impl<'de> Drop for OfferEventStream<'de> {
32189 fn drop(&mut self) {
32190 let _ = self
32191 .table
32192 .get(1)
32193 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
32194
32195 let _ = self.table.get(2).map(|envelope| unsafe {
32196 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
32197 });
32198
32199 let _ = self.table.get(3).map(|envelope| unsafe {
32200 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>>()
32201 });
32202
32203 let _ = self
32204 .table
32205 .get(4)
32206 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
32207
32208 let _ = self.table.get(5).map(|envelope| unsafe {
32209 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
32210 });
32211
32212 let _ = self
32213 .table
32214 .get(7)
32215 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
32216 }
32217 }
32218
32219 impl ::fidl_next::Constrained for OfferEventStream<'_> {
32220 type Constraint = ();
32221
32222 fn validate(
32223 _: ::fidl_next::Slot<'_, Self>,
32224 _: Self::Constraint,
32225 ) -> Result<(), ::fidl_next::ValidationError> {
32226 Ok(())
32227 }
32228 }
32229
32230 unsafe impl ::fidl_next::Wire for OfferEventStream<'static> {
32231 type Narrowed<'de> = OfferEventStream<'de>;
32232
32233 #[inline]
32234 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32235 ::fidl_next::munge!(let Self { table } = out);
32236 ::fidl_next::wire::Table::zero_padding(table);
32237 }
32238 }
32239
32240 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferEventStream<'de>
32241 where
32242 ___D: ::fidl_next::Decoder<'de> + ?Sized,
32243 {
32244 fn decode(
32245 slot: ::fidl_next::Slot<'_, Self>,
32246 decoder: &mut ___D,
32247 _: (),
32248 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32249 ::fidl_next::munge!(let Self { table } = slot);
32250
32251 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32252 match ordinal {
32253 0 => unsafe { ::core::hint::unreachable_unchecked() },
32254
32255 1 => {
32256 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
32257 slot.as_mut(),
32258 decoder,
32259 (),
32260 )?;
32261
32262 Ok(())
32263 }
32264
32265 2 => {
32266 ::fidl_next::wire::Envelope::decode_as::<
32267 ___D,
32268 ::fidl_next::wire::String<'de>,
32269 >(slot.as_mut(), decoder, 100)?;
32270
32271 let value = unsafe {
32272 slot.deref_unchecked()
32273 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32274 };
32275
32276 if value.len() > 100 {
32277 return Err(::fidl_next::DecodeError::VectorTooLong {
32278 size: value.len() as u64,
32279 limit: 100,
32280 });
32281 }
32282
32283 Ok(())
32284 }
32285
32286 3 => {
32287 ::fidl_next::wire::Envelope::decode_as::<
32288 ___D,
32289 ::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>,
32290 >(slot.as_mut(), decoder, (4294967295, ()))?;
32291
32292 Ok(())
32293 }
32294
32295 4 => {
32296 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
32297 slot.as_mut(),
32298 decoder,
32299 (),
32300 )?;
32301
32302 Ok(())
32303 }
32304
32305 5 => {
32306 ::fidl_next::wire::Envelope::decode_as::<
32307 ___D,
32308 ::fidl_next::wire::String<'de>,
32309 >(slot.as_mut(), decoder, 100)?;
32310
32311 let value = unsafe {
32312 slot.deref_unchecked()
32313 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32314 };
32315
32316 if value.len() > 100 {
32317 return Err(::fidl_next::DecodeError::VectorTooLong {
32318 size: value.len() as u64,
32319 limit: 100,
32320 });
32321 }
32322
32323 Ok(())
32324 }
32325
32326 7 => {
32327 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
32328 slot.as_mut(),
32329 decoder,
32330 (),
32331 )?;
32332
32333 Ok(())
32334 }
32335
32336 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
32337 }
32338 })
32339 }
32340 }
32341
32342 impl<'de> OfferEventStream<'de> {
32343 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
32344 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
32345 }
32346
32347 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32348 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
32349 }
32350
32351 pub fn scope(
32352 &self,
32353 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Ref<'de>>>
32354 {
32355 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
32356 }
32357
32358 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
32359 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
32360 }
32361
32362 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32363 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
32364 }
32365
32366 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
32367 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
32368 }
32369 }
32370
32371 impl<'de> ::core::fmt::Debug for OfferEventStream<'de> {
32372 fn fmt(
32373 &self,
32374 f: &mut ::core::fmt::Formatter<'_>,
32375 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32376 f.debug_struct("OfferEventStream")
32377 .field("source", &self.source())
32378 .field("source_name", &self.source_name())
32379 .field("scope", &self.scope())
32380 .field("target", &self.target())
32381 .field("target_name", &self.target_name())
32382 .field("availability", &self.availability())
32383 .finish()
32384 }
32385 }
32386
32387 impl<'de> ::fidl_next::IntoNatural for OfferEventStream<'de> {
32388 type Natural = crate::natural::OfferEventStream;
32389 }
32390
32391 #[repr(C)]
32393 pub struct OfferDictionary<'de> {
32394 pub(crate) table: ::fidl_next::wire::Table<'de>,
32395 }
32396
32397 impl<'de> Drop for OfferDictionary<'de> {
32398 fn drop(&mut self) {
32399 let _ = self
32400 .table
32401 .get(1)
32402 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
32403
32404 let _ = self.table.get(2).map(|envelope| unsafe {
32405 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
32406 });
32407
32408 let _ = self
32409 .table
32410 .get(3)
32411 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
32412
32413 let _ = self.table.get(4).map(|envelope| unsafe {
32414 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
32415 });
32416
32417 let _ = self.table.get(5).map(|envelope| unsafe {
32418 envelope.read_unchecked::<crate::wire::DependencyType>()
32419 });
32420
32421 let _ = self
32422 .table
32423 .get(6)
32424 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
32425
32426 let _ = self.table.get(7).map(|envelope| unsafe {
32427 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
32428 });
32429 }
32430 }
32431
32432 impl ::fidl_next::Constrained for OfferDictionary<'_> {
32433 type Constraint = ();
32434
32435 fn validate(
32436 _: ::fidl_next::Slot<'_, Self>,
32437 _: Self::Constraint,
32438 ) -> Result<(), ::fidl_next::ValidationError> {
32439 Ok(())
32440 }
32441 }
32442
32443 unsafe impl ::fidl_next::Wire for OfferDictionary<'static> {
32444 type Narrowed<'de> = OfferDictionary<'de>;
32445
32446 #[inline]
32447 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32448 ::fidl_next::munge!(let Self { table } = out);
32449 ::fidl_next::wire::Table::zero_padding(table);
32450 }
32451 }
32452
32453 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferDictionary<'de>
32454 where
32455 ___D: ::fidl_next::Decoder<'de> + ?Sized,
32456 {
32457 fn decode(
32458 slot: ::fidl_next::Slot<'_, Self>,
32459 decoder: &mut ___D,
32460 _: (),
32461 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32462 ::fidl_next::munge!(let Self { table } = slot);
32463
32464 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32465 match ordinal {
32466 0 => unsafe { ::core::hint::unreachable_unchecked() },
32467
32468 1 => {
32469 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
32470 slot.as_mut(),
32471 decoder,
32472 (),
32473 )?;
32474
32475 Ok(())
32476 }
32477
32478 2 => {
32479 ::fidl_next::wire::Envelope::decode_as::<
32480 ___D,
32481 ::fidl_next::wire::String<'de>,
32482 >(slot.as_mut(), decoder, 100)?;
32483
32484 let value = unsafe {
32485 slot.deref_unchecked()
32486 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32487 };
32488
32489 if value.len() > 100 {
32490 return Err(::fidl_next::DecodeError::VectorTooLong {
32491 size: value.len() as u64,
32492 limit: 100,
32493 });
32494 }
32495
32496 Ok(())
32497 }
32498
32499 3 => {
32500 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
32501 slot.as_mut(),
32502 decoder,
32503 (),
32504 )?;
32505
32506 Ok(())
32507 }
32508
32509 4 => {
32510 ::fidl_next::wire::Envelope::decode_as::<
32511 ___D,
32512 ::fidl_next::wire::String<'de>,
32513 >(slot.as_mut(), decoder, 100)?;
32514
32515 let value = unsafe {
32516 slot.deref_unchecked()
32517 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32518 };
32519
32520 if value.len() > 100 {
32521 return Err(::fidl_next::DecodeError::VectorTooLong {
32522 size: value.len() as u64,
32523 limit: 100,
32524 });
32525 }
32526
32527 Ok(())
32528 }
32529
32530 5 => {
32531 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DependencyType>(
32532 slot.as_mut(),
32533 decoder,
32534 (),
32535 )?;
32536
32537 Ok(())
32538 }
32539
32540 6 => {
32541 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
32542 slot.as_mut(),
32543 decoder,
32544 (),
32545 )?;
32546
32547 Ok(())
32548 }
32549
32550 7 => {
32551 ::fidl_next::wire::Envelope::decode_as::<
32552 ___D,
32553 ::fidl_next::wire::String<'de>,
32554 >(slot.as_mut(), decoder, 1024)?;
32555
32556 let value = unsafe {
32557 slot.deref_unchecked()
32558 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32559 };
32560
32561 if value.len() > 1024 {
32562 return Err(::fidl_next::DecodeError::VectorTooLong {
32563 size: value.len() as u64,
32564 limit: 1024,
32565 });
32566 }
32567
32568 Ok(())
32569 }
32570
32571 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
32572 }
32573 })
32574 }
32575 }
32576
32577 impl<'de> OfferDictionary<'de> {
32578 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
32579 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
32580 }
32581
32582 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32583 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
32584 }
32585
32586 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
32587 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
32588 }
32589
32590 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32591 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
32592 }
32593
32594 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
32595 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
32596 }
32597
32598 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
32599 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
32600 }
32601
32602 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32603 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
32604 }
32605 }
32606
32607 impl<'de> ::core::fmt::Debug for OfferDictionary<'de> {
32608 fn fmt(
32609 &self,
32610 f: &mut ::core::fmt::Formatter<'_>,
32611 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32612 f.debug_struct("OfferDictionary")
32613 .field("source", &self.source())
32614 .field("source_name", &self.source_name())
32615 .field("target", &self.target())
32616 .field("target_name", &self.target_name())
32617 .field("dependency_type", &self.dependency_type())
32618 .field("availability", &self.availability())
32619 .field("source_dictionary", &self.source_dictionary())
32620 .finish()
32621 }
32622 }
32623
32624 impl<'de> ::fidl_next::IntoNatural for OfferDictionary<'de> {
32625 type Natural = crate::natural::OfferDictionary;
32626 }
32627
32628 #[repr(C)]
32630 pub struct OfferConfiguration<'de> {
32631 pub(crate) table: ::fidl_next::wire::Table<'de>,
32632 }
32633
32634 impl<'de> Drop for OfferConfiguration<'de> {
32635 fn drop(&mut self) {
32636 let _ = self
32637 .table
32638 .get(1)
32639 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
32640
32641 let _ = self.table.get(2).map(|envelope| unsafe {
32642 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
32643 });
32644
32645 let _ = self
32646 .table
32647 .get(3)
32648 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
32649
32650 let _ = self.table.get(4).map(|envelope| unsafe {
32651 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
32652 });
32653
32654 let _ = self
32655 .table
32656 .get(5)
32657 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
32658
32659 let _ = self.table.get(6).map(|envelope| unsafe {
32660 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
32661 });
32662 }
32663 }
32664
32665 impl ::fidl_next::Constrained for OfferConfiguration<'_> {
32666 type Constraint = ();
32667
32668 fn validate(
32669 _: ::fidl_next::Slot<'_, Self>,
32670 _: Self::Constraint,
32671 ) -> Result<(), ::fidl_next::ValidationError> {
32672 Ok(())
32673 }
32674 }
32675
32676 unsafe impl ::fidl_next::Wire for OfferConfiguration<'static> {
32677 type Narrowed<'de> = OfferConfiguration<'de>;
32678
32679 #[inline]
32680 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32681 ::fidl_next::munge!(let Self { table } = out);
32682 ::fidl_next::wire::Table::zero_padding(table);
32683 }
32684 }
32685
32686 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for OfferConfiguration<'de>
32687 where
32688 ___D: ::fidl_next::Decoder<'de> + ?Sized,
32689 {
32690 fn decode(
32691 slot: ::fidl_next::Slot<'_, Self>,
32692 decoder: &mut ___D,
32693 _: (),
32694 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32695 ::fidl_next::munge!(let Self { table } = slot);
32696
32697 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32698 match ordinal {
32699 0 => unsafe { ::core::hint::unreachable_unchecked() },
32700
32701 1 => {
32702 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
32703 slot.as_mut(),
32704 decoder,
32705 (),
32706 )?;
32707
32708 Ok(())
32709 }
32710
32711 2 => {
32712 ::fidl_next::wire::Envelope::decode_as::<
32713 ___D,
32714 ::fidl_next::wire::String<'de>,
32715 >(slot.as_mut(), decoder, 100)?;
32716
32717 let value = unsafe {
32718 slot.deref_unchecked()
32719 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32720 };
32721
32722 if value.len() > 100 {
32723 return Err(::fidl_next::DecodeError::VectorTooLong {
32724 size: value.len() as u64,
32725 limit: 100,
32726 });
32727 }
32728
32729 Ok(())
32730 }
32731
32732 3 => {
32733 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
32734 slot.as_mut(),
32735 decoder,
32736 (),
32737 )?;
32738
32739 Ok(())
32740 }
32741
32742 4 => {
32743 ::fidl_next::wire::Envelope::decode_as::<
32744 ___D,
32745 ::fidl_next::wire::String<'de>,
32746 >(slot.as_mut(), decoder, 100)?;
32747
32748 let value = unsafe {
32749 slot.deref_unchecked()
32750 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32751 };
32752
32753 if value.len() > 100 {
32754 return Err(::fidl_next::DecodeError::VectorTooLong {
32755 size: value.len() as u64,
32756 limit: 100,
32757 });
32758 }
32759
32760 Ok(())
32761 }
32762
32763 5 => {
32764 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Availability>(
32765 slot.as_mut(),
32766 decoder,
32767 (),
32768 )?;
32769
32770 Ok(())
32771 }
32772
32773 6 => {
32774 ::fidl_next::wire::Envelope::decode_as::<
32775 ___D,
32776 ::fidl_next::wire::String<'de>,
32777 >(slot.as_mut(), decoder, 1024)?;
32778
32779 let value = unsafe {
32780 slot.deref_unchecked()
32781 .deref_unchecked::<::fidl_next::wire::String<'_>>()
32782 };
32783
32784 if value.len() > 1024 {
32785 return Err(::fidl_next::DecodeError::VectorTooLong {
32786 size: value.len() as u64,
32787 limit: 1024,
32788 });
32789 }
32790
32791 Ok(())
32792 }
32793
32794 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
32795 }
32796 })
32797 }
32798 }
32799
32800 impl<'de> OfferConfiguration<'de> {
32801 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
32802 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
32803 }
32804
32805 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32806 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
32807 }
32808
32809 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
32810 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
32811 }
32812
32813 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32814 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
32815 }
32816
32817 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
32818 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
32819 }
32820
32821 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
32822 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
32823 }
32824 }
32825
32826 impl<'de> ::core::fmt::Debug for OfferConfiguration<'de> {
32827 fn fmt(
32828 &self,
32829 f: &mut ::core::fmt::Formatter<'_>,
32830 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32831 f.debug_struct("OfferConfiguration")
32832 .field("source", &self.source())
32833 .field("source_name", &self.source_name())
32834 .field("target", &self.target())
32835 .field("target_name", &self.target_name())
32836 .field("availability", &self.availability())
32837 .field("source_dictionary", &self.source_dictionary())
32838 .finish()
32839 }
32840 }
32841
32842 impl<'de> ::fidl_next::IntoNatural for OfferConfiguration<'de> {
32843 type Natural = crate::natural::OfferConfiguration;
32844 }
32845
32846 #[repr(transparent)]
32848 pub struct Offer<'de> {
32849 pub(crate) raw: ::fidl_next::wire::Union,
32850 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
32851 }
32852
32853 impl<'de> Drop for Offer<'de> {
32854 fn drop(&mut self) {
32855 match self.raw.ordinal() {
32856 1 => {
32857 let _ = unsafe {
32858 self.raw.get().read_unchecked::<crate::wire::OfferService<'de>>()
32859 };
32860 }
32861
32862 2 => {
32863 let _ = unsafe {
32864 self.raw.get().read_unchecked::<crate::wire::OfferProtocol<'de>>()
32865 };
32866 }
32867
32868 3 => {
32869 let _ = unsafe {
32870 self.raw.get().read_unchecked::<crate::wire::OfferDirectory<'de>>()
32871 };
32872 }
32873
32874 4 => {
32875 let _ = unsafe {
32876 self.raw.get().read_unchecked::<crate::wire::OfferStorage<'de>>()
32877 };
32878 }
32879
32880 5 => {
32881 let _ =
32882 unsafe { self.raw.get().read_unchecked::<crate::wire::OfferRunner<'de>>() };
32883 }
32884
32885 6 => {
32886 let _ = unsafe {
32887 self.raw.get().read_unchecked::<crate::wire::OfferResolver<'de>>()
32888 };
32889 }
32890
32891 8 => {
32892 let _ = unsafe {
32893 self.raw.get().read_unchecked::<crate::wire::OfferEventStream<'de>>()
32894 };
32895 }
32896
32897 9 => {
32898 let _ = unsafe {
32899 self.raw.get().read_unchecked::<crate::wire::OfferDictionary<'de>>()
32900 };
32901 }
32902
32903 10 => {
32904 let _ = unsafe {
32905 self.raw.get().read_unchecked::<crate::wire::OfferConfiguration<'de>>()
32906 };
32907 }
32908
32909 _ => (),
32910 }
32911 }
32912 }
32913
32914 impl ::fidl_next::Constrained for Offer<'_> {
32915 type Constraint = ();
32916
32917 fn validate(
32918 _: ::fidl_next::Slot<'_, Self>,
32919 _: Self::Constraint,
32920 ) -> Result<(), ::fidl_next::ValidationError> {
32921 Ok(())
32922 }
32923 }
32924
32925 unsafe impl ::fidl_next::Wire for Offer<'static> {
32926 type Narrowed<'de> = Offer<'de>;
32927
32928 #[inline]
32929 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32930 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
32931 ::fidl_next::wire::Union::zero_padding(raw);
32932 }
32933 }
32934
32935 pub mod offer {
32936 pub enum Ref<'de> {
32937 Service(&'de crate::wire::OfferService<'de>),
32938
32939 Protocol(&'de crate::wire::OfferProtocol<'de>),
32940
32941 Directory(&'de crate::wire::OfferDirectory<'de>),
32942
32943 Storage(&'de crate::wire::OfferStorage<'de>),
32944
32945 Runner(&'de crate::wire::OfferRunner<'de>),
32946
32947 Resolver(&'de crate::wire::OfferResolver<'de>),
32948
32949 EventStream(&'de crate::wire::OfferEventStream<'de>),
32950
32951 Dictionary(&'de crate::wire::OfferDictionary<'de>),
32952
32953 Config(&'de crate::wire::OfferConfiguration<'de>),
32954
32955 UnknownOrdinal_(u64),
32956 }
32957 }
32958
32959 impl<'de> Offer<'de> {
32960 pub fn as_ref(&self) -> crate::wire::offer::Ref<'_> {
32961 match self.raw.ordinal() {
32962 1 => crate::wire::offer::Ref::Service(unsafe {
32963 self.raw.get().deref_unchecked::<crate::wire::OfferService<'_>>()
32964 }),
32965
32966 2 => crate::wire::offer::Ref::Protocol(unsafe {
32967 self.raw.get().deref_unchecked::<crate::wire::OfferProtocol<'_>>()
32968 }),
32969
32970 3 => crate::wire::offer::Ref::Directory(unsafe {
32971 self.raw.get().deref_unchecked::<crate::wire::OfferDirectory<'_>>()
32972 }),
32973
32974 4 => crate::wire::offer::Ref::Storage(unsafe {
32975 self.raw.get().deref_unchecked::<crate::wire::OfferStorage<'_>>()
32976 }),
32977
32978 5 => crate::wire::offer::Ref::Runner(unsafe {
32979 self.raw.get().deref_unchecked::<crate::wire::OfferRunner<'_>>()
32980 }),
32981
32982 6 => crate::wire::offer::Ref::Resolver(unsafe {
32983 self.raw.get().deref_unchecked::<crate::wire::OfferResolver<'_>>()
32984 }),
32985
32986 8 => crate::wire::offer::Ref::EventStream(unsafe {
32987 self.raw.get().deref_unchecked::<crate::wire::OfferEventStream<'_>>()
32988 }),
32989
32990 9 => crate::wire::offer::Ref::Dictionary(unsafe {
32991 self.raw.get().deref_unchecked::<crate::wire::OfferDictionary<'_>>()
32992 }),
32993
32994 10 => crate::wire::offer::Ref::Config(unsafe {
32995 self.raw.get().deref_unchecked::<crate::wire::OfferConfiguration<'_>>()
32996 }),
32997
32998 unknown => crate::wire::offer::Ref::UnknownOrdinal_(unknown),
32999 }
33000 }
33001 }
33002
33003 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Offer<'de>
33004 where
33005 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
33006 ___D: ::fidl_next::Decoder<'de>,
33007 {
33008 fn decode(
33009 mut slot: ::fidl_next::Slot<'_, Self>,
33010 decoder: &mut ___D,
33011 _: (),
33012 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33013 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
33014 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
33015 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferService<'de>>(
33016 raw,
33017 decoder,
33018 (),
33019 )?,
33020
33021 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferProtocol<'de>>(
33022 raw,
33023 decoder,
33024 (),
33025 )?,
33026
33027 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferDirectory<'de>>(
33028 raw,
33029 decoder,
33030 (),
33031 )?,
33032
33033 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferStorage<'de>>(
33034 raw,
33035 decoder,
33036 (),
33037 )?,
33038
33039 5 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferRunner<'de>>(
33040 raw,
33041 decoder,
33042 (),
33043 )?,
33044
33045 6 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferResolver<'de>>(
33046 raw,
33047 decoder,
33048 (),
33049 )?,
33050
33051 8 => {
33052 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferEventStream<'de>>(
33053 raw,
33054 decoder,
33055 (),
33056 )?
33057 }
33058
33059 9 => {
33060 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferDictionary<'de>>(
33061 raw,
33062 decoder,
33063 (),
33064 )?
33065 }
33066
33067 10 => ::fidl_next::wire::Union::decode_as::<
33068 ___D,
33069 crate::wire::OfferConfiguration<'de>,
33070 >(raw, decoder, ())?,
33071
33072 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
33073 }
33074
33075 Ok(())
33076 }
33077 }
33078
33079 impl<'de> ::core::fmt::Debug for Offer<'de> {
33080 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
33081 match self.raw.ordinal() {
33082 1 => unsafe {
33083 self.raw.get().deref_unchecked::<crate::wire::OfferService<'_>>().fmt(f)
33084 },
33085 2 => unsafe {
33086 self.raw.get().deref_unchecked::<crate::wire::OfferProtocol<'_>>().fmt(f)
33087 },
33088 3 => unsafe {
33089 self.raw.get().deref_unchecked::<crate::wire::OfferDirectory<'_>>().fmt(f)
33090 },
33091 4 => unsafe {
33092 self.raw.get().deref_unchecked::<crate::wire::OfferStorage<'_>>().fmt(f)
33093 },
33094 5 => unsafe {
33095 self.raw.get().deref_unchecked::<crate::wire::OfferRunner<'_>>().fmt(f)
33096 },
33097 6 => unsafe {
33098 self.raw.get().deref_unchecked::<crate::wire::OfferResolver<'_>>().fmt(f)
33099 },
33100 8 => unsafe {
33101 self.raw.get().deref_unchecked::<crate::wire::OfferEventStream<'_>>().fmt(f)
33102 },
33103 9 => unsafe {
33104 self.raw.get().deref_unchecked::<crate::wire::OfferDictionary<'_>>().fmt(f)
33105 },
33106 10 => unsafe {
33107 self.raw.get().deref_unchecked::<crate::wire::OfferConfiguration<'_>>().fmt(f)
33108 },
33109 _ => unsafe { ::core::hint::unreachable_unchecked() },
33110 }
33111 }
33112 }
33113
33114 impl<'de> ::fidl_next::IntoNatural for Offer<'de> {
33115 type Natural = crate::natural::Offer;
33116 }
33117
33118 #[repr(C)]
33120 pub struct RunnerRegistration<'de> {
33121 pub(crate) table: ::fidl_next::wire::Table<'de>,
33122 }
33123
33124 impl<'de> Drop for RunnerRegistration<'de> {
33125 fn drop(&mut self) {
33126 let _ = self.table.get(1).map(|envelope| unsafe {
33127 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
33128 });
33129
33130 let _ = self
33131 .table
33132 .get(2)
33133 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
33134
33135 let _ = self.table.get(3).map(|envelope| unsafe {
33136 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
33137 });
33138 }
33139 }
33140
33141 impl ::fidl_next::Constrained for RunnerRegistration<'_> {
33142 type Constraint = ();
33143
33144 fn validate(
33145 _: ::fidl_next::Slot<'_, Self>,
33146 _: Self::Constraint,
33147 ) -> Result<(), ::fidl_next::ValidationError> {
33148 Ok(())
33149 }
33150 }
33151
33152 unsafe impl ::fidl_next::Wire for RunnerRegistration<'static> {
33153 type Narrowed<'de> = RunnerRegistration<'de>;
33154
33155 #[inline]
33156 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33157 ::fidl_next::munge!(let Self { table } = out);
33158 ::fidl_next::wire::Table::zero_padding(table);
33159 }
33160 }
33161
33162 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for RunnerRegistration<'de>
33163 where
33164 ___D: ::fidl_next::Decoder<'de> + ?Sized,
33165 {
33166 fn decode(
33167 slot: ::fidl_next::Slot<'_, Self>,
33168 decoder: &mut ___D,
33169 _: (),
33170 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33171 ::fidl_next::munge!(let Self { table } = slot);
33172
33173 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
33174 match ordinal {
33175 0 => unsafe { ::core::hint::unreachable_unchecked() },
33176
33177 1 => {
33178 ::fidl_next::wire::Envelope::decode_as::<
33179 ___D,
33180 ::fidl_next::wire::String<'de>,
33181 >(slot.as_mut(), decoder, 100)?;
33182
33183 let value = unsafe {
33184 slot.deref_unchecked()
33185 .deref_unchecked::<::fidl_next::wire::String<'_>>()
33186 };
33187
33188 if value.len() > 100 {
33189 return Err(::fidl_next::DecodeError::VectorTooLong {
33190 size: value.len() as u64,
33191 limit: 100,
33192 });
33193 }
33194
33195 Ok(())
33196 }
33197
33198 2 => {
33199 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
33200 slot.as_mut(),
33201 decoder,
33202 (),
33203 )?;
33204
33205 Ok(())
33206 }
33207
33208 3 => {
33209 ::fidl_next::wire::Envelope::decode_as::<
33210 ___D,
33211 ::fidl_next::wire::String<'de>,
33212 >(slot.as_mut(), decoder, 100)?;
33213
33214 let value = unsafe {
33215 slot.deref_unchecked()
33216 .deref_unchecked::<::fidl_next::wire::String<'_>>()
33217 };
33218
33219 if value.len() > 100 {
33220 return Err(::fidl_next::DecodeError::VectorTooLong {
33221 size: value.len() as u64,
33222 limit: 100,
33223 });
33224 }
33225
33226 Ok(())
33227 }
33228
33229 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
33230 }
33231 })
33232 }
33233 }
33234
33235 impl<'de> RunnerRegistration<'de> {
33236 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
33237 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
33238 }
33239
33240 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
33241 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
33242 }
33243
33244 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
33245 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
33246 }
33247 }
33248
33249 impl<'de> ::core::fmt::Debug for RunnerRegistration<'de> {
33250 fn fmt(
33251 &self,
33252 f: &mut ::core::fmt::Formatter<'_>,
33253 ) -> ::core::result::Result<(), ::core::fmt::Error> {
33254 f.debug_struct("RunnerRegistration")
33255 .field("source_name", &self.source_name())
33256 .field("source", &self.source())
33257 .field("target_name", &self.target_name())
33258 .finish()
33259 }
33260 }
33261
33262 impl<'de> ::fidl_next::IntoNatural for RunnerRegistration<'de> {
33263 type Natural = crate::natural::RunnerRegistration;
33264 }
33265
33266 #[repr(C)]
33268 pub struct ResolverRegistration<'de> {
33269 pub(crate) table: ::fidl_next::wire::Table<'de>,
33270 }
33271
33272 impl<'de> Drop for ResolverRegistration<'de> {
33273 fn drop(&mut self) {
33274 let _ = self.table.get(1).map(|envelope| unsafe {
33275 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
33276 });
33277
33278 let _ = self
33279 .table
33280 .get(2)
33281 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
33282
33283 let _ = self.table.get(3).map(|envelope| unsafe {
33284 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
33285 });
33286 }
33287 }
33288
33289 impl ::fidl_next::Constrained for ResolverRegistration<'_> {
33290 type Constraint = ();
33291
33292 fn validate(
33293 _: ::fidl_next::Slot<'_, Self>,
33294 _: Self::Constraint,
33295 ) -> Result<(), ::fidl_next::ValidationError> {
33296 Ok(())
33297 }
33298 }
33299
33300 unsafe impl ::fidl_next::Wire for ResolverRegistration<'static> {
33301 type Narrowed<'de> = ResolverRegistration<'de>;
33302
33303 #[inline]
33304 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33305 ::fidl_next::munge!(let Self { table } = out);
33306 ::fidl_next::wire::Table::zero_padding(table);
33307 }
33308 }
33309
33310 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ResolverRegistration<'de>
33311 where
33312 ___D: ::fidl_next::Decoder<'de> + ?Sized,
33313 {
33314 fn decode(
33315 slot: ::fidl_next::Slot<'_, Self>,
33316 decoder: &mut ___D,
33317 _: (),
33318 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33319 ::fidl_next::munge!(let Self { table } = slot);
33320
33321 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
33322 match ordinal {
33323 0 => unsafe { ::core::hint::unreachable_unchecked() },
33324
33325 1 => {
33326 ::fidl_next::wire::Envelope::decode_as::<
33327 ___D,
33328 ::fidl_next::wire::String<'de>,
33329 >(slot.as_mut(), decoder, 100)?;
33330
33331 let value = unsafe {
33332 slot.deref_unchecked()
33333 .deref_unchecked::<::fidl_next::wire::String<'_>>()
33334 };
33335
33336 if value.len() > 100 {
33337 return Err(::fidl_next::DecodeError::VectorTooLong {
33338 size: value.len() as u64,
33339 limit: 100,
33340 });
33341 }
33342
33343 Ok(())
33344 }
33345
33346 2 => {
33347 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
33348 slot.as_mut(),
33349 decoder,
33350 (),
33351 )?;
33352
33353 Ok(())
33354 }
33355
33356 3 => {
33357 ::fidl_next::wire::Envelope::decode_as::<
33358 ___D,
33359 ::fidl_next::wire::String<'de>,
33360 >(slot.as_mut(), decoder, 100)?;
33361
33362 let value = unsafe {
33363 slot.deref_unchecked()
33364 .deref_unchecked::<::fidl_next::wire::String<'_>>()
33365 };
33366
33367 if value.len() > 100 {
33368 return Err(::fidl_next::DecodeError::VectorTooLong {
33369 size: value.len() as u64,
33370 limit: 100,
33371 });
33372 }
33373
33374 Ok(())
33375 }
33376
33377 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
33378 }
33379 })
33380 }
33381 }
33382
33383 impl<'de> ResolverRegistration<'de> {
33384 pub fn resolver(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
33385 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
33386 }
33387
33388 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
33389 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
33390 }
33391
33392 pub fn scheme(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
33393 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
33394 }
33395 }
33396
33397 impl<'de> ::core::fmt::Debug for ResolverRegistration<'de> {
33398 fn fmt(
33399 &self,
33400 f: &mut ::core::fmt::Formatter<'_>,
33401 ) -> ::core::result::Result<(), ::core::fmt::Error> {
33402 f.debug_struct("ResolverRegistration")
33403 .field("resolver", &self.resolver())
33404 .field("source", &self.source())
33405 .field("scheme", &self.scheme())
33406 .finish()
33407 }
33408 }
33409
33410 impl<'de> ::fidl_next::IntoNatural for ResolverRegistration<'de> {
33411 type Natural = crate::natural::ResolverRegistration;
33412 }
33413
33414 #[repr(C)]
33416 pub struct DebugProtocolRegistration<'de> {
33417 pub(crate) table: ::fidl_next::wire::Table<'de>,
33418 }
33419
33420 impl<'de> Drop for DebugProtocolRegistration<'de> {
33421 fn drop(&mut self) {
33422 let _ = self
33423 .table
33424 .get(1)
33425 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
33426
33427 let _ = self.table.get(2).map(|envelope| unsafe {
33428 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
33429 });
33430
33431 let _ = self.table.get(3).map(|envelope| unsafe {
33432 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
33433 });
33434 }
33435 }
33436
33437 impl ::fidl_next::Constrained for DebugProtocolRegistration<'_> {
33438 type Constraint = ();
33439
33440 fn validate(
33441 _: ::fidl_next::Slot<'_, Self>,
33442 _: Self::Constraint,
33443 ) -> Result<(), ::fidl_next::ValidationError> {
33444 Ok(())
33445 }
33446 }
33447
33448 unsafe impl ::fidl_next::Wire for DebugProtocolRegistration<'static> {
33449 type Narrowed<'de> = DebugProtocolRegistration<'de>;
33450
33451 #[inline]
33452 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33453 ::fidl_next::munge!(let Self { table } = out);
33454 ::fidl_next::wire::Table::zero_padding(table);
33455 }
33456 }
33457
33458 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DebugProtocolRegistration<'de>
33459 where
33460 ___D: ::fidl_next::Decoder<'de> + ?Sized,
33461 {
33462 fn decode(
33463 slot: ::fidl_next::Slot<'_, Self>,
33464 decoder: &mut ___D,
33465 _: (),
33466 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33467 ::fidl_next::munge!(let Self { table } = slot);
33468
33469 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
33470 match ordinal {
33471 0 => unsafe { ::core::hint::unreachable_unchecked() },
33472
33473 1 => {
33474 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Ref<'de>>(
33475 slot.as_mut(),
33476 decoder,
33477 (),
33478 )?;
33479
33480 Ok(())
33481 }
33482
33483 2 => {
33484 ::fidl_next::wire::Envelope::decode_as::<
33485 ___D,
33486 ::fidl_next::wire::String<'de>,
33487 >(slot.as_mut(), decoder, 100)?;
33488
33489 let value = unsafe {
33490 slot.deref_unchecked()
33491 .deref_unchecked::<::fidl_next::wire::String<'_>>()
33492 };
33493
33494 if value.len() > 100 {
33495 return Err(::fidl_next::DecodeError::VectorTooLong {
33496 size: value.len() as u64,
33497 limit: 100,
33498 });
33499 }
33500
33501 Ok(())
33502 }
33503
33504 3 => {
33505 ::fidl_next::wire::Envelope::decode_as::<
33506 ___D,
33507 ::fidl_next::wire::String<'de>,
33508 >(slot.as_mut(), decoder, 100)?;
33509
33510 let value = unsafe {
33511 slot.deref_unchecked()
33512 .deref_unchecked::<::fidl_next::wire::String<'_>>()
33513 };
33514
33515 if value.len() > 100 {
33516 return Err(::fidl_next::DecodeError::VectorTooLong {
33517 size: value.len() as u64,
33518 limit: 100,
33519 });
33520 }
33521
33522 Ok(())
33523 }
33524
33525 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
33526 }
33527 })
33528 }
33529 }
33530
33531 impl<'de> DebugProtocolRegistration<'de> {
33532 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
33533 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
33534 }
33535
33536 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
33537 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
33538 }
33539
33540 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
33541 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
33542 }
33543 }
33544
33545 impl<'de> ::core::fmt::Debug for DebugProtocolRegistration<'de> {
33546 fn fmt(
33547 &self,
33548 f: &mut ::core::fmt::Formatter<'_>,
33549 ) -> ::core::result::Result<(), ::core::fmt::Error> {
33550 f.debug_struct("DebugProtocolRegistration")
33551 .field("source", &self.source())
33552 .field("source_name", &self.source_name())
33553 .field("target_name", &self.target_name())
33554 .finish()
33555 }
33556 }
33557
33558 impl<'de> ::fidl_next::IntoNatural for DebugProtocolRegistration<'de> {
33559 type Natural = crate::natural::DebugProtocolRegistration;
33560 }
33561
33562 #[repr(transparent)]
33564 pub struct DebugRegistration<'de> {
33565 pub(crate) raw: ::fidl_next::wire::Union,
33566 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
33567 }
33568
33569 impl<'de> Drop for DebugRegistration<'de> {
33570 fn drop(&mut self) {
33571 match self.raw.ordinal() {
33572 1 => {
33573 let _ = unsafe {
33574 self.raw
33575 .get()
33576 .read_unchecked::<crate::wire::DebugProtocolRegistration<'de>>()
33577 };
33578 }
33579
33580 _ => (),
33581 }
33582 }
33583 }
33584
33585 impl ::fidl_next::Constrained for DebugRegistration<'_> {
33586 type Constraint = ();
33587
33588 fn validate(
33589 _: ::fidl_next::Slot<'_, Self>,
33590 _: Self::Constraint,
33591 ) -> Result<(), ::fidl_next::ValidationError> {
33592 Ok(())
33593 }
33594 }
33595
33596 unsafe impl ::fidl_next::Wire for DebugRegistration<'static> {
33597 type Narrowed<'de> = DebugRegistration<'de>;
33598
33599 #[inline]
33600 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33601 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
33602 ::fidl_next::wire::Union::zero_padding(raw);
33603 }
33604 }
33605
33606 pub mod debug_registration {
33607 pub enum Ref<'de> {
33608 Protocol(&'de crate::wire::DebugProtocolRegistration<'de>),
33609
33610 UnknownOrdinal_(u64),
33611 }
33612 }
33613
33614 impl<'de> DebugRegistration<'de> {
33615 pub fn as_ref(&self) -> crate::wire::debug_registration::Ref<'_> {
33616 match self.raw.ordinal() {
33617 1 => crate::wire::debug_registration::Ref::Protocol(unsafe {
33618 self.raw.get().deref_unchecked::<crate::wire::DebugProtocolRegistration<'_>>()
33619 }),
33620
33621 unknown => crate::wire::debug_registration::Ref::UnknownOrdinal_(unknown),
33622 }
33623 }
33624 }
33625
33626 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DebugRegistration<'de>
33627 where
33628 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
33629 ___D: ::fidl_next::Decoder<'de>,
33630 {
33631 fn decode(
33632 mut slot: ::fidl_next::Slot<'_, Self>,
33633 decoder: &mut ___D,
33634 _: (),
33635 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33636 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
33637 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
33638 1 => ::fidl_next::wire::Union::decode_as::<
33639 ___D,
33640 crate::wire::DebugProtocolRegistration<'de>,
33641 >(raw, decoder, ())?,
33642
33643 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
33644 }
33645
33646 Ok(())
33647 }
33648 }
33649
33650 impl<'de> ::core::fmt::Debug for DebugRegistration<'de> {
33651 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
33652 match self.raw.ordinal() {
33653 1 => unsafe {
33654 self.raw
33655 .get()
33656 .deref_unchecked::<crate::wire::DebugProtocolRegistration<'_>>()
33657 .fmt(f)
33658 },
33659 _ => unsafe { ::core::hint::unreachable_unchecked() },
33660 }
33661 }
33662 }
33663
33664 impl<'de> ::fidl_next::IntoNatural for DebugRegistration<'de> {
33665 type Natural = crate::natural::DebugRegistration;
33666 }
33667
33668 #[repr(C)]
33670 pub struct Environment<'de> {
33671 pub(crate) table: ::fidl_next::wire::Table<'de>,
33672 }
33673
33674 impl<'de> Drop for Environment<'de> {
33675 fn drop(&mut self) {
33676 let _ = self.table.get(1).map(|envelope| unsafe {
33677 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
33678 });
33679
33680 let _ = self.table.get(2).map(|envelope| unsafe {
33681 envelope.read_unchecked::<crate::wire::EnvironmentExtends>()
33682 });
33683
33684 let _ = self.table.get(3)
33685 .map(|envelope| unsafe {
33686 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::RunnerRegistration<'de>>>()
33687 });
33688
33689 let _ = self.table.get(4)
33690 .map(|envelope| unsafe {
33691 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ResolverRegistration<'de>>>()
33692 });
33693
33694 let _ = self.table.get(5)
33695 .map(|envelope| unsafe {
33696 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::DebugRegistration<'de>>>()
33697 });
33698
33699 let _ = self
33700 .table
33701 .get(6)
33702 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::wire::Uint32>() });
33703 }
33704 }
33705
33706 impl ::fidl_next::Constrained for Environment<'_> {
33707 type Constraint = ();
33708
33709 fn validate(
33710 _: ::fidl_next::Slot<'_, Self>,
33711 _: Self::Constraint,
33712 ) -> Result<(), ::fidl_next::ValidationError> {
33713 Ok(())
33714 }
33715 }
33716
33717 unsafe impl ::fidl_next::Wire for Environment<'static> {
33718 type Narrowed<'de> = Environment<'de>;
33719
33720 #[inline]
33721 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33722 ::fidl_next::munge!(let Self { table } = out);
33723 ::fidl_next::wire::Table::zero_padding(table);
33724 }
33725 }
33726
33727 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Environment<'de>
33728 where
33729 ___D: ::fidl_next::Decoder<'de> + ?Sized,
33730 {
33731 fn decode(
33732 slot: ::fidl_next::Slot<'_, Self>,
33733 decoder: &mut ___D,
33734 _: (),
33735 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33736 ::fidl_next::munge!(let Self { table } = slot);
33737
33738 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
33739 match ordinal {
33740 0 => unsafe { ::core::hint::unreachable_unchecked() },
33741
33742 1 => {
33743 ::fidl_next::wire::Envelope::decode_as::<
33744 ___D,
33745 ::fidl_next::wire::String<'de>,
33746 >(slot.as_mut(), decoder, 100)?;
33747
33748 let value = unsafe {
33749 slot.deref_unchecked()
33750 .deref_unchecked::<::fidl_next::wire::String<'_>>()
33751 };
33752
33753 if value.len() > 100 {
33754 return Err(::fidl_next::DecodeError::VectorTooLong {
33755 size: value.len() as u64,
33756 limit: 100,
33757 });
33758 }
33759
33760 Ok(())
33761 }
33762
33763 2 => {
33764 ::fidl_next::wire::Envelope::decode_as::<
33765 ___D,
33766 crate::wire::EnvironmentExtends,
33767 >(slot.as_mut(), decoder, ())?;
33768
33769 Ok(())
33770 }
33771
33772 3 => {
33773 ::fidl_next::wire::Envelope::decode_as::<
33774 ___D,
33775 ::fidl_next::wire::Vector<'de, crate::wire::RunnerRegistration<'de>>,
33776 >(slot.as_mut(), decoder, (4294967295, ()))?;
33777
33778 Ok(())
33779 }
33780
33781 4 => {
33782 ::fidl_next::wire::Envelope::decode_as::<
33783 ___D,
33784 ::fidl_next::wire::Vector<'de, crate::wire::ResolverRegistration<'de>>,
33785 >(slot.as_mut(), decoder, (4294967295, ()))?;
33786
33787 Ok(())
33788 }
33789
33790 5 => {
33791 ::fidl_next::wire::Envelope::decode_as::<
33792 ___D,
33793 ::fidl_next::wire::Vector<'de, crate::wire::DebugRegistration<'de>>,
33794 >(slot.as_mut(), decoder, (4294967295, ()))?;
33795
33796 Ok(())
33797 }
33798
33799 6 => {
33800 ::fidl_next::wire::Envelope::decode_as::<___D, ::fidl_next::wire::Uint32>(
33801 slot.as_mut(),
33802 decoder,
33803 (),
33804 )?;
33805
33806 Ok(())
33807 }
33808
33809 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
33810 }
33811 })
33812 }
33813 }
33814
33815 impl<'de> Environment<'de> {
33816 pub fn name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
33817 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
33818 }
33819
33820 pub fn extends(&self) -> ::core::option::Option<&crate::wire::EnvironmentExtends> {
33821 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
33822 }
33823
33824 pub fn runners(
33825 &self,
33826 ) -> ::core::option::Option<
33827 &::fidl_next::wire::Vector<'de, crate::wire::RunnerRegistration<'de>>,
33828 > {
33829 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
33830 }
33831
33832 pub fn resolvers(
33833 &self,
33834 ) -> ::core::option::Option<
33835 &::fidl_next::wire::Vector<'de, crate::wire::ResolverRegistration<'de>>,
33836 > {
33837 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
33838 }
33839
33840 pub fn debug_capabilities(
33841 &self,
33842 ) -> ::core::option::Option<
33843 &::fidl_next::wire::Vector<'de, crate::wire::DebugRegistration<'de>>,
33844 > {
33845 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
33846 }
33847
33848 pub fn stop_timeout_ms(&self) -> ::core::option::Option<&::fidl_next::wire::Uint32> {
33849 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
33850 }
33851 }
33852
33853 impl<'de> ::core::fmt::Debug for Environment<'de> {
33854 fn fmt(
33855 &self,
33856 f: &mut ::core::fmt::Formatter<'_>,
33857 ) -> ::core::result::Result<(), ::core::fmt::Error> {
33858 f.debug_struct("Environment")
33859 .field("name", &self.name())
33860 .field("extends", &self.extends())
33861 .field("runners", &self.runners())
33862 .field("resolvers", &self.resolvers())
33863 .field("debug_capabilities", &self.debug_capabilities())
33864 .field("stop_timeout_ms", &self.stop_timeout_ms())
33865 .finish()
33866 }
33867 }
33868
33869 impl<'de> ::fidl_next::IntoNatural for Environment<'de> {
33870 type Natural = crate::natural::Environment;
33871 }
33872
33873 #[repr(C)]
33875 pub struct ConfigSourceCapabilities<'de> {
33876 pub(crate) table: ::fidl_next::wire::Table<'de>,
33877 }
33878
33879 impl<'de> Drop for ConfigSourceCapabilities<'de> {
33880 fn drop(&mut self) {}
33881 }
33882
33883 impl ::fidl_next::Constrained for ConfigSourceCapabilities<'_> {
33884 type Constraint = ();
33885
33886 fn validate(
33887 _: ::fidl_next::Slot<'_, Self>,
33888 _: Self::Constraint,
33889 ) -> Result<(), ::fidl_next::ValidationError> {
33890 Ok(())
33891 }
33892 }
33893
33894 unsafe impl ::fidl_next::Wire for ConfigSourceCapabilities<'static> {
33895 type Narrowed<'de> = ConfigSourceCapabilities<'de>;
33896
33897 #[inline]
33898 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33899 ::fidl_next::munge!(let Self { table } = out);
33900 ::fidl_next::wire::Table::zero_padding(table);
33901 }
33902 }
33903
33904 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigSourceCapabilities<'de>
33905 where
33906 ___D: ::fidl_next::Decoder<'de> + ?Sized,
33907 {
33908 fn decode(
33909 slot: ::fidl_next::Slot<'_, Self>,
33910 decoder: &mut ___D,
33911 _: (),
33912 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33913 ::fidl_next::munge!(let Self { table } = slot);
33914
33915 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
33916 match ordinal {
33917 0 => unsafe { ::core::hint::unreachable_unchecked() },
33918
33919 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
33920 }
33921 })
33922 }
33923 }
33924
33925 impl<'de> ConfigSourceCapabilities<'de> {}
33926
33927 impl<'de> ::core::fmt::Debug for ConfigSourceCapabilities<'de> {
33928 fn fmt(
33929 &self,
33930 f: &mut ::core::fmt::Formatter<'_>,
33931 ) -> ::core::result::Result<(), ::core::fmt::Error> {
33932 f.debug_struct("ConfigSourceCapabilities").finish()
33933 }
33934 }
33935
33936 impl<'de> ::fidl_next::IntoNatural for ConfigSourceCapabilities<'de> {
33937 type Natural = crate::natural::ConfigSourceCapabilities;
33938 }
33939
33940 #[repr(transparent)]
33942 pub struct ConfigValueSource<'de> {
33943 pub(crate) raw: ::fidl_next::wire::Union,
33944 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
33945 }
33946
33947 impl<'de> Drop for ConfigValueSource<'de> {
33948 fn drop(&mut self) {
33949 match self.raw.ordinal() {
33950 1 => {
33951 let _ = unsafe {
33952 self.raw.get().read_unchecked::<::fidl_next::wire::String<'de>>()
33953 };
33954 }
33955
33956 2 => {
33957 let _ = unsafe {
33958 self.raw
33959 .get()
33960 .read_unchecked::<crate::wire::ConfigSourceCapabilities<'de>>()
33961 };
33962 }
33963
33964 _ => (),
33965 }
33966 }
33967 }
33968
33969 impl ::fidl_next::Constrained for ConfigValueSource<'_> {
33970 type Constraint = ();
33971
33972 fn validate(
33973 _: ::fidl_next::Slot<'_, Self>,
33974 _: Self::Constraint,
33975 ) -> Result<(), ::fidl_next::ValidationError> {
33976 Ok(())
33977 }
33978 }
33979
33980 unsafe impl ::fidl_next::Wire for ConfigValueSource<'static> {
33981 type Narrowed<'de> = ConfigValueSource<'de>;
33982
33983 #[inline]
33984 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33985 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
33986 ::fidl_next::wire::Union::zero_padding(raw);
33987 }
33988 }
33989
33990 pub mod config_value_source {
33991 pub enum Ref<'de> {
33992 PackagePath(&'de ::fidl_next::wire::String<'de>),
33993
33994 Capabilities(&'de crate::wire::ConfigSourceCapabilities<'de>),
33995
33996 UnknownOrdinal_(u64),
33997 }
33998 }
33999
34000 impl<'de> ConfigValueSource<'de> {
34001 pub fn as_ref(&self) -> crate::wire::config_value_source::Ref<'_> {
34002 match self.raw.ordinal() {
34003 1 => crate::wire::config_value_source::Ref::PackagePath(unsafe {
34004 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>()
34005 }),
34006
34007 2 => crate::wire::config_value_source::Ref::Capabilities(unsafe {
34008 self.raw.get().deref_unchecked::<crate::wire::ConfigSourceCapabilities<'_>>()
34009 }),
34010
34011 unknown => crate::wire::config_value_source::Ref::UnknownOrdinal_(unknown),
34012 }
34013 }
34014 }
34015
34016 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigValueSource<'de>
34017 where
34018 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34019 ___D: ::fidl_next::Decoder<'de>,
34020 {
34021 fn decode(
34022 mut slot: ::fidl_next::Slot<'_, Self>,
34023 decoder: &mut ___D,
34024 _: (),
34025 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34026 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34027 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
34028 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
34029 raw, decoder, 4294967295,
34030 )?,
34031
34032 2 => ::fidl_next::wire::Union::decode_as::<
34033 ___D,
34034 crate::wire::ConfigSourceCapabilities<'de>,
34035 >(raw, decoder, ())?,
34036
34037 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
34038 }
34039
34040 Ok(())
34041 }
34042 }
34043
34044 impl<'de> ::core::fmt::Debug for ConfigValueSource<'de> {
34045 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34046 match self.raw.ordinal() {
34047 1 => unsafe {
34048 self.raw.get().deref_unchecked::<::fidl_next::wire::String<'_>>().fmt(f)
34049 },
34050 2 => unsafe {
34051 self.raw
34052 .get()
34053 .deref_unchecked::<crate::wire::ConfigSourceCapabilities<'_>>()
34054 .fmt(f)
34055 },
34056 _ => unsafe { ::core::hint::unreachable_unchecked() },
34057 }
34058 }
34059 }
34060
34061 impl<'de> ::fidl_next::IntoNatural for ConfigValueSource<'de> {
34062 type Natural = crate::natural::ConfigValueSource;
34063 }
34064
34065 #[repr(C)]
34067 pub struct ConfigSchema<'de> {
34068 pub(crate) table: ::fidl_next::wire::Table<'de>,
34069 }
34070
34071 impl<'de> Drop for ConfigSchema<'de> {
34072 fn drop(&mut self) {
34073 let _ = self.table.get(1)
34074 .map(|envelope| unsafe {
34075 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigField<'de>>>()
34076 });
34077
34078 let _ = self.table.get(2).map(|envelope| unsafe {
34079 envelope.read_unchecked::<crate::wire::ConfigChecksum<'de>>()
34080 });
34081
34082 let _ = self.table.get(3).map(|envelope| unsafe {
34083 envelope.read_unchecked::<crate::wire::ConfigValueSource<'de>>()
34084 });
34085 }
34086 }
34087
34088 impl ::fidl_next::Constrained for ConfigSchema<'_> {
34089 type Constraint = ();
34090
34091 fn validate(
34092 _: ::fidl_next::Slot<'_, Self>,
34093 _: Self::Constraint,
34094 ) -> Result<(), ::fidl_next::ValidationError> {
34095 Ok(())
34096 }
34097 }
34098
34099 unsafe impl ::fidl_next::Wire for ConfigSchema<'static> {
34100 type Narrowed<'de> = ConfigSchema<'de>;
34101
34102 #[inline]
34103 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34104 ::fidl_next::munge!(let Self { table } = out);
34105 ::fidl_next::wire::Table::zero_padding(table);
34106 }
34107 }
34108
34109 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigSchema<'de>
34110 where
34111 ___D: ::fidl_next::Decoder<'de> + ?Sized,
34112 {
34113 fn decode(
34114 slot: ::fidl_next::Slot<'_, Self>,
34115 decoder: &mut ___D,
34116 _: (),
34117 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34118 ::fidl_next::munge!(let Self { table } = slot);
34119
34120 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
34121 match ordinal {
34122 0 => unsafe { ::core::hint::unreachable_unchecked() },
34123
34124 1 => {
34125 ::fidl_next::wire::Envelope::decode_as::<
34126 ___D,
34127 ::fidl_next::wire::Vector<'de, crate::wire::ConfigField<'de>>,
34128 >(slot.as_mut(), decoder, (4294967295, ()))?;
34129
34130 Ok(())
34131 }
34132
34133 2 => {
34134 ::fidl_next::wire::Envelope::decode_as::<
34135 ___D,
34136 crate::wire::ConfigChecksum<'de>,
34137 >(slot.as_mut(), decoder, ())?;
34138
34139 Ok(())
34140 }
34141
34142 3 => {
34143 ::fidl_next::wire::Envelope::decode_as::<
34144 ___D,
34145 crate::wire::ConfigValueSource<'de>,
34146 >(slot.as_mut(), decoder, ())?;
34147
34148 Ok(())
34149 }
34150
34151 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
34152 }
34153 })
34154 }
34155 }
34156
34157 impl<'de> ConfigSchema<'de> {
34158 pub fn fields(
34159 &self,
34160 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::ConfigField<'de>>>
34161 {
34162 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
34163 }
34164
34165 pub fn checksum(&self) -> ::core::option::Option<&crate::wire::ConfigChecksum<'de>> {
34166 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
34167 }
34168
34169 pub fn value_source(&self) -> ::core::option::Option<&crate::wire::ConfigValueSource<'de>> {
34170 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
34171 }
34172 }
34173
34174 impl<'de> ::core::fmt::Debug for ConfigSchema<'de> {
34175 fn fmt(
34176 &self,
34177 f: &mut ::core::fmt::Formatter<'_>,
34178 ) -> ::core::result::Result<(), ::core::fmt::Error> {
34179 f.debug_struct("ConfigSchema")
34180 .field("fields", &self.fields())
34181 .field("checksum", &self.checksum())
34182 .field("value_source", &self.value_source())
34183 .finish()
34184 }
34185 }
34186
34187 impl<'de> ::fidl_next::IntoNatural for ConfigSchema<'de> {
34188 type Natural = crate::natural::ConfigSchema;
34189 }
34190
34191 #[repr(C)]
34193 pub struct Component<'de> {
34194 pub(crate) table: ::fidl_next::wire::Table<'de>,
34195 }
34196
34197 impl<'de> Drop for Component<'de> {
34198 fn drop(&mut self) {
34199 let _ = self
34200 .table
34201 .get(1)
34202 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Program<'de>>() });
34203
34204 let _ = self.table.get(2).map(|envelope| unsafe {
34205 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Use<'de>>>()
34206 });
34207
34208 let _ = self.table.get(3).map(|envelope| unsafe {
34209 envelope
34210 .read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Expose<'de>>>()
34211 });
34212
34213 let _ = self.table.get(4).map(|envelope| unsafe {
34214 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Offer<'de>>>()
34215 });
34216
34217 let _ = self.table.get(5).map(|envelope| unsafe {
34218 envelope
34219 .read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Capability<'de>>>(
34220 )
34221 });
34222
34223 let _ = self.table.get(6).map(|envelope| unsafe {
34224 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Child<'de>>>()
34225 });
34226
34227 let _ = self.table.get(7).map(|envelope| unsafe {
34228 envelope
34229 .read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Collection<'de>>>(
34230 )
34231 });
34232
34233 let _ = self.table.get(8)
34234 .map(|envelope| unsafe {
34235 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::Environment<'de>>>()
34236 });
34237
34238 let _ = self.table.get(9).map(|envelope| unsafe {
34239 envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>()
34240 });
34241
34242 let _ = self.table.get(10).map(|envelope| unsafe {
34243 envelope.read_unchecked::<crate::wire::ConfigSchema<'de>>()
34244 });
34245
34246 let _ = self.table.get(11).map(|envelope| unsafe {
34247 envelope.read_unchecked::<crate::wire::DebugInfo<'de>>()
34248 });
34249 }
34250 }
34251
34252 impl ::fidl_next::Constrained for Component<'_> {
34253 type Constraint = ();
34254
34255 fn validate(
34256 _: ::fidl_next::Slot<'_, Self>,
34257 _: Self::Constraint,
34258 ) -> Result<(), ::fidl_next::ValidationError> {
34259 Ok(())
34260 }
34261 }
34262
34263 unsafe impl ::fidl_next::Wire for Component<'static> {
34264 type Narrowed<'de> = Component<'de>;
34265
34266 #[inline]
34267 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34268 ::fidl_next::munge!(let Self { table } = out);
34269 ::fidl_next::wire::Table::zero_padding(table);
34270 }
34271 }
34272
34273 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Component<'de>
34274 where
34275 ___D: ::fidl_next::Decoder<'de> + ?Sized,
34276 {
34277 fn decode(
34278 slot: ::fidl_next::Slot<'_, Self>,
34279 decoder: &mut ___D,
34280 _: (),
34281 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34282 ::fidl_next::munge!(let Self { table } = slot);
34283
34284 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
34285 match ordinal {
34286 0 => unsafe { ::core::hint::unreachable_unchecked() },
34287
34288 1 => {
34289 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::Program<'de>>(
34290 slot.as_mut(),
34291 decoder,
34292 (),
34293 )?;
34294
34295 Ok(())
34296 }
34297
34298 2 => {
34299 ::fidl_next::wire::Envelope::decode_as::<
34300 ___D,
34301 ::fidl_next::wire::Vector<'de, crate::wire::Use<'de>>,
34302 >(slot.as_mut(), decoder, (4294967295, ()))?;
34303
34304 Ok(())
34305 }
34306
34307 3 => {
34308 ::fidl_next::wire::Envelope::decode_as::<
34309 ___D,
34310 ::fidl_next::wire::Vector<'de, crate::wire::Expose<'de>>,
34311 >(slot.as_mut(), decoder, (4294967295, ()))?;
34312
34313 Ok(())
34314 }
34315
34316 4 => {
34317 ::fidl_next::wire::Envelope::decode_as::<
34318 ___D,
34319 ::fidl_next::wire::Vector<'de, crate::wire::Offer<'de>>,
34320 >(slot.as_mut(), decoder, (4294967295, ()))?;
34321
34322 Ok(())
34323 }
34324
34325 5 => {
34326 ::fidl_next::wire::Envelope::decode_as::<
34327 ___D,
34328 ::fidl_next::wire::Vector<'de, crate::wire::Capability<'de>>,
34329 >(slot.as_mut(), decoder, (4294967295, ()))?;
34330
34331 Ok(())
34332 }
34333
34334 6 => {
34335 ::fidl_next::wire::Envelope::decode_as::<
34336 ___D,
34337 ::fidl_next::wire::Vector<'de, crate::wire::Child<'de>>,
34338 >(slot.as_mut(), decoder, (4294967295, ()))?;
34339
34340 Ok(())
34341 }
34342
34343 7 => {
34344 ::fidl_next::wire::Envelope::decode_as::<
34345 ___D,
34346 ::fidl_next::wire::Vector<'de, crate::wire::Collection<'de>>,
34347 >(slot.as_mut(), decoder, (4294967295, ()))?;
34348
34349 Ok(())
34350 }
34351
34352 8 => {
34353 ::fidl_next::wire::Envelope::decode_as::<
34354 ___D,
34355 ::fidl_next::wire::Vector<'de, crate::wire::Environment<'de>>,
34356 >(slot.as_mut(), decoder, (4294967295, ()))?;
34357
34358 Ok(())
34359 }
34360
34361 9 => {
34362 ::fidl_next::wire::Envelope::decode_as::<
34363 ___D,
34364 ::fidl_next_common_fuchsia_data::wire::Dictionary<'de>,
34365 >(slot.as_mut(), decoder, ())?;
34366
34367 Ok(())
34368 }
34369
34370 10 => {
34371 ::fidl_next::wire::Envelope::decode_as::<
34372 ___D,
34373 crate::wire::ConfigSchema<'de>,
34374 >(slot.as_mut(), decoder, ())?;
34375
34376 Ok(())
34377 }
34378
34379 11 => {
34380 ::fidl_next::wire::Envelope::decode_as::<___D, crate::wire::DebugInfo<'de>>(
34381 slot.as_mut(),
34382 decoder,
34383 (),
34384 )?;
34385
34386 Ok(())
34387 }
34388
34389 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
34390 }
34391 })
34392 }
34393 }
34394
34395 impl<'de> Component<'de> {
34396 pub fn program(&self) -> ::core::option::Option<&crate::wire::Program<'de>> {
34397 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
34398 }
34399
34400 pub fn uses(
34401 &self,
34402 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Use<'de>>>
34403 {
34404 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
34405 }
34406
34407 pub fn exposes(
34408 &self,
34409 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Expose<'de>>>
34410 {
34411 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
34412 }
34413
34414 pub fn offers(
34415 &self,
34416 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Offer<'de>>>
34417 {
34418 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
34419 }
34420
34421 pub fn capabilities(
34422 &self,
34423 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Capability<'de>>>
34424 {
34425 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
34426 }
34427
34428 pub fn children(
34429 &self,
34430 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Child<'de>>>
34431 {
34432 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
34433 }
34434
34435 pub fn collections(
34436 &self,
34437 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Collection<'de>>>
34438 {
34439 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
34440 }
34441
34442 pub fn environments(
34443 &self,
34444 ) -> ::core::option::Option<&::fidl_next::wire::Vector<'de, crate::wire::Environment<'de>>>
34445 {
34446 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
34447 }
34448
34449 pub fn facets(
34450 &self,
34451 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>
34452 {
34453 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
34454 }
34455
34456 pub fn config(&self) -> ::core::option::Option<&crate::wire::ConfigSchema<'de>> {
34457 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
34458 }
34459
34460 pub fn debug_info(&self) -> ::core::option::Option<&crate::wire::DebugInfo<'de>> {
34461 unsafe { Some(self.table.get(11)?.deref_unchecked()) }
34462 }
34463 }
34464
34465 impl<'de> ::core::fmt::Debug for Component<'de> {
34466 fn fmt(
34467 &self,
34468 f: &mut ::core::fmt::Formatter<'_>,
34469 ) -> ::core::result::Result<(), ::core::fmt::Error> {
34470 f.debug_struct("Component")
34471 .field("program", &self.program())
34472 .field("uses", &self.uses())
34473 .field("exposes", &self.exposes())
34474 .field("offers", &self.offers())
34475 .field("capabilities", &self.capabilities())
34476 .field("children", &self.children())
34477 .field("collections", &self.collections())
34478 .field("environments", &self.environments())
34479 .field("facets", &self.facets())
34480 .field("config", &self.config())
34481 .field("debug_info", &self.debug_info())
34482 .finish()
34483 }
34484 }
34485
34486 impl<'de> ::fidl_next::IntoNatural for Component<'de> {
34487 type Natural = crate::natural::Component;
34488 }
34489
34490 #[repr(C)]
34492 pub struct ConfigValueSpec<'de> {
34493 pub(crate) table: ::fidl_next::wire::Table<'de>,
34494 }
34495
34496 impl<'de> Drop for ConfigValueSpec<'de> {
34497 fn drop(&mut self) {
34498 let _ = self.table.get(1).map(|envelope| unsafe {
34499 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
34500 });
34501 }
34502 }
34503
34504 impl ::fidl_next::Constrained for ConfigValueSpec<'_> {
34505 type Constraint = ();
34506
34507 fn validate(
34508 _: ::fidl_next::Slot<'_, Self>,
34509 _: Self::Constraint,
34510 ) -> Result<(), ::fidl_next::ValidationError> {
34511 Ok(())
34512 }
34513 }
34514
34515 unsafe impl ::fidl_next::Wire for ConfigValueSpec<'static> {
34516 type Narrowed<'de> = ConfigValueSpec<'de>;
34517
34518 #[inline]
34519 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34520 ::fidl_next::munge!(let Self { table } = out);
34521 ::fidl_next::wire::Table::zero_padding(table);
34522 }
34523 }
34524
34525 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigValueSpec<'de>
34526 where
34527 ___D: ::fidl_next::Decoder<'de> + ?Sized,
34528 {
34529 fn decode(
34530 slot: ::fidl_next::Slot<'_, Self>,
34531 decoder: &mut ___D,
34532 _: (),
34533 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34534 ::fidl_next::munge!(let Self { table } = slot);
34535
34536 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
34537 match ordinal {
34538 0 => unsafe { ::core::hint::unreachable_unchecked() },
34539
34540 1 => {
34541 ::fidl_next::wire::Envelope::decode_as::<
34542 ___D,
34543 crate::wire::ConfigValue<'de>,
34544 >(slot.as_mut(), decoder, ())?;
34545
34546 Ok(())
34547 }
34548
34549 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
34550 }
34551 })
34552 }
34553 }
34554
34555 impl<'de> ConfigValueSpec<'de> {
34556 pub fn value(&self) -> ::core::option::Option<&crate::wire::ConfigValue<'de>> {
34557 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
34558 }
34559 }
34560
34561 impl<'de> ::core::fmt::Debug for ConfigValueSpec<'de> {
34562 fn fmt(
34563 &self,
34564 f: &mut ::core::fmt::Formatter<'_>,
34565 ) -> ::core::result::Result<(), ::core::fmt::Error> {
34566 f.debug_struct("ConfigValueSpec").field("value", &self.value()).finish()
34567 }
34568 }
34569
34570 impl<'de> ::fidl_next::IntoNatural for ConfigValueSpec<'de> {
34571 type Natural = crate::natural::ConfigValueSpec;
34572 }
34573
34574 #[repr(C)]
34576 pub struct ConfigValuesData<'de> {
34577 pub(crate) table: ::fidl_next::wire::Table<'de>,
34578 }
34579
34580 impl<'de> Drop for ConfigValuesData<'de> {
34581 fn drop(&mut self) {
34582 let _ = self.table.get(1)
34583 .map(|envelope| unsafe {
34584 envelope.read_unchecked::<::fidl_next::wire::Vector<'de, crate::wire::ConfigValueSpec<'de>>>()
34585 });
34586
34587 let _ = self.table.get(2).map(|envelope| unsafe {
34588 envelope.read_unchecked::<crate::wire::ConfigChecksum<'de>>()
34589 });
34590 }
34591 }
34592
34593 impl ::fidl_next::Constrained for ConfigValuesData<'_> {
34594 type Constraint = ();
34595
34596 fn validate(
34597 _: ::fidl_next::Slot<'_, Self>,
34598 _: Self::Constraint,
34599 ) -> Result<(), ::fidl_next::ValidationError> {
34600 Ok(())
34601 }
34602 }
34603
34604 unsafe impl ::fidl_next::Wire for ConfigValuesData<'static> {
34605 type Narrowed<'de> = ConfigValuesData<'de>;
34606
34607 #[inline]
34608 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34609 ::fidl_next::munge!(let Self { table } = out);
34610 ::fidl_next::wire::Table::zero_padding(table);
34611 }
34612 }
34613
34614 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigValuesData<'de>
34615 where
34616 ___D: ::fidl_next::Decoder<'de> + ?Sized,
34617 {
34618 fn decode(
34619 slot: ::fidl_next::Slot<'_, Self>,
34620 decoder: &mut ___D,
34621 _: (),
34622 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34623 ::fidl_next::munge!(let Self { table } = slot);
34624
34625 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
34626 match ordinal {
34627 0 => unsafe { ::core::hint::unreachable_unchecked() },
34628
34629 1 => {
34630 ::fidl_next::wire::Envelope::decode_as::<
34631 ___D,
34632 ::fidl_next::wire::Vector<'de, crate::wire::ConfigValueSpec<'de>>,
34633 >(slot.as_mut(), decoder, (4294967295, ()))?;
34634
34635 Ok(())
34636 }
34637
34638 2 => {
34639 ::fidl_next::wire::Envelope::decode_as::<
34640 ___D,
34641 crate::wire::ConfigChecksum<'de>,
34642 >(slot.as_mut(), decoder, ())?;
34643
34644 Ok(())
34645 }
34646
34647 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
34648 }
34649 })
34650 }
34651 }
34652
34653 impl<'de> ConfigValuesData<'de> {
34654 pub fn values(
34655 &self,
34656 ) -> ::core::option::Option<
34657 &::fidl_next::wire::Vector<'de, crate::wire::ConfigValueSpec<'de>>,
34658 > {
34659 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
34660 }
34661
34662 pub fn checksum(&self) -> ::core::option::Option<&crate::wire::ConfigChecksum<'de>> {
34663 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
34664 }
34665 }
34666
34667 impl<'de> ::core::fmt::Debug for ConfigValuesData<'de> {
34668 fn fmt(
34669 &self,
34670 f: &mut ::core::fmt::Formatter<'_>,
34671 ) -> ::core::result::Result<(), ::core::fmt::Error> {
34672 f.debug_struct("ConfigValuesData")
34673 .field("values", &self.values())
34674 .field("checksum", &self.checksum())
34675 .finish()
34676 }
34677 }
34678
34679 impl<'de> ::fidl_next::IntoNatural for ConfigValuesData<'de> {
34680 type Natural = crate::natural::ConfigValuesData;
34681 }
34682
34683 #[repr(C)]
34685 pub struct EventSubscription<'de> {
34686 pub(crate) table: ::fidl_next::wire::Table<'de>,
34687 }
34688
34689 impl<'de> Drop for EventSubscription<'de> {
34690 fn drop(&mut self) {
34691 let _ = self.table.get(1).map(|envelope| unsafe {
34692 envelope.read_unchecked::<::fidl_next::wire::String<'de>>()
34693 });
34694 }
34695 }
34696
34697 impl ::fidl_next::Constrained for EventSubscription<'_> {
34698 type Constraint = ();
34699
34700 fn validate(
34701 _: ::fidl_next::Slot<'_, Self>,
34702 _: Self::Constraint,
34703 ) -> Result<(), ::fidl_next::ValidationError> {
34704 Ok(())
34705 }
34706 }
34707
34708 unsafe impl ::fidl_next::Wire for EventSubscription<'static> {
34709 type Narrowed<'de> = EventSubscription<'de>;
34710
34711 #[inline]
34712 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34713 ::fidl_next::munge!(let Self { table } = out);
34714 ::fidl_next::wire::Table::zero_padding(table);
34715 }
34716 }
34717
34718 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for EventSubscription<'de>
34719 where
34720 ___D: ::fidl_next::Decoder<'de> + ?Sized,
34721 {
34722 fn decode(
34723 slot: ::fidl_next::Slot<'_, Self>,
34724 decoder: &mut ___D,
34725 _: (),
34726 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34727 ::fidl_next::munge!(let Self { table } = slot);
34728
34729 ::fidl_next::wire::Table::decode_with(table, decoder, |ordinal, mut slot, decoder| {
34730 match ordinal {
34731 0 => unsafe { ::core::hint::unreachable_unchecked() },
34732
34733 1 => {
34734 ::fidl_next::wire::Envelope::decode_as::<
34735 ___D,
34736 ::fidl_next::wire::String<'de>,
34737 >(slot.as_mut(), decoder, 100)?;
34738
34739 let value = unsafe {
34740 slot.deref_unchecked()
34741 .deref_unchecked::<::fidl_next::wire::String<'_>>()
34742 };
34743
34744 if value.len() > 100 {
34745 return Err(::fidl_next::DecodeError::VectorTooLong {
34746 size: value.len() as u64,
34747 limit: 100,
34748 });
34749 }
34750
34751 Ok(())
34752 }
34753
34754 _ => ::fidl_next::wire::Envelope::decode_unknown(slot, decoder),
34755 }
34756 })
34757 }
34758 }
34759
34760 impl<'de> EventSubscription<'de> {
34761 pub fn event_name(&self) -> ::core::option::Option<&::fidl_next::wire::String<'de>> {
34762 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
34763 }
34764 }
34765
34766 impl<'de> ::core::fmt::Debug for EventSubscription<'de> {
34767 fn fmt(
34768 &self,
34769 f: &mut ::core::fmt::Formatter<'_>,
34770 ) -> ::core::result::Result<(), ::core::fmt::Error> {
34771 f.debug_struct("EventSubscription").field("event_name", &self.event_name()).finish()
34772 }
34773 }
34774
34775 impl<'de> ::fidl_next::IntoNatural for EventSubscription<'de> {
34776 type Natural = crate::natural::EventSubscription;
34777 }
34778
34779 #[repr(transparent)]
34781 pub struct LayoutParameter<'de> {
34782 pub(crate) raw: ::fidl_next::wire::Union,
34783 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34784 }
34785
34786 impl<'de> Drop for LayoutParameter<'de> {
34787 fn drop(&mut self) {
34788 match self.raw.ordinal() {
34789 1 => {
34790 let _ =
34791 unsafe { self.raw.get().read_unchecked::<crate::wire::ConfigType<'de>>() };
34792 }
34793
34794 _ => (),
34795 }
34796 }
34797 }
34798
34799 impl ::fidl_next::Constrained for LayoutParameter<'_> {
34800 type Constraint = ();
34801
34802 fn validate(
34803 _: ::fidl_next::Slot<'_, Self>,
34804 _: Self::Constraint,
34805 ) -> Result<(), ::fidl_next::ValidationError> {
34806 Ok(())
34807 }
34808 }
34809
34810 unsafe impl ::fidl_next::Wire for LayoutParameter<'static> {
34811 type Narrowed<'de> = LayoutParameter<'de>;
34812
34813 #[inline]
34814 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34815 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34816 ::fidl_next::wire::Union::zero_padding(raw);
34817 }
34818 }
34819
34820 pub mod layout_parameter {
34821 pub enum Ref<'de> {
34822 NestedType(&'de crate::wire::ConfigType<'de>),
34823
34824 UnknownOrdinal_(u64),
34825 }
34826 }
34827
34828 impl<'de> LayoutParameter<'de> {
34829 pub fn as_ref(&self) -> crate::wire::layout_parameter::Ref<'_> {
34830 match self.raw.ordinal() {
34831 1 => crate::wire::layout_parameter::Ref::NestedType(unsafe {
34832 self.raw.get().deref_unchecked::<crate::wire::ConfigType<'_>>()
34833 }),
34834
34835 unknown => crate::wire::layout_parameter::Ref::UnknownOrdinal_(unknown),
34836 }
34837 }
34838 }
34839
34840 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LayoutParameter<'de>
34841 where
34842 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34843 ___D: ::fidl_next::Decoder<'de>,
34844 {
34845 fn decode(
34846 mut slot: ::fidl_next::Slot<'_, Self>,
34847 decoder: &mut ___D,
34848 _: (),
34849 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34850 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34851 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
34852 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ConfigType<'de>>(
34853 raw,
34854 decoder,
34855 (),
34856 )?,
34857
34858 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
34859 }
34860
34861 Ok(())
34862 }
34863 }
34864
34865 impl<'de> ::core::fmt::Debug for LayoutParameter<'de> {
34866 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34867 match self.raw.ordinal() {
34868 1 => unsafe {
34869 self.raw.get().deref_unchecked::<crate::wire::ConfigType<'_>>().fmt(f)
34870 },
34871 _ => unsafe { ::core::hint::unreachable_unchecked() },
34872 }
34873 }
34874 }
34875
34876 impl<'de> ::fidl_next::IntoNatural for LayoutParameter<'de> {
34877 type Natural = crate::natural::LayoutParameter;
34878 }
34879
34880 #[derive(Debug)]
34882 #[repr(C)]
34883 pub struct ResolvedConfigField<'de> {
34884 pub key: ::fidl_next::wire::String<'de>,
34885
34886 pub value: crate::wire::ConfigValue<'de>,
34887 }
34888
34889 static_assertions::const_assert_eq!(std::mem::size_of::<ResolvedConfigField<'_>>(), 32);
34890 static_assertions::const_assert_eq!(std::mem::align_of::<ResolvedConfigField<'_>>(), 8);
34891
34892 static_assertions::const_assert_eq!(std::mem::offset_of!(ResolvedConfigField<'_>, key), 0);
34893
34894 static_assertions::const_assert_eq!(std::mem::offset_of!(ResolvedConfigField<'_>, value), 16);
34895
34896 impl ::fidl_next::Constrained for ResolvedConfigField<'_> {
34897 type Constraint = ();
34898
34899 fn validate(
34900 _: ::fidl_next::Slot<'_, Self>,
34901 _: Self::Constraint,
34902 ) -> Result<(), ::fidl_next::ValidationError> {
34903 Ok(())
34904 }
34905 }
34906
34907 unsafe impl ::fidl_next::Wire for ResolvedConfigField<'static> {
34908 type Narrowed<'de> = ResolvedConfigField<'de>;
34909
34910 #[inline]
34911 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
34912 ::fidl_next::munge! {
34913 let Self {
34914
34915 key,
34916 value,
34917
34918 } = &mut *out_;
34919 }
34920
34921 ::fidl_next::Wire::zero_padding(key);
34922
34923 ::fidl_next::Wire::zero_padding(value);
34924 }
34925 }
34926
34927 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ResolvedConfigField<'de>
34928 where
34929 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34930 ___D: ::fidl_next::Decoder<'de>,
34931 {
34932 fn decode(
34933 slot_: ::fidl_next::Slot<'_, Self>,
34934 decoder_: &mut ___D,
34935 _: (),
34936 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34937 ::fidl_next::munge! {
34938 let Self {
34939
34940 mut key,
34941 mut value,
34942
34943 } = slot_;
34944 }
34945
34946 let _field = key.as_mut();
34947 ::fidl_next::Constrained::validate(_field, 4294967295)?;
34948 ::fidl_next::Decode::decode(key.as_mut(), decoder_, 4294967295)?;
34949
34950 let _field = value.as_mut();
34951
34952 ::fidl_next::Decode::decode(value.as_mut(), decoder_, ())?;
34953
34954 Ok(())
34955 }
34956 }
34957
34958 impl<'de> ::fidl_next::IntoNatural for ResolvedConfigField<'de> {
34959 type Natural = crate::natural::ResolvedConfigField;
34960 }
34961
34962 #[derive(Debug)]
34964 #[repr(C)]
34965 pub struct ResolvedConfig<'de> {
34966 pub fields: ::fidl_next::wire::Vector<'de, crate::wire::ResolvedConfigField<'de>>,
34967
34968 pub checksum: crate::wire::ConfigChecksum<'de>,
34969 }
34970
34971 static_assertions::const_assert_eq!(std::mem::size_of::<ResolvedConfig<'_>>(), 32);
34972 static_assertions::const_assert_eq!(std::mem::align_of::<ResolvedConfig<'_>>(), 8);
34973
34974 static_assertions::const_assert_eq!(std::mem::offset_of!(ResolvedConfig<'_>, fields), 0);
34975
34976 static_assertions::const_assert_eq!(std::mem::offset_of!(ResolvedConfig<'_>, checksum), 16);
34977
34978 impl ::fidl_next::Constrained for ResolvedConfig<'_> {
34979 type Constraint = ();
34980
34981 fn validate(
34982 _: ::fidl_next::Slot<'_, Self>,
34983 _: Self::Constraint,
34984 ) -> Result<(), ::fidl_next::ValidationError> {
34985 Ok(())
34986 }
34987 }
34988
34989 unsafe impl ::fidl_next::Wire for ResolvedConfig<'static> {
34990 type Narrowed<'de> = ResolvedConfig<'de>;
34991
34992 #[inline]
34993 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
34994 ::fidl_next::munge! {
34995 let Self {
34996
34997 fields,
34998 checksum,
34999
35000 } = &mut *out_;
35001 }
35002
35003 ::fidl_next::Wire::zero_padding(fields);
35004
35005 ::fidl_next::Wire::zero_padding(checksum);
35006 }
35007 }
35008
35009 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ResolvedConfig<'de>
35010 where
35011 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
35012 ___D: ::fidl_next::Decoder<'de>,
35013 {
35014 fn decode(
35015 slot_: ::fidl_next::Slot<'_, Self>,
35016 decoder_: &mut ___D,
35017 _: (),
35018 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
35019 ::fidl_next::munge! {
35020 let Self {
35021
35022 mut fields,
35023 mut checksum,
35024
35025 } = slot_;
35026 }
35027
35028 let _field = fields.as_mut();
35029 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
35030 ::fidl_next::Decode::decode(fields.as_mut(), decoder_, (4294967295, ()))?;
35031
35032 let _field = checksum.as_mut();
35033
35034 ::fidl_next::Decode::decode(checksum.as_mut(), decoder_, ())?;
35035
35036 Ok(())
35037 }
35038 }
35039
35040 impl<'de> ::fidl_next::IntoNatural for ResolvedConfig<'de> {
35041 type Natural = crate::natural::ResolvedConfig;
35042 }
35043}
35044
35045pub mod wire_optional {
35046
35047 #[repr(transparent)]
35048 pub struct ConfigSingleValue<'de> {
35049 pub(crate) raw: ::fidl_next::wire::Union,
35050 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
35051 }
35052
35053 impl ::fidl_next::Constrained for ConfigSingleValue<'_> {
35054 type Constraint = ();
35055
35056 fn validate(
35057 _: ::fidl_next::Slot<'_, Self>,
35058 _: Self::Constraint,
35059 ) -> Result<(), ::fidl_next::ValidationError> {
35060 Ok(())
35061 }
35062 }
35063
35064 unsafe impl ::fidl_next::Wire for ConfigSingleValue<'static> {
35065 type Narrowed<'de> = ConfigSingleValue<'de>;
35066
35067 #[inline]
35068 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
35069 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
35070 ::fidl_next::wire::Union::zero_padding(raw);
35071 }
35072 }
35073
35074 impl<'de> ConfigSingleValue<'de> {
35075 pub fn is_some(&self) -> bool {
35076 self.raw.is_some()
35077 }
35078
35079 pub fn is_none(&self) -> bool {
35080 self.raw.is_none()
35081 }
35082
35083 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::ConfigSingleValue<'de>> {
35084 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
35085 }
35086
35087 pub fn into_option(self) -> ::core::option::Option<crate::wire::ConfigSingleValue<'de>> {
35088 if self.is_some() {
35089 Some(crate::wire::ConfigSingleValue {
35090 raw: self.raw,
35091 _phantom: ::core::marker::PhantomData,
35092 })
35093 } else {
35094 None
35095 }
35096 }
35097 }
35098
35099 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigSingleValue<'de>
35100 where
35101 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
35102 ___D: ::fidl_next::Decoder<'de>,
35103 {
35104 fn decode(
35105 mut slot: ::fidl_next::Slot<'_, Self>,
35106 decoder: &mut ___D,
35107 _: (),
35108 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
35109 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
35110 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
35111 1 => ::fidl_next::wire::Union::decode_as::<___D, bool>(raw, decoder, ())?,
35112
35113 2 => ::fidl_next::wire::Union::decode_as::<___D, u8>(raw, decoder, ())?,
35114
35115 3 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint16>(
35116 raw,
35117 decoder,
35118 (),
35119 )?,
35120
35121 4 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint32>(
35122 raw,
35123 decoder,
35124 (),
35125 )?,
35126
35127 5 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint64>(
35128 raw,
35129 decoder,
35130 (),
35131 )?,
35132
35133 6 => ::fidl_next::wire::Union::decode_as::<___D, i8>(raw, decoder, ())?,
35134
35135 7 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int16>(
35136 raw,
35137 decoder,
35138 (),
35139 )?,
35140
35141 8 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int32>(
35142 raw,
35143 decoder,
35144 (),
35145 )?,
35146
35147 9 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Int64>(
35148 raw,
35149 decoder,
35150 (),
35151 )?,
35152
35153 10 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
35154 raw, decoder, 4294967295,
35155 )?,
35156
35157 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
35158 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
35159 }
35160
35161 Ok(())
35162 }
35163 }
35164
35165 impl<'de> ::core::fmt::Debug for ConfigSingleValue<'de> {
35166 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
35167 self.as_ref().fmt(f)
35168 }
35169 }
35170
35171 impl<'de> ::fidl_next::IntoNatural for ConfigSingleValue<'de> {
35172 type Natural = ::core::option::Option<crate::natural::ConfigSingleValue>;
35173 }
35174
35175 #[repr(transparent)]
35176 pub struct ConfigVectorValue<'de> {
35177 pub(crate) raw: ::fidl_next::wire::Union,
35178 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
35179 }
35180
35181 impl ::fidl_next::Constrained for ConfigVectorValue<'_> {
35182 type Constraint = ();
35183
35184 fn validate(
35185 _: ::fidl_next::Slot<'_, Self>,
35186 _: Self::Constraint,
35187 ) -> Result<(), ::fidl_next::ValidationError> {
35188 Ok(())
35189 }
35190 }
35191
35192 unsafe impl ::fidl_next::Wire for ConfigVectorValue<'static> {
35193 type Narrowed<'de> = ConfigVectorValue<'de>;
35194
35195 #[inline]
35196 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
35197 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
35198 ::fidl_next::wire::Union::zero_padding(raw);
35199 }
35200 }
35201
35202 impl<'de> ConfigVectorValue<'de> {
35203 pub fn is_some(&self) -> bool {
35204 self.raw.is_some()
35205 }
35206
35207 pub fn is_none(&self) -> bool {
35208 self.raw.is_none()
35209 }
35210
35211 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::ConfigVectorValue<'de>> {
35212 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
35213 }
35214
35215 pub fn into_option(self) -> ::core::option::Option<crate::wire::ConfigVectorValue<'de>> {
35216 if self.is_some() {
35217 Some(crate::wire::ConfigVectorValue {
35218 raw: self.raw,
35219 _phantom: ::core::marker::PhantomData,
35220 })
35221 } else {
35222 None
35223 }
35224 }
35225 }
35226
35227 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigVectorValue<'de>
35228 where
35229 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
35230 ___D: ::fidl_next::Decoder<'de>,
35231 {
35232 fn decode(
35233 mut slot: ::fidl_next::Slot<'_, Self>,
35234 decoder: &mut ___D,
35235 _: (),
35236 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
35237 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
35238 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
35239 1 => ::fidl_next::wire::Union::decode_as::<
35240 ___D,
35241 ::fidl_next::wire::Vector<'de, bool>,
35242 >(raw, decoder, (4294967295, ()))?,
35243
35244 2 => {
35245 ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Vector<'de, u8>>(
35246 raw,
35247 decoder,
35248 (4294967295, ()),
35249 )?
35250 }
35251
35252 3 => ::fidl_next::wire::Union::decode_as::<
35253 ___D,
35254 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint16>,
35255 >(raw, decoder, (4294967295, ()))?,
35256
35257 4 => ::fidl_next::wire::Union::decode_as::<
35258 ___D,
35259 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint32>,
35260 >(raw, decoder, (4294967295, ()))?,
35261
35262 5 => ::fidl_next::wire::Union::decode_as::<
35263 ___D,
35264 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Uint64>,
35265 >(raw, decoder, (4294967295, ()))?,
35266
35267 6 => {
35268 ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Vector<'de, i8>>(
35269 raw,
35270 decoder,
35271 (4294967295, ()),
35272 )?
35273 }
35274
35275 7 => ::fidl_next::wire::Union::decode_as::<
35276 ___D,
35277 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int16>,
35278 >(raw, decoder, (4294967295, ()))?,
35279
35280 8 => ::fidl_next::wire::Union::decode_as::<
35281 ___D,
35282 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int32>,
35283 >(raw, decoder, (4294967295, ()))?,
35284
35285 9 => ::fidl_next::wire::Union::decode_as::<
35286 ___D,
35287 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::Int64>,
35288 >(raw, decoder, (4294967295, ()))?,
35289
35290 10 => ::fidl_next::wire::Union::decode_as::<
35291 ___D,
35292 ::fidl_next::wire::Vector<'de, ::fidl_next::wire::String<'de>>,
35293 >(raw, decoder, (4294967295, 4294967295))?,
35294
35295 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
35296 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
35297 }
35298
35299 Ok(())
35300 }
35301 }
35302
35303 impl<'de> ::core::fmt::Debug for ConfigVectorValue<'de> {
35304 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
35305 self.as_ref().fmt(f)
35306 }
35307 }
35308
35309 impl<'de> ::fidl_next::IntoNatural for ConfigVectorValue<'de> {
35310 type Natural = ::core::option::Option<crate::natural::ConfigVectorValue>;
35311 }
35312
35313 #[repr(transparent)]
35314 pub struct ConfigValue<'de> {
35315 pub(crate) raw: ::fidl_next::wire::Union,
35316 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
35317 }
35318
35319 impl ::fidl_next::Constrained for ConfigValue<'_> {
35320 type Constraint = ();
35321
35322 fn validate(
35323 _: ::fidl_next::Slot<'_, Self>,
35324 _: Self::Constraint,
35325 ) -> Result<(), ::fidl_next::ValidationError> {
35326 Ok(())
35327 }
35328 }
35329
35330 unsafe impl ::fidl_next::Wire for ConfigValue<'static> {
35331 type Narrowed<'de> = ConfigValue<'de>;
35332
35333 #[inline]
35334 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
35335 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
35336 ::fidl_next::wire::Union::zero_padding(raw);
35337 }
35338 }
35339
35340 impl<'de> ConfigValue<'de> {
35341 pub fn is_some(&self) -> bool {
35342 self.raw.is_some()
35343 }
35344
35345 pub fn is_none(&self) -> bool {
35346 self.raw.is_none()
35347 }
35348
35349 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::ConfigValue<'de>> {
35350 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
35351 }
35352
35353 pub fn into_option(self) -> ::core::option::Option<crate::wire::ConfigValue<'de>> {
35354 if self.is_some() {
35355 Some(crate::wire::ConfigValue {
35356 raw: self.raw,
35357 _phantom: ::core::marker::PhantomData,
35358 })
35359 } else {
35360 None
35361 }
35362 }
35363 }
35364
35365 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigValue<'de>
35366 where
35367 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
35368 ___D: ::fidl_next::Decoder<'de>,
35369 {
35370 fn decode(
35371 mut slot: ::fidl_next::Slot<'_, Self>,
35372 decoder: &mut ___D,
35373 _: (),
35374 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
35375 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
35376 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
35377 1 => ::fidl_next::wire::Union::decode_as::<
35378 ___D,
35379 crate::wire::ConfigSingleValue<'de>,
35380 >(raw, decoder, ())?,
35381
35382 2 => ::fidl_next::wire::Union::decode_as::<
35383 ___D,
35384 crate::wire::ConfigVectorValue<'de>,
35385 >(raw, decoder, ())?,
35386
35387 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
35388 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
35389 }
35390
35391 Ok(())
35392 }
35393 }
35394
35395 impl<'de> ::core::fmt::Debug for ConfigValue<'de> {
35396 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
35397 self.as_ref().fmt(f)
35398 }
35399 }
35400
35401 impl<'de> ::fidl_next::IntoNatural for ConfigValue<'de> {
35402 type Natural = ::core::option::Option<crate::natural::ConfigValue>;
35403 }
35404
35405 #[repr(transparent)]
35406 pub struct Ref<'de> {
35407 pub(crate) raw: ::fidl_next::wire::Union,
35408 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
35409 }
35410
35411 impl ::fidl_next::Constrained for Ref<'_> {
35412 type Constraint = ();
35413
35414 fn validate(
35415 _: ::fidl_next::Slot<'_, Self>,
35416 _: Self::Constraint,
35417 ) -> Result<(), ::fidl_next::ValidationError> {
35418 Ok(())
35419 }
35420 }
35421
35422 unsafe impl ::fidl_next::Wire for Ref<'static> {
35423 type Narrowed<'de> = Ref<'de>;
35424
35425 #[inline]
35426 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
35427 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
35428 ::fidl_next::wire::Union::zero_padding(raw);
35429 }
35430 }
35431
35432 impl<'de> Ref<'de> {
35433 pub fn is_some(&self) -> bool {
35434 self.raw.is_some()
35435 }
35436
35437 pub fn is_none(&self) -> bool {
35438 self.raw.is_none()
35439 }
35440
35441 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
35442 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
35443 }
35444
35445 pub fn into_option(self) -> ::core::option::Option<crate::wire::Ref<'de>> {
35446 if self.is_some() {
35447 Some(crate::wire::Ref { raw: self.raw, _phantom: ::core::marker::PhantomData })
35448 } else {
35449 None
35450 }
35451 }
35452 }
35453
35454 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Ref<'de>
35455 where
35456 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
35457 ___D: ::fidl_next::Decoder<'de>,
35458 {
35459 fn decode(
35460 mut slot: ::fidl_next::Slot<'_, Self>,
35461 decoder: &mut ___D,
35462 _: (),
35463 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
35464 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
35465 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
35466 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ParentRef>(
35467 raw,
35468 decoder,
35469 (),
35470 )?,
35471
35472 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::SelfRef>(
35473 raw,
35474 decoder,
35475 (),
35476 )?,
35477
35478 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ChildRef<'de>>(
35479 raw,
35480 decoder,
35481 (),
35482 )?,
35483
35484 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::CollectionRef<'de>>(
35485 raw,
35486 decoder,
35487 (),
35488 )?,
35489
35490 5 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::FrameworkRef>(
35491 raw,
35492 decoder,
35493 (),
35494 )?,
35495
35496 6 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::CapabilityRef<'de>>(
35497 raw,
35498 decoder,
35499 (),
35500 )?,
35501
35502 7 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::DebugRef>(
35503 raw,
35504 decoder,
35505 (),
35506 )?,
35507
35508 8 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::VoidRef>(
35509 raw,
35510 decoder,
35511 (),
35512 )?,
35513
35514 9 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::EnvironmentRef>(
35515 raw,
35516 decoder,
35517 (),
35518 )?,
35519
35520 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
35521 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
35522 }
35523
35524 Ok(())
35525 }
35526 }
35527
35528 impl<'de> ::core::fmt::Debug for Ref<'de> {
35529 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
35530 self.as_ref().fmt(f)
35531 }
35532 }
35533
35534 impl<'de> ::fidl_next::IntoNatural for Ref<'de> {
35535 type Natural = ::core::option::Option<crate::natural::Ref>;
35536 }
35537
35538 #[repr(transparent)]
35539 pub struct Capability<'de> {
35540 pub(crate) raw: ::fidl_next::wire::Union,
35541 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
35542 }
35543
35544 impl ::fidl_next::Constrained for Capability<'_> {
35545 type Constraint = ();
35546
35547 fn validate(
35548 _: ::fidl_next::Slot<'_, Self>,
35549 _: Self::Constraint,
35550 ) -> Result<(), ::fidl_next::ValidationError> {
35551 Ok(())
35552 }
35553 }
35554
35555 unsafe impl ::fidl_next::Wire for Capability<'static> {
35556 type Narrowed<'de> = Capability<'de>;
35557
35558 #[inline]
35559 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
35560 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
35561 ::fidl_next::wire::Union::zero_padding(raw);
35562 }
35563 }
35564
35565 impl<'de> Capability<'de> {
35566 pub fn is_some(&self) -> bool {
35567 self.raw.is_some()
35568 }
35569
35570 pub fn is_none(&self) -> bool {
35571 self.raw.is_none()
35572 }
35573
35574 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Capability<'de>> {
35575 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
35576 }
35577
35578 pub fn into_option(self) -> ::core::option::Option<crate::wire::Capability<'de>> {
35579 if self.is_some() {
35580 Some(crate::wire::Capability {
35581 raw: self.raw,
35582 _phantom: ::core::marker::PhantomData,
35583 })
35584 } else {
35585 None
35586 }
35587 }
35588 }
35589
35590 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Capability<'de>
35591 where
35592 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
35593 ___D: ::fidl_next::Decoder<'de>,
35594 {
35595 fn decode(
35596 mut slot: ::fidl_next::Slot<'_, Self>,
35597 decoder: &mut ___D,
35598 _: (),
35599 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
35600 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
35601 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
35602 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Service<'de>>(
35603 raw,
35604 decoder,
35605 (),
35606 )?,
35607
35608 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Protocol<'de>>(
35609 raw,
35610 decoder,
35611 (),
35612 )?,
35613
35614 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Directory<'de>>(
35615 raw,
35616 decoder,
35617 (),
35618 )?,
35619
35620 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Storage<'de>>(
35621 raw,
35622 decoder,
35623 (),
35624 )?,
35625
35626 5 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Runner<'de>>(
35627 raw,
35628 decoder,
35629 (),
35630 )?,
35631
35632 6 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Resolver<'de>>(
35633 raw,
35634 decoder,
35635 (),
35636 )?,
35637
35638 8 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::EventStream<'de>>(
35639 raw,
35640 decoder,
35641 (),
35642 )?,
35643
35644 9 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Dictionary<'de>>(
35645 raw,
35646 decoder,
35647 (),
35648 )?,
35649
35650 10 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::Configuration<'de>>(
35651 raw,
35652 decoder,
35653 (),
35654 )?,
35655
35656 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
35657 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
35658 }
35659
35660 Ok(())
35661 }
35662 }
35663
35664 impl<'de> ::core::fmt::Debug for Capability<'de> {
35665 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
35666 self.as_ref().fmt(f)
35667 }
35668 }
35669
35670 impl<'de> ::fidl_next::IntoNatural for Capability<'de> {
35671 type Natural = ::core::option::Option<crate::natural::Capability>;
35672 }
35673
35674 #[repr(transparent)]
35675 pub struct LayoutConstraint<'de> {
35676 pub(crate) raw: ::fidl_next::wire::Union,
35677 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
35678 }
35679
35680 impl ::fidl_next::Constrained for LayoutConstraint<'_> {
35681 type Constraint = ();
35682
35683 fn validate(
35684 _: ::fidl_next::Slot<'_, Self>,
35685 _: Self::Constraint,
35686 ) -> Result<(), ::fidl_next::ValidationError> {
35687 Ok(())
35688 }
35689 }
35690
35691 unsafe impl ::fidl_next::Wire for LayoutConstraint<'static> {
35692 type Narrowed<'de> = LayoutConstraint<'de>;
35693
35694 #[inline]
35695 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
35696 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
35697 ::fidl_next::wire::Union::zero_padding(raw);
35698 }
35699 }
35700
35701 impl<'de> LayoutConstraint<'de> {
35702 pub fn is_some(&self) -> bool {
35703 self.raw.is_some()
35704 }
35705
35706 pub fn is_none(&self) -> bool {
35707 self.raw.is_none()
35708 }
35709
35710 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::LayoutConstraint<'de>> {
35711 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
35712 }
35713
35714 pub fn into_option(self) -> ::core::option::Option<crate::wire::LayoutConstraint<'de>> {
35715 if self.is_some() {
35716 Some(crate::wire::LayoutConstraint {
35717 raw: self.raw,
35718 _phantom: ::core::marker::PhantomData,
35719 })
35720 } else {
35721 None
35722 }
35723 }
35724 }
35725
35726 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LayoutConstraint<'de>
35727 where
35728 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
35729 ___D: ::fidl_next::Decoder<'de>,
35730 {
35731 fn decode(
35732 mut slot: ::fidl_next::Slot<'_, Self>,
35733 decoder: &mut ___D,
35734 _: (),
35735 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
35736 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
35737 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
35738 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::Uint32>(
35739 raw,
35740 decoder,
35741 (),
35742 )?,
35743
35744 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
35745 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
35746 }
35747
35748 Ok(())
35749 }
35750 }
35751
35752 impl<'de> ::core::fmt::Debug for LayoutConstraint<'de> {
35753 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
35754 self.as_ref().fmt(f)
35755 }
35756 }
35757
35758 impl<'de> ::fidl_next::IntoNatural for LayoutConstraint<'de> {
35759 type Natural = ::core::option::Option<crate::natural::LayoutConstraint>;
35760 }
35761
35762 #[repr(transparent)]
35763 pub struct ConfigChecksum<'de> {
35764 pub(crate) raw: ::fidl_next::wire::Union,
35765 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
35766 }
35767
35768 impl ::fidl_next::Constrained for ConfigChecksum<'_> {
35769 type Constraint = ();
35770
35771 fn validate(
35772 _: ::fidl_next::Slot<'_, Self>,
35773 _: Self::Constraint,
35774 ) -> Result<(), ::fidl_next::ValidationError> {
35775 Ok(())
35776 }
35777 }
35778
35779 unsafe impl ::fidl_next::Wire for ConfigChecksum<'static> {
35780 type Narrowed<'de> = ConfigChecksum<'de>;
35781
35782 #[inline]
35783 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
35784 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
35785 ::fidl_next::wire::Union::zero_padding(raw);
35786 }
35787 }
35788
35789 impl<'de> ConfigChecksum<'de> {
35790 pub fn is_some(&self) -> bool {
35791 self.raw.is_some()
35792 }
35793
35794 pub fn is_none(&self) -> bool {
35795 self.raw.is_none()
35796 }
35797
35798 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::ConfigChecksum<'de>> {
35799 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
35800 }
35801
35802 pub fn into_option(self) -> ::core::option::Option<crate::wire::ConfigChecksum<'de>> {
35803 if self.is_some() {
35804 Some(crate::wire::ConfigChecksum {
35805 raw: self.raw,
35806 _phantom: ::core::marker::PhantomData,
35807 })
35808 } else {
35809 None
35810 }
35811 }
35812 }
35813
35814 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigChecksum<'de>
35815 where
35816 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
35817 ___D: ::fidl_next::Decoder<'de>,
35818 {
35819 fn decode(
35820 mut slot: ::fidl_next::Slot<'_, Self>,
35821 decoder: &mut ___D,
35822 _: (),
35823 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
35824 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
35825 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
35826 1 => ::fidl_next::wire::Union::decode_as::<___D, [u8; 32]>(raw, decoder, ())?,
35827
35828 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
35829 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
35830 }
35831
35832 Ok(())
35833 }
35834 }
35835
35836 impl<'de> ::core::fmt::Debug for ConfigChecksum<'de> {
35837 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
35838 self.as_ref().fmt(f)
35839 }
35840 }
35841
35842 impl<'de> ::fidl_next::IntoNatural for ConfigChecksum<'de> {
35843 type Natural = ::core::option::Option<crate::natural::ConfigChecksum>;
35844 }
35845
35846 #[repr(transparent)]
35847 pub struct Use<'de> {
35848 pub(crate) raw: ::fidl_next::wire::Union,
35849 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
35850 }
35851
35852 impl ::fidl_next::Constrained for Use<'_> {
35853 type Constraint = ();
35854
35855 fn validate(
35856 _: ::fidl_next::Slot<'_, Self>,
35857 _: Self::Constraint,
35858 ) -> Result<(), ::fidl_next::ValidationError> {
35859 Ok(())
35860 }
35861 }
35862
35863 unsafe impl ::fidl_next::Wire for Use<'static> {
35864 type Narrowed<'de> = Use<'de>;
35865
35866 #[inline]
35867 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
35868 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
35869 ::fidl_next::wire::Union::zero_padding(raw);
35870 }
35871 }
35872
35873 impl<'de> Use<'de> {
35874 pub fn is_some(&self) -> bool {
35875 self.raw.is_some()
35876 }
35877
35878 pub fn is_none(&self) -> bool {
35879 self.raw.is_none()
35880 }
35881
35882 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Use<'de>> {
35883 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
35884 }
35885
35886 pub fn into_option(self) -> ::core::option::Option<crate::wire::Use<'de>> {
35887 if self.is_some() {
35888 Some(crate::wire::Use { raw: self.raw, _phantom: ::core::marker::PhantomData })
35889 } else {
35890 None
35891 }
35892 }
35893 }
35894
35895 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Use<'de>
35896 where
35897 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
35898 ___D: ::fidl_next::Decoder<'de>,
35899 {
35900 fn decode(
35901 mut slot: ::fidl_next::Slot<'_, Self>,
35902 decoder: &mut ___D,
35903 _: (),
35904 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
35905 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
35906 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
35907 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseService<'de>>(
35908 raw,
35909 decoder,
35910 (),
35911 )?,
35912
35913 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseProtocol<'de>>(
35914 raw,
35915 decoder,
35916 (),
35917 )?,
35918
35919 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseDirectory<'de>>(
35920 raw,
35921 decoder,
35922 (),
35923 )?,
35924
35925 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseStorage<'de>>(
35926 raw,
35927 decoder,
35928 (),
35929 )?,
35930
35931 7 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseEventStream<'de>>(
35932 raw,
35933 decoder,
35934 (),
35935 )?,
35936
35937 8 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseRunner<'de>>(
35938 raw,
35939 decoder,
35940 (),
35941 )?,
35942
35943 9 => {
35944 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseConfiguration<'de>>(
35945 raw,
35946 decoder,
35947 (),
35948 )?
35949 }
35950
35951 10 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::UseDictionary<'de>>(
35952 raw,
35953 decoder,
35954 (),
35955 )?,
35956
35957 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
35958 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
35959 }
35960
35961 Ok(())
35962 }
35963 }
35964
35965 impl<'de> ::core::fmt::Debug for Use<'de> {
35966 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
35967 self.as_ref().fmt(f)
35968 }
35969 }
35970
35971 impl<'de> ::fidl_next::IntoNatural for Use<'de> {
35972 type Natural = ::core::option::Option<crate::natural::Use>;
35973 }
35974
35975 #[repr(transparent)]
35976 pub struct Expose<'de> {
35977 pub(crate) raw: ::fidl_next::wire::Union,
35978 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
35979 }
35980
35981 impl ::fidl_next::Constrained for Expose<'_> {
35982 type Constraint = ();
35983
35984 fn validate(
35985 _: ::fidl_next::Slot<'_, Self>,
35986 _: Self::Constraint,
35987 ) -> Result<(), ::fidl_next::ValidationError> {
35988 Ok(())
35989 }
35990 }
35991
35992 unsafe impl ::fidl_next::Wire for Expose<'static> {
35993 type Narrowed<'de> = Expose<'de>;
35994
35995 #[inline]
35996 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
35997 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
35998 ::fidl_next::wire::Union::zero_padding(raw);
35999 }
36000 }
36001
36002 impl<'de> Expose<'de> {
36003 pub fn is_some(&self) -> bool {
36004 self.raw.is_some()
36005 }
36006
36007 pub fn is_none(&self) -> bool {
36008 self.raw.is_none()
36009 }
36010
36011 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Expose<'de>> {
36012 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
36013 }
36014
36015 pub fn into_option(self) -> ::core::option::Option<crate::wire::Expose<'de>> {
36016 if self.is_some() {
36017 Some(crate::wire::Expose { raw: self.raw, _phantom: ::core::marker::PhantomData })
36018 } else {
36019 None
36020 }
36021 }
36022 }
36023
36024 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Expose<'de>
36025 where
36026 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
36027 ___D: ::fidl_next::Decoder<'de>,
36028 {
36029 fn decode(
36030 mut slot: ::fidl_next::Slot<'_, Self>,
36031 decoder: &mut ___D,
36032 _: (),
36033 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
36034 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
36035 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
36036 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeService<'de>>(
36037 raw,
36038 decoder,
36039 (),
36040 )?,
36041
36042 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeProtocol<'de>>(
36043 raw,
36044 decoder,
36045 (),
36046 )?,
36047
36048 3 => {
36049 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeDirectory<'de>>(
36050 raw,
36051 decoder,
36052 (),
36053 )?
36054 }
36055
36056 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeRunner<'de>>(
36057 raw,
36058 decoder,
36059 (),
36060 )?,
36061
36062 5 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeResolver<'de>>(
36063 raw,
36064 decoder,
36065 (),
36066 )?,
36067
36068 7 => {
36069 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ExposeDictionary<'de>>(
36070 raw,
36071 decoder,
36072 (),
36073 )?
36074 }
36075
36076 8 => ::fidl_next::wire::Union::decode_as::<
36077 ___D,
36078 crate::wire::ExposeConfiguration<'de>,
36079 >(raw, decoder, ())?,
36080
36081 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
36082 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
36083 }
36084
36085 Ok(())
36086 }
36087 }
36088
36089 impl<'de> ::core::fmt::Debug for Expose<'de> {
36090 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
36091 self.as_ref().fmt(f)
36092 }
36093 }
36094
36095 impl<'de> ::fidl_next::IntoNatural for Expose<'de> {
36096 type Natural = ::core::option::Option<crate::natural::Expose>;
36097 }
36098
36099 #[repr(transparent)]
36100 pub struct Offer<'de> {
36101 pub(crate) raw: ::fidl_next::wire::Union,
36102 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
36103 }
36104
36105 impl ::fidl_next::Constrained for Offer<'_> {
36106 type Constraint = ();
36107
36108 fn validate(
36109 _: ::fidl_next::Slot<'_, Self>,
36110 _: Self::Constraint,
36111 ) -> Result<(), ::fidl_next::ValidationError> {
36112 Ok(())
36113 }
36114 }
36115
36116 unsafe impl ::fidl_next::Wire for Offer<'static> {
36117 type Narrowed<'de> = Offer<'de>;
36118
36119 #[inline]
36120 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
36121 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
36122 ::fidl_next::wire::Union::zero_padding(raw);
36123 }
36124 }
36125
36126 impl<'de> Offer<'de> {
36127 pub fn is_some(&self) -> bool {
36128 self.raw.is_some()
36129 }
36130
36131 pub fn is_none(&self) -> bool {
36132 self.raw.is_none()
36133 }
36134
36135 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Offer<'de>> {
36136 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
36137 }
36138
36139 pub fn into_option(self) -> ::core::option::Option<crate::wire::Offer<'de>> {
36140 if self.is_some() {
36141 Some(crate::wire::Offer { raw: self.raw, _phantom: ::core::marker::PhantomData })
36142 } else {
36143 None
36144 }
36145 }
36146 }
36147
36148 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for Offer<'de>
36149 where
36150 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
36151 ___D: ::fidl_next::Decoder<'de>,
36152 {
36153 fn decode(
36154 mut slot: ::fidl_next::Slot<'_, Self>,
36155 decoder: &mut ___D,
36156 _: (),
36157 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
36158 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
36159 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
36160 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferService<'de>>(
36161 raw,
36162 decoder,
36163 (),
36164 )?,
36165
36166 2 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferProtocol<'de>>(
36167 raw,
36168 decoder,
36169 (),
36170 )?,
36171
36172 3 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferDirectory<'de>>(
36173 raw,
36174 decoder,
36175 (),
36176 )?,
36177
36178 4 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferStorage<'de>>(
36179 raw,
36180 decoder,
36181 (),
36182 )?,
36183
36184 5 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferRunner<'de>>(
36185 raw,
36186 decoder,
36187 (),
36188 )?,
36189
36190 6 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferResolver<'de>>(
36191 raw,
36192 decoder,
36193 (),
36194 )?,
36195
36196 8 => {
36197 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferEventStream<'de>>(
36198 raw,
36199 decoder,
36200 (),
36201 )?
36202 }
36203
36204 9 => {
36205 ::fidl_next::wire::Union::decode_as::<___D, crate::wire::OfferDictionary<'de>>(
36206 raw,
36207 decoder,
36208 (),
36209 )?
36210 }
36211
36212 10 => ::fidl_next::wire::Union::decode_as::<
36213 ___D,
36214 crate::wire::OfferConfiguration<'de>,
36215 >(raw, decoder, ())?,
36216
36217 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
36218 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
36219 }
36220
36221 Ok(())
36222 }
36223 }
36224
36225 impl<'de> ::core::fmt::Debug for Offer<'de> {
36226 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
36227 self.as_ref().fmt(f)
36228 }
36229 }
36230
36231 impl<'de> ::fidl_next::IntoNatural for Offer<'de> {
36232 type Natural = ::core::option::Option<crate::natural::Offer>;
36233 }
36234
36235 #[repr(transparent)]
36236 pub struct DebugRegistration<'de> {
36237 pub(crate) raw: ::fidl_next::wire::Union,
36238 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
36239 }
36240
36241 impl ::fidl_next::Constrained for DebugRegistration<'_> {
36242 type Constraint = ();
36243
36244 fn validate(
36245 _: ::fidl_next::Slot<'_, Self>,
36246 _: Self::Constraint,
36247 ) -> Result<(), ::fidl_next::ValidationError> {
36248 Ok(())
36249 }
36250 }
36251
36252 unsafe impl ::fidl_next::Wire for DebugRegistration<'static> {
36253 type Narrowed<'de> = DebugRegistration<'de>;
36254
36255 #[inline]
36256 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
36257 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
36258 ::fidl_next::wire::Union::zero_padding(raw);
36259 }
36260 }
36261
36262 impl<'de> DebugRegistration<'de> {
36263 pub fn is_some(&self) -> bool {
36264 self.raw.is_some()
36265 }
36266
36267 pub fn is_none(&self) -> bool {
36268 self.raw.is_none()
36269 }
36270
36271 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::DebugRegistration<'de>> {
36272 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
36273 }
36274
36275 pub fn into_option(self) -> ::core::option::Option<crate::wire::DebugRegistration<'de>> {
36276 if self.is_some() {
36277 Some(crate::wire::DebugRegistration {
36278 raw: self.raw,
36279 _phantom: ::core::marker::PhantomData,
36280 })
36281 } else {
36282 None
36283 }
36284 }
36285 }
36286
36287 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for DebugRegistration<'de>
36288 where
36289 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
36290 ___D: ::fidl_next::Decoder<'de>,
36291 {
36292 fn decode(
36293 mut slot: ::fidl_next::Slot<'_, Self>,
36294 decoder: &mut ___D,
36295 _: (),
36296 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
36297 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
36298 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
36299 1 => ::fidl_next::wire::Union::decode_as::<
36300 ___D,
36301 crate::wire::DebugProtocolRegistration<'de>,
36302 >(raw, decoder, ())?,
36303
36304 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
36305 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
36306 }
36307
36308 Ok(())
36309 }
36310 }
36311
36312 impl<'de> ::core::fmt::Debug for DebugRegistration<'de> {
36313 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
36314 self.as_ref().fmt(f)
36315 }
36316 }
36317
36318 impl<'de> ::fidl_next::IntoNatural for DebugRegistration<'de> {
36319 type Natural = ::core::option::Option<crate::natural::DebugRegistration>;
36320 }
36321
36322 #[repr(transparent)]
36323 pub struct ConfigValueSource<'de> {
36324 pub(crate) raw: ::fidl_next::wire::Union,
36325 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
36326 }
36327
36328 impl ::fidl_next::Constrained for ConfigValueSource<'_> {
36329 type Constraint = ();
36330
36331 fn validate(
36332 _: ::fidl_next::Slot<'_, Self>,
36333 _: Self::Constraint,
36334 ) -> Result<(), ::fidl_next::ValidationError> {
36335 Ok(())
36336 }
36337 }
36338
36339 unsafe impl ::fidl_next::Wire for ConfigValueSource<'static> {
36340 type Narrowed<'de> = ConfigValueSource<'de>;
36341
36342 #[inline]
36343 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
36344 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
36345 ::fidl_next::wire::Union::zero_padding(raw);
36346 }
36347 }
36348
36349 impl<'de> ConfigValueSource<'de> {
36350 pub fn is_some(&self) -> bool {
36351 self.raw.is_some()
36352 }
36353
36354 pub fn is_none(&self) -> bool {
36355 self.raw.is_none()
36356 }
36357
36358 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::ConfigValueSource<'de>> {
36359 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
36360 }
36361
36362 pub fn into_option(self) -> ::core::option::Option<crate::wire::ConfigValueSource<'de>> {
36363 if self.is_some() {
36364 Some(crate::wire::ConfigValueSource {
36365 raw: self.raw,
36366 _phantom: ::core::marker::PhantomData,
36367 })
36368 } else {
36369 None
36370 }
36371 }
36372 }
36373
36374 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for ConfigValueSource<'de>
36375 where
36376 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
36377 ___D: ::fidl_next::Decoder<'de>,
36378 {
36379 fn decode(
36380 mut slot: ::fidl_next::Slot<'_, Self>,
36381 decoder: &mut ___D,
36382 _: (),
36383 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
36384 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
36385 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
36386 1 => ::fidl_next::wire::Union::decode_as::<___D, ::fidl_next::wire::String<'de>>(
36387 raw, decoder, 4294967295,
36388 )?,
36389
36390 2 => ::fidl_next::wire::Union::decode_as::<
36391 ___D,
36392 crate::wire::ConfigSourceCapabilities<'de>,
36393 >(raw, decoder, ())?,
36394
36395 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
36396 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
36397 }
36398
36399 Ok(())
36400 }
36401 }
36402
36403 impl<'de> ::core::fmt::Debug for ConfigValueSource<'de> {
36404 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
36405 self.as_ref().fmt(f)
36406 }
36407 }
36408
36409 impl<'de> ::fidl_next::IntoNatural for ConfigValueSource<'de> {
36410 type Natural = ::core::option::Option<crate::natural::ConfigValueSource>;
36411 }
36412
36413 #[repr(transparent)]
36414 pub struct LayoutParameter<'de> {
36415 pub(crate) raw: ::fidl_next::wire::Union,
36416 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
36417 }
36418
36419 impl ::fidl_next::Constrained for LayoutParameter<'_> {
36420 type Constraint = ();
36421
36422 fn validate(
36423 _: ::fidl_next::Slot<'_, Self>,
36424 _: Self::Constraint,
36425 ) -> Result<(), ::fidl_next::ValidationError> {
36426 Ok(())
36427 }
36428 }
36429
36430 unsafe impl ::fidl_next::Wire for LayoutParameter<'static> {
36431 type Narrowed<'de> = LayoutParameter<'de>;
36432
36433 #[inline]
36434 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
36435 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
36436 ::fidl_next::wire::Union::zero_padding(raw);
36437 }
36438 }
36439
36440 impl<'de> LayoutParameter<'de> {
36441 pub fn is_some(&self) -> bool {
36442 self.raw.is_some()
36443 }
36444
36445 pub fn is_none(&self) -> bool {
36446 self.raw.is_none()
36447 }
36448
36449 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::LayoutParameter<'de>> {
36450 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
36451 }
36452
36453 pub fn into_option(self) -> ::core::option::Option<crate::wire::LayoutParameter<'de>> {
36454 if self.is_some() {
36455 Some(crate::wire::LayoutParameter {
36456 raw: self.raw,
36457 _phantom: ::core::marker::PhantomData,
36458 })
36459 } else {
36460 None
36461 }
36462 }
36463 }
36464
36465 unsafe impl<'de, ___D> ::fidl_next::Decode<___D> for LayoutParameter<'de>
36466 where
36467 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
36468 ___D: ::fidl_next::Decoder<'de>,
36469 {
36470 fn decode(
36471 mut slot: ::fidl_next::Slot<'_, Self>,
36472 decoder: &mut ___D,
36473 _: (),
36474 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
36475 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
36476 match ::fidl_next::wire::Union::encoded_ordinal(raw.as_mut()) {
36477 1 => ::fidl_next::wire::Union::decode_as::<___D, crate::wire::ConfigType<'de>>(
36478 raw,
36479 decoder,
36480 (),
36481 )?,
36482
36483 0 => ::fidl_next::wire::Union::decode_absent(raw)?,
36484 _ => ::fidl_next::wire::Union::decode_unknown(raw, decoder)?,
36485 }
36486
36487 Ok(())
36488 }
36489 }
36490
36491 impl<'de> ::core::fmt::Debug for LayoutParameter<'de> {
36492 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
36493 self.as_ref().fmt(f)
36494 }
36495 }
36496
36497 impl<'de> ::fidl_next::IntoNatural for LayoutParameter<'de> {
36498 type Natural = ::core::option::Option<crate::natural::LayoutParameter>;
36499 }
36500}
36501
36502pub mod generic {
36503
36504 pub struct ParentRef {}
36505
36506 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ParentRef, ___E> for ParentRef
36507 where
36508 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
36509 {
36510 #[inline]
36511 fn encode(
36512 self,
36513 encoder_: &mut ___E,
36514 out_: &mut ::core::mem::MaybeUninit<crate::wire::ParentRef>,
36515 _: (),
36516 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
36517 ::fidl_next::munge! {
36518 let crate::wire::ParentRef {
36519
36520 _empty,
36521
36522
36523 } = out_;
36524 }
36525
36526 Ok(())
36527 }
36528 }
36529
36530 pub struct SelfRef {}
36531
36532 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SelfRef, ___E> for SelfRef
36533 where
36534 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
36535 {
36536 #[inline]
36537 fn encode(
36538 self,
36539 encoder_: &mut ___E,
36540 out_: &mut ::core::mem::MaybeUninit<crate::wire::SelfRef>,
36541 _: (),
36542 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
36543 ::fidl_next::munge! {
36544 let crate::wire::SelfRef {
36545
36546 _empty,
36547
36548
36549 } = out_;
36550 }
36551
36552 Ok(())
36553 }
36554 }
36555
36556 pub struct ChildRef<T0, T1> {
36557 pub name: T0,
36558
36559 pub collection: T1,
36560 }
36561
36562 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::ChildRef<'static>, ___E>
36563 for ChildRef<T0, T1>
36564 where
36565 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
36566 ___E: ::fidl_next::Encoder,
36567 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
36568 T1: ::fidl_next::Encode<::fidl_next::wire::OptionalString<'static>, ___E>,
36569 {
36570 #[inline]
36571 fn encode(
36572 self,
36573 encoder_: &mut ___E,
36574 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChildRef<'static>>,
36575 _: (),
36576 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
36577 ::fidl_next::munge! {
36578 let crate::wire::ChildRef {
36579
36580 name,
36581 collection,
36582
36583 } = out_;
36584 }
36585
36586 ::fidl_next::Encode::encode(self.name, encoder_, name, 1024)?;
36587
36588 ::fidl_next::Encode::encode(self.collection, encoder_, collection, 100)?;
36589
36590 Ok(())
36591 }
36592 }
36593
36594 pub struct CollectionRef<T0> {
36595 pub name: T0,
36596 }
36597
36598 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::CollectionRef<'static>, ___E>
36599 for CollectionRef<T0>
36600 where
36601 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
36602 ___E: ::fidl_next::Encoder,
36603 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
36604 {
36605 #[inline]
36606 fn encode(
36607 self,
36608 encoder_: &mut ___E,
36609 out_: &mut ::core::mem::MaybeUninit<crate::wire::CollectionRef<'static>>,
36610 _: (),
36611 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
36612 ::fidl_next::munge! {
36613 let crate::wire::CollectionRef {
36614
36615 name,
36616
36617 } = out_;
36618 }
36619
36620 ::fidl_next::Encode::encode(self.name, encoder_, name, 100)?;
36621
36622 Ok(())
36623 }
36624 }
36625
36626 pub struct FrameworkRef {}
36627
36628 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FrameworkRef, ___E> for FrameworkRef
36629 where
36630 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
36631 {
36632 #[inline]
36633 fn encode(
36634 self,
36635 encoder_: &mut ___E,
36636 out_: &mut ::core::mem::MaybeUninit<crate::wire::FrameworkRef>,
36637 _: (),
36638 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
36639 ::fidl_next::munge! {
36640 let crate::wire::FrameworkRef {
36641
36642 _empty,
36643
36644
36645 } = out_;
36646 }
36647
36648 Ok(())
36649 }
36650 }
36651
36652 pub struct CapabilityRef<T0> {
36653 pub name: T0,
36654 }
36655
36656 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::CapabilityRef<'static>, ___E>
36657 for CapabilityRef<T0>
36658 where
36659 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
36660 ___E: ::fidl_next::Encoder,
36661 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
36662 {
36663 #[inline]
36664 fn encode(
36665 self,
36666 encoder_: &mut ___E,
36667 out_: &mut ::core::mem::MaybeUninit<crate::wire::CapabilityRef<'static>>,
36668 _: (),
36669 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
36670 ::fidl_next::munge! {
36671 let crate::wire::CapabilityRef {
36672
36673 name,
36674
36675 } = out_;
36676 }
36677
36678 ::fidl_next::Encode::encode(self.name, encoder_, name, 100)?;
36679
36680 Ok(())
36681 }
36682 }
36683
36684 pub struct DebugRef {}
36685
36686 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DebugRef, ___E> for DebugRef
36687 where
36688 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
36689 {
36690 #[inline]
36691 fn encode(
36692 self,
36693 encoder_: &mut ___E,
36694 out_: &mut ::core::mem::MaybeUninit<crate::wire::DebugRef>,
36695 _: (),
36696 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
36697 ::fidl_next::munge! {
36698 let crate::wire::DebugRef {
36699
36700 _empty,
36701
36702
36703 } = out_;
36704 }
36705
36706 Ok(())
36707 }
36708 }
36709
36710 pub struct VoidRef {}
36711
36712 unsafe impl<___E> ::fidl_next::Encode<crate::wire::VoidRef, ___E> for VoidRef
36713 where
36714 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
36715 {
36716 #[inline]
36717 fn encode(
36718 self,
36719 encoder_: &mut ___E,
36720 out_: &mut ::core::mem::MaybeUninit<crate::wire::VoidRef>,
36721 _: (),
36722 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
36723 ::fidl_next::munge! {
36724 let crate::wire::VoidRef {
36725
36726 _empty,
36727
36728
36729 } = out_;
36730 }
36731
36732 Ok(())
36733 }
36734 }
36735
36736 pub struct EnvironmentRef {}
36737
36738 unsafe impl<___E> ::fidl_next::Encode<crate::wire::EnvironmentRef, ___E> for EnvironmentRef
36739 where
36740 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
36741 {
36742 #[inline]
36743 fn encode(
36744 self,
36745 encoder_: &mut ___E,
36746 out_: &mut ::core::mem::MaybeUninit<crate::wire::EnvironmentRef>,
36747 _: (),
36748 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
36749 ::fidl_next::munge! {
36750 let crate::wire::EnvironmentRef {
36751
36752 _empty,
36753
36754
36755 } = out_;
36756 }
36757
36758 Ok(())
36759 }
36760 }
36761
36762 pub struct NameMapping<T0, T1> {
36763 pub source_name: T0,
36764
36765 pub target_name: T1,
36766 }
36767
36768 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::NameMapping<'static>, ___E>
36769 for NameMapping<T0, T1>
36770 where
36771 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
36772 ___E: ::fidl_next::Encoder,
36773 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
36774 T1: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
36775 {
36776 #[inline]
36777 fn encode(
36778 self,
36779 encoder_: &mut ___E,
36780 out_: &mut ::core::mem::MaybeUninit<crate::wire::NameMapping<'static>>,
36781 _: (),
36782 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
36783 ::fidl_next::munge! {
36784 let crate::wire::NameMapping {
36785
36786 source_name,
36787 target_name,
36788
36789 } = out_;
36790 }
36791
36792 ::fidl_next::Encode::encode(self.source_name, encoder_, source_name, 100)?;
36793
36794 ::fidl_next::Encode::encode(self.target_name, encoder_, target_name, 100)?;
36795
36796 Ok(())
36797 }
36798 }
36799
36800 pub struct ConfigType<T0, T1, T2> {
36801 pub layout: T0,
36802
36803 pub parameters: T1,
36804
36805 pub constraints: T2,
36806 }
36807
36808 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<crate::wire::ConfigType<'static>, ___E>
36809 for ConfigType<T0, T1, T2>
36810 where
36811 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
36812 ___E: ::fidl_next::Encoder,
36813 T0: ::fidl_next::Encode<crate::wire::ConfigTypeLayout, ___E>,
36814 T1: ::fidl_next::Encode<
36815 ::fidl_next::wire::OptionalVector<'static, crate::wire::LayoutParameter<'static>>,
36816 ___E,
36817 >,
36818 T2: ::fidl_next::Encode<
36819 ::fidl_next::wire::Vector<'static, crate::wire::LayoutConstraint<'static>>,
36820 ___E,
36821 >,
36822 {
36823 #[inline]
36824 fn encode(
36825 self,
36826 encoder_: &mut ___E,
36827 out_: &mut ::core::mem::MaybeUninit<crate::wire::ConfigType<'static>>,
36828 _: (),
36829 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
36830 ::fidl_next::munge! {
36831 let crate::wire::ConfigType {
36832
36833 layout,
36834 parameters,
36835 constraints,
36836
36837 } = out_;
36838 }
36839
36840 ::fidl_next::Encode::encode(self.layout, encoder_, layout, ())?;
36841
36842 ::fidl_next::Encode::encode(self.parameters, encoder_, parameters, (4294967295, ()))?;
36843
36844 ::fidl_next::Encode::encode(self.constraints, encoder_, constraints, (4294967295, ()))?;
36845
36846 Ok(())
36847 }
36848 }
36849
36850 pub struct ResolvedConfigField<T0, T1> {
36851 pub key: T0,
36852
36853 pub value: T1,
36854 }
36855
36856 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::ResolvedConfigField<'static>, ___E>
36857 for ResolvedConfigField<T0, T1>
36858 where
36859 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
36860 ___E: ::fidl_next::Encoder,
36861 T0: ::fidl_next::Encode<::fidl_next::wire::String<'static>, ___E>,
36862 T1: ::fidl_next::Encode<crate::wire::ConfigValue<'static>, ___E>,
36863 {
36864 #[inline]
36865 fn encode(
36866 self,
36867 encoder_: &mut ___E,
36868 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfigField<'static>>,
36869 _: (),
36870 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
36871 ::fidl_next::munge! {
36872 let crate::wire::ResolvedConfigField {
36873
36874 key,
36875 value,
36876
36877 } = out_;
36878 }
36879
36880 ::fidl_next::Encode::encode(self.key, encoder_, key, 4294967295)?;
36881
36882 ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
36883
36884 Ok(())
36885 }
36886 }
36887
36888 pub struct ResolvedConfig<T0, T1> {
36889 pub fields: T0,
36890
36891 pub checksum: T1,
36892 }
36893
36894 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::ResolvedConfig<'static>, ___E>
36895 for ResolvedConfig<T0, T1>
36896 where
36897 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
36898 ___E: ::fidl_next::Encoder,
36899 T0: ::fidl_next::Encode<
36900 ::fidl_next::wire::Vector<'static, crate::wire::ResolvedConfigField<'static>>,
36901 ___E,
36902 >,
36903 T1: ::fidl_next::Encode<crate::wire::ConfigChecksum<'static>, ___E>,
36904 {
36905 #[inline]
36906 fn encode(
36907 self,
36908 encoder_: &mut ___E,
36909 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfig<'static>>,
36910 _: (),
36911 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
36912 ::fidl_next::munge! {
36913 let crate::wire::ResolvedConfig {
36914
36915 fields,
36916 checksum,
36917
36918 } = out_;
36919 }
36920
36921 ::fidl_next::Encode::encode(self.fields, encoder_, fields, (4294967295, ()))?;
36922
36923 ::fidl_next::Encode::encode(self.checksum, encoder_, checksum, ())?;
36924
36925 Ok(())
36926 }
36927 }
36928}
36929
36930pub use self::natural::*;
36931
36932#[doc = " Config keys can only consist of these many bytes\n"]
36933pub const CONFIG_KEY_MAX_SIZE: u32 = 64 as u32;
36934
36935pub const MAX_NAME_LENGTH: u32 = 100 as u32;
36936
36937pub const MAX_PATH_LENGTH: u32 = 1024 as u32;
36938
36939pub const MAX_CHILD_NAME_LENGTH: u32 = 1024 as u32;
36940
36941pub const MAX_URL_SCHEME_LENGTH: u32 = 100 as u32;
36942
36943pub const MAX_MONIKER_LENGTH: u32 = 4096 as u32;
36944
36945#[doc = " The maximum number of EventSubscriptions in an EventStream.\n"]
36946pub const MAX_NUM_EVENT_STREAM_SUBSCRIPTIONS: u64 = 100 as u64;
36947
36948pub mod compat {
36950
36951 impl ::fidl_next::CompatFrom<crate::AllowedOffers>
36952 for ::fidl_fuchsia_component_decl::AllowedOffers
36953 {
36954 fn compat_from(value: crate::AllowedOffers) -> Self {
36955 match value {
36956 crate::AllowedOffers::StaticOnly => Self::StaticOnly,
36957
36958 crate::AllowedOffers::StaticAndDynamic => Self::StaticAndDynamic,
36959 }
36960 }
36961 }
36962
36963 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::AllowedOffers>
36964 for crate::AllowedOffers
36965 {
36966 fn compat_from(value: ::fidl_fuchsia_component_decl::AllowedOffers) -> Self {
36967 match value {
36968 ::fidl_fuchsia_component_decl::AllowedOffers::StaticOnly => Self::StaticOnly,
36969
36970 ::fidl_fuchsia_component_decl::AllowedOffers::StaticAndDynamic => {
36971 Self::StaticAndDynamic
36972 }
36973 }
36974 }
36975 }
36976
36977 impl ::fidl_next::CompatFrom<crate::Availability> for ::fidl_fuchsia_component_decl::Availability {
36978 fn compat_from(value: crate::Availability) -> Self {
36979 match value {
36980 crate::Availability::Required => Self::Required,
36981
36982 crate::Availability::Optional => Self::Optional,
36983
36984 crate::Availability::SameAsTarget => Self::SameAsTarget,
36985
36986 crate::Availability::Transitional => Self::Transitional,
36987 }
36988 }
36989 }
36990
36991 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Availability> for crate::Availability {
36992 fn compat_from(value: ::fidl_fuchsia_component_decl::Availability) -> Self {
36993 match value {
36994 ::fidl_fuchsia_component_decl::Availability::Required => Self::Required,
36995
36996 ::fidl_fuchsia_component_decl::Availability::Optional => Self::Optional,
36997
36998 ::fidl_fuchsia_component_decl::Availability::SameAsTarget => Self::SameAsTarget,
36999
37000 ::fidl_fuchsia_component_decl::Availability::Transitional => Self::Transitional,
37001 }
37002 }
37003 }
37004
37005 impl ::fidl_next::CompatFrom<crate::Service> for ::fidl_fuchsia_component_decl::Service {
37006 fn compat_from(value: crate::Service) -> Self {
37007 Self {
37008 name: ::fidl_next::CompatFrom::compat_from(value.name),
37009
37010 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
37011
37012 __source_breaking: ::fidl::marker::SourceBreaking,
37013 }
37014 }
37015 }
37016
37017 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Service> for crate::Service {
37018 fn compat_from(value: ::fidl_fuchsia_component_decl::Service) -> Self {
37019 Self {
37020 name: ::fidl_next::CompatFrom::compat_from(value.name),
37021
37022 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
37023 }
37024 }
37025 }
37026
37027 impl ::fidl_next::CompatFrom<crate::Directory> for ::fidl_fuchsia_component_decl::Directory {
37028 fn compat_from(value: crate::Directory) -> Self {
37029 Self {
37030 name: ::fidl_next::CompatFrom::compat_from(value.name),
37031
37032 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
37033
37034 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
37035
37036 __source_breaking: ::fidl::marker::SourceBreaking,
37037 }
37038 }
37039 }
37040
37041 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Directory> for crate::Directory {
37042 fn compat_from(value: ::fidl_fuchsia_component_decl::Directory) -> Self {
37043 Self {
37044 name: ::fidl_next::CompatFrom::compat_from(value.name),
37045
37046 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
37047
37048 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
37049 }
37050 }
37051 }
37052
37053 impl ::fidl_next::CompatFrom<crate::ParentRef> for ::fidl_fuchsia_component_decl::ParentRef {
37054 #[inline]
37055 fn compat_from(value: crate::ParentRef) -> Self {
37056 Self {}
37057 }
37058 }
37059
37060 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ParentRef> for crate::ParentRef {
37061 #[inline]
37062 fn compat_from(value: ::fidl_fuchsia_component_decl::ParentRef) -> Self {
37063 Self {}
37064 }
37065 }
37066
37067 impl ::fidl_next::CompatFrom<crate::SelfRef> for ::fidl_fuchsia_component_decl::SelfRef {
37068 #[inline]
37069 fn compat_from(value: crate::SelfRef) -> Self {
37070 Self {}
37071 }
37072 }
37073
37074 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::SelfRef> for crate::SelfRef {
37075 #[inline]
37076 fn compat_from(value: ::fidl_fuchsia_component_decl::SelfRef) -> Self {
37077 Self {}
37078 }
37079 }
37080
37081 impl ::fidl_next::CompatFrom<crate::ChildRef> for ::fidl_fuchsia_component_decl::ChildRef {
37082 #[inline]
37083 fn compat_from(value: crate::ChildRef) -> Self {
37084 Self {
37085 name: ::fidl_next::CompatFrom::compat_from(value.name),
37086
37087 collection: ::fidl_next::CompatFrom::compat_from(value.collection),
37088 }
37089 }
37090 }
37091
37092 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ChildRef> for crate::ChildRef {
37093 #[inline]
37094 fn compat_from(value: ::fidl_fuchsia_component_decl::ChildRef) -> Self {
37095 Self {
37096 name: ::fidl_next::CompatFrom::compat_from(value.name),
37097
37098 collection: ::fidl_next::CompatFrom::compat_from(value.collection),
37099 }
37100 }
37101 }
37102
37103 impl ::fidl_next::CompatFrom<crate::CollectionRef>
37104 for ::fidl_fuchsia_component_decl::CollectionRef
37105 {
37106 #[inline]
37107 fn compat_from(value: crate::CollectionRef) -> Self {
37108 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
37109 }
37110 }
37111
37112 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::CollectionRef>
37113 for crate::CollectionRef
37114 {
37115 #[inline]
37116 fn compat_from(value: ::fidl_fuchsia_component_decl::CollectionRef) -> Self {
37117 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
37118 }
37119 }
37120
37121 impl ::fidl_next::CompatFrom<crate::FrameworkRef> for ::fidl_fuchsia_component_decl::FrameworkRef {
37122 #[inline]
37123 fn compat_from(value: crate::FrameworkRef) -> Self {
37124 Self {}
37125 }
37126 }
37127
37128 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::FrameworkRef> for crate::FrameworkRef {
37129 #[inline]
37130 fn compat_from(value: ::fidl_fuchsia_component_decl::FrameworkRef) -> Self {
37131 Self {}
37132 }
37133 }
37134
37135 impl ::fidl_next::CompatFrom<crate::CapabilityRef>
37136 for ::fidl_fuchsia_component_decl::CapabilityRef
37137 {
37138 #[inline]
37139 fn compat_from(value: crate::CapabilityRef) -> Self {
37140 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
37141 }
37142 }
37143
37144 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::CapabilityRef>
37145 for crate::CapabilityRef
37146 {
37147 #[inline]
37148 fn compat_from(value: ::fidl_fuchsia_component_decl::CapabilityRef) -> Self {
37149 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
37150 }
37151 }
37152
37153 impl ::fidl_next::CompatFrom<crate::DebugRef> for ::fidl_fuchsia_component_decl::DebugRef {
37154 #[inline]
37155 fn compat_from(value: crate::DebugRef) -> Self {
37156 Self {}
37157 }
37158 }
37159
37160 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DebugRef> for crate::DebugRef {
37161 #[inline]
37162 fn compat_from(value: ::fidl_fuchsia_component_decl::DebugRef) -> Self {
37163 Self {}
37164 }
37165 }
37166
37167 impl ::fidl_next::CompatFrom<crate::VoidRef> for ::fidl_fuchsia_component_decl::VoidRef {
37168 #[inline]
37169 fn compat_from(value: crate::VoidRef) -> Self {
37170 Self {}
37171 }
37172 }
37173
37174 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::VoidRef> for crate::VoidRef {
37175 #[inline]
37176 fn compat_from(value: ::fidl_fuchsia_component_decl::VoidRef) -> Self {
37177 Self {}
37178 }
37179 }
37180
37181 impl ::fidl_next::CompatFrom<crate::StorageId> for ::fidl_fuchsia_component_decl::StorageId {
37182 fn compat_from(value: crate::StorageId) -> Self {
37183 match value {
37184 crate::StorageId::StaticInstanceId => Self::StaticInstanceId,
37185
37186 crate::StorageId::StaticInstanceIdOrMoniker => Self::StaticInstanceIdOrMoniker,
37187 }
37188 }
37189 }
37190
37191 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::StorageId> for crate::StorageId {
37192 fn compat_from(value: ::fidl_fuchsia_component_decl::StorageId) -> Self {
37193 match value {
37194 ::fidl_fuchsia_component_decl::StorageId::StaticInstanceId => {
37195 Self::StaticInstanceId
37196 }
37197
37198 ::fidl_fuchsia_component_decl::StorageId::StaticInstanceIdOrMoniker => {
37199 Self::StaticInstanceIdOrMoniker
37200 }
37201 }
37202 }
37203 }
37204
37205 impl ::fidl_next::CompatFrom<crate::Runner> for ::fidl_fuchsia_component_decl::Runner {
37206 fn compat_from(value: crate::Runner) -> Self {
37207 Self {
37208 name: ::fidl_next::CompatFrom::compat_from(value.name),
37209
37210 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
37211
37212 __source_breaking: ::fidl::marker::SourceBreaking,
37213 }
37214 }
37215 }
37216
37217 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Runner> for crate::Runner {
37218 fn compat_from(value: ::fidl_fuchsia_component_decl::Runner) -> Self {
37219 Self {
37220 name: ::fidl_next::CompatFrom::compat_from(value.name),
37221
37222 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
37223 }
37224 }
37225 }
37226
37227 impl ::fidl_next::CompatFrom<crate::Resolver> for ::fidl_fuchsia_component_decl::Resolver {
37228 fn compat_from(value: crate::Resolver) -> Self {
37229 Self {
37230 name: ::fidl_next::CompatFrom::compat_from(value.name),
37231
37232 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
37233
37234 __source_breaking: ::fidl::marker::SourceBreaking,
37235 }
37236 }
37237 }
37238
37239 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Resolver> for crate::Resolver {
37240 fn compat_from(value: ::fidl_fuchsia_component_decl::Resolver) -> Self {
37241 Self {
37242 name: ::fidl_next::CompatFrom::compat_from(value.name),
37243
37244 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
37245 }
37246 }
37247 }
37248
37249 impl ::fidl_next::CompatFrom<crate::EventStream> for ::fidl_fuchsia_component_decl::EventStream {
37250 fn compat_from(value: crate::EventStream) -> Self {
37251 Self {
37252 name: ::fidl_next::CompatFrom::compat_from(value.name),
37253
37254 __source_breaking: ::fidl::marker::SourceBreaking,
37255 }
37256 }
37257 }
37258
37259 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::EventStream> for crate::EventStream {
37260 fn compat_from(value: ::fidl_fuchsia_component_decl::EventStream) -> Self {
37261 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
37262 }
37263 }
37264
37265 impl ::fidl_next::CompatFrom<crate::ConfigSingleValue>
37266 for ::fidl_fuchsia_component_decl::ConfigSingleValue
37267 {
37268 fn compat_from(value: crate::ConfigSingleValue) -> Self {
37269 match value {
37270 crate::ConfigSingleValue::Bool(value) => {
37271 Self::Bool(::fidl_next::CompatFrom::compat_from(value))
37272 }
37273
37274 crate::ConfigSingleValue::Uint8(value) => {
37275 Self::Uint8(::fidl_next::CompatFrom::compat_from(value))
37276 }
37277
37278 crate::ConfigSingleValue::Uint16(value) => {
37279 Self::Uint16(::fidl_next::CompatFrom::compat_from(value))
37280 }
37281
37282 crate::ConfigSingleValue::Uint32(value) => {
37283 Self::Uint32(::fidl_next::CompatFrom::compat_from(value))
37284 }
37285
37286 crate::ConfigSingleValue::Uint64(value) => {
37287 Self::Uint64(::fidl_next::CompatFrom::compat_from(value))
37288 }
37289
37290 crate::ConfigSingleValue::Int8(value) => {
37291 Self::Int8(::fidl_next::CompatFrom::compat_from(value))
37292 }
37293
37294 crate::ConfigSingleValue::Int16(value) => {
37295 Self::Int16(::fidl_next::CompatFrom::compat_from(value))
37296 }
37297
37298 crate::ConfigSingleValue::Int32(value) => {
37299 Self::Int32(::fidl_next::CompatFrom::compat_from(value))
37300 }
37301
37302 crate::ConfigSingleValue::Int64(value) => {
37303 Self::Int64(::fidl_next::CompatFrom::compat_from(value))
37304 }
37305
37306 crate::ConfigSingleValue::String(value) => {
37307 Self::String(::fidl_next::CompatFrom::compat_from(value))
37308 }
37309
37310 crate::ConfigSingleValue::UnknownOrdinal_(unknown_ordinal) => {
37311 Self::__SourceBreaking { unknown_ordinal }
37312 }
37313 }
37314 }
37315 }
37316
37317 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigSingleValue>
37318 for crate::ConfigSingleValue
37319 {
37320 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigSingleValue) -> Self {
37321 match value {
37322 ::fidl_fuchsia_component_decl::ConfigSingleValue::Bool(value) => {
37323 Self::Bool(::fidl_next::CompatFrom::compat_from(value))
37324 }
37325
37326 ::fidl_fuchsia_component_decl::ConfigSingleValue::Uint8(value) => {
37327 Self::Uint8(::fidl_next::CompatFrom::compat_from(value))
37328 }
37329
37330 ::fidl_fuchsia_component_decl::ConfigSingleValue::Uint16(value) => {
37331 Self::Uint16(::fidl_next::CompatFrom::compat_from(value))
37332 }
37333
37334 ::fidl_fuchsia_component_decl::ConfigSingleValue::Uint32(value) => {
37335 Self::Uint32(::fidl_next::CompatFrom::compat_from(value))
37336 }
37337
37338 ::fidl_fuchsia_component_decl::ConfigSingleValue::Uint64(value) => {
37339 Self::Uint64(::fidl_next::CompatFrom::compat_from(value))
37340 }
37341
37342 ::fidl_fuchsia_component_decl::ConfigSingleValue::Int8(value) => {
37343 Self::Int8(::fidl_next::CompatFrom::compat_from(value))
37344 }
37345
37346 ::fidl_fuchsia_component_decl::ConfigSingleValue::Int16(value) => {
37347 Self::Int16(::fidl_next::CompatFrom::compat_from(value))
37348 }
37349
37350 ::fidl_fuchsia_component_decl::ConfigSingleValue::Int32(value) => {
37351 Self::Int32(::fidl_next::CompatFrom::compat_from(value))
37352 }
37353
37354 ::fidl_fuchsia_component_decl::ConfigSingleValue::Int64(value) => {
37355 Self::Int64(::fidl_next::CompatFrom::compat_from(value))
37356 }
37357
37358 ::fidl_fuchsia_component_decl::ConfigSingleValue::String(value) => {
37359 Self::String(::fidl_next::CompatFrom::compat_from(value))
37360 }
37361
37362 ::fidl_fuchsia_component_decl::ConfigSingleValue::__SourceBreaking {
37363 unknown_ordinal,
37364 } => Self::UnknownOrdinal_(unknown_ordinal),
37365 }
37366 }
37367 }
37368
37369 impl ::fidl_next::CompatFrom<crate::ConfigVectorValue>
37370 for ::fidl_fuchsia_component_decl::ConfigVectorValue
37371 {
37372 fn compat_from(value: crate::ConfigVectorValue) -> Self {
37373 match value {
37374 crate::ConfigVectorValue::BoolVector(value) => {
37375 Self::BoolVector(::fidl_next::CompatFrom::compat_from(value))
37376 }
37377
37378 crate::ConfigVectorValue::Uint8Vector(value) => {
37379 Self::Uint8Vector(::fidl_next::CompatFrom::compat_from(value))
37380 }
37381
37382 crate::ConfigVectorValue::Uint16Vector(value) => {
37383 Self::Uint16Vector(::fidl_next::CompatFrom::compat_from(value))
37384 }
37385
37386 crate::ConfigVectorValue::Uint32Vector(value) => {
37387 Self::Uint32Vector(::fidl_next::CompatFrom::compat_from(value))
37388 }
37389
37390 crate::ConfigVectorValue::Uint64Vector(value) => {
37391 Self::Uint64Vector(::fidl_next::CompatFrom::compat_from(value))
37392 }
37393
37394 crate::ConfigVectorValue::Int8Vector(value) => {
37395 Self::Int8Vector(::fidl_next::CompatFrom::compat_from(value))
37396 }
37397
37398 crate::ConfigVectorValue::Int16Vector(value) => {
37399 Self::Int16Vector(::fidl_next::CompatFrom::compat_from(value))
37400 }
37401
37402 crate::ConfigVectorValue::Int32Vector(value) => {
37403 Self::Int32Vector(::fidl_next::CompatFrom::compat_from(value))
37404 }
37405
37406 crate::ConfigVectorValue::Int64Vector(value) => {
37407 Self::Int64Vector(::fidl_next::CompatFrom::compat_from(value))
37408 }
37409
37410 crate::ConfigVectorValue::StringVector(value) => {
37411 Self::StringVector(::fidl_next::CompatFrom::compat_from(value))
37412 }
37413
37414 crate::ConfigVectorValue::UnknownOrdinal_(unknown_ordinal) => {
37415 Self::__SourceBreaking { unknown_ordinal }
37416 }
37417 }
37418 }
37419 }
37420
37421 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigVectorValue>
37422 for crate::ConfigVectorValue
37423 {
37424 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigVectorValue) -> Self {
37425 match value {
37426 ::fidl_fuchsia_component_decl::ConfigVectorValue::BoolVector(value) => {
37427 Self::BoolVector(::fidl_next::CompatFrom::compat_from(value))
37428 }
37429
37430 ::fidl_fuchsia_component_decl::ConfigVectorValue::Uint8Vector(value) => {
37431 Self::Uint8Vector(::fidl_next::CompatFrom::compat_from(value))
37432 }
37433
37434 ::fidl_fuchsia_component_decl::ConfigVectorValue::Uint16Vector(value) => {
37435 Self::Uint16Vector(::fidl_next::CompatFrom::compat_from(value))
37436 }
37437
37438 ::fidl_fuchsia_component_decl::ConfigVectorValue::Uint32Vector(value) => {
37439 Self::Uint32Vector(::fidl_next::CompatFrom::compat_from(value))
37440 }
37441
37442 ::fidl_fuchsia_component_decl::ConfigVectorValue::Uint64Vector(value) => {
37443 Self::Uint64Vector(::fidl_next::CompatFrom::compat_from(value))
37444 }
37445
37446 ::fidl_fuchsia_component_decl::ConfigVectorValue::Int8Vector(value) => {
37447 Self::Int8Vector(::fidl_next::CompatFrom::compat_from(value))
37448 }
37449
37450 ::fidl_fuchsia_component_decl::ConfigVectorValue::Int16Vector(value) => {
37451 Self::Int16Vector(::fidl_next::CompatFrom::compat_from(value))
37452 }
37453
37454 ::fidl_fuchsia_component_decl::ConfigVectorValue::Int32Vector(value) => {
37455 Self::Int32Vector(::fidl_next::CompatFrom::compat_from(value))
37456 }
37457
37458 ::fidl_fuchsia_component_decl::ConfigVectorValue::Int64Vector(value) => {
37459 Self::Int64Vector(::fidl_next::CompatFrom::compat_from(value))
37460 }
37461
37462 ::fidl_fuchsia_component_decl::ConfigVectorValue::StringVector(value) => {
37463 Self::StringVector(::fidl_next::CompatFrom::compat_from(value))
37464 }
37465
37466 ::fidl_fuchsia_component_decl::ConfigVectorValue::__SourceBreaking {
37467 unknown_ordinal,
37468 } => Self::UnknownOrdinal_(unknown_ordinal),
37469 }
37470 }
37471 }
37472
37473 impl ::fidl_next::CompatFrom<crate::ConfigValue> for ::fidl_fuchsia_component_decl::ConfigValue {
37474 fn compat_from(value: crate::ConfigValue) -> Self {
37475 match value {
37476 crate::ConfigValue::Single(value) => {
37477 Self::Single(::fidl_next::CompatFrom::compat_from(value))
37478 }
37479
37480 crate::ConfigValue::Vector(value) => {
37481 Self::Vector(::fidl_next::CompatFrom::compat_from(value))
37482 }
37483
37484 crate::ConfigValue::UnknownOrdinal_(unknown_ordinal) => {
37485 Self::__SourceBreaking { unknown_ordinal }
37486 }
37487 }
37488 }
37489 }
37490
37491 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigValue> for crate::ConfigValue {
37492 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigValue) -> Self {
37493 match value {
37494 ::fidl_fuchsia_component_decl::ConfigValue::Single(value) => {
37495 Self::Single(::fidl_next::CompatFrom::compat_from(value))
37496 }
37497
37498 ::fidl_fuchsia_component_decl::ConfigValue::Vector(value) => {
37499 Self::Vector(::fidl_next::CompatFrom::compat_from(value))
37500 }
37501
37502 ::fidl_fuchsia_component_decl::ConfigValue::__SourceBreaking {
37503 unknown_ordinal,
37504 } => Self::UnknownOrdinal_(unknown_ordinal),
37505 }
37506 }
37507 }
37508
37509 impl ::fidl_next::CompatFrom<crate::Configuration>
37510 for ::fidl_fuchsia_component_decl::Configuration
37511 {
37512 fn compat_from(value: crate::Configuration) -> Self {
37513 Self {
37514 name: ::fidl_next::CompatFrom::compat_from(value.name),
37515
37516 value: ::fidl_next::CompatFrom::compat_from(value.value),
37517
37518 __source_breaking: ::fidl::marker::SourceBreaking,
37519 }
37520 }
37521 }
37522
37523 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Configuration>
37524 for crate::Configuration
37525 {
37526 fn compat_from(value: ::fidl_fuchsia_component_decl::Configuration) -> Self {
37527 Self {
37528 name: ::fidl_next::CompatFrom::compat_from(value.name),
37529
37530 value: ::fidl_next::CompatFrom::compat_from(value.value),
37531 }
37532 }
37533 }
37534
37535 impl ::fidl_next::CompatFrom<crate::DeliveryType> for ::fidl_fuchsia_component_decl::DeliveryType {
37536 fn compat_from(value: crate::DeliveryType) -> Self {
37537 match value {
37538 crate::DeliveryType::Immediate => Self::Immediate,
37539
37540 crate::DeliveryType::OnReadable => Self::OnReadable,
37541
37542 crate::DeliveryType::UnknownOrdinal_(unknown_ordinal) => {
37543 Self::__SourceBreaking { unknown_ordinal }
37544 }
37545 }
37546 }
37547 }
37548
37549 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DeliveryType> for crate::DeliveryType {
37550 fn compat_from(value: ::fidl_fuchsia_component_decl::DeliveryType) -> Self {
37551 match value {
37552 ::fidl_fuchsia_component_decl::DeliveryType::Immediate => Self::Immediate,
37553
37554 ::fidl_fuchsia_component_decl::DeliveryType::OnReadable => Self::OnReadable,
37555
37556 ::fidl_fuchsia_component_decl::DeliveryType::__SourceBreaking {
37557 unknown_ordinal: value,
37558 } => Self::UnknownOrdinal_(value),
37559 }
37560 }
37561 }
37562
37563 impl ::fidl_next::CompatFrom<crate::Protocol> for ::fidl_fuchsia_component_decl::Protocol {
37564 fn compat_from(value: crate::Protocol) -> Self {
37565 Self {
37566 name: ::fidl_next::CompatFrom::compat_from(value.name),
37567
37568 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
37569
37570 delivery: ::fidl_next::CompatFrom::compat_from(value.delivery),
37571
37572 __source_breaking: ::fidl::marker::SourceBreaking,
37573 }
37574 }
37575 }
37576
37577 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Protocol> for crate::Protocol {
37578 fn compat_from(value: ::fidl_fuchsia_component_decl::Protocol) -> Self {
37579 Self {
37580 name: ::fidl_next::CompatFrom::compat_from(value.name),
37581
37582 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
37583
37584 delivery: ::fidl_next::CompatFrom::compat_from(value.delivery),
37585 }
37586 }
37587 }
37588
37589 impl ::fidl_next::CompatFrom<crate::EnvironmentRef>
37590 for ::fidl_fuchsia_component_decl::EnvironmentRef
37591 {
37592 #[inline]
37593 fn compat_from(value: crate::EnvironmentRef) -> Self {
37594 Self {}
37595 }
37596 }
37597
37598 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::EnvironmentRef>
37599 for crate::EnvironmentRef
37600 {
37601 #[inline]
37602 fn compat_from(value: ::fidl_fuchsia_component_decl::EnvironmentRef) -> Self {
37603 Self {}
37604 }
37605 }
37606
37607 impl ::fidl_next::CompatFrom<crate::Ref> for ::fidl_fuchsia_component_decl::Ref {
37608 fn compat_from(value: crate::Ref) -> Self {
37609 match value {
37610 crate::Ref::Parent(value) => {
37611 Self::Parent(::fidl_next::CompatFrom::compat_from(value))
37612 }
37613
37614 crate::Ref::Self_(value) => {
37615 Self::Self_(::fidl_next::CompatFrom::compat_from(value))
37616 }
37617
37618 crate::Ref::Child(value) => {
37619 Self::Child(::fidl_next::CompatFrom::compat_from(value))
37620 }
37621
37622 crate::Ref::Collection(value) => {
37623 Self::Collection(::fidl_next::CompatFrom::compat_from(value))
37624 }
37625
37626 crate::Ref::Framework(value) => {
37627 Self::Framework(::fidl_next::CompatFrom::compat_from(value))
37628 }
37629
37630 crate::Ref::Capability(value) => {
37631 Self::Capability(::fidl_next::CompatFrom::compat_from(value))
37632 }
37633
37634 crate::Ref::Debug(value) => {
37635 Self::Debug(::fidl_next::CompatFrom::compat_from(value))
37636 }
37637
37638 crate::Ref::VoidType(value) => {
37639 Self::VoidType(::fidl_next::CompatFrom::compat_from(value))
37640 }
37641
37642 crate::Ref::Environment(value) => {
37643 Self::Environment(::fidl_next::CompatFrom::compat_from(value))
37644 }
37645
37646 crate::Ref::UnknownOrdinal_(unknown_ordinal) => {
37647 Self::__SourceBreaking { unknown_ordinal }
37648 }
37649 }
37650 }
37651 }
37652
37653 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Ref> for crate::Ref {
37654 fn compat_from(value: ::fidl_fuchsia_component_decl::Ref) -> Self {
37655 match value {
37656 ::fidl_fuchsia_component_decl::Ref::Parent(value) => {
37657 Self::Parent(::fidl_next::CompatFrom::compat_from(value))
37658 }
37659
37660 ::fidl_fuchsia_component_decl::Ref::Self_(value) => {
37661 Self::Self_(::fidl_next::CompatFrom::compat_from(value))
37662 }
37663
37664 ::fidl_fuchsia_component_decl::Ref::Child(value) => {
37665 Self::Child(::fidl_next::CompatFrom::compat_from(value))
37666 }
37667
37668 ::fidl_fuchsia_component_decl::Ref::Collection(value) => {
37669 Self::Collection(::fidl_next::CompatFrom::compat_from(value))
37670 }
37671
37672 ::fidl_fuchsia_component_decl::Ref::Framework(value) => {
37673 Self::Framework(::fidl_next::CompatFrom::compat_from(value))
37674 }
37675
37676 ::fidl_fuchsia_component_decl::Ref::Capability(value) => {
37677 Self::Capability(::fidl_next::CompatFrom::compat_from(value))
37678 }
37679
37680 ::fidl_fuchsia_component_decl::Ref::Debug(value) => {
37681 Self::Debug(::fidl_next::CompatFrom::compat_from(value))
37682 }
37683
37684 ::fidl_fuchsia_component_decl::Ref::VoidType(value) => {
37685 Self::VoidType(::fidl_next::CompatFrom::compat_from(value))
37686 }
37687
37688 ::fidl_fuchsia_component_decl::Ref::Environment(value) => {
37689 Self::Environment(::fidl_next::CompatFrom::compat_from(value))
37690 }
37691
37692 ::fidl_fuchsia_component_decl::Ref::__SourceBreaking { unknown_ordinal } => {
37693 Self::UnknownOrdinal_(unknown_ordinal)
37694 }
37695 }
37696 }
37697 }
37698
37699 impl ::fidl_next::CompatFrom<crate::Storage> for ::fidl_fuchsia_component_decl::Storage {
37700 fn compat_from(value: crate::Storage) -> Self {
37701 Self {
37702 name: ::fidl_next::CompatFrom::compat_from(value.name),
37703
37704 source: ::fidl_next::CompatFrom::compat_from(value.source),
37705
37706 backing_dir: ::fidl_next::CompatFrom::compat_from(value.backing_dir),
37707
37708 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
37709
37710 storage_id: ::fidl_next::CompatFrom::compat_from(value.storage_id),
37711
37712 __source_breaking: ::fidl::marker::SourceBreaking,
37713 }
37714 }
37715 }
37716
37717 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Storage> for crate::Storage {
37718 fn compat_from(value: ::fidl_fuchsia_component_decl::Storage) -> Self {
37719 Self {
37720 name: ::fidl_next::CompatFrom::compat_from(value.name),
37721
37722 source: ::fidl_next::CompatFrom::compat_from(value.source),
37723
37724 backing_dir: ::fidl_next::CompatFrom::compat_from(value.backing_dir),
37725
37726 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
37727
37728 storage_id: ::fidl_next::CompatFrom::compat_from(value.storage_id),
37729 }
37730 }
37731 }
37732
37733 impl ::fidl_next::CompatFrom<crate::Dictionary> for ::fidl_fuchsia_component_decl::Dictionary {
37734 fn compat_from(value: crate::Dictionary) -> Self {
37735 Self {
37736 name: ::fidl_next::CompatFrom::compat_from(value.name),
37737
37738 source: ::fidl_next::CompatFrom::compat_from(value.source),
37739
37740 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37741
37742 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
37743
37744 __source_breaking: ::fidl::marker::SourceBreaking,
37745 }
37746 }
37747 }
37748
37749 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Dictionary> for crate::Dictionary {
37750 fn compat_from(value: ::fidl_fuchsia_component_decl::Dictionary) -> Self {
37751 Self {
37752 name: ::fidl_next::CompatFrom::compat_from(value.name),
37753
37754 source: ::fidl_next::CompatFrom::compat_from(value.source),
37755
37756 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37757
37758 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
37759 }
37760 }
37761 }
37762
37763 impl ::fidl_next::CompatFrom<crate::Capability> for ::fidl_fuchsia_component_decl::Capability {
37764 fn compat_from(value: crate::Capability) -> Self {
37765 match value {
37766 crate::Capability::Service(value) => {
37767 Self::Service(::fidl_next::CompatFrom::compat_from(value))
37768 }
37769
37770 crate::Capability::Protocol(value) => {
37771 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
37772 }
37773
37774 crate::Capability::Directory(value) => {
37775 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
37776 }
37777
37778 crate::Capability::Storage(value) => {
37779 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
37780 }
37781
37782 crate::Capability::Runner(value) => {
37783 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
37784 }
37785
37786 crate::Capability::Resolver(value) => {
37787 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
37788 }
37789
37790 crate::Capability::EventStream(value) => {
37791 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
37792 }
37793
37794 crate::Capability::Dictionary(value) => {
37795 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
37796 }
37797
37798 crate::Capability::Config(value) => {
37799 Self::Config(::fidl_next::CompatFrom::compat_from(value))
37800 }
37801
37802 crate::Capability::UnknownOrdinal_(unknown_ordinal) => {
37803 Self::__SourceBreaking { unknown_ordinal }
37804 }
37805 }
37806 }
37807 }
37808
37809 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Capability> for crate::Capability {
37810 fn compat_from(value: ::fidl_fuchsia_component_decl::Capability) -> Self {
37811 match value {
37812 ::fidl_fuchsia_component_decl::Capability::Service(value) => {
37813 Self::Service(::fidl_next::CompatFrom::compat_from(value))
37814 }
37815
37816 ::fidl_fuchsia_component_decl::Capability::Protocol(value) => {
37817 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
37818 }
37819
37820 ::fidl_fuchsia_component_decl::Capability::Directory(value) => {
37821 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
37822 }
37823
37824 ::fidl_fuchsia_component_decl::Capability::Storage(value) => {
37825 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
37826 }
37827
37828 ::fidl_fuchsia_component_decl::Capability::Runner(value) => {
37829 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
37830 }
37831
37832 ::fidl_fuchsia_component_decl::Capability::Resolver(value) => {
37833 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
37834 }
37835
37836 ::fidl_fuchsia_component_decl::Capability::EventStream(value) => {
37837 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
37838 }
37839
37840 ::fidl_fuchsia_component_decl::Capability::Dictionary(value) => {
37841 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
37842 }
37843
37844 ::fidl_fuchsia_component_decl::Capability::Config(value) => {
37845 Self::Config(::fidl_next::CompatFrom::compat_from(value))
37846 }
37847
37848 ::fidl_fuchsia_component_decl::Capability::__SourceBreaking { unknown_ordinal } => {
37849 Self::UnknownOrdinal_(unknown_ordinal)
37850 }
37851 }
37852 }
37853 }
37854
37855 impl ::fidl_next::CompatFrom<crate::StartupMode> for ::fidl_fuchsia_component_decl::StartupMode {
37856 fn compat_from(value: crate::StartupMode) -> Self {
37857 match value {
37858 crate::StartupMode::Lazy => Self::Lazy,
37859
37860 crate::StartupMode::Eager => Self::Eager,
37861 }
37862 }
37863 }
37864
37865 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::StartupMode> for crate::StartupMode {
37866 fn compat_from(value: ::fidl_fuchsia_component_decl::StartupMode) -> Self {
37867 match value {
37868 ::fidl_fuchsia_component_decl::StartupMode::Lazy => Self::Lazy,
37869
37870 ::fidl_fuchsia_component_decl::StartupMode::Eager => Self::Eager,
37871 }
37872 }
37873 }
37874
37875 impl ::fidl_next::CompatFrom<crate::OnTerminate> for ::fidl_fuchsia_component_decl::OnTerminate {
37876 fn compat_from(value: crate::OnTerminate) -> Self {
37877 match value {
37878 crate::OnTerminate::None => Self::None,
37879
37880 crate::OnTerminate::Reboot => Self::Reboot,
37881 }
37882 }
37883 }
37884
37885 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OnTerminate> for crate::OnTerminate {
37886 fn compat_from(value: ::fidl_fuchsia_component_decl::OnTerminate) -> Self {
37887 match value {
37888 ::fidl_fuchsia_component_decl::OnTerminate::None => Self::None,
37889
37890 ::fidl_fuchsia_component_decl::OnTerminate::Reboot => Self::Reboot,
37891 }
37892 }
37893 }
37894
37895 impl ::fidl_next::CompatFrom<crate::ConfigOverride>
37896 for ::fidl_fuchsia_component_decl::ConfigOverride
37897 {
37898 fn compat_from(value: crate::ConfigOverride) -> Self {
37899 Self {
37900 key: ::fidl_next::CompatFrom::compat_from(value.key),
37901
37902 value: ::fidl_next::CompatFrom::compat_from(value.value),
37903
37904 __source_breaking: ::fidl::marker::SourceBreaking,
37905 }
37906 }
37907 }
37908
37909 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigOverride>
37910 for crate::ConfigOverride
37911 {
37912 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigOverride) -> Self {
37913 Self {
37914 key: ::fidl_next::CompatFrom::compat_from(value.key),
37915
37916 value: ::fidl_next::CompatFrom::compat_from(value.value),
37917 }
37918 }
37919 }
37920
37921 impl ::fidl_next::CompatFrom<crate::Child> for ::fidl_fuchsia_component_decl::Child {
37922 fn compat_from(value: crate::Child) -> Self {
37923 Self {
37924 name: ::fidl_next::CompatFrom::compat_from(value.name),
37925
37926 url: ::fidl_next::CompatFrom::compat_from(value.url),
37927
37928 startup: ::fidl_next::CompatFrom::compat_from(value.startup),
37929
37930 environment: ::fidl_next::CompatFrom::compat_from(value.environment),
37931
37932 on_terminate: ::fidl_next::CompatFrom::compat_from(value.on_terminate),
37933
37934 config_overrides: ::fidl_next::CompatFrom::compat_from(value.config_overrides),
37935
37936 __source_breaking: ::fidl::marker::SourceBreaking,
37937 }
37938 }
37939 }
37940
37941 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Child> for crate::Child {
37942 fn compat_from(value: ::fidl_fuchsia_component_decl::Child) -> Self {
37943 Self {
37944 name: ::fidl_next::CompatFrom::compat_from(value.name),
37945
37946 url: ::fidl_next::CompatFrom::compat_from(value.url),
37947
37948 startup: ::fidl_next::CompatFrom::compat_from(value.startup),
37949
37950 environment: ::fidl_next::CompatFrom::compat_from(value.environment),
37951
37952 on_terminate: ::fidl_next::CompatFrom::compat_from(value.on_terminate),
37953
37954 config_overrides: ::fidl_next::CompatFrom::compat_from(value.config_overrides),
37955 }
37956 }
37957 }
37958
37959 impl ::fidl_next::CompatFrom<crate::Durability> for ::fidl_fuchsia_component_decl::Durability {
37960 fn compat_from(value: crate::Durability) -> Self {
37961 match value {
37962 crate::Durability::Transient => Self::Transient,
37963
37964 crate::Durability::SingleRun => Self::SingleRun,
37965 }
37966 }
37967 }
37968
37969 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Durability> for crate::Durability {
37970 fn compat_from(value: ::fidl_fuchsia_component_decl::Durability) -> Self {
37971 match value {
37972 ::fidl_fuchsia_component_decl::Durability::Transient => Self::Transient,
37973
37974 ::fidl_fuchsia_component_decl::Durability::SingleRun => Self::SingleRun,
37975 }
37976 }
37977 }
37978
37979 impl ::fidl_next::CompatFrom<crate::Collection> for ::fidl_fuchsia_component_decl::Collection {
37980 fn compat_from(value: crate::Collection) -> Self {
37981 Self {
37982 name: ::fidl_next::CompatFrom::compat_from(value.name),
37983
37984 durability: ::fidl_next::CompatFrom::compat_from(value.durability),
37985
37986 environment: ::fidl_next::CompatFrom::compat_from(value.environment),
37987
37988 allowed_offers: ::fidl_next::CompatFrom::compat_from(value.allowed_offers),
37989
37990 allow_long_names: ::fidl_next::CompatFrom::compat_from(value.allow_long_names),
37991
37992 persistent_storage: ::fidl_next::CompatFrom::compat_from(value.persistent_storage),
37993
37994 __source_breaking: ::fidl::marker::SourceBreaking,
37995 }
37996 }
37997 }
37998
37999 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Collection> for crate::Collection {
38000 fn compat_from(value: ::fidl_fuchsia_component_decl::Collection) -> Self {
38001 Self {
38002 name: ::fidl_next::CompatFrom::compat_from(value.name),
38003
38004 durability: ::fidl_next::CompatFrom::compat_from(value.durability),
38005
38006 environment: ::fidl_next::CompatFrom::compat_from(value.environment),
38007
38008 allowed_offers: ::fidl_next::CompatFrom::compat_from(value.allowed_offers),
38009
38010 allow_long_names: ::fidl_next::CompatFrom::compat_from(value.allow_long_names),
38011
38012 persistent_storage: ::fidl_next::CompatFrom::compat_from(value.persistent_storage),
38013 }
38014 }
38015 }
38016
38017 impl ::fidl_next::CompatFrom<crate::DependencyType>
38018 for ::fidl_fuchsia_component_decl::DependencyType
38019 {
38020 fn compat_from(value: crate::DependencyType) -> Self {
38021 match value {
38022 crate::DependencyType::Strong => Self::Strong,
38023
38024 crate::DependencyType::Weak => Self::Weak,
38025 }
38026 }
38027 }
38028
38029 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DependencyType>
38030 for crate::DependencyType
38031 {
38032 fn compat_from(value: ::fidl_fuchsia_component_decl::DependencyType) -> Self {
38033 match value {
38034 ::fidl_fuchsia_component_decl::DependencyType::Strong => Self::Strong,
38035
38036 ::fidl_fuchsia_component_decl::DependencyType::Weak => Self::Weak,
38037 }
38038 }
38039 }
38040
38041 impl ::fidl_next::CompatFrom<crate::NameMapping> for ::fidl_fuchsia_component_decl::NameMapping {
38042 #[inline]
38043 fn compat_from(value: crate::NameMapping) -> Self {
38044 Self {
38045 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38046
38047 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38048 }
38049 }
38050 }
38051
38052 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::NameMapping> for crate::NameMapping {
38053 #[inline]
38054 fn compat_from(value: ::fidl_fuchsia_component_decl::NameMapping) -> Self {
38055 Self {
38056 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38057
38058 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38059 }
38060 }
38061 }
38062
38063 impl ::fidl_next::CompatFrom<crate::EnvironmentExtends>
38064 for ::fidl_fuchsia_component_decl::EnvironmentExtends
38065 {
38066 fn compat_from(value: crate::EnvironmentExtends) -> Self {
38067 match value {
38068 crate::EnvironmentExtends::None => Self::None,
38069
38070 crate::EnvironmentExtends::Realm => Self::Realm,
38071 }
38072 }
38073 }
38074
38075 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::EnvironmentExtends>
38076 for crate::EnvironmentExtends
38077 {
38078 fn compat_from(value: ::fidl_fuchsia_component_decl::EnvironmentExtends) -> Self {
38079 match value {
38080 ::fidl_fuchsia_component_decl::EnvironmentExtends::None => Self::None,
38081
38082 ::fidl_fuchsia_component_decl::EnvironmentExtends::Realm => Self::Realm,
38083 }
38084 }
38085 }
38086
38087 impl ::fidl_next::CompatFrom<crate::ConfigTypeLayout>
38088 for ::fidl_fuchsia_component_decl::ConfigTypeLayout
38089 {
38090 fn compat_from(value: crate::ConfigTypeLayout) -> Self {
38091 match value {
38092 crate::ConfigTypeLayout::Bool => Self::Bool,
38093
38094 crate::ConfigTypeLayout::Uint8 => Self::Uint8,
38095
38096 crate::ConfigTypeLayout::Uint16 => Self::Uint16,
38097
38098 crate::ConfigTypeLayout::Uint32 => Self::Uint32,
38099
38100 crate::ConfigTypeLayout::Uint64 => Self::Uint64,
38101
38102 crate::ConfigTypeLayout::Int8 => Self::Int8,
38103
38104 crate::ConfigTypeLayout::Int16 => Self::Int16,
38105
38106 crate::ConfigTypeLayout::Int32 => Self::Int32,
38107
38108 crate::ConfigTypeLayout::Int64 => Self::Int64,
38109
38110 crate::ConfigTypeLayout::String => Self::String,
38111
38112 crate::ConfigTypeLayout::Vector => Self::Vector,
38113
38114 crate::ConfigTypeLayout::UnknownOrdinal_(unknown_ordinal) => {
38115 Self::__SourceBreaking { unknown_ordinal }
38116 }
38117 }
38118 }
38119 }
38120
38121 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigTypeLayout>
38122 for crate::ConfigTypeLayout
38123 {
38124 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigTypeLayout) -> Self {
38125 match value {
38126 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Bool => Self::Bool,
38127
38128 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Uint8 => Self::Uint8,
38129
38130 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Uint16 => Self::Uint16,
38131
38132 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Uint32 => Self::Uint32,
38133
38134 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Uint64 => Self::Uint64,
38135
38136 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Int8 => Self::Int8,
38137
38138 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Int16 => Self::Int16,
38139
38140 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Int32 => Self::Int32,
38141
38142 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Int64 => Self::Int64,
38143
38144 ::fidl_fuchsia_component_decl::ConfigTypeLayout::String => Self::String,
38145
38146 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Vector => Self::Vector,
38147
38148 ::fidl_fuchsia_component_decl::ConfigTypeLayout::__SourceBreaking {
38149 unknown_ordinal: value,
38150 } => Self::UnknownOrdinal_(value),
38151 }
38152 }
38153 }
38154
38155 impl ::fidl_next::CompatFrom<crate::LayoutConstraint>
38156 for ::fidl_fuchsia_component_decl::LayoutConstraint
38157 {
38158 fn compat_from(value: crate::LayoutConstraint) -> Self {
38159 match value {
38160 crate::LayoutConstraint::MaxSize(value) => {
38161 Self::MaxSize(::fidl_next::CompatFrom::compat_from(value))
38162 }
38163
38164 crate::LayoutConstraint::UnknownOrdinal_(unknown_ordinal) => {
38165 Self::__SourceBreaking { unknown_ordinal }
38166 }
38167 }
38168 }
38169 }
38170
38171 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::LayoutConstraint>
38172 for crate::LayoutConstraint
38173 {
38174 fn compat_from(value: ::fidl_fuchsia_component_decl::LayoutConstraint) -> Self {
38175 match value {
38176 ::fidl_fuchsia_component_decl::LayoutConstraint::MaxSize(value) => {
38177 Self::MaxSize(::fidl_next::CompatFrom::compat_from(value))
38178 }
38179
38180 ::fidl_fuchsia_component_decl::LayoutConstraint::__SourceBreaking {
38181 unknown_ordinal,
38182 } => Self::UnknownOrdinal_(unknown_ordinal),
38183 }
38184 }
38185 }
38186
38187 impl ::fidl_next::CompatFrom<crate::ConfigType> for ::fidl_fuchsia_component_decl::ConfigType {
38188 #[inline]
38189 fn compat_from(value: crate::ConfigType) -> Self {
38190 Self {
38191 layout: ::fidl_next::CompatFrom::compat_from(value.layout),
38192
38193 parameters: ::fidl_next::CompatFrom::compat_from(value.parameters),
38194
38195 constraints: ::fidl_next::CompatFrom::compat_from(value.constraints),
38196 }
38197 }
38198 }
38199
38200 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigType> for crate::ConfigType {
38201 #[inline]
38202 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigType) -> Self {
38203 Self {
38204 layout: ::fidl_next::CompatFrom::compat_from(value.layout),
38205
38206 parameters: ::fidl_next::CompatFrom::compat_from(value.parameters),
38207
38208 constraints: ::fidl_next::CompatFrom::compat_from(value.constraints),
38209 }
38210 }
38211 }
38212
38213 impl ::fidl_next::CompatFrom<crate::ConfigChecksum>
38214 for ::fidl_fuchsia_component_decl::ConfigChecksum
38215 {
38216 fn compat_from(value: crate::ConfigChecksum) -> Self {
38217 match value {
38218 crate::ConfigChecksum::Sha256(value) => {
38219 Self::Sha256(::fidl_next::CompatFrom::compat_from(value))
38220 }
38221
38222 crate::ConfigChecksum::UnknownOrdinal_(unknown_ordinal) => {
38223 Self::__SourceBreaking { unknown_ordinal }
38224 }
38225 }
38226 }
38227 }
38228
38229 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigChecksum>
38230 for crate::ConfigChecksum
38231 {
38232 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigChecksum) -> Self {
38233 match value {
38234 ::fidl_fuchsia_component_decl::ConfigChecksum::Sha256(value) => {
38235 Self::Sha256(::fidl_next::CompatFrom::compat_from(value))
38236 }
38237
38238 ::fidl_fuchsia_component_decl::ConfigChecksum::__SourceBreaking {
38239 unknown_ordinal,
38240 } => Self::UnknownOrdinal_(unknown_ordinal),
38241 }
38242 }
38243 }
38244
38245 impl ::fidl_next::CompatFrom<crate::UseStorage> for ::fidl_fuchsia_component_decl::UseStorage {
38246 fn compat_from(value: crate::UseStorage) -> Self {
38247 Self {
38248 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38249
38250 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
38251
38252 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38253
38254 __source_breaking: ::fidl::marker::SourceBreaking,
38255 }
38256 }
38257 }
38258
38259 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseStorage> for crate::UseStorage {
38260 fn compat_from(value: ::fidl_fuchsia_component_decl::UseStorage) -> Self {
38261 Self {
38262 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38263
38264 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
38265
38266 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38267 }
38268 }
38269 }
38270
38271 impl ::fidl_next::CompatFrom<crate::ConfigMutability>
38272 for ::fidl_fuchsia_component_decl::ConfigMutability
38273 {
38274 fn compat_from(value: crate::ConfigMutability) -> Self {
38275 Self::from_bits_retain(value.bits())
38276 }
38277 }
38278
38279 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigMutability>
38280 for crate::ConfigMutability
38281 {
38282 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigMutability) -> Self {
38283 Self::from_bits_retain(value.bits())
38284 }
38285 }
38286
38287 impl ::fidl_next::CompatFrom<crate::ConfigField> for ::fidl_fuchsia_component_decl::ConfigField {
38288 fn compat_from(value: crate::ConfigField) -> Self {
38289 Self {
38290 key: ::fidl_next::CompatFrom::compat_from(value.key),
38291
38292 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
38293
38294 mutability: ::fidl_next::CompatFrom::compat_from(value.mutability),
38295
38296 __source_breaking: ::fidl::marker::SourceBreaking,
38297 }
38298 }
38299 }
38300
38301 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigField> for crate::ConfigField {
38302 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigField) -> Self {
38303 Self {
38304 key: ::fidl_next::CompatFrom::compat_from(value.key),
38305
38306 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
38307
38308 mutability: ::fidl_next::CompatFrom::compat_from(value.mutability),
38309 }
38310 }
38311 }
38312
38313 impl ::fidl_next::CompatFrom<crate::Program> for ::fidl_fuchsia_component_decl::Program {
38314 fn compat_from(value: crate::Program) -> Self {
38315 Self {
38316 runner: ::fidl_next::CompatFrom::compat_from(value.runner),
38317
38318 info: ::fidl_next::CompatFrom::compat_from(value.info),
38319
38320 __source_breaking: ::fidl::marker::SourceBreaking,
38321 }
38322 }
38323 }
38324
38325 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Program> for crate::Program {
38326 fn compat_from(value: ::fidl_fuchsia_component_decl::Program) -> Self {
38327 Self {
38328 runner: ::fidl_next::CompatFrom::compat_from(value.runner),
38329
38330 info: ::fidl_next::CompatFrom::compat_from(value.info),
38331 }
38332 }
38333 }
38334
38335 impl ::fidl_next::CompatFrom<crate::DebugInfo> for ::fidl_fuchsia_component_decl::DebugInfo {
38336 fn compat_from(value: crate::DebugInfo) -> Self {
38337 Self {
38338 manifest_sources: ::fidl_next::CompatFrom::compat_from(value.manifest_sources),
38339
38340 __source_breaking: ::fidl::marker::SourceBreaking,
38341 }
38342 }
38343 }
38344
38345 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DebugInfo> for crate::DebugInfo {
38346 fn compat_from(value: ::fidl_fuchsia_component_decl::DebugInfo) -> Self {
38347 Self { manifest_sources: ::fidl_next::CompatFrom::compat_from(value.manifest_sources) }
38348 }
38349 }
38350
38351 impl ::fidl_next::CompatFrom<crate::UseService> for ::fidl_fuchsia_component_decl::UseService {
38352 fn compat_from(value: crate::UseService) -> Self {
38353 Self {
38354 source: ::fidl_next::CompatFrom::compat_from(value.source),
38355
38356 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38357
38358 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
38359
38360 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
38361
38362 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38363
38364 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38365
38366 __source_breaking: ::fidl::marker::SourceBreaking,
38367 }
38368 }
38369 }
38370
38371 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseService> for crate::UseService {
38372 fn compat_from(value: ::fidl_fuchsia_component_decl::UseService) -> Self {
38373 Self {
38374 source: ::fidl_next::CompatFrom::compat_from(value.source),
38375
38376 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38377
38378 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
38379
38380 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
38381
38382 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38383
38384 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38385 }
38386 }
38387 }
38388
38389 impl ::fidl_next::CompatFrom<crate::UseProtocol> for ::fidl_fuchsia_component_decl::UseProtocol {
38390 fn compat_from(value: crate::UseProtocol) -> Self {
38391 Self {
38392 source: ::fidl_next::CompatFrom::compat_from(value.source),
38393
38394 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38395
38396 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
38397
38398 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
38399
38400 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38401
38402 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38403
38404 numbered_handle: ::fidl_next::CompatFrom::compat_from(value.numbered_handle),
38405
38406 __source_breaking: ::fidl::marker::SourceBreaking,
38407 }
38408 }
38409 }
38410
38411 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseProtocol> for crate::UseProtocol {
38412 fn compat_from(value: ::fidl_fuchsia_component_decl::UseProtocol) -> Self {
38413 Self {
38414 source: ::fidl_next::CompatFrom::compat_from(value.source),
38415
38416 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38417
38418 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
38419
38420 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
38421
38422 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38423
38424 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38425
38426 numbered_handle: ::fidl_next::CompatFrom::compat_from(value.numbered_handle),
38427 }
38428 }
38429 }
38430
38431 impl ::fidl_next::CompatFrom<crate::UseDirectory> for ::fidl_fuchsia_component_decl::UseDirectory {
38432 fn compat_from(value: crate::UseDirectory) -> Self {
38433 Self {
38434 source: ::fidl_next::CompatFrom::compat_from(value.source),
38435
38436 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38437
38438 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
38439
38440 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
38441
38442 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
38443
38444 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
38445
38446 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38447
38448 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38449
38450 __source_breaking: ::fidl::marker::SourceBreaking,
38451 }
38452 }
38453 }
38454
38455 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseDirectory> for crate::UseDirectory {
38456 fn compat_from(value: ::fidl_fuchsia_component_decl::UseDirectory) -> Self {
38457 Self {
38458 source: ::fidl_next::CompatFrom::compat_from(value.source),
38459
38460 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38461
38462 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
38463
38464 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
38465
38466 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
38467
38468 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
38469
38470 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38471
38472 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38473 }
38474 }
38475 }
38476
38477 impl ::fidl_next::CompatFrom<crate::UseEventStream>
38478 for ::fidl_fuchsia_component_decl::UseEventStream
38479 {
38480 fn compat_from(value: crate::UseEventStream) -> Self {
38481 Self {
38482 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38483
38484 source: ::fidl_next::CompatFrom::compat_from(value.source),
38485
38486 scope: ::fidl_next::CompatFrom::compat_from(value.scope),
38487
38488 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
38489
38490 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38491
38492 filter: ::fidl_next::CompatFrom::compat_from(value.filter),
38493
38494 __source_breaking: ::fidl::marker::SourceBreaking,
38495 }
38496 }
38497 }
38498
38499 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseEventStream>
38500 for crate::UseEventStream
38501 {
38502 fn compat_from(value: ::fidl_fuchsia_component_decl::UseEventStream) -> Self {
38503 Self {
38504 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38505
38506 source: ::fidl_next::CompatFrom::compat_from(value.source),
38507
38508 scope: ::fidl_next::CompatFrom::compat_from(value.scope),
38509
38510 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
38511
38512 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38513
38514 filter: ::fidl_next::CompatFrom::compat_from(value.filter),
38515 }
38516 }
38517 }
38518
38519 impl ::fidl_next::CompatFrom<crate::UseRunner> for ::fidl_fuchsia_component_decl::UseRunner {
38520 fn compat_from(value: crate::UseRunner) -> Self {
38521 Self {
38522 source: ::fidl_next::CompatFrom::compat_from(value.source),
38523
38524 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38525
38526 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38527
38528 __source_breaking: ::fidl::marker::SourceBreaking,
38529 }
38530 }
38531 }
38532
38533 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseRunner> for crate::UseRunner {
38534 fn compat_from(value: ::fidl_fuchsia_component_decl::UseRunner) -> Self {
38535 Self {
38536 source: ::fidl_next::CompatFrom::compat_from(value.source),
38537
38538 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38539
38540 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38541 }
38542 }
38543 }
38544
38545 impl ::fidl_next::CompatFrom<crate::UseConfiguration>
38546 for ::fidl_fuchsia_component_decl::UseConfiguration
38547 {
38548 fn compat_from(value: crate::UseConfiguration) -> Self {
38549 Self {
38550 source: ::fidl_next::CompatFrom::compat_from(value.source),
38551
38552 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38553
38554 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38555
38556 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38557
38558 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
38559
38560 default: ::fidl_next::CompatFrom::compat_from(value.default),
38561
38562 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38563
38564 __source_breaking: ::fidl::marker::SourceBreaking,
38565 }
38566 }
38567 }
38568
38569 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseConfiguration>
38570 for crate::UseConfiguration
38571 {
38572 fn compat_from(value: ::fidl_fuchsia_component_decl::UseConfiguration) -> Self {
38573 Self {
38574 source: ::fidl_next::CompatFrom::compat_from(value.source),
38575
38576 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38577
38578 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38579
38580 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38581
38582 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
38583
38584 default: ::fidl_next::CompatFrom::compat_from(value.default),
38585
38586 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38587 }
38588 }
38589 }
38590
38591 impl ::fidl_next::CompatFrom<crate::UseDictionary>
38592 for ::fidl_fuchsia_component_decl::UseDictionary
38593 {
38594 fn compat_from(value: crate::UseDictionary) -> Self {
38595 Self {
38596 source: ::fidl_next::CompatFrom::compat_from(value.source),
38597
38598 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38599
38600 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
38601
38602 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
38603
38604 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38605
38606 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38607
38608 __source_breaking: ::fidl::marker::SourceBreaking,
38609 }
38610 }
38611 }
38612
38613 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseDictionary>
38614 for crate::UseDictionary
38615 {
38616 fn compat_from(value: ::fidl_fuchsia_component_decl::UseDictionary) -> Self {
38617 Self {
38618 source: ::fidl_next::CompatFrom::compat_from(value.source),
38619
38620 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38621
38622 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
38623
38624 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
38625
38626 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38627
38628 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38629 }
38630 }
38631 }
38632
38633 impl ::fidl_next::CompatFrom<crate::Use> for ::fidl_fuchsia_component_decl::Use {
38634 fn compat_from(value: crate::Use) -> Self {
38635 match value {
38636 crate::Use::Service(value) => {
38637 Self::Service(::fidl_next::CompatFrom::compat_from(value))
38638 }
38639
38640 crate::Use::Protocol(value) => {
38641 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
38642 }
38643
38644 crate::Use::Directory(value) => {
38645 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
38646 }
38647
38648 crate::Use::Storage(value) => {
38649 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
38650 }
38651
38652 crate::Use::EventStream(value) => {
38653 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
38654 }
38655
38656 crate::Use::Runner(value) => {
38657 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
38658 }
38659
38660 crate::Use::Config(value) => {
38661 Self::Config(::fidl_next::CompatFrom::compat_from(value))
38662 }
38663
38664 crate::Use::Dictionary(value) => {
38665 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
38666 }
38667
38668 crate::Use::UnknownOrdinal_(unknown_ordinal) => {
38669 Self::__SourceBreaking { unknown_ordinal }
38670 }
38671 }
38672 }
38673 }
38674
38675 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Use> for crate::Use {
38676 fn compat_from(value: ::fidl_fuchsia_component_decl::Use) -> Self {
38677 match value {
38678 ::fidl_fuchsia_component_decl::Use::Service(value) => {
38679 Self::Service(::fidl_next::CompatFrom::compat_from(value))
38680 }
38681
38682 ::fidl_fuchsia_component_decl::Use::Protocol(value) => {
38683 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
38684 }
38685
38686 ::fidl_fuchsia_component_decl::Use::Directory(value) => {
38687 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
38688 }
38689
38690 ::fidl_fuchsia_component_decl::Use::Storage(value) => {
38691 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
38692 }
38693
38694 ::fidl_fuchsia_component_decl::Use::EventStream(value) => {
38695 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
38696 }
38697
38698 ::fidl_fuchsia_component_decl::Use::Runner(value) => {
38699 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
38700 }
38701
38702 ::fidl_fuchsia_component_decl::Use::Config(value) => {
38703 Self::Config(::fidl_next::CompatFrom::compat_from(value))
38704 }
38705
38706 ::fidl_fuchsia_component_decl::Use::Dictionary(value) => {
38707 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
38708 }
38709
38710 ::fidl_fuchsia_component_decl::Use::__SourceBreaking { unknown_ordinal } => {
38711 Self::UnknownOrdinal_(unknown_ordinal)
38712 }
38713 }
38714 }
38715 }
38716
38717 impl ::fidl_next::CompatFrom<crate::ExposeService>
38718 for ::fidl_fuchsia_component_decl::ExposeService
38719 {
38720 fn compat_from(value: crate::ExposeService) -> Self {
38721 Self {
38722 source: ::fidl_next::CompatFrom::compat_from(value.source),
38723
38724 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38725
38726 target: ::fidl_next::CompatFrom::compat_from(value.target),
38727
38728 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38729
38730 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38731
38732 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38733
38734 __source_breaking: ::fidl::marker::SourceBreaking,
38735 }
38736 }
38737 }
38738
38739 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeService>
38740 for crate::ExposeService
38741 {
38742 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeService) -> Self {
38743 Self {
38744 source: ::fidl_next::CompatFrom::compat_from(value.source),
38745
38746 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38747
38748 target: ::fidl_next::CompatFrom::compat_from(value.target),
38749
38750 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38751
38752 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38753
38754 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38755 }
38756 }
38757 }
38758
38759 impl ::fidl_next::CompatFrom<crate::ExposeProtocol>
38760 for ::fidl_fuchsia_component_decl::ExposeProtocol
38761 {
38762 fn compat_from(value: crate::ExposeProtocol) -> Self {
38763 Self {
38764 source: ::fidl_next::CompatFrom::compat_from(value.source),
38765
38766 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38767
38768 target: ::fidl_next::CompatFrom::compat_from(value.target),
38769
38770 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38771
38772 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38773
38774 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38775
38776 __source_breaking: ::fidl::marker::SourceBreaking,
38777 }
38778 }
38779 }
38780
38781 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeProtocol>
38782 for crate::ExposeProtocol
38783 {
38784 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeProtocol) -> Self {
38785 Self {
38786 source: ::fidl_next::CompatFrom::compat_from(value.source),
38787
38788 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38789
38790 target: ::fidl_next::CompatFrom::compat_from(value.target),
38791
38792 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38793
38794 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38795
38796 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38797 }
38798 }
38799 }
38800
38801 impl ::fidl_next::CompatFrom<crate::ExposeDirectory>
38802 for ::fidl_fuchsia_component_decl::ExposeDirectory
38803 {
38804 fn compat_from(value: crate::ExposeDirectory) -> Self {
38805 Self {
38806 source: ::fidl_next::CompatFrom::compat_from(value.source),
38807
38808 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38809
38810 target: ::fidl_next::CompatFrom::compat_from(value.target),
38811
38812 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38813
38814 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
38815
38816 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
38817
38818 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38819
38820 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38821
38822 __source_breaking: ::fidl::marker::SourceBreaking,
38823 }
38824 }
38825 }
38826
38827 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeDirectory>
38828 for crate::ExposeDirectory
38829 {
38830 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeDirectory) -> Self {
38831 Self {
38832 source: ::fidl_next::CompatFrom::compat_from(value.source),
38833
38834 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38835
38836 target: ::fidl_next::CompatFrom::compat_from(value.target),
38837
38838 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38839
38840 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
38841
38842 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
38843
38844 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38845
38846 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38847 }
38848 }
38849 }
38850
38851 impl ::fidl_next::CompatFrom<crate::ExposeRunner> for ::fidl_fuchsia_component_decl::ExposeRunner {
38852 fn compat_from(value: crate::ExposeRunner) -> Self {
38853 Self {
38854 source: ::fidl_next::CompatFrom::compat_from(value.source),
38855
38856 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38857
38858 target: ::fidl_next::CompatFrom::compat_from(value.target),
38859
38860 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38861
38862 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38863
38864 __source_breaking: ::fidl::marker::SourceBreaking,
38865 }
38866 }
38867 }
38868
38869 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeRunner> for crate::ExposeRunner {
38870 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeRunner) -> Self {
38871 Self {
38872 source: ::fidl_next::CompatFrom::compat_from(value.source),
38873
38874 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38875
38876 target: ::fidl_next::CompatFrom::compat_from(value.target),
38877
38878 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38879
38880 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38881 }
38882 }
38883 }
38884
38885 impl ::fidl_next::CompatFrom<crate::ExposeResolver>
38886 for ::fidl_fuchsia_component_decl::ExposeResolver
38887 {
38888 fn compat_from(value: crate::ExposeResolver) -> Self {
38889 Self {
38890 source: ::fidl_next::CompatFrom::compat_from(value.source),
38891
38892 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38893
38894 target: ::fidl_next::CompatFrom::compat_from(value.target),
38895
38896 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38897
38898 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38899
38900 __source_breaking: ::fidl::marker::SourceBreaking,
38901 }
38902 }
38903 }
38904
38905 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeResolver>
38906 for crate::ExposeResolver
38907 {
38908 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeResolver) -> Self {
38909 Self {
38910 source: ::fidl_next::CompatFrom::compat_from(value.source),
38911
38912 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38913
38914 target: ::fidl_next::CompatFrom::compat_from(value.target),
38915
38916 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38917
38918 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38919 }
38920 }
38921 }
38922
38923 impl ::fidl_next::CompatFrom<crate::ExposeDictionary>
38924 for ::fidl_fuchsia_component_decl::ExposeDictionary
38925 {
38926 fn compat_from(value: crate::ExposeDictionary) -> Self {
38927 Self {
38928 source: ::fidl_next::CompatFrom::compat_from(value.source),
38929
38930 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38931
38932 target: ::fidl_next::CompatFrom::compat_from(value.target),
38933
38934 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38935
38936 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38937
38938 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38939
38940 __source_breaking: ::fidl::marker::SourceBreaking,
38941 }
38942 }
38943 }
38944
38945 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeDictionary>
38946 for crate::ExposeDictionary
38947 {
38948 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeDictionary) -> Self {
38949 Self {
38950 source: ::fidl_next::CompatFrom::compat_from(value.source),
38951
38952 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38953
38954 target: ::fidl_next::CompatFrom::compat_from(value.target),
38955
38956 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38957
38958 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38959
38960 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38961 }
38962 }
38963 }
38964
38965 impl ::fidl_next::CompatFrom<crate::ExposeConfiguration>
38966 for ::fidl_fuchsia_component_decl::ExposeConfiguration
38967 {
38968 fn compat_from(value: crate::ExposeConfiguration) -> Self {
38969 Self {
38970 source: ::fidl_next::CompatFrom::compat_from(value.source),
38971
38972 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38973
38974 target: ::fidl_next::CompatFrom::compat_from(value.target),
38975
38976 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38977
38978 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
38979
38980 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
38981
38982 __source_breaking: ::fidl::marker::SourceBreaking,
38983 }
38984 }
38985 }
38986
38987 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeConfiguration>
38988 for crate::ExposeConfiguration
38989 {
38990 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeConfiguration) -> Self {
38991 Self {
38992 source: ::fidl_next::CompatFrom::compat_from(value.source),
38993
38994 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38995
38996 target: ::fidl_next::CompatFrom::compat_from(value.target),
38997
38998 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38999
39000 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
39001
39002 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
39003 }
39004 }
39005 }
39006
39007 impl ::fidl_next::CompatFrom<crate::Expose> for ::fidl_fuchsia_component_decl::Expose {
39008 fn compat_from(value: crate::Expose) -> Self {
39009 match value {
39010 crate::Expose::Service(value) => {
39011 Self::Service(::fidl_next::CompatFrom::compat_from(value))
39012 }
39013
39014 crate::Expose::Protocol(value) => {
39015 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
39016 }
39017
39018 crate::Expose::Directory(value) => {
39019 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
39020 }
39021
39022 crate::Expose::Runner(value) => {
39023 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
39024 }
39025
39026 crate::Expose::Resolver(value) => {
39027 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
39028 }
39029
39030 crate::Expose::Dictionary(value) => {
39031 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
39032 }
39033
39034 crate::Expose::Config(value) => {
39035 Self::Config(::fidl_next::CompatFrom::compat_from(value))
39036 }
39037
39038 crate::Expose::UnknownOrdinal_(unknown_ordinal) => {
39039 Self::__SourceBreaking { unknown_ordinal }
39040 }
39041 }
39042 }
39043 }
39044
39045 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Expose> for crate::Expose {
39046 fn compat_from(value: ::fidl_fuchsia_component_decl::Expose) -> Self {
39047 match value {
39048 ::fidl_fuchsia_component_decl::Expose::Service(value) => {
39049 Self::Service(::fidl_next::CompatFrom::compat_from(value))
39050 }
39051
39052 ::fidl_fuchsia_component_decl::Expose::Protocol(value) => {
39053 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
39054 }
39055
39056 ::fidl_fuchsia_component_decl::Expose::Directory(value) => {
39057 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
39058 }
39059
39060 ::fidl_fuchsia_component_decl::Expose::Runner(value) => {
39061 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
39062 }
39063
39064 ::fidl_fuchsia_component_decl::Expose::Resolver(value) => {
39065 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
39066 }
39067
39068 ::fidl_fuchsia_component_decl::Expose::Dictionary(value) => {
39069 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
39070 }
39071
39072 ::fidl_fuchsia_component_decl::Expose::Config(value) => {
39073 Self::Config(::fidl_next::CompatFrom::compat_from(value))
39074 }
39075
39076 ::fidl_fuchsia_component_decl::Expose::__SourceBreaking { unknown_ordinal } => {
39077 Self::UnknownOrdinal_(unknown_ordinal)
39078 }
39079 }
39080 }
39081 }
39082
39083 impl ::fidl_next::CompatFrom<crate::OfferService> for ::fidl_fuchsia_component_decl::OfferService {
39084 fn compat_from(value: crate::OfferService) -> Self {
39085 Self {
39086 source: ::fidl_next::CompatFrom::compat_from(value.source),
39087
39088 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39089
39090 target: ::fidl_next::CompatFrom::compat_from(value.target),
39091
39092 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39093
39094 source_instance_filter: ::fidl_next::CompatFrom::compat_from(
39095 value.source_instance_filter,
39096 ),
39097
39098 renamed_instances: ::fidl_next::CompatFrom::compat_from(value.renamed_instances),
39099
39100 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
39101
39102 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
39103
39104 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
39105
39106 __source_breaking: ::fidl::marker::SourceBreaking,
39107 }
39108 }
39109 }
39110
39111 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferService> for crate::OfferService {
39112 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferService) -> Self {
39113 Self {
39114 source: ::fidl_next::CompatFrom::compat_from(value.source),
39115
39116 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39117
39118 target: ::fidl_next::CompatFrom::compat_from(value.target),
39119
39120 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39121
39122 source_instance_filter: ::fidl_next::CompatFrom::compat_from(
39123 value.source_instance_filter,
39124 ),
39125
39126 renamed_instances: ::fidl_next::CompatFrom::compat_from(value.renamed_instances),
39127
39128 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
39129
39130 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
39131
39132 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
39133 }
39134 }
39135 }
39136
39137 impl ::fidl_next::CompatFrom<crate::OfferProtocol>
39138 for ::fidl_fuchsia_component_decl::OfferProtocol
39139 {
39140 fn compat_from(value: crate::OfferProtocol) -> Self {
39141 Self {
39142 source: ::fidl_next::CompatFrom::compat_from(value.source),
39143
39144 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39145
39146 target: ::fidl_next::CompatFrom::compat_from(value.target),
39147
39148 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39149
39150 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
39151
39152 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
39153
39154 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
39155
39156 __source_breaking: ::fidl::marker::SourceBreaking,
39157 }
39158 }
39159 }
39160
39161 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferProtocol>
39162 for crate::OfferProtocol
39163 {
39164 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferProtocol) -> Self {
39165 Self {
39166 source: ::fidl_next::CompatFrom::compat_from(value.source),
39167
39168 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39169
39170 target: ::fidl_next::CompatFrom::compat_from(value.target),
39171
39172 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39173
39174 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
39175
39176 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
39177
39178 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
39179 }
39180 }
39181 }
39182
39183 impl ::fidl_next::CompatFrom<crate::OfferDirectory>
39184 for ::fidl_fuchsia_component_decl::OfferDirectory
39185 {
39186 fn compat_from(value: crate::OfferDirectory) -> Self {
39187 Self {
39188 source: ::fidl_next::CompatFrom::compat_from(value.source),
39189
39190 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39191
39192 target: ::fidl_next::CompatFrom::compat_from(value.target),
39193
39194 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39195
39196 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
39197
39198 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
39199
39200 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
39201
39202 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
39203
39204 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
39205
39206 __source_breaking: ::fidl::marker::SourceBreaking,
39207 }
39208 }
39209 }
39210
39211 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferDirectory>
39212 for crate::OfferDirectory
39213 {
39214 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferDirectory) -> Self {
39215 Self {
39216 source: ::fidl_next::CompatFrom::compat_from(value.source),
39217
39218 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39219
39220 target: ::fidl_next::CompatFrom::compat_from(value.target),
39221
39222 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39223
39224 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
39225
39226 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
39227
39228 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
39229
39230 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
39231
39232 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
39233 }
39234 }
39235 }
39236
39237 impl ::fidl_next::CompatFrom<crate::OfferStorage> for ::fidl_fuchsia_component_decl::OfferStorage {
39238 fn compat_from(value: crate::OfferStorage) -> Self {
39239 Self {
39240 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39241
39242 source: ::fidl_next::CompatFrom::compat_from(value.source),
39243
39244 target: ::fidl_next::CompatFrom::compat_from(value.target),
39245
39246 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39247
39248 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
39249
39250 __source_breaking: ::fidl::marker::SourceBreaking,
39251 }
39252 }
39253 }
39254
39255 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferStorage> for crate::OfferStorage {
39256 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferStorage) -> Self {
39257 Self {
39258 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39259
39260 source: ::fidl_next::CompatFrom::compat_from(value.source),
39261
39262 target: ::fidl_next::CompatFrom::compat_from(value.target),
39263
39264 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39265
39266 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
39267 }
39268 }
39269 }
39270
39271 impl ::fidl_next::CompatFrom<crate::OfferRunner> for ::fidl_fuchsia_component_decl::OfferRunner {
39272 fn compat_from(value: crate::OfferRunner) -> Self {
39273 Self {
39274 source: ::fidl_next::CompatFrom::compat_from(value.source),
39275
39276 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39277
39278 target: ::fidl_next::CompatFrom::compat_from(value.target),
39279
39280 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39281
39282 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
39283
39284 __source_breaking: ::fidl::marker::SourceBreaking,
39285 }
39286 }
39287 }
39288
39289 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferRunner> for crate::OfferRunner {
39290 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferRunner) -> Self {
39291 Self {
39292 source: ::fidl_next::CompatFrom::compat_from(value.source),
39293
39294 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39295
39296 target: ::fidl_next::CompatFrom::compat_from(value.target),
39297
39298 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39299
39300 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
39301 }
39302 }
39303 }
39304
39305 impl ::fidl_next::CompatFrom<crate::OfferResolver>
39306 for ::fidl_fuchsia_component_decl::OfferResolver
39307 {
39308 fn compat_from(value: crate::OfferResolver) -> Self {
39309 Self {
39310 source: ::fidl_next::CompatFrom::compat_from(value.source),
39311
39312 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39313
39314 target: ::fidl_next::CompatFrom::compat_from(value.target),
39315
39316 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39317
39318 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
39319
39320 __source_breaking: ::fidl::marker::SourceBreaking,
39321 }
39322 }
39323 }
39324
39325 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferResolver>
39326 for crate::OfferResolver
39327 {
39328 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferResolver) -> Self {
39329 Self {
39330 source: ::fidl_next::CompatFrom::compat_from(value.source),
39331
39332 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39333
39334 target: ::fidl_next::CompatFrom::compat_from(value.target),
39335
39336 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39337
39338 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
39339 }
39340 }
39341 }
39342
39343 impl ::fidl_next::CompatFrom<crate::OfferEventStream>
39344 for ::fidl_fuchsia_component_decl::OfferEventStream
39345 {
39346 fn compat_from(value: crate::OfferEventStream) -> Self {
39347 Self {
39348 source: ::fidl_next::CompatFrom::compat_from(value.source),
39349
39350 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39351
39352 scope: ::fidl_next::CompatFrom::compat_from(value.scope),
39353
39354 target: ::fidl_next::CompatFrom::compat_from(value.target),
39355
39356 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39357
39358 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
39359
39360 __source_breaking: ::fidl::marker::SourceBreaking,
39361 }
39362 }
39363 }
39364
39365 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferEventStream>
39366 for crate::OfferEventStream
39367 {
39368 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferEventStream) -> Self {
39369 Self {
39370 source: ::fidl_next::CompatFrom::compat_from(value.source),
39371
39372 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39373
39374 scope: ::fidl_next::CompatFrom::compat_from(value.scope),
39375
39376 target: ::fidl_next::CompatFrom::compat_from(value.target),
39377
39378 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39379
39380 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
39381 }
39382 }
39383 }
39384
39385 impl ::fidl_next::CompatFrom<crate::OfferDictionary>
39386 for ::fidl_fuchsia_component_decl::OfferDictionary
39387 {
39388 fn compat_from(value: crate::OfferDictionary) -> Self {
39389 Self {
39390 source: ::fidl_next::CompatFrom::compat_from(value.source),
39391
39392 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39393
39394 target: ::fidl_next::CompatFrom::compat_from(value.target),
39395
39396 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39397
39398 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
39399
39400 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
39401
39402 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
39403
39404 __source_breaking: ::fidl::marker::SourceBreaking,
39405 }
39406 }
39407 }
39408
39409 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferDictionary>
39410 for crate::OfferDictionary
39411 {
39412 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferDictionary) -> Self {
39413 Self {
39414 source: ::fidl_next::CompatFrom::compat_from(value.source),
39415
39416 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39417
39418 target: ::fidl_next::CompatFrom::compat_from(value.target),
39419
39420 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39421
39422 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
39423
39424 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
39425
39426 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
39427 }
39428 }
39429 }
39430
39431 impl ::fidl_next::CompatFrom<crate::OfferConfiguration>
39432 for ::fidl_fuchsia_component_decl::OfferConfiguration
39433 {
39434 fn compat_from(value: crate::OfferConfiguration) -> Self {
39435 Self {
39436 source: ::fidl_next::CompatFrom::compat_from(value.source),
39437
39438 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39439
39440 target: ::fidl_next::CompatFrom::compat_from(value.target),
39441
39442 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39443
39444 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
39445
39446 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
39447
39448 __source_breaking: ::fidl::marker::SourceBreaking,
39449 }
39450 }
39451 }
39452
39453 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferConfiguration>
39454 for crate::OfferConfiguration
39455 {
39456 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferConfiguration) -> Self {
39457 Self {
39458 source: ::fidl_next::CompatFrom::compat_from(value.source),
39459
39460 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39461
39462 target: ::fidl_next::CompatFrom::compat_from(value.target),
39463
39464 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39465
39466 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
39467
39468 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
39469 }
39470 }
39471 }
39472
39473 impl ::fidl_next::CompatFrom<crate::Offer> for ::fidl_fuchsia_component_decl::Offer {
39474 fn compat_from(value: crate::Offer) -> Self {
39475 match value {
39476 crate::Offer::Service(value) => {
39477 Self::Service(::fidl_next::CompatFrom::compat_from(value))
39478 }
39479
39480 crate::Offer::Protocol(value) => {
39481 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
39482 }
39483
39484 crate::Offer::Directory(value) => {
39485 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
39486 }
39487
39488 crate::Offer::Storage(value) => {
39489 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
39490 }
39491
39492 crate::Offer::Runner(value) => {
39493 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
39494 }
39495
39496 crate::Offer::Resolver(value) => {
39497 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
39498 }
39499
39500 crate::Offer::EventStream(value) => {
39501 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
39502 }
39503
39504 crate::Offer::Dictionary(value) => {
39505 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
39506 }
39507
39508 crate::Offer::Config(value) => {
39509 Self::Config(::fidl_next::CompatFrom::compat_from(value))
39510 }
39511
39512 crate::Offer::UnknownOrdinal_(unknown_ordinal) => {
39513 Self::__SourceBreaking { unknown_ordinal }
39514 }
39515 }
39516 }
39517 }
39518
39519 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Offer> for crate::Offer {
39520 fn compat_from(value: ::fidl_fuchsia_component_decl::Offer) -> Self {
39521 match value {
39522 ::fidl_fuchsia_component_decl::Offer::Service(value) => {
39523 Self::Service(::fidl_next::CompatFrom::compat_from(value))
39524 }
39525
39526 ::fidl_fuchsia_component_decl::Offer::Protocol(value) => {
39527 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
39528 }
39529
39530 ::fidl_fuchsia_component_decl::Offer::Directory(value) => {
39531 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
39532 }
39533
39534 ::fidl_fuchsia_component_decl::Offer::Storage(value) => {
39535 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
39536 }
39537
39538 ::fidl_fuchsia_component_decl::Offer::Runner(value) => {
39539 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
39540 }
39541
39542 ::fidl_fuchsia_component_decl::Offer::Resolver(value) => {
39543 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
39544 }
39545
39546 ::fidl_fuchsia_component_decl::Offer::EventStream(value) => {
39547 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
39548 }
39549
39550 ::fidl_fuchsia_component_decl::Offer::Dictionary(value) => {
39551 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
39552 }
39553
39554 ::fidl_fuchsia_component_decl::Offer::Config(value) => {
39555 Self::Config(::fidl_next::CompatFrom::compat_from(value))
39556 }
39557
39558 ::fidl_fuchsia_component_decl::Offer::__SourceBreaking { unknown_ordinal } => {
39559 Self::UnknownOrdinal_(unknown_ordinal)
39560 }
39561 }
39562 }
39563 }
39564
39565 impl ::fidl_next::CompatFrom<crate::RunnerRegistration>
39566 for ::fidl_fuchsia_component_decl::RunnerRegistration
39567 {
39568 fn compat_from(value: crate::RunnerRegistration) -> Self {
39569 Self {
39570 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39571
39572 source: ::fidl_next::CompatFrom::compat_from(value.source),
39573
39574 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39575
39576 __source_breaking: ::fidl::marker::SourceBreaking,
39577 }
39578 }
39579 }
39580
39581 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::RunnerRegistration>
39582 for crate::RunnerRegistration
39583 {
39584 fn compat_from(value: ::fidl_fuchsia_component_decl::RunnerRegistration) -> Self {
39585 Self {
39586 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39587
39588 source: ::fidl_next::CompatFrom::compat_from(value.source),
39589
39590 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39591 }
39592 }
39593 }
39594
39595 impl ::fidl_next::CompatFrom<crate::ResolverRegistration>
39596 for ::fidl_fuchsia_component_decl::ResolverRegistration
39597 {
39598 fn compat_from(value: crate::ResolverRegistration) -> Self {
39599 Self {
39600 resolver: ::fidl_next::CompatFrom::compat_from(value.resolver),
39601
39602 source: ::fidl_next::CompatFrom::compat_from(value.source),
39603
39604 scheme: ::fidl_next::CompatFrom::compat_from(value.scheme),
39605
39606 __source_breaking: ::fidl::marker::SourceBreaking,
39607 }
39608 }
39609 }
39610
39611 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ResolverRegistration>
39612 for crate::ResolverRegistration
39613 {
39614 fn compat_from(value: ::fidl_fuchsia_component_decl::ResolverRegistration) -> Self {
39615 Self {
39616 resolver: ::fidl_next::CompatFrom::compat_from(value.resolver),
39617
39618 source: ::fidl_next::CompatFrom::compat_from(value.source),
39619
39620 scheme: ::fidl_next::CompatFrom::compat_from(value.scheme),
39621 }
39622 }
39623 }
39624
39625 impl ::fidl_next::CompatFrom<crate::DebugProtocolRegistration>
39626 for ::fidl_fuchsia_component_decl::DebugProtocolRegistration
39627 {
39628 fn compat_from(value: crate::DebugProtocolRegistration) -> Self {
39629 Self {
39630 source: ::fidl_next::CompatFrom::compat_from(value.source),
39631
39632 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39633
39634 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39635
39636 __source_breaking: ::fidl::marker::SourceBreaking,
39637 }
39638 }
39639 }
39640
39641 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DebugProtocolRegistration>
39642 for crate::DebugProtocolRegistration
39643 {
39644 fn compat_from(value: ::fidl_fuchsia_component_decl::DebugProtocolRegistration) -> Self {
39645 Self {
39646 source: ::fidl_next::CompatFrom::compat_from(value.source),
39647
39648 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
39649
39650 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
39651 }
39652 }
39653 }
39654
39655 impl ::fidl_next::CompatFrom<crate::DebugRegistration>
39656 for ::fidl_fuchsia_component_decl::DebugRegistration
39657 {
39658 fn compat_from(value: crate::DebugRegistration) -> Self {
39659 match value {
39660 crate::DebugRegistration::Protocol(value) => {
39661 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
39662 }
39663
39664 crate::DebugRegistration::UnknownOrdinal_(unknown_ordinal) => {
39665 Self::__SourceBreaking { unknown_ordinal }
39666 }
39667 }
39668 }
39669 }
39670
39671 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DebugRegistration>
39672 for crate::DebugRegistration
39673 {
39674 fn compat_from(value: ::fidl_fuchsia_component_decl::DebugRegistration) -> Self {
39675 match value {
39676 ::fidl_fuchsia_component_decl::DebugRegistration::Protocol(value) => {
39677 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
39678 }
39679
39680 ::fidl_fuchsia_component_decl::DebugRegistration::__SourceBreaking {
39681 unknown_ordinal,
39682 } => Self::UnknownOrdinal_(unknown_ordinal),
39683 }
39684 }
39685 }
39686
39687 impl ::fidl_next::CompatFrom<crate::Environment> for ::fidl_fuchsia_component_decl::Environment {
39688 fn compat_from(value: crate::Environment) -> Self {
39689 Self {
39690 name: ::fidl_next::CompatFrom::compat_from(value.name),
39691
39692 extends: ::fidl_next::CompatFrom::compat_from(value.extends),
39693
39694 runners: ::fidl_next::CompatFrom::compat_from(value.runners),
39695
39696 resolvers: ::fidl_next::CompatFrom::compat_from(value.resolvers),
39697
39698 debug_capabilities: ::fidl_next::CompatFrom::compat_from(value.debug_capabilities),
39699
39700 stop_timeout_ms: ::fidl_next::CompatFrom::compat_from(value.stop_timeout_ms),
39701
39702 __source_breaking: ::fidl::marker::SourceBreaking,
39703 }
39704 }
39705 }
39706
39707 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Environment> for crate::Environment {
39708 fn compat_from(value: ::fidl_fuchsia_component_decl::Environment) -> Self {
39709 Self {
39710 name: ::fidl_next::CompatFrom::compat_from(value.name),
39711
39712 extends: ::fidl_next::CompatFrom::compat_from(value.extends),
39713
39714 runners: ::fidl_next::CompatFrom::compat_from(value.runners),
39715
39716 resolvers: ::fidl_next::CompatFrom::compat_from(value.resolvers),
39717
39718 debug_capabilities: ::fidl_next::CompatFrom::compat_from(value.debug_capabilities),
39719
39720 stop_timeout_ms: ::fidl_next::CompatFrom::compat_from(value.stop_timeout_ms),
39721 }
39722 }
39723 }
39724
39725 impl ::fidl_next::CompatFrom<crate::ConfigSourceCapabilities>
39726 for ::fidl_fuchsia_component_decl::ConfigSourceCapabilities
39727 {
39728 fn compat_from(value: crate::ConfigSourceCapabilities) -> Self {
39729 Self { __source_breaking: ::fidl::marker::SourceBreaking }
39730 }
39731 }
39732
39733 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigSourceCapabilities>
39734 for crate::ConfigSourceCapabilities
39735 {
39736 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigSourceCapabilities) -> Self {
39737 Self {}
39738 }
39739 }
39740
39741 impl ::fidl_next::CompatFrom<crate::ConfigValueSource>
39742 for ::fidl_fuchsia_component_decl::ConfigValueSource
39743 {
39744 fn compat_from(value: crate::ConfigValueSource) -> Self {
39745 match value {
39746 crate::ConfigValueSource::PackagePath(value) => {
39747 Self::PackagePath(::fidl_next::CompatFrom::compat_from(value))
39748 }
39749
39750 crate::ConfigValueSource::Capabilities(value) => {
39751 Self::Capabilities(::fidl_next::CompatFrom::compat_from(value))
39752 }
39753
39754 crate::ConfigValueSource::UnknownOrdinal_(unknown_ordinal) => {
39755 Self::__SourceBreaking { unknown_ordinal }
39756 }
39757 }
39758 }
39759 }
39760
39761 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigValueSource>
39762 for crate::ConfigValueSource
39763 {
39764 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigValueSource) -> Self {
39765 match value {
39766 ::fidl_fuchsia_component_decl::ConfigValueSource::PackagePath(value) => {
39767 Self::PackagePath(::fidl_next::CompatFrom::compat_from(value))
39768 }
39769
39770 ::fidl_fuchsia_component_decl::ConfigValueSource::Capabilities(value) => {
39771 Self::Capabilities(::fidl_next::CompatFrom::compat_from(value))
39772 }
39773
39774 ::fidl_fuchsia_component_decl::ConfigValueSource::__SourceBreaking {
39775 unknown_ordinal,
39776 } => Self::UnknownOrdinal_(unknown_ordinal),
39777 }
39778 }
39779 }
39780
39781 impl ::fidl_next::CompatFrom<crate::ConfigSchema> for ::fidl_fuchsia_component_decl::ConfigSchema {
39782 fn compat_from(value: crate::ConfigSchema) -> Self {
39783 Self {
39784 fields: ::fidl_next::CompatFrom::compat_from(value.fields),
39785
39786 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
39787
39788 value_source: ::fidl_next::CompatFrom::compat_from(value.value_source),
39789
39790 __source_breaking: ::fidl::marker::SourceBreaking,
39791 }
39792 }
39793 }
39794
39795 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigSchema> for crate::ConfigSchema {
39796 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigSchema) -> Self {
39797 Self {
39798 fields: ::fidl_next::CompatFrom::compat_from(value.fields),
39799
39800 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
39801
39802 value_source: ::fidl_next::CompatFrom::compat_from(value.value_source),
39803 }
39804 }
39805 }
39806
39807 impl ::fidl_next::CompatFrom<crate::Component> for ::fidl_fuchsia_component_decl::Component {
39808 fn compat_from(value: crate::Component) -> Self {
39809 Self {
39810 program: ::fidl_next::CompatFrom::compat_from(value.program),
39811
39812 uses: ::fidl_next::CompatFrom::compat_from(value.uses),
39813
39814 exposes: ::fidl_next::CompatFrom::compat_from(value.exposes),
39815
39816 offers: ::fidl_next::CompatFrom::compat_from(value.offers),
39817
39818 capabilities: ::fidl_next::CompatFrom::compat_from(value.capabilities),
39819
39820 children: ::fidl_next::CompatFrom::compat_from(value.children),
39821
39822 collections: ::fidl_next::CompatFrom::compat_from(value.collections),
39823
39824 environments: ::fidl_next::CompatFrom::compat_from(value.environments),
39825
39826 facets: ::fidl_next::CompatFrom::compat_from(value.facets),
39827
39828 config: ::fidl_next::CompatFrom::compat_from(value.config),
39829
39830 debug_info: ::fidl_next::CompatFrom::compat_from(value.debug_info),
39831
39832 __source_breaking: ::fidl::marker::SourceBreaking,
39833 }
39834 }
39835 }
39836
39837 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Component> for crate::Component {
39838 fn compat_from(value: ::fidl_fuchsia_component_decl::Component) -> Self {
39839 Self {
39840 program: ::fidl_next::CompatFrom::compat_from(value.program),
39841
39842 uses: ::fidl_next::CompatFrom::compat_from(value.uses),
39843
39844 exposes: ::fidl_next::CompatFrom::compat_from(value.exposes),
39845
39846 offers: ::fidl_next::CompatFrom::compat_from(value.offers),
39847
39848 capabilities: ::fidl_next::CompatFrom::compat_from(value.capabilities),
39849
39850 children: ::fidl_next::CompatFrom::compat_from(value.children),
39851
39852 collections: ::fidl_next::CompatFrom::compat_from(value.collections),
39853
39854 environments: ::fidl_next::CompatFrom::compat_from(value.environments),
39855
39856 facets: ::fidl_next::CompatFrom::compat_from(value.facets),
39857
39858 config: ::fidl_next::CompatFrom::compat_from(value.config),
39859
39860 debug_info: ::fidl_next::CompatFrom::compat_from(value.debug_info),
39861 }
39862 }
39863 }
39864
39865 impl ::fidl_next::CompatFrom<crate::ConfigValueSpec>
39866 for ::fidl_fuchsia_component_decl::ConfigValueSpec
39867 {
39868 fn compat_from(value: crate::ConfigValueSpec) -> Self {
39869 Self {
39870 value: ::fidl_next::CompatFrom::compat_from(value.value),
39871
39872 __source_breaking: ::fidl::marker::SourceBreaking,
39873 }
39874 }
39875 }
39876
39877 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigValueSpec>
39878 for crate::ConfigValueSpec
39879 {
39880 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigValueSpec) -> Self {
39881 Self { value: ::fidl_next::CompatFrom::compat_from(value.value) }
39882 }
39883 }
39884
39885 impl ::fidl_next::CompatFrom<crate::ConfigValuesData>
39886 for ::fidl_fuchsia_component_decl::ConfigValuesData
39887 {
39888 fn compat_from(value: crate::ConfigValuesData) -> Self {
39889 Self {
39890 values: ::fidl_next::CompatFrom::compat_from(value.values),
39891
39892 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
39893
39894 __source_breaking: ::fidl::marker::SourceBreaking,
39895 }
39896 }
39897 }
39898
39899 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigValuesData>
39900 for crate::ConfigValuesData
39901 {
39902 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigValuesData) -> Self {
39903 Self {
39904 values: ::fidl_next::CompatFrom::compat_from(value.values),
39905
39906 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
39907 }
39908 }
39909 }
39910
39911 impl ::fidl_next::CompatFrom<crate::EventSubscription>
39912 for ::fidl_fuchsia_component_decl::EventSubscription
39913 {
39914 fn compat_from(value: crate::EventSubscription) -> Self {
39915 Self {
39916 event_name: ::fidl_next::CompatFrom::compat_from(value.event_name),
39917
39918 __source_breaking: ::fidl::marker::SourceBreaking,
39919 }
39920 }
39921 }
39922
39923 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::EventSubscription>
39924 for crate::EventSubscription
39925 {
39926 fn compat_from(value: ::fidl_fuchsia_component_decl::EventSubscription) -> Self {
39927 Self { event_name: ::fidl_next::CompatFrom::compat_from(value.event_name) }
39928 }
39929 }
39930
39931 impl ::fidl_next::CompatFrom<crate::LayoutParameter>
39932 for ::fidl_fuchsia_component_decl::LayoutParameter
39933 {
39934 fn compat_from(value: crate::LayoutParameter) -> Self {
39935 match value {
39936 crate::LayoutParameter::NestedType(value) => {
39937 Self::NestedType(::fidl_next::CompatFrom::compat_from(value))
39938 }
39939
39940 crate::LayoutParameter::UnknownOrdinal_(unknown_ordinal) => {
39941 Self::__SourceBreaking { unknown_ordinal }
39942 }
39943 }
39944 }
39945 }
39946
39947 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::LayoutParameter>
39948 for crate::LayoutParameter
39949 {
39950 fn compat_from(value: ::fidl_fuchsia_component_decl::LayoutParameter) -> Self {
39951 match value {
39952 ::fidl_fuchsia_component_decl::LayoutParameter::NestedType(value) => {
39953 Self::NestedType(::fidl_next::CompatFrom::compat_from(value))
39954 }
39955
39956 ::fidl_fuchsia_component_decl::LayoutParameter::__SourceBreaking {
39957 unknown_ordinal,
39958 } => Self::UnknownOrdinal_(unknown_ordinal),
39959 }
39960 }
39961 }
39962
39963 impl ::fidl_next::CompatFrom<crate::ResolvedConfigField>
39964 for ::fidl_fuchsia_component_decl::ResolvedConfigField
39965 {
39966 #[inline]
39967 fn compat_from(value: crate::ResolvedConfigField) -> Self {
39968 Self {
39969 key: ::fidl_next::CompatFrom::compat_from(value.key),
39970
39971 value: ::fidl_next::CompatFrom::compat_from(value.value),
39972 }
39973 }
39974 }
39975
39976 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ResolvedConfigField>
39977 for crate::ResolvedConfigField
39978 {
39979 #[inline]
39980 fn compat_from(value: ::fidl_fuchsia_component_decl::ResolvedConfigField) -> Self {
39981 Self {
39982 key: ::fidl_next::CompatFrom::compat_from(value.key),
39983
39984 value: ::fidl_next::CompatFrom::compat_from(value.value),
39985 }
39986 }
39987 }
39988
39989 impl ::fidl_next::CompatFrom<crate::ResolvedConfig>
39990 for ::fidl_fuchsia_component_decl::ResolvedConfig
39991 {
39992 #[inline]
39993 fn compat_from(value: crate::ResolvedConfig) -> Self {
39994 Self {
39995 fields: ::fidl_next::CompatFrom::compat_from(value.fields),
39996
39997 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
39998 }
39999 }
40000 }
40001
40002 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ResolvedConfig>
40003 for crate::ResolvedConfig
40004 {
40005 #[inline]
40006 fn compat_from(value: ::fidl_fuchsia_component_decl::ResolvedConfig) -> Self {
40007 Self {
40008 fields: ::fidl_next::CompatFrom::compat_from(value.fields),
40009
40010 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
40011 }
40012 }
40013 }
40014}