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(Clone, Copy, Debug, PartialEq, Eq)]
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::WireU32::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(Clone, Copy, Debug, PartialEq, Eq)]
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::WireU32::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(PartialEq, Clone, Debug, Default)]
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::WireEnvelope>::uninit();
227 ::fidl_next::Wire::zero_padding(&mut out);
228
229 let mut preallocated =
230 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
231
232 for i in 1..=max_ord {
233 match i {
234 2 => {
235 if let Some(value) = self.source_path.take() {
236 ::fidl_next::WireEnvelope::encode_value::<
237 ::fidl_next::WireString<'static>,
238 ___E,
239 >(
240 value, preallocated.encoder, &mut out, 1024
241 )?;
242 } else {
243 ::fidl_next::WireEnvelope::encode_zero(&mut out)
244 }
245 }
246
247 1 => {
248 if let Some(value) = self.name.take() {
249 ::fidl_next::WireEnvelope::encode_value::<
250 ::fidl_next::WireString<'static>,
251 ___E,
252 >(
253 value, preallocated.encoder, &mut out, 100
254 )?;
255 } else {
256 ::fidl_next::WireEnvelope::encode_zero(&mut out)
257 }
258 }
259
260 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
261 }
262 unsafe {
263 preallocated.write_next(out.assume_init_ref());
264 }
265 }
266
267 ::fidl_next::WireTable::encode_len(table, max_ord);
268
269 Ok(())
270 }
271 }
272
273 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Service<'static>, ___E> for &'a Service
274 where
275 ___E: ::fidl_next::Encoder + ?Sized,
276 {
277 #[inline]
278 fn encode(
279 self,
280 encoder: &mut ___E,
281 out: &mut ::core::mem::MaybeUninit<crate::wire::Service<'static>>,
282 _: (),
283 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
284 ::fidl_next::munge!(let crate::wire::Service { table } = out);
285
286 let max_ord = self.__max_ordinal();
287
288 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
289 ::fidl_next::Wire::zero_padding(&mut out);
290
291 let mut preallocated =
292 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
293
294 for i in 1..=max_ord {
295 match i {
296 2 => {
297 if let Some(value) = &self.source_path {
298 ::fidl_next::WireEnvelope::encode_value::<
299 ::fidl_next::WireString<'static>,
300 ___E,
301 >(
302 value, preallocated.encoder, &mut out, 1024
303 )?;
304 } else {
305 ::fidl_next::WireEnvelope::encode_zero(&mut out)
306 }
307 }
308
309 1 => {
310 if let Some(value) = &self.name {
311 ::fidl_next::WireEnvelope::encode_value::<
312 ::fidl_next::WireString<'static>,
313 ___E,
314 >(
315 value, preallocated.encoder, &mut out, 100
316 )?;
317 } else {
318 ::fidl_next::WireEnvelope::encode_zero(&mut out)
319 }
320 }
321
322 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
323 }
324 unsafe {
325 preallocated.write_next(out.assume_init_ref());
326 }
327 }
328
329 ::fidl_next::WireTable::encode_len(table, max_ord);
330
331 Ok(())
332 }
333 }
334
335 impl<'de> ::fidl_next::FromWire<crate::wire::Service<'de>> for Service {
336 #[inline]
337 fn from_wire(wire_: crate::wire::Service<'de>) -> Self {
338 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
339
340 let name = wire_.table.get(1);
341
342 let source_path = wire_.table.get(2);
343
344 Self {
345 name: name.map(|envelope| {
346 ::fidl_next::FromWire::from_wire(unsafe {
347 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
348 })
349 }),
350
351 source_path: source_path.map(|envelope| {
352 ::fidl_next::FromWire::from_wire(unsafe {
353 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
354 })
355 }),
356 }
357 }
358 }
359
360 impl<'de> ::fidl_next::FromWireRef<crate::wire::Service<'de>> for Service {
361 #[inline]
362 fn from_wire_ref(wire: &crate::wire::Service<'de>) -> Self {
363 Self {
364 name: wire.table.get(1).map(|envelope| {
365 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
366 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
367 })
368 }),
369
370 source_path: wire.table.get(2).map(|envelope| {
371 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
372 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
373 })
374 }),
375 }
376 }
377 }
378
379 #[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"]
380 #[derive(PartialEq, Clone, Debug, Default)]
381 pub struct Directory {
382 pub name: ::core::option::Option<::std::string::String>,
383
384 pub source_path: ::core::option::Option<::std::string::String>,
385
386 pub rights: ::core::option::Option<::fidl_next_common_fuchsia_io::natural::Operations>,
387 }
388
389 impl Directory {
390 fn __max_ordinal(&self) -> usize {
391 if self.rights.is_some() {
392 return 3;
393 }
394
395 if self.source_path.is_some() {
396 return 2;
397 }
398
399 if self.name.is_some() {
400 return 1;
401 }
402
403 0
404 }
405 }
406
407 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Directory<'static>, ___E> for Directory
408 where
409 ___E: ::fidl_next::Encoder + ?Sized,
410 {
411 #[inline]
412 fn encode(
413 mut self,
414 encoder: &mut ___E,
415 out: &mut ::core::mem::MaybeUninit<crate::wire::Directory<'static>>,
416 _: (),
417 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
418 ::fidl_next::munge!(let crate::wire::Directory { table } = out);
419
420 let max_ord = self.__max_ordinal();
421
422 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
423 ::fidl_next::Wire::zero_padding(&mut out);
424
425 let mut preallocated =
426 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
427
428 for i in 1..=max_ord {
429 match i {
430 3 => {
431 if let Some(value) = self.rights.take() {
432 ::fidl_next::WireEnvelope::encode_value::<
433 ::fidl_next_common_fuchsia_io::wire::Operations,
434 ___E,
435 >(
436 value, preallocated.encoder, &mut out, ()
437 )?;
438 } else {
439 ::fidl_next::WireEnvelope::encode_zero(&mut out)
440 }
441 }
442
443 2 => {
444 if let Some(value) = self.source_path.take() {
445 ::fidl_next::WireEnvelope::encode_value::<
446 ::fidl_next::WireString<'static>,
447 ___E,
448 >(
449 value, preallocated.encoder, &mut out, 1024
450 )?;
451 } else {
452 ::fidl_next::WireEnvelope::encode_zero(&mut out)
453 }
454 }
455
456 1 => {
457 if let Some(value) = self.name.take() {
458 ::fidl_next::WireEnvelope::encode_value::<
459 ::fidl_next::WireString<'static>,
460 ___E,
461 >(
462 value, preallocated.encoder, &mut out, 100
463 )?;
464 } else {
465 ::fidl_next::WireEnvelope::encode_zero(&mut out)
466 }
467 }
468
469 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
470 }
471 unsafe {
472 preallocated.write_next(out.assume_init_ref());
473 }
474 }
475
476 ::fidl_next::WireTable::encode_len(table, max_ord);
477
478 Ok(())
479 }
480 }
481
482 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Directory<'static>, ___E> for &'a Directory
483 where
484 ___E: ::fidl_next::Encoder + ?Sized,
485 {
486 #[inline]
487 fn encode(
488 self,
489 encoder: &mut ___E,
490 out: &mut ::core::mem::MaybeUninit<crate::wire::Directory<'static>>,
491 _: (),
492 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
493 ::fidl_next::munge!(let crate::wire::Directory { table } = out);
494
495 let max_ord = self.__max_ordinal();
496
497 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
498 ::fidl_next::Wire::zero_padding(&mut out);
499
500 let mut preallocated =
501 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
502
503 for i in 1..=max_ord {
504 match i {
505 3 => {
506 if let Some(value) = &self.rights {
507 ::fidl_next::WireEnvelope::encode_value::<
508 ::fidl_next_common_fuchsia_io::wire::Operations,
509 ___E,
510 >(
511 value, preallocated.encoder, &mut out, ()
512 )?;
513 } else {
514 ::fidl_next::WireEnvelope::encode_zero(&mut out)
515 }
516 }
517
518 2 => {
519 if let Some(value) = &self.source_path {
520 ::fidl_next::WireEnvelope::encode_value::<
521 ::fidl_next::WireString<'static>,
522 ___E,
523 >(
524 value, preallocated.encoder, &mut out, 1024
525 )?;
526 } else {
527 ::fidl_next::WireEnvelope::encode_zero(&mut out)
528 }
529 }
530
531 1 => {
532 if let Some(value) = &self.name {
533 ::fidl_next::WireEnvelope::encode_value::<
534 ::fidl_next::WireString<'static>,
535 ___E,
536 >(
537 value, preallocated.encoder, &mut out, 100
538 )?;
539 } else {
540 ::fidl_next::WireEnvelope::encode_zero(&mut out)
541 }
542 }
543
544 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
545 }
546 unsafe {
547 preallocated.write_next(out.assume_init_ref());
548 }
549 }
550
551 ::fidl_next::WireTable::encode_len(table, max_ord);
552
553 Ok(())
554 }
555 }
556
557 impl<'de> ::fidl_next::FromWire<crate::wire::Directory<'de>> for Directory {
558 #[inline]
559 fn from_wire(wire_: crate::wire::Directory<'de>) -> Self {
560 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
561
562 let name = wire_.table.get(1);
563
564 let source_path = wire_.table.get(2);
565
566 let rights = wire_.table.get(3);
567
568 Self {
569 name: name.map(|envelope| {
570 ::fidl_next::FromWire::from_wire(unsafe {
571 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
572 })
573 }),
574
575 source_path: source_path.map(|envelope| {
576 ::fidl_next::FromWire::from_wire(unsafe {
577 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
578 })
579 }),
580
581 rights: rights.map(|envelope| {
582 ::fidl_next::FromWire::from_wire(unsafe {
583 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
584 })
585 }),
586 }
587 }
588 }
589
590 impl<'de> ::fidl_next::FromWireRef<crate::wire::Directory<'de>> for Directory {
591 #[inline]
592 fn from_wire_ref(wire: &crate::wire::Directory<'de>) -> Self {
593 Self {
594 name: wire.table.get(1).map(|envelope| {
595 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
596 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
597 })
598 }),
599
600 source_path: wire.table.get(2).map(|envelope| {
601 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
602 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
603 })
604 }),
605
606 rights: wire.table.get(3).map(|envelope| {
607 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
608 envelope
609 .deref_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
610 })
611 }),
612 }
613 }
614 }
615
616 #[doc = " A reference to a component\'s parent instance.\n"]
617 #[derive(PartialEq, Clone, Debug)]
618 #[repr(C)]
619 pub struct ParentRef {}
620
621 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ParentRef, ___E> for ParentRef
622 where
623 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
624 {
625 #[inline]
626 fn encode(
627 self,
628 encoder_: &mut ___E,
629 out_: &mut ::core::mem::MaybeUninit<crate::wire::ParentRef>,
630 _: (),
631 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
632 *out_ = ::core::mem::MaybeUninit::zeroed();
633
634 Ok(())
635 }
636 }
637
638 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ParentRef, ___E> for &'a ParentRef
639 where
640 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
641 {
642 #[inline]
643 fn encode(
644 self,
645 encoder_: &mut ___E,
646 out_: &mut ::core::mem::MaybeUninit<crate::wire::ParentRef>,
647 _: (),
648 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
649 ::fidl_next::munge! {
650 let crate::wire::ParentRef {
651
652 _empty,
653
654
655 } = out_;
656 }
657
658 Ok(())
659 }
660 }
661
662 unsafe impl<___E>
663 ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::ParentRef>, ___E>
664 for ParentRef
665 where
666 ___E: ::fidl_next::Encoder + ?Sized,
667 ParentRef: ::fidl_next::Encode<crate::wire::ParentRef, ___E>,
668 {
669 #[inline]
670 fn encode_option(
671 this: ::core::option::Option<Self>,
672 encoder: &mut ___E,
673 out: &mut ::core::mem::MaybeUninit<
674 ::fidl_next::WireBox<'static, crate::wire::ParentRef>,
675 >,
676 _: (),
677 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
678 if let Some(inner) = this {
679 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
680 ::fidl_next::WireBox::encode_present(out);
681 } else {
682 ::fidl_next::WireBox::encode_absent(out);
683 }
684
685 Ok(())
686 }
687 }
688
689 unsafe impl<'a, ___E>
690 ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::ParentRef>, ___E>
691 for &'a ParentRef
692 where
693 ___E: ::fidl_next::Encoder + ?Sized,
694 &'a ParentRef: ::fidl_next::Encode<crate::wire::ParentRef, ___E>,
695 {
696 #[inline]
697 fn encode_option(
698 this: ::core::option::Option<Self>,
699 encoder: &mut ___E,
700 out: &mut ::core::mem::MaybeUninit<
701 ::fidl_next::WireBox<'static, crate::wire::ParentRef>,
702 >,
703 _: (),
704 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
705 if let Some(inner) = this {
706 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
707 ::fidl_next::WireBox::encode_present(out);
708 } else {
709 ::fidl_next::WireBox::encode_absent(out);
710 }
711
712 Ok(())
713 }
714 }
715
716 impl ::fidl_next::FromWire<crate::wire::ParentRef> for ParentRef {
717 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::ParentRef, Self> =
718 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
719
720 #[inline]
721 fn from_wire(wire: crate::wire::ParentRef) -> Self {
722 Self {}
723 }
724 }
725
726 impl ::fidl_next::FromWireRef<crate::wire::ParentRef> for ParentRef {
727 #[inline]
728 fn from_wire_ref(wire: &crate::wire::ParentRef) -> Self {
729 Self {}
730 }
731 }
732
733 #[doc = " A reference to the component itself.\n"]
734 #[derive(PartialEq, Clone, Debug)]
735 #[repr(C)]
736 pub struct SelfRef {}
737
738 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SelfRef, ___E> for SelfRef
739 where
740 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
741 {
742 #[inline]
743 fn encode(
744 self,
745 encoder_: &mut ___E,
746 out_: &mut ::core::mem::MaybeUninit<crate::wire::SelfRef>,
747 _: (),
748 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
749 *out_ = ::core::mem::MaybeUninit::zeroed();
750
751 Ok(())
752 }
753 }
754
755 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::SelfRef, ___E> for &'a SelfRef
756 where
757 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
758 {
759 #[inline]
760 fn encode(
761 self,
762 encoder_: &mut ___E,
763 out_: &mut ::core::mem::MaybeUninit<crate::wire::SelfRef>,
764 _: (),
765 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
766 ::fidl_next::munge! {
767 let crate::wire::SelfRef {
768
769 _empty,
770
771
772 } = out_;
773 }
774
775 Ok(())
776 }
777 }
778
779 unsafe impl<___E>
780 ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::SelfRef>, ___E>
781 for SelfRef
782 where
783 ___E: ::fidl_next::Encoder + ?Sized,
784 SelfRef: ::fidl_next::Encode<crate::wire::SelfRef, ___E>,
785 {
786 #[inline]
787 fn encode_option(
788 this: ::core::option::Option<Self>,
789 encoder: &mut ___E,
790 out: &mut ::core::mem::MaybeUninit<::fidl_next::WireBox<'static, crate::wire::SelfRef>>,
791 _: (),
792 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
793 if let Some(inner) = this {
794 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
795 ::fidl_next::WireBox::encode_present(out);
796 } else {
797 ::fidl_next::WireBox::encode_absent(out);
798 }
799
800 Ok(())
801 }
802 }
803
804 unsafe impl<'a, ___E>
805 ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::SelfRef>, ___E>
806 for &'a SelfRef
807 where
808 ___E: ::fidl_next::Encoder + ?Sized,
809 &'a SelfRef: ::fidl_next::Encode<crate::wire::SelfRef, ___E>,
810 {
811 #[inline]
812 fn encode_option(
813 this: ::core::option::Option<Self>,
814 encoder: &mut ___E,
815 out: &mut ::core::mem::MaybeUninit<::fidl_next::WireBox<'static, crate::wire::SelfRef>>,
816 _: (),
817 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
818 if let Some(inner) = this {
819 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
820 ::fidl_next::WireBox::encode_present(out);
821 } else {
822 ::fidl_next::WireBox::encode_absent(out);
823 }
824
825 Ok(())
826 }
827 }
828
829 impl ::fidl_next::FromWire<crate::wire::SelfRef> for SelfRef {
830 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::SelfRef, Self> =
831 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
832
833 #[inline]
834 fn from_wire(wire: crate::wire::SelfRef) -> Self {
835 Self {}
836 }
837 }
838
839 impl ::fidl_next::FromWireRef<crate::wire::SelfRef> for SelfRef {
840 #[inline]
841 fn from_wire_ref(wire: &crate::wire::SelfRef) -> Self {
842 Self {}
843 }
844 }
845
846 pub type ChildName = ::std::string::String;
847
848 #[doc = " A reference to one of the component\'s child instances.\n"]
849 #[derive(PartialEq, Clone, Debug)]
850 pub struct ChildRef {
851 pub name: ::std::string::String,
852
853 pub collection: ::core::option::Option<::std::string::String>,
854 }
855
856 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ChildRef<'static>, ___E> for ChildRef
857 where
858 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
859 ___E: ::fidl_next::Encoder,
860 {
861 #[inline]
862 fn encode(
863 self,
864 encoder_: &mut ___E,
865 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChildRef<'static>>,
866 _: (),
867 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
868 ::fidl_next::munge! {
869 let crate::wire::ChildRef {
870 name,
871 collection,
872
873 } = out_;
874 }
875
876 ::fidl_next::Encode::encode(self.name, encoder_, name, 1024)?;
877
878 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
879 ::fidl_next::Constrained::validate(_field, 1024)?;
880
881 ::fidl_next::Encode::encode(self.collection, encoder_, collection, 100)?;
882
883 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(collection.as_mut_ptr()) };
884 ::fidl_next::Constrained::validate(_field, 100)?;
885
886 Ok(())
887 }
888 }
889
890 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ChildRef<'static>, ___E> for &'a ChildRef
891 where
892 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
893 ___E: ::fidl_next::Encoder,
894 {
895 #[inline]
896 fn encode(
897 self,
898 encoder_: &mut ___E,
899 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChildRef<'static>>,
900 _: (),
901 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
902 ::fidl_next::munge! {
903 let crate::wire::ChildRef {
904
905 name,
906 collection,
907
908 } = out_;
909 }
910
911 ::fidl_next::Encode::encode(&self.name, encoder_, name, 1024)?;
912
913 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
914 ::fidl_next::Constrained::validate(_field, 1024)?;
915
916 ::fidl_next::Encode::encode(&self.collection, encoder_, collection, 100)?;
917
918 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(collection.as_mut_ptr()) };
919 ::fidl_next::Constrained::validate(_field, 100)?;
920
921 Ok(())
922 }
923 }
924
925 unsafe impl<___E>
926 ::fidl_next::EncodeOption<
927 ::fidl_next::WireBox<'static, crate::wire::ChildRef<'static>>,
928 ___E,
929 > for ChildRef
930 where
931 ___E: ::fidl_next::Encoder + ?Sized,
932 ChildRef: ::fidl_next::Encode<crate::wire::ChildRef<'static>, ___E>,
933 {
934 #[inline]
935 fn encode_option(
936 this: ::core::option::Option<Self>,
937 encoder: &mut ___E,
938 out: &mut ::core::mem::MaybeUninit<
939 ::fidl_next::WireBox<'static, crate::wire::ChildRef<'static>>,
940 >,
941 _: (),
942 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
943 if let Some(inner) = this {
944 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
945 ::fidl_next::WireBox::encode_present(out);
946 } else {
947 ::fidl_next::WireBox::encode_absent(out);
948 }
949
950 Ok(())
951 }
952 }
953
954 unsafe impl<'a, ___E>
955 ::fidl_next::EncodeOption<
956 ::fidl_next::WireBox<'static, crate::wire::ChildRef<'static>>,
957 ___E,
958 > for &'a ChildRef
959 where
960 ___E: ::fidl_next::Encoder + ?Sized,
961 &'a ChildRef: ::fidl_next::Encode<crate::wire::ChildRef<'static>, ___E>,
962 {
963 #[inline]
964 fn encode_option(
965 this: ::core::option::Option<Self>,
966 encoder: &mut ___E,
967 out: &mut ::core::mem::MaybeUninit<
968 ::fidl_next::WireBox<'static, crate::wire::ChildRef<'static>>,
969 >,
970 _: (),
971 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
972 if let Some(inner) = this {
973 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
974 ::fidl_next::WireBox::encode_present(out);
975 } else {
976 ::fidl_next::WireBox::encode_absent(out);
977 }
978
979 Ok(())
980 }
981 }
982
983 impl<'de> ::fidl_next::FromWire<crate::wire::ChildRef<'de>> for ChildRef {
984 #[inline]
985 fn from_wire(wire: crate::wire::ChildRef<'de>) -> Self {
986 Self {
987 name: ::fidl_next::FromWire::from_wire(wire.name),
988
989 collection: ::fidl_next::FromWire::from_wire(wire.collection),
990 }
991 }
992 }
993
994 impl<'de> ::fidl_next::FromWireRef<crate::wire::ChildRef<'de>> for ChildRef {
995 #[inline]
996 fn from_wire_ref(wire: &crate::wire::ChildRef<'de>) -> Self {
997 Self {
998 name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name),
999
1000 collection: ::fidl_next::FromWireRef::from_wire_ref(&wire.collection),
1001 }
1002 }
1003 }
1004
1005 #[doc = " A reference to one of the component\'s collections.\n"]
1006 #[derive(PartialEq, Clone, Debug)]
1007 pub struct CollectionRef {
1008 pub name: ::std::string::String,
1009 }
1010
1011 unsafe impl<___E> ::fidl_next::Encode<crate::wire::CollectionRef<'static>, ___E> for CollectionRef
1012 where
1013 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1014 ___E: ::fidl_next::Encoder,
1015 {
1016 #[inline]
1017 fn encode(
1018 self,
1019 encoder_: &mut ___E,
1020 out_: &mut ::core::mem::MaybeUninit<crate::wire::CollectionRef<'static>>,
1021 _: (),
1022 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1023 ::fidl_next::munge! {
1024 let crate::wire::CollectionRef {
1025 name,
1026
1027 } = out_;
1028 }
1029
1030 ::fidl_next::Encode::encode(self.name, encoder_, name, 100)?;
1031
1032 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
1033 ::fidl_next::Constrained::validate(_field, 100)?;
1034
1035 Ok(())
1036 }
1037 }
1038
1039 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::CollectionRef<'static>, ___E>
1040 for &'a CollectionRef
1041 where
1042 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1043 ___E: ::fidl_next::Encoder,
1044 {
1045 #[inline]
1046 fn encode(
1047 self,
1048 encoder_: &mut ___E,
1049 out_: &mut ::core::mem::MaybeUninit<crate::wire::CollectionRef<'static>>,
1050 _: (),
1051 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1052 ::fidl_next::munge! {
1053 let crate::wire::CollectionRef {
1054
1055 name,
1056
1057 } = out_;
1058 }
1059
1060 ::fidl_next::Encode::encode(&self.name, encoder_, name, 100)?;
1061
1062 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
1063 ::fidl_next::Constrained::validate(_field, 100)?;
1064
1065 Ok(())
1066 }
1067 }
1068
1069 unsafe impl<___E>
1070 ::fidl_next::EncodeOption<
1071 ::fidl_next::WireBox<'static, crate::wire::CollectionRef<'static>>,
1072 ___E,
1073 > for CollectionRef
1074 where
1075 ___E: ::fidl_next::Encoder + ?Sized,
1076 CollectionRef: ::fidl_next::Encode<crate::wire::CollectionRef<'static>, ___E>,
1077 {
1078 #[inline]
1079 fn encode_option(
1080 this: ::core::option::Option<Self>,
1081 encoder: &mut ___E,
1082 out: &mut ::core::mem::MaybeUninit<
1083 ::fidl_next::WireBox<'static, crate::wire::CollectionRef<'static>>,
1084 >,
1085 _: (),
1086 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1087 if let Some(inner) = this {
1088 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
1089 ::fidl_next::WireBox::encode_present(out);
1090 } else {
1091 ::fidl_next::WireBox::encode_absent(out);
1092 }
1093
1094 Ok(())
1095 }
1096 }
1097
1098 unsafe impl<'a, ___E>
1099 ::fidl_next::EncodeOption<
1100 ::fidl_next::WireBox<'static, crate::wire::CollectionRef<'static>>,
1101 ___E,
1102 > for &'a CollectionRef
1103 where
1104 ___E: ::fidl_next::Encoder + ?Sized,
1105 &'a CollectionRef: ::fidl_next::Encode<crate::wire::CollectionRef<'static>, ___E>,
1106 {
1107 #[inline]
1108 fn encode_option(
1109 this: ::core::option::Option<Self>,
1110 encoder: &mut ___E,
1111 out: &mut ::core::mem::MaybeUninit<
1112 ::fidl_next::WireBox<'static, crate::wire::CollectionRef<'static>>,
1113 >,
1114 _: (),
1115 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1116 if let Some(inner) = this {
1117 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
1118 ::fidl_next::WireBox::encode_present(out);
1119 } else {
1120 ::fidl_next::WireBox::encode_absent(out);
1121 }
1122
1123 Ok(())
1124 }
1125 }
1126
1127 impl<'de> ::fidl_next::FromWire<crate::wire::CollectionRef<'de>> for CollectionRef {
1128 #[inline]
1129 fn from_wire(wire: crate::wire::CollectionRef<'de>) -> Self {
1130 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
1131 }
1132 }
1133
1134 impl<'de> ::fidl_next::FromWireRef<crate::wire::CollectionRef<'de>> for CollectionRef {
1135 #[inline]
1136 fn from_wire_ref(wire: &crate::wire::CollectionRef<'de>) -> Self {
1137 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
1138 }
1139 }
1140
1141 #[doc = " A reference to the component framework itself.\n"]
1142 #[derive(PartialEq, Clone, Debug)]
1143 #[repr(C)]
1144 pub struct FrameworkRef {}
1145
1146 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FrameworkRef, ___E> for FrameworkRef
1147 where
1148 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1149 {
1150 #[inline]
1151 fn encode(
1152 self,
1153 encoder_: &mut ___E,
1154 out_: &mut ::core::mem::MaybeUninit<crate::wire::FrameworkRef>,
1155 _: (),
1156 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1157 *out_ = ::core::mem::MaybeUninit::zeroed();
1158
1159 Ok(())
1160 }
1161 }
1162
1163 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::FrameworkRef, ___E> for &'a FrameworkRef
1164 where
1165 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1166 {
1167 #[inline]
1168 fn encode(
1169 self,
1170 encoder_: &mut ___E,
1171 out_: &mut ::core::mem::MaybeUninit<crate::wire::FrameworkRef>,
1172 _: (),
1173 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1174 ::fidl_next::munge! {
1175 let crate::wire::FrameworkRef {
1176
1177 _empty,
1178
1179
1180 } = out_;
1181 }
1182
1183 Ok(())
1184 }
1185 }
1186
1187 unsafe impl<___E>
1188 ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::FrameworkRef>, ___E>
1189 for FrameworkRef
1190 where
1191 ___E: ::fidl_next::Encoder + ?Sized,
1192 FrameworkRef: ::fidl_next::Encode<crate::wire::FrameworkRef, ___E>,
1193 {
1194 #[inline]
1195 fn encode_option(
1196 this: ::core::option::Option<Self>,
1197 encoder: &mut ___E,
1198 out: &mut ::core::mem::MaybeUninit<
1199 ::fidl_next::WireBox<'static, crate::wire::FrameworkRef>,
1200 >,
1201 _: (),
1202 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1203 if let Some(inner) = this {
1204 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
1205 ::fidl_next::WireBox::encode_present(out);
1206 } else {
1207 ::fidl_next::WireBox::encode_absent(out);
1208 }
1209
1210 Ok(())
1211 }
1212 }
1213
1214 unsafe impl<'a, ___E>
1215 ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::FrameworkRef>, ___E>
1216 for &'a FrameworkRef
1217 where
1218 ___E: ::fidl_next::Encoder + ?Sized,
1219 &'a FrameworkRef: ::fidl_next::Encode<crate::wire::FrameworkRef, ___E>,
1220 {
1221 #[inline]
1222 fn encode_option(
1223 this: ::core::option::Option<Self>,
1224 encoder: &mut ___E,
1225 out: &mut ::core::mem::MaybeUninit<
1226 ::fidl_next::WireBox<'static, crate::wire::FrameworkRef>,
1227 >,
1228 _: (),
1229 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1230 if let Some(inner) = this {
1231 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
1232 ::fidl_next::WireBox::encode_present(out);
1233 } else {
1234 ::fidl_next::WireBox::encode_absent(out);
1235 }
1236
1237 Ok(())
1238 }
1239 }
1240
1241 impl ::fidl_next::FromWire<crate::wire::FrameworkRef> for FrameworkRef {
1242 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::FrameworkRef, Self> =
1243 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1244
1245 #[inline]
1246 fn from_wire(wire: crate::wire::FrameworkRef) -> Self {
1247 Self {}
1248 }
1249 }
1250
1251 impl ::fidl_next::FromWireRef<crate::wire::FrameworkRef> for FrameworkRef {
1252 #[inline]
1253 fn from_wire_ref(wire: &crate::wire::FrameworkRef) -> Self {
1254 Self {}
1255 }
1256 }
1257
1258 #[doc = " A reference to a capability declared in this component.\n"]
1259 #[derive(PartialEq, Clone, Debug)]
1260 pub struct CapabilityRef {
1261 pub name: ::std::string::String,
1262 }
1263
1264 unsafe impl<___E> ::fidl_next::Encode<crate::wire::CapabilityRef<'static>, ___E> for CapabilityRef
1265 where
1266 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1267 ___E: ::fidl_next::Encoder,
1268 {
1269 #[inline]
1270 fn encode(
1271 self,
1272 encoder_: &mut ___E,
1273 out_: &mut ::core::mem::MaybeUninit<crate::wire::CapabilityRef<'static>>,
1274 _: (),
1275 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1276 ::fidl_next::munge! {
1277 let crate::wire::CapabilityRef {
1278 name,
1279
1280 } = out_;
1281 }
1282
1283 ::fidl_next::Encode::encode(self.name, encoder_, name, 100)?;
1284
1285 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
1286 ::fidl_next::Constrained::validate(_field, 100)?;
1287
1288 Ok(())
1289 }
1290 }
1291
1292 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::CapabilityRef<'static>, ___E>
1293 for &'a CapabilityRef
1294 where
1295 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1296 ___E: ::fidl_next::Encoder,
1297 {
1298 #[inline]
1299 fn encode(
1300 self,
1301 encoder_: &mut ___E,
1302 out_: &mut ::core::mem::MaybeUninit<crate::wire::CapabilityRef<'static>>,
1303 _: (),
1304 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1305 ::fidl_next::munge! {
1306 let crate::wire::CapabilityRef {
1307
1308 name,
1309
1310 } = out_;
1311 }
1312
1313 ::fidl_next::Encode::encode(&self.name, encoder_, name, 100)?;
1314
1315 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(name.as_mut_ptr()) };
1316 ::fidl_next::Constrained::validate(_field, 100)?;
1317
1318 Ok(())
1319 }
1320 }
1321
1322 unsafe impl<___E>
1323 ::fidl_next::EncodeOption<
1324 ::fidl_next::WireBox<'static, crate::wire::CapabilityRef<'static>>,
1325 ___E,
1326 > for CapabilityRef
1327 where
1328 ___E: ::fidl_next::Encoder + ?Sized,
1329 CapabilityRef: ::fidl_next::Encode<crate::wire::CapabilityRef<'static>, ___E>,
1330 {
1331 #[inline]
1332 fn encode_option(
1333 this: ::core::option::Option<Self>,
1334 encoder: &mut ___E,
1335 out: &mut ::core::mem::MaybeUninit<
1336 ::fidl_next::WireBox<'static, crate::wire::CapabilityRef<'static>>,
1337 >,
1338 _: (),
1339 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1340 if let Some(inner) = this {
1341 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
1342 ::fidl_next::WireBox::encode_present(out);
1343 } else {
1344 ::fidl_next::WireBox::encode_absent(out);
1345 }
1346
1347 Ok(())
1348 }
1349 }
1350
1351 unsafe impl<'a, ___E>
1352 ::fidl_next::EncodeOption<
1353 ::fidl_next::WireBox<'static, crate::wire::CapabilityRef<'static>>,
1354 ___E,
1355 > for &'a CapabilityRef
1356 where
1357 ___E: ::fidl_next::Encoder + ?Sized,
1358 &'a CapabilityRef: ::fidl_next::Encode<crate::wire::CapabilityRef<'static>, ___E>,
1359 {
1360 #[inline]
1361 fn encode_option(
1362 this: ::core::option::Option<Self>,
1363 encoder: &mut ___E,
1364 out: &mut ::core::mem::MaybeUninit<
1365 ::fidl_next::WireBox<'static, crate::wire::CapabilityRef<'static>>,
1366 >,
1367 _: (),
1368 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1369 if let Some(inner) = this {
1370 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
1371 ::fidl_next::WireBox::encode_present(out);
1372 } else {
1373 ::fidl_next::WireBox::encode_absent(out);
1374 }
1375
1376 Ok(())
1377 }
1378 }
1379
1380 impl<'de> ::fidl_next::FromWire<crate::wire::CapabilityRef<'de>> for CapabilityRef {
1381 #[inline]
1382 fn from_wire(wire: crate::wire::CapabilityRef<'de>) -> Self {
1383 Self { name: ::fidl_next::FromWire::from_wire(wire.name) }
1384 }
1385 }
1386
1387 impl<'de> ::fidl_next::FromWireRef<crate::wire::CapabilityRef<'de>> for CapabilityRef {
1388 #[inline]
1389 fn from_wire_ref(wire: &crate::wire::CapabilityRef<'de>) -> Self {
1390 Self { name: ::fidl_next::FromWireRef::from_wire_ref(&wire.name) }
1391 }
1392 }
1393
1394 #[doc = " A reference to the environment\'s debug capabilities.\n"]
1395 #[derive(PartialEq, Clone, Debug)]
1396 #[repr(C)]
1397 pub struct DebugRef {}
1398
1399 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DebugRef, ___E> for DebugRef
1400 where
1401 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1402 {
1403 #[inline]
1404 fn encode(
1405 self,
1406 encoder_: &mut ___E,
1407 out_: &mut ::core::mem::MaybeUninit<crate::wire::DebugRef>,
1408 _: (),
1409 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1410 *out_ = ::core::mem::MaybeUninit::zeroed();
1411
1412 Ok(())
1413 }
1414 }
1415
1416 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DebugRef, ___E> for &'a DebugRef
1417 where
1418 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1419 {
1420 #[inline]
1421 fn encode(
1422 self,
1423 encoder_: &mut ___E,
1424 out_: &mut ::core::mem::MaybeUninit<crate::wire::DebugRef>,
1425 _: (),
1426 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1427 ::fidl_next::munge! {
1428 let crate::wire::DebugRef {
1429
1430 _empty,
1431
1432
1433 } = out_;
1434 }
1435
1436 Ok(())
1437 }
1438 }
1439
1440 unsafe impl<___E>
1441 ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::DebugRef>, ___E>
1442 for DebugRef
1443 where
1444 ___E: ::fidl_next::Encoder + ?Sized,
1445 DebugRef: ::fidl_next::Encode<crate::wire::DebugRef, ___E>,
1446 {
1447 #[inline]
1448 fn encode_option(
1449 this: ::core::option::Option<Self>,
1450 encoder: &mut ___E,
1451 out: &mut ::core::mem::MaybeUninit<
1452 ::fidl_next::WireBox<'static, crate::wire::DebugRef>,
1453 >,
1454 _: (),
1455 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1456 if let Some(inner) = this {
1457 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
1458 ::fidl_next::WireBox::encode_present(out);
1459 } else {
1460 ::fidl_next::WireBox::encode_absent(out);
1461 }
1462
1463 Ok(())
1464 }
1465 }
1466
1467 unsafe impl<'a, ___E>
1468 ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::DebugRef>, ___E>
1469 for &'a DebugRef
1470 where
1471 ___E: ::fidl_next::Encoder + ?Sized,
1472 &'a DebugRef: ::fidl_next::Encode<crate::wire::DebugRef, ___E>,
1473 {
1474 #[inline]
1475 fn encode_option(
1476 this: ::core::option::Option<Self>,
1477 encoder: &mut ___E,
1478 out: &mut ::core::mem::MaybeUninit<
1479 ::fidl_next::WireBox<'static, crate::wire::DebugRef>,
1480 >,
1481 _: (),
1482 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1483 if let Some(inner) = this {
1484 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
1485 ::fidl_next::WireBox::encode_present(out);
1486 } else {
1487 ::fidl_next::WireBox::encode_absent(out);
1488 }
1489
1490 Ok(())
1491 }
1492 }
1493
1494 impl ::fidl_next::FromWire<crate::wire::DebugRef> for DebugRef {
1495 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::DebugRef, Self> =
1496 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1497
1498 #[inline]
1499 fn from_wire(wire: crate::wire::DebugRef) -> Self {
1500 Self {}
1501 }
1502 }
1503
1504 impl ::fidl_next::FromWireRef<crate::wire::DebugRef> for DebugRef {
1505 #[inline]
1506 fn from_wire_ref(wire: &crate::wire::DebugRef) -> Self {
1507 Self {}
1508 }
1509 }
1510
1511 #[doc = " A reference to an intentionally missing offer source.\n"]
1512 #[derive(PartialEq, Clone, Debug)]
1513 #[repr(C)]
1514 pub struct VoidRef {}
1515
1516 unsafe impl<___E> ::fidl_next::Encode<crate::wire::VoidRef, ___E> for VoidRef
1517 where
1518 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1519 {
1520 #[inline]
1521 fn encode(
1522 self,
1523 encoder_: &mut ___E,
1524 out_: &mut ::core::mem::MaybeUninit<crate::wire::VoidRef>,
1525 _: (),
1526 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1527 *out_ = ::core::mem::MaybeUninit::zeroed();
1528
1529 Ok(())
1530 }
1531 }
1532
1533 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::VoidRef, ___E> for &'a VoidRef
1534 where
1535 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1536 {
1537 #[inline]
1538 fn encode(
1539 self,
1540 encoder_: &mut ___E,
1541 out_: &mut ::core::mem::MaybeUninit<crate::wire::VoidRef>,
1542 _: (),
1543 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1544 ::fidl_next::munge! {
1545 let crate::wire::VoidRef {
1546
1547 _empty,
1548
1549
1550 } = out_;
1551 }
1552
1553 Ok(())
1554 }
1555 }
1556
1557 unsafe impl<___E>
1558 ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::VoidRef>, ___E>
1559 for VoidRef
1560 where
1561 ___E: ::fidl_next::Encoder + ?Sized,
1562 VoidRef: ::fidl_next::Encode<crate::wire::VoidRef, ___E>,
1563 {
1564 #[inline]
1565 fn encode_option(
1566 this: ::core::option::Option<Self>,
1567 encoder: &mut ___E,
1568 out: &mut ::core::mem::MaybeUninit<::fidl_next::WireBox<'static, crate::wire::VoidRef>>,
1569 _: (),
1570 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1571 if let Some(inner) = this {
1572 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
1573 ::fidl_next::WireBox::encode_present(out);
1574 } else {
1575 ::fidl_next::WireBox::encode_absent(out);
1576 }
1577
1578 Ok(())
1579 }
1580 }
1581
1582 unsafe impl<'a, ___E>
1583 ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::VoidRef>, ___E>
1584 for &'a VoidRef
1585 where
1586 ___E: ::fidl_next::Encoder + ?Sized,
1587 &'a VoidRef: ::fidl_next::Encode<crate::wire::VoidRef, ___E>,
1588 {
1589 #[inline]
1590 fn encode_option(
1591 this: ::core::option::Option<Self>,
1592 encoder: &mut ___E,
1593 out: &mut ::core::mem::MaybeUninit<::fidl_next::WireBox<'static, crate::wire::VoidRef>>,
1594 _: (),
1595 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1596 if let Some(inner) = this {
1597 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
1598 ::fidl_next::WireBox::encode_present(out);
1599 } else {
1600 ::fidl_next::WireBox::encode_absent(out);
1601 }
1602
1603 Ok(())
1604 }
1605 }
1606
1607 impl ::fidl_next::FromWire<crate::wire::VoidRef> for VoidRef {
1608 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::VoidRef, Self> =
1609 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
1610
1611 #[inline]
1612 fn from_wire(wire: crate::wire::VoidRef) -> Self {
1613 Self {}
1614 }
1615 }
1616
1617 impl ::fidl_next::FromWireRef<crate::wire::VoidRef> for VoidRef {
1618 #[inline]
1619 fn from_wire_ref(wire: &crate::wire::VoidRef) -> Self {
1620 Self {}
1621 }
1622 }
1623
1624 #[doc = " Declares which identifier to use to key a component\'s isolated storage\n directory.\n"]
1625 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1626 #[repr(u32)]
1627 pub enum StorageId {
1628 StaticInstanceId = 1,
1629 StaticInstanceIdOrMoniker = 2,
1630 }
1631 impl ::core::convert::TryFrom<u32> for StorageId {
1632 type Error = ::fidl_next::UnknownStrictEnumMemberError;
1633 fn try_from(
1634 value: u32,
1635 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
1636 match value {
1637 1 => Ok(Self::StaticInstanceId),
1638 2 => Ok(Self::StaticInstanceIdOrMoniker),
1639
1640 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
1641 }
1642 }
1643 }
1644
1645 unsafe impl<___E> ::fidl_next::Encode<crate::wire::StorageId, ___E> for StorageId
1646 where
1647 ___E: ?Sized,
1648 {
1649 #[inline]
1650 fn encode(
1651 self,
1652 encoder: &mut ___E,
1653 out: &mut ::core::mem::MaybeUninit<crate::wire::StorageId>,
1654 _: (),
1655 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1656 ::fidl_next::Encode::encode(&self, encoder, out, ())
1657 }
1658 }
1659
1660 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::StorageId, ___E> for &'a StorageId
1661 where
1662 ___E: ?Sized,
1663 {
1664 #[inline]
1665 fn encode(
1666 self,
1667 encoder: &mut ___E,
1668 out: &mut ::core::mem::MaybeUninit<crate::wire::StorageId>,
1669 _: (),
1670 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1671 ::fidl_next::munge!(let crate::wire::StorageId { value } = out);
1672 let _ = value.write(::fidl_next::WireU32::from(match *self {
1673 StorageId::StaticInstanceId => 1,
1674
1675 StorageId::StaticInstanceIdOrMoniker => 2,
1676 }));
1677
1678 Ok(())
1679 }
1680 }
1681
1682 impl ::core::convert::From<crate::wire::StorageId> for StorageId {
1683 fn from(wire: crate::wire::StorageId) -> Self {
1684 match u32::from(wire.value) {
1685 1 => Self::StaticInstanceId,
1686
1687 2 => Self::StaticInstanceIdOrMoniker,
1688
1689 _ => unsafe { ::core::hint::unreachable_unchecked() },
1690 }
1691 }
1692 }
1693
1694 impl ::fidl_next::FromWire<crate::wire::StorageId> for StorageId {
1695 #[inline]
1696 fn from_wire(wire: crate::wire::StorageId) -> Self {
1697 Self::from(wire)
1698 }
1699 }
1700
1701 impl ::fidl_next::FromWireRef<crate::wire::StorageId> for StorageId {
1702 #[inline]
1703 fn from_wire_ref(wire: &crate::wire::StorageId) -> Self {
1704 Self::from(*wire)
1705 }
1706 }
1707
1708 #[doc = " Declares a runner capability backed by a service.\n"]
1709 #[derive(PartialEq, Clone, Debug, Default)]
1710 pub struct Runner {
1711 pub name: ::core::option::Option<::std::string::String>,
1712
1713 pub source_path: ::core::option::Option<::std::string::String>,
1714 }
1715
1716 impl Runner {
1717 fn __max_ordinal(&self) -> usize {
1718 if self.source_path.is_some() {
1719 return 2;
1720 }
1721
1722 if self.name.is_some() {
1723 return 1;
1724 }
1725
1726 0
1727 }
1728 }
1729
1730 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Runner<'static>, ___E> for Runner
1731 where
1732 ___E: ::fidl_next::Encoder + ?Sized,
1733 {
1734 #[inline]
1735 fn encode(
1736 mut self,
1737 encoder: &mut ___E,
1738 out: &mut ::core::mem::MaybeUninit<crate::wire::Runner<'static>>,
1739 _: (),
1740 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1741 ::fidl_next::munge!(let crate::wire::Runner { table } = out);
1742
1743 let max_ord = self.__max_ordinal();
1744
1745 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1746 ::fidl_next::Wire::zero_padding(&mut out);
1747
1748 let mut preallocated =
1749 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1750
1751 for i in 1..=max_ord {
1752 match i {
1753 2 => {
1754 if let Some(value) = self.source_path.take() {
1755 ::fidl_next::WireEnvelope::encode_value::<
1756 ::fidl_next::WireString<'static>,
1757 ___E,
1758 >(
1759 value, preallocated.encoder, &mut out, 1024
1760 )?;
1761 } else {
1762 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1763 }
1764 }
1765
1766 1 => {
1767 if let Some(value) = self.name.take() {
1768 ::fidl_next::WireEnvelope::encode_value::<
1769 ::fidl_next::WireString<'static>,
1770 ___E,
1771 >(
1772 value, preallocated.encoder, &mut out, 100
1773 )?;
1774 } else {
1775 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1776 }
1777 }
1778
1779 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
1780 }
1781 unsafe {
1782 preallocated.write_next(out.assume_init_ref());
1783 }
1784 }
1785
1786 ::fidl_next::WireTable::encode_len(table, max_ord);
1787
1788 Ok(())
1789 }
1790 }
1791
1792 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Runner<'static>, ___E> for &'a Runner
1793 where
1794 ___E: ::fidl_next::Encoder + ?Sized,
1795 {
1796 #[inline]
1797 fn encode(
1798 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::WireEnvelope>::uninit();
1808 ::fidl_next::Wire::zero_padding(&mut out);
1809
1810 let mut preallocated =
1811 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1812
1813 for i in 1..=max_ord {
1814 match i {
1815 2 => {
1816 if let Some(value) = &self.source_path {
1817 ::fidl_next::WireEnvelope::encode_value::<
1818 ::fidl_next::WireString<'static>,
1819 ___E,
1820 >(
1821 value, preallocated.encoder, &mut out, 1024
1822 )?;
1823 } else {
1824 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1825 }
1826 }
1827
1828 1 => {
1829 if let Some(value) = &self.name {
1830 ::fidl_next::WireEnvelope::encode_value::<
1831 ::fidl_next::WireString<'static>,
1832 ___E,
1833 >(
1834 value, preallocated.encoder, &mut out, 100
1835 )?;
1836 } else {
1837 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1838 }
1839 }
1840
1841 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
1842 }
1843 unsafe {
1844 preallocated.write_next(out.assume_init_ref());
1845 }
1846 }
1847
1848 ::fidl_next::WireTable::encode_len(table, max_ord);
1849
1850 Ok(())
1851 }
1852 }
1853
1854 impl<'de> ::fidl_next::FromWire<crate::wire::Runner<'de>> for Runner {
1855 #[inline]
1856 fn from_wire(wire_: crate::wire::Runner<'de>) -> Self {
1857 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1858
1859 let name = wire_.table.get(1);
1860
1861 let source_path = wire_.table.get(2);
1862
1863 Self {
1864 name: name.map(|envelope| {
1865 ::fidl_next::FromWire::from_wire(unsafe {
1866 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
1867 })
1868 }),
1869
1870 source_path: source_path.map(|envelope| {
1871 ::fidl_next::FromWire::from_wire(unsafe {
1872 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
1873 })
1874 }),
1875 }
1876 }
1877 }
1878
1879 impl<'de> ::fidl_next::FromWireRef<crate::wire::Runner<'de>> for Runner {
1880 #[inline]
1881 fn from_wire_ref(wire: &crate::wire::Runner<'de>) -> Self {
1882 Self {
1883 name: wire.table.get(1).map(|envelope| {
1884 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1885 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
1886 })
1887 }),
1888
1889 source_path: wire.table.get(2).map(|envelope| {
1890 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
1891 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
1892 })
1893 }),
1894 }
1895 }
1896 }
1897
1898 #[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"]
1899 #[derive(PartialEq, Clone, Debug, Default)]
1900 pub struct Resolver {
1901 pub name: ::core::option::Option<::std::string::String>,
1902
1903 pub source_path: ::core::option::Option<::std::string::String>,
1904 }
1905
1906 impl Resolver {
1907 fn __max_ordinal(&self) -> usize {
1908 if self.source_path.is_some() {
1909 return 2;
1910 }
1911
1912 if self.name.is_some() {
1913 return 1;
1914 }
1915
1916 0
1917 }
1918 }
1919
1920 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Resolver<'static>, ___E> for Resolver
1921 where
1922 ___E: ::fidl_next::Encoder + ?Sized,
1923 {
1924 #[inline]
1925 fn encode(
1926 mut self,
1927 encoder: &mut ___E,
1928 out: &mut ::core::mem::MaybeUninit<crate::wire::Resolver<'static>>,
1929 _: (),
1930 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1931 ::fidl_next::munge!(let crate::wire::Resolver { table } = out);
1932
1933 let max_ord = self.__max_ordinal();
1934
1935 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1936 ::fidl_next::Wire::zero_padding(&mut out);
1937
1938 let mut preallocated =
1939 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1940
1941 for i in 1..=max_ord {
1942 match i {
1943 2 => {
1944 if let Some(value) = self.source_path.take() {
1945 ::fidl_next::WireEnvelope::encode_value::<
1946 ::fidl_next::WireString<'static>,
1947 ___E,
1948 >(
1949 value, preallocated.encoder, &mut out, 1024
1950 )?;
1951 } else {
1952 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1953 }
1954 }
1955
1956 1 => {
1957 if let Some(value) = self.name.take() {
1958 ::fidl_next::WireEnvelope::encode_value::<
1959 ::fidl_next::WireString<'static>,
1960 ___E,
1961 >(
1962 value, preallocated.encoder, &mut out, 100
1963 )?;
1964 } else {
1965 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1966 }
1967 }
1968
1969 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
1970 }
1971 unsafe {
1972 preallocated.write_next(out.assume_init_ref());
1973 }
1974 }
1975
1976 ::fidl_next::WireTable::encode_len(table, max_ord);
1977
1978 Ok(())
1979 }
1980 }
1981
1982 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Resolver<'static>, ___E> for &'a Resolver
1983 where
1984 ___E: ::fidl_next::Encoder + ?Sized,
1985 {
1986 #[inline]
1987 fn encode(
1988 self,
1989 encoder: &mut ___E,
1990 out: &mut ::core::mem::MaybeUninit<crate::wire::Resolver<'static>>,
1991 _: (),
1992 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1993 ::fidl_next::munge!(let crate::wire::Resolver { table } = out);
1994
1995 let max_ord = self.__max_ordinal();
1996
1997 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1998 ::fidl_next::Wire::zero_padding(&mut out);
1999
2000 let mut preallocated =
2001 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2002
2003 for i in 1..=max_ord {
2004 match i {
2005 2 => {
2006 if let Some(value) = &self.source_path {
2007 ::fidl_next::WireEnvelope::encode_value::<
2008 ::fidl_next::WireString<'static>,
2009 ___E,
2010 >(
2011 value, preallocated.encoder, &mut out, 1024
2012 )?;
2013 } else {
2014 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2015 }
2016 }
2017
2018 1 => {
2019 if let Some(value) = &self.name {
2020 ::fidl_next::WireEnvelope::encode_value::<
2021 ::fidl_next::WireString<'static>,
2022 ___E,
2023 >(
2024 value, preallocated.encoder, &mut out, 100
2025 )?;
2026 } else {
2027 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2028 }
2029 }
2030
2031 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2032 }
2033 unsafe {
2034 preallocated.write_next(out.assume_init_ref());
2035 }
2036 }
2037
2038 ::fidl_next::WireTable::encode_len(table, max_ord);
2039
2040 Ok(())
2041 }
2042 }
2043
2044 impl<'de> ::fidl_next::FromWire<crate::wire::Resolver<'de>> for Resolver {
2045 #[inline]
2046 fn from_wire(wire_: crate::wire::Resolver<'de>) -> Self {
2047 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
2048
2049 let name = wire_.table.get(1);
2050
2051 let source_path = wire_.table.get(2);
2052
2053 Self {
2054 name: name.map(|envelope| {
2055 ::fidl_next::FromWire::from_wire(unsafe {
2056 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
2057 })
2058 }),
2059
2060 source_path: source_path.map(|envelope| {
2061 ::fidl_next::FromWire::from_wire(unsafe {
2062 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
2063 })
2064 }),
2065 }
2066 }
2067 }
2068
2069 impl<'de> ::fidl_next::FromWireRef<crate::wire::Resolver<'de>> for Resolver {
2070 #[inline]
2071 fn from_wire_ref(wire: &crate::wire::Resolver<'de>) -> Self {
2072 Self {
2073 name: wire.table.get(1).map(|envelope| {
2074 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2075 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
2076 })
2077 }),
2078
2079 source_path: wire.table.get(2).map(|envelope| {
2080 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2081 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
2082 })
2083 }),
2084 }
2085 }
2086 }
2087
2088 #[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"]
2089 #[derive(PartialEq, Clone, Debug, Default)]
2090 pub struct EventStream {
2091 pub name: ::core::option::Option<::std::string::String>,
2092 }
2093
2094 impl EventStream {
2095 fn __max_ordinal(&self) -> usize {
2096 if self.name.is_some() {
2097 return 1;
2098 }
2099
2100 0
2101 }
2102 }
2103
2104 unsafe impl<___E> ::fidl_next::Encode<crate::wire::EventStream<'static>, ___E> for EventStream
2105 where
2106 ___E: ::fidl_next::Encoder + ?Sized,
2107 {
2108 #[inline]
2109 fn encode(
2110 mut self,
2111 encoder: &mut ___E,
2112 out: &mut ::core::mem::MaybeUninit<crate::wire::EventStream<'static>>,
2113 _: (),
2114 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2115 ::fidl_next::munge!(let crate::wire::EventStream { table } = out);
2116
2117 let max_ord = self.__max_ordinal();
2118
2119 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2120 ::fidl_next::Wire::zero_padding(&mut out);
2121
2122 let mut preallocated =
2123 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2124
2125 for i in 1..=max_ord {
2126 match i {
2127 1 => {
2128 if let Some(value) = self.name.take() {
2129 ::fidl_next::WireEnvelope::encode_value::<
2130 ::fidl_next::WireString<'static>,
2131 ___E,
2132 >(
2133 value, preallocated.encoder, &mut out, 100
2134 )?;
2135 } else {
2136 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2137 }
2138 }
2139
2140 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2141 }
2142 unsafe {
2143 preallocated.write_next(out.assume_init_ref());
2144 }
2145 }
2146
2147 ::fidl_next::WireTable::encode_len(table, max_ord);
2148
2149 Ok(())
2150 }
2151 }
2152
2153 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EventStream<'static>, ___E>
2154 for &'a EventStream
2155 where
2156 ___E: ::fidl_next::Encoder + ?Sized,
2157 {
2158 #[inline]
2159 fn encode(
2160 self,
2161 encoder: &mut ___E,
2162 out: &mut ::core::mem::MaybeUninit<crate::wire::EventStream<'static>>,
2163 _: (),
2164 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2165 ::fidl_next::munge!(let crate::wire::EventStream { table } = out);
2166
2167 let max_ord = self.__max_ordinal();
2168
2169 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2170 ::fidl_next::Wire::zero_padding(&mut out);
2171
2172 let mut preallocated =
2173 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2174
2175 for i in 1..=max_ord {
2176 match i {
2177 1 => {
2178 if let Some(value) = &self.name {
2179 ::fidl_next::WireEnvelope::encode_value::<
2180 ::fidl_next::WireString<'static>,
2181 ___E,
2182 >(
2183 value, preallocated.encoder, &mut out, 100
2184 )?;
2185 } else {
2186 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2187 }
2188 }
2189
2190 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2191 }
2192 unsafe {
2193 preallocated.write_next(out.assume_init_ref());
2194 }
2195 }
2196
2197 ::fidl_next::WireTable::encode_len(table, max_ord);
2198
2199 Ok(())
2200 }
2201 }
2202
2203 impl<'de> ::fidl_next::FromWire<crate::wire::EventStream<'de>> for EventStream {
2204 #[inline]
2205 fn from_wire(wire_: crate::wire::EventStream<'de>) -> Self {
2206 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
2207
2208 let name = wire_.table.get(1);
2209
2210 Self {
2211 name: name.map(|envelope| {
2212 ::fidl_next::FromWire::from_wire(unsafe {
2213 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
2214 })
2215 }),
2216 }
2217 }
2218 }
2219
2220 impl<'de> ::fidl_next::FromWireRef<crate::wire::EventStream<'de>> for EventStream {
2221 #[inline]
2222 fn from_wire_ref(wire: &crate::wire::EventStream<'de>) -> Self {
2223 Self {
2224 name: wire.table.get(1).map(|envelope| {
2225 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
2226 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
2227 })
2228 }),
2229 }
2230 }
2231 }
2232
2233 #[doc = " A single configuration value.\n"]
2234 #[derive(PartialEq, Clone, Debug)]
2235 pub enum ConfigSingleValue {
2236 Bool(bool),
2237
2238 Uint8(u8),
2239
2240 Uint16(u16),
2241
2242 Uint32(u32),
2243
2244 Uint64(u64),
2245
2246 Int8(i8),
2247
2248 Int16(i16),
2249
2250 Int32(i32),
2251
2252 Int64(i64),
2253
2254 String(::std::string::String),
2255
2256 UnknownOrdinal_(u64),
2257 }
2258
2259 impl ConfigSingleValue {
2260 pub fn is_unknown(&self) -> bool {
2261 #[allow(unreachable_patterns)]
2262 match self {
2263 Self::UnknownOrdinal_(_) => true,
2264 _ => false,
2265 }
2266 }
2267 }
2268
2269 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigSingleValue<'static>, ___E>
2270 for ConfigSingleValue
2271 where
2272 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2273 ___E: ::fidl_next::Encoder,
2274 {
2275 #[inline]
2276 fn encode(
2277 self,
2278 encoder: &mut ___E,
2279 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSingleValue<'static>>,
2280 _: (),
2281 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2282 ::fidl_next::munge!(let crate::wire::ConfigSingleValue { raw, _phantom: _ } = out);
2283
2284 match self {
2285 Self::Bool(value) => {
2286 ::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())?
2287 }
2288
2289 Self::Uint8(value) => {
2290 ::fidl_next::RawWireUnion::encode_as::<___E, u8>(value, 2, encoder, raw, ())?
2291 }
2292
2293 Self::Uint16(value) => ::fidl_next::RawWireUnion::encode_as::<
2294 ___E,
2295 ::fidl_next::WireU16,
2296 >(value, 3, encoder, raw, ())?,
2297
2298 Self::Uint32(value) => ::fidl_next::RawWireUnion::encode_as::<
2299 ___E,
2300 ::fidl_next::WireU32,
2301 >(value, 4, encoder, raw, ())?,
2302
2303 Self::Uint64(value) => ::fidl_next::RawWireUnion::encode_as::<
2304 ___E,
2305 ::fidl_next::WireU64,
2306 >(value, 5, encoder, raw, ())?,
2307
2308 Self::Int8(value) => {
2309 ::fidl_next::RawWireUnion::encode_as::<___E, i8>(value, 6, encoder, raw, ())?
2310 }
2311
2312 Self::Int16(value) => ::fidl_next::RawWireUnion::encode_as::<
2313 ___E,
2314 ::fidl_next::WireI16,
2315 >(value, 7, encoder, raw, ())?,
2316
2317 Self::Int32(value) => ::fidl_next::RawWireUnion::encode_as::<
2318 ___E,
2319 ::fidl_next::WireI32,
2320 >(value, 8, encoder, raw, ())?,
2321
2322 Self::Int64(value) => ::fidl_next::RawWireUnion::encode_as::<
2323 ___E,
2324 ::fidl_next::WireI64,
2325 >(value, 9, encoder, raw, ())?,
2326
2327 Self::String(value) => ::fidl_next::RawWireUnion::encode_as::<
2328 ___E,
2329 ::fidl_next::WireString<'static>,
2330 >(value, 10, encoder, raw, 4294967295)?,
2331
2332 Self::UnknownOrdinal_(ordinal) => {
2333 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
2334 }
2335 }
2336
2337 Ok(())
2338 }
2339 }
2340
2341 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigSingleValue<'static>, ___E>
2342 for &'a ConfigSingleValue
2343 where
2344 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2345 ___E: ::fidl_next::Encoder,
2346 {
2347 #[inline]
2348 fn encode(
2349 self,
2350 encoder: &mut ___E,
2351 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSingleValue<'static>>,
2352 _: (),
2353 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2354 ::fidl_next::munge!(let crate::wire::ConfigSingleValue { raw, _phantom: _ } = out);
2355
2356 match self {
2357 ConfigSingleValue::Bool(value) => {
2358 ::fidl_next::RawWireUnion::encode_as::<___E, bool>(value, 1, encoder, raw, ())?
2359 }
2360
2361 ConfigSingleValue::Uint8(value) => {
2362 ::fidl_next::RawWireUnion::encode_as::<___E, u8>(value, 2, encoder, raw, ())?
2363 }
2364
2365 ConfigSingleValue::Uint16(value) => ::fidl_next::RawWireUnion::encode_as::<
2366 ___E,
2367 ::fidl_next::WireU16,
2368 >(value, 3, encoder, raw, ())?,
2369
2370 ConfigSingleValue::Uint32(value) => ::fidl_next::RawWireUnion::encode_as::<
2371 ___E,
2372 ::fidl_next::WireU32,
2373 >(value, 4, encoder, raw, ())?,
2374
2375 ConfigSingleValue::Uint64(value) => ::fidl_next::RawWireUnion::encode_as::<
2376 ___E,
2377 ::fidl_next::WireU64,
2378 >(value, 5, encoder, raw, ())?,
2379
2380 ConfigSingleValue::Int8(value) => {
2381 ::fidl_next::RawWireUnion::encode_as::<___E, i8>(value, 6, encoder, raw, ())?
2382 }
2383
2384 ConfigSingleValue::Int16(value) => ::fidl_next::RawWireUnion::encode_as::<
2385 ___E,
2386 ::fidl_next::WireI16,
2387 >(value, 7, encoder, raw, ())?,
2388
2389 ConfigSingleValue::Int32(value) => ::fidl_next::RawWireUnion::encode_as::<
2390 ___E,
2391 ::fidl_next::WireI32,
2392 >(value, 8, encoder, raw, ())?,
2393
2394 ConfigSingleValue::Int64(value) => ::fidl_next::RawWireUnion::encode_as::<
2395 ___E,
2396 ::fidl_next::WireI64,
2397 >(value, 9, encoder, raw, ())?,
2398
2399 ConfigSingleValue::String(value) => {
2400 ::fidl_next::RawWireUnion::encode_as::<___E, ::fidl_next::WireString<'static>>(
2401 value, 10, encoder, raw, 4294967295,
2402 )?
2403 }
2404
2405 ConfigSingleValue::UnknownOrdinal_(ordinal) => {
2406 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
2407 }
2408 }
2409
2410 Ok(())
2411 }
2412 }
2413
2414 unsafe impl<___E>
2415 ::fidl_next::EncodeOption<crate::wire_optional::ConfigSingleValue<'static>, ___E>
2416 for ConfigSingleValue
2417 where
2418 ___E: ?Sized,
2419 ConfigSingleValue: ::fidl_next::Encode<crate::wire::ConfigSingleValue<'static>, ___E>,
2420 {
2421 #[inline]
2422 fn encode_option(
2423 this: ::core::option::Option<Self>,
2424 encoder: &mut ___E,
2425 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigSingleValue<'static>>,
2426 _: (),
2427 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2428 ::fidl_next::munge!(let crate::wire_optional::ConfigSingleValue { raw, _phantom: _ } = &mut *out);
2429
2430 if let Some(inner) = this {
2431 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
2432 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
2433 } else {
2434 ::fidl_next::RawWireUnion::encode_absent(raw);
2435 }
2436
2437 Ok(())
2438 }
2439 }
2440
2441 unsafe impl<'a, ___E>
2442 ::fidl_next::EncodeOption<crate::wire_optional::ConfigSingleValue<'static>, ___E>
2443 for &'a ConfigSingleValue
2444 where
2445 ___E: ?Sized,
2446 &'a ConfigSingleValue: ::fidl_next::Encode<crate::wire::ConfigSingleValue<'static>, ___E>,
2447 {
2448 #[inline]
2449 fn encode_option(
2450 this: ::core::option::Option<Self>,
2451 encoder: &mut ___E,
2452 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigSingleValue<'static>>,
2453 _: (),
2454 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2455 ::fidl_next::munge!(let crate::wire_optional::ConfigSingleValue { raw, _phantom: _ } = &mut *out);
2456
2457 if let Some(inner) = this {
2458 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
2459 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
2460 } else {
2461 ::fidl_next::RawWireUnion::encode_absent(raw);
2462 }
2463
2464 Ok(())
2465 }
2466 }
2467
2468 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigSingleValue<'de>> for ConfigSingleValue {
2469 #[inline]
2470 fn from_wire(wire: crate::wire::ConfigSingleValue<'de>) -> Self {
2471 let wire = ::core::mem::ManuallyDrop::new(wire);
2472 match wire.raw.ordinal() {
2473 1 => Self::Bool(::fidl_next::FromWire::from_wire(unsafe {
2474 wire.raw.get().read_unchecked::<bool>()
2475 })),
2476
2477 2 => Self::Uint8(::fidl_next::FromWire::from_wire(unsafe {
2478 wire.raw.get().read_unchecked::<u8>()
2479 })),
2480
2481 3 => Self::Uint16(::fidl_next::FromWire::from_wire(unsafe {
2482 wire.raw.get().read_unchecked::<::fidl_next::WireU16>()
2483 })),
2484
2485 4 => Self::Uint32(::fidl_next::FromWire::from_wire(unsafe {
2486 wire.raw.get().read_unchecked::<::fidl_next::WireU32>()
2487 })),
2488
2489 5 => Self::Uint64(::fidl_next::FromWire::from_wire(unsafe {
2490 wire.raw.get().read_unchecked::<::fidl_next::WireU64>()
2491 })),
2492
2493 6 => Self::Int8(::fidl_next::FromWire::from_wire(unsafe {
2494 wire.raw.get().read_unchecked::<i8>()
2495 })),
2496
2497 7 => Self::Int16(::fidl_next::FromWire::from_wire(unsafe {
2498 wire.raw.get().read_unchecked::<::fidl_next::WireI16>()
2499 })),
2500
2501 8 => Self::Int32(::fidl_next::FromWire::from_wire(unsafe {
2502 wire.raw.get().read_unchecked::<::fidl_next::WireI32>()
2503 })),
2504
2505 9 => Self::Int64(::fidl_next::FromWire::from_wire(unsafe {
2506 wire.raw.get().read_unchecked::<::fidl_next::WireI64>()
2507 })),
2508
2509 10 => Self::String(::fidl_next::FromWire::from_wire(unsafe {
2510 wire.raw.get().read_unchecked::<::fidl_next::WireString<'de>>()
2511 })),
2512
2513 ord => return Self::UnknownOrdinal_(ord as u64),
2514 }
2515 }
2516 }
2517
2518 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigSingleValue<'de>> for ConfigSingleValue {
2519 #[inline]
2520 fn from_wire_ref(wire: &crate::wire::ConfigSingleValue<'de>) -> Self {
2521 match wire.raw.ordinal() {
2522 1 => Self::Bool(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2523 wire.raw.get().deref_unchecked::<bool>()
2524 })),
2525
2526 2 => Self::Uint8(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2527 wire.raw.get().deref_unchecked::<u8>()
2528 })),
2529
2530 3 => Self::Uint16(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2531 wire.raw.get().deref_unchecked::<::fidl_next::WireU16>()
2532 })),
2533
2534 4 => Self::Uint32(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2535 wire.raw.get().deref_unchecked::<::fidl_next::WireU32>()
2536 })),
2537
2538 5 => Self::Uint64(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2539 wire.raw.get().deref_unchecked::<::fidl_next::WireU64>()
2540 })),
2541
2542 6 => Self::Int8(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2543 wire.raw.get().deref_unchecked::<i8>()
2544 })),
2545
2546 7 => Self::Int16(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2547 wire.raw.get().deref_unchecked::<::fidl_next::WireI16>()
2548 })),
2549
2550 8 => Self::Int32(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2551 wire.raw.get().deref_unchecked::<::fidl_next::WireI32>()
2552 })),
2553
2554 9 => Self::Int64(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2555 wire.raw.get().deref_unchecked::<::fidl_next::WireI64>()
2556 })),
2557
2558 10 => Self::String(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2559 wire.raw.get().deref_unchecked::<::fidl_next::WireString<'de>>()
2560 })),
2561
2562 ord => return Self::UnknownOrdinal_(ord as u64),
2563 }
2564 }
2565 }
2566
2567 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigSingleValue<'de>>
2568 for ConfigSingleValue
2569 {
2570 #[inline]
2571 fn from_wire_option(
2572 wire: crate::wire_optional::ConfigSingleValue<'de>,
2573 ) -> ::core::option::Option<Self> {
2574 if let Some(inner) = wire.into_option() {
2575 Some(::fidl_next::FromWire::from_wire(inner))
2576 } else {
2577 None
2578 }
2579 }
2580 }
2581
2582 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigSingleValue<'de>>
2583 for Box<ConfigSingleValue>
2584 {
2585 #[inline]
2586 fn from_wire_option(
2587 wire: crate::wire_optional::ConfigSingleValue<'de>,
2588 ) -> ::core::option::Option<Self> {
2589 <ConfigSingleValue as ::fidl_next::FromWireOption<
2590 crate::wire_optional::ConfigSingleValue<'de>,
2591 >>::from_wire_option(wire)
2592 .map(Box::new)
2593 }
2594 }
2595
2596 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::ConfigSingleValue<'de>>
2597 for Box<ConfigSingleValue>
2598 {
2599 #[inline]
2600 fn from_wire_option_ref(
2601 wire: &crate::wire_optional::ConfigSingleValue<'de>,
2602 ) -> ::core::option::Option<Self> {
2603 if let Some(inner) = wire.as_ref() {
2604 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
2605 } else {
2606 None
2607 }
2608 }
2609 }
2610
2611 #[doc = " A vector configuration value.\n"]
2612 #[derive(PartialEq, Clone, Debug)]
2613 pub enum ConfigVectorValue {
2614 BoolVector(::std::vec::Vec<bool>),
2615
2616 Uint8Vector(::std::vec::Vec<u8>),
2617
2618 Uint16Vector(::std::vec::Vec<u16>),
2619
2620 Uint32Vector(::std::vec::Vec<u32>),
2621
2622 Uint64Vector(::std::vec::Vec<u64>),
2623
2624 Int8Vector(::std::vec::Vec<i8>),
2625
2626 Int16Vector(::std::vec::Vec<i16>),
2627
2628 Int32Vector(::std::vec::Vec<i32>),
2629
2630 Int64Vector(::std::vec::Vec<i64>),
2631
2632 StringVector(::std::vec::Vec<::std::string::String>),
2633
2634 UnknownOrdinal_(u64),
2635 }
2636
2637 impl ConfigVectorValue {
2638 pub fn is_unknown(&self) -> bool {
2639 #[allow(unreachable_patterns)]
2640 match self {
2641 Self::UnknownOrdinal_(_) => true,
2642 _ => false,
2643 }
2644 }
2645 }
2646
2647 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigVectorValue<'static>, ___E>
2648 for ConfigVectorValue
2649 where
2650 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2651 ___E: ::fidl_next::Encoder,
2652 {
2653 #[inline]
2654 fn encode(
2655 self,
2656 encoder: &mut ___E,
2657 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigVectorValue<'static>>,
2658 _: (),
2659 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2660 ::fidl_next::munge!(let crate::wire::ConfigVectorValue { raw, _phantom: _ } = out);
2661
2662 match self {
2663 Self::BoolVector(value) => {
2664 ::fidl_next::RawWireUnion::encode_as::<
2665 ___E,
2666 ::fidl_next::WireVector<'static, bool>,
2667 >(value, 1, encoder, raw, (4294967295, ()))?
2668 }
2669
2670 Self::Uint8Vector(value) => {
2671 ::fidl_next::RawWireUnion::encode_as::<
2672 ___E,
2673 ::fidl_next::WireVector<'static, u8>,
2674 >(value, 2, encoder, raw, (4294967295, ()))?
2675 }
2676
2677 Self::Uint16Vector(value) => {
2678 ::fidl_next::RawWireUnion::encode_as::<
2679 ___E,
2680 ::fidl_next::WireVector<'static, ::fidl_next::WireU16>,
2681 >(value, 3, encoder, raw, (4294967295, ()))?
2682 }
2683
2684 Self::Uint32Vector(value) => {
2685 ::fidl_next::RawWireUnion::encode_as::<
2686 ___E,
2687 ::fidl_next::WireVector<'static, ::fidl_next::WireU32>,
2688 >(value, 4, encoder, raw, (4294967295, ()))?
2689 }
2690
2691 Self::Uint64Vector(value) => {
2692 ::fidl_next::RawWireUnion::encode_as::<
2693 ___E,
2694 ::fidl_next::WireVector<'static, ::fidl_next::WireU64>,
2695 >(value, 5, encoder, raw, (4294967295, ()))?
2696 }
2697
2698 Self::Int8Vector(value) => {
2699 ::fidl_next::RawWireUnion::encode_as::<
2700 ___E,
2701 ::fidl_next::WireVector<'static, i8>,
2702 >(value, 6, encoder, raw, (4294967295, ()))?
2703 }
2704
2705 Self::Int16Vector(value) => {
2706 ::fidl_next::RawWireUnion::encode_as::<
2707 ___E,
2708 ::fidl_next::WireVector<'static, ::fidl_next::WireI16>,
2709 >(value, 7, encoder, raw, (4294967295, ()))?
2710 }
2711
2712 Self::Int32Vector(value) => {
2713 ::fidl_next::RawWireUnion::encode_as::<
2714 ___E,
2715 ::fidl_next::WireVector<'static, ::fidl_next::WireI32>,
2716 >(value, 8, encoder, raw, (4294967295, ()))?
2717 }
2718
2719 Self::Int64Vector(value) => {
2720 ::fidl_next::RawWireUnion::encode_as::<
2721 ___E,
2722 ::fidl_next::WireVector<'static, ::fidl_next::WireI64>,
2723 >(value, 9, encoder, raw, (4294967295, ()))?
2724 }
2725
2726 Self::StringVector(value) => {
2727 ::fidl_next::RawWireUnion::encode_as::<
2728 ___E,
2729 ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
2730 >(value, 10, encoder, raw, (4294967295, 4294967295))?
2731 }
2732
2733 Self::UnknownOrdinal_(ordinal) => {
2734 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
2735 }
2736 }
2737
2738 Ok(())
2739 }
2740 }
2741
2742 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigVectorValue<'static>, ___E>
2743 for &'a ConfigVectorValue
2744 where
2745 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2746 ___E: ::fidl_next::Encoder,
2747 {
2748 #[inline]
2749 fn encode(
2750 self,
2751 encoder: &mut ___E,
2752 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigVectorValue<'static>>,
2753 _: (),
2754 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2755 ::fidl_next::munge!(let crate::wire::ConfigVectorValue { raw, _phantom: _ } = out);
2756
2757 match self {
2758 ConfigVectorValue::BoolVector(value) => {
2759 ::fidl_next::RawWireUnion::encode_as::<
2760 ___E,
2761 ::fidl_next::WireVector<'static, bool>,
2762 >(value, 1, encoder, raw, (4294967295, ()))?
2763 }
2764
2765 ConfigVectorValue::Uint8Vector(value) => {
2766 ::fidl_next::RawWireUnion::encode_as::<
2767 ___E,
2768 ::fidl_next::WireVector<'static, u8>,
2769 >(value, 2, encoder, raw, (4294967295, ()))?
2770 }
2771
2772 ConfigVectorValue::Uint16Vector(value) => {
2773 ::fidl_next::RawWireUnion::encode_as::<
2774 ___E,
2775 ::fidl_next::WireVector<'static, ::fidl_next::WireU16>,
2776 >(value, 3, encoder, raw, (4294967295, ()))?
2777 }
2778
2779 ConfigVectorValue::Uint32Vector(value) => {
2780 ::fidl_next::RawWireUnion::encode_as::<
2781 ___E,
2782 ::fidl_next::WireVector<'static, ::fidl_next::WireU32>,
2783 >(value, 4, encoder, raw, (4294967295, ()))?
2784 }
2785
2786 ConfigVectorValue::Uint64Vector(value) => {
2787 ::fidl_next::RawWireUnion::encode_as::<
2788 ___E,
2789 ::fidl_next::WireVector<'static, ::fidl_next::WireU64>,
2790 >(value, 5, encoder, raw, (4294967295, ()))?
2791 }
2792
2793 ConfigVectorValue::Int8Vector(value) => {
2794 ::fidl_next::RawWireUnion::encode_as::<
2795 ___E,
2796 ::fidl_next::WireVector<'static, i8>,
2797 >(value, 6, encoder, raw, (4294967295, ()))?
2798 }
2799
2800 ConfigVectorValue::Int16Vector(value) => {
2801 ::fidl_next::RawWireUnion::encode_as::<
2802 ___E,
2803 ::fidl_next::WireVector<'static, ::fidl_next::WireI16>,
2804 >(value, 7, encoder, raw, (4294967295, ()))?
2805 }
2806
2807 ConfigVectorValue::Int32Vector(value) => {
2808 ::fidl_next::RawWireUnion::encode_as::<
2809 ___E,
2810 ::fidl_next::WireVector<'static, ::fidl_next::WireI32>,
2811 >(value, 8, encoder, raw, (4294967295, ()))?
2812 }
2813
2814 ConfigVectorValue::Int64Vector(value) => {
2815 ::fidl_next::RawWireUnion::encode_as::<
2816 ___E,
2817 ::fidl_next::WireVector<'static, ::fidl_next::WireI64>,
2818 >(value, 9, encoder, raw, (4294967295, ()))?
2819 }
2820
2821 ConfigVectorValue::StringVector(value) => {
2822 ::fidl_next::RawWireUnion::encode_as::<
2823 ___E,
2824 ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
2825 >(value, 10, encoder, raw, (4294967295, 4294967295))?
2826 }
2827
2828 ConfigVectorValue::UnknownOrdinal_(ordinal) => {
2829 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
2830 }
2831 }
2832
2833 Ok(())
2834 }
2835 }
2836
2837 unsafe impl<___E>
2838 ::fidl_next::EncodeOption<crate::wire_optional::ConfigVectorValue<'static>, ___E>
2839 for ConfigVectorValue
2840 where
2841 ___E: ?Sized,
2842 ConfigVectorValue: ::fidl_next::Encode<crate::wire::ConfigVectorValue<'static>, ___E>,
2843 {
2844 #[inline]
2845 fn encode_option(
2846 this: ::core::option::Option<Self>,
2847 encoder: &mut ___E,
2848 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigVectorValue<'static>>,
2849 _: (),
2850 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2851 ::fidl_next::munge!(let crate::wire_optional::ConfigVectorValue { raw, _phantom: _ } = &mut *out);
2852
2853 if let Some(inner) = this {
2854 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
2855 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
2856 } else {
2857 ::fidl_next::RawWireUnion::encode_absent(raw);
2858 }
2859
2860 Ok(())
2861 }
2862 }
2863
2864 unsafe impl<'a, ___E>
2865 ::fidl_next::EncodeOption<crate::wire_optional::ConfigVectorValue<'static>, ___E>
2866 for &'a ConfigVectorValue
2867 where
2868 ___E: ?Sized,
2869 &'a ConfigVectorValue: ::fidl_next::Encode<crate::wire::ConfigVectorValue<'static>, ___E>,
2870 {
2871 #[inline]
2872 fn encode_option(
2873 this: ::core::option::Option<Self>,
2874 encoder: &mut ___E,
2875 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigVectorValue<'static>>,
2876 _: (),
2877 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2878 ::fidl_next::munge!(let crate::wire_optional::ConfigVectorValue { raw, _phantom: _ } = &mut *out);
2879
2880 if let Some(inner) = this {
2881 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
2882 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
2883 } else {
2884 ::fidl_next::RawWireUnion::encode_absent(raw);
2885 }
2886
2887 Ok(())
2888 }
2889 }
2890
2891 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigVectorValue<'de>> for ConfigVectorValue {
2892 #[inline]
2893 fn from_wire(wire: crate::wire::ConfigVectorValue<'de>) -> Self {
2894 let wire = ::core::mem::ManuallyDrop::new(wire);
2895 match wire.raw.ordinal() {
2896 1 => Self::BoolVector(::fidl_next::FromWire::from_wire(unsafe {
2897 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, bool>>()
2898 })),
2899
2900 2 => Self::Uint8Vector(::fidl_next::FromWire::from_wire(unsafe {
2901 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>()
2902 })),
2903
2904 3 => Self::Uint16Vector(::fidl_next::FromWire::from_wire(unsafe {
2905 wire.raw
2906 .get()
2907 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU16>>()
2908 })),
2909
2910 4 => Self::Uint32Vector(::fidl_next::FromWire::from_wire(unsafe {
2911 wire.raw
2912 .get()
2913 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU32>>()
2914 })),
2915
2916 5 => Self::Uint64Vector(::fidl_next::FromWire::from_wire(unsafe {
2917 wire.raw
2918 .get()
2919 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU64>>()
2920 })),
2921
2922 6 => Self::Int8Vector(::fidl_next::FromWire::from_wire(unsafe {
2923 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, i8>>()
2924 })),
2925
2926 7 => Self::Int16Vector(::fidl_next::FromWire::from_wire(unsafe {
2927 wire.raw
2928 .get()
2929 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI16>>()
2930 })),
2931
2932 8 => Self::Int32Vector(::fidl_next::FromWire::from_wire(unsafe {
2933 wire.raw
2934 .get()
2935 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI32>>()
2936 })),
2937
2938 9 => Self::Int64Vector(::fidl_next::FromWire::from_wire(unsafe {
2939 wire.raw
2940 .get()
2941 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI64>>()
2942 })),
2943
2944 10 => Self::StringVector(::fidl_next::FromWire::from_wire(unsafe {
2945 wire.raw.get().read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
2946 })),
2947
2948 ord => return Self::UnknownOrdinal_(ord as u64),
2949 }
2950 }
2951 }
2952
2953 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigVectorValue<'de>> for ConfigVectorValue {
2954 #[inline]
2955 fn from_wire_ref(wire: &crate::wire::ConfigVectorValue<'de>) -> Self {
2956 match wire.raw.ordinal() {
2957 1 => Self::BoolVector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2958 wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, bool>>()
2959 })),
2960
2961 2 => Self::Uint8Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2962 wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, u8>>()
2963 })),
2964
2965 3 => Self::Uint16Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2966 wire.raw
2967 .get()
2968 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU16>>()
2969 })),
2970
2971 4 => Self::Uint32Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2972 wire.raw
2973 .get()
2974 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU32>>()
2975 })),
2976
2977 5 => Self::Uint64Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2978 wire.raw
2979 .get()
2980 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU64>>()
2981 })),
2982
2983 6 => Self::Int8Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2984 wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, i8>>()
2985 })),
2986
2987 7 => Self::Int16Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2988 wire.raw
2989 .get()
2990 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI16>>()
2991 })),
2992
2993 8 => Self::Int32Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
2994 wire.raw
2995 .get()
2996 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI32>>()
2997 })),
2998
2999 9 => Self::Int64Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3000 wire.raw
3001 .get()
3002 .deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI64>>()
3003 })),
3004
3005 10 => Self::StringVector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3006 wire.raw.get().deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
3007 })),
3008
3009 ord => return Self::UnknownOrdinal_(ord as u64),
3010 }
3011 }
3012 }
3013
3014 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigVectorValue<'de>>
3015 for ConfigVectorValue
3016 {
3017 #[inline]
3018 fn from_wire_option(
3019 wire: crate::wire_optional::ConfigVectorValue<'de>,
3020 ) -> ::core::option::Option<Self> {
3021 if let Some(inner) = wire.into_option() {
3022 Some(::fidl_next::FromWire::from_wire(inner))
3023 } else {
3024 None
3025 }
3026 }
3027 }
3028
3029 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigVectorValue<'de>>
3030 for Box<ConfigVectorValue>
3031 {
3032 #[inline]
3033 fn from_wire_option(
3034 wire: crate::wire_optional::ConfigVectorValue<'de>,
3035 ) -> ::core::option::Option<Self> {
3036 <ConfigVectorValue as ::fidl_next::FromWireOption<
3037 crate::wire_optional::ConfigVectorValue<'de>,
3038 >>::from_wire_option(wire)
3039 .map(Box::new)
3040 }
3041 }
3042
3043 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::ConfigVectorValue<'de>>
3044 for Box<ConfigVectorValue>
3045 {
3046 #[inline]
3047 fn from_wire_option_ref(
3048 wire: &crate::wire_optional::ConfigVectorValue<'de>,
3049 ) -> ::core::option::Option<Self> {
3050 if let Some(inner) = wire.as_ref() {
3051 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
3052 } else {
3053 None
3054 }
3055 }
3056 }
3057
3058 #[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"]
3059 #[derive(PartialEq, Clone, Debug)]
3060 pub enum ConfigValue {
3061 Single(crate::natural::ConfigSingleValue),
3062
3063 Vector(crate::natural::ConfigVectorValue),
3064
3065 UnknownOrdinal_(u64),
3066 }
3067
3068 impl ConfigValue {
3069 pub fn is_unknown(&self) -> bool {
3070 #[allow(unreachable_patterns)]
3071 match self {
3072 Self::UnknownOrdinal_(_) => true,
3073 _ => false,
3074 }
3075 }
3076 }
3077
3078 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigValue<'static>, ___E> for ConfigValue
3079 where
3080 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3081 ___E: ::fidl_next::Encoder,
3082 {
3083 #[inline]
3084 fn encode(
3085 self,
3086 encoder: &mut ___E,
3087 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValue<'static>>,
3088 _: (),
3089 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3090 ::fidl_next::munge!(let crate::wire::ConfigValue { raw, _phantom: _ } = out);
3091
3092 match self {
3093 Self::Single(value) => ::fidl_next::RawWireUnion::encode_as::<
3094 ___E,
3095 crate::wire::ConfigSingleValue<'static>,
3096 >(value, 1, encoder, raw, ())?,
3097
3098 Self::Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
3099 ___E,
3100 crate::wire::ConfigVectorValue<'static>,
3101 >(value, 2, encoder, raw, ())?,
3102
3103 Self::UnknownOrdinal_(ordinal) => {
3104 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
3105 }
3106 }
3107
3108 Ok(())
3109 }
3110 }
3111
3112 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigValue<'static>, ___E>
3113 for &'a ConfigValue
3114 where
3115 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3116 ___E: ::fidl_next::Encoder,
3117 {
3118 #[inline]
3119 fn encode(
3120 self,
3121 encoder: &mut ___E,
3122 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValue<'static>>,
3123 _: (),
3124 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3125 ::fidl_next::munge!(let crate::wire::ConfigValue { raw, _phantom: _ } = out);
3126
3127 match self {
3128 ConfigValue::Single(value) => ::fidl_next::RawWireUnion::encode_as::<
3129 ___E,
3130 crate::wire::ConfigSingleValue<'static>,
3131 >(value, 1, encoder, raw, ())?,
3132
3133 ConfigValue::Vector(value) => ::fidl_next::RawWireUnion::encode_as::<
3134 ___E,
3135 crate::wire::ConfigVectorValue<'static>,
3136 >(value, 2, encoder, raw, ())?,
3137
3138 ConfigValue::UnknownOrdinal_(ordinal) => {
3139 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
3140 }
3141 }
3142
3143 Ok(())
3144 }
3145 }
3146
3147 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::ConfigValue<'static>, ___E>
3148 for ConfigValue
3149 where
3150 ___E: ?Sized,
3151 ConfigValue: ::fidl_next::Encode<crate::wire::ConfigValue<'static>, ___E>,
3152 {
3153 #[inline]
3154 fn encode_option(
3155 this: ::core::option::Option<Self>,
3156 encoder: &mut ___E,
3157 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigValue<'static>>,
3158 _: (),
3159 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3160 ::fidl_next::munge!(let crate::wire_optional::ConfigValue { raw, _phantom: _ } = &mut *out);
3161
3162 if let Some(inner) = this {
3163 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
3164 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
3165 } else {
3166 ::fidl_next::RawWireUnion::encode_absent(raw);
3167 }
3168
3169 Ok(())
3170 }
3171 }
3172
3173 unsafe impl<'a, ___E>
3174 ::fidl_next::EncodeOption<crate::wire_optional::ConfigValue<'static>, ___E>
3175 for &'a ConfigValue
3176 where
3177 ___E: ?Sized,
3178 &'a ConfigValue: ::fidl_next::Encode<crate::wire::ConfigValue<'static>, ___E>,
3179 {
3180 #[inline]
3181 fn encode_option(
3182 this: ::core::option::Option<Self>,
3183 encoder: &mut ___E,
3184 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigValue<'static>>,
3185 _: (),
3186 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3187 ::fidl_next::munge!(let crate::wire_optional::ConfigValue { raw, _phantom: _ } = &mut *out);
3188
3189 if let Some(inner) = this {
3190 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
3191 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
3192 } else {
3193 ::fidl_next::RawWireUnion::encode_absent(raw);
3194 }
3195
3196 Ok(())
3197 }
3198 }
3199
3200 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigValue<'de>> for ConfigValue {
3201 #[inline]
3202 fn from_wire(wire: crate::wire::ConfigValue<'de>) -> Self {
3203 let wire = ::core::mem::ManuallyDrop::new(wire);
3204 match wire.raw.ordinal() {
3205 1 => Self::Single(::fidl_next::FromWire::from_wire(unsafe {
3206 wire.raw.get().read_unchecked::<crate::wire::ConfigSingleValue<'de>>()
3207 })),
3208
3209 2 => Self::Vector(::fidl_next::FromWire::from_wire(unsafe {
3210 wire.raw.get().read_unchecked::<crate::wire::ConfigVectorValue<'de>>()
3211 })),
3212
3213 ord => return Self::UnknownOrdinal_(ord as u64),
3214 }
3215 }
3216 }
3217
3218 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigValue<'de>> for ConfigValue {
3219 #[inline]
3220 fn from_wire_ref(wire: &crate::wire::ConfigValue<'de>) -> Self {
3221 match wire.raw.ordinal() {
3222 1 => Self::Single(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3223 wire.raw.get().deref_unchecked::<crate::wire::ConfigSingleValue<'de>>()
3224 })),
3225
3226 2 => Self::Vector(::fidl_next::FromWireRef::from_wire_ref(unsafe {
3227 wire.raw.get().deref_unchecked::<crate::wire::ConfigVectorValue<'de>>()
3228 })),
3229
3230 ord => return Self::UnknownOrdinal_(ord as u64),
3231 }
3232 }
3233 }
3234
3235 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigValue<'de>> for ConfigValue {
3236 #[inline]
3237 fn from_wire_option(
3238 wire: crate::wire_optional::ConfigValue<'de>,
3239 ) -> ::core::option::Option<Self> {
3240 if let Some(inner) = wire.into_option() {
3241 Some(::fidl_next::FromWire::from_wire(inner))
3242 } else {
3243 None
3244 }
3245 }
3246 }
3247
3248 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigValue<'de>> for Box<ConfigValue> {
3249 #[inline]
3250 fn from_wire_option(
3251 wire: crate::wire_optional::ConfigValue<'de>,
3252 ) -> ::core::option::Option<Self> {
3253 <
3254 ConfigValue as ::fidl_next::FromWireOption<crate::wire_optional::ConfigValue<'de>>
3255 >::from_wire_option(wire).map(Box::new)
3256 }
3257 }
3258
3259 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::ConfigValue<'de>>
3260 for Box<ConfigValue>
3261 {
3262 #[inline]
3263 fn from_wire_option_ref(
3264 wire: &crate::wire_optional::ConfigValue<'de>,
3265 ) -> ::core::option::Option<Self> {
3266 if let Some(inner) = wire.as_ref() {
3267 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
3268 } else {
3269 None
3270 }
3271 }
3272 }
3273
3274 #[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"]
3275 #[derive(PartialEq, Clone, Debug, Default)]
3276 pub struct Configuration {
3277 pub name: ::core::option::Option<::std::string::String>,
3278
3279 pub value: ::core::option::Option<crate::natural::ConfigValue>,
3280 }
3281
3282 impl Configuration {
3283 fn __max_ordinal(&self) -> usize {
3284 if self.value.is_some() {
3285 return 2;
3286 }
3287
3288 if self.name.is_some() {
3289 return 1;
3290 }
3291
3292 0
3293 }
3294 }
3295
3296 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Configuration<'static>, ___E> for Configuration
3297 where
3298 ___E: ::fidl_next::Encoder + ?Sized,
3299 {
3300 #[inline]
3301 fn encode(
3302 mut self,
3303 encoder: &mut ___E,
3304 out: &mut ::core::mem::MaybeUninit<crate::wire::Configuration<'static>>,
3305 _: (),
3306 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3307 ::fidl_next::munge!(let crate::wire::Configuration { table } = out);
3308
3309 let max_ord = self.__max_ordinal();
3310
3311 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3312 ::fidl_next::Wire::zero_padding(&mut out);
3313
3314 let mut preallocated =
3315 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3316
3317 for i in 1..=max_ord {
3318 match i {
3319 2 => {
3320 if let Some(value) = self.value.take() {
3321 ::fidl_next::WireEnvelope::encode_value::<
3322 crate::wire::ConfigValue<'static>,
3323 ___E,
3324 >(
3325 value, preallocated.encoder, &mut out, ()
3326 )?;
3327 } else {
3328 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3329 }
3330 }
3331
3332 1 => {
3333 if let Some(value) = self.name.take() {
3334 ::fidl_next::WireEnvelope::encode_value::<
3335 ::fidl_next::WireString<'static>,
3336 ___E,
3337 >(
3338 value, preallocated.encoder, &mut out, 100
3339 )?;
3340 } else {
3341 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3342 }
3343 }
3344
3345 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3346 }
3347 unsafe {
3348 preallocated.write_next(out.assume_init_ref());
3349 }
3350 }
3351
3352 ::fidl_next::WireTable::encode_len(table, max_ord);
3353
3354 Ok(())
3355 }
3356 }
3357
3358 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Configuration<'static>, ___E>
3359 for &'a Configuration
3360 where
3361 ___E: ::fidl_next::Encoder + ?Sized,
3362 {
3363 #[inline]
3364 fn encode(
3365 self,
3366 encoder: &mut ___E,
3367 out: &mut ::core::mem::MaybeUninit<crate::wire::Configuration<'static>>,
3368 _: (),
3369 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3370 ::fidl_next::munge!(let crate::wire::Configuration { table } = out);
3371
3372 let max_ord = self.__max_ordinal();
3373
3374 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3375 ::fidl_next::Wire::zero_padding(&mut out);
3376
3377 let mut preallocated =
3378 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3379
3380 for i in 1..=max_ord {
3381 match i {
3382 2 => {
3383 if let Some(value) = &self.value {
3384 ::fidl_next::WireEnvelope::encode_value::<
3385 crate::wire::ConfigValue<'static>,
3386 ___E,
3387 >(
3388 value, preallocated.encoder, &mut out, ()
3389 )?;
3390 } else {
3391 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3392 }
3393 }
3394
3395 1 => {
3396 if let Some(value) = &self.name {
3397 ::fidl_next::WireEnvelope::encode_value::<
3398 ::fidl_next::WireString<'static>,
3399 ___E,
3400 >(
3401 value, preallocated.encoder, &mut out, 100
3402 )?;
3403 } else {
3404 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3405 }
3406 }
3407
3408 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3409 }
3410 unsafe {
3411 preallocated.write_next(out.assume_init_ref());
3412 }
3413 }
3414
3415 ::fidl_next::WireTable::encode_len(table, max_ord);
3416
3417 Ok(())
3418 }
3419 }
3420
3421 impl<'de> ::fidl_next::FromWire<crate::wire::Configuration<'de>> for Configuration {
3422 #[inline]
3423 fn from_wire(wire_: crate::wire::Configuration<'de>) -> Self {
3424 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3425
3426 let name = wire_.table.get(1);
3427
3428 let value = wire_.table.get(2);
3429
3430 Self {
3431 name: name.map(|envelope| {
3432 ::fidl_next::FromWire::from_wire(unsafe {
3433 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
3434 })
3435 }),
3436
3437 value: value.map(|envelope| {
3438 ::fidl_next::FromWire::from_wire(unsafe {
3439 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
3440 })
3441 }),
3442 }
3443 }
3444 }
3445
3446 impl<'de> ::fidl_next::FromWireRef<crate::wire::Configuration<'de>> for Configuration {
3447 #[inline]
3448 fn from_wire_ref(wire: &crate::wire::Configuration<'de>) -> Self {
3449 Self {
3450 name: wire.table.get(1).map(|envelope| {
3451 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3452 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
3453 })
3454 }),
3455
3456 value: wire.table.get(2).map(|envelope| {
3457 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3458 envelope.deref_unchecked::<crate::wire::ConfigValue<'de>>()
3459 })
3460 }),
3461 }
3462 }
3463 }
3464
3465 #[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"]
3466 pub type DictionaryPath = ::std::string::String;
3467
3468 #[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"]
3469 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
3470 #[repr(u32)]
3471 pub enum DeliveryType {
3472 Immediate = 0,
3473 OnReadable = 1,
3474 UnknownOrdinal_(u32) = 2,
3475 }
3476 impl ::std::convert::From<u32> for DeliveryType {
3477 fn from(value: u32) -> Self {
3478 match value {
3479 0 => Self::Immediate,
3480 1 => Self::OnReadable,
3481
3482 _ => Self::UnknownOrdinal_(value),
3483 }
3484 }
3485 }
3486
3487 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DeliveryType, ___E> for DeliveryType
3488 where
3489 ___E: ?Sized,
3490 {
3491 #[inline]
3492 fn encode(
3493 self,
3494 encoder: &mut ___E,
3495 out: &mut ::core::mem::MaybeUninit<crate::wire::DeliveryType>,
3496 _: (),
3497 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3498 ::fidl_next::Encode::encode(&self, encoder, out, ())
3499 }
3500 }
3501
3502 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DeliveryType, ___E> for &'a DeliveryType
3503 where
3504 ___E: ?Sized,
3505 {
3506 #[inline]
3507 fn encode(
3508 self,
3509 encoder: &mut ___E,
3510 out: &mut ::core::mem::MaybeUninit<crate::wire::DeliveryType>,
3511 _: (),
3512 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3513 ::fidl_next::munge!(let crate::wire::DeliveryType { value } = out);
3514 let _ = value.write(::fidl_next::WireU32::from(match *self {
3515 DeliveryType::Immediate => 0,
3516
3517 DeliveryType::OnReadable => 1,
3518
3519 DeliveryType::UnknownOrdinal_(value) => value,
3520 }));
3521
3522 Ok(())
3523 }
3524 }
3525
3526 impl ::core::convert::From<crate::wire::DeliveryType> for DeliveryType {
3527 fn from(wire: crate::wire::DeliveryType) -> Self {
3528 match u32::from(wire.value) {
3529 0 => Self::Immediate,
3530
3531 1 => Self::OnReadable,
3532
3533 value => Self::UnknownOrdinal_(value),
3534 }
3535 }
3536 }
3537
3538 impl ::fidl_next::FromWire<crate::wire::DeliveryType> for DeliveryType {
3539 #[inline]
3540 fn from_wire(wire: crate::wire::DeliveryType) -> Self {
3541 Self::from(wire)
3542 }
3543 }
3544
3545 impl ::fidl_next::FromWireRef<crate::wire::DeliveryType> for DeliveryType {
3546 #[inline]
3547 fn from_wire_ref(wire: &crate::wire::DeliveryType) -> Self {
3548 Self::from(*wire)
3549 }
3550 }
3551
3552 #[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"]
3553 #[derive(PartialEq, Clone, Debug, Default)]
3554 pub struct Protocol {
3555 pub name: ::core::option::Option<::std::string::String>,
3556
3557 pub source_path: ::core::option::Option<::std::string::String>,
3558
3559 pub delivery: ::core::option::Option<crate::natural::DeliveryType>,
3560 }
3561
3562 impl Protocol {
3563 fn __max_ordinal(&self) -> usize {
3564 if self.delivery.is_some() {
3565 return 3;
3566 }
3567
3568 if self.source_path.is_some() {
3569 return 2;
3570 }
3571
3572 if self.name.is_some() {
3573 return 1;
3574 }
3575
3576 0
3577 }
3578 }
3579
3580 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Protocol<'static>, ___E> for Protocol
3581 where
3582 ___E: ::fidl_next::Encoder + ?Sized,
3583 {
3584 #[inline]
3585 fn encode(
3586 mut self,
3587 encoder: &mut ___E,
3588 out: &mut ::core::mem::MaybeUninit<crate::wire::Protocol<'static>>,
3589 _: (),
3590 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3591 ::fidl_next::munge!(let crate::wire::Protocol { table } = out);
3592
3593 let max_ord = self.__max_ordinal();
3594
3595 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3596 ::fidl_next::Wire::zero_padding(&mut out);
3597
3598 let mut preallocated =
3599 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3600
3601 for i in 1..=max_ord {
3602 match i {
3603 3 => {
3604 if let Some(value) = self.delivery.take() {
3605 ::fidl_next::WireEnvelope::encode_value::<
3606 crate::wire::DeliveryType,
3607 ___E,
3608 >(
3609 value, preallocated.encoder, &mut out, ()
3610 )?;
3611 } else {
3612 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3613 }
3614 }
3615
3616 2 => {
3617 if let Some(value) = self.source_path.take() {
3618 ::fidl_next::WireEnvelope::encode_value::<
3619 ::fidl_next::WireString<'static>,
3620 ___E,
3621 >(
3622 value, preallocated.encoder, &mut out, 1024
3623 )?;
3624 } else {
3625 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3626 }
3627 }
3628
3629 1 => {
3630 if let Some(value) = self.name.take() {
3631 ::fidl_next::WireEnvelope::encode_value::<
3632 ::fidl_next::WireString<'static>,
3633 ___E,
3634 >(
3635 value, preallocated.encoder, &mut out, 100
3636 )?;
3637 } else {
3638 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3639 }
3640 }
3641
3642 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3643 }
3644 unsafe {
3645 preallocated.write_next(out.assume_init_ref());
3646 }
3647 }
3648
3649 ::fidl_next::WireTable::encode_len(table, max_ord);
3650
3651 Ok(())
3652 }
3653 }
3654
3655 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Protocol<'static>, ___E> for &'a Protocol
3656 where
3657 ___E: ::fidl_next::Encoder + ?Sized,
3658 {
3659 #[inline]
3660 fn encode(
3661 self,
3662 encoder: &mut ___E,
3663 out: &mut ::core::mem::MaybeUninit<crate::wire::Protocol<'static>>,
3664 _: (),
3665 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3666 ::fidl_next::munge!(let crate::wire::Protocol { table } = out);
3667
3668 let max_ord = self.__max_ordinal();
3669
3670 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3671 ::fidl_next::Wire::zero_padding(&mut out);
3672
3673 let mut preallocated =
3674 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3675
3676 for i in 1..=max_ord {
3677 match i {
3678 3 => {
3679 if let Some(value) = &self.delivery {
3680 ::fidl_next::WireEnvelope::encode_value::<
3681 crate::wire::DeliveryType,
3682 ___E,
3683 >(
3684 value, preallocated.encoder, &mut out, ()
3685 )?;
3686 } else {
3687 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3688 }
3689 }
3690
3691 2 => {
3692 if let Some(value) = &self.source_path {
3693 ::fidl_next::WireEnvelope::encode_value::<
3694 ::fidl_next::WireString<'static>,
3695 ___E,
3696 >(
3697 value, preallocated.encoder, &mut out, 1024
3698 )?;
3699 } else {
3700 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3701 }
3702 }
3703
3704 1 => {
3705 if let Some(value) = &self.name {
3706 ::fidl_next::WireEnvelope::encode_value::<
3707 ::fidl_next::WireString<'static>,
3708 ___E,
3709 >(
3710 value, preallocated.encoder, &mut out, 100
3711 )?;
3712 } else {
3713 ::fidl_next::WireEnvelope::encode_zero(&mut out)
3714 }
3715 }
3716
3717 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3718 }
3719 unsafe {
3720 preallocated.write_next(out.assume_init_ref());
3721 }
3722 }
3723
3724 ::fidl_next::WireTable::encode_len(table, max_ord);
3725
3726 Ok(())
3727 }
3728 }
3729
3730 impl<'de> ::fidl_next::FromWire<crate::wire::Protocol<'de>> for Protocol {
3731 #[inline]
3732 fn from_wire(wire_: crate::wire::Protocol<'de>) -> Self {
3733 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
3734
3735 let name = wire_.table.get(1);
3736
3737 let source_path = wire_.table.get(2);
3738
3739 let delivery = wire_.table.get(3);
3740
3741 Self {
3742 name: name.map(|envelope| {
3743 ::fidl_next::FromWire::from_wire(unsafe {
3744 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
3745 })
3746 }),
3747
3748 source_path: source_path.map(|envelope| {
3749 ::fidl_next::FromWire::from_wire(unsafe {
3750 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
3751 })
3752 }),
3753
3754 delivery: delivery.map(|envelope| {
3755 ::fidl_next::FromWire::from_wire(unsafe {
3756 envelope.read_unchecked::<crate::wire::DeliveryType>()
3757 })
3758 }),
3759 }
3760 }
3761 }
3762
3763 impl<'de> ::fidl_next::FromWireRef<crate::wire::Protocol<'de>> for Protocol {
3764 #[inline]
3765 fn from_wire_ref(wire: &crate::wire::Protocol<'de>) -> Self {
3766 Self {
3767 name: wire.table.get(1).map(|envelope| {
3768 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3769 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
3770 })
3771 }),
3772
3773 source_path: wire.table.get(2).map(|envelope| {
3774 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3775 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
3776 })
3777 }),
3778
3779 delivery: wire.table.get(3).map(|envelope| {
3780 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
3781 envelope.deref_unchecked::<crate::wire::DeliveryType>()
3782 })
3783 }),
3784 }
3785 }
3786 }
3787
3788 #[doc = " A reference to the environment.\n"]
3789 #[derive(PartialEq, Clone, Debug)]
3790 #[repr(C)]
3791 pub struct EnvironmentRef {}
3792
3793 unsafe impl<___E> ::fidl_next::Encode<crate::wire::EnvironmentRef, ___E> for EnvironmentRef
3794 where
3795 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3796 {
3797 #[inline]
3798 fn encode(
3799 self,
3800 encoder_: &mut ___E,
3801 out_: &mut ::core::mem::MaybeUninit<crate::wire::EnvironmentRef>,
3802 _: (),
3803 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3804 *out_ = ::core::mem::MaybeUninit::zeroed();
3805
3806 Ok(())
3807 }
3808 }
3809
3810 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EnvironmentRef, ___E> for &'a EnvironmentRef
3811 where
3812 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3813 {
3814 #[inline]
3815 fn encode(
3816 self,
3817 encoder_: &mut ___E,
3818 out_: &mut ::core::mem::MaybeUninit<crate::wire::EnvironmentRef>,
3819 _: (),
3820 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3821 ::fidl_next::munge! {
3822 let crate::wire::EnvironmentRef {
3823
3824 _empty,
3825
3826
3827 } = out_;
3828 }
3829
3830 Ok(())
3831 }
3832 }
3833
3834 unsafe impl<___E>
3835 ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::EnvironmentRef>, ___E>
3836 for EnvironmentRef
3837 where
3838 ___E: ::fidl_next::Encoder + ?Sized,
3839 EnvironmentRef: ::fidl_next::Encode<crate::wire::EnvironmentRef, ___E>,
3840 {
3841 #[inline]
3842 fn encode_option(
3843 this: ::core::option::Option<Self>,
3844 encoder: &mut ___E,
3845 out: &mut ::core::mem::MaybeUninit<
3846 ::fidl_next::WireBox<'static, crate::wire::EnvironmentRef>,
3847 >,
3848 _: (),
3849 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3850 if let Some(inner) = this {
3851 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
3852 ::fidl_next::WireBox::encode_present(out);
3853 } else {
3854 ::fidl_next::WireBox::encode_absent(out);
3855 }
3856
3857 Ok(())
3858 }
3859 }
3860
3861 unsafe impl<'a, ___E>
3862 ::fidl_next::EncodeOption<::fidl_next::WireBox<'static, crate::wire::EnvironmentRef>, ___E>
3863 for &'a EnvironmentRef
3864 where
3865 ___E: ::fidl_next::Encoder + ?Sized,
3866 &'a EnvironmentRef: ::fidl_next::Encode<crate::wire::EnvironmentRef, ___E>,
3867 {
3868 #[inline]
3869 fn encode_option(
3870 this: ::core::option::Option<Self>,
3871 encoder: &mut ___E,
3872 out: &mut ::core::mem::MaybeUninit<
3873 ::fidl_next::WireBox<'static, crate::wire::EnvironmentRef>,
3874 >,
3875 _: (),
3876 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3877 if let Some(inner) = this {
3878 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
3879 ::fidl_next::WireBox::encode_present(out);
3880 } else {
3881 ::fidl_next::WireBox::encode_absent(out);
3882 }
3883
3884 Ok(())
3885 }
3886 }
3887
3888 impl ::fidl_next::FromWire<crate::wire::EnvironmentRef> for EnvironmentRef {
3889 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<crate::wire::EnvironmentRef, Self> =
3890 unsafe { ::fidl_next::CopyOptimization::enable_if(true) };
3891
3892 #[inline]
3893 fn from_wire(wire: crate::wire::EnvironmentRef) -> Self {
3894 Self {}
3895 }
3896 }
3897
3898 impl ::fidl_next::FromWireRef<crate::wire::EnvironmentRef> for EnvironmentRef {
3899 #[inline]
3900 fn from_wire_ref(wire: &crate::wire::EnvironmentRef) -> Self {
3901 Self {}
3902 }
3903 }
3904
3905 #[doc = " A reference to a capability source or destination relative to this\n component.\n"]
3906 #[derive(PartialEq, Clone, Debug)]
3907 pub enum Ref {
3908 Parent(crate::natural::ParentRef),
3909
3910 Self_(crate::natural::SelfRef),
3911
3912 Child(crate::natural::ChildRef),
3913
3914 Collection(crate::natural::CollectionRef),
3915
3916 Framework(crate::natural::FrameworkRef),
3917
3918 Capability(crate::natural::CapabilityRef),
3919
3920 Debug(crate::natural::DebugRef),
3921
3922 VoidType(crate::natural::VoidRef),
3923
3924 Environment(crate::natural::EnvironmentRef),
3925
3926 UnknownOrdinal_(u64),
3927 }
3928
3929 impl Ref {
3930 pub fn is_unknown(&self) -> bool {
3931 #[allow(unreachable_patterns)]
3932 match self {
3933 Self::UnknownOrdinal_(_) => true,
3934 _ => false,
3935 }
3936 }
3937 }
3938
3939 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Ref<'static>, ___E> for Ref
3940 where
3941 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
3942 ___E: ::fidl_next::Encoder,
3943 {
3944 #[inline]
3945 fn encode(
3946 self,
3947 encoder: &mut ___E,
3948 out: &mut ::core::mem::MaybeUninit<crate::wire::Ref<'static>>,
3949 _: (),
3950 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3951 ::fidl_next::munge!(let crate::wire::Ref { raw, _phantom: _ } = out);
3952
3953 match self {
3954 Self::Parent(value) => ::fidl_next::RawWireUnion::encode_as::<
3955 ___E,
3956 crate::wire::ParentRef,
3957 >(value, 1, encoder, raw, ())?,
3958
3959 Self::Self_(value) => ::fidl_next::RawWireUnion::encode_as::<
3960 ___E,
3961 crate::wire::SelfRef,
3962 >(value, 2, encoder, raw, ())?,
3963
3964 Self::Child(value) => ::fidl_next::RawWireUnion::encode_as::<
3965 ___E,
3966 crate::wire::ChildRef<'static>,
3967 >(value, 3, encoder, raw, ())?,
3968
3969 Self::Collection(value) => ::fidl_next::RawWireUnion::encode_as::<
3970 ___E,
3971 crate::wire::CollectionRef<'static>,
3972 >(value, 4, encoder, raw, ())?,
3973
3974 Self::Framework(value) => ::fidl_next::RawWireUnion::encode_as::<
3975 ___E,
3976 crate::wire::FrameworkRef,
3977 >(value, 5, encoder, raw, ())?,
3978
3979 Self::Capability(value) => ::fidl_next::RawWireUnion::encode_as::<
3980 ___E,
3981 crate::wire::CapabilityRef<'static>,
3982 >(value, 6, encoder, raw, ())?,
3983
3984 Self::Debug(value) => ::fidl_next::RawWireUnion::encode_as::<
3985 ___E,
3986 crate::wire::DebugRef,
3987 >(value, 7, encoder, raw, ())?,
3988
3989 Self::VoidType(value) => ::fidl_next::RawWireUnion::encode_as::<
3990 ___E,
3991 crate::wire::VoidRef,
3992 >(value, 8, encoder, raw, ())?,
3993
3994 Self::Environment(value) => ::fidl_next::RawWireUnion::encode_as::<
3995 ___E,
3996 crate::wire::EnvironmentRef,
3997 >(value, 9, encoder, raw, ())?,
3998
3999 Self::UnknownOrdinal_(ordinal) => {
4000 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
4001 }
4002 }
4003
4004 Ok(())
4005 }
4006 }
4007
4008 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Ref<'static>, ___E> for &'a Ref
4009 where
4010 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4011 ___E: ::fidl_next::Encoder,
4012 {
4013 #[inline]
4014 fn encode(
4015 self,
4016 encoder: &mut ___E,
4017 out: &mut ::core::mem::MaybeUninit<crate::wire::Ref<'static>>,
4018 _: (),
4019 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4020 ::fidl_next::munge!(let crate::wire::Ref { raw, _phantom: _ } = out);
4021
4022 match self {
4023 Ref::Parent(value) => ::fidl_next::RawWireUnion::encode_as::<
4024 ___E,
4025 crate::wire::ParentRef,
4026 >(value, 1, encoder, raw, ())?,
4027
4028 Ref::Self_(value) => ::fidl_next::RawWireUnion::encode_as::<
4029 ___E,
4030 crate::wire::SelfRef,
4031 >(value, 2, encoder, raw, ())?,
4032
4033 Ref::Child(value) => ::fidl_next::RawWireUnion::encode_as::<
4034 ___E,
4035 crate::wire::ChildRef<'static>,
4036 >(value, 3, encoder, raw, ())?,
4037
4038 Ref::Collection(value) => ::fidl_next::RawWireUnion::encode_as::<
4039 ___E,
4040 crate::wire::CollectionRef<'static>,
4041 >(value, 4, encoder, raw, ())?,
4042
4043 Ref::Framework(value) => ::fidl_next::RawWireUnion::encode_as::<
4044 ___E,
4045 crate::wire::FrameworkRef,
4046 >(value, 5, encoder, raw, ())?,
4047
4048 Ref::Capability(value) => ::fidl_next::RawWireUnion::encode_as::<
4049 ___E,
4050 crate::wire::CapabilityRef<'static>,
4051 >(value, 6, encoder, raw, ())?,
4052
4053 Ref::Debug(value) => ::fidl_next::RawWireUnion::encode_as::<
4054 ___E,
4055 crate::wire::DebugRef,
4056 >(value, 7, encoder, raw, ())?,
4057
4058 Ref::VoidType(value) => ::fidl_next::RawWireUnion::encode_as::<
4059 ___E,
4060 crate::wire::VoidRef,
4061 >(value, 8, encoder, raw, ())?,
4062
4063 Ref::Environment(value) => ::fidl_next::RawWireUnion::encode_as::<
4064 ___E,
4065 crate::wire::EnvironmentRef,
4066 >(value, 9, encoder, raw, ())?,
4067
4068 Ref::UnknownOrdinal_(ordinal) => {
4069 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
4070 }
4071 }
4072
4073 Ok(())
4074 }
4075 }
4076
4077 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::Ref<'static>, ___E> for Ref
4078 where
4079 ___E: ?Sized,
4080 Ref: ::fidl_next::Encode<crate::wire::Ref<'static>, ___E>,
4081 {
4082 #[inline]
4083 fn encode_option(
4084 this: ::core::option::Option<Self>,
4085 encoder: &mut ___E,
4086 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Ref<'static>>,
4087 _: (),
4088 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4089 ::fidl_next::munge!(let crate::wire_optional::Ref { raw, _phantom: _ } = &mut *out);
4090
4091 if let Some(inner) = this {
4092 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
4093 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
4094 } else {
4095 ::fidl_next::RawWireUnion::encode_absent(raw);
4096 }
4097
4098 Ok(())
4099 }
4100 }
4101
4102 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::Ref<'static>, ___E>
4103 for &'a Ref
4104 where
4105 ___E: ?Sized,
4106 &'a Ref: ::fidl_next::Encode<crate::wire::Ref<'static>, ___E>,
4107 {
4108 #[inline]
4109 fn encode_option(
4110 this: ::core::option::Option<Self>,
4111 encoder: &mut ___E,
4112 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Ref<'static>>,
4113 _: (),
4114 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4115 ::fidl_next::munge!(let crate::wire_optional::Ref { raw, _phantom: _ } = &mut *out);
4116
4117 if let Some(inner) = this {
4118 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
4119 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
4120 } else {
4121 ::fidl_next::RawWireUnion::encode_absent(raw);
4122 }
4123
4124 Ok(())
4125 }
4126 }
4127
4128 impl<'de> ::fidl_next::FromWire<crate::wire::Ref<'de>> for Ref {
4129 #[inline]
4130 fn from_wire(wire: crate::wire::Ref<'de>) -> Self {
4131 let wire = ::core::mem::ManuallyDrop::new(wire);
4132 match wire.raw.ordinal() {
4133 1 => Self::Parent(::fidl_next::FromWire::from_wire(unsafe {
4134 wire.raw.get().read_unchecked::<crate::wire::ParentRef>()
4135 })),
4136
4137 2 => Self::Self_(::fidl_next::FromWire::from_wire(unsafe {
4138 wire.raw.get().read_unchecked::<crate::wire::SelfRef>()
4139 })),
4140
4141 3 => Self::Child(::fidl_next::FromWire::from_wire(unsafe {
4142 wire.raw.get().read_unchecked::<crate::wire::ChildRef<'de>>()
4143 })),
4144
4145 4 => Self::Collection(::fidl_next::FromWire::from_wire(unsafe {
4146 wire.raw.get().read_unchecked::<crate::wire::CollectionRef<'de>>()
4147 })),
4148
4149 5 => Self::Framework(::fidl_next::FromWire::from_wire(unsafe {
4150 wire.raw.get().read_unchecked::<crate::wire::FrameworkRef>()
4151 })),
4152
4153 6 => Self::Capability(::fidl_next::FromWire::from_wire(unsafe {
4154 wire.raw.get().read_unchecked::<crate::wire::CapabilityRef<'de>>()
4155 })),
4156
4157 7 => Self::Debug(::fidl_next::FromWire::from_wire(unsafe {
4158 wire.raw.get().read_unchecked::<crate::wire::DebugRef>()
4159 })),
4160
4161 8 => Self::VoidType(::fidl_next::FromWire::from_wire(unsafe {
4162 wire.raw.get().read_unchecked::<crate::wire::VoidRef>()
4163 })),
4164
4165 9 => Self::Environment(::fidl_next::FromWire::from_wire(unsafe {
4166 wire.raw.get().read_unchecked::<crate::wire::EnvironmentRef>()
4167 })),
4168
4169 ord => return Self::UnknownOrdinal_(ord as u64),
4170 }
4171 }
4172 }
4173
4174 impl<'de> ::fidl_next::FromWireRef<crate::wire::Ref<'de>> for Ref {
4175 #[inline]
4176 fn from_wire_ref(wire: &crate::wire::Ref<'de>) -> Self {
4177 match wire.raw.ordinal() {
4178 1 => Self::Parent(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4179 wire.raw.get().deref_unchecked::<crate::wire::ParentRef>()
4180 })),
4181
4182 2 => Self::Self_(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4183 wire.raw.get().deref_unchecked::<crate::wire::SelfRef>()
4184 })),
4185
4186 3 => Self::Child(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4187 wire.raw.get().deref_unchecked::<crate::wire::ChildRef<'de>>()
4188 })),
4189
4190 4 => Self::Collection(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4191 wire.raw.get().deref_unchecked::<crate::wire::CollectionRef<'de>>()
4192 })),
4193
4194 5 => Self::Framework(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4195 wire.raw.get().deref_unchecked::<crate::wire::FrameworkRef>()
4196 })),
4197
4198 6 => Self::Capability(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4199 wire.raw.get().deref_unchecked::<crate::wire::CapabilityRef<'de>>()
4200 })),
4201
4202 7 => Self::Debug(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4203 wire.raw.get().deref_unchecked::<crate::wire::DebugRef>()
4204 })),
4205
4206 8 => Self::VoidType(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4207 wire.raw.get().deref_unchecked::<crate::wire::VoidRef>()
4208 })),
4209
4210 9 => Self::Environment(::fidl_next::FromWireRef::from_wire_ref(unsafe {
4211 wire.raw.get().deref_unchecked::<crate::wire::EnvironmentRef>()
4212 })),
4213
4214 ord => return Self::UnknownOrdinal_(ord as u64),
4215 }
4216 }
4217 }
4218
4219 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Ref<'de>> for Ref {
4220 #[inline]
4221 fn from_wire_option(wire: crate::wire_optional::Ref<'de>) -> ::core::option::Option<Self> {
4222 if let Some(inner) = wire.into_option() {
4223 Some(::fidl_next::FromWire::from_wire(inner))
4224 } else {
4225 None
4226 }
4227 }
4228 }
4229
4230 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Ref<'de>> for Box<Ref> {
4231 #[inline]
4232 fn from_wire_option(wire: crate::wire_optional::Ref<'de>) -> ::core::option::Option<Self> {
4233 <Ref as ::fidl_next::FromWireOption<crate::wire_optional::Ref<'de>>>::from_wire_option(
4234 wire,
4235 )
4236 .map(Box::new)
4237 }
4238 }
4239
4240 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::Ref<'de>> for Box<Ref> {
4241 #[inline]
4242 fn from_wire_option_ref(
4243 wire: &crate::wire_optional::Ref<'de>,
4244 ) -> ::core::option::Option<Self> {
4245 if let Some(inner) = wire.as_ref() {
4246 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
4247 } else {
4248 None
4249 }
4250 }
4251 }
4252
4253 #[doc = " Declares a storage capability backed by a directory from which data, cache,\n or meta storage can be offered.\n"]
4254 #[derive(PartialEq, Clone, Debug, Default)]
4255 pub struct Storage {
4256 pub name: ::core::option::Option<::std::string::String>,
4257
4258 pub source: ::core::option::Option<crate::natural::Ref>,
4259
4260 pub backing_dir: ::core::option::Option<::std::string::String>,
4261
4262 pub subdir: ::core::option::Option<::std::string::String>,
4263
4264 pub storage_id: ::core::option::Option<crate::natural::StorageId>,
4265 }
4266
4267 impl Storage {
4268 fn __max_ordinal(&self) -> usize {
4269 if self.storage_id.is_some() {
4270 return 5;
4271 }
4272
4273 if self.subdir.is_some() {
4274 return 4;
4275 }
4276
4277 if self.backing_dir.is_some() {
4278 return 3;
4279 }
4280
4281 if self.source.is_some() {
4282 return 2;
4283 }
4284
4285 if self.name.is_some() {
4286 return 1;
4287 }
4288
4289 0
4290 }
4291 }
4292
4293 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Storage<'static>, ___E> for Storage
4294 where
4295 ___E: ::fidl_next::Encoder + ?Sized,
4296 {
4297 #[inline]
4298 fn encode(
4299 mut self,
4300 encoder: &mut ___E,
4301 out: &mut ::core::mem::MaybeUninit<crate::wire::Storage<'static>>,
4302 _: (),
4303 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4304 ::fidl_next::munge!(let crate::wire::Storage { table } = out);
4305
4306 let max_ord = self.__max_ordinal();
4307
4308 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
4309 ::fidl_next::Wire::zero_padding(&mut out);
4310
4311 let mut preallocated =
4312 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
4313
4314 for i in 1..=max_ord {
4315 match i {
4316 5 => {
4317 if let Some(value) = self.storage_id.take() {
4318 ::fidl_next::WireEnvelope::encode_value::<crate::wire::StorageId, ___E>(
4319 value,
4320 preallocated.encoder,
4321 &mut out,
4322 (),
4323 )?;
4324 } else {
4325 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4326 }
4327 }
4328
4329 4 => {
4330 if let Some(value) = self.subdir.take() {
4331 ::fidl_next::WireEnvelope::encode_value::<
4332 ::fidl_next::WireString<'static>,
4333 ___E,
4334 >(
4335 value, preallocated.encoder, &mut out, 1024
4336 )?;
4337 } else {
4338 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4339 }
4340 }
4341
4342 3 => {
4343 if let Some(value) = self.backing_dir.take() {
4344 ::fidl_next::WireEnvelope::encode_value::<
4345 ::fidl_next::WireString<'static>,
4346 ___E,
4347 >(
4348 value, preallocated.encoder, &mut out, 100
4349 )?;
4350 } else {
4351 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4352 }
4353 }
4354
4355 2 => {
4356 if let Some(value) = self.source.take() {
4357 ::fidl_next::WireEnvelope::encode_value::<
4358 crate::wire::Ref<'static>,
4359 ___E,
4360 >(
4361 value, preallocated.encoder, &mut out, ()
4362 )?;
4363 } else {
4364 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4365 }
4366 }
4367
4368 1 => {
4369 if let Some(value) = self.name.take() {
4370 ::fidl_next::WireEnvelope::encode_value::<
4371 ::fidl_next::WireString<'static>,
4372 ___E,
4373 >(
4374 value, preallocated.encoder, &mut out, 100
4375 )?;
4376 } else {
4377 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4378 }
4379 }
4380
4381 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
4382 }
4383 unsafe {
4384 preallocated.write_next(out.assume_init_ref());
4385 }
4386 }
4387
4388 ::fidl_next::WireTable::encode_len(table, max_ord);
4389
4390 Ok(())
4391 }
4392 }
4393
4394 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Storage<'static>, ___E> for &'a Storage
4395 where
4396 ___E: ::fidl_next::Encoder + ?Sized,
4397 {
4398 #[inline]
4399 fn encode(
4400 self,
4401 encoder: &mut ___E,
4402 out: &mut ::core::mem::MaybeUninit<crate::wire::Storage<'static>>,
4403 _: (),
4404 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4405 ::fidl_next::munge!(let crate::wire::Storage { table } = out);
4406
4407 let max_ord = self.__max_ordinal();
4408
4409 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
4410 ::fidl_next::Wire::zero_padding(&mut out);
4411
4412 let mut preallocated =
4413 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
4414
4415 for i in 1..=max_ord {
4416 match i {
4417 5 => {
4418 if let Some(value) = &self.storage_id {
4419 ::fidl_next::WireEnvelope::encode_value::<crate::wire::StorageId, ___E>(
4420 value,
4421 preallocated.encoder,
4422 &mut out,
4423 (),
4424 )?;
4425 } else {
4426 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4427 }
4428 }
4429
4430 4 => {
4431 if let Some(value) = &self.subdir {
4432 ::fidl_next::WireEnvelope::encode_value::<
4433 ::fidl_next::WireString<'static>,
4434 ___E,
4435 >(
4436 value, preallocated.encoder, &mut out, 1024
4437 )?;
4438 } else {
4439 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4440 }
4441 }
4442
4443 3 => {
4444 if let Some(value) = &self.backing_dir {
4445 ::fidl_next::WireEnvelope::encode_value::<
4446 ::fidl_next::WireString<'static>,
4447 ___E,
4448 >(
4449 value, preallocated.encoder, &mut out, 100
4450 )?;
4451 } else {
4452 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4453 }
4454 }
4455
4456 2 => {
4457 if let Some(value) = &self.source {
4458 ::fidl_next::WireEnvelope::encode_value::<
4459 crate::wire::Ref<'static>,
4460 ___E,
4461 >(
4462 value, preallocated.encoder, &mut out, ()
4463 )?;
4464 } else {
4465 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4466 }
4467 }
4468
4469 1 => {
4470 if let Some(value) = &self.name {
4471 ::fidl_next::WireEnvelope::encode_value::<
4472 ::fidl_next::WireString<'static>,
4473 ___E,
4474 >(
4475 value, preallocated.encoder, &mut out, 100
4476 )?;
4477 } else {
4478 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4479 }
4480 }
4481
4482 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
4483 }
4484 unsafe {
4485 preallocated.write_next(out.assume_init_ref());
4486 }
4487 }
4488
4489 ::fidl_next::WireTable::encode_len(table, max_ord);
4490
4491 Ok(())
4492 }
4493 }
4494
4495 impl<'de> ::fidl_next::FromWire<crate::wire::Storage<'de>> for Storage {
4496 #[inline]
4497 fn from_wire(wire_: crate::wire::Storage<'de>) -> Self {
4498 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4499
4500 let name = wire_.table.get(1);
4501
4502 let source = wire_.table.get(2);
4503
4504 let backing_dir = wire_.table.get(3);
4505
4506 let subdir = wire_.table.get(4);
4507
4508 let storage_id = wire_.table.get(5);
4509
4510 Self {
4511 name: name.map(|envelope| {
4512 ::fidl_next::FromWire::from_wire(unsafe {
4513 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
4514 })
4515 }),
4516
4517 source: source.map(|envelope| {
4518 ::fidl_next::FromWire::from_wire(unsafe {
4519 envelope.read_unchecked::<crate::wire::Ref<'de>>()
4520 })
4521 }),
4522
4523 backing_dir: backing_dir.map(|envelope| {
4524 ::fidl_next::FromWire::from_wire(unsafe {
4525 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
4526 })
4527 }),
4528
4529 subdir: subdir.map(|envelope| {
4530 ::fidl_next::FromWire::from_wire(unsafe {
4531 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
4532 })
4533 }),
4534
4535 storage_id: storage_id.map(|envelope| {
4536 ::fidl_next::FromWire::from_wire(unsafe {
4537 envelope.read_unchecked::<crate::wire::StorageId>()
4538 })
4539 }),
4540 }
4541 }
4542 }
4543
4544 impl<'de> ::fidl_next::FromWireRef<crate::wire::Storage<'de>> for Storage {
4545 #[inline]
4546 fn from_wire_ref(wire: &crate::wire::Storage<'de>) -> Self {
4547 Self {
4548 name: wire.table.get(1).map(|envelope| {
4549 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4550 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
4551 })
4552 }),
4553
4554 source: wire.table.get(2).map(|envelope| {
4555 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4556 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
4557 })
4558 }),
4559
4560 backing_dir: wire.table.get(3).map(|envelope| {
4561 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4562 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
4563 })
4564 }),
4565
4566 subdir: wire.table.get(4).map(|envelope| {
4567 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4568 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
4569 })
4570 }),
4571
4572 storage_id: wire.table.get(5).map(|envelope| {
4573 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4574 envelope.deref_unchecked::<crate::wire::StorageId>()
4575 })
4576 }),
4577 }
4578 }
4579 }
4580
4581 #[doc = " Declares a dictionary capability.\n"]
4582 #[derive(PartialEq, Clone, Debug, Default)]
4583 pub struct Dictionary {
4584 pub name: ::core::option::Option<::std::string::String>,
4585
4586 pub source: ::core::option::Option<crate::natural::Ref>,
4587
4588 pub source_dictionary: ::core::option::Option<::std::string::String>,
4589
4590 pub source_path: ::core::option::Option<::std::string::String>,
4591 }
4592
4593 impl Dictionary {
4594 fn __max_ordinal(&self) -> usize {
4595 if self.source_path.is_some() {
4596 return 4;
4597 }
4598
4599 if self.source_dictionary.is_some() {
4600 return 3;
4601 }
4602
4603 if self.source.is_some() {
4604 return 2;
4605 }
4606
4607 if self.name.is_some() {
4608 return 1;
4609 }
4610
4611 0
4612 }
4613 }
4614
4615 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Dictionary<'static>, ___E> for Dictionary
4616 where
4617 ___E: ::fidl_next::Encoder + ?Sized,
4618 {
4619 #[inline]
4620 fn encode(
4621 mut self,
4622 encoder: &mut ___E,
4623 out: &mut ::core::mem::MaybeUninit<crate::wire::Dictionary<'static>>,
4624 _: (),
4625 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4626 ::fidl_next::munge!(let crate::wire::Dictionary { table } = out);
4627
4628 let max_ord = self.__max_ordinal();
4629
4630 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
4631 ::fidl_next::Wire::zero_padding(&mut out);
4632
4633 let mut preallocated =
4634 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
4635
4636 for i in 1..=max_ord {
4637 match i {
4638 4 => {
4639 if let Some(value) = self.source_path.take() {
4640 ::fidl_next::WireEnvelope::encode_value::<
4641 ::fidl_next::WireString<'static>,
4642 ___E,
4643 >(
4644 value, preallocated.encoder, &mut out, 1024
4645 )?;
4646 } else {
4647 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4648 }
4649 }
4650
4651 3 => {
4652 if let Some(value) = self.source_dictionary.take() {
4653 ::fidl_next::WireEnvelope::encode_value::<
4654 ::fidl_next::WireString<'static>,
4655 ___E,
4656 >(
4657 value, preallocated.encoder, &mut out, 1024
4658 )?;
4659 } else {
4660 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4661 }
4662 }
4663
4664 2 => {
4665 if let Some(value) = self.source.take() {
4666 ::fidl_next::WireEnvelope::encode_value::<
4667 crate::wire::Ref<'static>,
4668 ___E,
4669 >(
4670 value, preallocated.encoder, &mut out, ()
4671 )?;
4672 } else {
4673 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4674 }
4675 }
4676
4677 1 => {
4678 if let Some(value) = self.name.take() {
4679 ::fidl_next::WireEnvelope::encode_value::<
4680 ::fidl_next::WireString<'static>,
4681 ___E,
4682 >(
4683 value, preallocated.encoder, &mut out, 100
4684 )?;
4685 } else {
4686 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4687 }
4688 }
4689
4690 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
4691 }
4692 unsafe {
4693 preallocated.write_next(out.assume_init_ref());
4694 }
4695 }
4696
4697 ::fidl_next::WireTable::encode_len(table, max_ord);
4698
4699 Ok(())
4700 }
4701 }
4702
4703 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Dictionary<'static>, ___E> for &'a Dictionary
4704 where
4705 ___E: ::fidl_next::Encoder + ?Sized,
4706 {
4707 #[inline]
4708 fn encode(
4709 self,
4710 encoder: &mut ___E,
4711 out: &mut ::core::mem::MaybeUninit<crate::wire::Dictionary<'static>>,
4712 _: (),
4713 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4714 ::fidl_next::munge!(let crate::wire::Dictionary { table } = out);
4715
4716 let max_ord = self.__max_ordinal();
4717
4718 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
4719 ::fidl_next::Wire::zero_padding(&mut out);
4720
4721 let mut preallocated =
4722 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
4723
4724 for i in 1..=max_ord {
4725 match i {
4726 4 => {
4727 if let Some(value) = &self.source_path {
4728 ::fidl_next::WireEnvelope::encode_value::<
4729 ::fidl_next::WireString<'static>,
4730 ___E,
4731 >(
4732 value, preallocated.encoder, &mut out, 1024
4733 )?;
4734 } else {
4735 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4736 }
4737 }
4738
4739 3 => {
4740 if let Some(value) = &self.source_dictionary {
4741 ::fidl_next::WireEnvelope::encode_value::<
4742 ::fidl_next::WireString<'static>,
4743 ___E,
4744 >(
4745 value, preallocated.encoder, &mut out, 1024
4746 )?;
4747 } else {
4748 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4749 }
4750 }
4751
4752 2 => {
4753 if let Some(value) = &self.source {
4754 ::fidl_next::WireEnvelope::encode_value::<
4755 crate::wire::Ref<'static>,
4756 ___E,
4757 >(
4758 value, preallocated.encoder, &mut out, ()
4759 )?;
4760 } else {
4761 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4762 }
4763 }
4764
4765 1 => {
4766 if let Some(value) = &self.name {
4767 ::fidl_next::WireEnvelope::encode_value::<
4768 ::fidl_next::WireString<'static>,
4769 ___E,
4770 >(
4771 value, preallocated.encoder, &mut out, 100
4772 )?;
4773 } else {
4774 ::fidl_next::WireEnvelope::encode_zero(&mut out)
4775 }
4776 }
4777
4778 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
4779 }
4780 unsafe {
4781 preallocated.write_next(out.assume_init_ref());
4782 }
4783 }
4784
4785 ::fidl_next::WireTable::encode_len(table, max_ord);
4786
4787 Ok(())
4788 }
4789 }
4790
4791 impl<'de> ::fidl_next::FromWire<crate::wire::Dictionary<'de>> for Dictionary {
4792 #[inline]
4793 fn from_wire(wire_: crate::wire::Dictionary<'de>) -> Self {
4794 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
4795
4796 let name = wire_.table.get(1);
4797
4798 let source = wire_.table.get(2);
4799
4800 let source_dictionary = wire_.table.get(3);
4801
4802 let source_path = wire_.table.get(4);
4803
4804 Self {
4805 name: name.map(|envelope| {
4806 ::fidl_next::FromWire::from_wire(unsafe {
4807 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
4808 })
4809 }),
4810
4811 source: source.map(|envelope| {
4812 ::fidl_next::FromWire::from_wire(unsafe {
4813 envelope.read_unchecked::<crate::wire::Ref<'de>>()
4814 })
4815 }),
4816
4817 source_dictionary: source_dictionary.map(|envelope| {
4818 ::fidl_next::FromWire::from_wire(unsafe {
4819 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
4820 })
4821 }),
4822
4823 source_path: source_path.map(|envelope| {
4824 ::fidl_next::FromWire::from_wire(unsafe {
4825 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
4826 })
4827 }),
4828 }
4829 }
4830 }
4831
4832 impl<'de> ::fidl_next::FromWireRef<crate::wire::Dictionary<'de>> for Dictionary {
4833 #[inline]
4834 fn from_wire_ref(wire: &crate::wire::Dictionary<'de>) -> Self {
4835 Self {
4836 name: wire.table.get(1).map(|envelope| {
4837 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4838 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
4839 })
4840 }),
4841
4842 source: wire.table.get(2).map(|envelope| {
4843 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4844 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
4845 })
4846 }),
4847
4848 source_dictionary: wire.table.get(3).map(|envelope| {
4849 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4850 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
4851 })
4852 }),
4853
4854 source_path: wire.table.get(4).map(|envelope| {
4855 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4856 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
4857 })
4858 }),
4859 }
4860 }
4861 }
4862
4863 #[doc = " Declares a capability defined by this component.\n"]
4864 #[derive(PartialEq, Clone, Debug)]
4865 pub enum Capability {
4866 Service(crate::natural::Service),
4867
4868 Protocol(crate::natural::Protocol),
4869
4870 Directory(crate::natural::Directory),
4871
4872 Storage(crate::natural::Storage),
4873
4874 Runner(crate::natural::Runner),
4875
4876 Resolver(crate::natural::Resolver),
4877
4878 EventStream(crate::natural::EventStream),
4879
4880 Dictionary(crate::natural::Dictionary),
4881
4882 Config(crate::natural::Configuration),
4883
4884 UnknownOrdinal_(u64),
4885 }
4886
4887 impl Capability {
4888 pub fn is_unknown(&self) -> bool {
4889 #[allow(unreachable_patterns)]
4890 match self {
4891 Self::UnknownOrdinal_(_) => true,
4892 _ => false,
4893 }
4894 }
4895 }
4896
4897 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Capability<'static>, ___E> for Capability
4898 where
4899 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4900 ___E: ::fidl_next::Encoder,
4901 {
4902 #[inline]
4903 fn encode(
4904 self,
4905 encoder: &mut ___E,
4906 out: &mut ::core::mem::MaybeUninit<crate::wire::Capability<'static>>,
4907 _: (),
4908 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4909 ::fidl_next::munge!(let crate::wire::Capability { raw, _phantom: _ } = out);
4910
4911 match self {
4912 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
4913 ___E,
4914 crate::wire::Service<'static>,
4915 >(value, 1, encoder, raw, ())?,
4916
4917 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
4918 ___E,
4919 crate::wire::Protocol<'static>,
4920 >(value, 2, encoder, raw, ())?,
4921
4922 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
4923 ___E,
4924 crate::wire::Directory<'static>,
4925 >(value, 3, encoder, raw, ())?,
4926
4927 Self::Storage(value) => ::fidl_next::RawWireUnion::encode_as::<
4928 ___E,
4929 crate::wire::Storage<'static>,
4930 >(value, 4, encoder, raw, ())?,
4931
4932 Self::Runner(value) => ::fidl_next::RawWireUnion::encode_as::<
4933 ___E,
4934 crate::wire::Runner<'static>,
4935 >(value, 5, encoder, raw, ())?,
4936
4937 Self::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<
4938 ___E,
4939 crate::wire::Resolver<'static>,
4940 >(value, 6, encoder, raw, ())?,
4941
4942 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
4943 ___E,
4944 crate::wire::EventStream<'static>,
4945 >(value, 8, encoder, raw, ())?,
4946
4947 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
4948 ___E,
4949 crate::wire::Dictionary<'static>,
4950 >(value, 9, encoder, raw, ())?,
4951
4952 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
4953 ___E,
4954 crate::wire::Configuration<'static>,
4955 >(value, 10, encoder, raw, ())?,
4956
4957 Self::UnknownOrdinal_(ordinal) => {
4958 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
4959 }
4960 }
4961
4962 Ok(())
4963 }
4964 }
4965
4966 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Capability<'static>, ___E> for &'a Capability
4967 where
4968 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4969 ___E: ::fidl_next::Encoder,
4970 {
4971 #[inline]
4972 fn encode(
4973 self,
4974 encoder: &mut ___E,
4975 out: &mut ::core::mem::MaybeUninit<crate::wire::Capability<'static>>,
4976 _: (),
4977 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
4978 ::fidl_next::munge!(let crate::wire::Capability { raw, _phantom: _ } = out);
4979
4980 match self {
4981 Capability::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
4982 ___E,
4983 crate::wire::Service<'static>,
4984 >(value, 1, encoder, raw, ())?,
4985
4986 Capability::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
4987 ___E,
4988 crate::wire::Protocol<'static>,
4989 >(value, 2, encoder, raw, ())?,
4990
4991 Capability::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
4992 ___E,
4993 crate::wire::Directory<'static>,
4994 >(value, 3, encoder, raw, ())?,
4995
4996 Capability::Storage(value) => ::fidl_next::RawWireUnion::encode_as::<
4997 ___E,
4998 crate::wire::Storage<'static>,
4999 >(value, 4, encoder, raw, ())?,
5000
5001 Capability::Runner(value) => ::fidl_next::RawWireUnion::encode_as::<
5002 ___E,
5003 crate::wire::Runner<'static>,
5004 >(value, 5, encoder, raw, ())?,
5005
5006 Capability::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<
5007 ___E,
5008 crate::wire::Resolver<'static>,
5009 >(value, 6, encoder, raw, ())?,
5010
5011 Capability::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
5012 ___E,
5013 crate::wire::EventStream<'static>,
5014 >(value, 8, encoder, raw, ())?,
5015
5016 Capability::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
5017 ___E,
5018 crate::wire::Dictionary<'static>,
5019 >(value, 9, encoder, raw, ())?,
5020
5021 Capability::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
5022 ___E,
5023 crate::wire::Configuration<'static>,
5024 >(value, 10, encoder, raw, ())?,
5025
5026 Capability::UnknownOrdinal_(ordinal) => {
5027 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
5028 }
5029 }
5030
5031 Ok(())
5032 }
5033 }
5034
5035 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::Capability<'static>, ___E>
5036 for Capability
5037 where
5038 ___E: ?Sized,
5039 Capability: ::fidl_next::Encode<crate::wire::Capability<'static>, ___E>,
5040 {
5041 #[inline]
5042 fn encode_option(
5043 this: ::core::option::Option<Self>,
5044 encoder: &mut ___E,
5045 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Capability<'static>>,
5046 _: (),
5047 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5048 ::fidl_next::munge!(let crate::wire_optional::Capability { raw, _phantom: _ } = &mut *out);
5049
5050 if let Some(inner) = this {
5051 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
5052 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
5053 } else {
5054 ::fidl_next::RawWireUnion::encode_absent(raw);
5055 }
5056
5057 Ok(())
5058 }
5059 }
5060
5061 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::Capability<'static>, ___E>
5062 for &'a Capability
5063 where
5064 ___E: ?Sized,
5065 &'a Capability: ::fidl_next::Encode<crate::wire::Capability<'static>, ___E>,
5066 {
5067 #[inline]
5068 fn encode_option(
5069 this: ::core::option::Option<Self>,
5070 encoder: &mut ___E,
5071 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Capability<'static>>,
5072 _: (),
5073 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5074 ::fidl_next::munge!(let crate::wire_optional::Capability { raw, _phantom: _ } = &mut *out);
5075
5076 if let Some(inner) = this {
5077 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
5078 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
5079 } else {
5080 ::fidl_next::RawWireUnion::encode_absent(raw);
5081 }
5082
5083 Ok(())
5084 }
5085 }
5086
5087 impl<'de> ::fidl_next::FromWire<crate::wire::Capability<'de>> for Capability {
5088 #[inline]
5089 fn from_wire(wire: crate::wire::Capability<'de>) -> Self {
5090 let wire = ::core::mem::ManuallyDrop::new(wire);
5091 match wire.raw.ordinal() {
5092 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
5093 wire.raw.get().read_unchecked::<crate::wire::Service<'de>>()
5094 })),
5095
5096 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
5097 wire.raw.get().read_unchecked::<crate::wire::Protocol<'de>>()
5098 })),
5099
5100 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
5101 wire.raw.get().read_unchecked::<crate::wire::Directory<'de>>()
5102 })),
5103
5104 4 => Self::Storage(::fidl_next::FromWire::from_wire(unsafe {
5105 wire.raw.get().read_unchecked::<crate::wire::Storage<'de>>()
5106 })),
5107
5108 5 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
5109 wire.raw.get().read_unchecked::<crate::wire::Runner<'de>>()
5110 })),
5111
5112 6 => Self::Resolver(::fidl_next::FromWire::from_wire(unsafe {
5113 wire.raw.get().read_unchecked::<crate::wire::Resolver<'de>>()
5114 })),
5115
5116 8 => Self::EventStream(::fidl_next::FromWire::from_wire(unsafe {
5117 wire.raw.get().read_unchecked::<crate::wire::EventStream<'de>>()
5118 })),
5119
5120 9 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
5121 wire.raw.get().read_unchecked::<crate::wire::Dictionary<'de>>()
5122 })),
5123
5124 10 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
5125 wire.raw.get().read_unchecked::<crate::wire::Configuration<'de>>()
5126 })),
5127
5128 ord => return Self::UnknownOrdinal_(ord as u64),
5129 }
5130 }
5131 }
5132
5133 impl<'de> ::fidl_next::FromWireRef<crate::wire::Capability<'de>> for Capability {
5134 #[inline]
5135 fn from_wire_ref(wire: &crate::wire::Capability<'de>) -> Self {
5136 match wire.raw.ordinal() {
5137 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5138 wire.raw.get().deref_unchecked::<crate::wire::Service<'de>>()
5139 })),
5140
5141 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5142 wire.raw.get().deref_unchecked::<crate::wire::Protocol<'de>>()
5143 })),
5144
5145 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5146 wire.raw.get().deref_unchecked::<crate::wire::Directory<'de>>()
5147 })),
5148
5149 4 => Self::Storage(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5150 wire.raw.get().deref_unchecked::<crate::wire::Storage<'de>>()
5151 })),
5152
5153 5 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5154 wire.raw.get().deref_unchecked::<crate::wire::Runner<'de>>()
5155 })),
5156
5157 6 => Self::Resolver(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5158 wire.raw.get().deref_unchecked::<crate::wire::Resolver<'de>>()
5159 })),
5160
5161 8 => Self::EventStream(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5162 wire.raw.get().deref_unchecked::<crate::wire::EventStream<'de>>()
5163 })),
5164
5165 9 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5166 wire.raw.get().deref_unchecked::<crate::wire::Dictionary<'de>>()
5167 })),
5168
5169 10 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
5170 wire.raw.get().deref_unchecked::<crate::wire::Configuration<'de>>()
5171 })),
5172
5173 ord => return Self::UnknownOrdinal_(ord as u64),
5174 }
5175 }
5176 }
5177
5178 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Capability<'de>> for Capability {
5179 #[inline]
5180 fn from_wire_option(
5181 wire: crate::wire_optional::Capability<'de>,
5182 ) -> ::core::option::Option<Self> {
5183 if let Some(inner) = wire.into_option() {
5184 Some(::fidl_next::FromWire::from_wire(inner))
5185 } else {
5186 None
5187 }
5188 }
5189 }
5190
5191 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Capability<'de>> for Box<Capability> {
5192 #[inline]
5193 fn from_wire_option(
5194 wire: crate::wire_optional::Capability<'de>,
5195 ) -> ::core::option::Option<Self> {
5196 <
5197 Capability as ::fidl_next::FromWireOption<crate::wire_optional::Capability<'de>>
5198 >::from_wire_option(wire).map(Box::new)
5199 }
5200 }
5201
5202 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::Capability<'de>>
5203 for Box<Capability>
5204 {
5205 #[inline]
5206 fn from_wire_option_ref(
5207 wire: &crate::wire_optional::Capability<'de>,
5208 ) -> ::core::option::Option<Self> {
5209 if let Some(inner) = wire.as_ref() {
5210 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
5211 } else {
5212 None
5213 }
5214 }
5215 }
5216
5217 #[doc = " Describes under what conditions the component may be started.\n"]
5218 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
5219 #[repr(u32)]
5220 pub enum StartupMode {
5221 Lazy = 0,
5222 Eager = 1,
5223 }
5224 impl ::core::convert::TryFrom<u32> for StartupMode {
5225 type Error = ::fidl_next::UnknownStrictEnumMemberError;
5226 fn try_from(
5227 value: u32,
5228 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
5229 match value {
5230 0 => Ok(Self::Lazy),
5231 1 => Ok(Self::Eager),
5232
5233 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
5234 }
5235 }
5236 }
5237
5238 unsafe impl<___E> ::fidl_next::Encode<crate::wire::StartupMode, ___E> for StartupMode
5239 where
5240 ___E: ?Sized,
5241 {
5242 #[inline]
5243 fn encode(
5244 self,
5245 encoder: &mut ___E,
5246 out: &mut ::core::mem::MaybeUninit<crate::wire::StartupMode>,
5247 _: (),
5248 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5249 ::fidl_next::Encode::encode(&self, encoder, out, ())
5250 }
5251 }
5252
5253 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::StartupMode, ___E> for &'a StartupMode
5254 where
5255 ___E: ?Sized,
5256 {
5257 #[inline]
5258 fn encode(
5259 self,
5260 encoder: &mut ___E,
5261 out: &mut ::core::mem::MaybeUninit<crate::wire::StartupMode>,
5262 _: (),
5263 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5264 ::fidl_next::munge!(let crate::wire::StartupMode { value } = out);
5265 let _ = value.write(::fidl_next::WireU32::from(match *self {
5266 StartupMode::Lazy => 0,
5267
5268 StartupMode::Eager => 1,
5269 }));
5270
5271 Ok(())
5272 }
5273 }
5274
5275 impl ::core::convert::From<crate::wire::StartupMode> for StartupMode {
5276 fn from(wire: crate::wire::StartupMode) -> Self {
5277 match u32::from(wire.value) {
5278 0 => Self::Lazy,
5279
5280 1 => Self::Eager,
5281
5282 _ => unsafe { ::core::hint::unreachable_unchecked() },
5283 }
5284 }
5285 }
5286
5287 impl ::fidl_next::FromWire<crate::wire::StartupMode> for StartupMode {
5288 #[inline]
5289 fn from_wire(wire: crate::wire::StartupMode) -> Self {
5290 Self::from(wire)
5291 }
5292 }
5293
5294 impl ::fidl_next::FromWireRef<crate::wire::StartupMode> for StartupMode {
5295 #[inline]
5296 fn from_wire_ref(wire: &crate::wire::StartupMode) -> Self {
5297 Self::from(*wire)
5298 }
5299 }
5300
5301 #[doc = " Describes the action to take if this component instance terminates\n unexpectedly.\n"]
5302 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
5303 #[repr(u32)]
5304 pub enum OnTerminate {
5305 None = 0,
5306 Reboot = 1,
5307 }
5308 impl ::core::convert::TryFrom<u32> for OnTerminate {
5309 type Error = ::fidl_next::UnknownStrictEnumMemberError;
5310 fn try_from(
5311 value: u32,
5312 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
5313 match value {
5314 0 => Ok(Self::None),
5315 1 => Ok(Self::Reboot),
5316
5317 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
5318 }
5319 }
5320 }
5321
5322 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OnTerminate, ___E> for OnTerminate
5323 where
5324 ___E: ?Sized,
5325 {
5326 #[inline]
5327 fn encode(
5328 self,
5329 encoder: &mut ___E,
5330 out: &mut ::core::mem::MaybeUninit<crate::wire::OnTerminate>,
5331 _: (),
5332 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5333 ::fidl_next::Encode::encode(&self, encoder, out, ())
5334 }
5335 }
5336
5337 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OnTerminate, ___E> for &'a OnTerminate
5338 where
5339 ___E: ?Sized,
5340 {
5341 #[inline]
5342 fn encode(
5343 self,
5344 encoder: &mut ___E,
5345 out: &mut ::core::mem::MaybeUninit<crate::wire::OnTerminate>,
5346 _: (),
5347 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5348 ::fidl_next::munge!(let crate::wire::OnTerminate { value } = out);
5349 let _ = value.write(::fidl_next::WireU32::from(match *self {
5350 OnTerminate::None => 0,
5351
5352 OnTerminate::Reboot => 1,
5353 }));
5354
5355 Ok(())
5356 }
5357 }
5358
5359 impl ::core::convert::From<crate::wire::OnTerminate> for OnTerminate {
5360 fn from(wire: crate::wire::OnTerminate) -> Self {
5361 match u32::from(wire.value) {
5362 0 => Self::None,
5363
5364 1 => Self::Reboot,
5365
5366 _ => unsafe { ::core::hint::unreachable_unchecked() },
5367 }
5368 }
5369 }
5370
5371 impl ::fidl_next::FromWire<crate::wire::OnTerminate> for OnTerminate {
5372 #[inline]
5373 fn from_wire(wire: crate::wire::OnTerminate) -> Self {
5374 Self::from(wire)
5375 }
5376 }
5377
5378 impl ::fidl_next::FromWireRef<crate::wire::OnTerminate> for OnTerminate {
5379 #[inline]
5380 fn from_wire_ref(wire: &crate::wire::OnTerminate) -> Self {
5381 Self::from(*wire)
5382 }
5383 }
5384
5385 #[doc = " The string identifier for a config field.\n"]
5386 pub type ConfigKey = ::std::string::String;
5387
5388 #[doc = " A directive to override the value of a particular configuration field in the child.\n"]
5389 #[derive(PartialEq, Clone, Debug, Default)]
5390 pub struct ConfigOverride {
5391 pub key: ::core::option::Option<::std::string::String>,
5392
5393 pub value: ::core::option::Option<crate::natural::ConfigValue>,
5394 }
5395
5396 impl ConfigOverride {
5397 fn __max_ordinal(&self) -> usize {
5398 if self.value.is_some() {
5399 return 2;
5400 }
5401
5402 if self.key.is_some() {
5403 return 1;
5404 }
5405
5406 0
5407 }
5408 }
5409
5410 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigOverride<'static>, ___E> for ConfigOverride
5411 where
5412 ___E: ::fidl_next::Encoder + ?Sized,
5413 {
5414 #[inline]
5415 fn encode(
5416 mut self,
5417 encoder: &mut ___E,
5418 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigOverride<'static>>,
5419 _: (),
5420 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5421 ::fidl_next::munge!(let crate::wire::ConfigOverride { table } = out);
5422
5423 let max_ord = self.__max_ordinal();
5424
5425 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5426 ::fidl_next::Wire::zero_padding(&mut out);
5427
5428 let mut preallocated =
5429 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5430
5431 for i in 1..=max_ord {
5432 match i {
5433 2 => {
5434 if let Some(value) = self.value.take() {
5435 ::fidl_next::WireEnvelope::encode_value::<
5436 crate::wire::ConfigValue<'static>,
5437 ___E,
5438 >(
5439 value, preallocated.encoder, &mut out, ()
5440 )?;
5441 } else {
5442 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5443 }
5444 }
5445
5446 1 => {
5447 if let Some(value) = self.key.take() {
5448 ::fidl_next::WireEnvelope::encode_value::<
5449 ::fidl_next::WireString<'static>,
5450 ___E,
5451 >(
5452 value, preallocated.encoder, &mut out, 64
5453 )?;
5454 } else {
5455 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5456 }
5457 }
5458
5459 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5460 }
5461 unsafe {
5462 preallocated.write_next(out.assume_init_ref());
5463 }
5464 }
5465
5466 ::fidl_next::WireTable::encode_len(table, max_ord);
5467
5468 Ok(())
5469 }
5470 }
5471
5472 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigOverride<'static>, ___E>
5473 for &'a ConfigOverride
5474 where
5475 ___E: ::fidl_next::Encoder + ?Sized,
5476 {
5477 #[inline]
5478 fn encode(
5479 self,
5480 encoder: &mut ___E,
5481 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigOverride<'static>>,
5482 _: (),
5483 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5484 ::fidl_next::munge!(let crate::wire::ConfigOverride { table } = out);
5485
5486 let max_ord = self.__max_ordinal();
5487
5488 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5489 ::fidl_next::Wire::zero_padding(&mut out);
5490
5491 let mut preallocated =
5492 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5493
5494 for i in 1..=max_ord {
5495 match i {
5496 2 => {
5497 if let Some(value) = &self.value {
5498 ::fidl_next::WireEnvelope::encode_value::<
5499 crate::wire::ConfigValue<'static>,
5500 ___E,
5501 >(
5502 value, preallocated.encoder, &mut out, ()
5503 )?;
5504 } else {
5505 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5506 }
5507 }
5508
5509 1 => {
5510 if let Some(value) = &self.key {
5511 ::fidl_next::WireEnvelope::encode_value::<
5512 ::fidl_next::WireString<'static>,
5513 ___E,
5514 >(
5515 value, preallocated.encoder, &mut out, 64
5516 )?;
5517 } else {
5518 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5519 }
5520 }
5521
5522 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5523 }
5524 unsafe {
5525 preallocated.write_next(out.assume_init_ref());
5526 }
5527 }
5528
5529 ::fidl_next::WireTable::encode_len(table, max_ord);
5530
5531 Ok(())
5532 }
5533 }
5534
5535 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigOverride<'de>> for ConfigOverride {
5536 #[inline]
5537 fn from_wire(wire_: crate::wire::ConfigOverride<'de>) -> Self {
5538 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5539
5540 let key = wire_.table.get(1);
5541
5542 let value = wire_.table.get(2);
5543
5544 Self {
5545 key: key.map(|envelope| {
5546 ::fidl_next::FromWire::from_wire(unsafe {
5547 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
5548 })
5549 }),
5550
5551 value: value.map(|envelope| {
5552 ::fidl_next::FromWire::from_wire(unsafe {
5553 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
5554 })
5555 }),
5556 }
5557 }
5558 }
5559
5560 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigOverride<'de>> for ConfigOverride {
5561 #[inline]
5562 fn from_wire_ref(wire: &crate::wire::ConfigOverride<'de>) -> Self {
5563 Self {
5564 key: wire.table.get(1).map(|envelope| {
5565 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5566 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
5567 })
5568 }),
5569
5570 value: wire.table.get(2).map(|envelope| {
5571 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
5572 envelope.deref_unchecked::<crate::wire::ConfigValue<'de>>()
5573 })
5574 }),
5575 }
5576 }
5577 }
5578
5579 #[doc = " Statically declares a child component instance.\n"]
5580 #[derive(PartialEq, Clone, Debug, Default)]
5581 pub struct Child {
5582 pub name: ::core::option::Option<::std::string::String>,
5583
5584 pub url: ::core::option::Option<::std::string::String>,
5585
5586 pub startup: ::core::option::Option<crate::natural::StartupMode>,
5587
5588 pub environment: ::core::option::Option<::std::string::String>,
5589
5590 pub on_terminate: ::core::option::Option<crate::natural::OnTerminate>,
5591
5592 pub config_overrides:
5593 ::core::option::Option<::std::vec::Vec<crate::natural::ConfigOverride>>,
5594 }
5595
5596 impl Child {
5597 fn __max_ordinal(&self) -> usize {
5598 if self.config_overrides.is_some() {
5599 return 6;
5600 }
5601
5602 if self.on_terminate.is_some() {
5603 return 5;
5604 }
5605
5606 if self.environment.is_some() {
5607 return 4;
5608 }
5609
5610 if self.startup.is_some() {
5611 return 3;
5612 }
5613
5614 if self.url.is_some() {
5615 return 2;
5616 }
5617
5618 if self.name.is_some() {
5619 return 1;
5620 }
5621
5622 0
5623 }
5624 }
5625
5626 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Child<'static>, ___E> for Child
5627 where
5628 ___E: ::fidl_next::Encoder + ?Sized,
5629 {
5630 #[inline]
5631 fn encode(
5632 mut self,
5633 encoder: &mut ___E,
5634 out: &mut ::core::mem::MaybeUninit<crate::wire::Child<'static>>,
5635 _: (),
5636 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5637 ::fidl_next::munge!(let crate::wire::Child { table } = out);
5638
5639 let max_ord = self.__max_ordinal();
5640
5641 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5642 ::fidl_next::Wire::zero_padding(&mut out);
5643
5644 let mut preallocated =
5645 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5646
5647 for i in 1..=max_ord {
5648 match i {
5649 6 => {
5650 if let Some(value) = self.config_overrides.take() {
5651 ::fidl_next::WireEnvelope::encode_value::<
5652 ::fidl_next::WireVector<
5653 'static,
5654 crate::wire::ConfigOverride<'static>,
5655 >,
5656 ___E,
5657 >(
5658 value, preallocated.encoder, &mut out, (4294967295, ())
5659 )?;
5660 } else {
5661 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5662 }
5663 }
5664
5665 5 => {
5666 if let Some(value) = self.on_terminate.take() {
5667 ::fidl_next::WireEnvelope::encode_value::<
5668 crate::wire::OnTerminate,
5669 ___E,
5670 >(
5671 value, preallocated.encoder, &mut out, ()
5672 )?;
5673 } else {
5674 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5675 }
5676 }
5677
5678 4 => {
5679 if let Some(value) = self.environment.take() {
5680 ::fidl_next::WireEnvelope::encode_value::<
5681 ::fidl_next::WireString<'static>,
5682 ___E,
5683 >(
5684 value, preallocated.encoder, &mut out, 100
5685 )?;
5686 } else {
5687 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5688 }
5689 }
5690
5691 3 => {
5692 if let Some(value) = self.startup.take() {
5693 ::fidl_next::WireEnvelope::encode_value::<
5694 crate::wire::StartupMode,
5695 ___E,
5696 >(
5697 value, preallocated.encoder, &mut out, ()
5698 )?;
5699 } else {
5700 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5701 }
5702 }
5703
5704 2 => {
5705 if let Some(value) = self.url.take() {
5706 ::fidl_next::WireEnvelope::encode_value::<
5707 ::fidl_next::WireString<'static>,
5708 ___E,
5709 >(
5710 value, preallocated.encoder, &mut out, 4096
5711 )?;
5712 } else {
5713 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5714 }
5715 }
5716
5717 1 => {
5718 if let Some(value) = self.name.take() {
5719 ::fidl_next::WireEnvelope::encode_value::<
5720 ::fidl_next::WireString<'static>,
5721 ___E,
5722 >(
5723 value, preallocated.encoder, &mut out, 1024
5724 )?;
5725 } else {
5726 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5727 }
5728 }
5729
5730 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5731 }
5732 unsafe {
5733 preallocated.write_next(out.assume_init_ref());
5734 }
5735 }
5736
5737 ::fidl_next::WireTable::encode_len(table, max_ord);
5738
5739 Ok(())
5740 }
5741 }
5742
5743 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Child<'static>, ___E> for &'a Child
5744 where
5745 ___E: ::fidl_next::Encoder + ?Sized,
5746 {
5747 #[inline]
5748 fn encode(
5749 self,
5750 encoder: &mut ___E,
5751 out: &mut ::core::mem::MaybeUninit<crate::wire::Child<'static>>,
5752 _: (),
5753 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5754 ::fidl_next::munge!(let crate::wire::Child { table } = out);
5755
5756 let max_ord = self.__max_ordinal();
5757
5758 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5759 ::fidl_next::Wire::zero_padding(&mut out);
5760
5761 let mut preallocated =
5762 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5763
5764 for i in 1..=max_ord {
5765 match i {
5766 6 => {
5767 if let Some(value) = &self.config_overrides {
5768 ::fidl_next::WireEnvelope::encode_value::<
5769 ::fidl_next::WireVector<
5770 'static,
5771 crate::wire::ConfigOverride<'static>,
5772 >,
5773 ___E,
5774 >(
5775 value, preallocated.encoder, &mut out, (4294967295, ())
5776 )?;
5777 } else {
5778 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5779 }
5780 }
5781
5782 5 => {
5783 if let Some(value) = &self.on_terminate {
5784 ::fidl_next::WireEnvelope::encode_value::<
5785 crate::wire::OnTerminate,
5786 ___E,
5787 >(
5788 value, preallocated.encoder, &mut out, ()
5789 )?;
5790 } else {
5791 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5792 }
5793 }
5794
5795 4 => {
5796 if let Some(value) = &self.environment {
5797 ::fidl_next::WireEnvelope::encode_value::<
5798 ::fidl_next::WireString<'static>,
5799 ___E,
5800 >(
5801 value, preallocated.encoder, &mut out, 100
5802 )?;
5803 } else {
5804 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5805 }
5806 }
5807
5808 3 => {
5809 if let Some(value) = &self.startup {
5810 ::fidl_next::WireEnvelope::encode_value::<
5811 crate::wire::StartupMode,
5812 ___E,
5813 >(
5814 value, preallocated.encoder, &mut out, ()
5815 )?;
5816 } else {
5817 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5818 }
5819 }
5820
5821 2 => {
5822 if let Some(value) = &self.url {
5823 ::fidl_next::WireEnvelope::encode_value::<
5824 ::fidl_next::WireString<'static>,
5825 ___E,
5826 >(
5827 value, preallocated.encoder, &mut out, 4096
5828 )?;
5829 } else {
5830 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5831 }
5832 }
5833
5834 1 => {
5835 if let Some(value) = &self.name {
5836 ::fidl_next::WireEnvelope::encode_value::<
5837 ::fidl_next::WireString<'static>,
5838 ___E,
5839 >(
5840 value, preallocated.encoder, &mut out, 1024
5841 )?;
5842 } else {
5843 ::fidl_next::WireEnvelope::encode_zero(&mut out)
5844 }
5845 }
5846
5847 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5848 }
5849 unsafe {
5850 preallocated.write_next(out.assume_init_ref());
5851 }
5852 }
5853
5854 ::fidl_next::WireTable::encode_len(table, max_ord);
5855
5856 Ok(())
5857 }
5858 }
5859
5860 impl<'de> ::fidl_next::FromWire<crate::wire::Child<'de>> for Child {
5861 #[inline]
5862 fn from_wire(wire_: crate::wire::Child<'de>) -> Self {
5863 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
5864
5865 let name = wire_.table.get(1);
5866
5867 let url = wire_.table.get(2);
5868
5869 let startup = wire_.table.get(3);
5870
5871 let environment = wire_.table.get(4);
5872
5873 let on_terminate = wire_.table.get(5);
5874
5875 let config_overrides = wire_.table.get(6);
5876
5877 Self {
5878
5879
5880 name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
5881 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
5882 )),
5883
5884
5885 url: url.map(|envelope| ::fidl_next::FromWire::from_wire(
5886 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
5887 )),
5888
5889
5890 startup: startup.map(|envelope| ::fidl_next::FromWire::from_wire(
5891 unsafe { envelope.read_unchecked::<crate::wire::StartupMode>() }
5892 )),
5893
5894
5895 environment: environment.map(|envelope| ::fidl_next::FromWire::from_wire(
5896 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
5897 )),
5898
5899
5900 on_terminate: on_terminate.map(|envelope| ::fidl_next::FromWire::from_wire(
5901 unsafe { envelope.read_unchecked::<crate::wire::OnTerminate>() }
5902 )),
5903
5904
5905 config_overrides: config_overrides.map(|envelope| ::fidl_next::FromWire::from_wire(
5906 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::ConfigOverride<'de>>>() }
5907 )),
5908
5909 }
5910 }
5911 }
5912
5913 impl<'de> ::fidl_next::FromWireRef<crate::wire::Child<'de>> for Child {
5914 #[inline]
5915 fn from_wire_ref(wire: &crate::wire::Child<'de>) -> Self {
5916 Self {
5917
5918
5919 name: wire.table.get(1)
5920 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5921 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
5922 )),
5923
5924
5925 url: wire.table.get(2)
5926 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5927 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
5928 )),
5929
5930
5931 startup: wire.table.get(3)
5932 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5933 unsafe { envelope.deref_unchecked::<crate::wire::StartupMode>() }
5934 )),
5935
5936
5937 environment: wire.table.get(4)
5938 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5939 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
5940 )),
5941
5942
5943 on_terminate: wire.table.get(5)
5944 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5945 unsafe { envelope.deref_unchecked::<crate::wire::OnTerminate>() }
5946 )),
5947
5948
5949 config_overrides: wire.table.get(6)
5950 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
5951 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::wire::ConfigOverride<'de>>>() }
5952 )),
5953
5954 }
5955 }
5956 }
5957
5958 #[doc = " The durability of component instances created in a collection.\n"]
5959 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
5960 #[repr(u32)]
5961 pub enum Durability {
5962 Transient = 2,
5963 SingleRun = 3,
5964 }
5965 impl ::core::convert::TryFrom<u32> for Durability {
5966 type Error = ::fidl_next::UnknownStrictEnumMemberError;
5967 fn try_from(
5968 value: u32,
5969 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
5970 match value {
5971 2 => Ok(Self::Transient),
5972 3 => Ok(Self::SingleRun),
5973
5974 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
5975 }
5976 }
5977 }
5978
5979 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Durability, ___E> for Durability
5980 where
5981 ___E: ?Sized,
5982 {
5983 #[inline]
5984 fn encode(
5985 self,
5986 encoder: &mut ___E,
5987 out: &mut ::core::mem::MaybeUninit<crate::wire::Durability>,
5988 _: (),
5989 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
5990 ::fidl_next::Encode::encode(&self, encoder, out, ())
5991 }
5992 }
5993
5994 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Durability, ___E> for &'a Durability
5995 where
5996 ___E: ?Sized,
5997 {
5998 #[inline]
5999 fn encode(
6000 self,
6001 encoder: &mut ___E,
6002 out: &mut ::core::mem::MaybeUninit<crate::wire::Durability>,
6003 _: (),
6004 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6005 ::fidl_next::munge!(let crate::wire::Durability { value } = out);
6006 let _ = value.write(::fidl_next::WireU32::from(match *self {
6007 Durability::Transient => 2,
6008
6009 Durability::SingleRun => 3,
6010 }));
6011
6012 Ok(())
6013 }
6014 }
6015
6016 impl ::core::convert::From<crate::wire::Durability> for Durability {
6017 fn from(wire: crate::wire::Durability) -> Self {
6018 match u32::from(wire.value) {
6019 2 => Self::Transient,
6020
6021 3 => Self::SingleRun,
6022
6023 _ => unsafe { ::core::hint::unreachable_unchecked() },
6024 }
6025 }
6026 }
6027
6028 impl ::fidl_next::FromWire<crate::wire::Durability> for Durability {
6029 #[inline]
6030 fn from_wire(wire: crate::wire::Durability) -> Self {
6031 Self::from(wire)
6032 }
6033 }
6034
6035 impl ::fidl_next::FromWireRef<crate::wire::Durability> for Durability {
6036 #[inline]
6037 fn from_wire_ref(wire: &crate::wire::Durability) -> Self {
6038 Self::from(*wire)
6039 }
6040 }
6041
6042 #[doc = " Statically declares a component instance collection.\n"]
6043 #[derive(PartialEq, Clone, Debug, Default)]
6044 pub struct Collection {
6045 pub name: ::core::option::Option<::std::string::String>,
6046
6047 pub durability: ::core::option::Option<crate::natural::Durability>,
6048
6049 pub environment: ::core::option::Option<::std::string::String>,
6050
6051 pub allowed_offers: ::core::option::Option<crate::natural::AllowedOffers>,
6052
6053 pub allow_long_names: ::core::option::Option<bool>,
6054
6055 pub persistent_storage: ::core::option::Option<bool>,
6056 }
6057
6058 impl Collection {
6059 fn __max_ordinal(&self) -> usize {
6060 if self.persistent_storage.is_some() {
6061 return 6;
6062 }
6063
6064 if self.allow_long_names.is_some() {
6065 return 5;
6066 }
6067
6068 if self.allowed_offers.is_some() {
6069 return 4;
6070 }
6071
6072 if self.environment.is_some() {
6073 return 3;
6074 }
6075
6076 if self.durability.is_some() {
6077 return 2;
6078 }
6079
6080 if self.name.is_some() {
6081 return 1;
6082 }
6083
6084 0
6085 }
6086 }
6087
6088 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Collection<'static>, ___E> for Collection
6089 where
6090 ___E: ::fidl_next::Encoder + ?Sized,
6091 {
6092 #[inline]
6093 fn encode(
6094 mut self,
6095 encoder: &mut ___E,
6096 out: &mut ::core::mem::MaybeUninit<crate::wire::Collection<'static>>,
6097 _: (),
6098 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6099 ::fidl_next::munge!(let crate::wire::Collection { table } = out);
6100
6101 let max_ord = self.__max_ordinal();
6102
6103 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
6104 ::fidl_next::Wire::zero_padding(&mut out);
6105
6106 let mut preallocated =
6107 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
6108
6109 for i in 1..=max_ord {
6110 match i {
6111 6 => {
6112 if let Some(value) = self.persistent_storage.take() {
6113 ::fidl_next::WireEnvelope::encode_value::<bool, ___E>(
6114 value,
6115 preallocated.encoder,
6116 &mut out,
6117 (),
6118 )?;
6119 } else {
6120 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6121 }
6122 }
6123
6124 5 => {
6125 if let Some(value) = self.allow_long_names.take() {
6126 ::fidl_next::WireEnvelope::encode_value::<bool, ___E>(
6127 value,
6128 preallocated.encoder,
6129 &mut out,
6130 (),
6131 )?;
6132 } else {
6133 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6134 }
6135 }
6136
6137 4 => {
6138 if let Some(value) = self.allowed_offers.take() {
6139 ::fidl_next::WireEnvelope::encode_value::<
6140 crate::wire::AllowedOffers,
6141 ___E,
6142 >(
6143 value, preallocated.encoder, &mut out, ()
6144 )?;
6145 } else {
6146 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6147 }
6148 }
6149
6150 3 => {
6151 if let Some(value) = self.environment.take() {
6152 ::fidl_next::WireEnvelope::encode_value::<
6153 ::fidl_next::WireString<'static>,
6154 ___E,
6155 >(
6156 value, preallocated.encoder, &mut out, 100
6157 )?;
6158 } else {
6159 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6160 }
6161 }
6162
6163 2 => {
6164 if let Some(value) = self.durability.take() {
6165 ::fidl_next::WireEnvelope::encode_value::<crate::wire::Durability, ___E>(
6166 value,
6167 preallocated.encoder,
6168 &mut out,
6169 (),
6170 )?;
6171 } else {
6172 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6173 }
6174 }
6175
6176 1 => {
6177 if let Some(value) = self.name.take() {
6178 ::fidl_next::WireEnvelope::encode_value::<
6179 ::fidl_next::WireString<'static>,
6180 ___E,
6181 >(
6182 value, preallocated.encoder, &mut out, 100
6183 )?;
6184 } else {
6185 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6186 }
6187 }
6188
6189 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
6190 }
6191 unsafe {
6192 preallocated.write_next(out.assume_init_ref());
6193 }
6194 }
6195
6196 ::fidl_next::WireTable::encode_len(table, max_ord);
6197
6198 Ok(())
6199 }
6200 }
6201
6202 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Collection<'static>, ___E> for &'a Collection
6203 where
6204 ___E: ::fidl_next::Encoder + ?Sized,
6205 {
6206 #[inline]
6207 fn encode(
6208 self,
6209 encoder: &mut ___E,
6210 out: &mut ::core::mem::MaybeUninit<crate::wire::Collection<'static>>,
6211 _: (),
6212 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6213 ::fidl_next::munge!(let crate::wire::Collection { table } = out);
6214
6215 let max_ord = self.__max_ordinal();
6216
6217 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
6218 ::fidl_next::Wire::zero_padding(&mut out);
6219
6220 let mut preallocated =
6221 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
6222
6223 for i in 1..=max_ord {
6224 match i {
6225 6 => {
6226 if let Some(value) = &self.persistent_storage {
6227 ::fidl_next::WireEnvelope::encode_value::<bool, ___E>(
6228 value,
6229 preallocated.encoder,
6230 &mut out,
6231 (),
6232 )?;
6233 } else {
6234 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6235 }
6236 }
6237
6238 5 => {
6239 if let Some(value) = &self.allow_long_names {
6240 ::fidl_next::WireEnvelope::encode_value::<bool, ___E>(
6241 value,
6242 preallocated.encoder,
6243 &mut out,
6244 (),
6245 )?;
6246 } else {
6247 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6248 }
6249 }
6250
6251 4 => {
6252 if let Some(value) = &self.allowed_offers {
6253 ::fidl_next::WireEnvelope::encode_value::<
6254 crate::wire::AllowedOffers,
6255 ___E,
6256 >(
6257 value, preallocated.encoder, &mut out, ()
6258 )?;
6259 } else {
6260 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6261 }
6262 }
6263
6264 3 => {
6265 if let Some(value) = &self.environment {
6266 ::fidl_next::WireEnvelope::encode_value::<
6267 ::fidl_next::WireString<'static>,
6268 ___E,
6269 >(
6270 value, preallocated.encoder, &mut out, 100
6271 )?;
6272 } else {
6273 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6274 }
6275 }
6276
6277 2 => {
6278 if let Some(value) = &self.durability {
6279 ::fidl_next::WireEnvelope::encode_value::<crate::wire::Durability, ___E>(
6280 value,
6281 preallocated.encoder,
6282 &mut out,
6283 (),
6284 )?;
6285 } else {
6286 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6287 }
6288 }
6289
6290 1 => {
6291 if let Some(value) = &self.name {
6292 ::fidl_next::WireEnvelope::encode_value::<
6293 ::fidl_next::WireString<'static>,
6294 ___E,
6295 >(
6296 value, preallocated.encoder, &mut out, 100
6297 )?;
6298 } else {
6299 ::fidl_next::WireEnvelope::encode_zero(&mut out)
6300 }
6301 }
6302
6303 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
6304 }
6305 unsafe {
6306 preallocated.write_next(out.assume_init_ref());
6307 }
6308 }
6309
6310 ::fidl_next::WireTable::encode_len(table, max_ord);
6311
6312 Ok(())
6313 }
6314 }
6315
6316 impl<'de> ::fidl_next::FromWire<crate::wire::Collection<'de>> for Collection {
6317 #[inline]
6318 fn from_wire(wire_: crate::wire::Collection<'de>) -> Self {
6319 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
6320
6321 let name = wire_.table.get(1);
6322
6323 let durability = wire_.table.get(2);
6324
6325 let environment = wire_.table.get(3);
6326
6327 let allowed_offers = wire_.table.get(4);
6328
6329 let allow_long_names = wire_.table.get(5);
6330
6331 let persistent_storage = wire_.table.get(6);
6332
6333 Self {
6334 name: name.map(|envelope| {
6335 ::fidl_next::FromWire::from_wire(unsafe {
6336 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
6337 })
6338 }),
6339
6340 durability: durability.map(|envelope| {
6341 ::fidl_next::FromWire::from_wire(unsafe {
6342 envelope.read_unchecked::<crate::wire::Durability>()
6343 })
6344 }),
6345
6346 environment: environment.map(|envelope| {
6347 ::fidl_next::FromWire::from_wire(unsafe {
6348 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
6349 })
6350 }),
6351
6352 allowed_offers: allowed_offers.map(|envelope| {
6353 ::fidl_next::FromWire::from_wire(unsafe {
6354 envelope.read_unchecked::<crate::wire::AllowedOffers>()
6355 })
6356 }),
6357
6358 allow_long_names: allow_long_names.map(|envelope| {
6359 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
6360 }),
6361
6362 persistent_storage: persistent_storage.map(|envelope| {
6363 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<bool>() })
6364 }),
6365 }
6366 }
6367 }
6368
6369 impl<'de> ::fidl_next::FromWireRef<crate::wire::Collection<'de>> for Collection {
6370 #[inline]
6371 fn from_wire_ref(wire: &crate::wire::Collection<'de>) -> Self {
6372 Self {
6373 name: wire.table.get(1).map(|envelope| {
6374 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6375 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
6376 })
6377 }),
6378
6379 durability: wire.table.get(2).map(|envelope| {
6380 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6381 envelope.deref_unchecked::<crate::wire::Durability>()
6382 })
6383 }),
6384
6385 environment: wire.table.get(3).map(|envelope| {
6386 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6387 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
6388 })
6389 }),
6390
6391 allowed_offers: wire.table.get(4).map(|envelope| {
6392 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6393 envelope.deref_unchecked::<crate::wire::AllowedOffers>()
6394 })
6395 }),
6396
6397 allow_long_names: wire.table.get(5).map(|envelope| {
6398 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6399 envelope.deref_unchecked::<bool>()
6400 })
6401 }),
6402
6403 persistent_storage: wire.table.get(6).map(|envelope| {
6404 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
6405 envelope.deref_unchecked::<bool>()
6406 })
6407 }),
6408 }
6409 }
6410 }
6411
6412 #[doc = " Describes the type of dependency implied by the capability.\n"]
6413 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
6414 #[repr(u32)]
6415 pub enum DependencyType {
6416 Strong = 1,
6417 Weak = 2,
6418 }
6419 impl ::core::convert::TryFrom<u32> for DependencyType {
6420 type Error = ::fidl_next::UnknownStrictEnumMemberError;
6421 fn try_from(
6422 value: u32,
6423 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
6424 match value {
6425 1 => Ok(Self::Strong),
6426 2 => Ok(Self::Weak),
6427
6428 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
6429 }
6430 }
6431 }
6432
6433 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DependencyType, ___E> for DependencyType
6434 where
6435 ___E: ?Sized,
6436 {
6437 #[inline]
6438 fn encode(
6439 self,
6440 encoder: &mut ___E,
6441 out: &mut ::core::mem::MaybeUninit<crate::wire::DependencyType>,
6442 _: (),
6443 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6444 ::fidl_next::Encode::encode(&self, encoder, out, ())
6445 }
6446 }
6447
6448 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DependencyType, ___E> for &'a DependencyType
6449 where
6450 ___E: ?Sized,
6451 {
6452 #[inline]
6453 fn encode(
6454 self,
6455 encoder: &mut ___E,
6456 out: &mut ::core::mem::MaybeUninit<crate::wire::DependencyType>,
6457 _: (),
6458 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6459 ::fidl_next::munge!(let crate::wire::DependencyType { value } = out);
6460 let _ = value.write(::fidl_next::WireU32::from(match *self {
6461 DependencyType::Strong => 1,
6462
6463 DependencyType::Weak => 2,
6464 }));
6465
6466 Ok(())
6467 }
6468 }
6469
6470 impl ::core::convert::From<crate::wire::DependencyType> for DependencyType {
6471 fn from(wire: crate::wire::DependencyType) -> Self {
6472 match u32::from(wire.value) {
6473 1 => Self::Strong,
6474
6475 2 => Self::Weak,
6476
6477 _ => unsafe { ::core::hint::unreachable_unchecked() },
6478 }
6479 }
6480 }
6481
6482 impl ::fidl_next::FromWire<crate::wire::DependencyType> for DependencyType {
6483 #[inline]
6484 fn from_wire(wire: crate::wire::DependencyType) -> Self {
6485 Self::from(wire)
6486 }
6487 }
6488
6489 impl ::fidl_next::FromWireRef<crate::wire::DependencyType> for DependencyType {
6490 #[inline]
6491 fn from_wire_ref(wire: &crate::wire::DependencyType) -> Self {
6492 Self::from(*wire)
6493 }
6494 }
6495
6496 #[doc = " Type used to create a mapping between 2 names. Used to rename service or component instances\n in FIDL declarations.\n"]
6497 #[derive(PartialEq, Clone, Debug)]
6498 pub struct NameMapping {
6499 pub source_name: ::std::string::String,
6500
6501 pub target_name: ::std::string::String,
6502 }
6503
6504 unsafe impl<___E> ::fidl_next::Encode<crate::wire::NameMapping<'static>, ___E> for NameMapping
6505 where
6506 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6507 ___E: ::fidl_next::Encoder,
6508 {
6509 #[inline]
6510 fn encode(
6511 self,
6512 encoder_: &mut ___E,
6513 out_: &mut ::core::mem::MaybeUninit<crate::wire::NameMapping<'static>>,
6514 _: (),
6515 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6516 ::fidl_next::munge! {
6517 let crate::wire::NameMapping {
6518 source_name,
6519 target_name,
6520
6521 } = out_;
6522 }
6523
6524 ::fidl_next::Encode::encode(self.source_name, encoder_, source_name, 100)?;
6525
6526 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(source_name.as_mut_ptr()) };
6527 ::fidl_next::Constrained::validate(_field, 100)?;
6528
6529 ::fidl_next::Encode::encode(self.target_name, encoder_, target_name, 100)?;
6530
6531 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(target_name.as_mut_ptr()) };
6532 ::fidl_next::Constrained::validate(_field, 100)?;
6533
6534 Ok(())
6535 }
6536 }
6537
6538 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::NameMapping<'static>, ___E>
6539 for &'a NameMapping
6540 where
6541 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6542 ___E: ::fidl_next::Encoder,
6543 {
6544 #[inline]
6545 fn encode(
6546 self,
6547 encoder_: &mut ___E,
6548 out_: &mut ::core::mem::MaybeUninit<crate::wire::NameMapping<'static>>,
6549 _: (),
6550 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6551 ::fidl_next::munge! {
6552 let crate::wire::NameMapping {
6553
6554 source_name,
6555 target_name,
6556
6557 } = out_;
6558 }
6559
6560 ::fidl_next::Encode::encode(&self.source_name, encoder_, source_name, 100)?;
6561
6562 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(source_name.as_mut_ptr()) };
6563 ::fidl_next::Constrained::validate(_field, 100)?;
6564
6565 ::fidl_next::Encode::encode(&self.target_name, encoder_, target_name, 100)?;
6566
6567 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(target_name.as_mut_ptr()) };
6568 ::fidl_next::Constrained::validate(_field, 100)?;
6569
6570 Ok(())
6571 }
6572 }
6573
6574 unsafe impl<___E>
6575 ::fidl_next::EncodeOption<
6576 ::fidl_next::WireBox<'static, crate::wire::NameMapping<'static>>,
6577 ___E,
6578 > for NameMapping
6579 where
6580 ___E: ::fidl_next::Encoder + ?Sized,
6581 NameMapping: ::fidl_next::Encode<crate::wire::NameMapping<'static>, ___E>,
6582 {
6583 #[inline]
6584 fn encode_option(
6585 this: ::core::option::Option<Self>,
6586 encoder: &mut ___E,
6587 out: &mut ::core::mem::MaybeUninit<
6588 ::fidl_next::WireBox<'static, crate::wire::NameMapping<'static>>,
6589 >,
6590 _: (),
6591 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6592 if let Some(inner) = this {
6593 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
6594 ::fidl_next::WireBox::encode_present(out);
6595 } else {
6596 ::fidl_next::WireBox::encode_absent(out);
6597 }
6598
6599 Ok(())
6600 }
6601 }
6602
6603 unsafe impl<'a, ___E>
6604 ::fidl_next::EncodeOption<
6605 ::fidl_next::WireBox<'static, crate::wire::NameMapping<'static>>,
6606 ___E,
6607 > for &'a NameMapping
6608 where
6609 ___E: ::fidl_next::Encoder + ?Sized,
6610 &'a NameMapping: ::fidl_next::Encode<crate::wire::NameMapping<'static>, ___E>,
6611 {
6612 #[inline]
6613 fn encode_option(
6614 this: ::core::option::Option<Self>,
6615 encoder: &mut ___E,
6616 out: &mut ::core::mem::MaybeUninit<
6617 ::fidl_next::WireBox<'static, crate::wire::NameMapping<'static>>,
6618 >,
6619 _: (),
6620 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6621 if let Some(inner) = this {
6622 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
6623 ::fidl_next::WireBox::encode_present(out);
6624 } else {
6625 ::fidl_next::WireBox::encode_absent(out);
6626 }
6627
6628 Ok(())
6629 }
6630 }
6631
6632 impl<'de> ::fidl_next::FromWire<crate::wire::NameMapping<'de>> for NameMapping {
6633 #[inline]
6634 fn from_wire(wire: crate::wire::NameMapping<'de>) -> Self {
6635 Self {
6636 source_name: ::fidl_next::FromWire::from_wire(wire.source_name),
6637
6638 target_name: ::fidl_next::FromWire::from_wire(wire.target_name),
6639 }
6640 }
6641 }
6642
6643 impl<'de> ::fidl_next::FromWireRef<crate::wire::NameMapping<'de>> for NameMapping {
6644 #[inline]
6645 fn from_wire_ref(wire: &crate::wire::NameMapping<'de>) -> Self {
6646 Self {
6647 source_name: ::fidl_next::FromWireRef::from_wire_ref(&wire.source_name),
6648
6649 target_name: ::fidl_next::FromWireRef::from_wire_ref(&wire.target_name),
6650 }
6651 }
6652 }
6653
6654 #[doc = " Specifies how a declared environment\'s initial set of properties are assigned.\n"]
6655 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
6656 #[repr(u32)]
6657 pub enum EnvironmentExtends {
6658 None = 0,
6659 Realm = 1,
6660 }
6661 impl ::core::convert::TryFrom<u32> for EnvironmentExtends {
6662 type Error = ::fidl_next::UnknownStrictEnumMemberError;
6663 fn try_from(
6664 value: u32,
6665 ) -> ::core::result::Result<Self, ::fidl_next::UnknownStrictEnumMemberError> {
6666 match value {
6667 0 => Ok(Self::None),
6668 1 => Ok(Self::Realm),
6669
6670 _ => Err(::fidl_next::UnknownStrictEnumMemberError::new(value.into())),
6671 }
6672 }
6673 }
6674
6675 unsafe impl<___E> ::fidl_next::Encode<crate::wire::EnvironmentExtends, ___E> for EnvironmentExtends
6676 where
6677 ___E: ?Sized,
6678 {
6679 #[inline]
6680 fn encode(
6681 self,
6682 encoder: &mut ___E,
6683 out: &mut ::core::mem::MaybeUninit<crate::wire::EnvironmentExtends>,
6684 _: (),
6685 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6686 ::fidl_next::Encode::encode(&self, encoder, out, ())
6687 }
6688 }
6689
6690 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EnvironmentExtends, ___E>
6691 for &'a EnvironmentExtends
6692 where
6693 ___E: ?Sized,
6694 {
6695 #[inline]
6696 fn encode(
6697 self,
6698 encoder: &mut ___E,
6699 out: &mut ::core::mem::MaybeUninit<crate::wire::EnvironmentExtends>,
6700 _: (),
6701 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6702 ::fidl_next::munge!(let crate::wire::EnvironmentExtends { value } = out);
6703 let _ = value.write(::fidl_next::WireU32::from(match *self {
6704 EnvironmentExtends::None => 0,
6705
6706 EnvironmentExtends::Realm => 1,
6707 }));
6708
6709 Ok(())
6710 }
6711 }
6712
6713 impl ::core::convert::From<crate::wire::EnvironmentExtends> for EnvironmentExtends {
6714 fn from(wire: crate::wire::EnvironmentExtends) -> Self {
6715 match u32::from(wire.value) {
6716 0 => Self::None,
6717
6718 1 => Self::Realm,
6719
6720 _ => unsafe { ::core::hint::unreachable_unchecked() },
6721 }
6722 }
6723 }
6724
6725 impl ::fidl_next::FromWire<crate::wire::EnvironmentExtends> for EnvironmentExtends {
6726 #[inline]
6727 fn from_wire(wire: crate::wire::EnvironmentExtends) -> Self {
6728 Self::from(wire)
6729 }
6730 }
6731
6732 impl ::fidl_next::FromWireRef<crate::wire::EnvironmentExtends> for EnvironmentExtends {
6733 #[inline]
6734 fn from_wire_ref(wire: &crate::wire::EnvironmentExtends) -> Self {
6735 Self::from(*wire)
6736 }
6737 }
6738
6739 pub type UrlScheme = ::std::string::String;
6740
6741 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
6742 #[repr(u32)]
6743 pub enum ConfigTypeLayout {
6744 Bool = 1,
6745 Uint8 = 2,
6746 Uint16 = 3,
6747 Uint32 = 4,
6748 Uint64 = 5,
6749 Int8 = 6,
6750 Int16 = 7,
6751 Int32 = 8,
6752 Int64 = 9,
6753 String = 10,
6754 Vector = 11,
6755 UnknownOrdinal_(u32) = 12,
6756 }
6757 impl ::std::convert::From<u32> for ConfigTypeLayout {
6758 fn from(value: u32) -> Self {
6759 match value {
6760 1 => Self::Bool,
6761 2 => Self::Uint8,
6762 3 => Self::Uint16,
6763 4 => Self::Uint32,
6764 5 => Self::Uint64,
6765 6 => Self::Int8,
6766 7 => Self::Int16,
6767 8 => Self::Int32,
6768 9 => Self::Int64,
6769 10 => Self::String,
6770 11 => Self::Vector,
6771
6772 _ => Self::UnknownOrdinal_(value),
6773 }
6774 }
6775 }
6776
6777 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigTypeLayout, ___E> for ConfigTypeLayout
6778 where
6779 ___E: ?Sized,
6780 {
6781 #[inline]
6782 fn encode(
6783 self,
6784 encoder: &mut ___E,
6785 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigTypeLayout>,
6786 _: (),
6787 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6788 ::fidl_next::Encode::encode(&self, encoder, out, ())
6789 }
6790 }
6791
6792 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigTypeLayout, ___E>
6793 for &'a ConfigTypeLayout
6794 where
6795 ___E: ?Sized,
6796 {
6797 #[inline]
6798 fn encode(
6799 self,
6800 encoder: &mut ___E,
6801 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigTypeLayout>,
6802 _: (),
6803 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6804 ::fidl_next::munge!(let crate::wire::ConfigTypeLayout { value } = out);
6805 let _ = value.write(::fidl_next::WireU32::from(match *self {
6806 ConfigTypeLayout::Bool => 1,
6807
6808 ConfigTypeLayout::Uint8 => 2,
6809
6810 ConfigTypeLayout::Uint16 => 3,
6811
6812 ConfigTypeLayout::Uint32 => 4,
6813
6814 ConfigTypeLayout::Uint64 => 5,
6815
6816 ConfigTypeLayout::Int8 => 6,
6817
6818 ConfigTypeLayout::Int16 => 7,
6819
6820 ConfigTypeLayout::Int32 => 8,
6821
6822 ConfigTypeLayout::Int64 => 9,
6823
6824 ConfigTypeLayout::String => 10,
6825
6826 ConfigTypeLayout::Vector => 11,
6827
6828 ConfigTypeLayout::UnknownOrdinal_(value) => value,
6829 }));
6830
6831 Ok(())
6832 }
6833 }
6834
6835 impl ::core::convert::From<crate::wire::ConfigTypeLayout> for ConfigTypeLayout {
6836 fn from(wire: crate::wire::ConfigTypeLayout) -> Self {
6837 match u32::from(wire.value) {
6838 1 => Self::Bool,
6839
6840 2 => Self::Uint8,
6841
6842 3 => Self::Uint16,
6843
6844 4 => Self::Uint32,
6845
6846 5 => Self::Uint64,
6847
6848 6 => Self::Int8,
6849
6850 7 => Self::Int16,
6851
6852 8 => Self::Int32,
6853
6854 9 => Self::Int64,
6855
6856 10 => Self::String,
6857
6858 11 => Self::Vector,
6859
6860 value => Self::UnknownOrdinal_(value),
6861 }
6862 }
6863 }
6864
6865 impl ::fidl_next::FromWire<crate::wire::ConfigTypeLayout> for ConfigTypeLayout {
6866 #[inline]
6867 fn from_wire(wire: crate::wire::ConfigTypeLayout) -> Self {
6868 Self::from(wire)
6869 }
6870 }
6871
6872 impl ::fidl_next::FromWireRef<crate::wire::ConfigTypeLayout> for ConfigTypeLayout {
6873 #[inline]
6874 fn from_wire_ref(wire: &crate::wire::ConfigTypeLayout) -> Self {
6875 Self::from(*wire)
6876 }
6877 }
6878
6879 #[derive(PartialEq, Clone, Debug)]
6880 pub enum LayoutConstraint {
6881 MaxSize(u32),
6882
6883 UnknownOrdinal_(u64),
6884 }
6885
6886 impl LayoutConstraint {
6887 pub fn is_unknown(&self) -> bool {
6888 #[allow(unreachable_patterns)]
6889 match self {
6890 Self::UnknownOrdinal_(_) => true,
6891 _ => false,
6892 }
6893 }
6894 }
6895
6896 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LayoutConstraint<'static>, ___E>
6897 for LayoutConstraint
6898 where
6899 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6900 ___E: ::fidl_next::Encoder,
6901 {
6902 #[inline]
6903 fn encode(
6904 self,
6905 encoder: &mut ___E,
6906 out: &mut ::core::mem::MaybeUninit<crate::wire::LayoutConstraint<'static>>,
6907 _: (),
6908 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6909 ::fidl_next::munge!(let crate::wire::LayoutConstraint { raw, _phantom: _ } = out);
6910
6911 match self {
6912 Self::MaxSize(value) => ::fidl_next::RawWireUnion::encode_as::<
6913 ___E,
6914 ::fidl_next::WireU32,
6915 >(value, 1, encoder, raw, ())?,
6916
6917 Self::UnknownOrdinal_(ordinal) => {
6918 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
6919 }
6920 }
6921
6922 Ok(())
6923 }
6924 }
6925
6926 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LayoutConstraint<'static>, ___E>
6927 for &'a LayoutConstraint
6928 where
6929 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6930 ___E: ::fidl_next::Encoder,
6931 {
6932 #[inline]
6933 fn encode(
6934 self,
6935 encoder: &mut ___E,
6936 out: &mut ::core::mem::MaybeUninit<crate::wire::LayoutConstraint<'static>>,
6937 _: (),
6938 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6939 ::fidl_next::munge!(let crate::wire::LayoutConstraint { raw, _phantom: _ } = out);
6940
6941 match self {
6942 LayoutConstraint::MaxSize(value) => ::fidl_next::RawWireUnion::encode_as::<
6943 ___E,
6944 ::fidl_next::WireU32,
6945 >(value, 1, encoder, raw, ())?,
6946
6947 LayoutConstraint::UnknownOrdinal_(ordinal) => {
6948 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
6949 }
6950 }
6951
6952 Ok(())
6953 }
6954 }
6955
6956 unsafe impl<___E>
6957 ::fidl_next::EncodeOption<crate::wire_optional::LayoutConstraint<'static>, ___E>
6958 for LayoutConstraint
6959 where
6960 ___E: ?Sized,
6961 LayoutConstraint: ::fidl_next::Encode<crate::wire::LayoutConstraint<'static>, ___E>,
6962 {
6963 #[inline]
6964 fn encode_option(
6965 this: ::core::option::Option<Self>,
6966 encoder: &mut ___E,
6967 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::LayoutConstraint<'static>>,
6968 _: (),
6969 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6970 ::fidl_next::munge!(let crate::wire_optional::LayoutConstraint { raw, _phantom: _ } = &mut *out);
6971
6972 if let Some(inner) = this {
6973 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
6974 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
6975 } else {
6976 ::fidl_next::RawWireUnion::encode_absent(raw);
6977 }
6978
6979 Ok(())
6980 }
6981 }
6982
6983 unsafe impl<'a, ___E>
6984 ::fidl_next::EncodeOption<crate::wire_optional::LayoutConstraint<'static>, ___E>
6985 for &'a LayoutConstraint
6986 where
6987 ___E: ?Sized,
6988 &'a LayoutConstraint: ::fidl_next::Encode<crate::wire::LayoutConstraint<'static>, ___E>,
6989 {
6990 #[inline]
6991 fn encode_option(
6992 this: ::core::option::Option<Self>,
6993 encoder: &mut ___E,
6994 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::LayoutConstraint<'static>>,
6995 _: (),
6996 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
6997 ::fidl_next::munge!(let crate::wire_optional::LayoutConstraint { raw, _phantom: _ } = &mut *out);
6998
6999 if let Some(inner) = this {
7000 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7001 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
7002 } else {
7003 ::fidl_next::RawWireUnion::encode_absent(raw);
7004 }
7005
7006 Ok(())
7007 }
7008 }
7009
7010 impl<'de> ::fidl_next::FromWire<crate::wire::LayoutConstraint<'de>> for LayoutConstraint {
7011 #[inline]
7012 fn from_wire(wire: crate::wire::LayoutConstraint<'de>) -> Self {
7013 let wire = ::core::mem::ManuallyDrop::new(wire);
7014 match wire.raw.ordinal() {
7015 1 => Self::MaxSize(::fidl_next::FromWire::from_wire(unsafe {
7016 wire.raw.get().read_unchecked::<::fidl_next::WireU32>()
7017 })),
7018
7019 ord => return Self::UnknownOrdinal_(ord as u64),
7020 }
7021 }
7022 }
7023
7024 impl<'de> ::fidl_next::FromWireRef<crate::wire::LayoutConstraint<'de>> for LayoutConstraint {
7025 #[inline]
7026 fn from_wire_ref(wire: &crate::wire::LayoutConstraint<'de>) -> Self {
7027 match wire.raw.ordinal() {
7028 1 => Self::MaxSize(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7029 wire.raw.get().deref_unchecked::<::fidl_next::WireU32>()
7030 })),
7031
7032 ord => return Self::UnknownOrdinal_(ord as u64),
7033 }
7034 }
7035 }
7036
7037 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::LayoutConstraint<'de>>
7038 for LayoutConstraint
7039 {
7040 #[inline]
7041 fn from_wire_option(
7042 wire: crate::wire_optional::LayoutConstraint<'de>,
7043 ) -> ::core::option::Option<Self> {
7044 if let Some(inner) = wire.into_option() {
7045 Some(::fidl_next::FromWire::from_wire(inner))
7046 } else {
7047 None
7048 }
7049 }
7050 }
7051
7052 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::LayoutConstraint<'de>>
7053 for Box<LayoutConstraint>
7054 {
7055 #[inline]
7056 fn from_wire_option(
7057 wire: crate::wire_optional::LayoutConstraint<'de>,
7058 ) -> ::core::option::Option<Self> {
7059 <LayoutConstraint as ::fidl_next::FromWireOption<
7060 crate::wire_optional::LayoutConstraint<'de>,
7061 >>::from_wire_option(wire)
7062 .map(Box::new)
7063 }
7064 }
7065
7066 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::LayoutConstraint<'de>>
7067 for Box<LayoutConstraint>
7068 {
7069 #[inline]
7070 fn from_wire_option_ref(
7071 wire: &crate::wire_optional::LayoutConstraint<'de>,
7072 ) -> ::core::option::Option<Self> {
7073 if let Some(inner) = wire.as_ref() {
7074 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
7075 } else {
7076 None
7077 }
7078 }
7079 }
7080
7081 #[derive(PartialEq, Clone, Debug)]
7082 pub struct ConfigType {
7083 pub layout: crate::natural::ConfigTypeLayout,
7084
7085 pub parameters: ::core::option::Option<::std::vec::Vec<crate::natural::LayoutParameter>>,
7086
7087 pub constraints: ::std::vec::Vec<crate::natural::LayoutConstraint>,
7088 }
7089
7090 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigType<'static>, ___E> for ConfigType
7091 where
7092 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7093 ___E: ::fidl_next::Encoder,
7094 {
7095 #[inline]
7096 fn encode(
7097 self,
7098 encoder_: &mut ___E,
7099 out_: &mut ::core::mem::MaybeUninit<crate::wire::ConfigType<'static>>,
7100 _: (),
7101 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7102 ::fidl_next::munge! {
7103 let crate::wire::ConfigType {
7104 layout,
7105 parameters,
7106 constraints,
7107
7108 } = out_;
7109 }
7110
7111 ::fidl_next::Encode::encode(self.layout, encoder_, layout, ())?;
7112
7113 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(layout.as_mut_ptr()) };
7114
7115 ::fidl_next::Encode::encode(self.parameters, encoder_, parameters, (4294967295, ()))?;
7116
7117 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(parameters.as_mut_ptr()) };
7118 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
7119
7120 ::fidl_next::Encode::encode(self.constraints, encoder_, constraints, (4294967295, ()))?;
7121
7122 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(constraints.as_mut_ptr()) };
7123 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
7124
7125 Ok(())
7126 }
7127 }
7128
7129 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigType<'static>, ___E> for &'a ConfigType
7130 where
7131 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7132 ___E: ::fidl_next::Encoder,
7133 {
7134 #[inline]
7135 fn encode(
7136 self,
7137 encoder_: &mut ___E,
7138 out_: &mut ::core::mem::MaybeUninit<crate::wire::ConfigType<'static>>,
7139 _: (),
7140 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7141 ::fidl_next::munge! {
7142 let crate::wire::ConfigType {
7143
7144 layout,
7145 parameters,
7146 constraints,
7147
7148 } = out_;
7149 }
7150
7151 ::fidl_next::Encode::encode(&self.layout, encoder_, layout, ())?;
7152
7153 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(layout.as_mut_ptr()) };
7154
7155 ::fidl_next::Encode::encode(&self.parameters, encoder_, parameters, (4294967295, ()))?;
7156
7157 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(parameters.as_mut_ptr()) };
7158 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
7159
7160 ::fidl_next::Encode::encode(
7161 &self.constraints,
7162 encoder_,
7163 constraints,
7164 (4294967295, ()),
7165 )?;
7166
7167 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(constraints.as_mut_ptr()) };
7168 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
7169
7170 Ok(())
7171 }
7172 }
7173
7174 unsafe impl<___E>
7175 ::fidl_next::EncodeOption<
7176 ::fidl_next::WireBox<'static, crate::wire::ConfigType<'static>>,
7177 ___E,
7178 > for ConfigType
7179 where
7180 ___E: ::fidl_next::Encoder + ?Sized,
7181 ConfigType: ::fidl_next::Encode<crate::wire::ConfigType<'static>, ___E>,
7182 {
7183 #[inline]
7184 fn encode_option(
7185 this: ::core::option::Option<Self>,
7186 encoder: &mut ___E,
7187 out: &mut ::core::mem::MaybeUninit<
7188 ::fidl_next::WireBox<'static, crate::wire::ConfigType<'static>>,
7189 >,
7190 _: (),
7191 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7192 if let Some(inner) = this {
7193 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
7194 ::fidl_next::WireBox::encode_present(out);
7195 } else {
7196 ::fidl_next::WireBox::encode_absent(out);
7197 }
7198
7199 Ok(())
7200 }
7201 }
7202
7203 unsafe impl<'a, ___E>
7204 ::fidl_next::EncodeOption<
7205 ::fidl_next::WireBox<'static, crate::wire::ConfigType<'static>>,
7206 ___E,
7207 > for &'a ConfigType
7208 where
7209 ___E: ::fidl_next::Encoder + ?Sized,
7210 &'a ConfigType: ::fidl_next::Encode<crate::wire::ConfigType<'static>, ___E>,
7211 {
7212 #[inline]
7213 fn encode_option(
7214 this: ::core::option::Option<Self>,
7215 encoder: &mut ___E,
7216 out: &mut ::core::mem::MaybeUninit<
7217 ::fidl_next::WireBox<'static, crate::wire::ConfigType<'static>>,
7218 >,
7219 _: (),
7220 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7221 if let Some(inner) = this {
7222 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
7223 ::fidl_next::WireBox::encode_present(out);
7224 } else {
7225 ::fidl_next::WireBox::encode_absent(out);
7226 }
7227
7228 Ok(())
7229 }
7230 }
7231
7232 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigType<'de>> for ConfigType {
7233 #[inline]
7234 fn from_wire(wire: crate::wire::ConfigType<'de>) -> Self {
7235 Self {
7236 layout: ::fidl_next::FromWire::from_wire(wire.layout),
7237
7238 parameters: ::fidl_next::FromWire::from_wire(wire.parameters),
7239
7240 constraints: ::fidl_next::FromWire::from_wire(wire.constraints),
7241 }
7242 }
7243 }
7244
7245 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigType<'de>> for ConfigType {
7246 #[inline]
7247 fn from_wire_ref(wire: &crate::wire::ConfigType<'de>) -> Self {
7248 Self {
7249 layout: ::fidl_next::FromWireRef::from_wire_ref(&wire.layout),
7250
7251 parameters: ::fidl_next::FromWireRef::from_wire_ref(&wire.parameters),
7252
7253 constraints: ::fidl_next::FromWireRef::from_wire_ref(&wire.constraints),
7254 }
7255 }
7256 }
7257
7258 #[doc = " The checksum produced for a configuration interface.\n Two configuration interfaces are the same if their checksums are the same.\n"]
7259 #[derive(PartialEq, Clone, Debug)]
7260 pub enum ConfigChecksum {
7261 Sha256([u8; 32]),
7262
7263 UnknownOrdinal_(u64),
7264 }
7265
7266 impl ConfigChecksum {
7267 pub fn is_unknown(&self) -> bool {
7268 #[allow(unreachable_patterns)]
7269 match self {
7270 Self::UnknownOrdinal_(_) => true,
7271 _ => false,
7272 }
7273 }
7274 }
7275
7276 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigChecksum<'static>, ___E> for ConfigChecksum
7277 where
7278 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7279 ___E: ::fidl_next::Encoder,
7280 {
7281 #[inline]
7282 fn encode(
7283 self,
7284 encoder: &mut ___E,
7285 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigChecksum<'static>>,
7286 _: (),
7287 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7288 ::fidl_next::munge!(let crate::wire::ConfigChecksum { raw, _phantom: _ } = out);
7289
7290 match self {
7291 Self::Sha256(value) => ::fidl_next::RawWireUnion::encode_as::<___E, [u8; 32]>(
7292 value,
7293 1,
7294 encoder,
7295 raw,
7296 (),
7297 )?,
7298
7299 Self::UnknownOrdinal_(ordinal) => {
7300 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
7301 }
7302 }
7303
7304 Ok(())
7305 }
7306 }
7307
7308 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigChecksum<'static>, ___E>
7309 for &'a ConfigChecksum
7310 where
7311 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7312 ___E: ::fidl_next::Encoder,
7313 {
7314 #[inline]
7315 fn encode(
7316 self,
7317 encoder: &mut ___E,
7318 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigChecksum<'static>>,
7319 _: (),
7320 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7321 ::fidl_next::munge!(let crate::wire::ConfigChecksum { raw, _phantom: _ } = out);
7322
7323 match self {
7324 ConfigChecksum::Sha256(value) => ::fidl_next::RawWireUnion::encode_as::<
7325 ___E,
7326 [u8; 32],
7327 >(value, 1, encoder, raw, ())?,
7328
7329 ConfigChecksum::UnknownOrdinal_(ordinal) => {
7330 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
7331 }
7332 }
7333
7334 Ok(())
7335 }
7336 }
7337
7338 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::ConfigChecksum<'static>, ___E>
7339 for ConfigChecksum
7340 where
7341 ___E: ?Sized,
7342 ConfigChecksum: ::fidl_next::Encode<crate::wire::ConfigChecksum<'static>, ___E>,
7343 {
7344 #[inline]
7345 fn encode_option(
7346 this: ::core::option::Option<Self>,
7347 encoder: &mut ___E,
7348 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigChecksum<'static>>,
7349 _: (),
7350 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7351 ::fidl_next::munge!(let crate::wire_optional::ConfigChecksum { raw, _phantom: _ } = &mut *out);
7352
7353 if let Some(inner) = this {
7354 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7355 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
7356 } else {
7357 ::fidl_next::RawWireUnion::encode_absent(raw);
7358 }
7359
7360 Ok(())
7361 }
7362 }
7363
7364 unsafe impl<'a, ___E>
7365 ::fidl_next::EncodeOption<crate::wire_optional::ConfigChecksum<'static>, ___E>
7366 for &'a ConfigChecksum
7367 where
7368 ___E: ?Sized,
7369 &'a ConfigChecksum: ::fidl_next::Encode<crate::wire::ConfigChecksum<'static>, ___E>,
7370 {
7371 #[inline]
7372 fn encode_option(
7373 this: ::core::option::Option<Self>,
7374 encoder: &mut ___E,
7375 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigChecksum<'static>>,
7376 _: (),
7377 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7378 ::fidl_next::munge!(let crate::wire_optional::ConfigChecksum { raw, _phantom: _ } = &mut *out);
7379
7380 if let Some(inner) = this {
7381 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
7382 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
7383 } else {
7384 ::fidl_next::RawWireUnion::encode_absent(raw);
7385 }
7386
7387 Ok(())
7388 }
7389 }
7390
7391 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigChecksum<'de>> for ConfigChecksum {
7392 #[inline]
7393 fn from_wire(wire: crate::wire::ConfigChecksum<'de>) -> Self {
7394 let wire = ::core::mem::ManuallyDrop::new(wire);
7395 match wire.raw.ordinal() {
7396 1 => Self::Sha256(::fidl_next::FromWire::from_wire(unsafe {
7397 wire.raw.get().read_unchecked::<[u8; 32]>()
7398 })),
7399
7400 ord => return Self::UnknownOrdinal_(ord as u64),
7401 }
7402 }
7403 }
7404
7405 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigChecksum<'de>> for ConfigChecksum {
7406 #[inline]
7407 fn from_wire_ref(wire: &crate::wire::ConfigChecksum<'de>) -> Self {
7408 match wire.raw.ordinal() {
7409 1 => Self::Sha256(::fidl_next::FromWireRef::from_wire_ref(unsafe {
7410 wire.raw.get().deref_unchecked::<[u8; 32]>()
7411 })),
7412
7413 ord => return Self::UnknownOrdinal_(ord as u64),
7414 }
7415 }
7416 }
7417
7418 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigChecksum<'de>>
7419 for ConfigChecksum
7420 {
7421 #[inline]
7422 fn from_wire_option(
7423 wire: crate::wire_optional::ConfigChecksum<'de>,
7424 ) -> ::core::option::Option<Self> {
7425 if let Some(inner) = wire.into_option() {
7426 Some(::fidl_next::FromWire::from_wire(inner))
7427 } else {
7428 None
7429 }
7430 }
7431 }
7432
7433 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigChecksum<'de>>
7434 for Box<ConfigChecksum>
7435 {
7436 #[inline]
7437 fn from_wire_option(
7438 wire: crate::wire_optional::ConfigChecksum<'de>,
7439 ) -> ::core::option::Option<Self> {
7440 <ConfigChecksum as ::fidl_next::FromWireOption<
7441 crate::wire_optional::ConfigChecksum<'de>,
7442 >>::from_wire_option(wire)
7443 .map(Box::new)
7444 }
7445 }
7446
7447 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::ConfigChecksum<'de>>
7448 for Box<ConfigChecksum>
7449 {
7450 #[inline]
7451 fn from_wire_option_ref(
7452 wire: &crate::wire_optional::ConfigChecksum<'de>,
7453 ) -> ::core::option::Option<Self> {
7454 if let Some(inner) = wire.as_ref() {
7455 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
7456 } else {
7457 None
7458 }
7459 }
7460 }
7461
7462 #[doc = " Declares storage used by a component, which was offered to it.\n"]
7463 #[derive(PartialEq, Clone, Debug, Default)]
7464 pub struct UseStorage {
7465 pub source_name: ::core::option::Option<::std::string::String>,
7466
7467 pub target_path: ::core::option::Option<::std::string::String>,
7468
7469 pub availability: ::core::option::Option<crate::natural::Availability>,
7470 }
7471
7472 impl UseStorage {
7473 fn __max_ordinal(&self) -> usize {
7474 if self.availability.is_some() {
7475 return 3;
7476 }
7477
7478 if self.target_path.is_some() {
7479 return 2;
7480 }
7481
7482 if self.source_name.is_some() {
7483 return 1;
7484 }
7485
7486 0
7487 }
7488 }
7489
7490 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseStorage<'static>, ___E> for UseStorage
7491 where
7492 ___E: ::fidl_next::Encoder + ?Sized,
7493 {
7494 #[inline]
7495 fn encode(
7496 mut self,
7497 encoder: &mut ___E,
7498 out: &mut ::core::mem::MaybeUninit<crate::wire::UseStorage<'static>>,
7499 _: (),
7500 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7501 ::fidl_next::munge!(let crate::wire::UseStorage { table } = out);
7502
7503 let max_ord = self.__max_ordinal();
7504
7505 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7506 ::fidl_next::Wire::zero_padding(&mut out);
7507
7508 let mut preallocated =
7509 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7510
7511 for i in 1..=max_ord {
7512 match i {
7513 3 => {
7514 if let Some(value) = self.availability.take() {
7515 ::fidl_next::WireEnvelope::encode_value::<
7516 crate::wire::Availability,
7517 ___E,
7518 >(
7519 value, preallocated.encoder, &mut out, ()
7520 )?;
7521 } else {
7522 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7523 }
7524 }
7525
7526 2 => {
7527 if let Some(value) = self.target_path.take() {
7528 ::fidl_next::WireEnvelope::encode_value::<
7529 ::fidl_next::WireString<'static>,
7530 ___E,
7531 >(
7532 value, preallocated.encoder, &mut out, 1024
7533 )?;
7534 } else {
7535 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7536 }
7537 }
7538
7539 1 => {
7540 if let Some(value) = self.source_name.take() {
7541 ::fidl_next::WireEnvelope::encode_value::<
7542 ::fidl_next::WireString<'static>,
7543 ___E,
7544 >(
7545 value, preallocated.encoder, &mut out, 100
7546 )?;
7547 } else {
7548 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7549 }
7550 }
7551
7552 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7553 }
7554 unsafe {
7555 preallocated.write_next(out.assume_init_ref());
7556 }
7557 }
7558
7559 ::fidl_next::WireTable::encode_len(table, max_ord);
7560
7561 Ok(())
7562 }
7563 }
7564
7565 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseStorage<'static>, ___E> for &'a UseStorage
7566 where
7567 ___E: ::fidl_next::Encoder + ?Sized,
7568 {
7569 #[inline]
7570 fn encode(
7571 self,
7572 encoder: &mut ___E,
7573 out: &mut ::core::mem::MaybeUninit<crate::wire::UseStorage<'static>>,
7574 _: (),
7575 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7576 ::fidl_next::munge!(let crate::wire::UseStorage { table } = out);
7577
7578 let max_ord = self.__max_ordinal();
7579
7580 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7581 ::fidl_next::Wire::zero_padding(&mut out);
7582
7583 let mut preallocated =
7584 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7585
7586 for i in 1..=max_ord {
7587 match i {
7588 3 => {
7589 if let Some(value) = &self.availability {
7590 ::fidl_next::WireEnvelope::encode_value::<
7591 crate::wire::Availability,
7592 ___E,
7593 >(
7594 value, preallocated.encoder, &mut out, ()
7595 )?;
7596 } else {
7597 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7598 }
7599 }
7600
7601 2 => {
7602 if let Some(value) = &self.target_path {
7603 ::fidl_next::WireEnvelope::encode_value::<
7604 ::fidl_next::WireString<'static>,
7605 ___E,
7606 >(
7607 value, preallocated.encoder, &mut out, 1024
7608 )?;
7609 } else {
7610 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7611 }
7612 }
7613
7614 1 => {
7615 if let Some(value) = &self.source_name {
7616 ::fidl_next::WireEnvelope::encode_value::<
7617 ::fidl_next::WireString<'static>,
7618 ___E,
7619 >(
7620 value, preallocated.encoder, &mut out, 100
7621 )?;
7622 } else {
7623 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7624 }
7625 }
7626
7627 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7628 }
7629 unsafe {
7630 preallocated.write_next(out.assume_init_ref());
7631 }
7632 }
7633
7634 ::fidl_next::WireTable::encode_len(table, max_ord);
7635
7636 Ok(())
7637 }
7638 }
7639
7640 impl<'de> ::fidl_next::FromWire<crate::wire::UseStorage<'de>> for UseStorage {
7641 #[inline]
7642 fn from_wire(wire_: crate::wire::UseStorage<'de>) -> Self {
7643 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7644
7645 let source_name = wire_.table.get(1);
7646
7647 let target_path = wire_.table.get(2);
7648
7649 let availability = wire_.table.get(3);
7650
7651 Self {
7652 source_name: source_name.map(|envelope| {
7653 ::fidl_next::FromWire::from_wire(unsafe {
7654 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
7655 })
7656 }),
7657
7658 target_path: target_path.map(|envelope| {
7659 ::fidl_next::FromWire::from_wire(unsafe {
7660 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
7661 })
7662 }),
7663
7664 availability: availability.map(|envelope| {
7665 ::fidl_next::FromWire::from_wire(unsafe {
7666 envelope.read_unchecked::<crate::wire::Availability>()
7667 })
7668 }),
7669 }
7670 }
7671 }
7672
7673 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseStorage<'de>> for UseStorage {
7674 #[inline]
7675 fn from_wire_ref(wire: &crate::wire::UseStorage<'de>) -> Self {
7676 Self {
7677 source_name: wire.table.get(1).map(|envelope| {
7678 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7679 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
7680 })
7681 }),
7682
7683 target_path: wire.table.get(2).map(|envelope| {
7684 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7685 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
7686 })
7687 }),
7688
7689 availability: wire.table.get(3).map(|envelope| {
7690 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7691 envelope.deref_unchecked::<crate::wire::Availability>()
7692 })
7693 }),
7694 }
7695 }
7696 }
7697
7698 ::fidl_next::bitflags::bitflags! {
7699 #[doc = " Allowed sources for runtime overrides of a config field\'s value.\n"]#[derive(
7700 Clone,
7701 Copy,
7702 Debug,
7703 PartialEq,
7704 Eq,
7705 Hash,
7706 )]
7707 pub struct ConfigMutability: u32 {
7708 #[doc = " Allow parent components to provide overrides for the configuration field.\n"]const PARENT = 1;
7709 const _ = !0;
7710 }
7711 }
7712
7713 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigMutability, ___E> for ConfigMutability
7714 where
7715 ___E: ?Sized,
7716 {
7717 #[inline]
7718 fn encode(
7719 self,
7720 encoder: &mut ___E,
7721 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigMutability>,
7722 _: (),
7723 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7724 ::fidl_next::Encode::encode(&self, encoder, out, ())
7725 }
7726 }
7727
7728 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigMutability, ___E>
7729 for &'a ConfigMutability
7730 where
7731 ___E: ?Sized,
7732 {
7733 #[inline]
7734 fn encode(
7735 self,
7736 _: &mut ___E,
7737 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigMutability>,
7738 _: (),
7739 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7740 ::fidl_next::munge!(let crate::wire::ConfigMutability { value } = out);
7741
7742 let _ = value.write(::fidl_next::WireU32::from(self.bits()));
7743 Ok(())
7744 }
7745 }
7746
7747 impl ::core::convert::From<crate::wire::ConfigMutability> for ConfigMutability {
7748 fn from(wire: crate::wire::ConfigMutability) -> Self {
7749 Self::from_bits_retain(u32::from(wire.value))
7750 }
7751 }
7752
7753 impl ::fidl_next::FromWire<crate::wire::ConfigMutability> for ConfigMutability {
7754 #[inline]
7755 fn from_wire(wire: crate::wire::ConfigMutability) -> Self {
7756 Self::from(wire)
7757 }
7758 }
7759
7760 impl ::fidl_next::FromWireRef<crate::wire::ConfigMutability> for ConfigMutability {
7761 #[inline]
7762 fn from_wire_ref(wire: &crate::wire::ConfigMutability) -> Self {
7763 Self::from(*wire)
7764 }
7765 }
7766
7767 #[doc = " Declares a single config field (key + type)\n"]
7768 #[derive(PartialEq, Clone, Debug, Default)]
7769 pub struct ConfigField {
7770 pub key: ::core::option::Option<::std::string::String>,
7771
7772 pub type_: ::core::option::Option<crate::natural::ConfigType>,
7773
7774 pub mutability: ::core::option::Option<crate::natural::ConfigMutability>,
7775 }
7776
7777 impl ConfigField {
7778 fn __max_ordinal(&self) -> usize {
7779 if self.mutability.is_some() {
7780 return 3;
7781 }
7782
7783 if self.type_.is_some() {
7784 return 2;
7785 }
7786
7787 if self.key.is_some() {
7788 return 1;
7789 }
7790
7791 0
7792 }
7793 }
7794
7795 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigField<'static>, ___E> for ConfigField
7796 where
7797 ___E: ::fidl_next::Encoder + ?Sized,
7798 {
7799 #[inline]
7800 fn encode(
7801 mut self,
7802 encoder: &mut ___E,
7803 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigField<'static>>,
7804 _: (),
7805 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7806 ::fidl_next::munge!(let crate::wire::ConfigField { table } = out);
7807
7808 let max_ord = self.__max_ordinal();
7809
7810 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7811 ::fidl_next::Wire::zero_padding(&mut out);
7812
7813 let mut preallocated =
7814 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7815
7816 for i in 1..=max_ord {
7817 match i {
7818 3 => {
7819 if let Some(value) = self.mutability.take() {
7820 ::fidl_next::WireEnvelope::encode_value::<
7821 crate::wire::ConfigMutability,
7822 ___E,
7823 >(
7824 value, preallocated.encoder, &mut out, ()
7825 )?;
7826 } else {
7827 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7828 }
7829 }
7830
7831 2 => {
7832 if let Some(value) = self.type_.take() {
7833 ::fidl_next::WireEnvelope::encode_value::<
7834 crate::wire::ConfigType<'static>,
7835 ___E,
7836 >(
7837 value, preallocated.encoder, &mut out, ()
7838 )?;
7839 } else {
7840 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7841 }
7842 }
7843
7844 1 => {
7845 if let Some(value) = self.key.take() {
7846 ::fidl_next::WireEnvelope::encode_value::<
7847 ::fidl_next::WireString<'static>,
7848 ___E,
7849 >(
7850 value, preallocated.encoder, &mut out, 64
7851 )?;
7852 } else {
7853 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7854 }
7855 }
7856
7857 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7858 }
7859 unsafe {
7860 preallocated.write_next(out.assume_init_ref());
7861 }
7862 }
7863
7864 ::fidl_next::WireTable::encode_len(table, max_ord);
7865
7866 Ok(())
7867 }
7868 }
7869
7870 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigField<'static>, ___E>
7871 for &'a ConfigField
7872 where
7873 ___E: ::fidl_next::Encoder + ?Sized,
7874 {
7875 #[inline]
7876 fn encode(
7877 self,
7878 encoder: &mut ___E,
7879 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigField<'static>>,
7880 _: (),
7881 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
7882 ::fidl_next::munge!(let crate::wire::ConfigField { table } = out);
7883
7884 let max_ord = self.__max_ordinal();
7885
7886 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
7887 ::fidl_next::Wire::zero_padding(&mut out);
7888
7889 let mut preallocated =
7890 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
7891
7892 for i in 1..=max_ord {
7893 match i {
7894 3 => {
7895 if let Some(value) = &self.mutability {
7896 ::fidl_next::WireEnvelope::encode_value::<
7897 crate::wire::ConfigMutability,
7898 ___E,
7899 >(
7900 value, preallocated.encoder, &mut out, ()
7901 )?;
7902 } else {
7903 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7904 }
7905 }
7906
7907 2 => {
7908 if let Some(value) = &self.type_ {
7909 ::fidl_next::WireEnvelope::encode_value::<
7910 crate::wire::ConfigType<'static>,
7911 ___E,
7912 >(
7913 value, preallocated.encoder, &mut out, ()
7914 )?;
7915 } else {
7916 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7917 }
7918 }
7919
7920 1 => {
7921 if let Some(value) = &self.key {
7922 ::fidl_next::WireEnvelope::encode_value::<
7923 ::fidl_next::WireString<'static>,
7924 ___E,
7925 >(
7926 value, preallocated.encoder, &mut out, 64
7927 )?;
7928 } else {
7929 ::fidl_next::WireEnvelope::encode_zero(&mut out)
7930 }
7931 }
7932
7933 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
7934 }
7935 unsafe {
7936 preallocated.write_next(out.assume_init_ref());
7937 }
7938 }
7939
7940 ::fidl_next::WireTable::encode_len(table, max_ord);
7941
7942 Ok(())
7943 }
7944 }
7945
7946 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigField<'de>> for ConfigField {
7947 #[inline]
7948 fn from_wire(wire_: crate::wire::ConfigField<'de>) -> Self {
7949 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
7950
7951 let key = wire_.table.get(1);
7952
7953 let type_ = wire_.table.get(2);
7954
7955 let mutability = wire_.table.get(3);
7956
7957 Self {
7958 key: key.map(|envelope| {
7959 ::fidl_next::FromWire::from_wire(unsafe {
7960 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
7961 })
7962 }),
7963
7964 type_: type_.map(|envelope| {
7965 ::fidl_next::FromWire::from_wire(unsafe {
7966 envelope.read_unchecked::<crate::wire::ConfigType<'de>>()
7967 })
7968 }),
7969
7970 mutability: mutability.map(|envelope| {
7971 ::fidl_next::FromWire::from_wire(unsafe {
7972 envelope.read_unchecked::<crate::wire::ConfigMutability>()
7973 })
7974 }),
7975 }
7976 }
7977 }
7978
7979 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigField<'de>> for ConfigField {
7980 #[inline]
7981 fn from_wire_ref(wire: &crate::wire::ConfigField<'de>) -> Self {
7982 Self {
7983 key: wire.table.get(1).map(|envelope| {
7984 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7985 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
7986 })
7987 }),
7988
7989 type_: wire.table.get(2).map(|envelope| {
7990 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7991 envelope.deref_unchecked::<crate::wire::ConfigType<'de>>()
7992 })
7993 }),
7994
7995 mutability: wire.table.get(3).map(|envelope| {
7996 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
7997 envelope.deref_unchecked::<crate::wire::ConfigMutability>()
7998 })
7999 }),
8000 }
8001 }
8002 }
8003
8004 #[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"]
8005 #[derive(PartialEq, Clone, Debug, Default)]
8006 pub struct Program {
8007 pub runner: ::core::option::Option<::std::string::String>,
8008
8009 pub info: ::core::option::Option<::fidl_next_common_fuchsia_data::natural::Dictionary>,
8010 }
8011
8012 impl Program {
8013 fn __max_ordinal(&self) -> usize {
8014 if self.info.is_some() {
8015 return 2;
8016 }
8017
8018 if self.runner.is_some() {
8019 return 1;
8020 }
8021
8022 0
8023 }
8024 }
8025
8026 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Program<'static>, ___E> for Program
8027 where
8028 ___E: ::fidl_next::Encoder + ?Sized,
8029 {
8030 #[inline]
8031 fn encode(
8032 mut self,
8033 encoder: &mut ___E,
8034 out: &mut ::core::mem::MaybeUninit<crate::wire::Program<'static>>,
8035 _: (),
8036 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8037 ::fidl_next::munge!(let crate::wire::Program { table } = out);
8038
8039 let max_ord = self.__max_ordinal();
8040
8041 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8042 ::fidl_next::Wire::zero_padding(&mut out);
8043
8044 let mut preallocated =
8045 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8046
8047 for i in 1..=max_ord {
8048 match i {
8049 2 => {
8050 if let Some(value) = self.info.take() {
8051 ::fidl_next::WireEnvelope::encode_value::<
8052 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
8053 ___E,
8054 >(
8055 value, preallocated.encoder, &mut out, ()
8056 )?;
8057 } else {
8058 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8059 }
8060 }
8061
8062 1 => {
8063 if let Some(value) = self.runner.take() {
8064 ::fidl_next::WireEnvelope::encode_value::<
8065 ::fidl_next::WireString<'static>,
8066 ___E,
8067 >(
8068 value, preallocated.encoder, &mut out, 100
8069 )?;
8070 } else {
8071 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8072 }
8073 }
8074
8075 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8076 }
8077 unsafe {
8078 preallocated.write_next(out.assume_init_ref());
8079 }
8080 }
8081
8082 ::fidl_next::WireTable::encode_len(table, max_ord);
8083
8084 Ok(())
8085 }
8086 }
8087
8088 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Program<'static>, ___E> for &'a Program
8089 where
8090 ___E: ::fidl_next::Encoder + ?Sized,
8091 {
8092 #[inline]
8093 fn encode(
8094 self,
8095 encoder: &mut ___E,
8096 out: &mut ::core::mem::MaybeUninit<crate::wire::Program<'static>>,
8097 _: (),
8098 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8099 ::fidl_next::munge!(let crate::wire::Program { table } = out);
8100
8101 let max_ord = self.__max_ordinal();
8102
8103 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8104 ::fidl_next::Wire::zero_padding(&mut out);
8105
8106 let mut preallocated =
8107 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8108
8109 for i in 1..=max_ord {
8110 match i {
8111 2 => {
8112 if let Some(value) = &self.info {
8113 ::fidl_next::WireEnvelope::encode_value::<
8114 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
8115 ___E,
8116 >(
8117 value, preallocated.encoder, &mut out, ()
8118 )?;
8119 } else {
8120 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8121 }
8122 }
8123
8124 1 => {
8125 if let Some(value) = &self.runner {
8126 ::fidl_next::WireEnvelope::encode_value::<
8127 ::fidl_next::WireString<'static>,
8128 ___E,
8129 >(
8130 value, preallocated.encoder, &mut out, 100
8131 )?;
8132 } else {
8133 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8134 }
8135 }
8136
8137 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8138 }
8139 unsafe {
8140 preallocated.write_next(out.assume_init_ref());
8141 }
8142 }
8143
8144 ::fidl_next::WireTable::encode_len(table, max_ord);
8145
8146 Ok(())
8147 }
8148 }
8149
8150 impl<'de> ::fidl_next::FromWire<crate::wire::Program<'de>> for Program {
8151 #[inline]
8152 fn from_wire(wire_: crate::wire::Program<'de>) -> Self {
8153 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8154
8155 let runner = wire_.table.get(1);
8156
8157 let info = wire_.table.get(2);
8158
8159 Self {
8160
8161
8162 runner: runner.map(|envelope| ::fidl_next::FromWire::from_wire(
8163 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
8164 )),
8165
8166
8167 info: info.map(|envelope| ::fidl_next::FromWire::from_wire(
8168 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
8169 )),
8170
8171 }
8172 }
8173 }
8174
8175 impl<'de> ::fidl_next::FromWireRef<crate::wire::Program<'de>> for Program {
8176 #[inline]
8177 fn from_wire_ref(wire: &crate::wire::Program<'de>) -> Self {
8178 Self {
8179
8180
8181 runner: wire.table.get(1)
8182 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
8183 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
8184 )),
8185
8186
8187 info: wire.table.get(2)
8188 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
8189 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
8190 )),
8191
8192 }
8193 }
8194 }
8195
8196 #[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"]
8197 #[derive(PartialEq, Clone, Debug, Default)]
8198 pub struct UseService {
8199 pub source: ::core::option::Option<crate::natural::Ref>,
8200
8201 pub source_name: ::core::option::Option<::std::string::String>,
8202
8203 pub target_path: ::core::option::Option<::std::string::String>,
8204
8205 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
8206
8207 pub availability: ::core::option::Option<crate::natural::Availability>,
8208
8209 pub source_dictionary: ::core::option::Option<::std::string::String>,
8210 }
8211
8212 impl UseService {
8213 fn __max_ordinal(&self) -> usize {
8214 if self.source_dictionary.is_some() {
8215 return 6;
8216 }
8217
8218 if self.availability.is_some() {
8219 return 5;
8220 }
8221
8222 if self.dependency_type.is_some() {
8223 return 4;
8224 }
8225
8226 if self.target_path.is_some() {
8227 return 3;
8228 }
8229
8230 if self.source_name.is_some() {
8231 return 2;
8232 }
8233
8234 if self.source.is_some() {
8235 return 1;
8236 }
8237
8238 0
8239 }
8240 }
8241
8242 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseService<'static>, ___E> for UseService
8243 where
8244 ___E: ::fidl_next::Encoder + ?Sized,
8245 {
8246 #[inline]
8247 fn encode(
8248 mut self,
8249 encoder: &mut ___E,
8250 out: &mut ::core::mem::MaybeUninit<crate::wire::UseService<'static>>,
8251 _: (),
8252 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8253 ::fidl_next::munge!(let crate::wire::UseService { table } = out);
8254
8255 let max_ord = self.__max_ordinal();
8256
8257 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8258 ::fidl_next::Wire::zero_padding(&mut out);
8259
8260 let mut preallocated =
8261 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8262
8263 for i in 1..=max_ord {
8264 match i {
8265 6 => {
8266 if let Some(value) = self.source_dictionary.take() {
8267 ::fidl_next::WireEnvelope::encode_value::<
8268 ::fidl_next::WireString<'static>,
8269 ___E,
8270 >(
8271 value, preallocated.encoder, &mut out, 1024
8272 )?;
8273 } else {
8274 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8275 }
8276 }
8277
8278 5 => {
8279 if let Some(value) = self.availability.take() {
8280 ::fidl_next::WireEnvelope::encode_value::<
8281 crate::wire::Availability,
8282 ___E,
8283 >(
8284 value, preallocated.encoder, &mut out, ()
8285 )?;
8286 } else {
8287 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8288 }
8289 }
8290
8291 4 => {
8292 if let Some(value) = self.dependency_type.take() {
8293 ::fidl_next::WireEnvelope::encode_value::<
8294 crate::wire::DependencyType,
8295 ___E,
8296 >(
8297 value, preallocated.encoder, &mut out, ()
8298 )?;
8299 } else {
8300 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8301 }
8302 }
8303
8304 3 => {
8305 if let Some(value) = self.target_path.take() {
8306 ::fidl_next::WireEnvelope::encode_value::<
8307 ::fidl_next::WireString<'static>,
8308 ___E,
8309 >(
8310 value, preallocated.encoder, &mut out, 1024
8311 )?;
8312 } else {
8313 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8314 }
8315 }
8316
8317 2 => {
8318 if let Some(value) = self.source_name.take() {
8319 ::fidl_next::WireEnvelope::encode_value::<
8320 ::fidl_next::WireString<'static>,
8321 ___E,
8322 >(
8323 value, preallocated.encoder, &mut out, 100
8324 )?;
8325 } else {
8326 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8327 }
8328 }
8329
8330 1 => {
8331 if let Some(value) = self.source.take() {
8332 ::fidl_next::WireEnvelope::encode_value::<
8333 crate::wire::Ref<'static>,
8334 ___E,
8335 >(
8336 value, preallocated.encoder, &mut out, ()
8337 )?;
8338 } else {
8339 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8340 }
8341 }
8342
8343 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8344 }
8345 unsafe {
8346 preallocated.write_next(out.assume_init_ref());
8347 }
8348 }
8349
8350 ::fidl_next::WireTable::encode_len(table, max_ord);
8351
8352 Ok(())
8353 }
8354 }
8355
8356 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseService<'static>, ___E> for &'a UseService
8357 where
8358 ___E: ::fidl_next::Encoder + ?Sized,
8359 {
8360 #[inline]
8361 fn encode(
8362 self,
8363 encoder: &mut ___E,
8364 out: &mut ::core::mem::MaybeUninit<crate::wire::UseService<'static>>,
8365 _: (),
8366 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8367 ::fidl_next::munge!(let crate::wire::UseService { table } = out);
8368
8369 let max_ord = self.__max_ordinal();
8370
8371 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8372 ::fidl_next::Wire::zero_padding(&mut out);
8373
8374 let mut preallocated =
8375 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8376
8377 for i in 1..=max_ord {
8378 match i {
8379 6 => {
8380 if let Some(value) = &self.source_dictionary {
8381 ::fidl_next::WireEnvelope::encode_value::<
8382 ::fidl_next::WireString<'static>,
8383 ___E,
8384 >(
8385 value, preallocated.encoder, &mut out, 1024
8386 )?;
8387 } else {
8388 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8389 }
8390 }
8391
8392 5 => {
8393 if let Some(value) = &self.availability {
8394 ::fidl_next::WireEnvelope::encode_value::<
8395 crate::wire::Availability,
8396 ___E,
8397 >(
8398 value, preallocated.encoder, &mut out, ()
8399 )?;
8400 } else {
8401 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8402 }
8403 }
8404
8405 4 => {
8406 if let Some(value) = &self.dependency_type {
8407 ::fidl_next::WireEnvelope::encode_value::<
8408 crate::wire::DependencyType,
8409 ___E,
8410 >(
8411 value, preallocated.encoder, &mut out, ()
8412 )?;
8413 } else {
8414 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8415 }
8416 }
8417
8418 3 => {
8419 if let Some(value) = &self.target_path {
8420 ::fidl_next::WireEnvelope::encode_value::<
8421 ::fidl_next::WireString<'static>,
8422 ___E,
8423 >(
8424 value, preallocated.encoder, &mut out, 1024
8425 )?;
8426 } else {
8427 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8428 }
8429 }
8430
8431 2 => {
8432 if let Some(value) = &self.source_name {
8433 ::fidl_next::WireEnvelope::encode_value::<
8434 ::fidl_next::WireString<'static>,
8435 ___E,
8436 >(
8437 value, preallocated.encoder, &mut out, 100
8438 )?;
8439 } else {
8440 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8441 }
8442 }
8443
8444 1 => {
8445 if let Some(value) = &self.source {
8446 ::fidl_next::WireEnvelope::encode_value::<
8447 crate::wire::Ref<'static>,
8448 ___E,
8449 >(
8450 value, preallocated.encoder, &mut out, ()
8451 )?;
8452 } else {
8453 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8454 }
8455 }
8456
8457 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8458 }
8459 unsafe {
8460 preallocated.write_next(out.assume_init_ref());
8461 }
8462 }
8463
8464 ::fidl_next::WireTable::encode_len(table, max_ord);
8465
8466 Ok(())
8467 }
8468 }
8469
8470 impl<'de> ::fidl_next::FromWire<crate::wire::UseService<'de>> for UseService {
8471 #[inline]
8472 fn from_wire(wire_: crate::wire::UseService<'de>) -> Self {
8473 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8474
8475 let source = wire_.table.get(1);
8476
8477 let source_name = wire_.table.get(2);
8478
8479 let target_path = wire_.table.get(3);
8480
8481 let dependency_type = wire_.table.get(4);
8482
8483 let availability = wire_.table.get(5);
8484
8485 let source_dictionary = wire_.table.get(6);
8486
8487 Self {
8488 source: source.map(|envelope| {
8489 ::fidl_next::FromWire::from_wire(unsafe {
8490 envelope.read_unchecked::<crate::wire::Ref<'de>>()
8491 })
8492 }),
8493
8494 source_name: source_name.map(|envelope| {
8495 ::fidl_next::FromWire::from_wire(unsafe {
8496 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
8497 })
8498 }),
8499
8500 target_path: target_path.map(|envelope| {
8501 ::fidl_next::FromWire::from_wire(unsafe {
8502 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
8503 })
8504 }),
8505
8506 dependency_type: dependency_type.map(|envelope| {
8507 ::fidl_next::FromWire::from_wire(unsafe {
8508 envelope.read_unchecked::<crate::wire::DependencyType>()
8509 })
8510 }),
8511
8512 availability: availability.map(|envelope| {
8513 ::fidl_next::FromWire::from_wire(unsafe {
8514 envelope.read_unchecked::<crate::wire::Availability>()
8515 })
8516 }),
8517
8518 source_dictionary: source_dictionary.map(|envelope| {
8519 ::fidl_next::FromWire::from_wire(unsafe {
8520 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
8521 })
8522 }),
8523 }
8524 }
8525 }
8526
8527 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseService<'de>> for UseService {
8528 #[inline]
8529 fn from_wire_ref(wire: &crate::wire::UseService<'de>) -> Self {
8530 Self {
8531 source: wire.table.get(1).map(|envelope| {
8532 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8533 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
8534 })
8535 }),
8536
8537 source_name: wire.table.get(2).map(|envelope| {
8538 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8539 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
8540 })
8541 }),
8542
8543 target_path: wire.table.get(3).map(|envelope| {
8544 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8545 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
8546 })
8547 }),
8548
8549 dependency_type: wire.table.get(4).map(|envelope| {
8550 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8551 envelope.deref_unchecked::<crate::wire::DependencyType>()
8552 })
8553 }),
8554
8555 availability: wire.table.get(5).map(|envelope| {
8556 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8557 envelope.deref_unchecked::<crate::wire::Availability>()
8558 })
8559 }),
8560
8561 source_dictionary: wire.table.get(6).map(|envelope| {
8562 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8563 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
8564 })
8565 }),
8566 }
8567 }
8568 }
8569
8570 #[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"]
8571 #[derive(PartialEq, Clone, Debug, Default)]
8572 pub struct UseProtocol {
8573 pub source: ::core::option::Option<crate::natural::Ref>,
8574
8575 pub source_name: ::core::option::Option<::std::string::String>,
8576
8577 pub target_path: ::core::option::Option<::std::string::String>,
8578
8579 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
8580
8581 pub availability: ::core::option::Option<crate::natural::Availability>,
8582
8583 pub source_dictionary: ::core::option::Option<::std::string::String>,
8584
8585 pub numbered_handle: ::core::option::Option<u8>,
8586 }
8587
8588 impl UseProtocol {
8589 fn __max_ordinal(&self) -> usize {
8590 if self.numbered_handle.is_some() {
8591 return 7;
8592 }
8593
8594 if self.source_dictionary.is_some() {
8595 return 6;
8596 }
8597
8598 if self.availability.is_some() {
8599 return 5;
8600 }
8601
8602 if self.dependency_type.is_some() {
8603 return 4;
8604 }
8605
8606 if self.target_path.is_some() {
8607 return 3;
8608 }
8609
8610 if self.source_name.is_some() {
8611 return 2;
8612 }
8613
8614 if self.source.is_some() {
8615 return 1;
8616 }
8617
8618 0
8619 }
8620 }
8621
8622 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseProtocol<'static>, ___E> for UseProtocol
8623 where
8624 ___E: ::fidl_next::Encoder + ?Sized,
8625 {
8626 #[inline]
8627 fn encode(
8628 mut self,
8629 encoder: &mut ___E,
8630 out: &mut ::core::mem::MaybeUninit<crate::wire::UseProtocol<'static>>,
8631 _: (),
8632 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8633 ::fidl_next::munge!(let crate::wire::UseProtocol { table } = out);
8634
8635 let max_ord = self.__max_ordinal();
8636
8637 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8638 ::fidl_next::Wire::zero_padding(&mut out);
8639
8640 let mut preallocated =
8641 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8642
8643 for i in 1..=max_ord {
8644 match i {
8645 7 => {
8646 if let Some(value) = self.numbered_handle.take() {
8647 ::fidl_next::WireEnvelope::encode_value::<u8, ___E>(
8648 value,
8649 preallocated.encoder,
8650 &mut out,
8651 (),
8652 )?;
8653 } else {
8654 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8655 }
8656 }
8657
8658 6 => {
8659 if let Some(value) = self.source_dictionary.take() {
8660 ::fidl_next::WireEnvelope::encode_value::<
8661 ::fidl_next::WireString<'static>,
8662 ___E,
8663 >(
8664 value, preallocated.encoder, &mut out, 1024
8665 )?;
8666 } else {
8667 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8668 }
8669 }
8670
8671 5 => {
8672 if let Some(value) = self.availability.take() {
8673 ::fidl_next::WireEnvelope::encode_value::<
8674 crate::wire::Availability,
8675 ___E,
8676 >(
8677 value, preallocated.encoder, &mut out, ()
8678 )?;
8679 } else {
8680 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8681 }
8682 }
8683
8684 4 => {
8685 if let Some(value) = self.dependency_type.take() {
8686 ::fidl_next::WireEnvelope::encode_value::<
8687 crate::wire::DependencyType,
8688 ___E,
8689 >(
8690 value, preallocated.encoder, &mut out, ()
8691 )?;
8692 } else {
8693 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8694 }
8695 }
8696
8697 3 => {
8698 if let Some(value) = self.target_path.take() {
8699 ::fidl_next::WireEnvelope::encode_value::<
8700 ::fidl_next::WireString<'static>,
8701 ___E,
8702 >(
8703 value, preallocated.encoder, &mut out, 1024
8704 )?;
8705 } else {
8706 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8707 }
8708 }
8709
8710 2 => {
8711 if let Some(value) = self.source_name.take() {
8712 ::fidl_next::WireEnvelope::encode_value::<
8713 ::fidl_next::WireString<'static>,
8714 ___E,
8715 >(
8716 value, preallocated.encoder, &mut out, 100
8717 )?;
8718 } else {
8719 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8720 }
8721 }
8722
8723 1 => {
8724 if let Some(value) = self.source.take() {
8725 ::fidl_next::WireEnvelope::encode_value::<
8726 crate::wire::Ref<'static>,
8727 ___E,
8728 >(
8729 value, preallocated.encoder, &mut out, ()
8730 )?;
8731 } else {
8732 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8733 }
8734 }
8735
8736 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8737 }
8738 unsafe {
8739 preallocated.write_next(out.assume_init_ref());
8740 }
8741 }
8742
8743 ::fidl_next::WireTable::encode_len(table, max_ord);
8744
8745 Ok(())
8746 }
8747 }
8748
8749 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseProtocol<'static>, ___E>
8750 for &'a UseProtocol
8751 where
8752 ___E: ::fidl_next::Encoder + ?Sized,
8753 {
8754 #[inline]
8755 fn encode(
8756 self,
8757 encoder: &mut ___E,
8758 out: &mut ::core::mem::MaybeUninit<crate::wire::UseProtocol<'static>>,
8759 _: (),
8760 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
8761 ::fidl_next::munge!(let crate::wire::UseProtocol { table } = out);
8762
8763 let max_ord = self.__max_ordinal();
8764
8765 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
8766 ::fidl_next::Wire::zero_padding(&mut out);
8767
8768 let mut preallocated =
8769 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
8770
8771 for i in 1..=max_ord {
8772 match i {
8773 7 => {
8774 if let Some(value) = &self.numbered_handle {
8775 ::fidl_next::WireEnvelope::encode_value::<u8, ___E>(
8776 value,
8777 preallocated.encoder,
8778 &mut out,
8779 (),
8780 )?;
8781 } else {
8782 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8783 }
8784 }
8785
8786 6 => {
8787 if let Some(value) = &self.source_dictionary {
8788 ::fidl_next::WireEnvelope::encode_value::<
8789 ::fidl_next::WireString<'static>,
8790 ___E,
8791 >(
8792 value, preallocated.encoder, &mut out, 1024
8793 )?;
8794 } else {
8795 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8796 }
8797 }
8798
8799 5 => {
8800 if let Some(value) = &self.availability {
8801 ::fidl_next::WireEnvelope::encode_value::<
8802 crate::wire::Availability,
8803 ___E,
8804 >(
8805 value, preallocated.encoder, &mut out, ()
8806 )?;
8807 } else {
8808 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8809 }
8810 }
8811
8812 4 => {
8813 if let Some(value) = &self.dependency_type {
8814 ::fidl_next::WireEnvelope::encode_value::<
8815 crate::wire::DependencyType,
8816 ___E,
8817 >(
8818 value, preallocated.encoder, &mut out, ()
8819 )?;
8820 } else {
8821 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8822 }
8823 }
8824
8825 3 => {
8826 if let Some(value) = &self.target_path {
8827 ::fidl_next::WireEnvelope::encode_value::<
8828 ::fidl_next::WireString<'static>,
8829 ___E,
8830 >(
8831 value, preallocated.encoder, &mut out, 1024
8832 )?;
8833 } else {
8834 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8835 }
8836 }
8837
8838 2 => {
8839 if let Some(value) = &self.source_name {
8840 ::fidl_next::WireEnvelope::encode_value::<
8841 ::fidl_next::WireString<'static>,
8842 ___E,
8843 >(
8844 value, preallocated.encoder, &mut out, 100
8845 )?;
8846 } else {
8847 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8848 }
8849 }
8850
8851 1 => {
8852 if let Some(value) = &self.source {
8853 ::fidl_next::WireEnvelope::encode_value::<
8854 crate::wire::Ref<'static>,
8855 ___E,
8856 >(
8857 value, preallocated.encoder, &mut out, ()
8858 )?;
8859 } else {
8860 ::fidl_next::WireEnvelope::encode_zero(&mut out)
8861 }
8862 }
8863
8864 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
8865 }
8866 unsafe {
8867 preallocated.write_next(out.assume_init_ref());
8868 }
8869 }
8870
8871 ::fidl_next::WireTable::encode_len(table, max_ord);
8872
8873 Ok(())
8874 }
8875 }
8876
8877 impl<'de> ::fidl_next::FromWire<crate::wire::UseProtocol<'de>> for UseProtocol {
8878 #[inline]
8879 fn from_wire(wire_: crate::wire::UseProtocol<'de>) -> Self {
8880 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
8881
8882 let source = wire_.table.get(1);
8883
8884 let source_name = wire_.table.get(2);
8885
8886 let target_path = wire_.table.get(3);
8887
8888 let dependency_type = wire_.table.get(4);
8889
8890 let availability = wire_.table.get(5);
8891
8892 let source_dictionary = wire_.table.get(6);
8893
8894 let numbered_handle = wire_.table.get(7);
8895
8896 Self {
8897 source: source.map(|envelope| {
8898 ::fidl_next::FromWire::from_wire(unsafe {
8899 envelope.read_unchecked::<crate::wire::Ref<'de>>()
8900 })
8901 }),
8902
8903 source_name: source_name.map(|envelope| {
8904 ::fidl_next::FromWire::from_wire(unsafe {
8905 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
8906 })
8907 }),
8908
8909 target_path: target_path.map(|envelope| {
8910 ::fidl_next::FromWire::from_wire(unsafe {
8911 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
8912 })
8913 }),
8914
8915 dependency_type: dependency_type.map(|envelope| {
8916 ::fidl_next::FromWire::from_wire(unsafe {
8917 envelope.read_unchecked::<crate::wire::DependencyType>()
8918 })
8919 }),
8920
8921 availability: availability.map(|envelope| {
8922 ::fidl_next::FromWire::from_wire(unsafe {
8923 envelope.read_unchecked::<crate::wire::Availability>()
8924 })
8925 }),
8926
8927 source_dictionary: source_dictionary.map(|envelope| {
8928 ::fidl_next::FromWire::from_wire(unsafe {
8929 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
8930 })
8931 }),
8932
8933 numbered_handle: numbered_handle.map(|envelope| {
8934 ::fidl_next::FromWire::from_wire(unsafe { envelope.read_unchecked::<u8>() })
8935 }),
8936 }
8937 }
8938 }
8939
8940 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseProtocol<'de>> for UseProtocol {
8941 #[inline]
8942 fn from_wire_ref(wire: &crate::wire::UseProtocol<'de>) -> Self {
8943 Self {
8944 source: wire.table.get(1).map(|envelope| {
8945 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8946 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
8947 })
8948 }),
8949
8950 source_name: wire.table.get(2).map(|envelope| {
8951 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8952 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
8953 })
8954 }),
8955
8956 target_path: wire.table.get(3).map(|envelope| {
8957 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8958 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
8959 })
8960 }),
8961
8962 dependency_type: wire.table.get(4).map(|envelope| {
8963 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8964 envelope.deref_unchecked::<crate::wire::DependencyType>()
8965 })
8966 }),
8967
8968 availability: wire.table.get(5).map(|envelope| {
8969 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8970 envelope.deref_unchecked::<crate::wire::Availability>()
8971 })
8972 }),
8973
8974 source_dictionary: wire.table.get(6).map(|envelope| {
8975 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8976 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
8977 })
8978 }),
8979
8980 numbered_handle: wire.table.get(7).map(|envelope| {
8981 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
8982 envelope.deref_unchecked::<u8>()
8983 })
8984 }),
8985 }
8986 }
8987 }
8988
8989 #[doc = " Declares a directory used by a component, which was offered to it.\n"]
8990 #[derive(PartialEq, Clone, Debug, Default)]
8991 pub struct UseDirectory {
8992 pub source: ::core::option::Option<crate::natural::Ref>,
8993
8994 pub source_name: ::core::option::Option<::std::string::String>,
8995
8996 pub target_path: ::core::option::Option<::std::string::String>,
8997
8998 pub rights: ::core::option::Option<::fidl_next_common_fuchsia_io::natural::Operations>,
8999
9000 pub subdir: ::core::option::Option<::std::string::String>,
9001
9002 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
9003
9004 pub availability: ::core::option::Option<crate::natural::Availability>,
9005
9006 pub source_dictionary: ::core::option::Option<::std::string::String>,
9007 }
9008
9009 impl UseDirectory {
9010 fn __max_ordinal(&self) -> usize {
9011 if self.source_dictionary.is_some() {
9012 return 8;
9013 }
9014
9015 if self.availability.is_some() {
9016 return 7;
9017 }
9018
9019 if self.dependency_type.is_some() {
9020 return 6;
9021 }
9022
9023 if self.subdir.is_some() {
9024 return 5;
9025 }
9026
9027 if self.rights.is_some() {
9028 return 4;
9029 }
9030
9031 if self.target_path.is_some() {
9032 return 3;
9033 }
9034
9035 if self.source_name.is_some() {
9036 return 2;
9037 }
9038
9039 if self.source.is_some() {
9040 return 1;
9041 }
9042
9043 0
9044 }
9045 }
9046
9047 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseDirectory<'static>, ___E> for UseDirectory
9048 where
9049 ___E: ::fidl_next::Encoder + ?Sized,
9050 {
9051 #[inline]
9052 fn encode(
9053 mut self,
9054 encoder: &mut ___E,
9055 out: &mut ::core::mem::MaybeUninit<crate::wire::UseDirectory<'static>>,
9056 _: (),
9057 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9058 ::fidl_next::munge!(let crate::wire::UseDirectory { table } = out);
9059
9060 let max_ord = self.__max_ordinal();
9061
9062 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9063 ::fidl_next::Wire::zero_padding(&mut out);
9064
9065 let mut preallocated =
9066 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9067
9068 for i in 1..=max_ord {
9069 match i {
9070 8 => {
9071 if let Some(value) = self.source_dictionary.take() {
9072 ::fidl_next::WireEnvelope::encode_value::<
9073 ::fidl_next::WireString<'static>,
9074 ___E,
9075 >(
9076 value, preallocated.encoder, &mut out, 1024
9077 )?;
9078 } else {
9079 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9080 }
9081 }
9082
9083 7 => {
9084 if let Some(value) = self.availability.take() {
9085 ::fidl_next::WireEnvelope::encode_value::<
9086 crate::wire::Availability,
9087 ___E,
9088 >(
9089 value, preallocated.encoder, &mut out, ()
9090 )?;
9091 } else {
9092 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9093 }
9094 }
9095
9096 6 => {
9097 if let Some(value) = self.dependency_type.take() {
9098 ::fidl_next::WireEnvelope::encode_value::<
9099 crate::wire::DependencyType,
9100 ___E,
9101 >(
9102 value, preallocated.encoder, &mut out, ()
9103 )?;
9104 } else {
9105 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9106 }
9107 }
9108
9109 5 => {
9110 if let Some(value) = self.subdir.take() {
9111 ::fidl_next::WireEnvelope::encode_value::<
9112 ::fidl_next::WireString<'static>,
9113 ___E,
9114 >(
9115 value, preallocated.encoder, &mut out, 1024
9116 )?;
9117 } else {
9118 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9119 }
9120 }
9121
9122 4 => {
9123 if let Some(value) = self.rights.take() {
9124 ::fidl_next::WireEnvelope::encode_value::<
9125 ::fidl_next_common_fuchsia_io::wire::Operations,
9126 ___E,
9127 >(
9128 value, preallocated.encoder, &mut out, ()
9129 )?;
9130 } else {
9131 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9132 }
9133 }
9134
9135 3 => {
9136 if let Some(value) = self.target_path.take() {
9137 ::fidl_next::WireEnvelope::encode_value::<
9138 ::fidl_next::WireString<'static>,
9139 ___E,
9140 >(
9141 value, preallocated.encoder, &mut out, 1024
9142 )?;
9143 } else {
9144 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9145 }
9146 }
9147
9148 2 => {
9149 if let Some(value) = self.source_name.take() {
9150 ::fidl_next::WireEnvelope::encode_value::<
9151 ::fidl_next::WireString<'static>,
9152 ___E,
9153 >(
9154 value, preallocated.encoder, &mut out, 100
9155 )?;
9156 } else {
9157 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9158 }
9159 }
9160
9161 1 => {
9162 if let Some(value) = self.source.take() {
9163 ::fidl_next::WireEnvelope::encode_value::<
9164 crate::wire::Ref<'static>,
9165 ___E,
9166 >(
9167 value, preallocated.encoder, &mut out, ()
9168 )?;
9169 } else {
9170 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9171 }
9172 }
9173
9174 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9175 }
9176 unsafe {
9177 preallocated.write_next(out.assume_init_ref());
9178 }
9179 }
9180
9181 ::fidl_next::WireTable::encode_len(table, max_ord);
9182
9183 Ok(())
9184 }
9185 }
9186
9187 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseDirectory<'static>, ___E>
9188 for &'a UseDirectory
9189 where
9190 ___E: ::fidl_next::Encoder + ?Sized,
9191 {
9192 #[inline]
9193 fn encode(
9194 self,
9195 encoder: &mut ___E,
9196 out: &mut ::core::mem::MaybeUninit<crate::wire::UseDirectory<'static>>,
9197 _: (),
9198 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9199 ::fidl_next::munge!(let crate::wire::UseDirectory { table } = out);
9200
9201 let max_ord = self.__max_ordinal();
9202
9203 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9204 ::fidl_next::Wire::zero_padding(&mut out);
9205
9206 let mut preallocated =
9207 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9208
9209 for i in 1..=max_ord {
9210 match i {
9211 8 => {
9212 if let Some(value) = &self.source_dictionary {
9213 ::fidl_next::WireEnvelope::encode_value::<
9214 ::fidl_next::WireString<'static>,
9215 ___E,
9216 >(
9217 value, preallocated.encoder, &mut out, 1024
9218 )?;
9219 } else {
9220 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9221 }
9222 }
9223
9224 7 => {
9225 if let Some(value) = &self.availability {
9226 ::fidl_next::WireEnvelope::encode_value::<
9227 crate::wire::Availability,
9228 ___E,
9229 >(
9230 value, preallocated.encoder, &mut out, ()
9231 )?;
9232 } else {
9233 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9234 }
9235 }
9236
9237 6 => {
9238 if let Some(value) = &self.dependency_type {
9239 ::fidl_next::WireEnvelope::encode_value::<
9240 crate::wire::DependencyType,
9241 ___E,
9242 >(
9243 value, preallocated.encoder, &mut out, ()
9244 )?;
9245 } else {
9246 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9247 }
9248 }
9249
9250 5 => {
9251 if let Some(value) = &self.subdir {
9252 ::fidl_next::WireEnvelope::encode_value::<
9253 ::fidl_next::WireString<'static>,
9254 ___E,
9255 >(
9256 value, preallocated.encoder, &mut out, 1024
9257 )?;
9258 } else {
9259 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9260 }
9261 }
9262
9263 4 => {
9264 if let Some(value) = &self.rights {
9265 ::fidl_next::WireEnvelope::encode_value::<
9266 ::fidl_next_common_fuchsia_io::wire::Operations,
9267 ___E,
9268 >(
9269 value, preallocated.encoder, &mut out, ()
9270 )?;
9271 } else {
9272 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9273 }
9274 }
9275
9276 3 => {
9277 if let Some(value) = &self.target_path {
9278 ::fidl_next::WireEnvelope::encode_value::<
9279 ::fidl_next::WireString<'static>,
9280 ___E,
9281 >(
9282 value, preallocated.encoder, &mut out, 1024
9283 )?;
9284 } else {
9285 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9286 }
9287 }
9288
9289 2 => {
9290 if let Some(value) = &self.source_name {
9291 ::fidl_next::WireEnvelope::encode_value::<
9292 ::fidl_next::WireString<'static>,
9293 ___E,
9294 >(
9295 value, preallocated.encoder, &mut out, 100
9296 )?;
9297 } else {
9298 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9299 }
9300 }
9301
9302 1 => {
9303 if let Some(value) = &self.source {
9304 ::fidl_next::WireEnvelope::encode_value::<
9305 crate::wire::Ref<'static>,
9306 ___E,
9307 >(
9308 value, preallocated.encoder, &mut out, ()
9309 )?;
9310 } else {
9311 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9312 }
9313 }
9314
9315 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9316 }
9317 unsafe {
9318 preallocated.write_next(out.assume_init_ref());
9319 }
9320 }
9321
9322 ::fidl_next::WireTable::encode_len(table, max_ord);
9323
9324 Ok(())
9325 }
9326 }
9327
9328 impl<'de> ::fidl_next::FromWire<crate::wire::UseDirectory<'de>> for UseDirectory {
9329 #[inline]
9330 fn from_wire(wire_: crate::wire::UseDirectory<'de>) -> Self {
9331 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
9332
9333 let source = wire_.table.get(1);
9334
9335 let source_name = wire_.table.get(2);
9336
9337 let target_path = wire_.table.get(3);
9338
9339 let rights = wire_.table.get(4);
9340
9341 let subdir = wire_.table.get(5);
9342
9343 let dependency_type = wire_.table.get(6);
9344
9345 let availability = wire_.table.get(7);
9346
9347 let source_dictionary = wire_.table.get(8);
9348
9349 Self {
9350 source: source.map(|envelope| {
9351 ::fidl_next::FromWire::from_wire(unsafe {
9352 envelope.read_unchecked::<crate::wire::Ref<'de>>()
9353 })
9354 }),
9355
9356 source_name: source_name.map(|envelope| {
9357 ::fidl_next::FromWire::from_wire(unsafe {
9358 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
9359 })
9360 }),
9361
9362 target_path: target_path.map(|envelope| {
9363 ::fidl_next::FromWire::from_wire(unsafe {
9364 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
9365 })
9366 }),
9367
9368 rights: rights.map(|envelope| {
9369 ::fidl_next::FromWire::from_wire(unsafe {
9370 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
9371 })
9372 }),
9373
9374 subdir: subdir.map(|envelope| {
9375 ::fidl_next::FromWire::from_wire(unsafe {
9376 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
9377 })
9378 }),
9379
9380 dependency_type: dependency_type.map(|envelope| {
9381 ::fidl_next::FromWire::from_wire(unsafe {
9382 envelope.read_unchecked::<crate::wire::DependencyType>()
9383 })
9384 }),
9385
9386 availability: availability.map(|envelope| {
9387 ::fidl_next::FromWire::from_wire(unsafe {
9388 envelope.read_unchecked::<crate::wire::Availability>()
9389 })
9390 }),
9391
9392 source_dictionary: source_dictionary.map(|envelope| {
9393 ::fidl_next::FromWire::from_wire(unsafe {
9394 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
9395 })
9396 }),
9397 }
9398 }
9399 }
9400
9401 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseDirectory<'de>> for UseDirectory {
9402 #[inline]
9403 fn from_wire_ref(wire: &crate::wire::UseDirectory<'de>) -> Self {
9404 Self {
9405 source: wire.table.get(1).map(|envelope| {
9406 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9407 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
9408 })
9409 }),
9410
9411 source_name: wire.table.get(2).map(|envelope| {
9412 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9413 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
9414 })
9415 }),
9416
9417 target_path: wire.table.get(3).map(|envelope| {
9418 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9419 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
9420 })
9421 }),
9422
9423 rights: wire.table.get(4).map(|envelope| {
9424 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9425 envelope
9426 .deref_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
9427 })
9428 }),
9429
9430 subdir: wire.table.get(5).map(|envelope| {
9431 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9432 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
9433 })
9434 }),
9435
9436 dependency_type: wire.table.get(6).map(|envelope| {
9437 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9438 envelope.deref_unchecked::<crate::wire::DependencyType>()
9439 })
9440 }),
9441
9442 availability: wire.table.get(7).map(|envelope| {
9443 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9444 envelope.deref_unchecked::<crate::wire::Availability>()
9445 })
9446 }),
9447
9448 source_dictionary: wire.table.get(8).map(|envelope| {
9449 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
9450 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
9451 })
9452 }),
9453 }
9454 }
9455 }
9456
9457 #[doc = " Declares an EventStream used by a component.\n"]
9458 #[derive(PartialEq, Clone, Debug, Default)]
9459 pub struct UseEventStream {
9460 pub source_name: ::core::option::Option<::std::string::String>,
9461
9462 pub source: ::core::option::Option<crate::natural::Ref>,
9463
9464 pub scope: ::core::option::Option<::std::vec::Vec<crate::natural::Ref>>,
9465
9466 pub target_path: ::core::option::Option<::std::string::String>,
9467
9468 pub availability: ::core::option::Option<crate::natural::Availability>,
9469
9470 pub filter: ::core::option::Option<::fidl_next_common_fuchsia_data::natural::Dictionary>,
9471 }
9472
9473 impl UseEventStream {
9474 fn __max_ordinal(&self) -> usize {
9475 if self.filter.is_some() {
9476 return 6;
9477 }
9478
9479 if self.availability.is_some() {
9480 return 5;
9481 }
9482
9483 if self.target_path.is_some() {
9484 return 4;
9485 }
9486
9487 if self.scope.is_some() {
9488 return 3;
9489 }
9490
9491 if self.source.is_some() {
9492 return 2;
9493 }
9494
9495 if self.source_name.is_some() {
9496 return 1;
9497 }
9498
9499 0
9500 }
9501 }
9502
9503 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseEventStream<'static>, ___E> for UseEventStream
9504 where
9505 ___E: ::fidl_next::Encoder + ?Sized,
9506 {
9507 #[inline]
9508 fn encode(
9509 mut self,
9510 encoder: &mut ___E,
9511 out: &mut ::core::mem::MaybeUninit<crate::wire::UseEventStream<'static>>,
9512 _: (),
9513 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9514 ::fidl_next::munge!(let crate::wire::UseEventStream { table } = out);
9515
9516 let max_ord = self.__max_ordinal();
9517
9518 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9519 ::fidl_next::Wire::zero_padding(&mut out);
9520
9521 let mut preallocated =
9522 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9523
9524 for i in 1..=max_ord {
9525 match i {
9526 6 => {
9527 if let Some(value) = self.filter.take() {
9528 ::fidl_next::WireEnvelope::encode_value::<
9529 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
9530 ___E,
9531 >(
9532 value, preallocated.encoder, &mut out, ()
9533 )?;
9534 } else {
9535 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9536 }
9537 }
9538
9539 5 => {
9540 if let Some(value) = self.availability.take() {
9541 ::fidl_next::WireEnvelope::encode_value::<
9542 crate::wire::Availability,
9543 ___E,
9544 >(
9545 value, preallocated.encoder, &mut out, ()
9546 )?;
9547 } else {
9548 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9549 }
9550 }
9551
9552 4 => {
9553 if let Some(value) = self.target_path.take() {
9554 ::fidl_next::WireEnvelope::encode_value::<
9555 ::fidl_next::WireString<'static>,
9556 ___E,
9557 >(
9558 value, preallocated.encoder, &mut out, 100
9559 )?;
9560 } else {
9561 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9562 }
9563 }
9564
9565 3 => {
9566 if let Some(value) = self.scope.take() {
9567 ::fidl_next::WireEnvelope::encode_value::<
9568 ::fidl_next::WireVector<'static, crate::wire::Ref<'static>>,
9569 ___E,
9570 >(
9571 value, preallocated.encoder, &mut out, (4294967295, ())
9572 )?;
9573 } else {
9574 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9575 }
9576 }
9577
9578 2 => {
9579 if let Some(value) = self.source.take() {
9580 ::fidl_next::WireEnvelope::encode_value::<
9581 crate::wire::Ref<'static>,
9582 ___E,
9583 >(
9584 value, preallocated.encoder, &mut out, ()
9585 )?;
9586 } else {
9587 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9588 }
9589 }
9590
9591 1 => {
9592 if let Some(value) = self.source_name.take() {
9593 ::fidl_next::WireEnvelope::encode_value::<
9594 ::fidl_next::WireString<'static>,
9595 ___E,
9596 >(
9597 value, preallocated.encoder, &mut out, 100
9598 )?;
9599 } else {
9600 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9601 }
9602 }
9603
9604 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9605 }
9606 unsafe {
9607 preallocated.write_next(out.assume_init_ref());
9608 }
9609 }
9610
9611 ::fidl_next::WireTable::encode_len(table, max_ord);
9612
9613 Ok(())
9614 }
9615 }
9616
9617 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseEventStream<'static>, ___E>
9618 for &'a UseEventStream
9619 where
9620 ___E: ::fidl_next::Encoder + ?Sized,
9621 {
9622 #[inline]
9623 fn encode(
9624 self,
9625 encoder: &mut ___E,
9626 out: &mut ::core::mem::MaybeUninit<crate::wire::UseEventStream<'static>>,
9627 _: (),
9628 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9629 ::fidl_next::munge!(let crate::wire::UseEventStream { table } = out);
9630
9631 let max_ord = self.__max_ordinal();
9632
9633 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9634 ::fidl_next::Wire::zero_padding(&mut out);
9635
9636 let mut preallocated =
9637 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9638
9639 for i in 1..=max_ord {
9640 match i {
9641 6 => {
9642 if let Some(value) = &self.filter {
9643 ::fidl_next::WireEnvelope::encode_value::<
9644 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
9645 ___E,
9646 >(
9647 value, preallocated.encoder, &mut out, ()
9648 )?;
9649 } else {
9650 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9651 }
9652 }
9653
9654 5 => {
9655 if let Some(value) = &self.availability {
9656 ::fidl_next::WireEnvelope::encode_value::<
9657 crate::wire::Availability,
9658 ___E,
9659 >(
9660 value, preallocated.encoder, &mut out, ()
9661 )?;
9662 } else {
9663 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9664 }
9665 }
9666
9667 4 => {
9668 if let Some(value) = &self.target_path {
9669 ::fidl_next::WireEnvelope::encode_value::<
9670 ::fidl_next::WireString<'static>,
9671 ___E,
9672 >(
9673 value, preallocated.encoder, &mut out, 100
9674 )?;
9675 } else {
9676 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9677 }
9678 }
9679
9680 3 => {
9681 if let Some(value) = &self.scope {
9682 ::fidl_next::WireEnvelope::encode_value::<
9683 ::fidl_next::WireVector<'static, crate::wire::Ref<'static>>,
9684 ___E,
9685 >(
9686 value, preallocated.encoder, &mut out, (4294967295, ())
9687 )?;
9688 } else {
9689 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9690 }
9691 }
9692
9693 2 => {
9694 if let Some(value) = &self.source {
9695 ::fidl_next::WireEnvelope::encode_value::<
9696 crate::wire::Ref<'static>,
9697 ___E,
9698 >(
9699 value, preallocated.encoder, &mut out, ()
9700 )?;
9701 } else {
9702 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9703 }
9704 }
9705
9706 1 => {
9707 if let Some(value) = &self.source_name {
9708 ::fidl_next::WireEnvelope::encode_value::<
9709 ::fidl_next::WireString<'static>,
9710 ___E,
9711 >(
9712 value, preallocated.encoder, &mut out, 100
9713 )?;
9714 } else {
9715 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9716 }
9717 }
9718
9719 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9720 }
9721 unsafe {
9722 preallocated.write_next(out.assume_init_ref());
9723 }
9724 }
9725
9726 ::fidl_next::WireTable::encode_len(table, max_ord);
9727
9728 Ok(())
9729 }
9730 }
9731
9732 impl<'de> ::fidl_next::FromWire<crate::wire::UseEventStream<'de>> for UseEventStream {
9733 #[inline]
9734 fn from_wire(wire_: crate::wire::UseEventStream<'de>) -> Self {
9735 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
9736
9737 let source_name = wire_.table.get(1);
9738
9739 let source = wire_.table.get(2);
9740
9741 let scope = wire_.table.get(3);
9742
9743 let target_path = wire_.table.get(4);
9744
9745 let availability = wire_.table.get(5);
9746
9747 let filter = wire_.table.get(6);
9748
9749 Self {
9750
9751
9752 source_name: source_name.map(|envelope| ::fidl_next::FromWire::from_wire(
9753 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
9754 )),
9755
9756
9757 source: source.map(|envelope| ::fidl_next::FromWire::from_wire(
9758 unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() }
9759 )),
9760
9761
9762 scope: scope.map(|envelope| ::fidl_next::FromWire::from_wire(
9763 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Ref<'de>>>() }
9764 )),
9765
9766
9767 target_path: target_path.map(|envelope| ::fidl_next::FromWire::from_wire(
9768 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
9769 )),
9770
9771
9772 availability: availability.map(|envelope| ::fidl_next::FromWire::from_wire(
9773 unsafe { envelope.read_unchecked::<crate::wire::Availability>() }
9774 )),
9775
9776
9777 filter: filter.map(|envelope| ::fidl_next::FromWire::from_wire(
9778 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
9779 )),
9780
9781 }
9782 }
9783 }
9784
9785 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseEventStream<'de>> for UseEventStream {
9786 #[inline]
9787 fn from_wire_ref(wire: &crate::wire::UseEventStream<'de>) -> Self {
9788 Self {
9789
9790
9791 source_name: wire.table.get(1)
9792 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9793 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
9794 )),
9795
9796
9797 source: wire.table.get(2)
9798 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9799 unsafe { envelope.deref_unchecked::<crate::wire::Ref<'de>>() }
9800 )),
9801
9802
9803 scope: wire.table.get(3)
9804 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9805 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::wire::Ref<'de>>>() }
9806 )),
9807
9808
9809 target_path: wire.table.get(4)
9810 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9811 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
9812 )),
9813
9814
9815 availability: wire.table.get(5)
9816 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9817 unsafe { envelope.deref_unchecked::<crate::wire::Availability>() }
9818 )),
9819
9820
9821 filter: wire.table.get(6)
9822 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
9823 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
9824 )),
9825
9826 }
9827 }
9828 }
9829
9830 #[doc = " Declares runner used by a component.\n"]
9831 #[derive(PartialEq, Clone, Debug, Default)]
9832 pub struct UseRunner {
9833 pub source: ::core::option::Option<crate::natural::Ref>,
9834
9835 pub source_name: ::core::option::Option<::std::string::String>,
9836
9837 pub source_dictionary: ::core::option::Option<::std::string::String>,
9838 }
9839
9840 impl UseRunner {
9841 fn __max_ordinal(&self) -> usize {
9842 if self.source_dictionary.is_some() {
9843 return 3;
9844 }
9845
9846 if self.source_name.is_some() {
9847 return 2;
9848 }
9849
9850 if self.source.is_some() {
9851 return 1;
9852 }
9853
9854 0
9855 }
9856 }
9857
9858 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseRunner<'static>, ___E> for UseRunner
9859 where
9860 ___E: ::fidl_next::Encoder + ?Sized,
9861 {
9862 #[inline]
9863 fn encode(
9864 mut self,
9865 encoder: &mut ___E,
9866 out: &mut ::core::mem::MaybeUninit<crate::wire::UseRunner<'static>>,
9867 _: (),
9868 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9869 ::fidl_next::munge!(let crate::wire::UseRunner { table } = out);
9870
9871 let max_ord = self.__max_ordinal();
9872
9873 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9874 ::fidl_next::Wire::zero_padding(&mut out);
9875
9876 let mut preallocated =
9877 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9878
9879 for i in 1..=max_ord {
9880 match i {
9881 3 => {
9882 if let Some(value) = self.source_dictionary.take() {
9883 ::fidl_next::WireEnvelope::encode_value::<
9884 ::fidl_next::WireString<'static>,
9885 ___E,
9886 >(
9887 value, preallocated.encoder, &mut out, 1024
9888 )?;
9889 } else {
9890 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9891 }
9892 }
9893
9894 2 => {
9895 if let Some(value) = self.source_name.take() {
9896 ::fidl_next::WireEnvelope::encode_value::<
9897 ::fidl_next::WireString<'static>,
9898 ___E,
9899 >(
9900 value, preallocated.encoder, &mut out, 100
9901 )?;
9902 } else {
9903 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9904 }
9905 }
9906
9907 1 => {
9908 if let Some(value) = self.source.take() {
9909 ::fidl_next::WireEnvelope::encode_value::<
9910 crate::wire::Ref<'static>,
9911 ___E,
9912 >(
9913 value, preallocated.encoder, &mut out, ()
9914 )?;
9915 } else {
9916 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9917 }
9918 }
9919
9920 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9921 }
9922 unsafe {
9923 preallocated.write_next(out.assume_init_ref());
9924 }
9925 }
9926
9927 ::fidl_next::WireTable::encode_len(table, max_ord);
9928
9929 Ok(())
9930 }
9931 }
9932
9933 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseRunner<'static>, ___E> for &'a UseRunner
9934 where
9935 ___E: ::fidl_next::Encoder + ?Sized,
9936 {
9937 #[inline]
9938 fn encode(
9939 self,
9940 encoder: &mut ___E,
9941 out: &mut ::core::mem::MaybeUninit<crate::wire::UseRunner<'static>>,
9942 _: (),
9943 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
9944 ::fidl_next::munge!(let crate::wire::UseRunner { table } = out);
9945
9946 let max_ord = self.__max_ordinal();
9947
9948 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
9949 ::fidl_next::Wire::zero_padding(&mut out);
9950
9951 let mut preallocated =
9952 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
9953
9954 for i in 1..=max_ord {
9955 match i {
9956 3 => {
9957 if let Some(value) = &self.source_dictionary {
9958 ::fidl_next::WireEnvelope::encode_value::<
9959 ::fidl_next::WireString<'static>,
9960 ___E,
9961 >(
9962 value, preallocated.encoder, &mut out, 1024
9963 )?;
9964 } else {
9965 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9966 }
9967 }
9968
9969 2 => {
9970 if let Some(value) = &self.source_name {
9971 ::fidl_next::WireEnvelope::encode_value::<
9972 ::fidl_next::WireString<'static>,
9973 ___E,
9974 >(
9975 value, preallocated.encoder, &mut out, 100
9976 )?;
9977 } else {
9978 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9979 }
9980 }
9981
9982 1 => {
9983 if let Some(value) = &self.source {
9984 ::fidl_next::WireEnvelope::encode_value::<
9985 crate::wire::Ref<'static>,
9986 ___E,
9987 >(
9988 value, preallocated.encoder, &mut out, ()
9989 )?;
9990 } else {
9991 ::fidl_next::WireEnvelope::encode_zero(&mut out)
9992 }
9993 }
9994
9995 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
9996 }
9997 unsafe {
9998 preallocated.write_next(out.assume_init_ref());
9999 }
10000 }
10001
10002 ::fidl_next::WireTable::encode_len(table, max_ord);
10003
10004 Ok(())
10005 }
10006 }
10007
10008 impl<'de> ::fidl_next::FromWire<crate::wire::UseRunner<'de>> for UseRunner {
10009 #[inline]
10010 fn from_wire(wire_: crate::wire::UseRunner<'de>) -> Self {
10011 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
10012
10013 let source = wire_.table.get(1);
10014
10015 let source_name = wire_.table.get(2);
10016
10017 let source_dictionary = wire_.table.get(3);
10018
10019 Self {
10020 source: source.map(|envelope| {
10021 ::fidl_next::FromWire::from_wire(unsafe {
10022 envelope.read_unchecked::<crate::wire::Ref<'de>>()
10023 })
10024 }),
10025
10026 source_name: source_name.map(|envelope| {
10027 ::fidl_next::FromWire::from_wire(unsafe {
10028 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
10029 })
10030 }),
10031
10032 source_dictionary: source_dictionary.map(|envelope| {
10033 ::fidl_next::FromWire::from_wire(unsafe {
10034 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
10035 })
10036 }),
10037 }
10038 }
10039 }
10040
10041 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseRunner<'de>> for UseRunner {
10042 #[inline]
10043 fn from_wire_ref(wire: &crate::wire::UseRunner<'de>) -> Self {
10044 Self {
10045 source: wire.table.get(1).map(|envelope| {
10046 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10047 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
10048 })
10049 }),
10050
10051 source_name: wire.table.get(2).map(|envelope| {
10052 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10053 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
10054 })
10055 }),
10056
10057 source_dictionary: wire.table.get(3).map(|envelope| {
10058 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10059 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
10060 })
10061 }),
10062 }
10063 }
10064 }
10065
10066 #[derive(PartialEq, Clone, Debug, Default)]
10067 pub struct UseConfiguration {
10068 pub source: ::core::option::Option<crate::natural::Ref>,
10069
10070 pub source_name: ::core::option::Option<::std::string::String>,
10071
10072 pub target_name: ::core::option::Option<::std::string::String>,
10073
10074 pub availability: ::core::option::Option<crate::natural::Availability>,
10075
10076 pub type_: ::core::option::Option<crate::natural::ConfigType>,
10077
10078 pub default: ::core::option::Option<crate::natural::ConfigValue>,
10079
10080 pub source_dictionary: ::core::option::Option<::std::string::String>,
10081 }
10082
10083 impl UseConfiguration {
10084 fn __max_ordinal(&self) -> usize {
10085 if self.source_dictionary.is_some() {
10086 return 7;
10087 }
10088
10089 if self.default.is_some() {
10090 return 6;
10091 }
10092
10093 if self.type_.is_some() {
10094 return 5;
10095 }
10096
10097 if self.availability.is_some() {
10098 return 4;
10099 }
10100
10101 if self.target_name.is_some() {
10102 return 3;
10103 }
10104
10105 if self.source_name.is_some() {
10106 return 2;
10107 }
10108
10109 if self.source.is_some() {
10110 return 1;
10111 }
10112
10113 0
10114 }
10115 }
10116
10117 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseConfiguration<'static>, ___E>
10118 for UseConfiguration
10119 where
10120 ___E: ::fidl_next::Encoder + ?Sized,
10121 {
10122 #[inline]
10123 fn encode(
10124 mut self,
10125 encoder: &mut ___E,
10126 out: &mut ::core::mem::MaybeUninit<crate::wire::UseConfiguration<'static>>,
10127 _: (),
10128 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10129 ::fidl_next::munge!(let crate::wire::UseConfiguration { table } = out);
10130
10131 let max_ord = self.__max_ordinal();
10132
10133 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10134 ::fidl_next::Wire::zero_padding(&mut out);
10135
10136 let mut preallocated =
10137 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10138
10139 for i in 1..=max_ord {
10140 match i {
10141 7 => {
10142 if let Some(value) = self.source_dictionary.take() {
10143 ::fidl_next::WireEnvelope::encode_value::<
10144 ::fidl_next::WireString<'static>,
10145 ___E,
10146 >(
10147 value, preallocated.encoder, &mut out, 1024
10148 )?;
10149 } else {
10150 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10151 }
10152 }
10153
10154 6 => {
10155 if let Some(value) = self.default.take() {
10156 ::fidl_next::WireEnvelope::encode_value::<
10157 crate::wire::ConfigValue<'static>,
10158 ___E,
10159 >(
10160 value, preallocated.encoder, &mut out, ()
10161 )?;
10162 } else {
10163 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10164 }
10165 }
10166
10167 5 => {
10168 if let Some(value) = self.type_.take() {
10169 ::fidl_next::WireEnvelope::encode_value::<
10170 crate::wire::ConfigType<'static>,
10171 ___E,
10172 >(
10173 value, preallocated.encoder, &mut out, ()
10174 )?;
10175 } else {
10176 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10177 }
10178 }
10179
10180 4 => {
10181 if let Some(value) = self.availability.take() {
10182 ::fidl_next::WireEnvelope::encode_value::<
10183 crate::wire::Availability,
10184 ___E,
10185 >(
10186 value, preallocated.encoder, &mut out, ()
10187 )?;
10188 } else {
10189 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10190 }
10191 }
10192
10193 3 => {
10194 if let Some(value) = self.target_name.take() {
10195 ::fidl_next::WireEnvelope::encode_value::<
10196 ::fidl_next::WireString<'static>,
10197 ___E,
10198 >(
10199 value, preallocated.encoder, &mut out, 100
10200 )?;
10201 } else {
10202 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10203 }
10204 }
10205
10206 2 => {
10207 if let Some(value) = self.source_name.take() {
10208 ::fidl_next::WireEnvelope::encode_value::<
10209 ::fidl_next::WireString<'static>,
10210 ___E,
10211 >(
10212 value, preallocated.encoder, &mut out, 100
10213 )?;
10214 } else {
10215 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10216 }
10217 }
10218
10219 1 => {
10220 if let Some(value) = self.source.take() {
10221 ::fidl_next::WireEnvelope::encode_value::<
10222 crate::wire::Ref<'static>,
10223 ___E,
10224 >(
10225 value, preallocated.encoder, &mut out, ()
10226 )?;
10227 } else {
10228 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10229 }
10230 }
10231
10232 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10233 }
10234 unsafe {
10235 preallocated.write_next(out.assume_init_ref());
10236 }
10237 }
10238
10239 ::fidl_next::WireTable::encode_len(table, max_ord);
10240
10241 Ok(())
10242 }
10243 }
10244
10245 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseConfiguration<'static>, ___E>
10246 for &'a UseConfiguration
10247 where
10248 ___E: ::fidl_next::Encoder + ?Sized,
10249 {
10250 #[inline]
10251 fn encode(
10252 self,
10253 encoder: &mut ___E,
10254 out: &mut ::core::mem::MaybeUninit<crate::wire::UseConfiguration<'static>>,
10255 _: (),
10256 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10257 ::fidl_next::munge!(let crate::wire::UseConfiguration { table } = out);
10258
10259 let max_ord = self.__max_ordinal();
10260
10261 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10262 ::fidl_next::Wire::zero_padding(&mut out);
10263
10264 let mut preallocated =
10265 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10266
10267 for i in 1..=max_ord {
10268 match i {
10269 7 => {
10270 if let Some(value) = &self.source_dictionary {
10271 ::fidl_next::WireEnvelope::encode_value::<
10272 ::fidl_next::WireString<'static>,
10273 ___E,
10274 >(
10275 value, preallocated.encoder, &mut out, 1024
10276 )?;
10277 } else {
10278 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10279 }
10280 }
10281
10282 6 => {
10283 if let Some(value) = &self.default {
10284 ::fidl_next::WireEnvelope::encode_value::<
10285 crate::wire::ConfigValue<'static>,
10286 ___E,
10287 >(
10288 value, preallocated.encoder, &mut out, ()
10289 )?;
10290 } else {
10291 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10292 }
10293 }
10294
10295 5 => {
10296 if let Some(value) = &self.type_ {
10297 ::fidl_next::WireEnvelope::encode_value::<
10298 crate::wire::ConfigType<'static>,
10299 ___E,
10300 >(
10301 value, preallocated.encoder, &mut out, ()
10302 )?;
10303 } else {
10304 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10305 }
10306 }
10307
10308 4 => {
10309 if let Some(value) = &self.availability {
10310 ::fidl_next::WireEnvelope::encode_value::<
10311 crate::wire::Availability,
10312 ___E,
10313 >(
10314 value, preallocated.encoder, &mut out, ()
10315 )?;
10316 } else {
10317 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10318 }
10319 }
10320
10321 3 => {
10322 if let Some(value) = &self.target_name {
10323 ::fidl_next::WireEnvelope::encode_value::<
10324 ::fidl_next::WireString<'static>,
10325 ___E,
10326 >(
10327 value, preallocated.encoder, &mut out, 100
10328 )?;
10329 } else {
10330 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10331 }
10332 }
10333
10334 2 => {
10335 if let Some(value) = &self.source_name {
10336 ::fidl_next::WireEnvelope::encode_value::<
10337 ::fidl_next::WireString<'static>,
10338 ___E,
10339 >(
10340 value, preallocated.encoder, &mut out, 100
10341 )?;
10342 } else {
10343 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10344 }
10345 }
10346
10347 1 => {
10348 if let Some(value) = &self.source {
10349 ::fidl_next::WireEnvelope::encode_value::<
10350 crate::wire::Ref<'static>,
10351 ___E,
10352 >(
10353 value, preallocated.encoder, &mut out, ()
10354 )?;
10355 } else {
10356 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10357 }
10358 }
10359
10360 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10361 }
10362 unsafe {
10363 preallocated.write_next(out.assume_init_ref());
10364 }
10365 }
10366
10367 ::fidl_next::WireTable::encode_len(table, max_ord);
10368
10369 Ok(())
10370 }
10371 }
10372
10373 impl<'de> ::fidl_next::FromWire<crate::wire::UseConfiguration<'de>> for UseConfiguration {
10374 #[inline]
10375 fn from_wire(wire_: crate::wire::UseConfiguration<'de>) -> Self {
10376 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
10377
10378 let source = wire_.table.get(1);
10379
10380 let source_name = wire_.table.get(2);
10381
10382 let target_name = wire_.table.get(3);
10383
10384 let availability = wire_.table.get(4);
10385
10386 let type_ = wire_.table.get(5);
10387
10388 let default = wire_.table.get(6);
10389
10390 let source_dictionary = wire_.table.get(7);
10391
10392 Self {
10393 source: source.map(|envelope| {
10394 ::fidl_next::FromWire::from_wire(unsafe {
10395 envelope.read_unchecked::<crate::wire::Ref<'de>>()
10396 })
10397 }),
10398
10399 source_name: source_name.map(|envelope| {
10400 ::fidl_next::FromWire::from_wire(unsafe {
10401 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
10402 })
10403 }),
10404
10405 target_name: target_name.map(|envelope| {
10406 ::fidl_next::FromWire::from_wire(unsafe {
10407 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
10408 })
10409 }),
10410
10411 availability: availability.map(|envelope| {
10412 ::fidl_next::FromWire::from_wire(unsafe {
10413 envelope.read_unchecked::<crate::wire::Availability>()
10414 })
10415 }),
10416
10417 type_: type_.map(|envelope| {
10418 ::fidl_next::FromWire::from_wire(unsafe {
10419 envelope.read_unchecked::<crate::wire::ConfigType<'de>>()
10420 })
10421 }),
10422
10423 default: default.map(|envelope| {
10424 ::fidl_next::FromWire::from_wire(unsafe {
10425 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
10426 })
10427 }),
10428
10429 source_dictionary: source_dictionary.map(|envelope| {
10430 ::fidl_next::FromWire::from_wire(unsafe {
10431 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
10432 })
10433 }),
10434 }
10435 }
10436 }
10437
10438 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseConfiguration<'de>> for UseConfiguration {
10439 #[inline]
10440 fn from_wire_ref(wire: &crate::wire::UseConfiguration<'de>) -> Self {
10441 Self {
10442 source: wire.table.get(1).map(|envelope| {
10443 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10444 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
10445 })
10446 }),
10447
10448 source_name: wire.table.get(2).map(|envelope| {
10449 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10450 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
10451 })
10452 }),
10453
10454 target_name: wire.table.get(3).map(|envelope| {
10455 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10456 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
10457 })
10458 }),
10459
10460 availability: wire.table.get(4).map(|envelope| {
10461 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10462 envelope.deref_unchecked::<crate::wire::Availability>()
10463 })
10464 }),
10465
10466 type_: wire.table.get(5).map(|envelope| {
10467 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10468 envelope.deref_unchecked::<crate::wire::ConfigType<'de>>()
10469 })
10470 }),
10471
10472 default: wire.table.get(6).map(|envelope| {
10473 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10474 envelope.deref_unchecked::<crate::wire::ConfigValue<'de>>()
10475 })
10476 }),
10477
10478 source_dictionary: wire.table.get(7).map(|envelope| {
10479 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10480 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
10481 })
10482 }),
10483 }
10484 }
10485 }
10486
10487 #[derive(PartialEq, Clone, Debug, Default)]
10488 pub struct UseDictionary {
10489 pub source: ::core::option::Option<crate::natural::Ref>,
10490
10491 pub source_name: ::core::option::Option<::std::string::String>,
10492
10493 pub target_path: ::core::option::Option<::std::string::String>,
10494
10495 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
10496
10497 pub availability: ::core::option::Option<crate::natural::Availability>,
10498
10499 pub source_dictionary: ::core::option::Option<::std::string::String>,
10500 }
10501
10502 impl UseDictionary {
10503 fn __max_ordinal(&self) -> usize {
10504 if self.source_dictionary.is_some() {
10505 return 8;
10506 }
10507
10508 if self.availability.is_some() {
10509 return 7;
10510 }
10511
10512 if self.dependency_type.is_some() {
10513 return 6;
10514 }
10515
10516 if self.target_path.is_some() {
10517 return 3;
10518 }
10519
10520 if self.source_name.is_some() {
10521 return 2;
10522 }
10523
10524 if self.source.is_some() {
10525 return 1;
10526 }
10527
10528 0
10529 }
10530 }
10531
10532 unsafe impl<___E> ::fidl_next::Encode<crate::wire::UseDictionary<'static>, ___E> for UseDictionary
10533 where
10534 ___E: ::fidl_next::Encoder + ?Sized,
10535 {
10536 #[inline]
10537 fn encode(
10538 mut self,
10539 encoder: &mut ___E,
10540 out: &mut ::core::mem::MaybeUninit<crate::wire::UseDictionary<'static>>,
10541 _: (),
10542 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10543 ::fidl_next::munge!(let crate::wire::UseDictionary { table } = out);
10544
10545 let max_ord = self.__max_ordinal();
10546
10547 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10548 ::fidl_next::Wire::zero_padding(&mut out);
10549
10550 let mut preallocated =
10551 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10552
10553 for i in 1..=max_ord {
10554 match i {
10555 8 => {
10556 if let Some(value) = self.source_dictionary.take() {
10557 ::fidl_next::WireEnvelope::encode_value::<
10558 ::fidl_next::WireString<'static>,
10559 ___E,
10560 >(
10561 value, preallocated.encoder, &mut out, 1024
10562 )?;
10563 } else {
10564 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10565 }
10566 }
10567
10568 7 => {
10569 if let Some(value) = self.availability.take() {
10570 ::fidl_next::WireEnvelope::encode_value::<
10571 crate::wire::Availability,
10572 ___E,
10573 >(
10574 value, preallocated.encoder, &mut out, ()
10575 )?;
10576 } else {
10577 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10578 }
10579 }
10580
10581 6 => {
10582 if let Some(value) = self.dependency_type.take() {
10583 ::fidl_next::WireEnvelope::encode_value::<
10584 crate::wire::DependencyType,
10585 ___E,
10586 >(
10587 value, preallocated.encoder, &mut out, ()
10588 )?;
10589 } else {
10590 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10591 }
10592 }
10593
10594 3 => {
10595 if let Some(value) = self.target_path.take() {
10596 ::fidl_next::WireEnvelope::encode_value::<
10597 ::fidl_next::WireString<'static>,
10598 ___E,
10599 >(
10600 value, preallocated.encoder, &mut out, 1024
10601 )?;
10602 } else {
10603 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10604 }
10605 }
10606
10607 2 => {
10608 if let Some(value) = self.source_name.take() {
10609 ::fidl_next::WireEnvelope::encode_value::<
10610 ::fidl_next::WireString<'static>,
10611 ___E,
10612 >(
10613 value, preallocated.encoder, &mut out, 100
10614 )?;
10615 } else {
10616 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10617 }
10618 }
10619
10620 1 => {
10621 if let Some(value) = self.source.take() {
10622 ::fidl_next::WireEnvelope::encode_value::<
10623 crate::wire::Ref<'static>,
10624 ___E,
10625 >(
10626 value, preallocated.encoder, &mut out, ()
10627 )?;
10628 } else {
10629 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10630 }
10631 }
10632
10633 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10634 }
10635 unsafe {
10636 preallocated.write_next(out.assume_init_ref());
10637 }
10638 }
10639
10640 ::fidl_next::WireTable::encode_len(table, max_ord);
10641
10642 Ok(())
10643 }
10644 }
10645
10646 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::UseDictionary<'static>, ___E>
10647 for &'a UseDictionary
10648 where
10649 ___E: ::fidl_next::Encoder + ?Sized,
10650 {
10651 #[inline]
10652 fn encode(
10653 self,
10654 encoder: &mut ___E,
10655 out: &mut ::core::mem::MaybeUninit<crate::wire::UseDictionary<'static>>,
10656 _: (),
10657 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10658 ::fidl_next::munge!(let crate::wire::UseDictionary { table } = out);
10659
10660 let max_ord = self.__max_ordinal();
10661
10662 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
10663 ::fidl_next::Wire::zero_padding(&mut out);
10664
10665 let mut preallocated =
10666 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
10667
10668 for i in 1..=max_ord {
10669 match i {
10670 8 => {
10671 if let Some(value) = &self.source_dictionary {
10672 ::fidl_next::WireEnvelope::encode_value::<
10673 ::fidl_next::WireString<'static>,
10674 ___E,
10675 >(
10676 value, preallocated.encoder, &mut out, 1024
10677 )?;
10678 } else {
10679 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10680 }
10681 }
10682
10683 7 => {
10684 if let Some(value) = &self.availability {
10685 ::fidl_next::WireEnvelope::encode_value::<
10686 crate::wire::Availability,
10687 ___E,
10688 >(
10689 value, preallocated.encoder, &mut out, ()
10690 )?;
10691 } else {
10692 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10693 }
10694 }
10695
10696 6 => {
10697 if let Some(value) = &self.dependency_type {
10698 ::fidl_next::WireEnvelope::encode_value::<
10699 crate::wire::DependencyType,
10700 ___E,
10701 >(
10702 value, preallocated.encoder, &mut out, ()
10703 )?;
10704 } else {
10705 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10706 }
10707 }
10708
10709 3 => {
10710 if let Some(value) = &self.target_path {
10711 ::fidl_next::WireEnvelope::encode_value::<
10712 ::fidl_next::WireString<'static>,
10713 ___E,
10714 >(
10715 value, preallocated.encoder, &mut out, 1024
10716 )?;
10717 } else {
10718 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10719 }
10720 }
10721
10722 2 => {
10723 if let Some(value) = &self.source_name {
10724 ::fidl_next::WireEnvelope::encode_value::<
10725 ::fidl_next::WireString<'static>,
10726 ___E,
10727 >(
10728 value, preallocated.encoder, &mut out, 100
10729 )?;
10730 } else {
10731 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10732 }
10733 }
10734
10735 1 => {
10736 if let Some(value) = &self.source {
10737 ::fidl_next::WireEnvelope::encode_value::<
10738 crate::wire::Ref<'static>,
10739 ___E,
10740 >(
10741 value, preallocated.encoder, &mut out, ()
10742 )?;
10743 } else {
10744 ::fidl_next::WireEnvelope::encode_zero(&mut out)
10745 }
10746 }
10747
10748 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
10749 }
10750 unsafe {
10751 preallocated.write_next(out.assume_init_ref());
10752 }
10753 }
10754
10755 ::fidl_next::WireTable::encode_len(table, max_ord);
10756
10757 Ok(())
10758 }
10759 }
10760
10761 impl<'de> ::fidl_next::FromWire<crate::wire::UseDictionary<'de>> for UseDictionary {
10762 #[inline]
10763 fn from_wire(wire_: crate::wire::UseDictionary<'de>) -> Self {
10764 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
10765
10766 let source = wire_.table.get(1);
10767
10768 let source_name = wire_.table.get(2);
10769
10770 let target_path = wire_.table.get(3);
10771
10772 let dependency_type = wire_.table.get(6);
10773
10774 let availability = wire_.table.get(7);
10775
10776 let source_dictionary = wire_.table.get(8);
10777
10778 Self {
10779 source: source.map(|envelope| {
10780 ::fidl_next::FromWire::from_wire(unsafe {
10781 envelope.read_unchecked::<crate::wire::Ref<'de>>()
10782 })
10783 }),
10784
10785 source_name: source_name.map(|envelope| {
10786 ::fidl_next::FromWire::from_wire(unsafe {
10787 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
10788 })
10789 }),
10790
10791 target_path: target_path.map(|envelope| {
10792 ::fidl_next::FromWire::from_wire(unsafe {
10793 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
10794 })
10795 }),
10796
10797 dependency_type: dependency_type.map(|envelope| {
10798 ::fidl_next::FromWire::from_wire(unsafe {
10799 envelope.read_unchecked::<crate::wire::DependencyType>()
10800 })
10801 }),
10802
10803 availability: availability.map(|envelope| {
10804 ::fidl_next::FromWire::from_wire(unsafe {
10805 envelope.read_unchecked::<crate::wire::Availability>()
10806 })
10807 }),
10808
10809 source_dictionary: source_dictionary.map(|envelope| {
10810 ::fidl_next::FromWire::from_wire(unsafe {
10811 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
10812 })
10813 }),
10814 }
10815 }
10816 }
10817
10818 impl<'de> ::fidl_next::FromWireRef<crate::wire::UseDictionary<'de>> for UseDictionary {
10819 #[inline]
10820 fn from_wire_ref(wire: &crate::wire::UseDictionary<'de>) -> Self {
10821 Self {
10822 source: wire.table.get(1).map(|envelope| {
10823 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10824 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
10825 })
10826 }),
10827
10828 source_name: wire.table.get(2).map(|envelope| {
10829 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10830 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
10831 })
10832 }),
10833
10834 target_path: wire.table.get(3).map(|envelope| {
10835 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10836 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
10837 })
10838 }),
10839
10840 dependency_type: wire.table.get(6).map(|envelope| {
10841 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10842 envelope.deref_unchecked::<crate::wire::DependencyType>()
10843 })
10844 }),
10845
10846 availability: wire.table.get(7).map(|envelope| {
10847 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10848 envelope.deref_unchecked::<crate::wire::Availability>()
10849 })
10850 }),
10851
10852 source_dictionary: wire.table.get(8).map(|envelope| {
10853 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
10854 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
10855 })
10856 }),
10857 }
10858 }
10859 }
10860
10861 #[doc = " Declares a capability used by a component, which was offered to it.\n"]
10862 #[derive(PartialEq, Clone, Debug)]
10863 pub enum Use {
10864 Service(crate::natural::UseService),
10865
10866 Protocol(crate::natural::UseProtocol),
10867
10868 Directory(crate::natural::UseDirectory),
10869
10870 Storage(crate::natural::UseStorage),
10871
10872 EventStream(crate::natural::UseEventStream),
10873
10874 Runner(crate::natural::UseRunner),
10875
10876 Config(crate::natural::UseConfiguration),
10877
10878 Dictionary(crate::natural::UseDictionary),
10879
10880 UnknownOrdinal_(u64),
10881 }
10882
10883 impl Use {
10884 pub fn is_unknown(&self) -> bool {
10885 #[allow(unreachable_patterns)]
10886 match self {
10887 Self::UnknownOrdinal_(_) => true,
10888 _ => false,
10889 }
10890 }
10891 }
10892
10893 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Use<'static>, ___E> for Use
10894 where
10895 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10896 ___E: ::fidl_next::Encoder,
10897 {
10898 #[inline]
10899 fn encode(
10900 self,
10901 encoder: &mut ___E,
10902 out: &mut ::core::mem::MaybeUninit<crate::wire::Use<'static>>,
10903 _: (),
10904 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10905 ::fidl_next::munge!(let crate::wire::Use { raw, _phantom: _ } = out);
10906
10907 match self {
10908 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
10909 ___E,
10910 crate::wire::UseService<'static>,
10911 >(value, 1, encoder, raw, ())?,
10912
10913 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
10914 ___E,
10915 crate::wire::UseProtocol<'static>,
10916 >(value, 2, encoder, raw, ())?,
10917
10918 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
10919 ___E,
10920 crate::wire::UseDirectory<'static>,
10921 >(value, 3, encoder, raw, ())?,
10922
10923 Self::Storage(value) => ::fidl_next::RawWireUnion::encode_as::<
10924 ___E,
10925 crate::wire::UseStorage<'static>,
10926 >(value, 4, encoder, raw, ())?,
10927
10928 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
10929 ___E,
10930 crate::wire::UseEventStream<'static>,
10931 >(value, 7, encoder, raw, ())?,
10932
10933 Self::Runner(value) => ::fidl_next::RawWireUnion::encode_as::<
10934 ___E,
10935 crate::wire::UseRunner<'static>,
10936 >(value, 8, encoder, raw, ())?,
10937
10938 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
10939 ___E,
10940 crate::wire::UseConfiguration<'static>,
10941 >(value, 9, encoder, raw, ())?,
10942
10943 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
10944 ___E,
10945 crate::wire::UseDictionary<'static>,
10946 >(value, 10, encoder, raw, ())?,
10947
10948 Self::UnknownOrdinal_(ordinal) => {
10949 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
10950 }
10951 }
10952
10953 Ok(())
10954 }
10955 }
10956
10957 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Use<'static>, ___E> for &'a Use
10958 where
10959 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
10960 ___E: ::fidl_next::Encoder,
10961 {
10962 #[inline]
10963 fn encode(
10964 self,
10965 encoder: &mut ___E,
10966 out: &mut ::core::mem::MaybeUninit<crate::wire::Use<'static>>,
10967 _: (),
10968 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
10969 ::fidl_next::munge!(let crate::wire::Use { raw, _phantom: _ } = out);
10970
10971 match self {
10972 Use::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
10973 ___E,
10974 crate::wire::UseService<'static>,
10975 >(value, 1, encoder, raw, ())?,
10976
10977 Use::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
10978 ___E,
10979 crate::wire::UseProtocol<'static>,
10980 >(value, 2, encoder, raw, ())?,
10981
10982 Use::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
10983 ___E,
10984 crate::wire::UseDirectory<'static>,
10985 >(value, 3, encoder, raw, ())?,
10986
10987 Use::Storage(value) => ::fidl_next::RawWireUnion::encode_as::<
10988 ___E,
10989 crate::wire::UseStorage<'static>,
10990 >(value, 4, encoder, raw, ())?,
10991
10992 Use::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
10993 ___E,
10994 crate::wire::UseEventStream<'static>,
10995 >(value, 7, encoder, raw, ())?,
10996
10997 Use::Runner(value) => ::fidl_next::RawWireUnion::encode_as::<
10998 ___E,
10999 crate::wire::UseRunner<'static>,
11000 >(value, 8, encoder, raw, ())?,
11001
11002 Use::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
11003 ___E,
11004 crate::wire::UseConfiguration<'static>,
11005 >(value, 9, encoder, raw, ())?,
11006
11007 Use::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
11008 ___E,
11009 crate::wire::UseDictionary<'static>,
11010 >(value, 10, encoder, raw, ())?,
11011
11012 Use::UnknownOrdinal_(ordinal) => {
11013 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
11014 }
11015 }
11016
11017 Ok(())
11018 }
11019 }
11020
11021 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::Use<'static>, ___E> for Use
11022 where
11023 ___E: ?Sized,
11024 Use: ::fidl_next::Encode<crate::wire::Use<'static>, ___E>,
11025 {
11026 #[inline]
11027 fn encode_option(
11028 this: ::core::option::Option<Self>,
11029 encoder: &mut ___E,
11030 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Use<'static>>,
11031 _: (),
11032 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11033 ::fidl_next::munge!(let crate::wire_optional::Use { raw, _phantom: _ } = &mut *out);
11034
11035 if let Some(inner) = this {
11036 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
11037 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
11038 } else {
11039 ::fidl_next::RawWireUnion::encode_absent(raw);
11040 }
11041
11042 Ok(())
11043 }
11044 }
11045
11046 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::Use<'static>, ___E>
11047 for &'a Use
11048 where
11049 ___E: ?Sized,
11050 &'a Use: ::fidl_next::Encode<crate::wire::Use<'static>, ___E>,
11051 {
11052 #[inline]
11053 fn encode_option(
11054 this: ::core::option::Option<Self>,
11055 encoder: &mut ___E,
11056 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Use<'static>>,
11057 _: (),
11058 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11059 ::fidl_next::munge!(let crate::wire_optional::Use { raw, _phantom: _ } = &mut *out);
11060
11061 if let Some(inner) = this {
11062 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
11063 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
11064 } else {
11065 ::fidl_next::RawWireUnion::encode_absent(raw);
11066 }
11067
11068 Ok(())
11069 }
11070 }
11071
11072 impl<'de> ::fidl_next::FromWire<crate::wire::Use<'de>> for Use {
11073 #[inline]
11074 fn from_wire(wire: crate::wire::Use<'de>) -> Self {
11075 let wire = ::core::mem::ManuallyDrop::new(wire);
11076 match wire.raw.ordinal() {
11077 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
11078 wire.raw.get().read_unchecked::<crate::wire::UseService<'de>>()
11079 })),
11080
11081 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
11082 wire.raw.get().read_unchecked::<crate::wire::UseProtocol<'de>>()
11083 })),
11084
11085 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
11086 wire.raw.get().read_unchecked::<crate::wire::UseDirectory<'de>>()
11087 })),
11088
11089 4 => Self::Storage(::fidl_next::FromWire::from_wire(unsafe {
11090 wire.raw.get().read_unchecked::<crate::wire::UseStorage<'de>>()
11091 })),
11092
11093 7 => Self::EventStream(::fidl_next::FromWire::from_wire(unsafe {
11094 wire.raw.get().read_unchecked::<crate::wire::UseEventStream<'de>>()
11095 })),
11096
11097 8 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
11098 wire.raw.get().read_unchecked::<crate::wire::UseRunner<'de>>()
11099 })),
11100
11101 9 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
11102 wire.raw.get().read_unchecked::<crate::wire::UseConfiguration<'de>>()
11103 })),
11104
11105 10 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
11106 wire.raw.get().read_unchecked::<crate::wire::UseDictionary<'de>>()
11107 })),
11108
11109 ord => return Self::UnknownOrdinal_(ord as u64),
11110 }
11111 }
11112 }
11113
11114 impl<'de> ::fidl_next::FromWireRef<crate::wire::Use<'de>> for Use {
11115 #[inline]
11116 fn from_wire_ref(wire: &crate::wire::Use<'de>) -> Self {
11117 match wire.raw.ordinal() {
11118 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11119 wire.raw.get().deref_unchecked::<crate::wire::UseService<'de>>()
11120 })),
11121
11122 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11123 wire.raw.get().deref_unchecked::<crate::wire::UseProtocol<'de>>()
11124 })),
11125
11126 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11127 wire.raw.get().deref_unchecked::<crate::wire::UseDirectory<'de>>()
11128 })),
11129
11130 4 => Self::Storage(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11131 wire.raw.get().deref_unchecked::<crate::wire::UseStorage<'de>>()
11132 })),
11133
11134 7 => Self::EventStream(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11135 wire.raw.get().deref_unchecked::<crate::wire::UseEventStream<'de>>()
11136 })),
11137
11138 8 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11139 wire.raw.get().deref_unchecked::<crate::wire::UseRunner<'de>>()
11140 })),
11141
11142 9 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11143 wire.raw.get().deref_unchecked::<crate::wire::UseConfiguration<'de>>()
11144 })),
11145
11146 10 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
11147 wire.raw.get().deref_unchecked::<crate::wire::UseDictionary<'de>>()
11148 })),
11149
11150 ord => return Self::UnknownOrdinal_(ord as u64),
11151 }
11152 }
11153 }
11154
11155 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Use<'de>> for Use {
11156 #[inline]
11157 fn from_wire_option(wire: crate::wire_optional::Use<'de>) -> ::core::option::Option<Self> {
11158 if let Some(inner) = wire.into_option() {
11159 Some(::fidl_next::FromWire::from_wire(inner))
11160 } else {
11161 None
11162 }
11163 }
11164 }
11165
11166 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Use<'de>> for Box<Use> {
11167 #[inline]
11168 fn from_wire_option(wire: crate::wire_optional::Use<'de>) -> ::core::option::Option<Self> {
11169 <Use as ::fidl_next::FromWireOption<crate::wire_optional::Use<'de>>>::from_wire_option(
11170 wire,
11171 )
11172 .map(Box::new)
11173 }
11174 }
11175
11176 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::Use<'de>> for Box<Use> {
11177 #[inline]
11178 fn from_wire_option_ref(
11179 wire: &crate::wire_optional::Use<'de>,
11180 ) -> ::core::option::Option<Self> {
11181 if let Some(inner) = wire.as_ref() {
11182 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
11183 } else {
11184 None
11185 }
11186 }
11187 }
11188
11189 #[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"]
11190 #[derive(PartialEq, Clone, Debug, Default)]
11191 pub struct ExposeService {
11192 pub source: ::core::option::Option<crate::natural::Ref>,
11193
11194 pub source_name: ::core::option::Option<::std::string::String>,
11195
11196 pub target: ::core::option::Option<crate::natural::Ref>,
11197
11198 pub target_name: ::core::option::Option<::std::string::String>,
11199
11200 pub availability: ::core::option::Option<crate::natural::Availability>,
11201
11202 pub source_dictionary: ::core::option::Option<::std::string::String>,
11203 }
11204
11205 impl ExposeService {
11206 fn __max_ordinal(&self) -> usize {
11207 if self.source_dictionary.is_some() {
11208 return 6;
11209 }
11210
11211 if self.availability.is_some() {
11212 return 5;
11213 }
11214
11215 if self.target_name.is_some() {
11216 return 4;
11217 }
11218
11219 if self.target.is_some() {
11220 return 3;
11221 }
11222
11223 if self.source_name.is_some() {
11224 return 2;
11225 }
11226
11227 if self.source.is_some() {
11228 return 1;
11229 }
11230
11231 0
11232 }
11233 }
11234
11235 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeService<'static>, ___E> for ExposeService
11236 where
11237 ___E: ::fidl_next::Encoder + ?Sized,
11238 {
11239 #[inline]
11240 fn encode(
11241 mut self,
11242 encoder: &mut ___E,
11243 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeService<'static>>,
11244 _: (),
11245 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11246 ::fidl_next::munge!(let crate::wire::ExposeService { table } = out);
11247
11248 let max_ord = self.__max_ordinal();
11249
11250 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11251 ::fidl_next::Wire::zero_padding(&mut out);
11252
11253 let mut preallocated =
11254 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11255
11256 for i in 1..=max_ord {
11257 match i {
11258 6 => {
11259 if let Some(value) = self.source_dictionary.take() {
11260 ::fidl_next::WireEnvelope::encode_value::<
11261 ::fidl_next::WireString<'static>,
11262 ___E,
11263 >(
11264 value, preallocated.encoder, &mut out, 1024
11265 )?;
11266 } else {
11267 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11268 }
11269 }
11270
11271 5 => {
11272 if let Some(value) = self.availability.take() {
11273 ::fidl_next::WireEnvelope::encode_value::<
11274 crate::wire::Availability,
11275 ___E,
11276 >(
11277 value, preallocated.encoder, &mut out, ()
11278 )?;
11279 } else {
11280 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11281 }
11282 }
11283
11284 4 => {
11285 if let Some(value) = self.target_name.take() {
11286 ::fidl_next::WireEnvelope::encode_value::<
11287 ::fidl_next::WireString<'static>,
11288 ___E,
11289 >(
11290 value, preallocated.encoder, &mut out, 100
11291 )?;
11292 } else {
11293 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11294 }
11295 }
11296
11297 3 => {
11298 if let Some(value) = self.target.take() {
11299 ::fidl_next::WireEnvelope::encode_value::<
11300 crate::wire::Ref<'static>,
11301 ___E,
11302 >(
11303 value, preallocated.encoder, &mut out, ()
11304 )?;
11305 } else {
11306 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11307 }
11308 }
11309
11310 2 => {
11311 if let Some(value) = self.source_name.take() {
11312 ::fidl_next::WireEnvelope::encode_value::<
11313 ::fidl_next::WireString<'static>,
11314 ___E,
11315 >(
11316 value, preallocated.encoder, &mut out, 100
11317 )?;
11318 } else {
11319 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11320 }
11321 }
11322
11323 1 => {
11324 if let Some(value) = self.source.take() {
11325 ::fidl_next::WireEnvelope::encode_value::<
11326 crate::wire::Ref<'static>,
11327 ___E,
11328 >(
11329 value, preallocated.encoder, &mut out, ()
11330 )?;
11331 } else {
11332 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11333 }
11334 }
11335
11336 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11337 }
11338 unsafe {
11339 preallocated.write_next(out.assume_init_ref());
11340 }
11341 }
11342
11343 ::fidl_next::WireTable::encode_len(table, max_ord);
11344
11345 Ok(())
11346 }
11347 }
11348
11349 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeService<'static>, ___E>
11350 for &'a ExposeService
11351 where
11352 ___E: ::fidl_next::Encoder + ?Sized,
11353 {
11354 #[inline]
11355 fn encode(
11356 self,
11357 encoder: &mut ___E,
11358 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeService<'static>>,
11359 _: (),
11360 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11361 ::fidl_next::munge!(let crate::wire::ExposeService { table } = out);
11362
11363 let max_ord = self.__max_ordinal();
11364
11365 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11366 ::fidl_next::Wire::zero_padding(&mut out);
11367
11368 let mut preallocated =
11369 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11370
11371 for i in 1..=max_ord {
11372 match i {
11373 6 => {
11374 if let Some(value) = &self.source_dictionary {
11375 ::fidl_next::WireEnvelope::encode_value::<
11376 ::fidl_next::WireString<'static>,
11377 ___E,
11378 >(
11379 value, preallocated.encoder, &mut out, 1024
11380 )?;
11381 } else {
11382 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11383 }
11384 }
11385
11386 5 => {
11387 if let Some(value) = &self.availability {
11388 ::fidl_next::WireEnvelope::encode_value::<
11389 crate::wire::Availability,
11390 ___E,
11391 >(
11392 value, preallocated.encoder, &mut out, ()
11393 )?;
11394 } else {
11395 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11396 }
11397 }
11398
11399 4 => {
11400 if let Some(value) = &self.target_name {
11401 ::fidl_next::WireEnvelope::encode_value::<
11402 ::fidl_next::WireString<'static>,
11403 ___E,
11404 >(
11405 value, preallocated.encoder, &mut out, 100
11406 )?;
11407 } else {
11408 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11409 }
11410 }
11411
11412 3 => {
11413 if let Some(value) = &self.target {
11414 ::fidl_next::WireEnvelope::encode_value::<
11415 crate::wire::Ref<'static>,
11416 ___E,
11417 >(
11418 value, preallocated.encoder, &mut out, ()
11419 )?;
11420 } else {
11421 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11422 }
11423 }
11424
11425 2 => {
11426 if let Some(value) = &self.source_name {
11427 ::fidl_next::WireEnvelope::encode_value::<
11428 ::fidl_next::WireString<'static>,
11429 ___E,
11430 >(
11431 value, preallocated.encoder, &mut out, 100
11432 )?;
11433 } else {
11434 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11435 }
11436 }
11437
11438 1 => {
11439 if let Some(value) = &self.source {
11440 ::fidl_next::WireEnvelope::encode_value::<
11441 crate::wire::Ref<'static>,
11442 ___E,
11443 >(
11444 value, preallocated.encoder, &mut out, ()
11445 )?;
11446 } else {
11447 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11448 }
11449 }
11450
11451 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11452 }
11453 unsafe {
11454 preallocated.write_next(out.assume_init_ref());
11455 }
11456 }
11457
11458 ::fidl_next::WireTable::encode_len(table, max_ord);
11459
11460 Ok(())
11461 }
11462 }
11463
11464 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeService<'de>> for ExposeService {
11465 #[inline]
11466 fn from_wire(wire_: crate::wire::ExposeService<'de>) -> Self {
11467 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
11468
11469 let source = wire_.table.get(1);
11470
11471 let source_name = wire_.table.get(2);
11472
11473 let target = wire_.table.get(3);
11474
11475 let target_name = wire_.table.get(4);
11476
11477 let availability = wire_.table.get(5);
11478
11479 let source_dictionary = wire_.table.get(6);
11480
11481 Self {
11482 source: source.map(|envelope| {
11483 ::fidl_next::FromWire::from_wire(unsafe {
11484 envelope.read_unchecked::<crate::wire::Ref<'de>>()
11485 })
11486 }),
11487
11488 source_name: source_name.map(|envelope| {
11489 ::fidl_next::FromWire::from_wire(unsafe {
11490 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
11491 })
11492 }),
11493
11494 target: target.map(|envelope| {
11495 ::fidl_next::FromWire::from_wire(unsafe {
11496 envelope.read_unchecked::<crate::wire::Ref<'de>>()
11497 })
11498 }),
11499
11500 target_name: target_name.map(|envelope| {
11501 ::fidl_next::FromWire::from_wire(unsafe {
11502 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
11503 })
11504 }),
11505
11506 availability: availability.map(|envelope| {
11507 ::fidl_next::FromWire::from_wire(unsafe {
11508 envelope.read_unchecked::<crate::wire::Availability>()
11509 })
11510 }),
11511
11512 source_dictionary: source_dictionary.map(|envelope| {
11513 ::fidl_next::FromWire::from_wire(unsafe {
11514 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
11515 })
11516 }),
11517 }
11518 }
11519 }
11520
11521 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeService<'de>> for ExposeService {
11522 #[inline]
11523 fn from_wire_ref(wire: &crate::wire::ExposeService<'de>) -> Self {
11524 Self {
11525 source: wire.table.get(1).map(|envelope| {
11526 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11527 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
11528 })
11529 }),
11530
11531 source_name: wire.table.get(2).map(|envelope| {
11532 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11533 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
11534 })
11535 }),
11536
11537 target: wire.table.get(3).map(|envelope| {
11538 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11539 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
11540 })
11541 }),
11542
11543 target_name: wire.table.get(4).map(|envelope| {
11544 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11545 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
11546 })
11547 }),
11548
11549 availability: wire.table.get(5).map(|envelope| {
11550 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11551 envelope.deref_unchecked::<crate::wire::Availability>()
11552 })
11553 }),
11554
11555 source_dictionary: wire.table.get(6).map(|envelope| {
11556 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11557 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
11558 })
11559 }),
11560 }
11561 }
11562 }
11563
11564 #[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"]
11565 #[derive(PartialEq, Clone, Debug, Default)]
11566 pub struct ExposeProtocol {
11567 pub source: ::core::option::Option<crate::natural::Ref>,
11568
11569 pub source_name: ::core::option::Option<::std::string::String>,
11570
11571 pub target: ::core::option::Option<crate::natural::Ref>,
11572
11573 pub target_name: ::core::option::Option<::std::string::String>,
11574
11575 pub availability: ::core::option::Option<crate::natural::Availability>,
11576
11577 pub source_dictionary: ::core::option::Option<::std::string::String>,
11578 }
11579
11580 impl ExposeProtocol {
11581 fn __max_ordinal(&self) -> usize {
11582 if self.source_dictionary.is_some() {
11583 return 6;
11584 }
11585
11586 if self.availability.is_some() {
11587 return 5;
11588 }
11589
11590 if self.target_name.is_some() {
11591 return 4;
11592 }
11593
11594 if self.target.is_some() {
11595 return 3;
11596 }
11597
11598 if self.source_name.is_some() {
11599 return 2;
11600 }
11601
11602 if self.source.is_some() {
11603 return 1;
11604 }
11605
11606 0
11607 }
11608 }
11609
11610 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeProtocol<'static>, ___E> for ExposeProtocol
11611 where
11612 ___E: ::fidl_next::Encoder + ?Sized,
11613 {
11614 #[inline]
11615 fn encode(
11616 mut self,
11617 encoder: &mut ___E,
11618 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeProtocol<'static>>,
11619 _: (),
11620 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11621 ::fidl_next::munge!(let crate::wire::ExposeProtocol { table } = out);
11622
11623 let max_ord = self.__max_ordinal();
11624
11625 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11626 ::fidl_next::Wire::zero_padding(&mut out);
11627
11628 let mut preallocated =
11629 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11630
11631 for i in 1..=max_ord {
11632 match i {
11633 6 => {
11634 if let Some(value) = self.source_dictionary.take() {
11635 ::fidl_next::WireEnvelope::encode_value::<
11636 ::fidl_next::WireString<'static>,
11637 ___E,
11638 >(
11639 value, preallocated.encoder, &mut out, 1024
11640 )?;
11641 } else {
11642 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11643 }
11644 }
11645
11646 5 => {
11647 if let Some(value) = self.availability.take() {
11648 ::fidl_next::WireEnvelope::encode_value::<
11649 crate::wire::Availability,
11650 ___E,
11651 >(
11652 value, preallocated.encoder, &mut out, ()
11653 )?;
11654 } else {
11655 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11656 }
11657 }
11658
11659 4 => {
11660 if let Some(value) = self.target_name.take() {
11661 ::fidl_next::WireEnvelope::encode_value::<
11662 ::fidl_next::WireString<'static>,
11663 ___E,
11664 >(
11665 value, preallocated.encoder, &mut out, 100
11666 )?;
11667 } else {
11668 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11669 }
11670 }
11671
11672 3 => {
11673 if let Some(value) = self.target.take() {
11674 ::fidl_next::WireEnvelope::encode_value::<
11675 crate::wire::Ref<'static>,
11676 ___E,
11677 >(
11678 value, preallocated.encoder, &mut out, ()
11679 )?;
11680 } else {
11681 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11682 }
11683 }
11684
11685 2 => {
11686 if let Some(value) = self.source_name.take() {
11687 ::fidl_next::WireEnvelope::encode_value::<
11688 ::fidl_next::WireString<'static>,
11689 ___E,
11690 >(
11691 value, preallocated.encoder, &mut out, 100
11692 )?;
11693 } else {
11694 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11695 }
11696 }
11697
11698 1 => {
11699 if let Some(value) = self.source.take() {
11700 ::fidl_next::WireEnvelope::encode_value::<
11701 crate::wire::Ref<'static>,
11702 ___E,
11703 >(
11704 value, preallocated.encoder, &mut out, ()
11705 )?;
11706 } else {
11707 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11708 }
11709 }
11710
11711 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11712 }
11713 unsafe {
11714 preallocated.write_next(out.assume_init_ref());
11715 }
11716 }
11717
11718 ::fidl_next::WireTable::encode_len(table, max_ord);
11719
11720 Ok(())
11721 }
11722 }
11723
11724 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeProtocol<'static>, ___E>
11725 for &'a ExposeProtocol
11726 where
11727 ___E: ::fidl_next::Encoder + ?Sized,
11728 {
11729 #[inline]
11730 fn encode(
11731 self,
11732 encoder: &mut ___E,
11733 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeProtocol<'static>>,
11734 _: (),
11735 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
11736 ::fidl_next::munge!(let crate::wire::ExposeProtocol { table } = out);
11737
11738 let max_ord = self.__max_ordinal();
11739
11740 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
11741 ::fidl_next::Wire::zero_padding(&mut out);
11742
11743 let mut preallocated =
11744 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
11745
11746 for i in 1..=max_ord {
11747 match i {
11748 6 => {
11749 if let Some(value) = &self.source_dictionary {
11750 ::fidl_next::WireEnvelope::encode_value::<
11751 ::fidl_next::WireString<'static>,
11752 ___E,
11753 >(
11754 value, preallocated.encoder, &mut out, 1024
11755 )?;
11756 } else {
11757 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11758 }
11759 }
11760
11761 5 => {
11762 if let Some(value) = &self.availability {
11763 ::fidl_next::WireEnvelope::encode_value::<
11764 crate::wire::Availability,
11765 ___E,
11766 >(
11767 value, preallocated.encoder, &mut out, ()
11768 )?;
11769 } else {
11770 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11771 }
11772 }
11773
11774 4 => {
11775 if let Some(value) = &self.target_name {
11776 ::fidl_next::WireEnvelope::encode_value::<
11777 ::fidl_next::WireString<'static>,
11778 ___E,
11779 >(
11780 value, preallocated.encoder, &mut out, 100
11781 )?;
11782 } else {
11783 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11784 }
11785 }
11786
11787 3 => {
11788 if let Some(value) = &self.target {
11789 ::fidl_next::WireEnvelope::encode_value::<
11790 crate::wire::Ref<'static>,
11791 ___E,
11792 >(
11793 value, preallocated.encoder, &mut out, ()
11794 )?;
11795 } else {
11796 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11797 }
11798 }
11799
11800 2 => {
11801 if let Some(value) = &self.source_name {
11802 ::fidl_next::WireEnvelope::encode_value::<
11803 ::fidl_next::WireString<'static>,
11804 ___E,
11805 >(
11806 value, preallocated.encoder, &mut out, 100
11807 )?;
11808 } else {
11809 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11810 }
11811 }
11812
11813 1 => {
11814 if let Some(value) = &self.source {
11815 ::fidl_next::WireEnvelope::encode_value::<
11816 crate::wire::Ref<'static>,
11817 ___E,
11818 >(
11819 value, preallocated.encoder, &mut out, ()
11820 )?;
11821 } else {
11822 ::fidl_next::WireEnvelope::encode_zero(&mut out)
11823 }
11824 }
11825
11826 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
11827 }
11828 unsafe {
11829 preallocated.write_next(out.assume_init_ref());
11830 }
11831 }
11832
11833 ::fidl_next::WireTable::encode_len(table, max_ord);
11834
11835 Ok(())
11836 }
11837 }
11838
11839 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeProtocol<'de>> for ExposeProtocol {
11840 #[inline]
11841 fn from_wire(wire_: crate::wire::ExposeProtocol<'de>) -> Self {
11842 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
11843
11844 let source = wire_.table.get(1);
11845
11846 let source_name = wire_.table.get(2);
11847
11848 let target = wire_.table.get(3);
11849
11850 let target_name = wire_.table.get(4);
11851
11852 let availability = wire_.table.get(5);
11853
11854 let source_dictionary = wire_.table.get(6);
11855
11856 Self {
11857 source: source.map(|envelope| {
11858 ::fidl_next::FromWire::from_wire(unsafe {
11859 envelope.read_unchecked::<crate::wire::Ref<'de>>()
11860 })
11861 }),
11862
11863 source_name: source_name.map(|envelope| {
11864 ::fidl_next::FromWire::from_wire(unsafe {
11865 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
11866 })
11867 }),
11868
11869 target: target.map(|envelope| {
11870 ::fidl_next::FromWire::from_wire(unsafe {
11871 envelope.read_unchecked::<crate::wire::Ref<'de>>()
11872 })
11873 }),
11874
11875 target_name: target_name.map(|envelope| {
11876 ::fidl_next::FromWire::from_wire(unsafe {
11877 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
11878 })
11879 }),
11880
11881 availability: availability.map(|envelope| {
11882 ::fidl_next::FromWire::from_wire(unsafe {
11883 envelope.read_unchecked::<crate::wire::Availability>()
11884 })
11885 }),
11886
11887 source_dictionary: source_dictionary.map(|envelope| {
11888 ::fidl_next::FromWire::from_wire(unsafe {
11889 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
11890 })
11891 }),
11892 }
11893 }
11894 }
11895
11896 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeProtocol<'de>> for ExposeProtocol {
11897 #[inline]
11898 fn from_wire_ref(wire: &crate::wire::ExposeProtocol<'de>) -> Self {
11899 Self {
11900 source: wire.table.get(1).map(|envelope| {
11901 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11902 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
11903 })
11904 }),
11905
11906 source_name: wire.table.get(2).map(|envelope| {
11907 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11908 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
11909 })
11910 }),
11911
11912 target: wire.table.get(3).map(|envelope| {
11913 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11914 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
11915 })
11916 }),
11917
11918 target_name: wire.table.get(4).map(|envelope| {
11919 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11920 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
11921 })
11922 }),
11923
11924 availability: wire.table.get(5).map(|envelope| {
11925 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11926 envelope.deref_unchecked::<crate::wire::Availability>()
11927 })
11928 }),
11929
11930 source_dictionary: wire.table.get(6).map(|envelope| {
11931 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
11932 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
11933 })
11934 }),
11935 }
11936 }
11937 }
11938
11939 #[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"]
11940 #[derive(PartialEq, Clone, Debug, Default)]
11941 pub struct ExposeDirectory {
11942 pub source: ::core::option::Option<crate::natural::Ref>,
11943
11944 pub source_name: ::core::option::Option<::std::string::String>,
11945
11946 pub target: ::core::option::Option<crate::natural::Ref>,
11947
11948 pub target_name: ::core::option::Option<::std::string::String>,
11949
11950 pub rights: ::core::option::Option<::fidl_next_common_fuchsia_io::natural::Operations>,
11951
11952 pub subdir: ::core::option::Option<::std::string::String>,
11953
11954 pub availability: ::core::option::Option<crate::natural::Availability>,
11955
11956 pub source_dictionary: ::core::option::Option<::std::string::String>,
11957 }
11958
11959 impl ExposeDirectory {
11960 fn __max_ordinal(&self) -> usize {
11961 if self.source_dictionary.is_some() {
11962 return 8;
11963 }
11964
11965 if self.availability.is_some() {
11966 return 7;
11967 }
11968
11969 if self.subdir.is_some() {
11970 return 6;
11971 }
11972
11973 if self.rights.is_some() {
11974 return 5;
11975 }
11976
11977 if self.target_name.is_some() {
11978 return 4;
11979 }
11980
11981 if self.target.is_some() {
11982 return 3;
11983 }
11984
11985 if self.source_name.is_some() {
11986 return 2;
11987 }
11988
11989 if self.source.is_some() {
11990 return 1;
11991 }
11992
11993 0
11994 }
11995 }
11996
11997 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeDirectory<'static>, ___E>
11998 for ExposeDirectory
11999 where
12000 ___E: ::fidl_next::Encoder + ?Sized,
12001 {
12002 #[inline]
12003 fn encode(
12004 mut self,
12005 encoder: &mut ___E,
12006 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeDirectory<'static>>,
12007 _: (),
12008 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12009 ::fidl_next::munge!(let crate::wire::ExposeDirectory { table } = out);
12010
12011 let max_ord = self.__max_ordinal();
12012
12013 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12014 ::fidl_next::Wire::zero_padding(&mut out);
12015
12016 let mut preallocated =
12017 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12018
12019 for i in 1..=max_ord {
12020 match i {
12021 8 => {
12022 if let Some(value) = self.source_dictionary.take() {
12023 ::fidl_next::WireEnvelope::encode_value::<
12024 ::fidl_next::WireString<'static>,
12025 ___E,
12026 >(
12027 value, preallocated.encoder, &mut out, 1024
12028 )?;
12029 } else {
12030 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12031 }
12032 }
12033
12034 7 => {
12035 if let Some(value) = self.availability.take() {
12036 ::fidl_next::WireEnvelope::encode_value::<
12037 crate::wire::Availability,
12038 ___E,
12039 >(
12040 value, preallocated.encoder, &mut out, ()
12041 )?;
12042 } else {
12043 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12044 }
12045 }
12046
12047 6 => {
12048 if let Some(value) = self.subdir.take() {
12049 ::fidl_next::WireEnvelope::encode_value::<
12050 ::fidl_next::WireString<'static>,
12051 ___E,
12052 >(
12053 value, preallocated.encoder, &mut out, 1024
12054 )?;
12055 } else {
12056 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12057 }
12058 }
12059
12060 5 => {
12061 if let Some(value) = self.rights.take() {
12062 ::fidl_next::WireEnvelope::encode_value::<
12063 ::fidl_next_common_fuchsia_io::wire::Operations,
12064 ___E,
12065 >(
12066 value, preallocated.encoder, &mut out, ()
12067 )?;
12068 } else {
12069 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12070 }
12071 }
12072
12073 4 => {
12074 if let Some(value) = self.target_name.take() {
12075 ::fidl_next::WireEnvelope::encode_value::<
12076 ::fidl_next::WireString<'static>,
12077 ___E,
12078 >(
12079 value, preallocated.encoder, &mut out, 100
12080 )?;
12081 } else {
12082 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12083 }
12084 }
12085
12086 3 => {
12087 if let Some(value) = self.target.take() {
12088 ::fidl_next::WireEnvelope::encode_value::<
12089 crate::wire::Ref<'static>,
12090 ___E,
12091 >(
12092 value, preallocated.encoder, &mut out, ()
12093 )?;
12094 } else {
12095 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12096 }
12097 }
12098
12099 2 => {
12100 if let Some(value) = self.source_name.take() {
12101 ::fidl_next::WireEnvelope::encode_value::<
12102 ::fidl_next::WireString<'static>,
12103 ___E,
12104 >(
12105 value, preallocated.encoder, &mut out, 100
12106 )?;
12107 } else {
12108 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12109 }
12110 }
12111
12112 1 => {
12113 if let Some(value) = self.source.take() {
12114 ::fidl_next::WireEnvelope::encode_value::<
12115 crate::wire::Ref<'static>,
12116 ___E,
12117 >(
12118 value, preallocated.encoder, &mut out, ()
12119 )?;
12120 } else {
12121 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12122 }
12123 }
12124
12125 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12126 }
12127 unsafe {
12128 preallocated.write_next(out.assume_init_ref());
12129 }
12130 }
12131
12132 ::fidl_next::WireTable::encode_len(table, max_ord);
12133
12134 Ok(())
12135 }
12136 }
12137
12138 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeDirectory<'static>, ___E>
12139 for &'a ExposeDirectory
12140 where
12141 ___E: ::fidl_next::Encoder + ?Sized,
12142 {
12143 #[inline]
12144 fn encode(
12145 self,
12146 encoder: &mut ___E,
12147 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeDirectory<'static>>,
12148 _: (),
12149 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12150 ::fidl_next::munge!(let crate::wire::ExposeDirectory { table } = out);
12151
12152 let max_ord = self.__max_ordinal();
12153
12154 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12155 ::fidl_next::Wire::zero_padding(&mut out);
12156
12157 let mut preallocated =
12158 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12159
12160 for i in 1..=max_ord {
12161 match i {
12162 8 => {
12163 if let Some(value) = &self.source_dictionary {
12164 ::fidl_next::WireEnvelope::encode_value::<
12165 ::fidl_next::WireString<'static>,
12166 ___E,
12167 >(
12168 value, preallocated.encoder, &mut out, 1024
12169 )?;
12170 } else {
12171 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12172 }
12173 }
12174
12175 7 => {
12176 if let Some(value) = &self.availability {
12177 ::fidl_next::WireEnvelope::encode_value::<
12178 crate::wire::Availability,
12179 ___E,
12180 >(
12181 value, preallocated.encoder, &mut out, ()
12182 )?;
12183 } else {
12184 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12185 }
12186 }
12187
12188 6 => {
12189 if let Some(value) = &self.subdir {
12190 ::fidl_next::WireEnvelope::encode_value::<
12191 ::fidl_next::WireString<'static>,
12192 ___E,
12193 >(
12194 value, preallocated.encoder, &mut out, 1024
12195 )?;
12196 } else {
12197 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12198 }
12199 }
12200
12201 5 => {
12202 if let Some(value) = &self.rights {
12203 ::fidl_next::WireEnvelope::encode_value::<
12204 ::fidl_next_common_fuchsia_io::wire::Operations,
12205 ___E,
12206 >(
12207 value, preallocated.encoder, &mut out, ()
12208 )?;
12209 } else {
12210 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12211 }
12212 }
12213
12214 4 => {
12215 if let Some(value) = &self.target_name {
12216 ::fidl_next::WireEnvelope::encode_value::<
12217 ::fidl_next::WireString<'static>,
12218 ___E,
12219 >(
12220 value, preallocated.encoder, &mut out, 100
12221 )?;
12222 } else {
12223 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12224 }
12225 }
12226
12227 3 => {
12228 if let Some(value) = &self.target {
12229 ::fidl_next::WireEnvelope::encode_value::<
12230 crate::wire::Ref<'static>,
12231 ___E,
12232 >(
12233 value, preallocated.encoder, &mut out, ()
12234 )?;
12235 } else {
12236 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12237 }
12238 }
12239
12240 2 => {
12241 if let Some(value) = &self.source_name {
12242 ::fidl_next::WireEnvelope::encode_value::<
12243 ::fidl_next::WireString<'static>,
12244 ___E,
12245 >(
12246 value, preallocated.encoder, &mut out, 100
12247 )?;
12248 } else {
12249 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12250 }
12251 }
12252
12253 1 => {
12254 if let Some(value) = &self.source {
12255 ::fidl_next::WireEnvelope::encode_value::<
12256 crate::wire::Ref<'static>,
12257 ___E,
12258 >(
12259 value, preallocated.encoder, &mut out, ()
12260 )?;
12261 } else {
12262 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12263 }
12264 }
12265
12266 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12267 }
12268 unsafe {
12269 preallocated.write_next(out.assume_init_ref());
12270 }
12271 }
12272
12273 ::fidl_next::WireTable::encode_len(table, max_ord);
12274
12275 Ok(())
12276 }
12277 }
12278
12279 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeDirectory<'de>> for ExposeDirectory {
12280 #[inline]
12281 fn from_wire(wire_: crate::wire::ExposeDirectory<'de>) -> Self {
12282 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
12283
12284 let source = wire_.table.get(1);
12285
12286 let source_name = wire_.table.get(2);
12287
12288 let target = wire_.table.get(3);
12289
12290 let target_name = wire_.table.get(4);
12291
12292 let rights = wire_.table.get(5);
12293
12294 let subdir = wire_.table.get(6);
12295
12296 let availability = wire_.table.get(7);
12297
12298 let source_dictionary = wire_.table.get(8);
12299
12300 Self {
12301 source: source.map(|envelope| {
12302 ::fidl_next::FromWire::from_wire(unsafe {
12303 envelope.read_unchecked::<crate::wire::Ref<'de>>()
12304 })
12305 }),
12306
12307 source_name: source_name.map(|envelope| {
12308 ::fidl_next::FromWire::from_wire(unsafe {
12309 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
12310 })
12311 }),
12312
12313 target: target.map(|envelope| {
12314 ::fidl_next::FromWire::from_wire(unsafe {
12315 envelope.read_unchecked::<crate::wire::Ref<'de>>()
12316 })
12317 }),
12318
12319 target_name: target_name.map(|envelope| {
12320 ::fidl_next::FromWire::from_wire(unsafe {
12321 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
12322 })
12323 }),
12324
12325 rights: rights.map(|envelope| {
12326 ::fidl_next::FromWire::from_wire(unsafe {
12327 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
12328 })
12329 }),
12330
12331 subdir: subdir.map(|envelope| {
12332 ::fidl_next::FromWire::from_wire(unsafe {
12333 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
12334 })
12335 }),
12336
12337 availability: availability.map(|envelope| {
12338 ::fidl_next::FromWire::from_wire(unsafe {
12339 envelope.read_unchecked::<crate::wire::Availability>()
12340 })
12341 }),
12342
12343 source_dictionary: source_dictionary.map(|envelope| {
12344 ::fidl_next::FromWire::from_wire(unsafe {
12345 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
12346 })
12347 }),
12348 }
12349 }
12350 }
12351
12352 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeDirectory<'de>> for ExposeDirectory {
12353 #[inline]
12354 fn from_wire_ref(wire: &crate::wire::ExposeDirectory<'de>) -> Self {
12355 Self {
12356 source: wire.table.get(1).map(|envelope| {
12357 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12358 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
12359 })
12360 }),
12361
12362 source_name: wire.table.get(2).map(|envelope| {
12363 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12364 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
12365 })
12366 }),
12367
12368 target: wire.table.get(3).map(|envelope| {
12369 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12370 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
12371 })
12372 }),
12373
12374 target_name: wire.table.get(4).map(|envelope| {
12375 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12376 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
12377 })
12378 }),
12379
12380 rights: wire.table.get(5).map(|envelope| {
12381 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12382 envelope
12383 .deref_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
12384 })
12385 }),
12386
12387 subdir: wire.table.get(6).map(|envelope| {
12388 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12389 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
12390 })
12391 }),
12392
12393 availability: wire.table.get(7).map(|envelope| {
12394 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12395 envelope.deref_unchecked::<crate::wire::Availability>()
12396 })
12397 }),
12398
12399 source_dictionary: wire.table.get(8).map(|envelope| {
12400 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12401 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
12402 })
12403 }),
12404 }
12405 }
12406 }
12407
12408 #[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"]
12409 #[derive(PartialEq, Clone, Debug, Default)]
12410 pub struct ExposeRunner {
12411 pub source: ::core::option::Option<crate::natural::Ref>,
12412
12413 pub source_name: ::core::option::Option<::std::string::String>,
12414
12415 pub target: ::core::option::Option<crate::natural::Ref>,
12416
12417 pub target_name: ::core::option::Option<::std::string::String>,
12418
12419 pub source_dictionary: ::core::option::Option<::std::string::String>,
12420 }
12421
12422 impl ExposeRunner {
12423 fn __max_ordinal(&self) -> usize {
12424 if self.source_dictionary.is_some() {
12425 return 6;
12426 }
12427
12428 if self.target_name.is_some() {
12429 return 4;
12430 }
12431
12432 if self.target.is_some() {
12433 return 3;
12434 }
12435
12436 if self.source_name.is_some() {
12437 return 2;
12438 }
12439
12440 if self.source.is_some() {
12441 return 1;
12442 }
12443
12444 0
12445 }
12446 }
12447
12448 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeRunner<'static>, ___E> for ExposeRunner
12449 where
12450 ___E: ::fidl_next::Encoder + ?Sized,
12451 {
12452 #[inline]
12453 fn encode(
12454 mut self,
12455 encoder: &mut ___E,
12456 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeRunner<'static>>,
12457 _: (),
12458 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12459 ::fidl_next::munge!(let crate::wire::ExposeRunner { table } = out);
12460
12461 let max_ord = self.__max_ordinal();
12462
12463 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12464 ::fidl_next::Wire::zero_padding(&mut out);
12465
12466 let mut preallocated =
12467 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12468
12469 for i in 1..=max_ord {
12470 match i {
12471 6 => {
12472 if let Some(value) = self.source_dictionary.take() {
12473 ::fidl_next::WireEnvelope::encode_value::<
12474 ::fidl_next::WireString<'static>,
12475 ___E,
12476 >(
12477 value, preallocated.encoder, &mut out, 1024
12478 )?;
12479 } else {
12480 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12481 }
12482 }
12483
12484 4 => {
12485 if let Some(value) = self.target_name.take() {
12486 ::fidl_next::WireEnvelope::encode_value::<
12487 ::fidl_next::WireString<'static>,
12488 ___E,
12489 >(
12490 value, preallocated.encoder, &mut out, 100
12491 )?;
12492 } else {
12493 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12494 }
12495 }
12496
12497 3 => {
12498 if let Some(value) = self.target.take() {
12499 ::fidl_next::WireEnvelope::encode_value::<
12500 crate::wire::Ref<'static>,
12501 ___E,
12502 >(
12503 value, preallocated.encoder, &mut out, ()
12504 )?;
12505 } else {
12506 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12507 }
12508 }
12509
12510 2 => {
12511 if let Some(value) = self.source_name.take() {
12512 ::fidl_next::WireEnvelope::encode_value::<
12513 ::fidl_next::WireString<'static>,
12514 ___E,
12515 >(
12516 value, preallocated.encoder, &mut out, 100
12517 )?;
12518 } else {
12519 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12520 }
12521 }
12522
12523 1 => {
12524 if let Some(value) = self.source.take() {
12525 ::fidl_next::WireEnvelope::encode_value::<
12526 crate::wire::Ref<'static>,
12527 ___E,
12528 >(
12529 value, preallocated.encoder, &mut out, ()
12530 )?;
12531 } else {
12532 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12533 }
12534 }
12535
12536 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12537 }
12538 unsafe {
12539 preallocated.write_next(out.assume_init_ref());
12540 }
12541 }
12542
12543 ::fidl_next::WireTable::encode_len(table, max_ord);
12544
12545 Ok(())
12546 }
12547 }
12548
12549 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeRunner<'static>, ___E>
12550 for &'a ExposeRunner
12551 where
12552 ___E: ::fidl_next::Encoder + ?Sized,
12553 {
12554 #[inline]
12555 fn encode(
12556 self,
12557 encoder: &mut ___E,
12558 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeRunner<'static>>,
12559 _: (),
12560 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12561 ::fidl_next::munge!(let crate::wire::ExposeRunner { table } = out);
12562
12563 let max_ord = self.__max_ordinal();
12564
12565 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12566 ::fidl_next::Wire::zero_padding(&mut out);
12567
12568 let mut preallocated =
12569 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12570
12571 for i in 1..=max_ord {
12572 match i {
12573 6 => {
12574 if let Some(value) = &self.source_dictionary {
12575 ::fidl_next::WireEnvelope::encode_value::<
12576 ::fidl_next::WireString<'static>,
12577 ___E,
12578 >(
12579 value, preallocated.encoder, &mut out, 1024
12580 )?;
12581 } else {
12582 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12583 }
12584 }
12585
12586 4 => {
12587 if let Some(value) = &self.target_name {
12588 ::fidl_next::WireEnvelope::encode_value::<
12589 ::fidl_next::WireString<'static>,
12590 ___E,
12591 >(
12592 value, preallocated.encoder, &mut out, 100
12593 )?;
12594 } else {
12595 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12596 }
12597 }
12598
12599 3 => {
12600 if let Some(value) = &self.target {
12601 ::fidl_next::WireEnvelope::encode_value::<
12602 crate::wire::Ref<'static>,
12603 ___E,
12604 >(
12605 value, preallocated.encoder, &mut out, ()
12606 )?;
12607 } else {
12608 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12609 }
12610 }
12611
12612 2 => {
12613 if let Some(value) = &self.source_name {
12614 ::fidl_next::WireEnvelope::encode_value::<
12615 ::fidl_next::WireString<'static>,
12616 ___E,
12617 >(
12618 value, preallocated.encoder, &mut out, 100
12619 )?;
12620 } else {
12621 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12622 }
12623 }
12624
12625 1 => {
12626 if let Some(value) = &self.source {
12627 ::fidl_next::WireEnvelope::encode_value::<
12628 crate::wire::Ref<'static>,
12629 ___E,
12630 >(
12631 value, preallocated.encoder, &mut out, ()
12632 )?;
12633 } else {
12634 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12635 }
12636 }
12637
12638 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12639 }
12640 unsafe {
12641 preallocated.write_next(out.assume_init_ref());
12642 }
12643 }
12644
12645 ::fidl_next::WireTable::encode_len(table, max_ord);
12646
12647 Ok(())
12648 }
12649 }
12650
12651 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeRunner<'de>> for ExposeRunner {
12652 #[inline]
12653 fn from_wire(wire_: crate::wire::ExposeRunner<'de>) -> Self {
12654 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
12655
12656 let source = wire_.table.get(1);
12657
12658 let source_name = wire_.table.get(2);
12659
12660 let target = wire_.table.get(3);
12661
12662 let target_name = wire_.table.get(4);
12663
12664 let source_dictionary = wire_.table.get(6);
12665
12666 Self {
12667 source: source.map(|envelope| {
12668 ::fidl_next::FromWire::from_wire(unsafe {
12669 envelope.read_unchecked::<crate::wire::Ref<'de>>()
12670 })
12671 }),
12672
12673 source_name: source_name.map(|envelope| {
12674 ::fidl_next::FromWire::from_wire(unsafe {
12675 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
12676 })
12677 }),
12678
12679 target: target.map(|envelope| {
12680 ::fidl_next::FromWire::from_wire(unsafe {
12681 envelope.read_unchecked::<crate::wire::Ref<'de>>()
12682 })
12683 }),
12684
12685 target_name: target_name.map(|envelope| {
12686 ::fidl_next::FromWire::from_wire(unsafe {
12687 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
12688 })
12689 }),
12690
12691 source_dictionary: source_dictionary.map(|envelope| {
12692 ::fidl_next::FromWire::from_wire(unsafe {
12693 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
12694 })
12695 }),
12696 }
12697 }
12698 }
12699
12700 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeRunner<'de>> for ExposeRunner {
12701 #[inline]
12702 fn from_wire_ref(wire: &crate::wire::ExposeRunner<'de>) -> Self {
12703 Self {
12704 source: wire.table.get(1).map(|envelope| {
12705 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12706 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
12707 })
12708 }),
12709
12710 source_name: wire.table.get(2).map(|envelope| {
12711 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12712 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
12713 })
12714 }),
12715
12716 target: wire.table.get(3).map(|envelope| {
12717 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12718 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
12719 })
12720 }),
12721
12722 target_name: wire.table.get(4).map(|envelope| {
12723 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12724 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
12725 })
12726 }),
12727
12728 source_dictionary: wire.table.get(6).map(|envelope| {
12729 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
12730 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
12731 })
12732 }),
12733 }
12734 }
12735 }
12736
12737 #[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"]
12738 #[derive(PartialEq, Clone, Debug, Default)]
12739 pub struct ExposeResolver {
12740 pub source: ::core::option::Option<crate::natural::Ref>,
12741
12742 pub source_name: ::core::option::Option<::std::string::String>,
12743
12744 pub target: ::core::option::Option<crate::natural::Ref>,
12745
12746 pub target_name: ::core::option::Option<::std::string::String>,
12747
12748 pub source_dictionary: ::core::option::Option<::std::string::String>,
12749 }
12750
12751 impl ExposeResolver {
12752 fn __max_ordinal(&self) -> usize {
12753 if self.source_dictionary.is_some() {
12754 return 6;
12755 }
12756
12757 if self.target_name.is_some() {
12758 return 4;
12759 }
12760
12761 if self.target.is_some() {
12762 return 3;
12763 }
12764
12765 if self.source_name.is_some() {
12766 return 2;
12767 }
12768
12769 if self.source.is_some() {
12770 return 1;
12771 }
12772
12773 0
12774 }
12775 }
12776
12777 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeResolver<'static>, ___E> for ExposeResolver
12778 where
12779 ___E: ::fidl_next::Encoder + ?Sized,
12780 {
12781 #[inline]
12782 fn encode(
12783 mut self,
12784 encoder: &mut ___E,
12785 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeResolver<'static>>,
12786 _: (),
12787 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12788 ::fidl_next::munge!(let crate::wire::ExposeResolver { table } = out);
12789
12790 let max_ord = self.__max_ordinal();
12791
12792 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12793 ::fidl_next::Wire::zero_padding(&mut out);
12794
12795 let mut preallocated =
12796 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12797
12798 for i in 1..=max_ord {
12799 match i {
12800 6 => {
12801 if let Some(value) = self.source_dictionary.take() {
12802 ::fidl_next::WireEnvelope::encode_value::<
12803 ::fidl_next::WireString<'static>,
12804 ___E,
12805 >(
12806 value, preallocated.encoder, &mut out, 1024
12807 )?;
12808 } else {
12809 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12810 }
12811 }
12812
12813 4 => {
12814 if let Some(value) = self.target_name.take() {
12815 ::fidl_next::WireEnvelope::encode_value::<
12816 ::fidl_next::WireString<'static>,
12817 ___E,
12818 >(
12819 value, preallocated.encoder, &mut out, 100
12820 )?;
12821 } else {
12822 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12823 }
12824 }
12825
12826 3 => {
12827 if let Some(value) = self.target.take() {
12828 ::fidl_next::WireEnvelope::encode_value::<
12829 crate::wire::Ref<'static>,
12830 ___E,
12831 >(
12832 value, preallocated.encoder, &mut out, ()
12833 )?;
12834 } else {
12835 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12836 }
12837 }
12838
12839 2 => {
12840 if let Some(value) = self.source_name.take() {
12841 ::fidl_next::WireEnvelope::encode_value::<
12842 ::fidl_next::WireString<'static>,
12843 ___E,
12844 >(
12845 value, preallocated.encoder, &mut out, 100
12846 )?;
12847 } else {
12848 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12849 }
12850 }
12851
12852 1 => {
12853 if let Some(value) = self.source.take() {
12854 ::fidl_next::WireEnvelope::encode_value::<
12855 crate::wire::Ref<'static>,
12856 ___E,
12857 >(
12858 value, preallocated.encoder, &mut out, ()
12859 )?;
12860 } else {
12861 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12862 }
12863 }
12864
12865 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12866 }
12867 unsafe {
12868 preallocated.write_next(out.assume_init_ref());
12869 }
12870 }
12871
12872 ::fidl_next::WireTable::encode_len(table, max_ord);
12873
12874 Ok(())
12875 }
12876 }
12877
12878 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeResolver<'static>, ___E>
12879 for &'a ExposeResolver
12880 where
12881 ___E: ::fidl_next::Encoder + ?Sized,
12882 {
12883 #[inline]
12884 fn encode(
12885 self,
12886 encoder: &mut ___E,
12887 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeResolver<'static>>,
12888 _: (),
12889 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
12890 ::fidl_next::munge!(let crate::wire::ExposeResolver { table } = out);
12891
12892 let max_ord = self.__max_ordinal();
12893
12894 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
12895 ::fidl_next::Wire::zero_padding(&mut out);
12896
12897 let mut preallocated =
12898 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
12899
12900 for i in 1..=max_ord {
12901 match i {
12902 6 => {
12903 if let Some(value) = &self.source_dictionary {
12904 ::fidl_next::WireEnvelope::encode_value::<
12905 ::fidl_next::WireString<'static>,
12906 ___E,
12907 >(
12908 value, preallocated.encoder, &mut out, 1024
12909 )?;
12910 } else {
12911 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12912 }
12913 }
12914
12915 4 => {
12916 if let Some(value) = &self.target_name {
12917 ::fidl_next::WireEnvelope::encode_value::<
12918 ::fidl_next::WireString<'static>,
12919 ___E,
12920 >(
12921 value, preallocated.encoder, &mut out, 100
12922 )?;
12923 } else {
12924 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12925 }
12926 }
12927
12928 3 => {
12929 if let Some(value) = &self.target {
12930 ::fidl_next::WireEnvelope::encode_value::<
12931 crate::wire::Ref<'static>,
12932 ___E,
12933 >(
12934 value, preallocated.encoder, &mut out, ()
12935 )?;
12936 } else {
12937 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12938 }
12939 }
12940
12941 2 => {
12942 if let Some(value) = &self.source_name {
12943 ::fidl_next::WireEnvelope::encode_value::<
12944 ::fidl_next::WireString<'static>,
12945 ___E,
12946 >(
12947 value, preallocated.encoder, &mut out, 100
12948 )?;
12949 } else {
12950 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12951 }
12952 }
12953
12954 1 => {
12955 if let Some(value) = &self.source {
12956 ::fidl_next::WireEnvelope::encode_value::<
12957 crate::wire::Ref<'static>,
12958 ___E,
12959 >(
12960 value, preallocated.encoder, &mut out, ()
12961 )?;
12962 } else {
12963 ::fidl_next::WireEnvelope::encode_zero(&mut out)
12964 }
12965 }
12966
12967 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
12968 }
12969 unsafe {
12970 preallocated.write_next(out.assume_init_ref());
12971 }
12972 }
12973
12974 ::fidl_next::WireTable::encode_len(table, max_ord);
12975
12976 Ok(())
12977 }
12978 }
12979
12980 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeResolver<'de>> for ExposeResolver {
12981 #[inline]
12982 fn from_wire(wire_: crate::wire::ExposeResolver<'de>) -> Self {
12983 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
12984
12985 let source = wire_.table.get(1);
12986
12987 let source_name = wire_.table.get(2);
12988
12989 let target = wire_.table.get(3);
12990
12991 let target_name = wire_.table.get(4);
12992
12993 let source_dictionary = wire_.table.get(6);
12994
12995 Self {
12996 source: source.map(|envelope| {
12997 ::fidl_next::FromWire::from_wire(unsafe {
12998 envelope.read_unchecked::<crate::wire::Ref<'de>>()
12999 })
13000 }),
13001
13002 source_name: source_name.map(|envelope| {
13003 ::fidl_next::FromWire::from_wire(unsafe {
13004 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13005 })
13006 }),
13007
13008 target: target.map(|envelope| {
13009 ::fidl_next::FromWire::from_wire(unsafe {
13010 envelope.read_unchecked::<crate::wire::Ref<'de>>()
13011 })
13012 }),
13013
13014 target_name: target_name.map(|envelope| {
13015 ::fidl_next::FromWire::from_wire(unsafe {
13016 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13017 })
13018 }),
13019
13020 source_dictionary: source_dictionary.map(|envelope| {
13021 ::fidl_next::FromWire::from_wire(unsafe {
13022 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13023 })
13024 }),
13025 }
13026 }
13027 }
13028
13029 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeResolver<'de>> for ExposeResolver {
13030 #[inline]
13031 fn from_wire_ref(wire: &crate::wire::ExposeResolver<'de>) -> Self {
13032 Self {
13033 source: wire.table.get(1).map(|envelope| {
13034 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13035 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
13036 })
13037 }),
13038
13039 source_name: wire.table.get(2).map(|envelope| {
13040 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13041 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13042 })
13043 }),
13044
13045 target: wire.table.get(3).map(|envelope| {
13046 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13047 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
13048 })
13049 }),
13050
13051 target_name: wire.table.get(4).map(|envelope| {
13052 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13053 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13054 })
13055 }),
13056
13057 source_dictionary: wire.table.get(6).map(|envelope| {
13058 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13059 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13060 })
13061 }),
13062 }
13063 }
13064 }
13065
13066 #[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"]
13067 #[derive(PartialEq, Clone, Debug, Default)]
13068 pub struct ExposeDictionary {
13069 pub source: ::core::option::Option<crate::natural::Ref>,
13070
13071 pub source_name: ::core::option::Option<::std::string::String>,
13072
13073 pub target: ::core::option::Option<crate::natural::Ref>,
13074
13075 pub target_name: ::core::option::Option<::std::string::String>,
13076
13077 pub availability: ::core::option::Option<crate::natural::Availability>,
13078
13079 pub source_dictionary: ::core::option::Option<::std::string::String>,
13080 }
13081
13082 impl ExposeDictionary {
13083 fn __max_ordinal(&self) -> usize {
13084 if self.source_dictionary.is_some() {
13085 return 6;
13086 }
13087
13088 if self.availability.is_some() {
13089 return 5;
13090 }
13091
13092 if self.target_name.is_some() {
13093 return 4;
13094 }
13095
13096 if self.target.is_some() {
13097 return 3;
13098 }
13099
13100 if self.source_name.is_some() {
13101 return 2;
13102 }
13103
13104 if self.source.is_some() {
13105 return 1;
13106 }
13107
13108 0
13109 }
13110 }
13111
13112 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeDictionary<'static>, ___E>
13113 for ExposeDictionary
13114 where
13115 ___E: ::fidl_next::Encoder + ?Sized,
13116 {
13117 #[inline]
13118 fn encode(
13119 mut self,
13120 encoder: &mut ___E,
13121 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeDictionary<'static>>,
13122 _: (),
13123 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13124 ::fidl_next::munge!(let crate::wire::ExposeDictionary { table } = out);
13125
13126 let max_ord = self.__max_ordinal();
13127
13128 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
13129 ::fidl_next::Wire::zero_padding(&mut out);
13130
13131 let mut preallocated =
13132 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
13133
13134 for i in 1..=max_ord {
13135 match i {
13136 6 => {
13137 if let Some(value) = self.source_dictionary.take() {
13138 ::fidl_next::WireEnvelope::encode_value::<
13139 ::fidl_next::WireString<'static>,
13140 ___E,
13141 >(
13142 value, preallocated.encoder, &mut out, 1024
13143 )?;
13144 } else {
13145 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13146 }
13147 }
13148
13149 5 => {
13150 if let Some(value) = self.availability.take() {
13151 ::fidl_next::WireEnvelope::encode_value::<
13152 crate::wire::Availability,
13153 ___E,
13154 >(
13155 value, preallocated.encoder, &mut out, ()
13156 )?;
13157 } else {
13158 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13159 }
13160 }
13161
13162 4 => {
13163 if let Some(value) = self.target_name.take() {
13164 ::fidl_next::WireEnvelope::encode_value::<
13165 ::fidl_next::WireString<'static>,
13166 ___E,
13167 >(
13168 value, preallocated.encoder, &mut out, 100
13169 )?;
13170 } else {
13171 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13172 }
13173 }
13174
13175 3 => {
13176 if let Some(value) = self.target.take() {
13177 ::fidl_next::WireEnvelope::encode_value::<
13178 crate::wire::Ref<'static>,
13179 ___E,
13180 >(
13181 value, preallocated.encoder, &mut out, ()
13182 )?;
13183 } else {
13184 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13185 }
13186 }
13187
13188 2 => {
13189 if let Some(value) = self.source_name.take() {
13190 ::fidl_next::WireEnvelope::encode_value::<
13191 ::fidl_next::WireString<'static>,
13192 ___E,
13193 >(
13194 value, preallocated.encoder, &mut out, 100
13195 )?;
13196 } else {
13197 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13198 }
13199 }
13200
13201 1 => {
13202 if let Some(value) = self.source.take() {
13203 ::fidl_next::WireEnvelope::encode_value::<
13204 crate::wire::Ref<'static>,
13205 ___E,
13206 >(
13207 value, preallocated.encoder, &mut out, ()
13208 )?;
13209 } else {
13210 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13211 }
13212 }
13213
13214 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
13215 }
13216 unsafe {
13217 preallocated.write_next(out.assume_init_ref());
13218 }
13219 }
13220
13221 ::fidl_next::WireTable::encode_len(table, max_ord);
13222
13223 Ok(())
13224 }
13225 }
13226
13227 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeDictionary<'static>, ___E>
13228 for &'a ExposeDictionary
13229 where
13230 ___E: ::fidl_next::Encoder + ?Sized,
13231 {
13232 #[inline]
13233 fn encode(
13234 self,
13235 encoder: &mut ___E,
13236 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeDictionary<'static>>,
13237 _: (),
13238 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13239 ::fidl_next::munge!(let crate::wire::ExposeDictionary { table } = out);
13240
13241 let max_ord = self.__max_ordinal();
13242
13243 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
13244 ::fidl_next::Wire::zero_padding(&mut out);
13245
13246 let mut preallocated =
13247 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
13248
13249 for i in 1..=max_ord {
13250 match i {
13251 6 => {
13252 if let Some(value) = &self.source_dictionary {
13253 ::fidl_next::WireEnvelope::encode_value::<
13254 ::fidl_next::WireString<'static>,
13255 ___E,
13256 >(
13257 value, preallocated.encoder, &mut out, 1024
13258 )?;
13259 } else {
13260 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13261 }
13262 }
13263
13264 5 => {
13265 if let Some(value) = &self.availability {
13266 ::fidl_next::WireEnvelope::encode_value::<
13267 crate::wire::Availability,
13268 ___E,
13269 >(
13270 value, preallocated.encoder, &mut out, ()
13271 )?;
13272 } else {
13273 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13274 }
13275 }
13276
13277 4 => {
13278 if let Some(value) = &self.target_name {
13279 ::fidl_next::WireEnvelope::encode_value::<
13280 ::fidl_next::WireString<'static>,
13281 ___E,
13282 >(
13283 value, preallocated.encoder, &mut out, 100
13284 )?;
13285 } else {
13286 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13287 }
13288 }
13289
13290 3 => {
13291 if let Some(value) = &self.target {
13292 ::fidl_next::WireEnvelope::encode_value::<
13293 crate::wire::Ref<'static>,
13294 ___E,
13295 >(
13296 value, preallocated.encoder, &mut out, ()
13297 )?;
13298 } else {
13299 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13300 }
13301 }
13302
13303 2 => {
13304 if let Some(value) = &self.source_name {
13305 ::fidl_next::WireEnvelope::encode_value::<
13306 ::fidl_next::WireString<'static>,
13307 ___E,
13308 >(
13309 value, preallocated.encoder, &mut out, 100
13310 )?;
13311 } else {
13312 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13313 }
13314 }
13315
13316 1 => {
13317 if let Some(value) = &self.source {
13318 ::fidl_next::WireEnvelope::encode_value::<
13319 crate::wire::Ref<'static>,
13320 ___E,
13321 >(
13322 value, preallocated.encoder, &mut out, ()
13323 )?;
13324 } else {
13325 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13326 }
13327 }
13328
13329 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
13330 }
13331 unsafe {
13332 preallocated.write_next(out.assume_init_ref());
13333 }
13334 }
13335
13336 ::fidl_next::WireTable::encode_len(table, max_ord);
13337
13338 Ok(())
13339 }
13340 }
13341
13342 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeDictionary<'de>> for ExposeDictionary {
13343 #[inline]
13344 fn from_wire(wire_: crate::wire::ExposeDictionary<'de>) -> Self {
13345 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
13346
13347 let source = wire_.table.get(1);
13348
13349 let source_name = wire_.table.get(2);
13350
13351 let target = wire_.table.get(3);
13352
13353 let target_name = wire_.table.get(4);
13354
13355 let availability = wire_.table.get(5);
13356
13357 let source_dictionary = wire_.table.get(6);
13358
13359 Self {
13360 source: source.map(|envelope| {
13361 ::fidl_next::FromWire::from_wire(unsafe {
13362 envelope.read_unchecked::<crate::wire::Ref<'de>>()
13363 })
13364 }),
13365
13366 source_name: source_name.map(|envelope| {
13367 ::fidl_next::FromWire::from_wire(unsafe {
13368 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13369 })
13370 }),
13371
13372 target: target.map(|envelope| {
13373 ::fidl_next::FromWire::from_wire(unsafe {
13374 envelope.read_unchecked::<crate::wire::Ref<'de>>()
13375 })
13376 }),
13377
13378 target_name: target_name.map(|envelope| {
13379 ::fidl_next::FromWire::from_wire(unsafe {
13380 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13381 })
13382 }),
13383
13384 availability: availability.map(|envelope| {
13385 ::fidl_next::FromWire::from_wire(unsafe {
13386 envelope.read_unchecked::<crate::wire::Availability>()
13387 })
13388 }),
13389
13390 source_dictionary: source_dictionary.map(|envelope| {
13391 ::fidl_next::FromWire::from_wire(unsafe {
13392 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13393 })
13394 }),
13395 }
13396 }
13397 }
13398
13399 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeDictionary<'de>> for ExposeDictionary {
13400 #[inline]
13401 fn from_wire_ref(wire: &crate::wire::ExposeDictionary<'de>) -> Self {
13402 Self {
13403 source: wire.table.get(1).map(|envelope| {
13404 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13405 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
13406 })
13407 }),
13408
13409 source_name: wire.table.get(2).map(|envelope| {
13410 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13411 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13412 })
13413 }),
13414
13415 target: wire.table.get(3).map(|envelope| {
13416 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13417 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
13418 })
13419 }),
13420
13421 target_name: wire.table.get(4).map(|envelope| {
13422 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13423 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13424 })
13425 }),
13426
13427 availability: wire.table.get(5).map(|envelope| {
13428 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13429 envelope.deref_unchecked::<crate::wire::Availability>()
13430 })
13431 }),
13432
13433 source_dictionary: wire.table.get(6).map(|envelope| {
13434 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13435 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13436 })
13437 }),
13438 }
13439 }
13440 }
13441
13442 #[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"]
13443 #[derive(PartialEq, Clone, Debug, Default)]
13444 pub struct ExposeConfiguration {
13445 pub source: ::core::option::Option<crate::natural::Ref>,
13446
13447 pub source_name: ::core::option::Option<::std::string::String>,
13448
13449 pub target: ::core::option::Option<crate::natural::Ref>,
13450
13451 pub target_name: ::core::option::Option<::std::string::String>,
13452
13453 pub availability: ::core::option::Option<crate::natural::Availability>,
13454
13455 pub source_dictionary: ::core::option::Option<::std::string::String>,
13456 }
13457
13458 impl ExposeConfiguration {
13459 fn __max_ordinal(&self) -> usize {
13460 if self.source_dictionary.is_some() {
13461 return 6;
13462 }
13463
13464 if self.availability.is_some() {
13465 return 5;
13466 }
13467
13468 if self.target_name.is_some() {
13469 return 4;
13470 }
13471
13472 if self.target.is_some() {
13473 return 3;
13474 }
13475
13476 if self.source_name.is_some() {
13477 return 2;
13478 }
13479
13480 if self.source.is_some() {
13481 return 1;
13482 }
13483
13484 0
13485 }
13486 }
13487
13488 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ExposeConfiguration<'static>, ___E>
13489 for ExposeConfiguration
13490 where
13491 ___E: ::fidl_next::Encoder + ?Sized,
13492 {
13493 #[inline]
13494 fn encode(
13495 mut self,
13496 encoder: &mut ___E,
13497 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeConfiguration<'static>>,
13498 _: (),
13499 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13500 ::fidl_next::munge!(let crate::wire::ExposeConfiguration { table } = out);
13501
13502 let max_ord = self.__max_ordinal();
13503
13504 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
13505 ::fidl_next::Wire::zero_padding(&mut out);
13506
13507 let mut preallocated =
13508 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
13509
13510 for i in 1..=max_ord {
13511 match i {
13512 6 => {
13513 if let Some(value) = self.source_dictionary.take() {
13514 ::fidl_next::WireEnvelope::encode_value::<
13515 ::fidl_next::WireString<'static>,
13516 ___E,
13517 >(
13518 value, preallocated.encoder, &mut out, 1024
13519 )?;
13520 } else {
13521 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13522 }
13523 }
13524
13525 5 => {
13526 if let Some(value) = self.availability.take() {
13527 ::fidl_next::WireEnvelope::encode_value::<
13528 crate::wire::Availability,
13529 ___E,
13530 >(
13531 value, preallocated.encoder, &mut out, ()
13532 )?;
13533 } else {
13534 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13535 }
13536 }
13537
13538 4 => {
13539 if let Some(value) = self.target_name.take() {
13540 ::fidl_next::WireEnvelope::encode_value::<
13541 ::fidl_next::WireString<'static>,
13542 ___E,
13543 >(
13544 value, preallocated.encoder, &mut out, 100
13545 )?;
13546 } else {
13547 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13548 }
13549 }
13550
13551 3 => {
13552 if let Some(value) = self.target.take() {
13553 ::fidl_next::WireEnvelope::encode_value::<
13554 crate::wire::Ref<'static>,
13555 ___E,
13556 >(
13557 value, preallocated.encoder, &mut out, ()
13558 )?;
13559 } else {
13560 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13561 }
13562 }
13563
13564 2 => {
13565 if let Some(value) = self.source_name.take() {
13566 ::fidl_next::WireEnvelope::encode_value::<
13567 ::fidl_next::WireString<'static>,
13568 ___E,
13569 >(
13570 value, preallocated.encoder, &mut out, 100
13571 )?;
13572 } else {
13573 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13574 }
13575 }
13576
13577 1 => {
13578 if let Some(value) = self.source.take() {
13579 ::fidl_next::WireEnvelope::encode_value::<
13580 crate::wire::Ref<'static>,
13581 ___E,
13582 >(
13583 value, preallocated.encoder, &mut out, ()
13584 )?;
13585 } else {
13586 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13587 }
13588 }
13589
13590 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
13591 }
13592 unsafe {
13593 preallocated.write_next(out.assume_init_ref());
13594 }
13595 }
13596
13597 ::fidl_next::WireTable::encode_len(table, max_ord);
13598
13599 Ok(())
13600 }
13601 }
13602
13603 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ExposeConfiguration<'static>, ___E>
13604 for &'a ExposeConfiguration
13605 where
13606 ___E: ::fidl_next::Encoder + ?Sized,
13607 {
13608 #[inline]
13609 fn encode(
13610 self,
13611 encoder: &mut ___E,
13612 out: &mut ::core::mem::MaybeUninit<crate::wire::ExposeConfiguration<'static>>,
13613 _: (),
13614 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13615 ::fidl_next::munge!(let crate::wire::ExposeConfiguration { table } = out);
13616
13617 let max_ord = self.__max_ordinal();
13618
13619 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
13620 ::fidl_next::Wire::zero_padding(&mut out);
13621
13622 let mut preallocated =
13623 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
13624
13625 for i in 1..=max_ord {
13626 match i {
13627 6 => {
13628 if let Some(value) = &self.source_dictionary {
13629 ::fidl_next::WireEnvelope::encode_value::<
13630 ::fidl_next::WireString<'static>,
13631 ___E,
13632 >(
13633 value, preallocated.encoder, &mut out, 1024
13634 )?;
13635 } else {
13636 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13637 }
13638 }
13639
13640 5 => {
13641 if let Some(value) = &self.availability {
13642 ::fidl_next::WireEnvelope::encode_value::<
13643 crate::wire::Availability,
13644 ___E,
13645 >(
13646 value, preallocated.encoder, &mut out, ()
13647 )?;
13648 } else {
13649 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13650 }
13651 }
13652
13653 4 => {
13654 if let Some(value) = &self.target_name {
13655 ::fidl_next::WireEnvelope::encode_value::<
13656 ::fidl_next::WireString<'static>,
13657 ___E,
13658 >(
13659 value, preallocated.encoder, &mut out, 100
13660 )?;
13661 } else {
13662 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13663 }
13664 }
13665
13666 3 => {
13667 if let Some(value) = &self.target {
13668 ::fidl_next::WireEnvelope::encode_value::<
13669 crate::wire::Ref<'static>,
13670 ___E,
13671 >(
13672 value, preallocated.encoder, &mut out, ()
13673 )?;
13674 } else {
13675 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13676 }
13677 }
13678
13679 2 => {
13680 if let Some(value) = &self.source_name {
13681 ::fidl_next::WireEnvelope::encode_value::<
13682 ::fidl_next::WireString<'static>,
13683 ___E,
13684 >(
13685 value, preallocated.encoder, &mut out, 100
13686 )?;
13687 } else {
13688 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13689 }
13690 }
13691
13692 1 => {
13693 if let Some(value) = &self.source {
13694 ::fidl_next::WireEnvelope::encode_value::<
13695 crate::wire::Ref<'static>,
13696 ___E,
13697 >(
13698 value, preallocated.encoder, &mut out, ()
13699 )?;
13700 } else {
13701 ::fidl_next::WireEnvelope::encode_zero(&mut out)
13702 }
13703 }
13704
13705 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
13706 }
13707 unsafe {
13708 preallocated.write_next(out.assume_init_ref());
13709 }
13710 }
13711
13712 ::fidl_next::WireTable::encode_len(table, max_ord);
13713
13714 Ok(())
13715 }
13716 }
13717
13718 impl<'de> ::fidl_next::FromWire<crate::wire::ExposeConfiguration<'de>> for ExposeConfiguration {
13719 #[inline]
13720 fn from_wire(wire_: crate::wire::ExposeConfiguration<'de>) -> Self {
13721 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
13722
13723 let source = wire_.table.get(1);
13724
13725 let source_name = wire_.table.get(2);
13726
13727 let target = wire_.table.get(3);
13728
13729 let target_name = wire_.table.get(4);
13730
13731 let availability = wire_.table.get(5);
13732
13733 let source_dictionary = wire_.table.get(6);
13734
13735 Self {
13736 source: source.map(|envelope| {
13737 ::fidl_next::FromWire::from_wire(unsafe {
13738 envelope.read_unchecked::<crate::wire::Ref<'de>>()
13739 })
13740 }),
13741
13742 source_name: source_name.map(|envelope| {
13743 ::fidl_next::FromWire::from_wire(unsafe {
13744 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13745 })
13746 }),
13747
13748 target: target.map(|envelope| {
13749 ::fidl_next::FromWire::from_wire(unsafe {
13750 envelope.read_unchecked::<crate::wire::Ref<'de>>()
13751 })
13752 }),
13753
13754 target_name: target_name.map(|envelope| {
13755 ::fidl_next::FromWire::from_wire(unsafe {
13756 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13757 })
13758 }),
13759
13760 availability: availability.map(|envelope| {
13761 ::fidl_next::FromWire::from_wire(unsafe {
13762 envelope.read_unchecked::<crate::wire::Availability>()
13763 })
13764 }),
13765
13766 source_dictionary: source_dictionary.map(|envelope| {
13767 ::fidl_next::FromWire::from_wire(unsafe {
13768 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
13769 })
13770 }),
13771 }
13772 }
13773 }
13774
13775 impl<'de> ::fidl_next::FromWireRef<crate::wire::ExposeConfiguration<'de>> for ExposeConfiguration {
13776 #[inline]
13777 fn from_wire_ref(wire: &crate::wire::ExposeConfiguration<'de>) -> Self {
13778 Self {
13779 source: wire.table.get(1).map(|envelope| {
13780 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13781 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
13782 })
13783 }),
13784
13785 source_name: wire.table.get(2).map(|envelope| {
13786 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13787 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13788 })
13789 }),
13790
13791 target: wire.table.get(3).map(|envelope| {
13792 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13793 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
13794 })
13795 }),
13796
13797 target_name: wire.table.get(4).map(|envelope| {
13798 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13799 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13800 })
13801 }),
13802
13803 availability: wire.table.get(5).map(|envelope| {
13804 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13805 envelope.deref_unchecked::<crate::wire::Availability>()
13806 })
13807 }),
13808
13809 source_dictionary: wire.table.get(6).map(|envelope| {
13810 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
13811 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
13812 })
13813 }),
13814 }
13815 }
13816 }
13817
13818 #[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"]
13819 #[derive(PartialEq, Clone, Debug)]
13820 pub enum Expose {
13821 Service(crate::natural::ExposeService),
13822
13823 Protocol(crate::natural::ExposeProtocol),
13824
13825 Directory(crate::natural::ExposeDirectory),
13826
13827 Runner(crate::natural::ExposeRunner),
13828
13829 Resolver(crate::natural::ExposeResolver),
13830
13831 Dictionary(crate::natural::ExposeDictionary),
13832
13833 Config(crate::natural::ExposeConfiguration),
13834
13835 UnknownOrdinal_(u64),
13836 }
13837
13838 impl Expose {
13839 pub fn is_unknown(&self) -> bool {
13840 #[allow(unreachable_patterns)]
13841 match self {
13842 Self::UnknownOrdinal_(_) => true,
13843 _ => false,
13844 }
13845 }
13846 }
13847
13848 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Expose<'static>, ___E> for Expose
13849 where
13850 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13851 ___E: ::fidl_next::Encoder,
13852 {
13853 #[inline]
13854 fn encode(
13855 self,
13856 encoder: &mut ___E,
13857 out: &mut ::core::mem::MaybeUninit<crate::wire::Expose<'static>>,
13858 _: (),
13859 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13860 ::fidl_next::munge!(let crate::wire::Expose { raw, _phantom: _ } = out);
13861
13862 match self {
13863 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
13864 ___E,
13865 crate::wire::ExposeService<'static>,
13866 >(value, 1, encoder, raw, ())?,
13867
13868 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
13869 ___E,
13870 crate::wire::ExposeProtocol<'static>,
13871 >(value, 2, encoder, raw, ())?,
13872
13873 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
13874 ___E,
13875 crate::wire::ExposeDirectory<'static>,
13876 >(value, 3, encoder, raw, ())?,
13877
13878 Self::Runner(value) => ::fidl_next::RawWireUnion::encode_as::<
13879 ___E,
13880 crate::wire::ExposeRunner<'static>,
13881 >(value, 4, encoder, raw, ())?,
13882
13883 Self::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<
13884 ___E,
13885 crate::wire::ExposeResolver<'static>,
13886 >(value, 5, encoder, raw, ())?,
13887
13888 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
13889 ___E,
13890 crate::wire::ExposeDictionary<'static>,
13891 >(value, 7, encoder, raw, ())?,
13892
13893 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
13894 ___E,
13895 crate::wire::ExposeConfiguration<'static>,
13896 >(value, 8, encoder, raw, ())?,
13897
13898 Self::UnknownOrdinal_(ordinal) => {
13899 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
13900 }
13901 }
13902
13903 Ok(())
13904 }
13905 }
13906
13907 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Expose<'static>, ___E> for &'a Expose
13908 where
13909 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
13910 ___E: ::fidl_next::Encoder,
13911 {
13912 #[inline]
13913 fn encode(
13914 self,
13915 encoder: &mut ___E,
13916 out: &mut ::core::mem::MaybeUninit<crate::wire::Expose<'static>>,
13917 _: (),
13918 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13919 ::fidl_next::munge!(let crate::wire::Expose { raw, _phantom: _ } = out);
13920
13921 match self {
13922 Expose::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
13923 ___E,
13924 crate::wire::ExposeService<'static>,
13925 >(value, 1, encoder, raw, ())?,
13926
13927 Expose::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
13928 ___E,
13929 crate::wire::ExposeProtocol<'static>,
13930 >(value, 2, encoder, raw, ())?,
13931
13932 Expose::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
13933 ___E,
13934 crate::wire::ExposeDirectory<'static>,
13935 >(value, 3, encoder, raw, ())?,
13936
13937 Expose::Runner(value) => ::fidl_next::RawWireUnion::encode_as::<
13938 ___E,
13939 crate::wire::ExposeRunner<'static>,
13940 >(value, 4, encoder, raw, ())?,
13941
13942 Expose::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<
13943 ___E,
13944 crate::wire::ExposeResolver<'static>,
13945 >(value, 5, encoder, raw, ())?,
13946
13947 Expose::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
13948 ___E,
13949 crate::wire::ExposeDictionary<'static>,
13950 >(value, 7, encoder, raw, ())?,
13951
13952 Expose::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
13953 ___E,
13954 crate::wire::ExposeConfiguration<'static>,
13955 >(value, 8, encoder, raw, ())?,
13956
13957 Expose::UnknownOrdinal_(ordinal) => {
13958 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
13959 }
13960 }
13961
13962 Ok(())
13963 }
13964 }
13965
13966 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::Expose<'static>, ___E> for Expose
13967 where
13968 ___E: ?Sized,
13969 Expose: ::fidl_next::Encode<crate::wire::Expose<'static>, ___E>,
13970 {
13971 #[inline]
13972 fn encode_option(
13973 this: ::core::option::Option<Self>,
13974 encoder: &mut ___E,
13975 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Expose<'static>>,
13976 _: (),
13977 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
13978 ::fidl_next::munge!(let crate::wire_optional::Expose { raw, _phantom: _ } = &mut *out);
13979
13980 if let Some(inner) = this {
13981 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
13982 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
13983 } else {
13984 ::fidl_next::RawWireUnion::encode_absent(raw);
13985 }
13986
13987 Ok(())
13988 }
13989 }
13990
13991 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::Expose<'static>, ___E>
13992 for &'a Expose
13993 where
13994 ___E: ?Sized,
13995 &'a Expose: ::fidl_next::Encode<crate::wire::Expose<'static>, ___E>,
13996 {
13997 #[inline]
13998 fn encode_option(
13999 this: ::core::option::Option<Self>,
14000 encoder: &mut ___E,
14001 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Expose<'static>>,
14002 _: (),
14003 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14004 ::fidl_next::munge!(let crate::wire_optional::Expose { raw, _phantom: _ } = &mut *out);
14005
14006 if let Some(inner) = this {
14007 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
14008 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
14009 } else {
14010 ::fidl_next::RawWireUnion::encode_absent(raw);
14011 }
14012
14013 Ok(())
14014 }
14015 }
14016
14017 impl<'de> ::fidl_next::FromWire<crate::wire::Expose<'de>> for Expose {
14018 #[inline]
14019 fn from_wire(wire: crate::wire::Expose<'de>) -> Self {
14020 let wire = ::core::mem::ManuallyDrop::new(wire);
14021 match wire.raw.ordinal() {
14022 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
14023 wire.raw.get().read_unchecked::<crate::wire::ExposeService<'de>>()
14024 })),
14025
14026 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
14027 wire.raw.get().read_unchecked::<crate::wire::ExposeProtocol<'de>>()
14028 })),
14029
14030 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
14031 wire.raw.get().read_unchecked::<crate::wire::ExposeDirectory<'de>>()
14032 })),
14033
14034 4 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
14035 wire.raw.get().read_unchecked::<crate::wire::ExposeRunner<'de>>()
14036 })),
14037
14038 5 => Self::Resolver(::fidl_next::FromWire::from_wire(unsafe {
14039 wire.raw.get().read_unchecked::<crate::wire::ExposeResolver<'de>>()
14040 })),
14041
14042 7 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
14043 wire.raw.get().read_unchecked::<crate::wire::ExposeDictionary<'de>>()
14044 })),
14045
14046 8 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
14047 wire.raw.get().read_unchecked::<crate::wire::ExposeConfiguration<'de>>()
14048 })),
14049
14050 ord => return Self::UnknownOrdinal_(ord as u64),
14051 }
14052 }
14053 }
14054
14055 impl<'de> ::fidl_next::FromWireRef<crate::wire::Expose<'de>> for Expose {
14056 #[inline]
14057 fn from_wire_ref(wire: &crate::wire::Expose<'de>) -> Self {
14058 match wire.raw.ordinal() {
14059 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
14060 wire.raw.get().deref_unchecked::<crate::wire::ExposeService<'de>>()
14061 })),
14062
14063 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
14064 wire.raw.get().deref_unchecked::<crate::wire::ExposeProtocol<'de>>()
14065 })),
14066
14067 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
14068 wire.raw.get().deref_unchecked::<crate::wire::ExposeDirectory<'de>>()
14069 })),
14070
14071 4 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
14072 wire.raw.get().deref_unchecked::<crate::wire::ExposeRunner<'de>>()
14073 })),
14074
14075 5 => Self::Resolver(::fidl_next::FromWireRef::from_wire_ref(unsafe {
14076 wire.raw.get().deref_unchecked::<crate::wire::ExposeResolver<'de>>()
14077 })),
14078
14079 7 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
14080 wire.raw.get().deref_unchecked::<crate::wire::ExposeDictionary<'de>>()
14081 })),
14082
14083 8 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
14084 wire.raw.get().deref_unchecked::<crate::wire::ExposeConfiguration<'de>>()
14085 })),
14086
14087 ord => return Self::UnknownOrdinal_(ord as u64),
14088 }
14089 }
14090 }
14091
14092 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Expose<'de>> for Expose {
14093 #[inline]
14094 fn from_wire_option(
14095 wire: crate::wire_optional::Expose<'de>,
14096 ) -> ::core::option::Option<Self> {
14097 if let Some(inner) = wire.into_option() {
14098 Some(::fidl_next::FromWire::from_wire(inner))
14099 } else {
14100 None
14101 }
14102 }
14103 }
14104
14105 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Expose<'de>> for Box<Expose> {
14106 #[inline]
14107 fn from_wire_option(
14108 wire: crate::wire_optional::Expose<'de>,
14109 ) -> ::core::option::Option<Self> {
14110 <
14111 Expose as ::fidl_next::FromWireOption<crate::wire_optional::Expose<'de>>
14112 >::from_wire_option(wire).map(Box::new)
14113 }
14114 }
14115
14116 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::Expose<'de>> for Box<Expose> {
14117 #[inline]
14118 fn from_wire_option_ref(
14119 wire: &crate::wire_optional::Expose<'de>,
14120 ) -> ::core::option::Option<Self> {
14121 if let Some(inner) = wire.as_ref() {
14122 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
14123 } else {
14124 None
14125 }
14126 }
14127 }
14128
14129 #[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"]
14130 #[derive(PartialEq, Clone, Debug, Default)]
14131 pub struct OfferService {
14132 pub source: ::core::option::Option<crate::natural::Ref>,
14133
14134 pub source_name: ::core::option::Option<::std::string::String>,
14135
14136 pub target: ::core::option::Option<crate::natural::Ref>,
14137
14138 pub target_name: ::core::option::Option<::std::string::String>,
14139
14140 pub source_instance_filter: ::core::option::Option<::std::vec::Vec<::std::string::String>>,
14141
14142 pub renamed_instances: ::core::option::Option<::std::vec::Vec<crate::natural::NameMapping>>,
14143
14144 pub availability: ::core::option::Option<crate::natural::Availability>,
14145
14146 pub source_dictionary: ::core::option::Option<::std::string::String>,
14147
14148 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
14149 }
14150
14151 impl OfferService {
14152 fn __max_ordinal(&self) -> usize {
14153 if self.dependency_type.is_some() {
14154 return 9;
14155 }
14156
14157 if self.source_dictionary.is_some() {
14158 return 8;
14159 }
14160
14161 if self.availability.is_some() {
14162 return 7;
14163 }
14164
14165 if self.renamed_instances.is_some() {
14166 return 6;
14167 }
14168
14169 if self.source_instance_filter.is_some() {
14170 return 5;
14171 }
14172
14173 if self.target_name.is_some() {
14174 return 4;
14175 }
14176
14177 if self.target.is_some() {
14178 return 3;
14179 }
14180
14181 if self.source_name.is_some() {
14182 return 2;
14183 }
14184
14185 if self.source.is_some() {
14186 return 1;
14187 }
14188
14189 0
14190 }
14191 }
14192
14193 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferService<'static>, ___E> for OfferService
14194 where
14195 ___E: ::fidl_next::Encoder + ?Sized,
14196 {
14197 #[inline]
14198 fn encode(
14199 mut self,
14200 encoder: &mut ___E,
14201 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferService<'static>>,
14202 _: (),
14203 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14204 ::fidl_next::munge!(let crate::wire::OfferService { table } = out);
14205
14206 let max_ord = self.__max_ordinal();
14207
14208 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
14209 ::fidl_next::Wire::zero_padding(&mut out);
14210
14211 let mut preallocated =
14212 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
14213
14214 for i in 1..=max_ord {
14215 match i {
14216 9 => {
14217 if let Some(value) = self.dependency_type.take() {
14218 ::fidl_next::WireEnvelope::encode_value::<
14219 crate::wire::DependencyType,
14220 ___E,
14221 >(
14222 value, preallocated.encoder, &mut out, ()
14223 )?;
14224 } else {
14225 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14226 }
14227 }
14228
14229 8 => {
14230 if let Some(value) = self.source_dictionary.take() {
14231 ::fidl_next::WireEnvelope::encode_value::<
14232 ::fidl_next::WireString<'static>,
14233 ___E,
14234 >(
14235 value, preallocated.encoder, &mut out, 1024
14236 )?;
14237 } else {
14238 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14239 }
14240 }
14241
14242 7 => {
14243 if let Some(value) = self.availability.take() {
14244 ::fidl_next::WireEnvelope::encode_value::<
14245 crate::wire::Availability,
14246 ___E,
14247 >(
14248 value, preallocated.encoder, &mut out, ()
14249 )?;
14250 } else {
14251 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14252 }
14253 }
14254
14255 6 => {
14256 if let Some(value) = self.renamed_instances.take() {
14257 ::fidl_next::WireEnvelope::encode_value::<
14258 ::fidl_next::WireVector<'static, crate::wire::NameMapping<'static>>,
14259 ___E,
14260 >(
14261 value, preallocated.encoder, &mut out, (4294967295, ())
14262 )?;
14263 } else {
14264 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14265 }
14266 }
14267
14268 5 => {
14269 if let Some(value) = self.source_instance_filter.take() {
14270 ::fidl_next::WireEnvelope::encode_value::<
14271 ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
14272 ___E,
14273 >(
14274 value, preallocated.encoder, &mut out, (4294967295, 100)
14275 )?;
14276 } else {
14277 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14278 }
14279 }
14280
14281 4 => {
14282 if let Some(value) = self.target_name.take() {
14283 ::fidl_next::WireEnvelope::encode_value::<
14284 ::fidl_next::WireString<'static>,
14285 ___E,
14286 >(
14287 value, preallocated.encoder, &mut out, 100
14288 )?;
14289 } else {
14290 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14291 }
14292 }
14293
14294 3 => {
14295 if let Some(value) = self.target.take() {
14296 ::fidl_next::WireEnvelope::encode_value::<
14297 crate::wire::Ref<'static>,
14298 ___E,
14299 >(
14300 value, preallocated.encoder, &mut out, ()
14301 )?;
14302 } else {
14303 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14304 }
14305 }
14306
14307 2 => {
14308 if let Some(value) = self.source_name.take() {
14309 ::fidl_next::WireEnvelope::encode_value::<
14310 ::fidl_next::WireString<'static>,
14311 ___E,
14312 >(
14313 value, preallocated.encoder, &mut out, 100
14314 )?;
14315 } else {
14316 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14317 }
14318 }
14319
14320 1 => {
14321 if let Some(value) = self.source.take() {
14322 ::fidl_next::WireEnvelope::encode_value::<
14323 crate::wire::Ref<'static>,
14324 ___E,
14325 >(
14326 value, preallocated.encoder, &mut out, ()
14327 )?;
14328 } else {
14329 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14330 }
14331 }
14332
14333 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
14334 }
14335 unsafe {
14336 preallocated.write_next(out.assume_init_ref());
14337 }
14338 }
14339
14340 ::fidl_next::WireTable::encode_len(table, max_ord);
14341
14342 Ok(())
14343 }
14344 }
14345
14346 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferService<'static>, ___E>
14347 for &'a OfferService
14348 where
14349 ___E: ::fidl_next::Encoder + ?Sized,
14350 {
14351 #[inline]
14352 fn encode(
14353 self,
14354 encoder: &mut ___E,
14355 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferService<'static>>,
14356 _: (),
14357 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14358 ::fidl_next::munge!(let crate::wire::OfferService { table } = out);
14359
14360 let max_ord = self.__max_ordinal();
14361
14362 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
14363 ::fidl_next::Wire::zero_padding(&mut out);
14364
14365 let mut preallocated =
14366 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
14367
14368 for i in 1..=max_ord {
14369 match i {
14370 9 => {
14371 if let Some(value) = &self.dependency_type {
14372 ::fidl_next::WireEnvelope::encode_value::<
14373 crate::wire::DependencyType,
14374 ___E,
14375 >(
14376 value, preallocated.encoder, &mut out, ()
14377 )?;
14378 } else {
14379 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14380 }
14381 }
14382
14383 8 => {
14384 if let Some(value) = &self.source_dictionary {
14385 ::fidl_next::WireEnvelope::encode_value::<
14386 ::fidl_next::WireString<'static>,
14387 ___E,
14388 >(
14389 value, preallocated.encoder, &mut out, 1024
14390 )?;
14391 } else {
14392 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14393 }
14394 }
14395
14396 7 => {
14397 if let Some(value) = &self.availability {
14398 ::fidl_next::WireEnvelope::encode_value::<
14399 crate::wire::Availability,
14400 ___E,
14401 >(
14402 value, preallocated.encoder, &mut out, ()
14403 )?;
14404 } else {
14405 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14406 }
14407 }
14408
14409 6 => {
14410 if let Some(value) = &self.renamed_instances {
14411 ::fidl_next::WireEnvelope::encode_value::<
14412 ::fidl_next::WireVector<'static, crate::wire::NameMapping<'static>>,
14413 ___E,
14414 >(
14415 value, preallocated.encoder, &mut out, (4294967295, ())
14416 )?;
14417 } else {
14418 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14419 }
14420 }
14421
14422 5 => {
14423 if let Some(value) = &self.source_instance_filter {
14424 ::fidl_next::WireEnvelope::encode_value::<
14425 ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
14426 ___E,
14427 >(
14428 value, preallocated.encoder, &mut out, (4294967295, 100)
14429 )?;
14430 } else {
14431 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14432 }
14433 }
14434
14435 4 => {
14436 if let Some(value) = &self.target_name {
14437 ::fidl_next::WireEnvelope::encode_value::<
14438 ::fidl_next::WireString<'static>,
14439 ___E,
14440 >(
14441 value, preallocated.encoder, &mut out, 100
14442 )?;
14443 } else {
14444 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14445 }
14446 }
14447
14448 3 => {
14449 if let Some(value) = &self.target {
14450 ::fidl_next::WireEnvelope::encode_value::<
14451 crate::wire::Ref<'static>,
14452 ___E,
14453 >(
14454 value, preallocated.encoder, &mut out, ()
14455 )?;
14456 } else {
14457 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14458 }
14459 }
14460
14461 2 => {
14462 if let Some(value) = &self.source_name {
14463 ::fidl_next::WireEnvelope::encode_value::<
14464 ::fidl_next::WireString<'static>,
14465 ___E,
14466 >(
14467 value, preallocated.encoder, &mut out, 100
14468 )?;
14469 } else {
14470 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14471 }
14472 }
14473
14474 1 => {
14475 if let Some(value) = &self.source {
14476 ::fidl_next::WireEnvelope::encode_value::<
14477 crate::wire::Ref<'static>,
14478 ___E,
14479 >(
14480 value, preallocated.encoder, &mut out, ()
14481 )?;
14482 } else {
14483 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14484 }
14485 }
14486
14487 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
14488 }
14489 unsafe {
14490 preallocated.write_next(out.assume_init_ref());
14491 }
14492 }
14493
14494 ::fidl_next::WireTable::encode_len(table, max_ord);
14495
14496 Ok(())
14497 }
14498 }
14499
14500 impl<'de> ::fidl_next::FromWire<crate::wire::OfferService<'de>> for OfferService {
14501 #[inline]
14502 fn from_wire(wire_: crate::wire::OfferService<'de>) -> Self {
14503 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
14504
14505 let source = wire_.table.get(1);
14506
14507 let source_name = wire_.table.get(2);
14508
14509 let target = wire_.table.get(3);
14510
14511 let target_name = wire_.table.get(4);
14512
14513 let source_instance_filter = wire_.table.get(5);
14514
14515 let renamed_instances = wire_.table.get(6);
14516
14517 let availability = wire_.table.get(7);
14518
14519 let source_dictionary = wire_.table.get(8);
14520
14521 let dependency_type = wire_.table.get(9);
14522
14523 Self {
14524
14525
14526 source: source.map(|envelope| ::fidl_next::FromWire::from_wire(
14527 unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() }
14528 )),
14529
14530
14531 source_name: source_name.map(|envelope| ::fidl_next::FromWire::from_wire(
14532 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
14533 )),
14534
14535
14536 target: target.map(|envelope| ::fidl_next::FromWire::from_wire(
14537 unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() }
14538 )),
14539
14540
14541 target_name: target_name.map(|envelope| ::fidl_next::FromWire::from_wire(
14542 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
14543 )),
14544
14545
14546 source_instance_filter: source_instance_filter.map(|envelope| ::fidl_next::FromWire::from_wire(
14547 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>() }
14548 )),
14549
14550
14551 renamed_instances: renamed_instances.map(|envelope| ::fidl_next::FromWire::from_wire(
14552 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::NameMapping<'de>>>() }
14553 )),
14554
14555
14556 availability: availability.map(|envelope| ::fidl_next::FromWire::from_wire(
14557 unsafe { envelope.read_unchecked::<crate::wire::Availability>() }
14558 )),
14559
14560
14561 source_dictionary: source_dictionary.map(|envelope| ::fidl_next::FromWire::from_wire(
14562 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
14563 )),
14564
14565
14566 dependency_type: dependency_type.map(|envelope| ::fidl_next::FromWire::from_wire(
14567 unsafe { envelope.read_unchecked::<crate::wire::DependencyType>() }
14568 )),
14569
14570 }
14571 }
14572 }
14573
14574 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferService<'de>> for OfferService {
14575 #[inline]
14576 fn from_wire_ref(wire: &crate::wire::OfferService<'de>) -> Self {
14577 Self {
14578
14579
14580 source: wire.table.get(1)
14581 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14582 unsafe { envelope.deref_unchecked::<crate::wire::Ref<'de>>() }
14583 )),
14584
14585
14586 source_name: wire.table.get(2)
14587 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14588 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
14589 )),
14590
14591
14592 target: wire.table.get(3)
14593 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14594 unsafe { envelope.deref_unchecked::<crate::wire::Ref<'de>>() }
14595 )),
14596
14597
14598 target_name: wire.table.get(4)
14599 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14600 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
14601 )),
14602
14603
14604 source_instance_filter: wire.table.get(5)
14605 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14606 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>() }
14607 )),
14608
14609
14610 renamed_instances: wire.table.get(6)
14611 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14612 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::wire::NameMapping<'de>>>() }
14613 )),
14614
14615
14616 availability: wire.table.get(7)
14617 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14618 unsafe { envelope.deref_unchecked::<crate::wire::Availability>() }
14619 )),
14620
14621
14622 source_dictionary: wire.table.get(8)
14623 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14624 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
14625 )),
14626
14627
14628 dependency_type: wire.table.get(9)
14629 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
14630 unsafe { envelope.deref_unchecked::<crate::wire::DependencyType>() }
14631 )),
14632
14633 }
14634 }
14635 }
14636
14637 #[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"]
14638 #[derive(PartialEq, Clone, Debug, Default)]
14639 pub struct OfferProtocol {
14640 pub source: ::core::option::Option<crate::natural::Ref>,
14641
14642 pub source_name: ::core::option::Option<::std::string::String>,
14643
14644 pub target: ::core::option::Option<crate::natural::Ref>,
14645
14646 pub target_name: ::core::option::Option<::std::string::String>,
14647
14648 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
14649
14650 pub availability: ::core::option::Option<crate::natural::Availability>,
14651
14652 pub source_dictionary: ::core::option::Option<::std::string::String>,
14653 }
14654
14655 impl OfferProtocol {
14656 fn __max_ordinal(&self) -> usize {
14657 if self.source_dictionary.is_some() {
14658 return 7;
14659 }
14660
14661 if self.availability.is_some() {
14662 return 6;
14663 }
14664
14665 if self.dependency_type.is_some() {
14666 return 5;
14667 }
14668
14669 if self.target_name.is_some() {
14670 return 4;
14671 }
14672
14673 if self.target.is_some() {
14674 return 3;
14675 }
14676
14677 if self.source_name.is_some() {
14678 return 2;
14679 }
14680
14681 if self.source.is_some() {
14682 return 1;
14683 }
14684
14685 0
14686 }
14687 }
14688
14689 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferProtocol<'static>, ___E> for OfferProtocol
14690 where
14691 ___E: ::fidl_next::Encoder + ?Sized,
14692 {
14693 #[inline]
14694 fn encode(
14695 mut self,
14696 encoder: &mut ___E,
14697 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferProtocol<'static>>,
14698 _: (),
14699 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14700 ::fidl_next::munge!(let crate::wire::OfferProtocol { table } = out);
14701
14702 let max_ord = self.__max_ordinal();
14703
14704 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
14705 ::fidl_next::Wire::zero_padding(&mut out);
14706
14707 let mut preallocated =
14708 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
14709
14710 for i in 1..=max_ord {
14711 match i {
14712 7 => {
14713 if let Some(value) = self.source_dictionary.take() {
14714 ::fidl_next::WireEnvelope::encode_value::<
14715 ::fidl_next::WireString<'static>,
14716 ___E,
14717 >(
14718 value, preallocated.encoder, &mut out, 1024
14719 )?;
14720 } else {
14721 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14722 }
14723 }
14724
14725 6 => {
14726 if let Some(value) = self.availability.take() {
14727 ::fidl_next::WireEnvelope::encode_value::<
14728 crate::wire::Availability,
14729 ___E,
14730 >(
14731 value, preallocated.encoder, &mut out, ()
14732 )?;
14733 } else {
14734 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14735 }
14736 }
14737
14738 5 => {
14739 if let Some(value) = self.dependency_type.take() {
14740 ::fidl_next::WireEnvelope::encode_value::<
14741 crate::wire::DependencyType,
14742 ___E,
14743 >(
14744 value, preallocated.encoder, &mut out, ()
14745 )?;
14746 } else {
14747 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14748 }
14749 }
14750
14751 4 => {
14752 if let Some(value) = self.target_name.take() {
14753 ::fidl_next::WireEnvelope::encode_value::<
14754 ::fidl_next::WireString<'static>,
14755 ___E,
14756 >(
14757 value, preallocated.encoder, &mut out, 100
14758 )?;
14759 } else {
14760 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14761 }
14762 }
14763
14764 3 => {
14765 if let Some(value) = self.target.take() {
14766 ::fidl_next::WireEnvelope::encode_value::<
14767 crate::wire::Ref<'static>,
14768 ___E,
14769 >(
14770 value, preallocated.encoder, &mut out, ()
14771 )?;
14772 } else {
14773 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14774 }
14775 }
14776
14777 2 => {
14778 if let Some(value) = self.source_name.take() {
14779 ::fidl_next::WireEnvelope::encode_value::<
14780 ::fidl_next::WireString<'static>,
14781 ___E,
14782 >(
14783 value, preallocated.encoder, &mut out, 100
14784 )?;
14785 } else {
14786 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14787 }
14788 }
14789
14790 1 => {
14791 if let Some(value) = self.source.take() {
14792 ::fidl_next::WireEnvelope::encode_value::<
14793 crate::wire::Ref<'static>,
14794 ___E,
14795 >(
14796 value, preallocated.encoder, &mut out, ()
14797 )?;
14798 } else {
14799 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14800 }
14801 }
14802
14803 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
14804 }
14805 unsafe {
14806 preallocated.write_next(out.assume_init_ref());
14807 }
14808 }
14809
14810 ::fidl_next::WireTable::encode_len(table, max_ord);
14811
14812 Ok(())
14813 }
14814 }
14815
14816 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferProtocol<'static>, ___E>
14817 for &'a OfferProtocol
14818 where
14819 ___E: ::fidl_next::Encoder + ?Sized,
14820 {
14821 #[inline]
14822 fn encode(
14823 self,
14824 encoder: &mut ___E,
14825 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferProtocol<'static>>,
14826 _: (),
14827 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
14828 ::fidl_next::munge!(let crate::wire::OfferProtocol { table } = out);
14829
14830 let max_ord = self.__max_ordinal();
14831
14832 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
14833 ::fidl_next::Wire::zero_padding(&mut out);
14834
14835 let mut preallocated =
14836 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
14837
14838 for i in 1..=max_ord {
14839 match i {
14840 7 => {
14841 if let Some(value) = &self.source_dictionary {
14842 ::fidl_next::WireEnvelope::encode_value::<
14843 ::fidl_next::WireString<'static>,
14844 ___E,
14845 >(
14846 value, preallocated.encoder, &mut out, 1024
14847 )?;
14848 } else {
14849 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14850 }
14851 }
14852
14853 6 => {
14854 if let Some(value) = &self.availability {
14855 ::fidl_next::WireEnvelope::encode_value::<
14856 crate::wire::Availability,
14857 ___E,
14858 >(
14859 value, preallocated.encoder, &mut out, ()
14860 )?;
14861 } else {
14862 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14863 }
14864 }
14865
14866 5 => {
14867 if let Some(value) = &self.dependency_type {
14868 ::fidl_next::WireEnvelope::encode_value::<
14869 crate::wire::DependencyType,
14870 ___E,
14871 >(
14872 value, preallocated.encoder, &mut out, ()
14873 )?;
14874 } else {
14875 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14876 }
14877 }
14878
14879 4 => {
14880 if let Some(value) = &self.target_name {
14881 ::fidl_next::WireEnvelope::encode_value::<
14882 ::fidl_next::WireString<'static>,
14883 ___E,
14884 >(
14885 value, preallocated.encoder, &mut out, 100
14886 )?;
14887 } else {
14888 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14889 }
14890 }
14891
14892 3 => {
14893 if let Some(value) = &self.target {
14894 ::fidl_next::WireEnvelope::encode_value::<
14895 crate::wire::Ref<'static>,
14896 ___E,
14897 >(
14898 value, preallocated.encoder, &mut out, ()
14899 )?;
14900 } else {
14901 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14902 }
14903 }
14904
14905 2 => {
14906 if let Some(value) = &self.source_name {
14907 ::fidl_next::WireEnvelope::encode_value::<
14908 ::fidl_next::WireString<'static>,
14909 ___E,
14910 >(
14911 value, preallocated.encoder, &mut out, 100
14912 )?;
14913 } else {
14914 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14915 }
14916 }
14917
14918 1 => {
14919 if let Some(value) = &self.source {
14920 ::fidl_next::WireEnvelope::encode_value::<
14921 crate::wire::Ref<'static>,
14922 ___E,
14923 >(
14924 value, preallocated.encoder, &mut out, ()
14925 )?;
14926 } else {
14927 ::fidl_next::WireEnvelope::encode_zero(&mut out)
14928 }
14929 }
14930
14931 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
14932 }
14933 unsafe {
14934 preallocated.write_next(out.assume_init_ref());
14935 }
14936 }
14937
14938 ::fidl_next::WireTable::encode_len(table, max_ord);
14939
14940 Ok(())
14941 }
14942 }
14943
14944 impl<'de> ::fidl_next::FromWire<crate::wire::OfferProtocol<'de>> for OfferProtocol {
14945 #[inline]
14946 fn from_wire(wire_: crate::wire::OfferProtocol<'de>) -> Self {
14947 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
14948
14949 let source = wire_.table.get(1);
14950
14951 let source_name = wire_.table.get(2);
14952
14953 let target = wire_.table.get(3);
14954
14955 let target_name = wire_.table.get(4);
14956
14957 let dependency_type = wire_.table.get(5);
14958
14959 let availability = wire_.table.get(6);
14960
14961 let source_dictionary = wire_.table.get(7);
14962
14963 Self {
14964 source: source.map(|envelope| {
14965 ::fidl_next::FromWire::from_wire(unsafe {
14966 envelope.read_unchecked::<crate::wire::Ref<'de>>()
14967 })
14968 }),
14969
14970 source_name: source_name.map(|envelope| {
14971 ::fidl_next::FromWire::from_wire(unsafe {
14972 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
14973 })
14974 }),
14975
14976 target: target.map(|envelope| {
14977 ::fidl_next::FromWire::from_wire(unsafe {
14978 envelope.read_unchecked::<crate::wire::Ref<'de>>()
14979 })
14980 }),
14981
14982 target_name: target_name.map(|envelope| {
14983 ::fidl_next::FromWire::from_wire(unsafe {
14984 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
14985 })
14986 }),
14987
14988 dependency_type: dependency_type.map(|envelope| {
14989 ::fidl_next::FromWire::from_wire(unsafe {
14990 envelope.read_unchecked::<crate::wire::DependencyType>()
14991 })
14992 }),
14993
14994 availability: availability.map(|envelope| {
14995 ::fidl_next::FromWire::from_wire(unsafe {
14996 envelope.read_unchecked::<crate::wire::Availability>()
14997 })
14998 }),
14999
15000 source_dictionary: source_dictionary.map(|envelope| {
15001 ::fidl_next::FromWire::from_wire(unsafe {
15002 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
15003 })
15004 }),
15005 }
15006 }
15007 }
15008
15009 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferProtocol<'de>> for OfferProtocol {
15010 #[inline]
15011 fn from_wire_ref(wire: &crate::wire::OfferProtocol<'de>) -> Self {
15012 Self {
15013 source: wire.table.get(1).map(|envelope| {
15014 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15015 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
15016 })
15017 }),
15018
15019 source_name: wire.table.get(2).map(|envelope| {
15020 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15021 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15022 })
15023 }),
15024
15025 target: wire.table.get(3).map(|envelope| {
15026 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15027 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
15028 })
15029 }),
15030
15031 target_name: wire.table.get(4).map(|envelope| {
15032 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15033 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15034 })
15035 }),
15036
15037 dependency_type: wire.table.get(5).map(|envelope| {
15038 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15039 envelope.deref_unchecked::<crate::wire::DependencyType>()
15040 })
15041 }),
15042
15043 availability: wire.table.get(6).map(|envelope| {
15044 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15045 envelope.deref_unchecked::<crate::wire::Availability>()
15046 })
15047 }),
15048
15049 source_dictionary: wire.table.get(7).map(|envelope| {
15050 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15051 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15052 })
15053 }),
15054 }
15055 }
15056 }
15057
15058 #[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"]
15059 #[derive(PartialEq, Clone, Debug, Default)]
15060 pub struct OfferDirectory {
15061 pub source: ::core::option::Option<crate::natural::Ref>,
15062
15063 pub source_name: ::core::option::Option<::std::string::String>,
15064
15065 pub target: ::core::option::Option<crate::natural::Ref>,
15066
15067 pub target_name: ::core::option::Option<::std::string::String>,
15068
15069 pub rights: ::core::option::Option<::fidl_next_common_fuchsia_io::natural::Operations>,
15070
15071 pub subdir: ::core::option::Option<::std::string::String>,
15072
15073 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
15074
15075 pub availability: ::core::option::Option<crate::natural::Availability>,
15076
15077 pub source_dictionary: ::core::option::Option<::std::string::String>,
15078 }
15079
15080 impl OfferDirectory {
15081 fn __max_ordinal(&self) -> usize {
15082 if self.source_dictionary.is_some() {
15083 return 9;
15084 }
15085
15086 if self.availability.is_some() {
15087 return 8;
15088 }
15089
15090 if self.dependency_type.is_some() {
15091 return 7;
15092 }
15093
15094 if self.subdir.is_some() {
15095 return 6;
15096 }
15097
15098 if self.rights.is_some() {
15099 return 5;
15100 }
15101
15102 if self.target_name.is_some() {
15103 return 4;
15104 }
15105
15106 if self.target.is_some() {
15107 return 3;
15108 }
15109
15110 if self.source_name.is_some() {
15111 return 2;
15112 }
15113
15114 if self.source.is_some() {
15115 return 1;
15116 }
15117
15118 0
15119 }
15120 }
15121
15122 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferDirectory<'static>, ___E> for OfferDirectory
15123 where
15124 ___E: ::fidl_next::Encoder + ?Sized,
15125 {
15126 #[inline]
15127 fn encode(
15128 mut self,
15129 encoder: &mut ___E,
15130 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferDirectory<'static>>,
15131 _: (),
15132 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15133 ::fidl_next::munge!(let crate::wire::OfferDirectory { table } = out);
15134
15135 let max_ord = self.__max_ordinal();
15136
15137 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
15138 ::fidl_next::Wire::zero_padding(&mut out);
15139
15140 let mut preallocated =
15141 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
15142
15143 for i in 1..=max_ord {
15144 match i {
15145 9 => {
15146 if let Some(value) = self.source_dictionary.take() {
15147 ::fidl_next::WireEnvelope::encode_value::<
15148 ::fidl_next::WireString<'static>,
15149 ___E,
15150 >(
15151 value, preallocated.encoder, &mut out, 1024
15152 )?;
15153 } else {
15154 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15155 }
15156 }
15157
15158 8 => {
15159 if let Some(value) = self.availability.take() {
15160 ::fidl_next::WireEnvelope::encode_value::<
15161 crate::wire::Availability,
15162 ___E,
15163 >(
15164 value, preallocated.encoder, &mut out, ()
15165 )?;
15166 } else {
15167 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15168 }
15169 }
15170
15171 7 => {
15172 if let Some(value) = self.dependency_type.take() {
15173 ::fidl_next::WireEnvelope::encode_value::<
15174 crate::wire::DependencyType,
15175 ___E,
15176 >(
15177 value, preallocated.encoder, &mut out, ()
15178 )?;
15179 } else {
15180 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15181 }
15182 }
15183
15184 6 => {
15185 if let Some(value) = self.subdir.take() {
15186 ::fidl_next::WireEnvelope::encode_value::<
15187 ::fidl_next::WireString<'static>,
15188 ___E,
15189 >(
15190 value, preallocated.encoder, &mut out, 1024
15191 )?;
15192 } else {
15193 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15194 }
15195 }
15196
15197 5 => {
15198 if let Some(value) = self.rights.take() {
15199 ::fidl_next::WireEnvelope::encode_value::<
15200 ::fidl_next_common_fuchsia_io::wire::Operations,
15201 ___E,
15202 >(
15203 value, preallocated.encoder, &mut out, ()
15204 )?;
15205 } else {
15206 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15207 }
15208 }
15209
15210 4 => {
15211 if let Some(value) = self.target_name.take() {
15212 ::fidl_next::WireEnvelope::encode_value::<
15213 ::fidl_next::WireString<'static>,
15214 ___E,
15215 >(
15216 value, preallocated.encoder, &mut out, 100
15217 )?;
15218 } else {
15219 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15220 }
15221 }
15222
15223 3 => {
15224 if let Some(value) = self.target.take() {
15225 ::fidl_next::WireEnvelope::encode_value::<
15226 crate::wire::Ref<'static>,
15227 ___E,
15228 >(
15229 value, preallocated.encoder, &mut out, ()
15230 )?;
15231 } else {
15232 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15233 }
15234 }
15235
15236 2 => {
15237 if let Some(value) = self.source_name.take() {
15238 ::fidl_next::WireEnvelope::encode_value::<
15239 ::fidl_next::WireString<'static>,
15240 ___E,
15241 >(
15242 value, preallocated.encoder, &mut out, 100
15243 )?;
15244 } else {
15245 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15246 }
15247 }
15248
15249 1 => {
15250 if let Some(value) = self.source.take() {
15251 ::fidl_next::WireEnvelope::encode_value::<
15252 crate::wire::Ref<'static>,
15253 ___E,
15254 >(
15255 value, preallocated.encoder, &mut out, ()
15256 )?;
15257 } else {
15258 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15259 }
15260 }
15261
15262 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
15263 }
15264 unsafe {
15265 preallocated.write_next(out.assume_init_ref());
15266 }
15267 }
15268
15269 ::fidl_next::WireTable::encode_len(table, max_ord);
15270
15271 Ok(())
15272 }
15273 }
15274
15275 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferDirectory<'static>, ___E>
15276 for &'a OfferDirectory
15277 where
15278 ___E: ::fidl_next::Encoder + ?Sized,
15279 {
15280 #[inline]
15281 fn encode(
15282 self,
15283 encoder: &mut ___E,
15284 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferDirectory<'static>>,
15285 _: (),
15286 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15287 ::fidl_next::munge!(let crate::wire::OfferDirectory { table } = out);
15288
15289 let max_ord = self.__max_ordinal();
15290
15291 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
15292 ::fidl_next::Wire::zero_padding(&mut out);
15293
15294 let mut preallocated =
15295 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
15296
15297 for i in 1..=max_ord {
15298 match i {
15299 9 => {
15300 if let Some(value) = &self.source_dictionary {
15301 ::fidl_next::WireEnvelope::encode_value::<
15302 ::fidl_next::WireString<'static>,
15303 ___E,
15304 >(
15305 value, preallocated.encoder, &mut out, 1024
15306 )?;
15307 } else {
15308 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15309 }
15310 }
15311
15312 8 => {
15313 if let Some(value) = &self.availability {
15314 ::fidl_next::WireEnvelope::encode_value::<
15315 crate::wire::Availability,
15316 ___E,
15317 >(
15318 value, preallocated.encoder, &mut out, ()
15319 )?;
15320 } else {
15321 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15322 }
15323 }
15324
15325 7 => {
15326 if let Some(value) = &self.dependency_type {
15327 ::fidl_next::WireEnvelope::encode_value::<
15328 crate::wire::DependencyType,
15329 ___E,
15330 >(
15331 value, preallocated.encoder, &mut out, ()
15332 )?;
15333 } else {
15334 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15335 }
15336 }
15337
15338 6 => {
15339 if let Some(value) = &self.subdir {
15340 ::fidl_next::WireEnvelope::encode_value::<
15341 ::fidl_next::WireString<'static>,
15342 ___E,
15343 >(
15344 value, preallocated.encoder, &mut out, 1024
15345 )?;
15346 } else {
15347 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15348 }
15349 }
15350
15351 5 => {
15352 if let Some(value) = &self.rights {
15353 ::fidl_next::WireEnvelope::encode_value::<
15354 ::fidl_next_common_fuchsia_io::wire::Operations,
15355 ___E,
15356 >(
15357 value, preallocated.encoder, &mut out, ()
15358 )?;
15359 } else {
15360 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15361 }
15362 }
15363
15364 4 => {
15365 if let Some(value) = &self.target_name {
15366 ::fidl_next::WireEnvelope::encode_value::<
15367 ::fidl_next::WireString<'static>,
15368 ___E,
15369 >(
15370 value, preallocated.encoder, &mut out, 100
15371 )?;
15372 } else {
15373 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15374 }
15375 }
15376
15377 3 => {
15378 if let Some(value) = &self.target {
15379 ::fidl_next::WireEnvelope::encode_value::<
15380 crate::wire::Ref<'static>,
15381 ___E,
15382 >(
15383 value, preallocated.encoder, &mut out, ()
15384 )?;
15385 } else {
15386 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15387 }
15388 }
15389
15390 2 => {
15391 if let Some(value) = &self.source_name {
15392 ::fidl_next::WireEnvelope::encode_value::<
15393 ::fidl_next::WireString<'static>,
15394 ___E,
15395 >(
15396 value, preallocated.encoder, &mut out, 100
15397 )?;
15398 } else {
15399 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15400 }
15401 }
15402
15403 1 => {
15404 if let Some(value) = &self.source {
15405 ::fidl_next::WireEnvelope::encode_value::<
15406 crate::wire::Ref<'static>,
15407 ___E,
15408 >(
15409 value, preallocated.encoder, &mut out, ()
15410 )?;
15411 } else {
15412 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15413 }
15414 }
15415
15416 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
15417 }
15418 unsafe {
15419 preallocated.write_next(out.assume_init_ref());
15420 }
15421 }
15422
15423 ::fidl_next::WireTable::encode_len(table, max_ord);
15424
15425 Ok(())
15426 }
15427 }
15428
15429 impl<'de> ::fidl_next::FromWire<crate::wire::OfferDirectory<'de>> for OfferDirectory {
15430 #[inline]
15431 fn from_wire(wire_: crate::wire::OfferDirectory<'de>) -> Self {
15432 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
15433
15434 let source = wire_.table.get(1);
15435
15436 let source_name = wire_.table.get(2);
15437
15438 let target = wire_.table.get(3);
15439
15440 let target_name = wire_.table.get(4);
15441
15442 let rights = wire_.table.get(5);
15443
15444 let subdir = wire_.table.get(6);
15445
15446 let dependency_type = wire_.table.get(7);
15447
15448 let availability = wire_.table.get(8);
15449
15450 let source_dictionary = wire_.table.get(9);
15451
15452 Self {
15453 source: source.map(|envelope| {
15454 ::fidl_next::FromWire::from_wire(unsafe {
15455 envelope.read_unchecked::<crate::wire::Ref<'de>>()
15456 })
15457 }),
15458
15459 source_name: source_name.map(|envelope| {
15460 ::fidl_next::FromWire::from_wire(unsafe {
15461 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
15462 })
15463 }),
15464
15465 target: target.map(|envelope| {
15466 ::fidl_next::FromWire::from_wire(unsafe {
15467 envelope.read_unchecked::<crate::wire::Ref<'de>>()
15468 })
15469 }),
15470
15471 target_name: target_name.map(|envelope| {
15472 ::fidl_next::FromWire::from_wire(unsafe {
15473 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
15474 })
15475 }),
15476
15477 rights: rights.map(|envelope| {
15478 ::fidl_next::FromWire::from_wire(unsafe {
15479 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
15480 })
15481 }),
15482
15483 subdir: subdir.map(|envelope| {
15484 ::fidl_next::FromWire::from_wire(unsafe {
15485 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
15486 })
15487 }),
15488
15489 dependency_type: dependency_type.map(|envelope| {
15490 ::fidl_next::FromWire::from_wire(unsafe {
15491 envelope.read_unchecked::<crate::wire::DependencyType>()
15492 })
15493 }),
15494
15495 availability: availability.map(|envelope| {
15496 ::fidl_next::FromWire::from_wire(unsafe {
15497 envelope.read_unchecked::<crate::wire::Availability>()
15498 })
15499 }),
15500
15501 source_dictionary: source_dictionary.map(|envelope| {
15502 ::fidl_next::FromWire::from_wire(unsafe {
15503 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
15504 })
15505 }),
15506 }
15507 }
15508 }
15509
15510 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferDirectory<'de>> for OfferDirectory {
15511 #[inline]
15512 fn from_wire_ref(wire: &crate::wire::OfferDirectory<'de>) -> Self {
15513 Self {
15514 source: wire.table.get(1).map(|envelope| {
15515 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15516 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
15517 })
15518 }),
15519
15520 source_name: wire.table.get(2).map(|envelope| {
15521 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15522 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15523 })
15524 }),
15525
15526 target: wire.table.get(3).map(|envelope| {
15527 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15528 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
15529 })
15530 }),
15531
15532 target_name: wire.table.get(4).map(|envelope| {
15533 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15534 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15535 })
15536 }),
15537
15538 rights: wire.table.get(5).map(|envelope| {
15539 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15540 envelope
15541 .deref_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
15542 })
15543 }),
15544
15545 subdir: wire.table.get(6).map(|envelope| {
15546 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15547 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15548 })
15549 }),
15550
15551 dependency_type: wire.table.get(7).map(|envelope| {
15552 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15553 envelope.deref_unchecked::<crate::wire::DependencyType>()
15554 })
15555 }),
15556
15557 availability: wire.table.get(8).map(|envelope| {
15558 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15559 envelope.deref_unchecked::<crate::wire::Availability>()
15560 })
15561 }),
15562
15563 source_dictionary: wire.table.get(9).map(|envelope| {
15564 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15565 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15566 })
15567 }),
15568 }
15569 }
15570 }
15571
15572 #[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"]
15573 #[derive(PartialEq, Clone, Debug, Default)]
15574 pub struct OfferStorage {
15575 pub source_name: ::core::option::Option<::std::string::String>,
15576
15577 pub source: ::core::option::Option<crate::natural::Ref>,
15578
15579 pub target: ::core::option::Option<crate::natural::Ref>,
15580
15581 pub target_name: ::core::option::Option<::std::string::String>,
15582
15583 pub availability: ::core::option::Option<crate::natural::Availability>,
15584 }
15585
15586 impl OfferStorage {
15587 fn __max_ordinal(&self) -> usize {
15588 if self.availability.is_some() {
15589 return 5;
15590 }
15591
15592 if self.target_name.is_some() {
15593 return 4;
15594 }
15595
15596 if self.target.is_some() {
15597 return 3;
15598 }
15599
15600 if self.source.is_some() {
15601 return 2;
15602 }
15603
15604 if self.source_name.is_some() {
15605 return 1;
15606 }
15607
15608 0
15609 }
15610 }
15611
15612 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferStorage<'static>, ___E> for OfferStorage
15613 where
15614 ___E: ::fidl_next::Encoder + ?Sized,
15615 {
15616 #[inline]
15617 fn encode(
15618 mut self,
15619 encoder: &mut ___E,
15620 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferStorage<'static>>,
15621 _: (),
15622 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15623 ::fidl_next::munge!(let crate::wire::OfferStorage { table } = out);
15624
15625 let max_ord = self.__max_ordinal();
15626
15627 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
15628 ::fidl_next::Wire::zero_padding(&mut out);
15629
15630 let mut preallocated =
15631 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
15632
15633 for i in 1..=max_ord {
15634 match i {
15635 5 => {
15636 if let Some(value) = self.availability.take() {
15637 ::fidl_next::WireEnvelope::encode_value::<
15638 crate::wire::Availability,
15639 ___E,
15640 >(
15641 value, preallocated.encoder, &mut out, ()
15642 )?;
15643 } else {
15644 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15645 }
15646 }
15647
15648 4 => {
15649 if let Some(value) = self.target_name.take() {
15650 ::fidl_next::WireEnvelope::encode_value::<
15651 ::fidl_next::WireString<'static>,
15652 ___E,
15653 >(
15654 value, preallocated.encoder, &mut out, 100
15655 )?;
15656 } else {
15657 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15658 }
15659 }
15660
15661 3 => {
15662 if let Some(value) = self.target.take() {
15663 ::fidl_next::WireEnvelope::encode_value::<
15664 crate::wire::Ref<'static>,
15665 ___E,
15666 >(
15667 value, preallocated.encoder, &mut out, ()
15668 )?;
15669 } else {
15670 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15671 }
15672 }
15673
15674 2 => {
15675 if let Some(value) = self.source.take() {
15676 ::fidl_next::WireEnvelope::encode_value::<
15677 crate::wire::Ref<'static>,
15678 ___E,
15679 >(
15680 value, preallocated.encoder, &mut out, ()
15681 )?;
15682 } else {
15683 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15684 }
15685 }
15686
15687 1 => {
15688 if let Some(value) = self.source_name.take() {
15689 ::fidl_next::WireEnvelope::encode_value::<
15690 ::fidl_next::WireString<'static>,
15691 ___E,
15692 >(
15693 value, preallocated.encoder, &mut out, 100
15694 )?;
15695 } else {
15696 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15697 }
15698 }
15699
15700 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
15701 }
15702 unsafe {
15703 preallocated.write_next(out.assume_init_ref());
15704 }
15705 }
15706
15707 ::fidl_next::WireTable::encode_len(table, max_ord);
15708
15709 Ok(())
15710 }
15711 }
15712
15713 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferStorage<'static>, ___E>
15714 for &'a OfferStorage
15715 where
15716 ___E: ::fidl_next::Encoder + ?Sized,
15717 {
15718 #[inline]
15719 fn encode(
15720 self,
15721 encoder: &mut ___E,
15722 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferStorage<'static>>,
15723 _: (),
15724 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15725 ::fidl_next::munge!(let crate::wire::OfferStorage { table } = out);
15726
15727 let max_ord = self.__max_ordinal();
15728
15729 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
15730 ::fidl_next::Wire::zero_padding(&mut out);
15731
15732 let mut preallocated =
15733 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
15734
15735 for i in 1..=max_ord {
15736 match i {
15737 5 => {
15738 if let Some(value) = &self.availability {
15739 ::fidl_next::WireEnvelope::encode_value::<
15740 crate::wire::Availability,
15741 ___E,
15742 >(
15743 value, preallocated.encoder, &mut out, ()
15744 )?;
15745 } else {
15746 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15747 }
15748 }
15749
15750 4 => {
15751 if let Some(value) = &self.target_name {
15752 ::fidl_next::WireEnvelope::encode_value::<
15753 ::fidl_next::WireString<'static>,
15754 ___E,
15755 >(
15756 value, preallocated.encoder, &mut out, 100
15757 )?;
15758 } else {
15759 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15760 }
15761 }
15762
15763 3 => {
15764 if let Some(value) = &self.target {
15765 ::fidl_next::WireEnvelope::encode_value::<
15766 crate::wire::Ref<'static>,
15767 ___E,
15768 >(
15769 value, preallocated.encoder, &mut out, ()
15770 )?;
15771 } else {
15772 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15773 }
15774 }
15775
15776 2 => {
15777 if let Some(value) = &self.source {
15778 ::fidl_next::WireEnvelope::encode_value::<
15779 crate::wire::Ref<'static>,
15780 ___E,
15781 >(
15782 value, preallocated.encoder, &mut out, ()
15783 )?;
15784 } else {
15785 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15786 }
15787 }
15788
15789 1 => {
15790 if let Some(value) = &self.source_name {
15791 ::fidl_next::WireEnvelope::encode_value::<
15792 ::fidl_next::WireString<'static>,
15793 ___E,
15794 >(
15795 value, preallocated.encoder, &mut out, 100
15796 )?;
15797 } else {
15798 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15799 }
15800 }
15801
15802 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
15803 }
15804 unsafe {
15805 preallocated.write_next(out.assume_init_ref());
15806 }
15807 }
15808
15809 ::fidl_next::WireTable::encode_len(table, max_ord);
15810
15811 Ok(())
15812 }
15813 }
15814
15815 impl<'de> ::fidl_next::FromWire<crate::wire::OfferStorage<'de>> for OfferStorage {
15816 #[inline]
15817 fn from_wire(wire_: crate::wire::OfferStorage<'de>) -> Self {
15818 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
15819
15820 let source_name = wire_.table.get(1);
15821
15822 let source = wire_.table.get(2);
15823
15824 let target = wire_.table.get(3);
15825
15826 let target_name = wire_.table.get(4);
15827
15828 let availability = wire_.table.get(5);
15829
15830 Self {
15831 source_name: source_name.map(|envelope| {
15832 ::fidl_next::FromWire::from_wire(unsafe {
15833 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
15834 })
15835 }),
15836
15837 source: source.map(|envelope| {
15838 ::fidl_next::FromWire::from_wire(unsafe {
15839 envelope.read_unchecked::<crate::wire::Ref<'de>>()
15840 })
15841 }),
15842
15843 target: target.map(|envelope| {
15844 ::fidl_next::FromWire::from_wire(unsafe {
15845 envelope.read_unchecked::<crate::wire::Ref<'de>>()
15846 })
15847 }),
15848
15849 target_name: target_name.map(|envelope| {
15850 ::fidl_next::FromWire::from_wire(unsafe {
15851 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
15852 })
15853 }),
15854
15855 availability: availability.map(|envelope| {
15856 ::fidl_next::FromWire::from_wire(unsafe {
15857 envelope.read_unchecked::<crate::wire::Availability>()
15858 })
15859 }),
15860 }
15861 }
15862 }
15863
15864 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferStorage<'de>> for OfferStorage {
15865 #[inline]
15866 fn from_wire_ref(wire: &crate::wire::OfferStorage<'de>) -> Self {
15867 Self {
15868 source_name: wire.table.get(1).map(|envelope| {
15869 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15870 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15871 })
15872 }),
15873
15874 source: wire.table.get(2).map(|envelope| {
15875 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15876 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
15877 })
15878 }),
15879
15880 target: wire.table.get(3).map(|envelope| {
15881 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15882 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
15883 })
15884 }),
15885
15886 target_name: wire.table.get(4).map(|envelope| {
15887 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15888 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
15889 })
15890 }),
15891
15892 availability: wire.table.get(5).map(|envelope| {
15893 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
15894 envelope.deref_unchecked::<crate::wire::Availability>()
15895 })
15896 }),
15897 }
15898 }
15899 }
15900
15901 #[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"]
15902 #[derive(PartialEq, Clone, Debug, Default)]
15903 pub struct OfferRunner {
15904 pub source: ::core::option::Option<crate::natural::Ref>,
15905
15906 pub source_name: ::core::option::Option<::std::string::String>,
15907
15908 pub target: ::core::option::Option<crate::natural::Ref>,
15909
15910 pub target_name: ::core::option::Option<::std::string::String>,
15911
15912 pub source_dictionary: ::core::option::Option<::std::string::String>,
15913 }
15914
15915 impl OfferRunner {
15916 fn __max_ordinal(&self) -> usize {
15917 if self.source_dictionary.is_some() {
15918 return 5;
15919 }
15920
15921 if self.target_name.is_some() {
15922 return 4;
15923 }
15924
15925 if self.target.is_some() {
15926 return 3;
15927 }
15928
15929 if self.source_name.is_some() {
15930 return 2;
15931 }
15932
15933 if self.source.is_some() {
15934 return 1;
15935 }
15936
15937 0
15938 }
15939 }
15940
15941 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferRunner<'static>, ___E> for OfferRunner
15942 where
15943 ___E: ::fidl_next::Encoder + ?Sized,
15944 {
15945 #[inline]
15946 fn encode(
15947 mut self,
15948 encoder: &mut ___E,
15949 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferRunner<'static>>,
15950 _: (),
15951 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
15952 ::fidl_next::munge!(let crate::wire::OfferRunner { table } = out);
15953
15954 let max_ord = self.__max_ordinal();
15955
15956 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
15957 ::fidl_next::Wire::zero_padding(&mut out);
15958
15959 let mut preallocated =
15960 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
15961
15962 for i in 1..=max_ord {
15963 match i {
15964 5 => {
15965 if let Some(value) = self.source_dictionary.take() {
15966 ::fidl_next::WireEnvelope::encode_value::<
15967 ::fidl_next::WireString<'static>,
15968 ___E,
15969 >(
15970 value, preallocated.encoder, &mut out, 1024
15971 )?;
15972 } else {
15973 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15974 }
15975 }
15976
15977 4 => {
15978 if let Some(value) = self.target_name.take() {
15979 ::fidl_next::WireEnvelope::encode_value::<
15980 ::fidl_next::WireString<'static>,
15981 ___E,
15982 >(
15983 value, preallocated.encoder, &mut out, 100
15984 )?;
15985 } else {
15986 ::fidl_next::WireEnvelope::encode_zero(&mut out)
15987 }
15988 }
15989
15990 3 => {
15991 if let Some(value) = self.target.take() {
15992 ::fidl_next::WireEnvelope::encode_value::<
15993 crate::wire::Ref<'static>,
15994 ___E,
15995 >(
15996 value, preallocated.encoder, &mut out, ()
15997 )?;
15998 } else {
15999 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16000 }
16001 }
16002
16003 2 => {
16004 if let Some(value) = self.source_name.take() {
16005 ::fidl_next::WireEnvelope::encode_value::<
16006 ::fidl_next::WireString<'static>,
16007 ___E,
16008 >(
16009 value, preallocated.encoder, &mut out, 100
16010 )?;
16011 } else {
16012 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16013 }
16014 }
16015
16016 1 => {
16017 if let Some(value) = self.source.take() {
16018 ::fidl_next::WireEnvelope::encode_value::<
16019 crate::wire::Ref<'static>,
16020 ___E,
16021 >(
16022 value, preallocated.encoder, &mut out, ()
16023 )?;
16024 } else {
16025 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16026 }
16027 }
16028
16029 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
16030 }
16031 unsafe {
16032 preallocated.write_next(out.assume_init_ref());
16033 }
16034 }
16035
16036 ::fidl_next::WireTable::encode_len(table, max_ord);
16037
16038 Ok(())
16039 }
16040 }
16041
16042 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferRunner<'static>, ___E>
16043 for &'a OfferRunner
16044 where
16045 ___E: ::fidl_next::Encoder + ?Sized,
16046 {
16047 #[inline]
16048 fn encode(
16049 self,
16050 encoder: &mut ___E,
16051 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferRunner<'static>>,
16052 _: (),
16053 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16054 ::fidl_next::munge!(let crate::wire::OfferRunner { table } = out);
16055
16056 let max_ord = self.__max_ordinal();
16057
16058 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
16059 ::fidl_next::Wire::zero_padding(&mut out);
16060
16061 let mut preallocated =
16062 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
16063
16064 for i in 1..=max_ord {
16065 match i {
16066 5 => {
16067 if let Some(value) = &self.source_dictionary {
16068 ::fidl_next::WireEnvelope::encode_value::<
16069 ::fidl_next::WireString<'static>,
16070 ___E,
16071 >(
16072 value, preallocated.encoder, &mut out, 1024
16073 )?;
16074 } else {
16075 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16076 }
16077 }
16078
16079 4 => {
16080 if let Some(value) = &self.target_name {
16081 ::fidl_next::WireEnvelope::encode_value::<
16082 ::fidl_next::WireString<'static>,
16083 ___E,
16084 >(
16085 value, preallocated.encoder, &mut out, 100
16086 )?;
16087 } else {
16088 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16089 }
16090 }
16091
16092 3 => {
16093 if let Some(value) = &self.target {
16094 ::fidl_next::WireEnvelope::encode_value::<
16095 crate::wire::Ref<'static>,
16096 ___E,
16097 >(
16098 value, preallocated.encoder, &mut out, ()
16099 )?;
16100 } else {
16101 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16102 }
16103 }
16104
16105 2 => {
16106 if let Some(value) = &self.source_name {
16107 ::fidl_next::WireEnvelope::encode_value::<
16108 ::fidl_next::WireString<'static>,
16109 ___E,
16110 >(
16111 value, preallocated.encoder, &mut out, 100
16112 )?;
16113 } else {
16114 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16115 }
16116 }
16117
16118 1 => {
16119 if let Some(value) = &self.source {
16120 ::fidl_next::WireEnvelope::encode_value::<
16121 crate::wire::Ref<'static>,
16122 ___E,
16123 >(
16124 value, preallocated.encoder, &mut out, ()
16125 )?;
16126 } else {
16127 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16128 }
16129 }
16130
16131 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
16132 }
16133 unsafe {
16134 preallocated.write_next(out.assume_init_ref());
16135 }
16136 }
16137
16138 ::fidl_next::WireTable::encode_len(table, max_ord);
16139
16140 Ok(())
16141 }
16142 }
16143
16144 impl<'de> ::fidl_next::FromWire<crate::wire::OfferRunner<'de>> for OfferRunner {
16145 #[inline]
16146 fn from_wire(wire_: crate::wire::OfferRunner<'de>) -> Self {
16147 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
16148
16149 let source = wire_.table.get(1);
16150
16151 let source_name = wire_.table.get(2);
16152
16153 let target = wire_.table.get(3);
16154
16155 let target_name = wire_.table.get(4);
16156
16157 let source_dictionary = wire_.table.get(5);
16158
16159 Self {
16160 source: source.map(|envelope| {
16161 ::fidl_next::FromWire::from_wire(unsafe {
16162 envelope.read_unchecked::<crate::wire::Ref<'de>>()
16163 })
16164 }),
16165
16166 source_name: source_name.map(|envelope| {
16167 ::fidl_next::FromWire::from_wire(unsafe {
16168 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
16169 })
16170 }),
16171
16172 target: target.map(|envelope| {
16173 ::fidl_next::FromWire::from_wire(unsafe {
16174 envelope.read_unchecked::<crate::wire::Ref<'de>>()
16175 })
16176 }),
16177
16178 target_name: target_name.map(|envelope| {
16179 ::fidl_next::FromWire::from_wire(unsafe {
16180 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
16181 })
16182 }),
16183
16184 source_dictionary: source_dictionary.map(|envelope| {
16185 ::fidl_next::FromWire::from_wire(unsafe {
16186 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
16187 })
16188 }),
16189 }
16190 }
16191 }
16192
16193 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferRunner<'de>> for OfferRunner {
16194 #[inline]
16195 fn from_wire_ref(wire: &crate::wire::OfferRunner<'de>) -> Self {
16196 Self {
16197 source: wire.table.get(1).map(|envelope| {
16198 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16199 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
16200 })
16201 }),
16202
16203 source_name: wire.table.get(2).map(|envelope| {
16204 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16205 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
16206 })
16207 }),
16208
16209 target: wire.table.get(3).map(|envelope| {
16210 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16211 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
16212 })
16213 }),
16214
16215 target_name: wire.table.get(4).map(|envelope| {
16216 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16217 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
16218 })
16219 }),
16220
16221 source_dictionary: wire.table.get(5).map(|envelope| {
16222 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16223 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
16224 })
16225 }),
16226 }
16227 }
16228 }
16229
16230 #[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"]
16231 #[derive(PartialEq, Clone, Debug, Default)]
16232 pub struct OfferResolver {
16233 pub source: ::core::option::Option<crate::natural::Ref>,
16234
16235 pub source_name: ::core::option::Option<::std::string::String>,
16236
16237 pub target: ::core::option::Option<crate::natural::Ref>,
16238
16239 pub target_name: ::core::option::Option<::std::string::String>,
16240
16241 pub source_dictionary: ::core::option::Option<::std::string::String>,
16242 }
16243
16244 impl OfferResolver {
16245 fn __max_ordinal(&self) -> usize {
16246 if self.source_dictionary.is_some() {
16247 return 5;
16248 }
16249
16250 if self.target_name.is_some() {
16251 return 4;
16252 }
16253
16254 if self.target.is_some() {
16255 return 3;
16256 }
16257
16258 if self.source_name.is_some() {
16259 return 2;
16260 }
16261
16262 if self.source.is_some() {
16263 return 1;
16264 }
16265
16266 0
16267 }
16268 }
16269
16270 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferResolver<'static>, ___E> for OfferResolver
16271 where
16272 ___E: ::fidl_next::Encoder + ?Sized,
16273 {
16274 #[inline]
16275 fn encode(
16276 mut self,
16277 encoder: &mut ___E,
16278 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferResolver<'static>>,
16279 _: (),
16280 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16281 ::fidl_next::munge!(let crate::wire::OfferResolver { table } = out);
16282
16283 let max_ord = self.__max_ordinal();
16284
16285 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
16286 ::fidl_next::Wire::zero_padding(&mut out);
16287
16288 let mut preallocated =
16289 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
16290
16291 for i in 1..=max_ord {
16292 match i {
16293 5 => {
16294 if let Some(value) = self.source_dictionary.take() {
16295 ::fidl_next::WireEnvelope::encode_value::<
16296 ::fidl_next::WireString<'static>,
16297 ___E,
16298 >(
16299 value, preallocated.encoder, &mut out, 1024
16300 )?;
16301 } else {
16302 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16303 }
16304 }
16305
16306 4 => {
16307 if let Some(value) = self.target_name.take() {
16308 ::fidl_next::WireEnvelope::encode_value::<
16309 ::fidl_next::WireString<'static>,
16310 ___E,
16311 >(
16312 value, preallocated.encoder, &mut out, 100
16313 )?;
16314 } else {
16315 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16316 }
16317 }
16318
16319 3 => {
16320 if let Some(value) = self.target.take() {
16321 ::fidl_next::WireEnvelope::encode_value::<
16322 crate::wire::Ref<'static>,
16323 ___E,
16324 >(
16325 value, preallocated.encoder, &mut out, ()
16326 )?;
16327 } else {
16328 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16329 }
16330 }
16331
16332 2 => {
16333 if let Some(value) = self.source_name.take() {
16334 ::fidl_next::WireEnvelope::encode_value::<
16335 ::fidl_next::WireString<'static>,
16336 ___E,
16337 >(
16338 value, preallocated.encoder, &mut out, 100
16339 )?;
16340 } else {
16341 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16342 }
16343 }
16344
16345 1 => {
16346 if let Some(value) = self.source.take() {
16347 ::fidl_next::WireEnvelope::encode_value::<
16348 crate::wire::Ref<'static>,
16349 ___E,
16350 >(
16351 value, preallocated.encoder, &mut out, ()
16352 )?;
16353 } else {
16354 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16355 }
16356 }
16357
16358 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
16359 }
16360 unsafe {
16361 preallocated.write_next(out.assume_init_ref());
16362 }
16363 }
16364
16365 ::fidl_next::WireTable::encode_len(table, max_ord);
16366
16367 Ok(())
16368 }
16369 }
16370
16371 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferResolver<'static>, ___E>
16372 for &'a OfferResolver
16373 where
16374 ___E: ::fidl_next::Encoder + ?Sized,
16375 {
16376 #[inline]
16377 fn encode(
16378 self,
16379 encoder: &mut ___E,
16380 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferResolver<'static>>,
16381 _: (),
16382 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16383 ::fidl_next::munge!(let crate::wire::OfferResolver { table } = out);
16384
16385 let max_ord = self.__max_ordinal();
16386
16387 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
16388 ::fidl_next::Wire::zero_padding(&mut out);
16389
16390 let mut preallocated =
16391 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
16392
16393 for i in 1..=max_ord {
16394 match i {
16395 5 => {
16396 if let Some(value) = &self.source_dictionary {
16397 ::fidl_next::WireEnvelope::encode_value::<
16398 ::fidl_next::WireString<'static>,
16399 ___E,
16400 >(
16401 value, preallocated.encoder, &mut out, 1024
16402 )?;
16403 } else {
16404 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16405 }
16406 }
16407
16408 4 => {
16409 if let Some(value) = &self.target_name {
16410 ::fidl_next::WireEnvelope::encode_value::<
16411 ::fidl_next::WireString<'static>,
16412 ___E,
16413 >(
16414 value, preallocated.encoder, &mut out, 100
16415 )?;
16416 } else {
16417 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16418 }
16419 }
16420
16421 3 => {
16422 if let Some(value) = &self.target {
16423 ::fidl_next::WireEnvelope::encode_value::<
16424 crate::wire::Ref<'static>,
16425 ___E,
16426 >(
16427 value, preallocated.encoder, &mut out, ()
16428 )?;
16429 } else {
16430 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16431 }
16432 }
16433
16434 2 => {
16435 if let Some(value) = &self.source_name {
16436 ::fidl_next::WireEnvelope::encode_value::<
16437 ::fidl_next::WireString<'static>,
16438 ___E,
16439 >(
16440 value, preallocated.encoder, &mut out, 100
16441 )?;
16442 } else {
16443 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16444 }
16445 }
16446
16447 1 => {
16448 if let Some(value) = &self.source {
16449 ::fidl_next::WireEnvelope::encode_value::<
16450 crate::wire::Ref<'static>,
16451 ___E,
16452 >(
16453 value, preallocated.encoder, &mut out, ()
16454 )?;
16455 } else {
16456 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16457 }
16458 }
16459
16460 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
16461 }
16462 unsafe {
16463 preallocated.write_next(out.assume_init_ref());
16464 }
16465 }
16466
16467 ::fidl_next::WireTable::encode_len(table, max_ord);
16468
16469 Ok(())
16470 }
16471 }
16472
16473 impl<'de> ::fidl_next::FromWire<crate::wire::OfferResolver<'de>> for OfferResolver {
16474 #[inline]
16475 fn from_wire(wire_: crate::wire::OfferResolver<'de>) -> Self {
16476 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
16477
16478 let source = wire_.table.get(1);
16479
16480 let source_name = wire_.table.get(2);
16481
16482 let target = wire_.table.get(3);
16483
16484 let target_name = wire_.table.get(4);
16485
16486 let source_dictionary = wire_.table.get(5);
16487
16488 Self {
16489 source: source.map(|envelope| {
16490 ::fidl_next::FromWire::from_wire(unsafe {
16491 envelope.read_unchecked::<crate::wire::Ref<'de>>()
16492 })
16493 }),
16494
16495 source_name: source_name.map(|envelope| {
16496 ::fidl_next::FromWire::from_wire(unsafe {
16497 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
16498 })
16499 }),
16500
16501 target: target.map(|envelope| {
16502 ::fidl_next::FromWire::from_wire(unsafe {
16503 envelope.read_unchecked::<crate::wire::Ref<'de>>()
16504 })
16505 }),
16506
16507 target_name: target_name.map(|envelope| {
16508 ::fidl_next::FromWire::from_wire(unsafe {
16509 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
16510 })
16511 }),
16512
16513 source_dictionary: source_dictionary.map(|envelope| {
16514 ::fidl_next::FromWire::from_wire(unsafe {
16515 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
16516 })
16517 }),
16518 }
16519 }
16520 }
16521
16522 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferResolver<'de>> for OfferResolver {
16523 #[inline]
16524 fn from_wire_ref(wire: &crate::wire::OfferResolver<'de>) -> Self {
16525 Self {
16526 source: wire.table.get(1).map(|envelope| {
16527 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16528 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
16529 })
16530 }),
16531
16532 source_name: wire.table.get(2).map(|envelope| {
16533 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16534 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
16535 })
16536 }),
16537
16538 target: wire.table.get(3).map(|envelope| {
16539 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16540 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
16541 })
16542 }),
16543
16544 target_name: wire.table.get(4).map(|envelope| {
16545 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16546 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
16547 })
16548 }),
16549
16550 source_dictionary: wire.table.get(5).map(|envelope| {
16551 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16552 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
16553 })
16554 }),
16555 }
16556 }
16557 }
16558
16559 #[doc = " Declares an event stream offered by a component.\n"]
16560 #[derive(PartialEq, Clone, Debug, Default)]
16561 pub struct OfferEventStream {
16562 pub source: ::core::option::Option<crate::natural::Ref>,
16563
16564 pub source_name: ::core::option::Option<::std::string::String>,
16565
16566 pub scope: ::core::option::Option<::std::vec::Vec<crate::natural::Ref>>,
16567
16568 pub target: ::core::option::Option<crate::natural::Ref>,
16569
16570 pub target_name: ::core::option::Option<::std::string::String>,
16571
16572 pub availability: ::core::option::Option<crate::natural::Availability>,
16573 }
16574
16575 impl OfferEventStream {
16576 fn __max_ordinal(&self) -> usize {
16577 if self.availability.is_some() {
16578 return 7;
16579 }
16580
16581 if self.target_name.is_some() {
16582 return 5;
16583 }
16584
16585 if self.target.is_some() {
16586 return 4;
16587 }
16588
16589 if self.scope.is_some() {
16590 return 3;
16591 }
16592
16593 if self.source_name.is_some() {
16594 return 2;
16595 }
16596
16597 if self.source.is_some() {
16598 return 1;
16599 }
16600
16601 0
16602 }
16603 }
16604
16605 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferEventStream<'static>, ___E>
16606 for OfferEventStream
16607 where
16608 ___E: ::fidl_next::Encoder + ?Sized,
16609 {
16610 #[inline]
16611 fn encode(
16612 mut self,
16613 encoder: &mut ___E,
16614 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferEventStream<'static>>,
16615 _: (),
16616 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16617 ::fidl_next::munge!(let crate::wire::OfferEventStream { table } = out);
16618
16619 let max_ord = self.__max_ordinal();
16620
16621 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
16622 ::fidl_next::Wire::zero_padding(&mut out);
16623
16624 let mut preallocated =
16625 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
16626
16627 for i in 1..=max_ord {
16628 match i {
16629 7 => {
16630 if let Some(value) = self.availability.take() {
16631 ::fidl_next::WireEnvelope::encode_value::<
16632 crate::wire::Availability,
16633 ___E,
16634 >(
16635 value, preallocated.encoder, &mut out, ()
16636 )?;
16637 } else {
16638 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16639 }
16640 }
16641
16642 5 => {
16643 if let Some(value) = self.target_name.take() {
16644 ::fidl_next::WireEnvelope::encode_value::<
16645 ::fidl_next::WireString<'static>,
16646 ___E,
16647 >(
16648 value, preallocated.encoder, &mut out, 100
16649 )?;
16650 } else {
16651 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16652 }
16653 }
16654
16655 4 => {
16656 if let Some(value) = self.target.take() {
16657 ::fidl_next::WireEnvelope::encode_value::<
16658 crate::wire::Ref<'static>,
16659 ___E,
16660 >(
16661 value, preallocated.encoder, &mut out, ()
16662 )?;
16663 } else {
16664 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16665 }
16666 }
16667
16668 3 => {
16669 if let Some(value) = self.scope.take() {
16670 ::fidl_next::WireEnvelope::encode_value::<
16671 ::fidl_next::WireVector<'static, crate::wire::Ref<'static>>,
16672 ___E,
16673 >(
16674 value, preallocated.encoder, &mut out, (4294967295, ())
16675 )?;
16676 } else {
16677 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16678 }
16679 }
16680
16681 2 => {
16682 if let Some(value) = self.source_name.take() {
16683 ::fidl_next::WireEnvelope::encode_value::<
16684 ::fidl_next::WireString<'static>,
16685 ___E,
16686 >(
16687 value, preallocated.encoder, &mut out, 100
16688 )?;
16689 } else {
16690 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16691 }
16692 }
16693
16694 1 => {
16695 if let Some(value) = self.source.take() {
16696 ::fidl_next::WireEnvelope::encode_value::<
16697 crate::wire::Ref<'static>,
16698 ___E,
16699 >(
16700 value, preallocated.encoder, &mut out, ()
16701 )?;
16702 } else {
16703 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16704 }
16705 }
16706
16707 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
16708 }
16709 unsafe {
16710 preallocated.write_next(out.assume_init_ref());
16711 }
16712 }
16713
16714 ::fidl_next::WireTable::encode_len(table, max_ord);
16715
16716 Ok(())
16717 }
16718 }
16719
16720 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferEventStream<'static>, ___E>
16721 for &'a OfferEventStream
16722 where
16723 ___E: ::fidl_next::Encoder + ?Sized,
16724 {
16725 #[inline]
16726 fn encode(
16727 self,
16728 encoder: &mut ___E,
16729 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferEventStream<'static>>,
16730 _: (),
16731 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
16732 ::fidl_next::munge!(let crate::wire::OfferEventStream { table } = out);
16733
16734 let max_ord = self.__max_ordinal();
16735
16736 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
16737 ::fidl_next::Wire::zero_padding(&mut out);
16738
16739 let mut preallocated =
16740 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
16741
16742 for i in 1..=max_ord {
16743 match i {
16744 7 => {
16745 if let Some(value) = &self.availability {
16746 ::fidl_next::WireEnvelope::encode_value::<
16747 crate::wire::Availability,
16748 ___E,
16749 >(
16750 value, preallocated.encoder, &mut out, ()
16751 )?;
16752 } else {
16753 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16754 }
16755 }
16756
16757 5 => {
16758 if let Some(value) = &self.target_name {
16759 ::fidl_next::WireEnvelope::encode_value::<
16760 ::fidl_next::WireString<'static>,
16761 ___E,
16762 >(
16763 value, preallocated.encoder, &mut out, 100
16764 )?;
16765 } else {
16766 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16767 }
16768 }
16769
16770 4 => {
16771 if let Some(value) = &self.target {
16772 ::fidl_next::WireEnvelope::encode_value::<
16773 crate::wire::Ref<'static>,
16774 ___E,
16775 >(
16776 value, preallocated.encoder, &mut out, ()
16777 )?;
16778 } else {
16779 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16780 }
16781 }
16782
16783 3 => {
16784 if let Some(value) = &self.scope {
16785 ::fidl_next::WireEnvelope::encode_value::<
16786 ::fidl_next::WireVector<'static, crate::wire::Ref<'static>>,
16787 ___E,
16788 >(
16789 value, preallocated.encoder, &mut out, (4294967295, ())
16790 )?;
16791 } else {
16792 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16793 }
16794 }
16795
16796 2 => {
16797 if let Some(value) = &self.source_name {
16798 ::fidl_next::WireEnvelope::encode_value::<
16799 ::fidl_next::WireString<'static>,
16800 ___E,
16801 >(
16802 value, preallocated.encoder, &mut out, 100
16803 )?;
16804 } else {
16805 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16806 }
16807 }
16808
16809 1 => {
16810 if let Some(value) = &self.source {
16811 ::fidl_next::WireEnvelope::encode_value::<
16812 crate::wire::Ref<'static>,
16813 ___E,
16814 >(
16815 value, preallocated.encoder, &mut out, ()
16816 )?;
16817 } else {
16818 ::fidl_next::WireEnvelope::encode_zero(&mut out)
16819 }
16820 }
16821
16822 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
16823 }
16824 unsafe {
16825 preallocated.write_next(out.assume_init_ref());
16826 }
16827 }
16828
16829 ::fidl_next::WireTable::encode_len(table, max_ord);
16830
16831 Ok(())
16832 }
16833 }
16834
16835 impl<'de> ::fidl_next::FromWire<crate::wire::OfferEventStream<'de>> for OfferEventStream {
16836 #[inline]
16837 fn from_wire(wire_: crate::wire::OfferEventStream<'de>) -> Self {
16838 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
16839
16840 let source = wire_.table.get(1);
16841
16842 let source_name = wire_.table.get(2);
16843
16844 let scope = wire_.table.get(3);
16845
16846 let target = wire_.table.get(4);
16847
16848 let target_name = wire_.table.get(5);
16849
16850 let availability = wire_.table.get(7);
16851
16852 Self {
16853 source: source.map(|envelope| {
16854 ::fidl_next::FromWire::from_wire(unsafe {
16855 envelope.read_unchecked::<crate::wire::Ref<'de>>()
16856 })
16857 }),
16858
16859 source_name: source_name.map(|envelope| {
16860 ::fidl_next::FromWire::from_wire(unsafe {
16861 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
16862 })
16863 }),
16864
16865 scope: scope.map(|envelope| {
16866 ::fidl_next::FromWire::from_wire(unsafe {
16867 envelope
16868 .read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Ref<'de>>>()
16869 })
16870 }),
16871
16872 target: target.map(|envelope| {
16873 ::fidl_next::FromWire::from_wire(unsafe {
16874 envelope.read_unchecked::<crate::wire::Ref<'de>>()
16875 })
16876 }),
16877
16878 target_name: target_name.map(|envelope| {
16879 ::fidl_next::FromWire::from_wire(unsafe {
16880 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
16881 })
16882 }),
16883
16884 availability: availability.map(|envelope| {
16885 ::fidl_next::FromWire::from_wire(unsafe {
16886 envelope.read_unchecked::<crate::wire::Availability>()
16887 })
16888 }),
16889 }
16890 }
16891 }
16892
16893 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferEventStream<'de>> for OfferEventStream {
16894 #[inline]
16895 fn from_wire_ref(wire: &crate::wire::OfferEventStream<'de>) -> Self {
16896 Self {
16897 source: wire.table.get(1).map(|envelope| {
16898 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16899 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
16900 })
16901 }),
16902
16903 source_name: wire.table.get(2).map(|envelope| {
16904 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16905 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
16906 })
16907 }),
16908
16909 scope: wire.table.get(3).map(|envelope| {
16910 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16911 envelope
16912 .deref_unchecked::<::fidl_next::WireVector<'de, crate::wire::Ref<'de>>>(
16913 )
16914 })
16915 }),
16916
16917 target: wire.table.get(4).map(|envelope| {
16918 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16919 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
16920 })
16921 }),
16922
16923 target_name: wire.table.get(5).map(|envelope| {
16924 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16925 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
16926 })
16927 }),
16928
16929 availability: wire.table.get(7).map(|envelope| {
16930 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
16931 envelope.deref_unchecked::<crate::wire::Availability>()
16932 })
16933 }),
16934 }
16935 }
16936 }
16937
16938 #[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"]
16939 #[derive(PartialEq, Clone, Debug, Default)]
16940 pub struct OfferDictionary {
16941 pub source: ::core::option::Option<crate::natural::Ref>,
16942
16943 pub source_name: ::core::option::Option<::std::string::String>,
16944
16945 pub target: ::core::option::Option<crate::natural::Ref>,
16946
16947 pub target_name: ::core::option::Option<::std::string::String>,
16948
16949 pub dependency_type: ::core::option::Option<crate::natural::DependencyType>,
16950
16951 pub availability: ::core::option::Option<crate::natural::Availability>,
16952
16953 pub source_dictionary: ::core::option::Option<::std::string::String>,
16954 }
16955
16956 impl OfferDictionary {
16957 fn __max_ordinal(&self) -> usize {
16958 if self.source_dictionary.is_some() {
16959 return 7;
16960 }
16961
16962 if self.availability.is_some() {
16963 return 6;
16964 }
16965
16966 if self.dependency_type.is_some() {
16967 return 5;
16968 }
16969
16970 if self.target_name.is_some() {
16971 return 4;
16972 }
16973
16974 if self.target.is_some() {
16975 return 3;
16976 }
16977
16978 if self.source_name.is_some() {
16979 return 2;
16980 }
16981
16982 if self.source.is_some() {
16983 return 1;
16984 }
16985
16986 0
16987 }
16988 }
16989
16990 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferDictionary<'static>, ___E>
16991 for OfferDictionary
16992 where
16993 ___E: ::fidl_next::Encoder + ?Sized,
16994 {
16995 #[inline]
16996 fn encode(
16997 mut self,
16998 encoder: &mut ___E,
16999 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferDictionary<'static>>,
17000 _: (),
17001 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17002 ::fidl_next::munge!(let crate::wire::OfferDictionary { table } = out);
17003
17004 let max_ord = self.__max_ordinal();
17005
17006 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
17007 ::fidl_next::Wire::zero_padding(&mut out);
17008
17009 let mut preallocated =
17010 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
17011
17012 for i in 1..=max_ord {
17013 match i {
17014 7 => {
17015 if let Some(value) = self.source_dictionary.take() {
17016 ::fidl_next::WireEnvelope::encode_value::<
17017 ::fidl_next::WireString<'static>,
17018 ___E,
17019 >(
17020 value, preallocated.encoder, &mut out, 1024
17021 )?;
17022 } else {
17023 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17024 }
17025 }
17026
17027 6 => {
17028 if let Some(value) = self.availability.take() {
17029 ::fidl_next::WireEnvelope::encode_value::<
17030 crate::wire::Availability,
17031 ___E,
17032 >(
17033 value, preallocated.encoder, &mut out, ()
17034 )?;
17035 } else {
17036 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17037 }
17038 }
17039
17040 5 => {
17041 if let Some(value) = self.dependency_type.take() {
17042 ::fidl_next::WireEnvelope::encode_value::<
17043 crate::wire::DependencyType,
17044 ___E,
17045 >(
17046 value, preallocated.encoder, &mut out, ()
17047 )?;
17048 } else {
17049 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17050 }
17051 }
17052
17053 4 => {
17054 if let Some(value) = self.target_name.take() {
17055 ::fidl_next::WireEnvelope::encode_value::<
17056 ::fidl_next::WireString<'static>,
17057 ___E,
17058 >(
17059 value, preallocated.encoder, &mut out, 100
17060 )?;
17061 } else {
17062 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17063 }
17064 }
17065
17066 3 => {
17067 if let Some(value) = self.target.take() {
17068 ::fidl_next::WireEnvelope::encode_value::<
17069 crate::wire::Ref<'static>,
17070 ___E,
17071 >(
17072 value, preallocated.encoder, &mut out, ()
17073 )?;
17074 } else {
17075 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17076 }
17077 }
17078
17079 2 => {
17080 if let Some(value) = self.source_name.take() {
17081 ::fidl_next::WireEnvelope::encode_value::<
17082 ::fidl_next::WireString<'static>,
17083 ___E,
17084 >(
17085 value, preallocated.encoder, &mut out, 100
17086 )?;
17087 } else {
17088 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17089 }
17090 }
17091
17092 1 => {
17093 if let Some(value) = self.source.take() {
17094 ::fidl_next::WireEnvelope::encode_value::<
17095 crate::wire::Ref<'static>,
17096 ___E,
17097 >(
17098 value, preallocated.encoder, &mut out, ()
17099 )?;
17100 } else {
17101 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17102 }
17103 }
17104
17105 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
17106 }
17107 unsafe {
17108 preallocated.write_next(out.assume_init_ref());
17109 }
17110 }
17111
17112 ::fidl_next::WireTable::encode_len(table, max_ord);
17113
17114 Ok(())
17115 }
17116 }
17117
17118 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferDictionary<'static>, ___E>
17119 for &'a OfferDictionary
17120 where
17121 ___E: ::fidl_next::Encoder + ?Sized,
17122 {
17123 #[inline]
17124 fn encode(
17125 self,
17126 encoder: &mut ___E,
17127 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferDictionary<'static>>,
17128 _: (),
17129 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17130 ::fidl_next::munge!(let crate::wire::OfferDictionary { table } = out);
17131
17132 let max_ord = self.__max_ordinal();
17133
17134 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
17135 ::fidl_next::Wire::zero_padding(&mut out);
17136
17137 let mut preallocated =
17138 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
17139
17140 for i in 1..=max_ord {
17141 match i {
17142 7 => {
17143 if let Some(value) = &self.source_dictionary {
17144 ::fidl_next::WireEnvelope::encode_value::<
17145 ::fidl_next::WireString<'static>,
17146 ___E,
17147 >(
17148 value, preallocated.encoder, &mut out, 1024
17149 )?;
17150 } else {
17151 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17152 }
17153 }
17154
17155 6 => {
17156 if let Some(value) = &self.availability {
17157 ::fidl_next::WireEnvelope::encode_value::<
17158 crate::wire::Availability,
17159 ___E,
17160 >(
17161 value, preallocated.encoder, &mut out, ()
17162 )?;
17163 } else {
17164 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17165 }
17166 }
17167
17168 5 => {
17169 if let Some(value) = &self.dependency_type {
17170 ::fidl_next::WireEnvelope::encode_value::<
17171 crate::wire::DependencyType,
17172 ___E,
17173 >(
17174 value, preallocated.encoder, &mut out, ()
17175 )?;
17176 } else {
17177 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17178 }
17179 }
17180
17181 4 => {
17182 if let Some(value) = &self.target_name {
17183 ::fidl_next::WireEnvelope::encode_value::<
17184 ::fidl_next::WireString<'static>,
17185 ___E,
17186 >(
17187 value, preallocated.encoder, &mut out, 100
17188 )?;
17189 } else {
17190 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17191 }
17192 }
17193
17194 3 => {
17195 if let Some(value) = &self.target {
17196 ::fidl_next::WireEnvelope::encode_value::<
17197 crate::wire::Ref<'static>,
17198 ___E,
17199 >(
17200 value, preallocated.encoder, &mut out, ()
17201 )?;
17202 } else {
17203 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17204 }
17205 }
17206
17207 2 => {
17208 if let Some(value) = &self.source_name {
17209 ::fidl_next::WireEnvelope::encode_value::<
17210 ::fidl_next::WireString<'static>,
17211 ___E,
17212 >(
17213 value, preallocated.encoder, &mut out, 100
17214 )?;
17215 } else {
17216 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17217 }
17218 }
17219
17220 1 => {
17221 if let Some(value) = &self.source {
17222 ::fidl_next::WireEnvelope::encode_value::<
17223 crate::wire::Ref<'static>,
17224 ___E,
17225 >(
17226 value, preallocated.encoder, &mut out, ()
17227 )?;
17228 } else {
17229 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17230 }
17231 }
17232
17233 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
17234 }
17235 unsafe {
17236 preallocated.write_next(out.assume_init_ref());
17237 }
17238 }
17239
17240 ::fidl_next::WireTable::encode_len(table, max_ord);
17241
17242 Ok(())
17243 }
17244 }
17245
17246 impl<'de> ::fidl_next::FromWire<crate::wire::OfferDictionary<'de>> for OfferDictionary {
17247 #[inline]
17248 fn from_wire(wire_: crate::wire::OfferDictionary<'de>) -> Self {
17249 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
17250
17251 let source = wire_.table.get(1);
17252
17253 let source_name = wire_.table.get(2);
17254
17255 let target = wire_.table.get(3);
17256
17257 let target_name = wire_.table.get(4);
17258
17259 let dependency_type = wire_.table.get(5);
17260
17261 let availability = wire_.table.get(6);
17262
17263 let source_dictionary = wire_.table.get(7);
17264
17265 Self {
17266 source: source.map(|envelope| {
17267 ::fidl_next::FromWire::from_wire(unsafe {
17268 envelope.read_unchecked::<crate::wire::Ref<'de>>()
17269 })
17270 }),
17271
17272 source_name: source_name.map(|envelope| {
17273 ::fidl_next::FromWire::from_wire(unsafe {
17274 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
17275 })
17276 }),
17277
17278 target: target.map(|envelope| {
17279 ::fidl_next::FromWire::from_wire(unsafe {
17280 envelope.read_unchecked::<crate::wire::Ref<'de>>()
17281 })
17282 }),
17283
17284 target_name: target_name.map(|envelope| {
17285 ::fidl_next::FromWire::from_wire(unsafe {
17286 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
17287 })
17288 }),
17289
17290 dependency_type: dependency_type.map(|envelope| {
17291 ::fidl_next::FromWire::from_wire(unsafe {
17292 envelope.read_unchecked::<crate::wire::DependencyType>()
17293 })
17294 }),
17295
17296 availability: availability.map(|envelope| {
17297 ::fidl_next::FromWire::from_wire(unsafe {
17298 envelope.read_unchecked::<crate::wire::Availability>()
17299 })
17300 }),
17301
17302 source_dictionary: source_dictionary.map(|envelope| {
17303 ::fidl_next::FromWire::from_wire(unsafe {
17304 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
17305 })
17306 }),
17307 }
17308 }
17309 }
17310
17311 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferDictionary<'de>> for OfferDictionary {
17312 #[inline]
17313 fn from_wire_ref(wire: &crate::wire::OfferDictionary<'de>) -> Self {
17314 Self {
17315 source: wire.table.get(1).map(|envelope| {
17316 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17317 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
17318 })
17319 }),
17320
17321 source_name: wire.table.get(2).map(|envelope| {
17322 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17323 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
17324 })
17325 }),
17326
17327 target: wire.table.get(3).map(|envelope| {
17328 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17329 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
17330 })
17331 }),
17332
17333 target_name: wire.table.get(4).map(|envelope| {
17334 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17335 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
17336 })
17337 }),
17338
17339 dependency_type: wire.table.get(5).map(|envelope| {
17340 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17341 envelope.deref_unchecked::<crate::wire::DependencyType>()
17342 })
17343 }),
17344
17345 availability: wire.table.get(6).map(|envelope| {
17346 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17347 envelope.deref_unchecked::<crate::wire::Availability>()
17348 })
17349 }),
17350
17351 source_dictionary: wire.table.get(7).map(|envelope| {
17352 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17353 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
17354 })
17355 }),
17356 }
17357 }
17358 }
17359
17360 #[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"]
17361 #[derive(PartialEq, Clone, Debug, Default)]
17362 pub struct OfferConfiguration {
17363 pub source: ::core::option::Option<crate::natural::Ref>,
17364
17365 pub source_name: ::core::option::Option<::std::string::String>,
17366
17367 pub target: ::core::option::Option<crate::natural::Ref>,
17368
17369 pub target_name: ::core::option::Option<::std::string::String>,
17370
17371 pub availability: ::core::option::Option<crate::natural::Availability>,
17372
17373 pub source_dictionary: ::core::option::Option<::std::string::String>,
17374 }
17375
17376 impl OfferConfiguration {
17377 fn __max_ordinal(&self) -> usize {
17378 if self.source_dictionary.is_some() {
17379 return 6;
17380 }
17381
17382 if self.availability.is_some() {
17383 return 5;
17384 }
17385
17386 if self.target_name.is_some() {
17387 return 4;
17388 }
17389
17390 if self.target.is_some() {
17391 return 3;
17392 }
17393
17394 if self.source_name.is_some() {
17395 return 2;
17396 }
17397
17398 if self.source.is_some() {
17399 return 1;
17400 }
17401
17402 0
17403 }
17404 }
17405
17406 unsafe impl<___E> ::fidl_next::Encode<crate::wire::OfferConfiguration<'static>, ___E>
17407 for OfferConfiguration
17408 where
17409 ___E: ::fidl_next::Encoder + ?Sized,
17410 {
17411 #[inline]
17412 fn encode(
17413 mut self,
17414 encoder: &mut ___E,
17415 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferConfiguration<'static>>,
17416 _: (),
17417 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17418 ::fidl_next::munge!(let crate::wire::OfferConfiguration { table } = out);
17419
17420 let max_ord = self.__max_ordinal();
17421
17422 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
17423 ::fidl_next::Wire::zero_padding(&mut out);
17424
17425 let mut preallocated =
17426 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
17427
17428 for i in 1..=max_ord {
17429 match i {
17430 6 => {
17431 if let Some(value) = self.source_dictionary.take() {
17432 ::fidl_next::WireEnvelope::encode_value::<
17433 ::fidl_next::WireString<'static>,
17434 ___E,
17435 >(
17436 value, preallocated.encoder, &mut out, 1024
17437 )?;
17438 } else {
17439 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17440 }
17441 }
17442
17443 5 => {
17444 if let Some(value) = self.availability.take() {
17445 ::fidl_next::WireEnvelope::encode_value::<
17446 crate::wire::Availability,
17447 ___E,
17448 >(
17449 value, preallocated.encoder, &mut out, ()
17450 )?;
17451 } else {
17452 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17453 }
17454 }
17455
17456 4 => {
17457 if let Some(value) = self.target_name.take() {
17458 ::fidl_next::WireEnvelope::encode_value::<
17459 ::fidl_next::WireString<'static>,
17460 ___E,
17461 >(
17462 value, preallocated.encoder, &mut out, 100
17463 )?;
17464 } else {
17465 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17466 }
17467 }
17468
17469 3 => {
17470 if let Some(value) = self.target.take() {
17471 ::fidl_next::WireEnvelope::encode_value::<
17472 crate::wire::Ref<'static>,
17473 ___E,
17474 >(
17475 value, preallocated.encoder, &mut out, ()
17476 )?;
17477 } else {
17478 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17479 }
17480 }
17481
17482 2 => {
17483 if let Some(value) = self.source_name.take() {
17484 ::fidl_next::WireEnvelope::encode_value::<
17485 ::fidl_next::WireString<'static>,
17486 ___E,
17487 >(
17488 value, preallocated.encoder, &mut out, 100
17489 )?;
17490 } else {
17491 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17492 }
17493 }
17494
17495 1 => {
17496 if let Some(value) = self.source.take() {
17497 ::fidl_next::WireEnvelope::encode_value::<
17498 crate::wire::Ref<'static>,
17499 ___E,
17500 >(
17501 value, preallocated.encoder, &mut out, ()
17502 )?;
17503 } else {
17504 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17505 }
17506 }
17507
17508 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
17509 }
17510 unsafe {
17511 preallocated.write_next(out.assume_init_ref());
17512 }
17513 }
17514
17515 ::fidl_next::WireTable::encode_len(table, max_ord);
17516
17517 Ok(())
17518 }
17519 }
17520
17521 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::OfferConfiguration<'static>, ___E>
17522 for &'a OfferConfiguration
17523 where
17524 ___E: ::fidl_next::Encoder + ?Sized,
17525 {
17526 #[inline]
17527 fn encode(
17528 self,
17529 encoder: &mut ___E,
17530 out: &mut ::core::mem::MaybeUninit<crate::wire::OfferConfiguration<'static>>,
17531 _: (),
17532 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17533 ::fidl_next::munge!(let crate::wire::OfferConfiguration { table } = out);
17534
17535 let max_ord = self.__max_ordinal();
17536
17537 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
17538 ::fidl_next::Wire::zero_padding(&mut out);
17539
17540 let mut preallocated =
17541 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
17542
17543 for i in 1..=max_ord {
17544 match i {
17545 6 => {
17546 if let Some(value) = &self.source_dictionary {
17547 ::fidl_next::WireEnvelope::encode_value::<
17548 ::fidl_next::WireString<'static>,
17549 ___E,
17550 >(
17551 value, preallocated.encoder, &mut out, 1024
17552 )?;
17553 } else {
17554 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17555 }
17556 }
17557
17558 5 => {
17559 if let Some(value) = &self.availability {
17560 ::fidl_next::WireEnvelope::encode_value::<
17561 crate::wire::Availability,
17562 ___E,
17563 >(
17564 value, preallocated.encoder, &mut out, ()
17565 )?;
17566 } else {
17567 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17568 }
17569 }
17570
17571 4 => {
17572 if let Some(value) = &self.target_name {
17573 ::fidl_next::WireEnvelope::encode_value::<
17574 ::fidl_next::WireString<'static>,
17575 ___E,
17576 >(
17577 value, preallocated.encoder, &mut out, 100
17578 )?;
17579 } else {
17580 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17581 }
17582 }
17583
17584 3 => {
17585 if let Some(value) = &self.target {
17586 ::fidl_next::WireEnvelope::encode_value::<
17587 crate::wire::Ref<'static>,
17588 ___E,
17589 >(
17590 value, preallocated.encoder, &mut out, ()
17591 )?;
17592 } else {
17593 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17594 }
17595 }
17596
17597 2 => {
17598 if let Some(value) = &self.source_name {
17599 ::fidl_next::WireEnvelope::encode_value::<
17600 ::fidl_next::WireString<'static>,
17601 ___E,
17602 >(
17603 value, preallocated.encoder, &mut out, 100
17604 )?;
17605 } else {
17606 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17607 }
17608 }
17609
17610 1 => {
17611 if let Some(value) = &self.source {
17612 ::fidl_next::WireEnvelope::encode_value::<
17613 crate::wire::Ref<'static>,
17614 ___E,
17615 >(
17616 value, preallocated.encoder, &mut out, ()
17617 )?;
17618 } else {
17619 ::fidl_next::WireEnvelope::encode_zero(&mut out)
17620 }
17621 }
17622
17623 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
17624 }
17625 unsafe {
17626 preallocated.write_next(out.assume_init_ref());
17627 }
17628 }
17629
17630 ::fidl_next::WireTable::encode_len(table, max_ord);
17631
17632 Ok(())
17633 }
17634 }
17635
17636 impl<'de> ::fidl_next::FromWire<crate::wire::OfferConfiguration<'de>> for OfferConfiguration {
17637 #[inline]
17638 fn from_wire(wire_: crate::wire::OfferConfiguration<'de>) -> Self {
17639 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
17640
17641 let source = wire_.table.get(1);
17642
17643 let source_name = wire_.table.get(2);
17644
17645 let target = wire_.table.get(3);
17646
17647 let target_name = wire_.table.get(4);
17648
17649 let availability = wire_.table.get(5);
17650
17651 let source_dictionary = wire_.table.get(6);
17652
17653 Self {
17654 source: source.map(|envelope| {
17655 ::fidl_next::FromWire::from_wire(unsafe {
17656 envelope.read_unchecked::<crate::wire::Ref<'de>>()
17657 })
17658 }),
17659
17660 source_name: source_name.map(|envelope| {
17661 ::fidl_next::FromWire::from_wire(unsafe {
17662 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
17663 })
17664 }),
17665
17666 target: target.map(|envelope| {
17667 ::fidl_next::FromWire::from_wire(unsafe {
17668 envelope.read_unchecked::<crate::wire::Ref<'de>>()
17669 })
17670 }),
17671
17672 target_name: target_name.map(|envelope| {
17673 ::fidl_next::FromWire::from_wire(unsafe {
17674 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
17675 })
17676 }),
17677
17678 availability: availability.map(|envelope| {
17679 ::fidl_next::FromWire::from_wire(unsafe {
17680 envelope.read_unchecked::<crate::wire::Availability>()
17681 })
17682 }),
17683
17684 source_dictionary: source_dictionary.map(|envelope| {
17685 ::fidl_next::FromWire::from_wire(unsafe {
17686 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
17687 })
17688 }),
17689 }
17690 }
17691 }
17692
17693 impl<'de> ::fidl_next::FromWireRef<crate::wire::OfferConfiguration<'de>> for OfferConfiguration {
17694 #[inline]
17695 fn from_wire_ref(wire: &crate::wire::OfferConfiguration<'de>) -> Self {
17696 Self {
17697 source: wire.table.get(1).map(|envelope| {
17698 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17699 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
17700 })
17701 }),
17702
17703 source_name: wire.table.get(2).map(|envelope| {
17704 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17705 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
17706 })
17707 }),
17708
17709 target: wire.table.get(3).map(|envelope| {
17710 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17711 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
17712 })
17713 }),
17714
17715 target_name: wire.table.get(4).map(|envelope| {
17716 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17717 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
17718 })
17719 }),
17720
17721 availability: wire.table.get(5).map(|envelope| {
17722 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17723 envelope.deref_unchecked::<crate::wire::Availability>()
17724 })
17725 }),
17726
17727 source_dictionary: wire.table.get(6).map(|envelope| {
17728 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
17729 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
17730 })
17731 }),
17732 }
17733 }
17734 }
17735
17736 #[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"]
17737 #[derive(PartialEq, Clone, Debug)]
17738 pub enum Offer {
17739 Service(crate::natural::OfferService),
17740
17741 Protocol(crate::natural::OfferProtocol),
17742
17743 Directory(crate::natural::OfferDirectory),
17744
17745 Storage(crate::natural::OfferStorage),
17746
17747 Runner(crate::natural::OfferRunner),
17748
17749 Resolver(crate::natural::OfferResolver),
17750
17751 EventStream(crate::natural::OfferEventStream),
17752
17753 Dictionary(crate::natural::OfferDictionary),
17754
17755 Config(crate::natural::OfferConfiguration),
17756
17757 UnknownOrdinal_(u64),
17758 }
17759
17760 impl Offer {
17761 pub fn is_unknown(&self) -> bool {
17762 #[allow(unreachable_patterns)]
17763 match self {
17764 Self::UnknownOrdinal_(_) => true,
17765 _ => false,
17766 }
17767 }
17768 }
17769
17770 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Offer<'static>, ___E> for Offer
17771 where
17772 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17773 ___E: ::fidl_next::Encoder,
17774 {
17775 #[inline]
17776 fn encode(
17777 self,
17778 encoder: &mut ___E,
17779 out: &mut ::core::mem::MaybeUninit<crate::wire::Offer<'static>>,
17780 _: (),
17781 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17782 ::fidl_next::munge!(let crate::wire::Offer { raw, _phantom: _ } = out);
17783
17784 match self {
17785 Self::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
17786 ___E,
17787 crate::wire::OfferService<'static>,
17788 >(value, 1, encoder, raw, ())?,
17789
17790 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
17791 ___E,
17792 crate::wire::OfferProtocol<'static>,
17793 >(value, 2, encoder, raw, ())?,
17794
17795 Self::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
17796 ___E,
17797 crate::wire::OfferDirectory<'static>,
17798 >(value, 3, encoder, raw, ())?,
17799
17800 Self::Storage(value) => ::fidl_next::RawWireUnion::encode_as::<
17801 ___E,
17802 crate::wire::OfferStorage<'static>,
17803 >(value, 4, encoder, raw, ())?,
17804
17805 Self::Runner(value) => ::fidl_next::RawWireUnion::encode_as::<
17806 ___E,
17807 crate::wire::OfferRunner<'static>,
17808 >(value, 5, encoder, raw, ())?,
17809
17810 Self::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<
17811 ___E,
17812 crate::wire::OfferResolver<'static>,
17813 >(value, 6, encoder, raw, ())?,
17814
17815 Self::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
17816 ___E,
17817 crate::wire::OfferEventStream<'static>,
17818 >(value, 8, encoder, raw, ())?,
17819
17820 Self::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
17821 ___E,
17822 crate::wire::OfferDictionary<'static>,
17823 >(value, 9, encoder, raw, ())?,
17824
17825 Self::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
17826 ___E,
17827 crate::wire::OfferConfiguration<'static>,
17828 >(value, 10, encoder, raw, ())?,
17829
17830 Self::UnknownOrdinal_(ordinal) => {
17831 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
17832 }
17833 }
17834
17835 Ok(())
17836 }
17837 }
17838
17839 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Offer<'static>, ___E> for &'a Offer
17840 where
17841 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
17842 ___E: ::fidl_next::Encoder,
17843 {
17844 #[inline]
17845 fn encode(
17846 self,
17847 encoder: &mut ___E,
17848 out: &mut ::core::mem::MaybeUninit<crate::wire::Offer<'static>>,
17849 _: (),
17850 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17851 ::fidl_next::munge!(let crate::wire::Offer { raw, _phantom: _ } = out);
17852
17853 match self {
17854 Offer::Service(value) => ::fidl_next::RawWireUnion::encode_as::<
17855 ___E,
17856 crate::wire::OfferService<'static>,
17857 >(value, 1, encoder, raw, ())?,
17858
17859 Offer::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
17860 ___E,
17861 crate::wire::OfferProtocol<'static>,
17862 >(value, 2, encoder, raw, ())?,
17863
17864 Offer::Directory(value) => ::fidl_next::RawWireUnion::encode_as::<
17865 ___E,
17866 crate::wire::OfferDirectory<'static>,
17867 >(value, 3, encoder, raw, ())?,
17868
17869 Offer::Storage(value) => ::fidl_next::RawWireUnion::encode_as::<
17870 ___E,
17871 crate::wire::OfferStorage<'static>,
17872 >(value, 4, encoder, raw, ())?,
17873
17874 Offer::Runner(value) => ::fidl_next::RawWireUnion::encode_as::<
17875 ___E,
17876 crate::wire::OfferRunner<'static>,
17877 >(value, 5, encoder, raw, ())?,
17878
17879 Offer::Resolver(value) => ::fidl_next::RawWireUnion::encode_as::<
17880 ___E,
17881 crate::wire::OfferResolver<'static>,
17882 >(value, 6, encoder, raw, ())?,
17883
17884 Offer::EventStream(value) => ::fidl_next::RawWireUnion::encode_as::<
17885 ___E,
17886 crate::wire::OfferEventStream<'static>,
17887 >(value, 8, encoder, raw, ())?,
17888
17889 Offer::Dictionary(value) => ::fidl_next::RawWireUnion::encode_as::<
17890 ___E,
17891 crate::wire::OfferDictionary<'static>,
17892 >(value, 9, encoder, raw, ())?,
17893
17894 Offer::Config(value) => ::fidl_next::RawWireUnion::encode_as::<
17895 ___E,
17896 crate::wire::OfferConfiguration<'static>,
17897 >(value, 10, encoder, raw, ())?,
17898
17899 Offer::UnknownOrdinal_(ordinal) => {
17900 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
17901 }
17902 }
17903
17904 Ok(())
17905 }
17906 }
17907
17908 unsafe impl<___E> ::fidl_next::EncodeOption<crate::wire_optional::Offer<'static>, ___E> for Offer
17909 where
17910 ___E: ?Sized,
17911 Offer: ::fidl_next::Encode<crate::wire::Offer<'static>, ___E>,
17912 {
17913 #[inline]
17914 fn encode_option(
17915 this: ::core::option::Option<Self>,
17916 encoder: &mut ___E,
17917 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Offer<'static>>,
17918 _: (),
17919 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17920 ::fidl_next::munge!(let crate::wire_optional::Offer { raw, _phantom: _ } = &mut *out);
17921
17922 if let Some(inner) = this {
17923 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
17924 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
17925 } else {
17926 ::fidl_next::RawWireUnion::encode_absent(raw);
17927 }
17928
17929 Ok(())
17930 }
17931 }
17932
17933 unsafe impl<'a, ___E> ::fidl_next::EncodeOption<crate::wire_optional::Offer<'static>, ___E>
17934 for &'a Offer
17935 where
17936 ___E: ?Sized,
17937 &'a Offer: ::fidl_next::Encode<crate::wire::Offer<'static>, ___E>,
17938 {
17939 #[inline]
17940 fn encode_option(
17941 this: ::core::option::Option<Self>,
17942 encoder: &mut ___E,
17943 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::Offer<'static>>,
17944 _: (),
17945 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
17946 ::fidl_next::munge!(let crate::wire_optional::Offer { raw, _phantom: _ } = &mut *out);
17947
17948 if let Some(inner) = this {
17949 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
17950 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
17951 } else {
17952 ::fidl_next::RawWireUnion::encode_absent(raw);
17953 }
17954
17955 Ok(())
17956 }
17957 }
17958
17959 impl<'de> ::fidl_next::FromWire<crate::wire::Offer<'de>> for Offer {
17960 #[inline]
17961 fn from_wire(wire: crate::wire::Offer<'de>) -> Self {
17962 let wire = ::core::mem::ManuallyDrop::new(wire);
17963 match wire.raw.ordinal() {
17964 1 => Self::Service(::fidl_next::FromWire::from_wire(unsafe {
17965 wire.raw.get().read_unchecked::<crate::wire::OfferService<'de>>()
17966 })),
17967
17968 2 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
17969 wire.raw.get().read_unchecked::<crate::wire::OfferProtocol<'de>>()
17970 })),
17971
17972 3 => Self::Directory(::fidl_next::FromWire::from_wire(unsafe {
17973 wire.raw.get().read_unchecked::<crate::wire::OfferDirectory<'de>>()
17974 })),
17975
17976 4 => Self::Storage(::fidl_next::FromWire::from_wire(unsafe {
17977 wire.raw.get().read_unchecked::<crate::wire::OfferStorage<'de>>()
17978 })),
17979
17980 5 => Self::Runner(::fidl_next::FromWire::from_wire(unsafe {
17981 wire.raw.get().read_unchecked::<crate::wire::OfferRunner<'de>>()
17982 })),
17983
17984 6 => Self::Resolver(::fidl_next::FromWire::from_wire(unsafe {
17985 wire.raw.get().read_unchecked::<crate::wire::OfferResolver<'de>>()
17986 })),
17987
17988 8 => Self::EventStream(::fidl_next::FromWire::from_wire(unsafe {
17989 wire.raw.get().read_unchecked::<crate::wire::OfferEventStream<'de>>()
17990 })),
17991
17992 9 => Self::Dictionary(::fidl_next::FromWire::from_wire(unsafe {
17993 wire.raw.get().read_unchecked::<crate::wire::OfferDictionary<'de>>()
17994 })),
17995
17996 10 => Self::Config(::fidl_next::FromWire::from_wire(unsafe {
17997 wire.raw.get().read_unchecked::<crate::wire::OfferConfiguration<'de>>()
17998 })),
17999
18000 ord => return Self::UnknownOrdinal_(ord as u64),
18001 }
18002 }
18003 }
18004
18005 impl<'de> ::fidl_next::FromWireRef<crate::wire::Offer<'de>> for Offer {
18006 #[inline]
18007 fn from_wire_ref(wire: &crate::wire::Offer<'de>) -> Self {
18008 match wire.raw.ordinal() {
18009 1 => Self::Service(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18010 wire.raw.get().deref_unchecked::<crate::wire::OfferService<'de>>()
18011 })),
18012
18013 2 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18014 wire.raw.get().deref_unchecked::<crate::wire::OfferProtocol<'de>>()
18015 })),
18016
18017 3 => Self::Directory(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18018 wire.raw.get().deref_unchecked::<crate::wire::OfferDirectory<'de>>()
18019 })),
18020
18021 4 => Self::Storage(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18022 wire.raw.get().deref_unchecked::<crate::wire::OfferStorage<'de>>()
18023 })),
18024
18025 5 => Self::Runner(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18026 wire.raw.get().deref_unchecked::<crate::wire::OfferRunner<'de>>()
18027 })),
18028
18029 6 => Self::Resolver(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18030 wire.raw.get().deref_unchecked::<crate::wire::OfferResolver<'de>>()
18031 })),
18032
18033 8 => Self::EventStream(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18034 wire.raw.get().deref_unchecked::<crate::wire::OfferEventStream<'de>>()
18035 })),
18036
18037 9 => Self::Dictionary(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18038 wire.raw.get().deref_unchecked::<crate::wire::OfferDictionary<'de>>()
18039 })),
18040
18041 10 => Self::Config(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18042 wire.raw.get().deref_unchecked::<crate::wire::OfferConfiguration<'de>>()
18043 })),
18044
18045 ord => return Self::UnknownOrdinal_(ord as u64),
18046 }
18047 }
18048 }
18049
18050 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Offer<'de>> for Offer {
18051 #[inline]
18052 fn from_wire_option(
18053 wire: crate::wire_optional::Offer<'de>,
18054 ) -> ::core::option::Option<Self> {
18055 if let Some(inner) = wire.into_option() {
18056 Some(::fidl_next::FromWire::from_wire(inner))
18057 } else {
18058 None
18059 }
18060 }
18061 }
18062
18063 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::Offer<'de>> for Box<Offer> {
18064 #[inline]
18065 fn from_wire_option(
18066 wire: crate::wire_optional::Offer<'de>,
18067 ) -> ::core::option::Option<Self> {
18068 <
18069 Offer as ::fidl_next::FromWireOption<crate::wire_optional::Offer<'de>>
18070 >::from_wire_option(wire).map(Box::new)
18071 }
18072 }
18073
18074 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::Offer<'de>> for Box<Offer> {
18075 #[inline]
18076 fn from_wire_option_ref(
18077 wire: &crate::wire_optional::Offer<'de>,
18078 ) -> ::core::option::Option<Self> {
18079 if let Some(inner) = wire.as_ref() {
18080 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
18081 } else {
18082 None
18083 }
18084 }
18085 }
18086
18087 #[doc = " A repository of the runners available in an environment.\n"]
18088 #[derive(PartialEq, Clone, Debug, Default)]
18089 pub struct RunnerRegistration {
18090 pub source_name: ::core::option::Option<::std::string::String>,
18091
18092 pub source: ::core::option::Option<crate::natural::Ref>,
18093
18094 pub target_name: ::core::option::Option<::std::string::String>,
18095 }
18096
18097 impl RunnerRegistration {
18098 fn __max_ordinal(&self) -> usize {
18099 if self.target_name.is_some() {
18100 return 3;
18101 }
18102
18103 if self.source.is_some() {
18104 return 2;
18105 }
18106
18107 if self.source_name.is_some() {
18108 return 1;
18109 }
18110
18111 0
18112 }
18113 }
18114
18115 unsafe impl<___E> ::fidl_next::Encode<crate::wire::RunnerRegistration<'static>, ___E>
18116 for RunnerRegistration
18117 where
18118 ___E: ::fidl_next::Encoder + ?Sized,
18119 {
18120 #[inline]
18121 fn encode(
18122 mut self,
18123 encoder: &mut ___E,
18124 out: &mut ::core::mem::MaybeUninit<crate::wire::RunnerRegistration<'static>>,
18125 _: (),
18126 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18127 ::fidl_next::munge!(let crate::wire::RunnerRegistration { table } = out);
18128
18129 let max_ord = self.__max_ordinal();
18130
18131 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
18132 ::fidl_next::Wire::zero_padding(&mut out);
18133
18134 let mut preallocated =
18135 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
18136
18137 for i in 1..=max_ord {
18138 match i {
18139 3 => {
18140 if let Some(value) = self.target_name.take() {
18141 ::fidl_next::WireEnvelope::encode_value::<
18142 ::fidl_next::WireString<'static>,
18143 ___E,
18144 >(
18145 value, preallocated.encoder, &mut out, 100
18146 )?;
18147 } else {
18148 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18149 }
18150 }
18151
18152 2 => {
18153 if let Some(value) = self.source.take() {
18154 ::fidl_next::WireEnvelope::encode_value::<
18155 crate::wire::Ref<'static>,
18156 ___E,
18157 >(
18158 value, preallocated.encoder, &mut out, ()
18159 )?;
18160 } else {
18161 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18162 }
18163 }
18164
18165 1 => {
18166 if let Some(value) = self.source_name.take() {
18167 ::fidl_next::WireEnvelope::encode_value::<
18168 ::fidl_next::WireString<'static>,
18169 ___E,
18170 >(
18171 value, preallocated.encoder, &mut out, 100
18172 )?;
18173 } else {
18174 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18175 }
18176 }
18177
18178 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
18179 }
18180 unsafe {
18181 preallocated.write_next(out.assume_init_ref());
18182 }
18183 }
18184
18185 ::fidl_next::WireTable::encode_len(table, max_ord);
18186
18187 Ok(())
18188 }
18189 }
18190
18191 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::RunnerRegistration<'static>, ___E>
18192 for &'a RunnerRegistration
18193 where
18194 ___E: ::fidl_next::Encoder + ?Sized,
18195 {
18196 #[inline]
18197 fn encode(
18198 self,
18199 encoder: &mut ___E,
18200 out: &mut ::core::mem::MaybeUninit<crate::wire::RunnerRegistration<'static>>,
18201 _: (),
18202 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18203 ::fidl_next::munge!(let crate::wire::RunnerRegistration { table } = out);
18204
18205 let max_ord = self.__max_ordinal();
18206
18207 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
18208 ::fidl_next::Wire::zero_padding(&mut out);
18209
18210 let mut preallocated =
18211 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
18212
18213 for i in 1..=max_ord {
18214 match i {
18215 3 => {
18216 if let Some(value) = &self.target_name {
18217 ::fidl_next::WireEnvelope::encode_value::<
18218 ::fidl_next::WireString<'static>,
18219 ___E,
18220 >(
18221 value, preallocated.encoder, &mut out, 100
18222 )?;
18223 } else {
18224 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18225 }
18226 }
18227
18228 2 => {
18229 if let Some(value) = &self.source {
18230 ::fidl_next::WireEnvelope::encode_value::<
18231 crate::wire::Ref<'static>,
18232 ___E,
18233 >(
18234 value, preallocated.encoder, &mut out, ()
18235 )?;
18236 } else {
18237 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18238 }
18239 }
18240
18241 1 => {
18242 if let Some(value) = &self.source_name {
18243 ::fidl_next::WireEnvelope::encode_value::<
18244 ::fidl_next::WireString<'static>,
18245 ___E,
18246 >(
18247 value, preallocated.encoder, &mut out, 100
18248 )?;
18249 } else {
18250 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18251 }
18252 }
18253
18254 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
18255 }
18256 unsafe {
18257 preallocated.write_next(out.assume_init_ref());
18258 }
18259 }
18260
18261 ::fidl_next::WireTable::encode_len(table, max_ord);
18262
18263 Ok(())
18264 }
18265 }
18266
18267 impl<'de> ::fidl_next::FromWire<crate::wire::RunnerRegistration<'de>> for RunnerRegistration {
18268 #[inline]
18269 fn from_wire(wire_: crate::wire::RunnerRegistration<'de>) -> Self {
18270 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
18271
18272 let source_name = wire_.table.get(1);
18273
18274 let source = wire_.table.get(2);
18275
18276 let target_name = wire_.table.get(3);
18277
18278 Self {
18279 source_name: source_name.map(|envelope| {
18280 ::fidl_next::FromWire::from_wire(unsafe {
18281 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
18282 })
18283 }),
18284
18285 source: source.map(|envelope| {
18286 ::fidl_next::FromWire::from_wire(unsafe {
18287 envelope.read_unchecked::<crate::wire::Ref<'de>>()
18288 })
18289 }),
18290
18291 target_name: target_name.map(|envelope| {
18292 ::fidl_next::FromWire::from_wire(unsafe {
18293 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
18294 })
18295 }),
18296 }
18297 }
18298 }
18299
18300 impl<'de> ::fidl_next::FromWireRef<crate::wire::RunnerRegistration<'de>> for RunnerRegistration {
18301 #[inline]
18302 fn from_wire_ref(wire: &crate::wire::RunnerRegistration<'de>) -> Self {
18303 Self {
18304 source_name: wire.table.get(1).map(|envelope| {
18305 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18306 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
18307 })
18308 }),
18309
18310 source: wire.table.get(2).map(|envelope| {
18311 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18312 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
18313 })
18314 }),
18315
18316 target_name: wire.table.get(3).map(|envelope| {
18317 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18318 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
18319 })
18320 }),
18321 }
18322 }
18323 }
18324
18325 #[doc = " A mapping of URL scheme to resolver name.\n"]
18326 #[derive(PartialEq, Clone, Debug, Default)]
18327 pub struct ResolverRegistration {
18328 pub resolver: ::core::option::Option<::std::string::String>,
18329
18330 pub source: ::core::option::Option<crate::natural::Ref>,
18331
18332 pub scheme: ::core::option::Option<::std::string::String>,
18333 }
18334
18335 impl ResolverRegistration {
18336 fn __max_ordinal(&self) -> usize {
18337 if self.scheme.is_some() {
18338 return 3;
18339 }
18340
18341 if self.source.is_some() {
18342 return 2;
18343 }
18344
18345 if self.resolver.is_some() {
18346 return 1;
18347 }
18348
18349 0
18350 }
18351 }
18352
18353 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ResolverRegistration<'static>, ___E>
18354 for ResolverRegistration
18355 where
18356 ___E: ::fidl_next::Encoder + ?Sized,
18357 {
18358 #[inline]
18359 fn encode(
18360 mut self,
18361 encoder: &mut ___E,
18362 out: &mut ::core::mem::MaybeUninit<crate::wire::ResolverRegistration<'static>>,
18363 _: (),
18364 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18365 ::fidl_next::munge!(let crate::wire::ResolverRegistration { table } = out);
18366
18367 let max_ord = self.__max_ordinal();
18368
18369 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
18370 ::fidl_next::Wire::zero_padding(&mut out);
18371
18372 let mut preallocated =
18373 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
18374
18375 for i in 1..=max_ord {
18376 match i {
18377 3 => {
18378 if let Some(value) = self.scheme.take() {
18379 ::fidl_next::WireEnvelope::encode_value::<
18380 ::fidl_next::WireString<'static>,
18381 ___E,
18382 >(
18383 value, preallocated.encoder, &mut out, 100
18384 )?;
18385 } else {
18386 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18387 }
18388 }
18389
18390 2 => {
18391 if let Some(value) = self.source.take() {
18392 ::fidl_next::WireEnvelope::encode_value::<
18393 crate::wire::Ref<'static>,
18394 ___E,
18395 >(
18396 value, preallocated.encoder, &mut out, ()
18397 )?;
18398 } else {
18399 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18400 }
18401 }
18402
18403 1 => {
18404 if let Some(value) = self.resolver.take() {
18405 ::fidl_next::WireEnvelope::encode_value::<
18406 ::fidl_next::WireString<'static>,
18407 ___E,
18408 >(
18409 value, preallocated.encoder, &mut out, 100
18410 )?;
18411 } else {
18412 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18413 }
18414 }
18415
18416 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
18417 }
18418 unsafe {
18419 preallocated.write_next(out.assume_init_ref());
18420 }
18421 }
18422
18423 ::fidl_next::WireTable::encode_len(table, max_ord);
18424
18425 Ok(())
18426 }
18427 }
18428
18429 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ResolverRegistration<'static>, ___E>
18430 for &'a ResolverRegistration
18431 where
18432 ___E: ::fidl_next::Encoder + ?Sized,
18433 {
18434 #[inline]
18435 fn encode(
18436 self,
18437 encoder: &mut ___E,
18438 out: &mut ::core::mem::MaybeUninit<crate::wire::ResolverRegistration<'static>>,
18439 _: (),
18440 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18441 ::fidl_next::munge!(let crate::wire::ResolverRegistration { table } = out);
18442
18443 let max_ord = self.__max_ordinal();
18444
18445 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
18446 ::fidl_next::Wire::zero_padding(&mut out);
18447
18448 let mut preallocated =
18449 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
18450
18451 for i in 1..=max_ord {
18452 match i {
18453 3 => {
18454 if let Some(value) = &self.scheme {
18455 ::fidl_next::WireEnvelope::encode_value::<
18456 ::fidl_next::WireString<'static>,
18457 ___E,
18458 >(
18459 value, preallocated.encoder, &mut out, 100
18460 )?;
18461 } else {
18462 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18463 }
18464 }
18465
18466 2 => {
18467 if let Some(value) = &self.source {
18468 ::fidl_next::WireEnvelope::encode_value::<
18469 crate::wire::Ref<'static>,
18470 ___E,
18471 >(
18472 value, preallocated.encoder, &mut out, ()
18473 )?;
18474 } else {
18475 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18476 }
18477 }
18478
18479 1 => {
18480 if let Some(value) = &self.resolver {
18481 ::fidl_next::WireEnvelope::encode_value::<
18482 ::fidl_next::WireString<'static>,
18483 ___E,
18484 >(
18485 value, preallocated.encoder, &mut out, 100
18486 )?;
18487 } else {
18488 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18489 }
18490 }
18491
18492 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
18493 }
18494 unsafe {
18495 preallocated.write_next(out.assume_init_ref());
18496 }
18497 }
18498
18499 ::fidl_next::WireTable::encode_len(table, max_ord);
18500
18501 Ok(())
18502 }
18503 }
18504
18505 impl<'de> ::fidl_next::FromWire<crate::wire::ResolverRegistration<'de>> for ResolverRegistration {
18506 #[inline]
18507 fn from_wire(wire_: crate::wire::ResolverRegistration<'de>) -> Self {
18508 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
18509
18510 let resolver = wire_.table.get(1);
18511
18512 let source = wire_.table.get(2);
18513
18514 let scheme = wire_.table.get(3);
18515
18516 Self {
18517 resolver: resolver.map(|envelope| {
18518 ::fidl_next::FromWire::from_wire(unsafe {
18519 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
18520 })
18521 }),
18522
18523 source: source.map(|envelope| {
18524 ::fidl_next::FromWire::from_wire(unsafe {
18525 envelope.read_unchecked::<crate::wire::Ref<'de>>()
18526 })
18527 }),
18528
18529 scheme: scheme.map(|envelope| {
18530 ::fidl_next::FromWire::from_wire(unsafe {
18531 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
18532 })
18533 }),
18534 }
18535 }
18536 }
18537
18538 impl<'de> ::fidl_next::FromWireRef<crate::wire::ResolverRegistration<'de>>
18539 for ResolverRegistration
18540 {
18541 #[inline]
18542 fn from_wire_ref(wire: &crate::wire::ResolverRegistration<'de>) -> Self {
18543 Self {
18544 resolver: wire.table.get(1).map(|envelope| {
18545 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18546 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
18547 })
18548 }),
18549
18550 source: wire.table.get(2).map(|envelope| {
18551 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18552 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
18553 })
18554 }),
18555
18556 scheme: wire.table.get(3).map(|envelope| {
18557 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18558 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
18559 })
18560 }),
18561 }
18562 }
18563 }
18564
18565 #[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"]
18566 #[derive(PartialEq, Clone, Debug, Default)]
18567 pub struct DebugProtocolRegistration {
18568 pub source: ::core::option::Option<crate::natural::Ref>,
18569
18570 pub source_name: ::core::option::Option<::std::string::String>,
18571
18572 pub target_name: ::core::option::Option<::std::string::String>,
18573 }
18574
18575 impl DebugProtocolRegistration {
18576 fn __max_ordinal(&self) -> usize {
18577 if self.target_name.is_some() {
18578 return 3;
18579 }
18580
18581 if self.source_name.is_some() {
18582 return 2;
18583 }
18584
18585 if self.source.is_some() {
18586 return 1;
18587 }
18588
18589 0
18590 }
18591 }
18592
18593 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DebugProtocolRegistration<'static>, ___E>
18594 for DebugProtocolRegistration
18595 where
18596 ___E: ::fidl_next::Encoder + ?Sized,
18597 {
18598 #[inline]
18599 fn encode(
18600 mut self,
18601 encoder: &mut ___E,
18602 out: &mut ::core::mem::MaybeUninit<crate::wire::DebugProtocolRegistration<'static>>,
18603 _: (),
18604 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18605 ::fidl_next::munge!(let crate::wire::DebugProtocolRegistration { table } = out);
18606
18607 let max_ord = self.__max_ordinal();
18608
18609 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
18610 ::fidl_next::Wire::zero_padding(&mut out);
18611
18612 let mut preallocated =
18613 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
18614
18615 for i in 1..=max_ord {
18616 match i {
18617 3 => {
18618 if let Some(value) = self.target_name.take() {
18619 ::fidl_next::WireEnvelope::encode_value::<
18620 ::fidl_next::WireString<'static>,
18621 ___E,
18622 >(
18623 value, preallocated.encoder, &mut out, 100
18624 )?;
18625 } else {
18626 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18627 }
18628 }
18629
18630 2 => {
18631 if let Some(value) = self.source_name.take() {
18632 ::fidl_next::WireEnvelope::encode_value::<
18633 ::fidl_next::WireString<'static>,
18634 ___E,
18635 >(
18636 value, preallocated.encoder, &mut out, 100
18637 )?;
18638 } else {
18639 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18640 }
18641 }
18642
18643 1 => {
18644 if let Some(value) = self.source.take() {
18645 ::fidl_next::WireEnvelope::encode_value::<
18646 crate::wire::Ref<'static>,
18647 ___E,
18648 >(
18649 value, preallocated.encoder, &mut out, ()
18650 )?;
18651 } else {
18652 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18653 }
18654 }
18655
18656 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
18657 }
18658 unsafe {
18659 preallocated.write_next(out.assume_init_ref());
18660 }
18661 }
18662
18663 ::fidl_next::WireTable::encode_len(table, max_ord);
18664
18665 Ok(())
18666 }
18667 }
18668
18669 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DebugProtocolRegistration<'static>, ___E>
18670 for &'a DebugProtocolRegistration
18671 where
18672 ___E: ::fidl_next::Encoder + ?Sized,
18673 {
18674 #[inline]
18675 fn encode(
18676 self,
18677 encoder: &mut ___E,
18678 out: &mut ::core::mem::MaybeUninit<crate::wire::DebugProtocolRegistration<'static>>,
18679 _: (),
18680 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18681 ::fidl_next::munge!(let crate::wire::DebugProtocolRegistration { table } = out);
18682
18683 let max_ord = self.__max_ordinal();
18684
18685 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
18686 ::fidl_next::Wire::zero_padding(&mut out);
18687
18688 let mut preallocated =
18689 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
18690
18691 for i in 1..=max_ord {
18692 match i {
18693 3 => {
18694 if let Some(value) = &self.target_name {
18695 ::fidl_next::WireEnvelope::encode_value::<
18696 ::fidl_next::WireString<'static>,
18697 ___E,
18698 >(
18699 value, preallocated.encoder, &mut out, 100
18700 )?;
18701 } else {
18702 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18703 }
18704 }
18705
18706 2 => {
18707 if let Some(value) = &self.source_name {
18708 ::fidl_next::WireEnvelope::encode_value::<
18709 ::fidl_next::WireString<'static>,
18710 ___E,
18711 >(
18712 value, preallocated.encoder, &mut out, 100
18713 )?;
18714 } else {
18715 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18716 }
18717 }
18718
18719 1 => {
18720 if let Some(value) = &self.source {
18721 ::fidl_next::WireEnvelope::encode_value::<
18722 crate::wire::Ref<'static>,
18723 ___E,
18724 >(
18725 value, preallocated.encoder, &mut out, ()
18726 )?;
18727 } else {
18728 ::fidl_next::WireEnvelope::encode_zero(&mut out)
18729 }
18730 }
18731
18732 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
18733 }
18734 unsafe {
18735 preallocated.write_next(out.assume_init_ref());
18736 }
18737 }
18738
18739 ::fidl_next::WireTable::encode_len(table, max_ord);
18740
18741 Ok(())
18742 }
18743 }
18744
18745 impl<'de> ::fidl_next::FromWire<crate::wire::DebugProtocolRegistration<'de>>
18746 for DebugProtocolRegistration
18747 {
18748 #[inline]
18749 fn from_wire(wire_: crate::wire::DebugProtocolRegistration<'de>) -> Self {
18750 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
18751
18752 let source = wire_.table.get(1);
18753
18754 let source_name = wire_.table.get(2);
18755
18756 let target_name = wire_.table.get(3);
18757
18758 Self {
18759 source: source.map(|envelope| {
18760 ::fidl_next::FromWire::from_wire(unsafe {
18761 envelope.read_unchecked::<crate::wire::Ref<'de>>()
18762 })
18763 }),
18764
18765 source_name: source_name.map(|envelope| {
18766 ::fidl_next::FromWire::from_wire(unsafe {
18767 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
18768 })
18769 }),
18770
18771 target_name: target_name.map(|envelope| {
18772 ::fidl_next::FromWire::from_wire(unsafe {
18773 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
18774 })
18775 }),
18776 }
18777 }
18778 }
18779
18780 impl<'de> ::fidl_next::FromWireRef<crate::wire::DebugProtocolRegistration<'de>>
18781 for DebugProtocolRegistration
18782 {
18783 #[inline]
18784 fn from_wire_ref(wire: &crate::wire::DebugProtocolRegistration<'de>) -> Self {
18785 Self {
18786 source: wire.table.get(1).map(|envelope| {
18787 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18788 envelope.deref_unchecked::<crate::wire::Ref<'de>>()
18789 })
18790 }),
18791
18792 source_name: wire.table.get(2).map(|envelope| {
18793 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18794 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
18795 })
18796 }),
18797
18798 target_name: wire.table.get(3).map(|envelope| {
18799 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
18800 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
18801 })
18802 }),
18803 }
18804 }
18805 }
18806
18807 #[doc = " Declares a capability registered in the debug section of an environment.\n"]
18808 #[derive(PartialEq, Clone, Debug)]
18809 pub enum DebugRegistration {
18810 Protocol(crate::natural::DebugProtocolRegistration),
18811
18812 UnknownOrdinal_(u64),
18813 }
18814
18815 impl DebugRegistration {
18816 pub fn is_unknown(&self) -> bool {
18817 #[allow(unreachable_patterns)]
18818 match self {
18819 Self::UnknownOrdinal_(_) => true,
18820 _ => false,
18821 }
18822 }
18823 }
18824
18825 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DebugRegistration<'static>, ___E>
18826 for DebugRegistration
18827 where
18828 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18829 ___E: ::fidl_next::Encoder,
18830 {
18831 #[inline]
18832 fn encode(
18833 self,
18834 encoder: &mut ___E,
18835 out: &mut ::core::mem::MaybeUninit<crate::wire::DebugRegistration<'static>>,
18836 _: (),
18837 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18838 ::fidl_next::munge!(let crate::wire::DebugRegistration { raw, _phantom: _ } = out);
18839
18840 match self {
18841 Self::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
18842 ___E,
18843 crate::wire::DebugProtocolRegistration<'static>,
18844 >(value, 1, encoder, raw, ())?,
18845
18846 Self::UnknownOrdinal_(ordinal) => {
18847 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
18848 }
18849 }
18850
18851 Ok(())
18852 }
18853 }
18854
18855 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::DebugRegistration<'static>, ___E>
18856 for &'a DebugRegistration
18857 where
18858 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
18859 ___E: ::fidl_next::Encoder,
18860 {
18861 #[inline]
18862 fn encode(
18863 self,
18864 encoder: &mut ___E,
18865 out: &mut ::core::mem::MaybeUninit<crate::wire::DebugRegistration<'static>>,
18866 _: (),
18867 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18868 ::fidl_next::munge!(let crate::wire::DebugRegistration { raw, _phantom: _ } = out);
18869
18870 match self {
18871 DebugRegistration::Protocol(value) => ::fidl_next::RawWireUnion::encode_as::<
18872 ___E,
18873 crate::wire::DebugProtocolRegistration<'static>,
18874 >(value, 1, encoder, raw, ())?,
18875
18876 DebugRegistration::UnknownOrdinal_(ordinal) => {
18877 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
18878 }
18879 }
18880
18881 Ok(())
18882 }
18883 }
18884
18885 unsafe impl<___E>
18886 ::fidl_next::EncodeOption<crate::wire_optional::DebugRegistration<'static>, ___E>
18887 for DebugRegistration
18888 where
18889 ___E: ?Sized,
18890 DebugRegistration: ::fidl_next::Encode<crate::wire::DebugRegistration<'static>, ___E>,
18891 {
18892 #[inline]
18893 fn encode_option(
18894 this: ::core::option::Option<Self>,
18895 encoder: &mut ___E,
18896 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::DebugRegistration<'static>>,
18897 _: (),
18898 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18899 ::fidl_next::munge!(let crate::wire_optional::DebugRegistration { raw, _phantom: _ } = &mut *out);
18900
18901 if let Some(inner) = this {
18902 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
18903 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
18904 } else {
18905 ::fidl_next::RawWireUnion::encode_absent(raw);
18906 }
18907
18908 Ok(())
18909 }
18910 }
18911
18912 unsafe impl<'a, ___E>
18913 ::fidl_next::EncodeOption<crate::wire_optional::DebugRegistration<'static>, ___E>
18914 for &'a DebugRegistration
18915 where
18916 ___E: ?Sized,
18917 &'a DebugRegistration: ::fidl_next::Encode<crate::wire::DebugRegistration<'static>, ___E>,
18918 {
18919 #[inline]
18920 fn encode_option(
18921 this: ::core::option::Option<Self>,
18922 encoder: &mut ___E,
18923 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::DebugRegistration<'static>>,
18924 _: (),
18925 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
18926 ::fidl_next::munge!(let crate::wire_optional::DebugRegistration { raw, _phantom: _ } = &mut *out);
18927
18928 if let Some(inner) = this {
18929 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
18930 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
18931 } else {
18932 ::fidl_next::RawWireUnion::encode_absent(raw);
18933 }
18934
18935 Ok(())
18936 }
18937 }
18938
18939 impl<'de> ::fidl_next::FromWire<crate::wire::DebugRegistration<'de>> for DebugRegistration {
18940 #[inline]
18941 fn from_wire(wire: crate::wire::DebugRegistration<'de>) -> Self {
18942 let wire = ::core::mem::ManuallyDrop::new(wire);
18943 match wire.raw.ordinal() {
18944 1 => Self::Protocol(::fidl_next::FromWire::from_wire(unsafe {
18945 wire.raw.get().read_unchecked::<crate::wire::DebugProtocolRegistration<'de>>()
18946 })),
18947
18948 ord => return Self::UnknownOrdinal_(ord as u64),
18949 }
18950 }
18951 }
18952
18953 impl<'de> ::fidl_next::FromWireRef<crate::wire::DebugRegistration<'de>> for DebugRegistration {
18954 #[inline]
18955 fn from_wire_ref(wire: &crate::wire::DebugRegistration<'de>) -> Self {
18956 match wire.raw.ordinal() {
18957 1 => Self::Protocol(::fidl_next::FromWireRef::from_wire_ref(unsafe {
18958 wire.raw.get().deref_unchecked::<crate::wire::DebugProtocolRegistration<'de>>()
18959 })),
18960
18961 ord => return Self::UnknownOrdinal_(ord as u64),
18962 }
18963 }
18964 }
18965
18966 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::DebugRegistration<'de>>
18967 for DebugRegistration
18968 {
18969 #[inline]
18970 fn from_wire_option(
18971 wire: crate::wire_optional::DebugRegistration<'de>,
18972 ) -> ::core::option::Option<Self> {
18973 if let Some(inner) = wire.into_option() {
18974 Some(::fidl_next::FromWire::from_wire(inner))
18975 } else {
18976 None
18977 }
18978 }
18979 }
18980
18981 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::DebugRegistration<'de>>
18982 for Box<DebugRegistration>
18983 {
18984 #[inline]
18985 fn from_wire_option(
18986 wire: crate::wire_optional::DebugRegistration<'de>,
18987 ) -> ::core::option::Option<Self> {
18988 <DebugRegistration as ::fidl_next::FromWireOption<
18989 crate::wire_optional::DebugRegistration<'de>,
18990 >>::from_wire_option(wire)
18991 .map(Box::new)
18992 }
18993 }
18994
18995 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::DebugRegistration<'de>>
18996 for Box<DebugRegistration>
18997 {
18998 #[inline]
18999 fn from_wire_option_ref(
19000 wire: &crate::wire_optional::DebugRegistration<'de>,
19001 ) -> ::core::option::Option<Self> {
19002 if let Some(inner) = wire.as_ref() {
19003 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
19004 } else {
19005 None
19006 }
19007 }
19008 }
19009
19010 #[doc = " Declares an environment which configures a realm.\n"]
19011 #[derive(PartialEq, Clone, Debug, Default)]
19012 pub struct Environment {
19013 pub name: ::core::option::Option<::std::string::String>,
19014
19015 pub extends: ::core::option::Option<crate::natural::EnvironmentExtends>,
19016
19017 pub runners: ::core::option::Option<::std::vec::Vec<crate::natural::RunnerRegistration>>,
19018
19019 pub resolvers:
19020 ::core::option::Option<::std::vec::Vec<crate::natural::ResolverRegistration>>,
19021
19022 pub debug_capabilities:
19023 ::core::option::Option<::std::vec::Vec<crate::natural::DebugRegistration>>,
19024
19025 pub stop_timeout_ms: ::core::option::Option<u32>,
19026 }
19027
19028 impl Environment {
19029 fn __max_ordinal(&self) -> usize {
19030 if self.stop_timeout_ms.is_some() {
19031 return 6;
19032 }
19033
19034 if self.debug_capabilities.is_some() {
19035 return 5;
19036 }
19037
19038 if self.resolvers.is_some() {
19039 return 4;
19040 }
19041
19042 if self.runners.is_some() {
19043 return 3;
19044 }
19045
19046 if self.extends.is_some() {
19047 return 2;
19048 }
19049
19050 if self.name.is_some() {
19051 return 1;
19052 }
19053
19054 0
19055 }
19056 }
19057
19058 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Environment<'static>, ___E> for Environment
19059 where
19060 ___E: ::fidl_next::Encoder + ?Sized,
19061 {
19062 #[inline]
19063 fn encode(
19064 mut self,
19065 encoder: &mut ___E,
19066 out: &mut ::core::mem::MaybeUninit<crate::wire::Environment<'static>>,
19067 _: (),
19068 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19069 ::fidl_next::munge!(let crate::wire::Environment { table } = out);
19070
19071 let max_ord = self.__max_ordinal();
19072
19073 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
19074 ::fidl_next::Wire::zero_padding(&mut out);
19075
19076 let mut preallocated =
19077 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
19078
19079 for i in 1..=max_ord {
19080 match i {
19081 6 => {
19082 if let Some(value) = self.stop_timeout_ms.take() {
19083 ::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU32, ___E>(
19084 value,
19085 preallocated.encoder,
19086 &mut out,
19087 (),
19088 )?;
19089 } else {
19090 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19091 }
19092 }
19093
19094 5 => {
19095 if let Some(value) = self.debug_capabilities.take() {
19096 ::fidl_next::WireEnvelope::encode_value::<
19097 ::fidl_next::WireVector<
19098 'static,
19099 crate::wire::DebugRegistration<'static>,
19100 >,
19101 ___E,
19102 >(
19103 value, preallocated.encoder, &mut out, (4294967295, ())
19104 )?;
19105 } else {
19106 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19107 }
19108 }
19109
19110 4 => {
19111 if let Some(value) = self.resolvers.take() {
19112 ::fidl_next::WireEnvelope::encode_value::<
19113 ::fidl_next::WireVector<
19114 'static,
19115 crate::wire::ResolverRegistration<'static>,
19116 >,
19117 ___E,
19118 >(
19119 value, preallocated.encoder, &mut out, (4294967295, ())
19120 )?;
19121 } else {
19122 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19123 }
19124 }
19125
19126 3 => {
19127 if let Some(value) = self.runners.take() {
19128 ::fidl_next::WireEnvelope::encode_value::<
19129 ::fidl_next::WireVector<
19130 'static,
19131 crate::wire::RunnerRegistration<'static>,
19132 >,
19133 ___E,
19134 >(
19135 value, preallocated.encoder, &mut out, (4294967295, ())
19136 )?;
19137 } else {
19138 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19139 }
19140 }
19141
19142 2 => {
19143 if let Some(value) = self.extends.take() {
19144 ::fidl_next::WireEnvelope::encode_value::<
19145 crate::wire::EnvironmentExtends,
19146 ___E,
19147 >(
19148 value, preallocated.encoder, &mut out, ()
19149 )?;
19150 } else {
19151 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19152 }
19153 }
19154
19155 1 => {
19156 if let Some(value) = self.name.take() {
19157 ::fidl_next::WireEnvelope::encode_value::<
19158 ::fidl_next::WireString<'static>,
19159 ___E,
19160 >(
19161 value, preallocated.encoder, &mut out, 100
19162 )?;
19163 } else {
19164 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19165 }
19166 }
19167
19168 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
19169 }
19170 unsafe {
19171 preallocated.write_next(out.assume_init_ref());
19172 }
19173 }
19174
19175 ::fidl_next::WireTable::encode_len(table, max_ord);
19176
19177 Ok(())
19178 }
19179 }
19180
19181 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Environment<'static>, ___E>
19182 for &'a Environment
19183 where
19184 ___E: ::fidl_next::Encoder + ?Sized,
19185 {
19186 #[inline]
19187 fn encode(
19188 self,
19189 encoder: &mut ___E,
19190 out: &mut ::core::mem::MaybeUninit<crate::wire::Environment<'static>>,
19191 _: (),
19192 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19193 ::fidl_next::munge!(let crate::wire::Environment { table } = out);
19194
19195 let max_ord = self.__max_ordinal();
19196
19197 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
19198 ::fidl_next::Wire::zero_padding(&mut out);
19199
19200 let mut preallocated =
19201 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
19202
19203 for i in 1..=max_ord {
19204 match i {
19205 6 => {
19206 if let Some(value) = &self.stop_timeout_ms {
19207 ::fidl_next::WireEnvelope::encode_value::<::fidl_next::WireU32, ___E>(
19208 value,
19209 preallocated.encoder,
19210 &mut out,
19211 (),
19212 )?;
19213 } else {
19214 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19215 }
19216 }
19217
19218 5 => {
19219 if let Some(value) = &self.debug_capabilities {
19220 ::fidl_next::WireEnvelope::encode_value::<
19221 ::fidl_next::WireVector<
19222 'static,
19223 crate::wire::DebugRegistration<'static>,
19224 >,
19225 ___E,
19226 >(
19227 value, preallocated.encoder, &mut out, (4294967295, ())
19228 )?;
19229 } else {
19230 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19231 }
19232 }
19233
19234 4 => {
19235 if let Some(value) = &self.resolvers {
19236 ::fidl_next::WireEnvelope::encode_value::<
19237 ::fidl_next::WireVector<
19238 'static,
19239 crate::wire::ResolverRegistration<'static>,
19240 >,
19241 ___E,
19242 >(
19243 value, preallocated.encoder, &mut out, (4294967295, ())
19244 )?;
19245 } else {
19246 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19247 }
19248 }
19249
19250 3 => {
19251 if let Some(value) = &self.runners {
19252 ::fidl_next::WireEnvelope::encode_value::<
19253 ::fidl_next::WireVector<
19254 'static,
19255 crate::wire::RunnerRegistration<'static>,
19256 >,
19257 ___E,
19258 >(
19259 value, preallocated.encoder, &mut out, (4294967295, ())
19260 )?;
19261 } else {
19262 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19263 }
19264 }
19265
19266 2 => {
19267 if let Some(value) = &self.extends {
19268 ::fidl_next::WireEnvelope::encode_value::<
19269 crate::wire::EnvironmentExtends,
19270 ___E,
19271 >(
19272 value, preallocated.encoder, &mut out, ()
19273 )?;
19274 } else {
19275 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19276 }
19277 }
19278
19279 1 => {
19280 if let Some(value) = &self.name {
19281 ::fidl_next::WireEnvelope::encode_value::<
19282 ::fidl_next::WireString<'static>,
19283 ___E,
19284 >(
19285 value, preallocated.encoder, &mut out, 100
19286 )?;
19287 } else {
19288 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19289 }
19290 }
19291
19292 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
19293 }
19294 unsafe {
19295 preallocated.write_next(out.assume_init_ref());
19296 }
19297 }
19298
19299 ::fidl_next::WireTable::encode_len(table, max_ord);
19300
19301 Ok(())
19302 }
19303 }
19304
19305 impl<'de> ::fidl_next::FromWire<crate::wire::Environment<'de>> for Environment {
19306 #[inline]
19307 fn from_wire(wire_: crate::wire::Environment<'de>) -> Self {
19308 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
19309
19310 let name = wire_.table.get(1);
19311
19312 let extends = wire_.table.get(2);
19313
19314 let runners = wire_.table.get(3);
19315
19316 let resolvers = wire_.table.get(4);
19317
19318 let debug_capabilities = wire_.table.get(5);
19319
19320 let stop_timeout_ms = wire_.table.get(6);
19321
19322 Self {
19323
19324
19325 name: name.map(|envelope| ::fidl_next::FromWire::from_wire(
19326 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
19327 )),
19328
19329
19330 extends: extends.map(|envelope| ::fidl_next::FromWire::from_wire(
19331 unsafe { envelope.read_unchecked::<crate::wire::EnvironmentExtends>() }
19332 )),
19333
19334
19335 runners: runners.map(|envelope| ::fidl_next::FromWire::from_wire(
19336 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::RunnerRegistration<'de>>>() }
19337 )),
19338
19339
19340 resolvers: resolvers.map(|envelope| ::fidl_next::FromWire::from_wire(
19341 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::ResolverRegistration<'de>>>() }
19342 )),
19343
19344
19345 debug_capabilities: debug_capabilities.map(|envelope| ::fidl_next::FromWire::from_wire(
19346 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::DebugRegistration<'de>>>() }
19347 )),
19348
19349
19350 stop_timeout_ms: stop_timeout_ms.map(|envelope| ::fidl_next::FromWire::from_wire(
19351 unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() }
19352 )),
19353
19354 }
19355 }
19356 }
19357
19358 impl<'de> ::fidl_next::FromWireRef<crate::wire::Environment<'de>> for Environment {
19359 #[inline]
19360 fn from_wire_ref(wire: &crate::wire::Environment<'de>) -> Self {
19361 Self {
19362
19363
19364 name: wire.table.get(1)
19365 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19366 unsafe { envelope.deref_unchecked::<::fidl_next::WireString<'de>>() }
19367 )),
19368
19369
19370 extends: wire.table.get(2)
19371 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19372 unsafe { envelope.deref_unchecked::<crate::wire::EnvironmentExtends>() }
19373 )),
19374
19375
19376 runners: wire.table.get(3)
19377 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19378 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::wire::RunnerRegistration<'de>>>() }
19379 )),
19380
19381
19382 resolvers: wire.table.get(4)
19383 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19384 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::wire::ResolverRegistration<'de>>>() }
19385 )),
19386
19387
19388 debug_capabilities: wire.table.get(5)
19389 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19390 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::wire::DebugRegistration<'de>>>() }
19391 )),
19392
19393
19394 stop_timeout_ms: wire.table.get(6)
19395 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19396 unsafe { envelope.deref_unchecked::<::fidl_next::WireU32>() }
19397 )),
19398
19399 }
19400 }
19401 }
19402
19403 #[derive(PartialEq, Clone, Debug, Default)]
19404 pub struct ConfigSourceCapabilities {}
19405
19406 impl ConfigSourceCapabilities {
19407 fn __max_ordinal(&self) -> usize {
19408 0
19409 }
19410 }
19411
19412 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigSourceCapabilities<'static>, ___E>
19413 for ConfigSourceCapabilities
19414 where
19415 ___E: ::fidl_next::Encoder + ?Sized,
19416 {
19417 #[inline]
19418 fn encode(
19419 mut self,
19420 encoder: &mut ___E,
19421 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSourceCapabilities<'static>>,
19422 _: (),
19423 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19424 ::fidl_next::munge!(let crate::wire::ConfigSourceCapabilities { table } = out);
19425
19426 let max_ord = self.__max_ordinal();
19427
19428 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
19429 ::fidl_next::Wire::zero_padding(&mut out);
19430
19431 let mut preallocated =
19432 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
19433
19434 for i in 1..=max_ord {
19435 match i {
19436 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
19437 }
19438 unsafe {
19439 preallocated.write_next(out.assume_init_ref());
19440 }
19441 }
19442
19443 ::fidl_next::WireTable::encode_len(table, max_ord);
19444
19445 Ok(())
19446 }
19447 }
19448
19449 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigSourceCapabilities<'static>, ___E>
19450 for &'a ConfigSourceCapabilities
19451 where
19452 ___E: ::fidl_next::Encoder + ?Sized,
19453 {
19454 #[inline]
19455 fn encode(
19456 self,
19457 encoder: &mut ___E,
19458 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSourceCapabilities<'static>>,
19459 _: (),
19460 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19461 ::fidl_next::munge!(let crate::wire::ConfigSourceCapabilities { table } = out);
19462
19463 let max_ord = self.__max_ordinal();
19464
19465 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
19466 ::fidl_next::Wire::zero_padding(&mut out);
19467
19468 let mut preallocated =
19469 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
19470
19471 for i in 1..=max_ord {
19472 match i {
19473 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
19474 }
19475 unsafe {
19476 preallocated.write_next(out.assume_init_ref());
19477 }
19478 }
19479
19480 ::fidl_next::WireTable::encode_len(table, max_ord);
19481
19482 Ok(())
19483 }
19484 }
19485
19486 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigSourceCapabilities<'de>>
19487 for ConfigSourceCapabilities
19488 {
19489 #[inline]
19490 fn from_wire(wire_: crate::wire::ConfigSourceCapabilities<'de>) -> Self {
19491 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
19492
19493 Self {}
19494 }
19495 }
19496
19497 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigSourceCapabilities<'de>>
19498 for ConfigSourceCapabilities
19499 {
19500 #[inline]
19501 fn from_wire_ref(wire: &crate::wire::ConfigSourceCapabilities<'de>) -> Self {
19502 Self {}
19503 }
19504 }
19505
19506 #[doc = " Strategies available for resolving configuration values.\n"]
19507 #[derive(PartialEq, Clone, Debug)]
19508 pub enum ConfigValueSource {
19509 PackagePath(::std::string::String),
19510
19511 Capabilities(crate::natural::ConfigSourceCapabilities),
19512
19513 UnknownOrdinal_(u64),
19514 }
19515
19516 impl ConfigValueSource {
19517 pub fn is_unknown(&self) -> bool {
19518 #[allow(unreachable_patterns)]
19519 match self {
19520 Self::UnknownOrdinal_(_) => true,
19521 _ => false,
19522 }
19523 }
19524 }
19525
19526 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigValueSource<'static>, ___E>
19527 for ConfigValueSource
19528 where
19529 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19530 ___E: ::fidl_next::Encoder,
19531 {
19532 #[inline]
19533 fn encode(
19534 self,
19535 encoder: &mut ___E,
19536 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValueSource<'static>>,
19537 _: (),
19538 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19539 ::fidl_next::munge!(let crate::wire::ConfigValueSource { raw, _phantom: _ } = out);
19540
19541 match self {
19542 Self::PackagePath(value) => ::fidl_next::RawWireUnion::encode_as::<
19543 ___E,
19544 ::fidl_next::WireString<'static>,
19545 >(value, 1, encoder, raw, 4294967295)?,
19546
19547 Self::Capabilities(value) => ::fidl_next::RawWireUnion::encode_as::<
19548 ___E,
19549 crate::wire::ConfigSourceCapabilities<'static>,
19550 >(value, 2, encoder, raw, ())?,
19551
19552 Self::UnknownOrdinal_(ordinal) => {
19553 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
19554 }
19555 }
19556
19557 Ok(())
19558 }
19559 }
19560
19561 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigValueSource<'static>, ___E>
19562 for &'a ConfigValueSource
19563 where
19564 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
19565 ___E: ::fidl_next::Encoder,
19566 {
19567 #[inline]
19568 fn encode(
19569 self,
19570 encoder: &mut ___E,
19571 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValueSource<'static>>,
19572 _: (),
19573 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19574 ::fidl_next::munge!(let crate::wire::ConfigValueSource { raw, _phantom: _ } = out);
19575
19576 match self {
19577 ConfigValueSource::PackagePath(value) => {
19578 ::fidl_next::RawWireUnion::encode_as::<___E, ::fidl_next::WireString<'static>>(
19579 value, 1, encoder, raw, 4294967295,
19580 )?
19581 }
19582
19583 ConfigValueSource::Capabilities(value) => {
19584 ::fidl_next::RawWireUnion::encode_as::<
19585 ___E,
19586 crate::wire::ConfigSourceCapabilities<'static>,
19587 >(value, 2, encoder, raw, ())?
19588 }
19589
19590 ConfigValueSource::UnknownOrdinal_(ordinal) => {
19591 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
19592 }
19593 }
19594
19595 Ok(())
19596 }
19597 }
19598
19599 unsafe impl<___E>
19600 ::fidl_next::EncodeOption<crate::wire_optional::ConfigValueSource<'static>, ___E>
19601 for ConfigValueSource
19602 where
19603 ___E: ?Sized,
19604 ConfigValueSource: ::fidl_next::Encode<crate::wire::ConfigValueSource<'static>, ___E>,
19605 {
19606 #[inline]
19607 fn encode_option(
19608 this: ::core::option::Option<Self>,
19609 encoder: &mut ___E,
19610 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigValueSource<'static>>,
19611 _: (),
19612 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19613 ::fidl_next::munge!(let crate::wire_optional::ConfigValueSource { raw, _phantom: _ } = &mut *out);
19614
19615 if let Some(inner) = this {
19616 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
19617 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
19618 } else {
19619 ::fidl_next::RawWireUnion::encode_absent(raw);
19620 }
19621
19622 Ok(())
19623 }
19624 }
19625
19626 unsafe impl<'a, ___E>
19627 ::fidl_next::EncodeOption<crate::wire_optional::ConfigValueSource<'static>, ___E>
19628 for &'a ConfigValueSource
19629 where
19630 ___E: ?Sized,
19631 &'a ConfigValueSource: ::fidl_next::Encode<crate::wire::ConfigValueSource<'static>, ___E>,
19632 {
19633 #[inline]
19634 fn encode_option(
19635 this: ::core::option::Option<Self>,
19636 encoder: &mut ___E,
19637 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::ConfigValueSource<'static>>,
19638 _: (),
19639 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19640 ::fidl_next::munge!(let crate::wire_optional::ConfigValueSource { raw, _phantom: _ } = &mut *out);
19641
19642 if let Some(inner) = this {
19643 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
19644 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
19645 } else {
19646 ::fidl_next::RawWireUnion::encode_absent(raw);
19647 }
19648
19649 Ok(())
19650 }
19651 }
19652
19653 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigValueSource<'de>> for ConfigValueSource {
19654 #[inline]
19655 fn from_wire(wire: crate::wire::ConfigValueSource<'de>) -> Self {
19656 let wire = ::core::mem::ManuallyDrop::new(wire);
19657 match wire.raw.ordinal() {
19658 1 => Self::PackagePath(::fidl_next::FromWire::from_wire(unsafe {
19659 wire.raw.get().read_unchecked::<::fidl_next::WireString<'de>>()
19660 })),
19661
19662 2 => Self::Capabilities(::fidl_next::FromWire::from_wire(unsafe {
19663 wire.raw.get().read_unchecked::<crate::wire::ConfigSourceCapabilities<'de>>()
19664 })),
19665
19666 ord => return Self::UnknownOrdinal_(ord as u64),
19667 }
19668 }
19669 }
19670
19671 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigValueSource<'de>> for ConfigValueSource {
19672 #[inline]
19673 fn from_wire_ref(wire: &crate::wire::ConfigValueSource<'de>) -> Self {
19674 match wire.raw.ordinal() {
19675 1 => Self::PackagePath(::fidl_next::FromWireRef::from_wire_ref(unsafe {
19676 wire.raw.get().deref_unchecked::<::fidl_next::WireString<'de>>()
19677 })),
19678
19679 2 => Self::Capabilities(::fidl_next::FromWireRef::from_wire_ref(unsafe {
19680 wire.raw.get().deref_unchecked::<crate::wire::ConfigSourceCapabilities<'de>>()
19681 })),
19682
19683 ord => return Self::UnknownOrdinal_(ord as u64),
19684 }
19685 }
19686 }
19687
19688 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigValueSource<'de>>
19689 for ConfigValueSource
19690 {
19691 #[inline]
19692 fn from_wire_option(
19693 wire: crate::wire_optional::ConfigValueSource<'de>,
19694 ) -> ::core::option::Option<Self> {
19695 if let Some(inner) = wire.into_option() {
19696 Some(::fidl_next::FromWire::from_wire(inner))
19697 } else {
19698 None
19699 }
19700 }
19701 }
19702
19703 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::ConfigValueSource<'de>>
19704 for Box<ConfigValueSource>
19705 {
19706 #[inline]
19707 fn from_wire_option(
19708 wire: crate::wire_optional::ConfigValueSource<'de>,
19709 ) -> ::core::option::Option<Self> {
19710 <ConfigValueSource as ::fidl_next::FromWireOption<
19711 crate::wire_optional::ConfigValueSource<'de>,
19712 >>::from_wire_option(wire)
19713 .map(Box::new)
19714 }
19715 }
19716
19717 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::ConfigValueSource<'de>>
19718 for Box<ConfigValueSource>
19719 {
19720 #[inline]
19721 fn from_wire_option_ref(
19722 wire: &crate::wire_optional::ConfigValueSource<'de>,
19723 ) -> ::core::option::Option<Self> {
19724 if let Some(inner) = wire.as_ref() {
19725 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
19726 } else {
19727 None
19728 }
19729 }
19730 }
19731
19732 #[doc = " The schema of a component\'s configuration interface.\n"]
19733 #[derive(PartialEq, Clone, Debug, Default)]
19734 pub struct ConfigSchema {
19735 pub fields: ::core::option::Option<::std::vec::Vec<crate::natural::ConfigField>>,
19736
19737 pub checksum: ::core::option::Option<crate::natural::ConfigChecksum>,
19738
19739 pub value_source: ::core::option::Option<crate::natural::ConfigValueSource>,
19740 }
19741
19742 impl ConfigSchema {
19743 fn __max_ordinal(&self) -> usize {
19744 if self.value_source.is_some() {
19745 return 3;
19746 }
19747
19748 if self.checksum.is_some() {
19749 return 2;
19750 }
19751
19752 if self.fields.is_some() {
19753 return 1;
19754 }
19755
19756 0
19757 }
19758 }
19759
19760 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigSchema<'static>, ___E> for ConfigSchema
19761 where
19762 ___E: ::fidl_next::Encoder + ?Sized,
19763 {
19764 #[inline]
19765 fn encode(
19766 mut self,
19767 encoder: &mut ___E,
19768 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSchema<'static>>,
19769 _: (),
19770 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19771 ::fidl_next::munge!(let crate::wire::ConfigSchema { table } = out);
19772
19773 let max_ord = self.__max_ordinal();
19774
19775 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
19776 ::fidl_next::Wire::zero_padding(&mut out);
19777
19778 let mut preallocated =
19779 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
19780
19781 for i in 1..=max_ord {
19782 match i {
19783 3 => {
19784 if let Some(value) = self.value_source.take() {
19785 ::fidl_next::WireEnvelope::encode_value::<
19786 crate::wire::ConfigValueSource<'static>,
19787 ___E,
19788 >(
19789 value, preallocated.encoder, &mut out, ()
19790 )?;
19791 } else {
19792 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19793 }
19794 }
19795
19796 2 => {
19797 if let Some(value) = self.checksum.take() {
19798 ::fidl_next::WireEnvelope::encode_value::<
19799 crate::wire::ConfigChecksum<'static>,
19800 ___E,
19801 >(
19802 value, preallocated.encoder, &mut out, ()
19803 )?;
19804 } else {
19805 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19806 }
19807 }
19808
19809 1 => {
19810 if let Some(value) = self.fields.take() {
19811 ::fidl_next::WireEnvelope::encode_value::<
19812 ::fidl_next::WireVector<'static, crate::wire::ConfigField<'static>>,
19813 ___E,
19814 >(
19815 value, preallocated.encoder, &mut out, (4294967295, ())
19816 )?;
19817 } else {
19818 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19819 }
19820 }
19821
19822 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
19823 }
19824 unsafe {
19825 preallocated.write_next(out.assume_init_ref());
19826 }
19827 }
19828
19829 ::fidl_next::WireTable::encode_len(table, max_ord);
19830
19831 Ok(())
19832 }
19833 }
19834
19835 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigSchema<'static>, ___E>
19836 for &'a ConfigSchema
19837 where
19838 ___E: ::fidl_next::Encoder + ?Sized,
19839 {
19840 #[inline]
19841 fn encode(
19842 self,
19843 encoder: &mut ___E,
19844 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigSchema<'static>>,
19845 _: (),
19846 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
19847 ::fidl_next::munge!(let crate::wire::ConfigSchema { table } = out);
19848
19849 let max_ord = self.__max_ordinal();
19850
19851 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
19852 ::fidl_next::Wire::zero_padding(&mut out);
19853
19854 let mut preallocated =
19855 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
19856
19857 for i in 1..=max_ord {
19858 match i {
19859 3 => {
19860 if let Some(value) = &self.value_source {
19861 ::fidl_next::WireEnvelope::encode_value::<
19862 crate::wire::ConfigValueSource<'static>,
19863 ___E,
19864 >(
19865 value, preallocated.encoder, &mut out, ()
19866 )?;
19867 } else {
19868 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19869 }
19870 }
19871
19872 2 => {
19873 if let Some(value) = &self.checksum {
19874 ::fidl_next::WireEnvelope::encode_value::<
19875 crate::wire::ConfigChecksum<'static>,
19876 ___E,
19877 >(
19878 value, preallocated.encoder, &mut out, ()
19879 )?;
19880 } else {
19881 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19882 }
19883 }
19884
19885 1 => {
19886 if let Some(value) = &self.fields {
19887 ::fidl_next::WireEnvelope::encode_value::<
19888 ::fidl_next::WireVector<'static, crate::wire::ConfigField<'static>>,
19889 ___E,
19890 >(
19891 value, preallocated.encoder, &mut out, (4294967295, ())
19892 )?;
19893 } else {
19894 ::fidl_next::WireEnvelope::encode_zero(&mut out)
19895 }
19896 }
19897
19898 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
19899 }
19900 unsafe {
19901 preallocated.write_next(out.assume_init_ref());
19902 }
19903 }
19904
19905 ::fidl_next::WireTable::encode_len(table, max_ord);
19906
19907 Ok(())
19908 }
19909 }
19910
19911 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigSchema<'de>> for ConfigSchema {
19912 #[inline]
19913 fn from_wire(wire_: crate::wire::ConfigSchema<'de>) -> Self {
19914 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
19915
19916 let fields = wire_.table.get(1);
19917
19918 let checksum = wire_.table.get(2);
19919
19920 let value_source = wire_.table.get(3);
19921
19922 Self {
19923
19924
19925 fields: fields.map(|envelope| ::fidl_next::FromWire::from_wire(
19926 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::ConfigField<'de>>>() }
19927 )),
19928
19929
19930 checksum: checksum.map(|envelope| ::fidl_next::FromWire::from_wire(
19931 unsafe { envelope.read_unchecked::<crate::wire::ConfigChecksum<'de>>() }
19932 )),
19933
19934
19935 value_source: value_source.map(|envelope| ::fidl_next::FromWire::from_wire(
19936 unsafe { envelope.read_unchecked::<crate::wire::ConfigValueSource<'de>>() }
19937 )),
19938
19939 }
19940 }
19941 }
19942
19943 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigSchema<'de>> for ConfigSchema {
19944 #[inline]
19945 fn from_wire_ref(wire: &crate::wire::ConfigSchema<'de>) -> Self {
19946 Self {
19947
19948
19949 fields: wire.table.get(1)
19950 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19951 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::wire::ConfigField<'de>>>() }
19952 )),
19953
19954
19955 checksum: wire.table.get(2)
19956 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19957 unsafe { envelope.deref_unchecked::<crate::wire::ConfigChecksum<'de>>() }
19958 )),
19959
19960
19961 value_source: wire.table.get(3)
19962 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
19963 unsafe { envelope.deref_unchecked::<crate::wire::ConfigValueSource<'de>>() }
19964 )),
19965
19966 }
19967 }
19968 }
19969
19970 #[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"]
19971 #[derive(PartialEq, Clone, Debug, Default)]
19972 pub struct Component {
19973 pub program: ::core::option::Option<crate::natural::Program>,
19974
19975 pub uses: ::core::option::Option<::std::vec::Vec<crate::natural::Use>>,
19976
19977 pub exposes: ::core::option::Option<::std::vec::Vec<crate::natural::Expose>>,
19978
19979 pub offers: ::core::option::Option<::std::vec::Vec<crate::natural::Offer>>,
19980
19981 pub capabilities: ::core::option::Option<::std::vec::Vec<crate::natural::Capability>>,
19982
19983 pub children: ::core::option::Option<::std::vec::Vec<crate::natural::Child>>,
19984
19985 pub collections: ::core::option::Option<::std::vec::Vec<crate::natural::Collection>>,
19986
19987 pub environments: ::core::option::Option<::std::vec::Vec<crate::natural::Environment>>,
19988
19989 pub facets: ::core::option::Option<::fidl_next_common_fuchsia_data::natural::Dictionary>,
19990
19991 pub config: ::core::option::Option<crate::natural::ConfigSchema>,
19992 }
19993
19994 impl Component {
19995 fn __max_ordinal(&self) -> usize {
19996 if self.config.is_some() {
19997 return 10;
19998 }
19999
20000 if self.facets.is_some() {
20001 return 9;
20002 }
20003
20004 if self.environments.is_some() {
20005 return 8;
20006 }
20007
20008 if self.collections.is_some() {
20009 return 7;
20010 }
20011
20012 if self.children.is_some() {
20013 return 6;
20014 }
20015
20016 if self.capabilities.is_some() {
20017 return 5;
20018 }
20019
20020 if self.offers.is_some() {
20021 return 4;
20022 }
20023
20024 if self.exposes.is_some() {
20025 return 3;
20026 }
20027
20028 if self.uses.is_some() {
20029 return 2;
20030 }
20031
20032 if self.program.is_some() {
20033 return 1;
20034 }
20035
20036 0
20037 }
20038 }
20039
20040 unsafe impl<___E> ::fidl_next::Encode<crate::wire::Component<'static>, ___E> for Component
20041 where
20042 ___E: ::fidl_next::Encoder + ?Sized,
20043 {
20044 #[inline]
20045 fn encode(
20046 mut self,
20047 encoder: &mut ___E,
20048 out: &mut ::core::mem::MaybeUninit<crate::wire::Component<'static>>,
20049 _: (),
20050 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20051 ::fidl_next::munge!(let crate::wire::Component { table } = out);
20052
20053 let max_ord = self.__max_ordinal();
20054
20055 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
20056 ::fidl_next::Wire::zero_padding(&mut out);
20057
20058 let mut preallocated =
20059 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
20060
20061 for i in 1..=max_ord {
20062 match i {
20063 10 => {
20064 if let Some(value) = self.config.take() {
20065 ::fidl_next::WireEnvelope::encode_value::<
20066 crate::wire::ConfigSchema<'static>,
20067 ___E,
20068 >(
20069 value, preallocated.encoder, &mut out, ()
20070 )?;
20071 } else {
20072 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20073 }
20074 }
20075
20076 9 => {
20077 if let Some(value) = self.facets.take() {
20078 ::fidl_next::WireEnvelope::encode_value::<
20079 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
20080 ___E,
20081 >(
20082 value, preallocated.encoder, &mut out, ()
20083 )?;
20084 } else {
20085 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20086 }
20087 }
20088
20089 8 => {
20090 if let Some(value) = self.environments.take() {
20091 ::fidl_next::WireEnvelope::encode_value::<
20092 ::fidl_next::WireVector<'static, crate::wire::Environment<'static>>,
20093 ___E,
20094 >(
20095 value, preallocated.encoder, &mut out, (4294967295, ())
20096 )?;
20097 } else {
20098 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20099 }
20100 }
20101
20102 7 => {
20103 if let Some(value) = self.collections.take() {
20104 ::fidl_next::WireEnvelope::encode_value::<
20105 ::fidl_next::WireVector<'static, crate::wire::Collection<'static>>,
20106 ___E,
20107 >(
20108 value, preallocated.encoder, &mut out, (4294967295, ())
20109 )?;
20110 } else {
20111 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20112 }
20113 }
20114
20115 6 => {
20116 if let Some(value) = self.children.take() {
20117 ::fidl_next::WireEnvelope::encode_value::<
20118 ::fidl_next::WireVector<'static, crate::wire::Child<'static>>,
20119 ___E,
20120 >(
20121 value, preallocated.encoder, &mut out, (4294967295, ())
20122 )?;
20123 } else {
20124 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20125 }
20126 }
20127
20128 5 => {
20129 if let Some(value) = self.capabilities.take() {
20130 ::fidl_next::WireEnvelope::encode_value::<
20131 ::fidl_next::WireVector<'static, crate::wire::Capability<'static>>,
20132 ___E,
20133 >(
20134 value, preallocated.encoder, &mut out, (4294967295, ())
20135 )?;
20136 } else {
20137 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20138 }
20139 }
20140
20141 4 => {
20142 if let Some(value) = self.offers.take() {
20143 ::fidl_next::WireEnvelope::encode_value::<
20144 ::fidl_next::WireVector<'static, crate::wire::Offer<'static>>,
20145 ___E,
20146 >(
20147 value, preallocated.encoder, &mut out, (4294967295, ())
20148 )?;
20149 } else {
20150 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20151 }
20152 }
20153
20154 3 => {
20155 if let Some(value) = self.exposes.take() {
20156 ::fidl_next::WireEnvelope::encode_value::<
20157 ::fidl_next::WireVector<'static, crate::wire::Expose<'static>>,
20158 ___E,
20159 >(
20160 value, preallocated.encoder, &mut out, (4294967295, ())
20161 )?;
20162 } else {
20163 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20164 }
20165 }
20166
20167 2 => {
20168 if let Some(value) = self.uses.take() {
20169 ::fidl_next::WireEnvelope::encode_value::<
20170 ::fidl_next::WireVector<'static, crate::wire::Use<'static>>,
20171 ___E,
20172 >(
20173 value, preallocated.encoder, &mut out, (4294967295, ())
20174 )?;
20175 } else {
20176 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20177 }
20178 }
20179
20180 1 => {
20181 if let Some(value) = self.program.take() {
20182 ::fidl_next::WireEnvelope::encode_value::<
20183 crate::wire::Program<'static>,
20184 ___E,
20185 >(
20186 value, preallocated.encoder, &mut out, ()
20187 )?;
20188 } else {
20189 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20190 }
20191 }
20192
20193 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
20194 }
20195 unsafe {
20196 preallocated.write_next(out.assume_init_ref());
20197 }
20198 }
20199
20200 ::fidl_next::WireTable::encode_len(table, max_ord);
20201
20202 Ok(())
20203 }
20204 }
20205
20206 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::Component<'static>, ___E> for &'a Component
20207 where
20208 ___E: ::fidl_next::Encoder + ?Sized,
20209 {
20210 #[inline]
20211 fn encode(
20212 self,
20213 encoder: &mut ___E,
20214 out: &mut ::core::mem::MaybeUninit<crate::wire::Component<'static>>,
20215 _: (),
20216 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20217 ::fidl_next::munge!(let crate::wire::Component { table } = out);
20218
20219 let max_ord = self.__max_ordinal();
20220
20221 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
20222 ::fidl_next::Wire::zero_padding(&mut out);
20223
20224 let mut preallocated =
20225 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
20226
20227 for i in 1..=max_ord {
20228 match i {
20229 10 => {
20230 if let Some(value) = &self.config {
20231 ::fidl_next::WireEnvelope::encode_value::<
20232 crate::wire::ConfigSchema<'static>,
20233 ___E,
20234 >(
20235 value, preallocated.encoder, &mut out, ()
20236 )?;
20237 } else {
20238 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20239 }
20240 }
20241
20242 9 => {
20243 if let Some(value) = &self.facets {
20244 ::fidl_next::WireEnvelope::encode_value::<
20245 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
20246 ___E,
20247 >(
20248 value, preallocated.encoder, &mut out, ()
20249 )?;
20250 } else {
20251 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20252 }
20253 }
20254
20255 8 => {
20256 if let Some(value) = &self.environments {
20257 ::fidl_next::WireEnvelope::encode_value::<
20258 ::fidl_next::WireVector<'static, crate::wire::Environment<'static>>,
20259 ___E,
20260 >(
20261 value, preallocated.encoder, &mut out, (4294967295, ())
20262 )?;
20263 } else {
20264 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20265 }
20266 }
20267
20268 7 => {
20269 if let Some(value) = &self.collections {
20270 ::fidl_next::WireEnvelope::encode_value::<
20271 ::fidl_next::WireVector<'static, crate::wire::Collection<'static>>,
20272 ___E,
20273 >(
20274 value, preallocated.encoder, &mut out, (4294967295, ())
20275 )?;
20276 } else {
20277 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20278 }
20279 }
20280
20281 6 => {
20282 if let Some(value) = &self.children {
20283 ::fidl_next::WireEnvelope::encode_value::<
20284 ::fidl_next::WireVector<'static, crate::wire::Child<'static>>,
20285 ___E,
20286 >(
20287 value, preallocated.encoder, &mut out, (4294967295, ())
20288 )?;
20289 } else {
20290 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20291 }
20292 }
20293
20294 5 => {
20295 if let Some(value) = &self.capabilities {
20296 ::fidl_next::WireEnvelope::encode_value::<
20297 ::fidl_next::WireVector<'static, crate::wire::Capability<'static>>,
20298 ___E,
20299 >(
20300 value, preallocated.encoder, &mut out, (4294967295, ())
20301 )?;
20302 } else {
20303 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20304 }
20305 }
20306
20307 4 => {
20308 if let Some(value) = &self.offers {
20309 ::fidl_next::WireEnvelope::encode_value::<
20310 ::fidl_next::WireVector<'static, crate::wire::Offer<'static>>,
20311 ___E,
20312 >(
20313 value, preallocated.encoder, &mut out, (4294967295, ())
20314 )?;
20315 } else {
20316 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20317 }
20318 }
20319
20320 3 => {
20321 if let Some(value) = &self.exposes {
20322 ::fidl_next::WireEnvelope::encode_value::<
20323 ::fidl_next::WireVector<'static, crate::wire::Expose<'static>>,
20324 ___E,
20325 >(
20326 value, preallocated.encoder, &mut out, (4294967295, ())
20327 )?;
20328 } else {
20329 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20330 }
20331 }
20332
20333 2 => {
20334 if let Some(value) = &self.uses {
20335 ::fidl_next::WireEnvelope::encode_value::<
20336 ::fidl_next::WireVector<'static, crate::wire::Use<'static>>,
20337 ___E,
20338 >(
20339 value, preallocated.encoder, &mut out, (4294967295, ())
20340 )?;
20341 } else {
20342 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20343 }
20344 }
20345
20346 1 => {
20347 if let Some(value) = &self.program {
20348 ::fidl_next::WireEnvelope::encode_value::<
20349 crate::wire::Program<'static>,
20350 ___E,
20351 >(
20352 value, preallocated.encoder, &mut out, ()
20353 )?;
20354 } else {
20355 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20356 }
20357 }
20358
20359 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
20360 }
20361 unsafe {
20362 preallocated.write_next(out.assume_init_ref());
20363 }
20364 }
20365
20366 ::fidl_next::WireTable::encode_len(table, max_ord);
20367
20368 Ok(())
20369 }
20370 }
20371
20372 impl<'de> ::fidl_next::FromWire<crate::wire::Component<'de>> for Component {
20373 #[inline]
20374 fn from_wire(wire_: crate::wire::Component<'de>) -> Self {
20375 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
20376
20377 let program = wire_.table.get(1);
20378
20379 let uses = wire_.table.get(2);
20380
20381 let exposes = wire_.table.get(3);
20382
20383 let offers = wire_.table.get(4);
20384
20385 let capabilities = wire_.table.get(5);
20386
20387 let children = wire_.table.get(6);
20388
20389 let collections = wire_.table.get(7);
20390
20391 let environments = wire_.table.get(8);
20392
20393 let facets = wire_.table.get(9);
20394
20395 let config = wire_.table.get(10);
20396
20397 Self {
20398
20399
20400 program: program.map(|envelope| ::fidl_next::FromWire::from_wire(
20401 unsafe { envelope.read_unchecked::<crate::wire::Program<'de>>() }
20402 )),
20403
20404
20405 uses: uses.map(|envelope| ::fidl_next::FromWire::from_wire(
20406 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Use<'de>>>() }
20407 )),
20408
20409
20410 exposes: exposes.map(|envelope| ::fidl_next::FromWire::from_wire(
20411 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Expose<'de>>>() }
20412 )),
20413
20414
20415 offers: offers.map(|envelope| ::fidl_next::FromWire::from_wire(
20416 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Offer<'de>>>() }
20417 )),
20418
20419
20420 capabilities: capabilities.map(|envelope| ::fidl_next::FromWire::from_wire(
20421 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Capability<'de>>>() }
20422 )),
20423
20424
20425 children: children.map(|envelope| ::fidl_next::FromWire::from_wire(
20426 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Child<'de>>>() }
20427 )),
20428
20429
20430 collections: collections.map(|envelope| ::fidl_next::FromWire::from_wire(
20431 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Collection<'de>>>() }
20432 )),
20433
20434
20435 environments: environments.map(|envelope| ::fidl_next::FromWire::from_wire(
20436 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Environment<'de>>>() }
20437 )),
20438
20439
20440 facets: facets.map(|envelope| ::fidl_next::FromWire::from_wire(
20441 unsafe { envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
20442 )),
20443
20444
20445 config: config.map(|envelope| ::fidl_next::FromWire::from_wire(
20446 unsafe { envelope.read_unchecked::<crate::wire::ConfigSchema<'de>>() }
20447 )),
20448
20449 }
20450 }
20451 }
20452
20453 impl<'de> ::fidl_next::FromWireRef<crate::wire::Component<'de>> for Component {
20454 #[inline]
20455 fn from_wire_ref(wire: &crate::wire::Component<'de>) -> Self {
20456 Self {
20457
20458
20459 program: wire.table.get(1)
20460 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20461 unsafe { envelope.deref_unchecked::<crate::wire::Program<'de>>() }
20462 )),
20463
20464
20465 uses: wire.table.get(2)
20466 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20467 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::wire::Use<'de>>>() }
20468 )),
20469
20470
20471 exposes: wire.table.get(3)
20472 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20473 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::wire::Expose<'de>>>() }
20474 )),
20475
20476
20477 offers: wire.table.get(4)
20478 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20479 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::wire::Offer<'de>>>() }
20480 )),
20481
20482
20483 capabilities: wire.table.get(5)
20484 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20485 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::wire::Capability<'de>>>() }
20486 )),
20487
20488
20489 children: wire.table.get(6)
20490 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20491 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::wire::Child<'de>>>() }
20492 )),
20493
20494
20495 collections: wire.table.get(7)
20496 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20497 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::wire::Collection<'de>>>() }
20498 )),
20499
20500
20501 environments: wire.table.get(8)
20502 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20503 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::wire::Environment<'de>>>() }
20504 )),
20505
20506
20507 facets: wire.table.get(9)
20508 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20509 unsafe { envelope.deref_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>() }
20510 )),
20511
20512
20513 config: wire.table.get(10)
20514 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20515 unsafe { envelope.deref_unchecked::<crate::wire::ConfigSchema<'de>>() }
20516 )),
20517
20518 }
20519 }
20520 }
20521
20522 #[doc = " An individual configuration value. It is matched against a specific configuration field based\n on its offset within `ValuesData.values`.\n"]
20523 #[derive(PartialEq, Clone, Debug, Default)]
20524 pub struct ConfigValueSpec {
20525 pub value: ::core::option::Option<crate::natural::ConfigValue>,
20526 }
20527
20528 impl ConfigValueSpec {
20529 fn __max_ordinal(&self) -> usize {
20530 if self.value.is_some() {
20531 return 1;
20532 }
20533
20534 0
20535 }
20536 }
20537
20538 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigValueSpec<'static>, ___E>
20539 for ConfigValueSpec
20540 where
20541 ___E: ::fidl_next::Encoder + ?Sized,
20542 {
20543 #[inline]
20544 fn encode(
20545 mut self,
20546 encoder: &mut ___E,
20547 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValueSpec<'static>>,
20548 _: (),
20549 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20550 ::fidl_next::munge!(let crate::wire::ConfigValueSpec { table } = out);
20551
20552 let max_ord = self.__max_ordinal();
20553
20554 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
20555 ::fidl_next::Wire::zero_padding(&mut out);
20556
20557 let mut preallocated =
20558 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
20559
20560 for i in 1..=max_ord {
20561 match i {
20562 1 => {
20563 if let Some(value) = self.value.take() {
20564 ::fidl_next::WireEnvelope::encode_value::<
20565 crate::wire::ConfigValue<'static>,
20566 ___E,
20567 >(
20568 value, preallocated.encoder, &mut out, ()
20569 )?;
20570 } else {
20571 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20572 }
20573 }
20574
20575 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
20576 }
20577 unsafe {
20578 preallocated.write_next(out.assume_init_ref());
20579 }
20580 }
20581
20582 ::fidl_next::WireTable::encode_len(table, max_ord);
20583
20584 Ok(())
20585 }
20586 }
20587
20588 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigValueSpec<'static>, ___E>
20589 for &'a ConfigValueSpec
20590 where
20591 ___E: ::fidl_next::Encoder + ?Sized,
20592 {
20593 #[inline]
20594 fn encode(
20595 self,
20596 encoder: &mut ___E,
20597 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValueSpec<'static>>,
20598 _: (),
20599 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20600 ::fidl_next::munge!(let crate::wire::ConfigValueSpec { table } = out);
20601
20602 let max_ord = self.__max_ordinal();
20603
20604 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
20605 ::fidl_next::Wire::zero_padding(&mut out);
20606
20607 let mut preallocated =
20608 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
20609
20610 for i in 1..=max_ord {
20611 match i {
20612 1 => {
20613 if let Some(value) = &self.value {
20614 ::fidl_next::WireEnvelope::encode_value::<
20615 crate::wire::ConfigValue<'static>,
20616 ___E,
20617 >(
20618 value, preallocated.encoder, &mut out, ()
20619 )?;
20620 } else {
20621 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20622 }
20623 }
20624
20625 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
20626 }
20627 unsafe {
20628 preallocated.write_next(out.assume_init_ref());
20629 }
20630 }
20631
20632 ::fidl_next::WireTable::encode_len(table, max_ord);
20633
20634 Ok(())
20635 }
20636 }
20637
20638 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigValueSpec<'de>> for ConfigValueSpec {
20639 #[inline]
20640 fn from_wire(wire_: crate::wire::ConfigValueSpec<'de>) -> Self {
20641 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
20642
20643 let value = wire_.table.get(1);
20644
20645 Self {
20646 value: value.map(|envelope| {
20647 ::fidl_next::FromWire::from_wire(unsafe {
20648 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
20649 })
20650 }),
20651 }
20652 }
20653 }
20654
20655 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigValueSpec<'de>> for ConfigValueSpec {
20656 #[inline]
20657 fn from_wire_ref(wire: &crate::wire::ConfigValueSpec<'de>) -> Self {
20658 Self {
20659 value: wire.table.get(1).map(|envelope| {
20660 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
20661 envelope.deref_unchecked::<crate::wire::ConfigValue<'de>>()
20662 })
20663 }),
20664 }
20665 }
20666 }
20667
20668 #[doc = " Contents of the configuration value file. Defines the base values for a component\'s config.\n"]
20669 #[derive(PartialEq, Clone, Debug, Default)]
20670 pub struct ConfigValuesData {
20671 pub values: ::core::option::Option<::std::vec::Vec<crate::natural::ConfigValueSpec>>,
20672
20673 pub checksum: ::core::option::Option<crate::natural::ConfigChecksum>,
20674 }
20675
20676 impl ConfigValuesData {
20677 fn __max_ordinal(&self) -> usize {
20678 if self.checksum.is_some() {
20679 return 2;
20680 }
20681
20682 if self.values.is_some() {
20683 return 1;
20684 }
20685
20686 0
20687 }
20688 }
20689
20690 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ConfigValuesData<'static>, ___E>
20691 for ConfigValuesData
20692 where
20693 ___E: ::fidl_next::Encoder + ?Sized,
20694 {
20695 #[inline]
20696 fn encode(
20697 mut self,
20698 encoder: &mut ___E,
20699 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValuesData<'static>>,
20700 _: (),
20701 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20702 ::fidl_next::munge!(let crate::wire::ConfigValuesData { table } = out);
20703
20704 let max_ord = self.__max_ordinal();
20705
20706 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
20707 ::fidl_next::Wire::zero_padding(&mut out);
20708
20709 let mut preallocated =
20710 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
20711
20712 for i in 1..=max_ord {
20713 match i {
20714 2 => {
20715 if let Some(value) = self.checksum.take() {
20716 ::fidl_next::WireEnvelope::encode_value::<
20717 crate::wire::ConfigChecksum<'static>,
20718 ___E,
20719 >(
20720 value, preallocated.encoder, &mut out, ()
20721 )?;
20722 } else {
20723 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20724 }
20725 }
20726
20727 1 => {
20728 if let Some(value) = self.values.take() {
20729 ::fidl_next::WireEnvelope::encode_value::<
20730 ::fidl_next::WireVector<
20731 'static,
20732 crate::wire::ConfigValueSpec<'static>,
20733 >,
20734 ___E,
20735 >(
20736 value, preallocated.encoder, &mut out, (4294967295, ())
20737 )?;
20738 } else {
20739 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20740 }
20741 }
20742
20743 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
20744 }
20745 unsafe {
20746 preallocated.write_next(out.assume_init_ref());
20747 }
20748 }
20749
20750 ::fidl_next::WireTable::encode_len(table, max_ord);
20751
20752 Ok(())
20753 }
20754 }
20755
20756 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ConfigValuesData<'static>, ___E>
20757 for &'a ConfigValuesData
20758 where
20759 ___E: ::fidl_next::Encoder + ?Sized,
20760 {
20761 #[inline]
20762 fn encode(
20763 self,
20764 encoder: &mut ___E,
20765 out: &mut ::core::mem::MaybeUninit<crate::wire::ConfigValuesData<'static>>,
20766 _: (),
20767 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20768 ::fidl_next::munge!(let crate::wire::ConfigValuesData { table } = out);
20769
20770 let max_ord = self.__max_ordinal();
20771
20772 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
20773 ::fidl_next::Wire::zero_padding(&mut out);
20774
20775 let mut preallocated =
20776 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
20777
20778 for i in 1..=max_ord {
20779 match i {
20780 2 => {
20781 if let Some(value) = &self.checksum {
20782 ::fidl_next::WireEnvelope::encode_value::<
20783 crate::wire::ConfigChecksum<'static>,
20784 ___E,
20785 >(
20786 value, preallocated.encoder, &mut out, ()
20787 )?;
20788 } else {
20789 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20790 }
20791 }
20792
20793 1 => {
20794 if let Some(value) = &self.values {
20795 ::fidl_next::WireEnvelope::encode_value::<
20796 ::fidl_next::WireVector<
20797 'static,
20798 crate::wire::ConfigValueSpec<'static>,
20799 >,
20800 ___E,
20801 >(
20802 value, preallocated.encoder, &mut out, (4294967295, ())
20803 )?;
20804 } else {
20805 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20806 }
20807 }
20808
20809 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
20810 }
20811 unsafe {
20812 preallocated.write_next(out.assume_init_ref());
20813 }
20814 }
20815
20816 ::fidl_next::WireTable::encode_len(table, max_ord);
20817
20818 Ok(())
20819 }
20820 }
20821
20822 impl<'de> ::fidl_next::FromWire<crate::wire::ConfigValuesData<'de>> for ConfigValuesData {
20823 #[inline]
20824 fn from_wire(wire_: crate::wire::ConfigValuesData<'de>) -> Self {
20825 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
20826
20827 let values = wire_.table.get(1);
20828
20829 let checksum = wire_.table.get(2);
20830
20831 Self {
20832
20833
20834 values: values.map(|envelope| ::fidl_next::FromWire::from_wire(
20835 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::ConfigValueSpec<'de>>>() }
20836 )),
20837
20838
20839 checksum: checksum.map(|envelope| ::fidl_next::FromWire::from_wire(
20840 unsafe { envelope.read_unchecked::<crate::wire::ConfigChecksum<'de>>() }
20841 )),
20842
20843 }
20844 }
20845 }
20846
20847 impl<'de> ::fidl_next::FromWireRef<crate::wire::ConfigValuesData<'de>> for ConfigValuesData {
20848 #[inline]
20849 fn from_wire_ref(wire: &crate::wire::ConfigValuesData<'de>) -> Self {
20850 Self {
20851
20852
20853 values: wire.table.get(1)
20854 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20855 unsafe { envelope.deref_unchecked::<::fidl_next::WireVector<'de, crate::wire::ConfigValueSpec<'de>>>() }
20856 )),
20857
20858
20859 checksum: wire.table.get(2)
20860 .map(|envelope| ::fidl_next::FromWireRef::from_wire_ref(
20861 unsafe { envelope.deref_unchecked::<crate::wire::ConfigChecksum<'de>>() }
20862 )),
20863
20864 }
20865 }
20866 }
20867
20868 #[doc = " Indicates the event name to subscribe to with a given event mode.\n"]
20869 #[derive(PartialEq, Clone, Debug, Default)]
20870 pub struct EventSubscription {
20871 pub event_name: ::core::option::Option<::std::string::String>,
20872 }
20873
20874 impl EventSubscription {
20875 fn __max_ordinal(&self) -> usize {
20876 if self.event_name.is_some() {
20877 return 1;
20878 }
20879
20880 0
20881 }
20882 }
20883
20884 unsafe impl<___E> ::fidl_next::Encode<crate::wire::EventSubscription<'static>, ___E>
20885 for EventSubscription
20886 where
20887 ___E: ::fidl_next::Encoder + ?Sized,
20888 {
20889 #[inline]
20890 fn encode(
20891 mut self,
20892 encoder: &mut ___E,
20893 out: &mut ::core::mem::MaybeUninit<crate::wire::EventSubscription<'static>>,
20894 _: (),
20895 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20896 ::fidl_next::munge!(let crate::wire::EventSubscription { table } = out);
20897
20898 let max_ord = self.__max_ordinal();
20899
20900 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
20901 ::fidl_next::Wire::zero_padding(&mut out);
20902
20903 let mut preallocated =
20904 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
20905
20906 for i in 1..=max_ord {
20907 match i {
20908 1 => {
20909 if let Some(value) = self.event_name.take() {
20910 ::fidl_next::WireEnvelope::encode_value::<
20911 ::fidl_next::WireString<'static>,
20912 ___E,
20913 >(
20914 value, preallocated.encoder, &mut out, 100
20915 )?;
20916 } else {
20917 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20918 }
20919 }
20920
20921 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
20922 }
20923 unsafe {
20924 preallocated.write_next(out.assume_init_ref());
20925 }
20926 }
20927
20928 ::fidl_next::WireTable::encode_len(table, max_ord);
20929
20930 Ok(())
20931 }
20932 }
20933
20934 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::EventSubscription<'static>, ___E>
20935 for &'a EventSubscription
20936 where
20937 ___E: ::fidl_next::Encoder + ?Sized,
20938 {
20939 #[inline]
20940 fn encode(
20941 self,
20942 encoder: &mut ___E,
20943 out: &mut ::core::mem::MaybeUninit<crate::wire::EventSubscription<'static>>,
20944 _: (),
20945 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
20946 ::fidl_next::munge!(let crate::wire::EventSubscription { table } = out);
20947
20948 let max_ord = self.__max_ordinal();
20949
20950 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
20951 ::fidl_next::Wire::zero_padding(&mut out);
20952
20953 let mut preallocated =
20954 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
20955
20956 for i in 1..=max_ord {
20957 match i {
20958 1 => {
20959 if let Some(value) = &self.event_name {
20960 ::fidl_next::WireEnvelope::encode_value::<
20961 ::fidl_next::WireString<'static>,
20962 ___E,
20963 >(
20964 value, preallocated.encoder, &mut out, 100
20965 )?;
20966 } else {
20967 ::fidl_next::WireEnvelope::encode_zero(&mut out)
20968 }
20969 }
20970
20971 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
20972 }
20973 unsafe {
20974 preallocated.write_next(out.assume_init_ref());
20975 }
20976 }
20977
20978 ::fidl_next::WireTable::encode_len(table, max_ord);
20979
20980 Ok(())
20981 }
20982 }
20983
20984 impl<'de> ::fidl_next::FromWire<crate::wire::EventSubscription<'de>> for EventSubscription {
20985 #[inline]
20986 fn from_wire(wire_: crate::wire::EventSubscription<'de>) -> Self {
20987 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
20988
20989 let event_name = wire_.table.get(1);
20990
20991 Self {
20992 event_name: event_name.map(|envelope| {
20993 ::fidl_next::FromWire::from_wire(unsafe {
20994 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
20995 })
20996 }),
20997 }
20998 }
20999 }
21000
21001 impl<'de> ::fidl_next::FromWireRef<crate::wire::EventSubscription<'de>> for EventSubscription {
21002 #[inline]
21003 fn from_wire_ref(wire: &crate::wire::EventSubscription<'de>) -> Self {
21004 Self {
21005 event_name: wire.table.get(1).map(|envelope| {
21006 ::fidl_next::FromWireRef::from_wire_ref(unsafe {
21007 envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
21008 })
21009 }),
21010 }
21011 }
21012 }
21013
21014 #[derive(PartialEq, Clone, Debug)]
21015 pub enum LayoutParameter {
21016 NestedType(crate::natural::ConfigType),
21017
21018 UnknownOrdinal_(u64),
21019 }
21020
21021 impl LayoutParameter {
21022 pub fn is_unknown(&self) -> bool {
21023 #[allow(unreachable_patterns)]
21024 match self {
21025 Self::UnknownOrdinal_(_) => true,
21026 _ => false,
21027 }
21028 }
21029 }
21030
21031 unsafe impl<___E> ::fidl_next::Encode<crate::wire::LayoutParameter<'static>, ___E>
21032 for LayoutParameter
21033 where
21034 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21035 ___E: ::fidl_next::Encoder,
21036 {
21037 #[inline]
21038 fn encode(
21039 self,
21040 encoder: &mut ___E,
21041 out: &mut ::core::mem::MaybeUninit<crate::wire::LayoutParameter<'static>>,
21042 _: (),
21043 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21044 ::fidl_next::munge!(let crate::wire::LayoutParameter { raw, _phantom: _ } = out);
21045
21046 match self {
21047 Self::NestedType(value) => ::fidl_next::RawWireUnion::encode_as::<
21048 ___E,
21049 crate::wire::ConfigType<'static>,
21050 >(value, 1, encoder, raw, ())?,
21051
21052 Self::UnknownOrdinal_(ordinal) => {
21053 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
21054 }
21055 }
21056
21057 Ok(())
21058 }
21059 }
21060
21061 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::LayoutParameter<'static>, ___E>
21062 for &'a LayoutParameter
21063 where
21064 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21065 ___E: ::fidl_next::Encoder,
21066 {
21067 #[inline]
21068 fn encode(
21069 self,
21070 encoder: &mut ___E,
21071 out: &mut ::core::mem::MaybeUninit<crate::wire::LayoutParameter<'static>>,
21072 _: (),
21073 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21074 ::fidl_next::munge!(let crate::wire::LayoutParameter { raw, _phantom: _ } = out);
21075
21076 match self {
21077 LayoutParameter::NestedType(value) => ::fidl_next::RawWireUnion::encode_as::<
21078 ___E,
21079 crate::wire::ConfigType<'static>,
21080 >(value, 1, encoder, raw, ())?,
21081
21082 LayoutParameter::UnknownOrdinal_(ordinal) => {
21083 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(*ordinal as usize));
21084 }
21085 }
21086
21087 Ok(())
21088 }
21089 }
21090
21091 unsafe impl<___E>
21092 ::fidl_next::EncodeOption<crate::wire_optional::LayoutParameter<'static>, ___E>
21093 for LayoutParameter
21094 where
21095 ___E: ?Sized,
21096 LayoutParameter: ::fidl_next::Encode<crate::wire::LayoutParameter<'static>, ___E>,
21097 {
21098 #[inline]
21099 fn encode_option(
21100 this: ::core::option::Option<Self>,
21101 encoder: &mut ___E,
21102 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::LayoutParameter<'static>>,
21103 _: (),
21104 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21105 ::fidl_next::munge!(let crate::wire_optional::LayoutParameter { raw, _phantom: _ } = &mut *out);
21106
21107 if let Some(inner) = this {
21108 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
21109 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
21110 } else {
21111 ::fidl_next::RawWireUnion::encode_absent(raw);
21112 }
21113
21114 Ok(())
21115 }
21116 }
21117
21118 unsafe impl<'a, ___E>
21119 ::fidl_next::EncodeOption<crate::wire_optional::LayoutParameter<'static>, ___E>
21120 for &'a LayoutParameter
21121 where
21122 ___E: ?Sized,
21123 &'a LayoutParameter: ::fidl_next::Encode<crate::wire::LayoutParameter<'static>, ___E>,
21124 {
21125 #[inline]
21126 fn encode_option(
21127 this: ::core::option::Option<Self>,
21128 encoder: &mut ___E,
21129 out: &mut ::core::mem::MaybeUninit<crate::wire_optional::LayoutParameter<'static>>,
21130 _: (),
21131 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21132 ::fidl_next::munge!(let crate::wire_optional::LayoutParameter { raw, _phantom: _ } = &mut *out);
21133
21134 if let Some(inner) = this {
21135 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
21136 ::fidl_next::Encode::encode(inner, encoder, value_out, ())?;
21137 } else {
21138 ::fidl_next::RawWireUnion::encode_absent(raw);
21139 }
21140
21141 Ok(())
21142 }
21143 }
21144
21145 impl<'de> ::fidl_next::FromWire<crate::wire::LayoutParameter<'de>> for LayoutParameter {
21146 #[inline]
21147 fn from_wire(wire: crate::wire::LayoutParameter<'de>) -> Self {
21148 let wire = ::core::mem::ManuallyDrop::new(wire);
21149 match wire.raw.ordinal() {
21150 1 => Self::NestedType(::fidl_next::FromWire::from_wire(unsafe {
21151 wire.raw.get().read_unchecked::<crate::wire::ConfigType<'de>>()
21152 })),
21153
21154 ord => return Self::UnknownOrdinal_(ord as u64),
21155 }
21156 }
21157 }
21158
21159 impl<'de> ::fidl_next::FromWireRef<crate::wire::LayoutParameter<'de>> for LayoutParameter {
21160 #[inline]
21161 fn from_wire_ref(wire: &crate::wire::LayoutParameter<'de>) -> Self {
21162 match wire.raw.ordinal() {
21163 1 => Self::NestedType(::fidl_next::FromWireRef::from_wire_ref(unsafe {
21164 wire.raw.get().deref_unchecked::<crate::wire::ConfigType<'de>>()
21165 })),
21166
21167 ord => return Self::UnknownOrdinal_(ord as u64),
21168 }
21169 }
21170 }
21171
21172 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::LayoutParameter<'de>>
21173 for LayoutParameter
21174 {
21175 #[inline]
21176 fn from_wire_option(
21177 wire: crate::wire_optional::LayoutParameter<'de>,
21178 ) -> ::core::option::Option<Self> {
21179 if let Some(inner) = wire.into_option() {
21180 Some(::fidl_next::FromWire::from_wire(inner))
21181 } else {
21182 None
21183 }
21184 }
21185 }
21186
21187 impl<'de> ::fidl_next::FromWireOption<crate::wire_optional::LayoutParameter<'de>>
21188 for Box<LayoutParameter>
21189 {
21190 #[inline]
21191 fn from_wire_option(
21192 wire: crate::wire_optional::LayoutParameter<'de>,
21193 ) -> ::core::option::Option<Self> {
21194 <LayoutParameter as ::fidl_next::FromWireOption<
21195 crate::wire_optional::LayoutParameter<'de>,
21196 >>::from_wire_option(wire)
21197 .map(Box::new)
21198 }
21199 }
21200
21201 impl<'de> ::fidl_next::FromWireOptionRef<crate::wire_optional::LayoutParameter<'de>>
21202 for Box<LayoutParameter>
21203 {
21204 #[inline]
21205 fn from_wire_option_ref(
21206 wire: &crate::wire_optional::LayoutParameter<'de>,
21207 ) -> ::core::option::Option<Self> {
21208 if let Some(inner) = wire.as_ref() {
21209 Some(Box::new(::fidl_next::FromWireRef::from_wire_ref(inner)))
21210 } else {
21211 None
21212 }
21213 }
21214 }
21215
21216 #[derive(PartialEq, Clone, Debug)]
21217 pub struct ResolvedConfigField {
21218 pub key: ::std::string::String,
21219
21220 pub value: crate::natural::ConfigValue,
21221 }
21222
21223 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ResolvedConfigField<'static>, ___E>
21224 for ResolvedConfigField
21225 where
21226 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21227 ___E: ::fidl_next::Encoder,
21228 {
21229 #[inline]
21230 fn encode(
21231 self,
21232 encoder_: &mut ___E,
21233 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfigField<'static>>,
21234 _: (),
21235 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21236 ::fidl_next::munge! {
21237 let crate::wire::ResolvedConfigField {
21238 key,
21239 value,
21240
21241 } = out_;
21242 }
21243
21244 ::fidl_next::Encode::encode(self.key, encoder_, key, 4294967295)?;
21245
21246 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(key.as_mut_ptr()) };
21247 ::fidl_next::Constrained::validate(_field, 4294967295)?;
21248
21249 ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
21250
21251 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
21252
21253 Ok(())
21254 }
21255 }
21256
21257 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ResolvedConfigField<'static>, ___E>
21258 for &'a ResolvedConfigField
21259 where
21260 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21261 ___E: ::fidl_next::Encoder,
21262 {
21263 #[inline]
21264 fn encode(
21265 self,
21266 encoder_: &mut ___E,
21267 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfigField<'static>>,
21268 _: (),
21269 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21270 ::fidl_next::munge! {
21271 let crate::wire::ResolvedConfigField {
21272
21273 key,
21274 value,
21275
21276 } = out_;
21277 }
21278
21279 ::fidl_next::Encode::encode(&self.key, encoder_, key, 4294967295)?;
21280
21281 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(key.as_mut_ptr()) };
21282 ::fidl_next::Constrained::validate(_field, 4294967295)?;
21283
21284 ::fidl_next::Encode::encode(&self.value, encoder_, value, ())?;
21285
21286 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(value.as_mut_ptr()) };
21287
21288 Ok(())
21289 }
21290 }
21291
21292 unsafe impl<___E>
21293 ::fidl_next::EncodeOption<
21294 ::fidl_next::WireBox<'static, crate::wire::ResolvedConfigField<'static>>,
21295 ___E,
21296 > for ResolvedConfigField
21297 where
21298 ___E: ::fidl_next::Encoder + ?Sized,
21299 ResolvedConfigField: ::fidl_next::Encode<crate::wire::ResolvedConfigField<'static>, ___E>,
21300 {
21301 #[inline]
21302 fn encode_option(
21303 this: ::core::option::Option<Self>,
21304 encoder: &mut ___E,
21305 out: &mut ::core::mem::MaybeUninit<
21306 ::fidl_next::WireBox<'static, crate::wire::ResolvedConfigField<'static>>,
21307 >,
21308 _: (),
21309 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21310 if let Some(inner) = this {
21311 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
21312 ::fidl_next::WireBox::encode_present(out);
21313 } else {
21314 ::fidl_next::WireBox::encode_absent(out);
21315 }
21316
21317 Ok(())
21318 }
21319 }
21320
21321 unsafe impl<'a, ___E>
21322 ::fidl_next::EncodeOption<
21323 ::fidl_next::WireBox<'static, crate::wire::ResolvedConfigField<'static>>,
21324 ___E,
21325 > for &'a ResolvedConfigField
21326 where
21327 ___E: ::fidl_next::Encoder + ?Sized,
21328 &'a ResolvedConfigField:
21329 ::fidl_next::Encode<crate::wire::ResolvedConfigField<'static>, ___E>,
21330 {
21331 #[inline]
21332 fn encode_option(
21333 this: ::core::option::Option<Self>,
21334 encoder: &mut ___E,
21335 out: &mut ::core::mem::MaybeUninit<
21336 ::fidl_next::WireBox<'static, crate::wire::ResolvedConfigField<'static>>,
21337 >,
21338 _: (),
21339 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21340 if let Some(inner) = this {
21341 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
21342 ::fidl_next::WireBox::encode_present(out);
21343 } else {
21344 ::fidl_next::WireBox::encode_absent(out);
21345 }
21346
21347 Ok(())
21348 }
21349 }
21350
21351 impl<'de> ::fidl_next::FromWire<crate::wire::ResolvedConfigField<'de>> for ResolvedConfigField {
21352 #[inline]
21353 fn from_wire(wire: crate::wire::ResolvedConfigField<'de>) -> Self {
21354 Self {
21355 key: ::fidl_next::FromWire::from_wire(wire.key),
21356
21357 value: ::fidl_next::FromWire::from_wire(wire.value),
21358 }
21359 }
21360 }
21361
21362 impl<'de> ::fidl_next::FromWireRef<crate::wire::ResolvedConfigField<'de>> for ResolvedConfigField {
21363 #[inline]
21364 fn from_wire_ref(wire: &crate::wire::ResolvedConfigField<'de>) -> Self {
21365 Self {
21366 key: ::fidl_next::FromWireRef::from_wire_ref(&wire.key),
21367
21368 value: ::fidl_next::FromWireRef::from_wire_ref(&wire.value),
21369 }
21370 }
21371 }
21372
21373 #[doc = " A configuration that has been completely resolved by component manager.\n"]
21374 #[derive(PartialEq, Clone, Debug)]
21375 pub struct ResolvedConfig {
21376 pub fields: ::std::vec::Vec<crate::natural::ResolvedConfigField>,
21377
21378 pub checksum: crate::natural::ConfigChecksum,
21379 }
21380
21381 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ResolvedConfig<'static>, ___E> for ResolvedConfig
21382 where
21383 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21384 ___E: ::fidl_next::Encoder,
21385 {
21386 #[inline]
21387 fn encode(
21388 self,
21389 encoder_: &mut ___E,
21390 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfig<'static>>,
21391 _: (),
21392 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21393 ::fidl_next::munge! {
21394 let crate::wire::ResolvedConfig {
21395 fields,
21396 checksum,
21397
21398 } = out_;
21399 }
21400
21401 ::fidl_next::Encode::encode(self.fields, encoder_, fields, (4294967295, ()))?;
21402
21403 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(fields.as_mut_ptr()) };
21404 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
21405
21406 ::fidl_next::Encode::encode(self.checksum, encoder_, checksum, ())?;
21407
21408 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(checksum.as_mut_ptr()) };
21409
21410 Ok(())
21411 }
21412 }
21413
21414 unsafe impl<'a, ___E> ::fidl_next::Encode<crate::wire::ResolvedConfig<'static>, ___E>
21415 for &'a ResolvedConfig
21416 where
21417 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
21418 ___E: ::fidl_next::Encoder,
21419 {
21420 #[inline]
21421 fn encode(
21422 self,
21423 encoder_: &mut ___E,
21424 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfig<'static>>,
21425 _: (),
21426 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21427 ::fidl_next::munge! {
21428 let crate::wire::ResolvedConfig {
21429
21430 fields,
21431 checksum,
21432
21433 } = out_;
21434 }
21435
21436 ::fidl_next::Encode::encode(&self.fields, encoder_, fields, (4294967295, ()))?;
21437
21438 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(fields.as_mut_ptr()) };
21439 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
21440
21441 ::fidl_next::Encode::encode(&self.checksum, encoder_, checksum, ())?;
21442
21443 let mut _field = unsafe { ::fidl_next::Slot::new_unchecked(checksum.as_mut_ptr()) };
21444
21445 Ok(())
21446 }
21447 }
21448
21449 unsafe impl<___E>
21450 ::fidl_next::EncodeOption<
21451 ::fidl_next::WireBox<'static, crate::wire::ResolvedConfig<'static>>,
21452 ___E,
21453 > for ResolvedConfig
21454 where
21455 ___E: ::fidl_next::Encoder + ?Sized,
21456 ResolvedConfig: ::fidl_next::Encode<crate::wire::ResolvedConfig<'static>, ___E>,
21457 {
21458 #[inline]
21459 fn encode_option(
21460 this: ::core::option::Option<Self>,
21461 encoder: &mut ___E,
21462 out: &mut ::core::mem::MaybeUninit<
21463 ::fidl_next::WireBox<'static, crate::wire::ResolvedConfig<'static>>,
21464 >,
21465 _: (),
21466 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21467 if let Some(inner) = this {
21468 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
21469 ::fidl_next::WireBox::encode_present(out);
21470 } else {
21471 ::fidl_next::WireBox::encode_absent(out);
21472 }
21473
21474 Ok(())
21475 }
21476 }
21477
21478 unsafe impl<'a, ___E>
21479 ::fidl_next::EncodeOption<
21480 ::fidl_next::WireBox<'static, crate::wire::ResolvedConfig<'static>>,
21481 ___E,
21482 > for &'a ResolvedConfig
21483 where
21484 ___E: ::fidl_next::Encoder + ?Sized,
21485 &'a ResolvedConfig: ::fidl_next::Encode<crate::wire::ResolvedConfig<'static>, ___E>,
21486 {
21487 #[inline]
21488 fn encode_option(
21489 this: ::core::option::Option<Self>,
21490 encoder: &mut ___E,
21491 out: &mut ::core::mem::MaybeUninit<
21492 ::fidl_next::WireBox<'static, crate::wire::ResolvedConfig<'static>>,
21493 >,
21494 _: (),
21495 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
21496 if let Some(inner) = this {
21497 ::fidl_next::EncoderExt::encode_next(encoder, inner, ())?;
21498 ::fidl_next::WireBox::encode_present(out);
21499 } else {
21500 ::fidl_next::WireBox::encode_absent(out);
21501 }
21502
21503 Ok(())
21504 }
21505 }
21506
21507 impl<'de> ::fidl_next::FromWire<crate::wire::ResolvedConfig<'de>> for ResolvedConfig {
21508 #[inline]
21509 fn from_wire(wire: crate::wire::ResolvedConfig<'de>) -> Self {
21510 Self {
21511 fields: ::fidl_next::FromWire::from_wire(wire.fields),
21512
21513 checksum: ::fidl_next::FromWire::from_wire(wire.checksum),
21514 }
21515 }
21516 }
21517
21518 impl<'de> ::fidl_next::FromWireRef<crate::wire::ResolvedConfig<'de>> for ResolvedConfig {
21519 #[inline]
21520 fn from_wire_ref(wire: &crate::wire::ResolvedConfig<'de>) -> Self {
21521 Self {
21522 fields: ::fidl_next::FromWireRef::from_wire_ref(&wire.fields),
21523
21524 checksum: ::fidl_next::FromWireRef::from_wire_ref(&wire.checksum),
21525 }
21526 }
21527 }
21528}
21529
21530pub mod wire {
21531
21532 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
21534 #[repr(transparent)]
21535 pub struct AllowedOffers {
21536 pub(crate) value: ::fidl_next::WireU32,
21537 }
21538
21539 unsafe impl ::fidl_next::Wire for AllowedOffers {
21540 type Owned<'de> = Self;
21541
21542 #[inline]
21543 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
21544 }
21546 }
21547
21548 impl AllowedOffers {
21549 pub const STATIC_ONLY: AllowedOffers = AllowedOffers { value: ::fidl_next::WireU32(1) };
21550
21551 pub const STATIC_AND_DYNAMIC: AllowedOffers =
21552 AllowedOffers { value: ::fidl_next::WireU32(2) };
21553 }
21554
21555 unsafe impl<___D> ::fidl_next::Decode<___D> for AllowedOffers
21556 where
21557 ___D: ?Sized,
21558 {
21559 fn decode(
21560 slot: ::fidl_next::Slot<'_, Self>,
21561 _: &mut ___D,
21562 _: (),
21563 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21564 ::fidl_next::munge!(let Self { value } = slot);
21565
21566 match u32::from(*value) {
21567 1 | 2 => (),
21568 unknown => {
21569 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
21570 }
21571 }
21572
21573 Ok(())
21574 }
21575 }
21576
21577 impl ::core::convert::From<crate::natural::AllowedOffers> for AllowedOffers {
21578 fn from(natural: crate::natural::AllowedOffers) -> Self {
21579 match natural {
21580 crate::natural::AllowedOffers::StaticOnly => AllowedOffers::STATIC_ONLY,
21581
21582 crate::natural::AllowedOffers::StaticAndDynamic => {
21583 AllowedOffers::STATIC_AND_DYNAMIC
21584 }
21585 }
21586 }
21587 }
21588
21589 impl ::fidl_next::IntoNatural for AllowedOffers {
21590 type Natural = crate::natural::AllowedOffers;
21591 }
21592
21593 impl ::fidl_next::Unconstrained for AllowedOffers {}
21594
21595 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
21597 #[repr(transparent)]
21598 pub struct Availability {
21599 pub(crate) value: ::fidl_next::WireU32,
21600 }
21601
21602 unsafe impl ::fidl_next::Wire for Availability {
21603 type Owned<'de> = Self;
21604
21605 #[inline]
21606 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
21607 }
21609 }
21610
21611 impl Availability {
21612 pub const REQUIRED: Availability = Availability { value: ::fidl_next::WireU32(1) };
21613
21614 pub const OPTIONAL: Availability = Availability { value: ::fidl_next::WireU32(2) };
21615
21616 pub const SAME_AS_TARGET: Availability = Availability { value: ::fidl_next::WireU32(3) };
21617
21618 pub const TRANSITIONAL: Availability = Availability { value: ::fidl_next::WireU32(4) };
21619 }
21620
21621 unsafe impl<___D> ::fidl_next::Decode<___D> for Availability
21622 where
21623 ___D: ?Sized,
21624 {
21625 fn decode(
21626 slot: ::fidl_next::Slot<'_, Self>,
21627 _: &mut ___D,
21628 _: (),
21629 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21630 ::fidl_next::munge!(let Self { value } = slot);
21631
21632 match u32::from(*value) {
21633 1 | 2 | 3 | 4 => (),
21634 unknown => {
21635 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
21636 }
21637 }
21638
21639 Ok(())
21640 }
21641 }
21642
21643 impl ::core::convert::From<crate::natural::Availability> for Availability {
21644 fn from(natural: crate::natural::Availability) -> Self {
21645 match natural {
21646 crate::natural::Availability::Required => Availability::REQUIRED,
21647
21648 crate::natural::Availability::Optional => Availability::OPTIONAL,
21649
21650 crate::natural::Availability::SameAsTarget => Availability::SAME_AS_TARGET,
21651
21652 crate::natural::Availability::Transitional => Availability::TRANSITIONAL,
21653 }
21654 }
21655 }
21656
21657 impl ::fidl_next::IntoNatural for Availability {
21658 type Natural = crate::natural::Availability;
21659 }
21660
21661 impl ::fidl_next::Unconstrained for Availability {}
21662
21663 pub type Name<'de> = ::fidl_next::WireString<'de>;
21665
21666 #[repr(C)]
21668 pub struct Service<'de> {
21669 pub(crate) table: ::fidl_next::WireTable<'de>,
21670 }
21671
21672 impl<'de> Drop for Service<'de> {
21673 fn drop(&mut self) {
21674 let _ = self.table.get(1).map(|envelope| unsafe {
21675 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
21676 });
21677
21678 let _ = self.table.get(2).map(|envelope| unsafe {
21679 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
21680 });
21681 }
21682 }
21683
21684 unsafe impl ::fidl_next::Wire for Service<'static> {
21685 type Owned<'de> = Service<'de>;
21686
21687 #[inline]
21688 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
21689 ::fidl_next::munge!(let Self { table } = out);
21690 ::fidl_next::WireTable::zero_padding(table);
21691 }
21692 }
21693
21694 unsafe impl<___D> ::fidl_next::Decode<___D> for Service<'static>
21695 where
21696 ___D: ::fidl_next::Decoder + ?Sized,
21697 {
21698 fn decode(
21699 slot: ::fidl_next::Slot<'_, Self>,
21700 decoder: &mut ___D,
21701 _: (),
21702 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21703 ::fidl_next::munge!(let Self { table } = slot);
21704
21705 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
21706 match ordinal {
21707 0 => unsafe { ::core::hint::unreachable_unchecked() },
21708
21709 1 => {
21710 ::fidl_next::WireEnvelope::decode_as::<
21711 ___D,
21712 ::fidl_next::WireString<'static>,
21713 >(slot.as_mut(), decoder, 100)?;
21714
21715 let value = unsafe {
21716 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
21717 };
21718
21719 if value.len() > 100 {
21720 return Err(::fidl_next::DecodeError::VectorTooLong {
21721 size: value.len() as u64,
21722 limit: 100,
21723 });
21724 }
21725
21726 Ok(())
21727 }
21728
21729 2 => {
21730 ::fidl_next::WireEnvelope::decode_as::<
21731 ___D,
21732 ::fidl_next::WireString<'static>,
21733 >(slot.as_mut(), decoder, 1024)?;
21734
21735 let value = unsafe {
21736 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
21737 };
21738
21739 if value.len() > 1024 {
21740 return Err(::fidl_next::DecodeError::VectorTooLong {
21741 size: value.len() as u64,
21742 limit: 1024,
21743 });
21744 }
21745
21746 Ok(())
21747 }
21748
21749 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
21750 }
21751 })
21752 }
21753 }
21754
21755 impl<'de> Service<'de> {
21756 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
21757 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
21758 }
21759
21760 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
21761 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
21762 }
21763 }
21764
21765 impl<'de> ::core::fmt::Debug for Service<'de> {
21766 fn fmt(
21767 &self,
21768 f: &mut ::core::fmt::Formatter<'_>,
21769 ) -> ::core::result::Result<(), ::core::fmt::Error> {
21770 f.debug_struct("Service")
21771 .field("name", &self.name())
21772 .field("source_path", &self.source_path())
21773 .finish()
21774 }
21775 }
21776
21777 impl<'de> ::fidl_next::IntoNatural for Service<'de> {
21778 type Natural = crate::natural::Service;
21779 }
21780
21781 impl ::fidl_next::Unconstrained for Service<'_> {}
21782
21783 #[repr(C)]
21785 pub struct Directory<'de> {
21786 pub(crate) table: ::fidl_next::WireTable<'de>,
21787 }
21788
21789 impl<'de> Drop for Directory<'de> {
21790 fn drop(&mut self) {
21791 let _ = self.table.get(1).map(|envelope| unsafe {
21792 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
21793 });
21794
21795 let _ = self.table.get(2).map(|envelope| unsafe {
21796 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
21797 });
21798
21799 let _ = self.table.get(3).map(|envelope| unsafe {
21800 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
21801 });
21802 }
21803 }
21804
21805 unsafe impl ::fidl_next::Wire for Directory<'static> {
21806 type Owned<'de> = Directory<'de>;
21807
21808 #[inline]
21809 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
21810 ::fidl_next::munge!(let Self { table } = out);
21811 ::fidl_next::WireTable::zero_padding(table);
21812 }
21813 }
21814
21815 unsafe impl<___D> ::fidl_next::Decode<___D> for Directory<'static>
21816 where
21817 ___D: ::fidl_next::Decoder + ?Sized,
21818 {
21819 fn decode(
21820 slot: ::fidl_next::Slot<'_, Self>,
21821 decoder: &mut ___D,
21822 _: (),
21823 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21824 ::fidl_next::munge!(let Self { table } = slot);
21825
21826 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
21827 match ordinal {
21828 0 => unsafe { ::core::hint::unreachable_unchecked() },
21829
21830 1 => {
21831 ::fidl_next::WireEnvelope::decode_as::<
21832 ___D,
21833 ::fidl_next::WireString<'static>,
21834 >(slot.as_mut(), decoder, 100)?;
21835
21836 let value = unsafe {
21837 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
21838 };
21839
21840 if value.len() > 100 {
21841 return Err(::fidl_next::DecodeError::VectorTooLong {
21842 size: value.len() as u64,
21843 limit: 100,
21844 });
21845 }
21846
21847 Ok(())
21848 }
21849
21850 2 => {
21851 ::fidl_next::WireEnvelope::decode_as::<
21852 ___D,
21853 ::fidl_next::WireString<'static>,
21854 >(slot.as_mut(), decoder, 1024)?;
21855
21856 let value = unsafe {
21857 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
21858 };
21859
21860 if value.len() > 1024 {
21861 return Err(::fidl_next::DecodeError::VectorTooLong {
21862 size: value.len() as u64,
21863 limit: 1024,
21864 });
21865 }
21866
21867 Ok(())
21868 }
21869
21870 3 => {
21871 ::fidl_next::WireEnvelope::decode_as::<
21872 ___D,
21873 ::fidl_next_common_fuchsia_io::wire::Operations,
21874 >(slot.as_mut(), decoder, ())?;
21875
21876 Ok(())
21877 }
21878
21879 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
21880 }
21881 })
21882 }
21883 }
21884
21885 impl<'de> Directory<'de> {
21886 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
21887 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
21888 }
21889
21890 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
21891 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
21892 }
21893
21894 pub fn rights(
21895 &self,
21896 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_io::wire::Operations> {
21897 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
21898 }
21899 }
21900
21901 impl<'de> ::core::fmt::Debug for Directory<'de> {
21902 fn fmt(
21903 &self,
21904 f: &mut ::core::fmt::Formatter<'_>,
21905 ) -> ::core::result::Result<(), ::core::fmt::Error> {
21906 f.debug_struct("Directory")
21907 .field("name", &self.name())
21908 .field("source_path", &self.source_path())
21909 .field("rights", &self.rights())
21910 .finish()
21911 }
21912 }
21913
21914 impl<'de> ::fidl_next::IntoNatural for Directory<'de> {
21915 type Natural = crate::natural::Directory;
21916 }
21917
21918 impl ::fidl_next::Unconstrained for Directory<'_> {}
21919
21920 #[derive(Clone, Debug)]
21922 #[repr(C)]
21923 pub struct ParentRef {
21924 pub(crate) _empty: fidl_next::WireEmptyStructPlaceholder,
21925 }
21926
21927 static_assertions::const_assert_eq!(std::mem::size_of::<ParentRef>(), 1);
21928 static_assertions::const_assert_eq!(std::mem::align_of::<ParentRef>(), 1);
21929
21930 unsafe impl ::fidl_next::Wire for ParentRef {
21931 type Owned<'de> = ParentRef;
21932
21933 #[inline]
21934 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
21935 ::fidl_next::munge! {
21936 let Self {
21937
21938 _empty,
21939
21940
21941 } = &mut *out_;
21942 }
21943 }
21944 }
21945
21946 unsafe impl<___D> ::fidl_next::Decode<___D> for ParentRef
21947 where
21948 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
21949 {
21950 fn decode(
21951 slot_: ::fidl_next::Slot<'_, Self>,
21952 decoder_: &mut ___D,
21953 _: (),
21954 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
21955 ::fidl_next::munge! {
21956 let Self {
21957
21958 mut _empty,
21959
21960
21961 } = slot_;
21962 }
21963
21964 if _empty.as_bytes() != &[0u8] {
21965 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
21966 }
21967
21968 Ok(())
21969 }
21970 }
21971
21972 impl ::fidl_next::IntoNatural for ParentRef {
21973 type Natural = crate::natural::ParentRef;
21974 }
21975
21976 impl ::fidl_next::Unconstrained for ParentRef {}
21977
21978 #[derive(Clone, Debug)]
21980 #[repr(C)]
21981 pub struct SelfRef {
21982 pub(crate) _empty: fidl_next::WireEmptyStructPlaceholder,
21983 }
21984
21985 static_assertions::const_assert_eq!(std::mem::size_of::<SelfRef>(), 1);
21986 static_assertions::const_assert_eq!(std::mem::align_of::<SelfRef>(), 1);
21987
21988 unsafe impl ::fidl_next::Wire for SelfRef {
21989 type Owned<'de> = SelfRef;
21990
21991 #[inline]
21992 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
21993 ::fidl_next::munge! {
21994 let Self {
21995
21996 _empty,
21997
21998
21999 } = &mut *out_;
22000 }
22001 }
22002 }
22003
22004 unsafe impl<___D> ::fidl_next::Decode<___D> for SelfRef
22005 where
22006 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22007 {
22008 fn decode(
22009 slot_: ::fidl_next::Slot<'_, Self>,
22010 decoder_: &mut ___D,
22011 _: (),
22012 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22013 ::fidl_next::munge! {
22014 let Self {
22015
22016 mut _empty,
22017
22018
22019 } = slot_;
22020 }
22021
22022 if _empty.as_bytes() != &[0u8] {
22023 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
22024 }
22025
22026 Ok(())
22027 }
22028 }
22029
22030 impl ::fidl_next::IntoNatural for SelfRef {
22031 type Natural = crate::natural::SelfRef;
22032 }
22033
22034 impl ::fidl_next::Unconstrained for SelfRef {}
22035
22036 pub type ChildName<'de> = ::fidl_next::WireString<'de>;
22038
22039 #[derive(Debug)]
22041 #[repr(C)]
22042 pub struct ChildRef<'de> {
22043 pub name: ::fidl_next::WireString<'de>,
22044
22045 pub collection: ::fidl_next::WireOptionalString<'de>,
22046 }
22047
22048 static_assertions::const_assert_eq!(std::mem::size_of::<ChildRef<'_>>(), 32);
22049 static_assertions::const_assert_eq!(std::mem::align_of::<ChildRef<'_>>(), 8);
22050
22051 static_assertions::const_assert_eq!(std::mem::offset_of!(ChildRef<'_>, name), 0);
22052
22053 static_assertions::const_assert_eq!(std::mem::offset_of!(ChildRef<'_>, collection), 16);
22054
22055 unsafe impl ::fidl_next::Wire for ChildRef<'static> {
22056 type Owned<'de> = ChildRef<'de>;
22057
22058 #[inline]
22059 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22060 ::fidl_next::munge! {
22061 let Self {
22062
22063 name,
22064 collection,
22065
22066 } = &mut *out_;
22067 }
22068
22069 ::fidl_next::Wire::zero_padding(name);
22070
22071 ::fidl_next::Wire::zero_padding(collection);
22072 }
22073 }
22074
22075 unsafe impl<___D> ::fidl_next::Decode<___D> for ChildRef<'static>
22076 where
22077 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22078 ___D: ::fidl_next::Decoder,
22079 {
22080 fn decode(
22081 slot_: ::fidl_next::Slot<'_, Self>,
22082 decoder_: &mut ___D,
22083 _: (),
22084 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22085 ::fidl_next::munge! {
22086 let Self {
22087
22088 mut name,
22089 mut collection,
22090
22091 } = slot_;
22092 }
22093
22094 let _field = name.as_mut();
22095 ::fidl_next::Constrained::validate(_field, 1024)?;
22096 ::fidl_next::Decode::decode(name.as_mut(), decoder_, 1024)?;
22097
22098 let name = unsafe { name.deref_unchecked() };
22099
22100 if name.len() > 1024 {
22101 return Err(::fidl_next::DecodeError::VectorTooLong {
22102 size: name.len() as u64,
22103 limit: 1024,
22104 });
22105 }
22106
22107 let _field = collection.as_mut();
22108 ::fidl_next::Constrained::validate(_field, 100)?;
22109 ::fidl_next::Decode::decode(collection.as_mut(), decoder_, 100)?;
22110
22111 let collection = unsafe { collection.deref_unchecked() };
22112
22113 if let Some(collection) = collection.as_ref() {
22114 if collection.len() > 100 {
22115 return Err(::fidl_next::DecodeError::VectorTooLong {
22116 size: collection.len() as u64,
22117 limit: 100,
22118 });
22119 }
22120 }
22121
22122 Ok(())
22123 }
22124 }
22125
22126 impl<'de> ::fidl_next::IntoNatural for ChildRef<'de> {
22127 type Natural = crate::natural::ChildRef;
22128 }
22129
22130 impl ::fidl_next::Unconstrained for ChildRef<'static> {}
22131
22132 #[derive(Debug)]
22134 #[repr(C)]
22135 pub struct CollectionRef<'de> {
22136 pub name: ::fidl_next::WireString<'de>,
22137 }
22138
22139 static_assertions::const_assert_eq!(std::mem::size_of::<CollectionRef<'_>>(), 16);
22140 static_assertions::const_assert_eq!(std::mem::align_of::<CollectionRef<'_>>(), 8);
22141
22142 static_assertions::const_assert_eq!(std::mem::offset_of!(CollectionRef<'_>, name), 0);
22143
22144 unsafe impl ::fidl_next::Wire for CollectionRef<'static> {
22145 type Owned<'de> = CollectionRef<'de>;
22146
22147 #[inline]
22148 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22149 ::fidl_next::munge! {
22150 let Self {
22151
22152 name,
22153
22154 } = &mut *out_;
22155 }
22156
22157 ::fidl_next::Wire::zero_padding(name);
22158 }
22159 }
22160
22161 unsafe impl<___D> ::fidl_next::Decode<___D> for CollectionRef<'static>
22162 where
22163 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22164 ___D: ::fidl_next::Decoder,
22165 {
22166 fn decode(
22167 slot_: ::fidl_next::Slot<'_, Self>,
22168 decoder_: &mut ___D,
22169 _: (),
22170 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22171 ::fidl_next::munge! {
22172 let Self {
22173
22174 mut name,
22175
22176 } = slot_;
22177 }
22178
22179 let _field = name.as_mut();
22180 ::fidl_next::Constrained::validate(_field, 100)?;
22181 ::fidl_next::Decode::decode(name.as_mut(), decoder_, 100)?;
22182
22183 let name = unsafe { name.deref_unchecked() };
22184
22185 if name.len() > 100 {
22186 return Err(::fidl_next::DecodeError::VectorTooLong {
22187 size: name.len() as u64,
22188 limit: 100,
22189 });
22190 }
22191
22192 Ok(())
22193 }
22194 }
22195
22196 impl<'de> ::fidl_next::IntoNatural for CollectionRef<'de> {
22197 type Natural = crate::natural::CollectionRef;
22198 }
22199
22200 impl ::fidl_next::Unconstrained for CollectionRef<'static> {}
22201
22202 #[derive(Clone, Debug)]
22204 #[repr(C)]
22205 pub struct FrameworkRef {
22206 pub(crate) _empty: fidl_next::WireEmptyStructPlaceholder,
22207 }
22208
22209 static_assertions::const_assert_eq!(std::mem::size_of::<FrameworkRef>(), 1);
22210 static_assertions::const_assert_eq!(std::mem::align_of::<FrameworkRef>(), 1);
22211
22212 unsafe impl ::fidl_next::Wire for FrameworkRef {
22213 type Owned<'de> = FrameworkRef;
22214
22215 #[inline]
22216 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22217 ::fidl_next::munge! {
22218 let Self {
22219
22220 _empty,
22221
22222
22223 } = &mut *out_;
22224 }
22225 }
22226 }
22227
22228 unsafe impl<___D> ::fidl_next::Decode<___D> for FrameworkRef
22229 where
22230 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22231 {
22232 fn decode(
22233 slot_: ::fidl_next::Slot<'_, Self>,
22234 decoder_: &mut ___D,
22235 _: (),
22236 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22237 ::fidl_next::munge! {
22238 let Self {
22239
22240 mut _empty,
22241
22242
22243 } = slot_;
22244 }
22245
22246 if _empty.as_bytes() != &[0u8] {
22247 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
22248 }
22249
22250 Ok(())
22251 }
22252 }
22253
22254 impl ::fidl_next::IntoNatural for FrameworkRef {
22255 type Natural = crate::natural::FrameworkRef;
22256 }
22257
22258 impl ::fidl_next::Unconstrained for FrameworkRef {}
22259
22260 #[derive(Debug)]
22262 #[repr(C)]
22263 pub struct CapabilityRef<'de> {
22264 pub name: ::fidl_next::WireString<'de>,
22265 }
22266
22267 static_assertions::const_assert_eq!(std::mem::size_of::<CapabilityRef<'_>>(), 16);
22268 static_assertions::const_assert_eq!(std::mem::align_of::<CapabilityRef<'_>>(), 8);
22269
22270 static_assertions::const_assert_eq!(std::mem::offset_of!(CapabilityRef<'_>, name), 0);
22271
22272 unsafe impl ::fidl_next::Wire for CapabilityRef<'static> {
22273 type Owned<'de> = CapabilityRef<'de>;
22274
22275 #[inline]
22276 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22277 ::fidl_next::munge! {
22278 let Self {
22279
22280 name,
22281
22282 } = &mut *out_;
22283 }
22284
22285 ::fidl_next::Wire::zero_padding(name);
22286 }
22287 }
22288
22289 unsafe impl<___D> ::fidl_next::Decode<___D> for CapabilityRef<'static>
22290 where
22291 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22292 ___D: ::fidl_next::Decoder,
22293 {
22294 fn decode(
22295 slot_: ::fidl_next::Slot<'_, Self>,
22296 decoder_: &mut ___D,
22297 _: (),
22298 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22299 ::fidl_next::munge! {
22300 let Self {
22301
22302 mut name,
22303
22304 } = slot_;
22305 }
22306
22307 let _field = name.as_mut();
22308 ::fidl_next::Constrained::validate(_field, 100)?;
22309 ::fidl_next::Decode::decode(name.as_mut(), decoder_, 100)?;
22310
22311 let name = unsafe { name.deref_unchecked() };
22312
22313 if name.len() > 100 {
22314 return Err(::fidl_next::DecodeError::VectorTooLong {
22315 size: name.len() as u64,
22316 limit: 100,
22317 });
22318 }
22319
22320 Ok(())
22321 }
22322 }
22323
22324 impl<'de> ::fidl_next::IntoNatural for CapabilityRef<'de> {
22325 type Natural = crate::natural::CapabilityRef;
22326 }
22327
22328 impl ::fidl_next::Unconstrained for CapabilityRef<'static> {}
22329
22330 #[derive(Clone, Debug)]
22332 #[repr(C)]
22333 pub struct DebugRef {
22334 pub(crate) _empty: fidl_next::WireEmptyStructPlaceholder,
22335 }
22336
22337 static_assertions::const_assert_eq!(std::mem::size_of::<DebugRef>(), 1);
22338 static_assertions::const_assert_eq!(std::mem::align_of::<DebugRef>(), 1);
22339
22340 unsafe impl ::fidl_next::Wire for DebugRef {
22341 type Owned<'de> = DebugRef;
22342
22343 #[inline]
22344 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22345 ::fidl_next::munge! {
22346 let Self {
22347
22348 _empty,
22349
22350
22351 } = &mut *out_;
22352 }
22353 }
22354 }
22355
22356 unsafe impl<___D> ::fidl_next::Decode<___D> for DebugRef
22357 where
22358 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22359 {
22360 fn decode(
22361 slot_: ::fidl_next::Slot<'_, Self>,
22362 decoder_: &mut ___D,
22363 _: (),
22364 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22365 ::fidl_next::munge! {
22366 let Self {
22367
22368 mut _empty,
22369
22370
22371 } = slot_;
22372 }
22373
22374 if _empty.as_bytes() != &[0u8] {
22375 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
22376 }
22377
22378 Ok(())
22379 }
22380 }
22381
22382 impl ::fidl_next::IntoNatural for DebugRef {
22383 type Natural = crate::natural::DebugRef;
22384 }
22385
22386 impl ::fidl_next::Unconstrained for DebugRef {}
22387
22388 #[derive(Clone, Debug)]
22390 #[repr(C)]
22391 pub struct VoidRef {
22392 pub(crate) _empty: fidl_next::WireEmptyStructPlaceholder,
22393 }
22394
22395 static_assertions::const_assert_eq!(std::mem::size_of::<VoidRef>(), 1);
22396 static_assertions::const_assert_eq!(std::mem::align_of::<VoidRef>(), 1);
22397
22398 unsafe impl ::fidl_next::Wire for VoidRef {
22399 type Owned<'de> = VoidRef;
22400
22401 #[inline]
22402 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
22403 ::fidl_next::munge! {
22404 let Self {
22405
22406 _empty,
22407
22408
22409 } = &mut *out_;
22410 }
22411 }
22412 }
22413
22414 unsafe impl<___D> ::fidl_next::Decode<___D> for VoidRef
22415 where
22416 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22417 {
22418 fn decode(
22419 slot_: ::fidl_next::Slot<'_, Self>,
22420 decoder_: &mut ___D,
22421 _: (),
22422 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22423 ::fidl_next::munge! {
22424 let Self {
22425
22426 mut _empty,
22427
22428
22429 } = slot_;
22430 }
22431
22432 if _empty.as_bytes() != &[0u8] {
22433 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
22434 }
22435
22436 Ok(())
22437 }
22438 }
22439
22440 impl ::fidl_next::IntoNatural for VoidRef {
22441 type Natural = crate::natural::VoidRef;
22442 }
22443
22444 impl ::fidl_next::Unconstrained for VoidRef {}
22445
22446 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
22448 #[repr(transparent)]
22449 pub struct StorageId {
22450 pub(crate) value: ::fidl_next::WireU32,
22451 }
22452
22453 unsafe impl ::fidl_next::Wire for StorageId {
22454 type Owned<'de> = Self;
22455
22456 #[inline]
22457 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
22458 }
22460 }
22461
22462 impl StorageId {
22463 pub const STATIC_INSTANCE_ID: StorageId = StorageId { value: ::fidl_next::WireU32(1) };
22464
22465 pub const STATIC_INSTANCE_ID_OR_MONIKER: StorageId =
22466 StorageId { value: ::fidl_next::WireU32(2) };
22467 }
22468
22469 unsafe impl<___D> ::fidl_next::Decode<___D> for StorageId
22470 where
22471 ___D: ?Sized,
22472 {
22473 fn decode(
22474 slot: ::fidl_next::Slot<'_, Self>,
22475 _: &mut ___D,
22476 _: (),
22477 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22478 ::fidl_next::munge!(let Self { value } = slot);
22479
22480 match u32::from(*value) {
22481 1 | 2 => (),
22482 unknown => {
22483 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
22484 }
22485 }
22486
22487 Ok(())
22488 }
22489 }
22490
22491 impl ::core::convert::From<crate::natural::StorageId> for StorageId {
22492 fn from(natural: crate::natural::StorageId) -> Self {
22493 match natural {
22494 crate::natural::StorageId::StaticInstanceId => StorageId::STATIC_INSTANCE_ID,
22495
22496 crate::natural::StorageId::StaticInstanceIdOrMoniker => {
22497 StorageId::STATIC_INSTANCE_ID_OR_MONIKER
22498 }
22499 }
22500 }
22501 }
22502
22503 impl ::fidl_next::IntoNatural for StorageId {
22504 type Natural = crate::natural::StorageId;
22505 }
22506
22507 impl ::fidl_next::Unconstrained for StorageId {}
22508
22509 #[repr(C)]
22511 pub struct Runner<'de> {
22512 pub(crate) table: ::fidl_next::WireTable<'de>,
22513 }
22514
22515 impl<'de> Drop for Runner<'de> {
22516 fn drop(&mut self) {
22517 let _ = self.table.get(1).map(|envelope| unsafe {
22518 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
22519 });
22520
22521 let _ = self.table.get(2).map(|envelope| unsafe {
22522 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
22523 });
22524 }
22525 }
22526
22527 unsafe impl ::fidl_next::Wire for Runner<'static> {
22528 type Owned<'de> = Runner<'de>;
22529
22530 #[inline]
22531 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
22532 ::fidl_next::munge!(let Self { table } = out);
22533 ::fidl_next::WireTable::zero_padding(table);
22534 }
22535 }
22536
22537 unsafe impl<___D> ::fidl_next::Decode<___D> for Runner<'static>
22538 where
22539 ___D: ::fidl_next::Decoder + ?Sized,
22540 {
22541 fn decode(
22542 slot: ::fidl_next::Slot<'_, Self>,
22543 decoder: &mut ___D,
22544 _: (),
22545 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22546 ::fidl_next::munge!(let Self { table } = slot);
22547
22548 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
22549 match ordinal {
22550 0 => unsafe { ::core::hint::unreachable_unchecked() },
22551
22552 1 => {
22553 ::fidl_next::WireEnvelope::decode_as::<
22554 ___D,
22555 ::fidl_next::WireString<'static>,
22556 >(slot.as_mut(), decoder, 100)?;
22557
22558 let value = unsafe {
22559 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
22560 };
22561
22562 if value.len() > 100 {
22563 return Err(::fidl_next::DecodeError::VectorTooLong {
22564 size: value.len() as u64,
22565 limit: 100,
22566 });
22567 }
22568
22569 Ok(())
22570 }
22571
22572 2 => {
22573 ::fidl_next::WireEnvelope::decode_as::<
22574 ___D,
22575 ::fidl_next::WireString<'static>,
22576 >(slot.as_mut(), decoder, 1024)?;
22577
22578 let value = unsafe {
22579 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
22580 };
22581
22582 if value.len() > 1024 {
22583 return Err(::fidl_next::DecodeError::VectorTooLong {
22584 size: value.len() as u64,
22585 limit: 1024,
22586 });
22587 }
22588
22589 Ok(())
22590 }
22591
22592 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
22593 }
22594 })
22595 }
22596 }
22597
22598 impl<'de> Runner<'de> {
22599 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
22600 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
22601 }
22602
22603 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
22604 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
22605 }
22606 }
22607
22608 impl<'de> ::core::fmt::Debug for Runner<'de> {
22609 fn fmt(
22610 &self,
22611 f: &mut ::core::fmt::Formatter<'_>,
22612 ) -> ::core::result::Result<(), ::core::fmt::Error> {
22613 f.debug_struct("Runner")
22614 .field("name", &self.name())
22615 .field("source_path", &self.source_path())
22616 .finish()
22617 }
22618 }
22619
22620 impl<'de> ::fidl_next::IntoNatural for Runner<'de> {
22621 type Natural = crate::natural::Runner;
22622 }
22623
22624 impl ::fidl_next::Unconstrained for Runner<'_> {}
22625
22626 #[repr(C)]
22628 pub struct Resolver<'de> {
22629 pub(crate) table: ::fidl_next::WireTable<'de>,
22630 }
22631
22632 impl<'de> Drop for Resolver<'de> {
22633 fn drop(&mut self) {
22634 let _ = self.table.get(1).map(|envelope| unsafe {
22635 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
22636 });
22637
22638 let _ = self.table.get(2).map(|envelope| unsafe {
22639 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
22640 });
22641 }
22642 }
22643
22644 unsafe impl ::fidl_next::Wire for Resolver<'static> {
22645 type Owned<'de> = Resolver<'de>;
22646
22647 #[inline]
22648 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
22649 ::fidl_next::munge!(let Self { table } = out);
22650 ::fidl_next::WireTable::zero_padding(table);
22651 }
22652 }
22653
22654 unsafe impl<___D> ::fidl_next::Decode<___D> for Resolver<'static>
22655 where
22656 ___D: ::fidl_next::Decoder + ?Sized,
22657 {
22658 fn decode(
22659 slot: ::fidl_next::Slot<'_, Self>,
22660 decoder: &mut ___D,
22661 _: (),
22662 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22663 ::fidl_next::munge!(let Self { table } = slot);
22664
22665 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
22666 match ordinal {
22667 0 => unsafe { ::core::hint::unreachable_unchecked() },
22668
22669 1 => {
22670 ::fidl_next::WireEnvelope::decode_as::<
22671 ___D,
22672 ::fidl_next::WireString<'static>,
22673 >(slot.as_mut(), decoder, 100)?;
22674
22675 let value = unsafe {
22676 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
22677 };
22678
22679 if value.len() > 100 {
22680 return Err(::fidl_next::DecodeError::VectorTooLong {
22681 size: value.len() as u64,
22682 limit: 100,
22683 });
22684 }
22685
22686 Ok(())
22687 }
22688
22689 2 => {
22690 ::fidl_next::WireEnvelope::decode_as::<
22691 ___D,
22692 ::fidl_next::WireString<'static>,
22693 >(slot.as_mut(), decoder, 1024)?;
22694
22695 let value = unsafe {
22696 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
22697 };
22698
22699 if value.len() > 1024 {
22700 return Err(::fidl_next::DecodeError::VectorTooLong {
22701 size: value.len() as u64,
22702 limit: 1024,
22703 });
22704 }
22705
22706 Ok(())
22707 }
22708
22709 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
22710 }
22711 })
22712 }
22713 }
22714
22715 impl<'de> Resolver<'de> {
22716 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
22717 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
22718 }
22719
22720 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
22721 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
22722 }
22723 }
22724
22725 impl<'de> ::core::fmt::Debug for Resolver<'de> {
22726 fn fmt(
22727 &self,
22728 f: &mut ::core::fmt::Formatter<'_>,
22729 ) -> ::core::result::Result<(), ::core::fmt::Error> {
22730 f.debug_struct("Resolver")
22731 .field("name", &self.name())
22732 .field("source_path", &self.source_path())
22733 .finish()
22734 }
22735 }
22736
22737 impl<'de> ::fidl_next::IntoNatural for Resolver<'de> {
22738 type Natural = crate::natural::Resolver;
22739 }
22740
22741 impl ::fidl_next::Unconstrained for Resolver<'_> {}
22742
22743 #[repr(C)]
22745 pub struct EventStream<'de> {
22746 pub(crate) table: ::fidl_next::WireTable<'de>,
22747 }
22748
22749 impl<'de> Drop for EventStream<'de> {
22750 fn drop(&mut self) {
22751 let _ = self.table.get(1).map(|envelope| unsafe {
22752 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
22753 });
22754 }
22755 }
22756
22757 unsafe impl ::fidl_next::Wire for EventStream<'static> {
22758 type Owned<'de> = EventStream<'de>;
22759
22760 #[inline]
22761 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
22762 ::fidl_next::munge!(let Self { table } = out);
22763 ::fidl_next::WireTable::zero_padding(table);
22764 }
22765 }
22766
22767 unsafe impl<___D> ::fidl_next::Decode<___D> for EventStream<'static>
22768 where
22769 ___D: ::fidl_next::Decoder + ?Sized,
22770 {
22771 fn decode(
22772 slot: ::fidl_next::Slot<'_, Self>,
22773 decoder: &mut ___D,
22774 _: (),
22775 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22776 ::fidl_next::munge!(let Self { table } = slot);
22777
22778 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
22779 match ordinal {
22780 0 => unsafe { ::core::hint::unreachable_unchecked() },
22781
22782 1 => {
22783 ::fidl_next::WireEnvelope::decode_as::<
22784 ___D,
22785 ::fidl_next::WireString<'static>,
22786 >(slot.as_mut(), decoder, 100)?;
22787
22788 let value = unsafe {
22789 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
22790 };
22791
22792 if value.len() > 100 {
22793 return Err(::fidl_next::DecodeError::VectorTooLong {
22794 size: value.len() as u64,
22795 limit: 100,
22796 });
22797 }
22798
22799 Ok(())
22800 }
22801
22802 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
22803 }
22804 })
22805 }
22806 }
22807
22808 impl<'de> EventStream<'de> {
22809 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
22810 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
22811 }
22812 }
22813
22814 impl<'de> ::core::fmt::Debug for EventStream<'de> {
22815 fn fmt(
22816 &self,
22817 f: &mut ::core::fmt::Formatter<'_>,
22818 ) -> ::core::result::Result<(), ::core::fmt::Error> {
22819 f.debug_struct("EventStream").field("name", &self.name()).finish()
22820 }
22821 }
22822
22823 impl<'de> ::fidl_next::IntoNatural for EventStream<'de> {
22824 type Natural = crate::natural::EventStream;
22825 }
22826
22827 impl ::fidl_next::Unconstrained for EventStream<'_> {}
22828
22829 #[repr(transparent)]
22831 pub struct ConfigSingleValue<'de> {
22832 pub(crate) raw: ::fidl_next::RawWireUnion,
22833 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
22834 }
22835
22836 impl<'de> Drop for ConfigSingleValue<'de> {
22837 fn drop(&mut self) {
22838 match self.raw.ordinal() {
22839 1 => {
22840 let _ = unsafe { self.raw.get().read_unchecked::<bool>() };
22841 }
22842
22843 2 => {
22844 let _ = unsafe { self.raw.get().read_unchecked::<u8>() };
22845 }
22846
22847 3 => {
22848 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU16>() };
22849 }
22850
22851 4 => {
22852 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU32>() };
22853 }
22854
22855 5 => {
22856 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU64>() };
22857 }
22858
22859 6 => {
22860 let _ = unsafe { self.raw.get().read_unchecked::<i8>() };
22861 }
22862
22863 7 => {
22864 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireI16>() };
22865 }
22866
22867 8 => {
22868 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireI32>() };
22869 }
22870
22871 9 => {
22872 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireI64>() };
22873 }
22874
22875 10 => {
22876 let _ =
22877 unsafe { self.raw.get().read_unchecked::<::fidl_next::WireString<'de>>() };
22878 }
22879
22880 _ => (),
22881 }
22882 }
22883 }
22884
22885 unsafe impl ::fidl_next::Wire for ConfigSingleValue<'static> {
22886 type Owned<'de> = ConfigSingleValue<'de>;
22887
22888 #[inline]
22889 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
22890 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
22891 ::fidl_next::RawWireUnion::zero_padding(raw);
22892 }
22893 }
22894
22895 pub mod config_single_value {
22896 pub enum Ref<'de> {
22897 Bool(&'de bool),
22898
22899 Uint8(&'de u8),
22900
22901 Uint16(&'de ::fidl_next::WireU16),
22902
22903 Uint32(&'de ::fidl_next::WireU32),
22904
22905 Uint64(&'de ::fidl_next::WireU64),
22906
22907 Int8(&'de i8),
22908
22909 Int16(&'de ::fidl_next::WireI16),
22910
22911 Int32(&'de ::fidl_next::WireI32),
22912
22913 Int64(&'de ::fidl_next::WireI64),
22914
22915 String(&'de ::fidl_next::WireString<'de>),
22916
22917 UnknownOrdinal_(u64),
22918 }
22919 }
22920
22921 impl<'de> ConfigSingleValue<'de> {
22922 pub fn as_ref(&self) -> crate::wire::config_single_value::Ref<'_> {
22923 match self.raw.ordinal() {
22924 1 => crate::wire::config_single_value::Ref::Bool(unsafe {
22925 self.raw.get().deref_unchecked::<bool>()
22926 }),
22927
22928 2 => crate::wire::config_single_value::Ref::Uint8(unsafe {
22929 self.raw.get().deref_unchecked::<u8>()
22930 }),
22931
22932 3 => crate::wire::config_single_value::Ref::Uint16(unsafe {
22933 self.raw.get().deref_unchecked::<::fidl_next::WireU16>()
22934 }),
22935
22936 4 => crate::wire::config_single_value::Ref::Uint32(unsafe {
22937 self.raw.get().deref_unchecked::<::fidl_next::WireU32>()
22938 }),
22939
22940 5 => crate::wire::config_single_value::Ref::Uint64(unsafe {
22941 self.raw.get().deref_unchecked::<::fidl_next::WireU64>()
22942 }),
22943
22944 6 => crate::wire::config_single_value::Ref::Int8(unsafe {
22945 self.raw.get().deref_unchecked::<i8>()
22946 }),
22947
22948 7 => crate::wire::config_single_value::Ref::Int16(unsafe {
22949 self.raw.get().deref_unchecked::<::fidl_next::WireI16>()
22950 }),
22951
22952 8 => crate::wire::config_single_value::Ref::Int32(unsafe {
22953 self.raw.get().deref_unchecked::<::fidl_next::WireI32>()
22954 }),
22955
22956 9 => crate::wire::config_single_value::Ref::Int64(unsafe {
22957 self.raw.get().deref_unchecked::<::fidl_next::WireI64>()
22958 }),
22959
22960 10 => crate::wire::config_single_value::Ref::String(unsafe {
22961 self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>()
22962 }),
22963
22964 unknown => crate::wire::config_single_value::Ref::UnknownOrdinal_(unknown),
22965 }
22966 }
22967 }
22968
22969 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigSingleValue<'static>
22970 where
22971 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
22972 ___D: ::fidl_next::Decoder,
22973 {
22974 fn decode(
22975 mut slot: ::fidl_next::Slot<'_, Self>,
22976 decoder: &mut ___D,
22977 _: (),
22978 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
22979 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
22980 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
22981 1 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder, ())?,
22982
22983 2 => ::fidl_next::RawWireUnion::decode_as::<___D, u8>(raw, decoder, ())?,
22984
22985 3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU16>(
22986 raw,
22987 decoder,
22988 (),
22989 )?,
22990
22991 4 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(
22992 raw,
22993 decoder,
22994 (),
22995 )?,
22996
22997 5 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU64>(
22998 raw,
22999 decoder,
23000 (),
23001 )?,
23002
23003 6 => ::fidl_next::RawWireUnion::decode_as::<___D, i8>(raw, decoder, ())?,
23004
23005 7 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI16>(
23006 raw,
23007 decoder,
23008 (),
23009 )?,
23010
23011 8 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI32>(
23012 raw,
23013 decoder,
23014 (),
23015 )?,
23016
23017 9 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI64>(
23018 raw,
23019 decoder,
23020 (),
23021 )?,
23022
23023 10 => {
23024 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
23025 raw, decoder, 4294967295,
23026 )?
23027 }
23028
23029 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
23030 }
23031
23032 Ok(())
23033 }
23034 }
23035
23036 impl<'de> ::core::fmt::Debug for ConfigSingleValue<'de> {
23037 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
23038 match self.raw.ordinal() {
23039 1 => unsafe { self.raw.get().deref_unchecked::<bool>().fmt(f) },
23040 2 => unsafe { self.raw.get().deref_unchecked::<u8>().fmt(f) },
23041 3 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU16>().fmt(f) },
23042 4 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU32>().fmt(f) },
23043 5 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU64>().fmt(f) },
23044 6 => unsafe { self.raw.get().deref_unchecked::<i8>().fmt(f) },
23045 7 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireI16>().fmt(f) },
23046 8 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireI32>().fmt(f) },
23047 9 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireI64>().fmt(f) },
23048 10 => unsafe {
23049 self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>().fmt(f)
23050 },
23051 _ => unsafe { ::core::hint::unreachable_unchecked() },
23052 }
23053 }
23054 }
23055
23056 impl<'de> ::fidl_next::IntoNatural for ConfigSingleValue<'de> {
23057 type Natural = crate::natural::ConfigSingleValue;
23058 }
23059
23060 impl ::fidl_next::Unconstrained for ConfigSingleValue<'static> {}
23061
23062 #[repr(transparent)]
23064 pub struct ConfigVectorValue<'de> {
23065 pub(crate) raw: ::fidl_next::RawWireUnion,
23066 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
23067 }
23068
23069 impl<'de> Drop for ConfigVectorValue<'de> {
23070 fn drop(&mut self) {
23071 match self.raw.ordinal() {
23072 1 => {
23073 let _ = unsafe {
23074 self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, bool>>()
23075 };
23076 }
23077
23078 2 => {
23079 let _ = unsafe {
23080 self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, u8>>()
23081 };
23082 }
23083
23084 3 => {
23085 let _ = unsafe {
23086 self.raw
23087 .get()
23088 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU16>>()
23089 };
23090 }
23091
23092 4 => {
23093 let _ = unsafe {
23094 self.raw
23095 .get()
23096 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU32>>()
23097 };
23098 }
23099
23100 5 => {
23101 let _ = unsafe {
23102 self.raw
23103 .get()
23104 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireU64>>()
23105 };
23106 }
23107
23108 6 => {
23109 let _ = unsafe {
23110 self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, i8>>()
23111 };
23112 }
23113
23114 7 => {
23115 let _ = unsafe {
23116 self.raw
23117 .get()
23118 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI16>>()
23119 };
23120 }
23121
23122 8 => {
23123 let _ = unsafe {
23124 self.raw
23125 .get()
23126 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI32>>()
23127 };
23128 }
23129
23130 9 => {
23131 let _ = unsafe {
23132 self.raw
23133 .get()
23134 .read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireI64>>()
23135 };
23136 }
23137
23138 10 => {
23139 let _ = unsafe {
23140 self.raw.get().read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
23141 };
23142 }
23143
23144 _ => (),
23145 }
23146 }
23147 }
23148
23149 unsafe impl ::fidl_next::Wire for ConfigVectorValue<'static> {
23150 type Owned<'de> = ConfigVectorValue<'de>;
23151
23152 #[inline]
23153 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23154 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
23155 ::fidl_next::RawWireUnion::zero_padding(raw);
23156 }
23157 }
23158
23159 pub mod config_vector_value {
23160 pub enum Ref<'de> {
23161 BoolVector(&'de ::fidl_next::WireVector<'de, bool>),
23162
23163 Uint8Vector(&'de ::fidl_next::WireVector<'de, u8>),
23164
23165 Uint16Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireU16>),
23166
23167 Uint32Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireU32>),
23168
23169 Uint64Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireU64>),
23170
23171 Int8Vector(&'de ::fidl_next::WireVector<'de, i8>),
23172
23173 Int16Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireI16>),
23174
23175 Int32Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireI32>),
23176
23177 Int64Vector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireI64>),
23178
23179 StringVector(&'de ::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>),
23180
23181 UnknownOrdinal_(u64),
23182 }
23183 }
23184
23185 impl<'de> ConfigVectorValue<'de> {
23186 pub fn as_ref(&self) -> crate::wire::config_vector_value::Ref<'_> {
23187 match self.raw.ordinal() {
23188 1 => crate::wire::config_vector_value::Ref::BoolVector(unsafe {
23189 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, bool>>()
23190 }),
23191
23192 2 => crate::wire::config_vector_value::Ref::Uint8Vector(unsafe {
23193 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>()
23194 }),
23195
23196 3 => crate::wire::config_vector_value::Ref::Uint16Vector(unsafe {
23197 self.raw
23198 .get()
23199 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU16>>()
23200 }),
23201
23202 4 => crate::wire::config_vector_value::Ref::Uint32Vector(unsafe {
23203 self.raw
23204 .get()
23205 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU32>>()
23206 }),
23207
23208 5 => crate::wire::config_vector_value::Ref::Uint64Vector(unsafe {
23209 self.raw
23210 .get()
23211 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU64>>()
23212 }),
23213
23214 6 => crate::wire::config_vector_value::Ref::Int8Vector(unsafe {
23215 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, i8>>()
23216 }),
23217
23218 7 => crate::wire::config_vector_value::Ref::Int16Vector(unsafe {
23219 self.raw
23220 .get()
23221 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI16>>()
23222 }),
23223
23224 8 => crate::wire::config_vector_value::Ref::Int32Vector(unsafe {
23225 self.raw
23226 .get()
23227 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI32>>()
23228 }),
23229
23230 9 => crate::wire::config_vector_value::Ref::Int64Vector(unsafe {
23231 self.raw
23232 .get()
23233 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI64>>()
23234 }),
23235
23236 10 => crate::wire::config_vector_value::Ref::StringVector(unsafe {
23237 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireString<'_>>>()
23238 }),
23239
23240 unknown => crate::wire::config_vector_value::Ref::UnknownOrdinal_(unknown),
23241 }
23242 }
23243 }
23244
23245 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigVectorValue<'static>
23246 where
23247 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
23248 ___D: ::fidl_next::Decoder,
23249 {
23250 fn decode(
23251 mut slot: ::fidl_next::Slot<'_, Self>,
23252 decoder: &mut ___D,
23253 _: (),
23254 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23255 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
23256 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
23257 1 => ::fidl_next::RawWireUnion::decode_as::<
23258 ___D,
23259 ::fidl_next::WireVector<'static, bool>,
23260 >(raw, decoder, (4294967295, ()))?,
23261
23262 2 => ::fidl_next::RawWireUnion::decode_as::<
23263 ___D,
23264 ::fidl_next::WireVector<'static, u8>,
23265 >(raw, decoder, (4294967295, ()))?,
23266
23267 3 => ::fidl_next::RawWireUnion::decode_as::<
23268 ___D,
23269 ::fidl_next::WireVector<'static, ::fidl_next::WireU16>,
23270 >(raw, decoder, (4294967295, ()))?,
23271
23272 4 => ::fidl_next::RawWireUnion::decode_as::<
23273 ___D,
23274 ::fidl_next::WireVector<'static, ::fidl_next::WireU32>,
23275 >(raw, decoder, (4294967295, ()))?,
23276
23277 5 => ::fidl_next::RawWireUnion::decode_as::<
23278 ___D,
23279 ::fidl_next::WireVector<'static, ::fidl_next::WireU64>,
23280 >(raw, decoder, (4294967295, ()))?,
23281
23282 6 => ::fidl_next::RawWireUnion::decode_as::<
23283 ___D,
23284 ::fidl_next::WireVector<'static, i8>,
23285 >(raw, decoder, (4294967295, ()))?,
23286
23287 7 => ::fidl_next::RawWireUnion::decode_as::<
23288 ___D,
23289 ::fidl_next::WireVector<'static, ::fidl_next::WireI16>,
23290 >(raw, decoder, (4294967295, ()))?,
23291
23292 8 => ::fidl_next::RawWireUnion::decode_as::<
23293 ___D,
23294 ::fidl_next::WireVector<'static, ::fidl_next::WireI32>,
23295 >(raw, decoder, (4294967295, ()))?,
23296
23297 9 => ::fidl_next::RawWireUnion::decode_as::<
23298 ___D,
23299 ::fidl_next::WireVector<'static, ::fidl_next::WireI64>,
23300 >(raw, decoder, (4294967295, ()))?,
23301
23302 10 => ::fidl_next::RawWireUnion::decode_as::<
23303 ___D,
23304 ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
23305 >(raw, decoder, (4294967295, 4294967295))?,
23306
23307 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
23308 }
23309
23310 Ok(())
23311 }
23312 }
23313
23314 impl<'de> ::core::fmt::Debug for ConfigVectorValue<'de> {
23315 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
23316 match self.raw.ordinal() {
23317 1 => unsafe {
23318 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, bool>>().fmt(f)
23319 },
23320 2 => unsafe {
23321 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, u8>>().fmt(f)
23322 },
23323 3 => unsafe {
23324 self.raw
23325 .get()
23326 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU16>>()
23327 .fmt(f)
23328 },
23329 4 => unsafe {
23330 self.raw
23331 .get()
23332 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU32>>()
23333 .fmt(f)
23334 },
23335 5 => unsafe {
23336 self.raw
23337 .get()
23338 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireU64>>()
23339 .fmt(f)
23340 },
23341 6 => unsafe {
23342 self.raw.get().deref_unchecked::<::fidl_next::WireVector<'_, i8>>().fmt(f)
23343 },
23344 7 => unsafe {
23345 self.raw
23346 .get()
23347 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI16>>()
23348 .fmt(f)
23349 },
23350 8 => unsafe {
23351 self.raw
23352 .get()
23353 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI32>>()
23354 .fmt(f)
23355 },
23356 9 => unsafe {
23357 self.raw
23358 .get()
23359 .deref_unchecked::<::fidl_next::WireVector<'_, ::fidl_next::WireI64>>()
23360 .fmt(f)
23361 },
23362 10 => unsafe {
23363 self.raw.get().deref_unchecked::<
23364 ::fidl_next::WireVector<'_, ::fidl_next::WireString<'_>>
23365 >().fmt(f)
23366 },
23367 _ => unsafe { ::core::hint::unreachable_unchecked() },
23368 }
23369 }
23370 }
23371
23372 impl<'de> ::fidl_next::IntoNatural for ConfigVectorValue<'de> {
23373 type Natural = crate::natural::ConfigVectorValue;
23374 }
23375
23376 impl ::fidl_next::Unconstrained for ConfigVectorValue<'static> {}
23377
23378 #[repr(transparent)]
23380 pub struct ConfigValue<'de> {
23381 pub(crate) raw: ::fidl_next::RawWireUnion,
23382 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
23383 }
23384
23385 impl<'de> Drop for ConfigValue<'de> {
23386 fn drop(&mut self) {
23387 match self.raw.ordinal() {
23388 1 => {
23389 let _ = unsafe {
23390 self.raw.get().read_unchecked::<crate::wire::ConfigSingleValue<'de>>()
23391 };
23392 }
23393
23394 2 => {
23395 let _ = unsafe {
23396 self.raw.get().read_unchecked::<crate::wire::ConfigVectorValue<'de>>()
23397 };
23398 }
23399
23400 _ => (),
23401 }
23402 }
23403 }
23404
23405 unsafe impl ::fidl_next::Wire for ConfigValue<'static> {
23406 type Owned<'de> = ConfigValue<'de>;
23407
23408 #[inline]
23409 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23410 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
23411 ::fidl_next::RawWireUnion::zero_padding(raw);
23412 }
23413 }
23414
23415 pub mod config_value {
23416 pub enum Ref<'de> {
23417 Single(&'de crate::wire::ConfigSingleValue<'de>),
23418
23419 Vector(&'de crate::wire::ConfigVectorValue<'de>),
23420
23421 UnknownOrdinal_(u64),
23422 }
23423 }
23424
23425 impl<'de> ConfigValue<'de> {
23426 pub fn as_ref(&self) -> crate::wire::config_value::Ref<'_> {
23427 match self.raw.ordinal() {
23428 1 => crate::wire::config_value::Ref::Single(unsafe {
23429 self.raw.get().deref_unchecked::<crate::wire::ConfigSingleValue<'_>>()
23430 }),
23431
23432 2 => crate::wire::config_value::Ref::Vector(unsafe {
23433 self.raw.get().deref_unchecked::<crate::wire::ConfigVectorValue<'_>>()
23434 }),
23435
23436 unknown => crate::wire::config_value::Ref::UnknownOrdinal_(unknown),
23437 }
23438 }
23439 }
23440
23441 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigValue<'static>
23442 where
23443 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
23444 ___D: ::fidl_next::Decoder,
23445 {
23446 fn decode(
23447 mut slot: ::fidl_next::Slot<'_, Self>,
23448 decoder: &mut ___D,
23449 _: (),
23450 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23451 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
23452 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
23453 1 => ::fidl_next::RawWireUnion::decode_as::<
23454 ___D,
23455 crate::wire::ConfigSingleValue<'static>,
23456 >(raw, decoder, ())?,
23457
23458 2 => ::fidl_next::RawWireUnion::decode_as::<
23459 ___D,
23460 crate::wire::ConfigVectorValue<'static>,
23461 >(raw, decoder, ())?,
23462
23463 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
23464 }
23465
23466 Ok(())
23467 }
23468 }
23469
23470 impl<'de> ::core::fmt::Debug for ConfigValue<'de> {
23471 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
23472 match self.raw.ordinal() {
23473 1 => unsafe {
23474 self.raw.get().deref_unchecked::<crate::wire::ConfigSingleValue<'_>>().fmt(f)
23475 },
23476 2 => unsafe {
23477 self.raw.get().deref_unchecked::<crate::wire::ConfigVectorValue<'_>>().fmt(f)
23478 },
23479 _ => unsafe { ::core::hint::unreachable_unchecked() },
23480 }
23481 }
23482 }
23483
23484 impl<'de> ::fidl_next::IntoNatural for ConfigValue<'de> {
23485 type Natural = crate::natural::ConfigValue;
23486 }
23487
23488 impl ::fidl_next::Unconstrained for ConfigValue<'static> {}
23489
23490 #[repr(C)]
23492 pub struct Configuration<'de> {
23493 pub(crate) table: ::fidl_next::WireTable<'de>,
23494 }
23495
23496 impl<'de> Drop for Configuration<'de> {
23497 fn drop(&mut self) {
23498 let _ = self.table.get(1).map(|envelope| unsafe {
23499 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
23500 });
23501
23502 let _ = self.table.get(2).map(|envelope| unsafe {
23503 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
23504 });
23505 }
23506 }
23507
23508 unsafe impl ::fidl_next::Wire for Configuration<'static> {
23509 type Owned<'de> = Configuration<'de>;
23510
23511 #[inline]
23512 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23513 ::fidl_next::munge!(let Self { table } = out);
23514 ::fidl_next::WireTable::zero_padding(table);
23515 }
23516 }
23517
23518 unsafe impl<___D> ::fidl_next::Decode<___D> for Configuration<'static>
23519 where
23520 ___D: ::fidl_next::Decoder + ?Sized,
23521 {
23522 fn decode(
23523 slot: ::fidl_next::Slot<'_, Self>,
23524 decoder: &mut ___D,
23525 _: (),
23526 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23527 ::fidl_next::munge!(let Self { table } = slot);
23528
23529 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
23530 match ordinal {
23531 0 => unsafe { ::core::hint::unreachable_unchecked() },
23532
23533 1 => {
23534 ::fidl_next::WireEnvelope::decode_as::<
23535 ___D,
23536 ::fidl_next::WireString<'static>,
23537 >(slot.as_mut(), decoder, 100)?;
23538
23539 let value = unsafe {
23540 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
23541 };
23542
23543 if value.len() > 100 {
23544 return Err(::fidl_next::DecodeError::VectorTooLong {
23545 size: value.len() as u64,
23546 limit: 100,
23547 });
23548 }
23549
23550 Ok(())
23551 }
23552
23553 2 => {
23554 ::fidl_next::WireEnvelope::decode_as::<
23555 ___D,
23556 crate::wire::ConfigValue<'static>,
23557 >(slot.as_mut(), decoder, ())?;
23558
23559 Ok(())
23560 }
23561
23562 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
23563 }
23564 })
23565 }
23566 }
23567
23568 impl<'de> Configuration<'de> {
23569 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
23570 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
23571 }
23572
23573 pub fn value(&self) -> ::core::option::Option<&crate::wire::ConfigValue<'de>> {
23574 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
23575 }
23576 }
23577
23578 impl<'de> ::core::fmt::Debug for Configuration<'de> {
23579 fn fmt(
23580 &self,
23581 f: &mut ::core::fmt::Formatter<'_>,
23582 ) -> ::core::result::Result<(), ::core::fmt::Error> {
23583 f.debug_struct("Configuration")
23584 .field("name", &self.name())
23585 .field("value", &self.value())
23586 .finish()
23587 }
23588 }
23589
23590 impl<'de> ::fidl_next::IntoNatural for Configuration<'de> {
23591 type Natural = crate::natural::Configuration;
23592 }
23593
23594 impl ::fidl_next::Unconstrained for Configuration<'_> {}
23595
23596 pub type DictionaryPath<'de> = ::fidl_next::WireString<'de>;
23598
23599 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
23601 #[repr(transparent)]
23602 pub struct DeliveryType {
23603 pub(crate) value: ::fidl_next::WireU32,
23604 }
23605
23606 unsafe impl ::fidl_next::Wire for DeliveryType {
23607 type Owned<'de> = Self;
23608
23609 #[inline]
23610 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
23611 }
23613 }
23614
23615 impl DeliveryType {
23616 pub const IMMEDIATE: DeliveryType = DeliveryType { value: ::fidl_next::WireU32(0) };
23617
23618 pub const ON_READABLE: DeliveryType = DeliveryType { value: ::fidl_next::WireU32(1) };
23619 }
23620
23621 unsafe impl<___D> ::fidl_next::Decode<___D> for DeliveryType
23622 where
23623 ___D: ?Sized,
23624 {
23625 fn decode(
23626 slot: ::fidl_next::Slot<'_, Self>,
23627 _: &mut ___D,
23628 _: (),
23629 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23630 Ok(())
23631 }
23632 }
23633
23634 impl ::core::convert::From<crate::natural::DeliveryType> for DeliveryType {
23635 fn from(natural: crate::natural::DeliveryType) -> Self {
23636 match natural {
23637 crate::natural::DeliveryType::Immediate => DeliveryType::IMMEDIATE,
23638
23639 crate::natural::DeliveryType::OnReadable => DeliveryType::ON_READABLE,
23640
23641 crate::natural::DeliveryType::UnknownOrdinal_(value) => {
23642 DeliveryType { value: ::fidl_next::WireU32::from(value) }
23643 }
23644 }
23645 }
23646 }
23647
23648 impl ::fidl_next::IntoNatural for DeliveryType {
23649 type Natural = crate::natural::DeliveryType;
23650 }
23651
23652 impl ::fidl_next::Unconstrained for DeliveryType {}
23653
23654 #[repr(C)]
23656 pub struct Protocol<'de> {
23657 pub(crate) table: ::fidl_next::WireTable<'de>,
23658 }
23659
23660 impl<'de> Drop for Protocol<'de> {
23661 fn drop(&mut self) {
23662 let _ = self.table.get(1).map(|envelope| unsafe {
23663 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
23664 });
23665
23666 let _ = self.table.get(2).map(|envelope| unsafe {
23667 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
23668 });
23669
23670 let _ = self
23671 .table
23672 .get(3)
23673 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::DeliveryType>() });
23674 }
23675 }
23676
23677 unsafe impl ::fidl_next::Wire for Protocol<'static> {
23678 type Owned<'de> = Protocol<'de>;
23679
23680 #[inline]
23681 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23682 ::fidl_next::munge!(let Self { table } = out);
23683 ::fidl_next::WireTable::zero_padding(table);
23684 }
23685 }
23686
23687 unsafe impl<___D> ::fidl_next::Decode<___D> for Protocol<'static>
23688 where
23689 ___D: ::fidl_next::Decoder + ?Sized,
23690 {
23691 fn decode(
23692 slot: ::fidl_next::Slot<'_, Self>,
23693 decoder: &mut ___D,
23694 _: (),
23695 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23696 ::fidl_next::munge!(let Self { table } = slot);
23697
23698 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
23699 match ordinal {
23700 0 => unsafe { ::core::hint::unreachable_unchecked() },
23701
23702 1 => {
23703 ::fidl_next::WireEnvelope::decode_as::<
23704 ___D,
23705 ::fidl_next::WireString<'static>,
23706 >(slot.as_mut(), decoder, 100)?;
23707
23708 let value = unsafe {
23709 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
23710 };
23711
23712 if value.len() > 100 {
23713 return Err(::fidl_next::DecodeError::VectorTooLong {
23714 size: value.len() as u64,
23715 limit: 100,
23716 });
23717 }
23718
23719 Ok(())
23720 }
23721
23722 2 => {
23723 ::fidl_next::WireEnvelope::decode_as::<
23724 ___D,
23725 ::fidl_next::WireString<'static>,
23726 >(slot.as_mut(), decoder, 1024)?;
23727
23728 let value = unsafe {
23729 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
23730 };
23731
23732 if value.len() > 1024 {
23733 return Err(::fidl_next::DecodeError::VectorTooLong {
23734 size: value.len() as u64,
23735 limit: 1024,
23736 });
23737 }
23738
23739 Ok(())
23740 }
23741
23742 3 => {
23743 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::DeliveryType>(
23744 slot.as_mut(),
23745 decoder,
23746 (),
23747 )?;
23748
23749 Ok(())
23750 }
23751
23752 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
23753 }
23754 })
23755 }
23756 }
23757
23758 impl<'de> Protocol<'de> {
23759 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
23760 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
23761 }
23762
23763 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
23764 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
23765 }
23766
23767 pub fn delivery(&self) -> ::core::option::Option<&crate::wire::DeliveryType> {
23768 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
23769 }
23770 }
23771
23772 impl<'de> ::core::fmt::Debug for Protocol<'de> {
23773 fn fmt(
23774 &self,
23775 f: &mut ::core::fmt::Formatter<'_>,
23776 ) -> ::core::result::Result<(), ::core::fmt::Error> {
23777 f.debug_struct("Protocol")
23778 .field("name", &self.name())
23779 .field("source_path", &self.source_path())
23780 .field("delivery", &self.delivery())
23781 .finish()
23782 }
23783 }
23784
23785 impl<'de> ::fidl_next::IntoNatural for Protocol<'de> {
23786 type Natural = crate::natural::Protocol;
23787 }
23788
23789 impl ::fidl_next::Unconstrained for Protocol<'_> {}
23790
23791 #[derive(Clone, Debug)]
23793 #[repr(C)]
23794 pub struct EnvironmentRef {
23795 pub(crate) _empty: fidl_next::WireEmptyStructPlaceholder,
23796 }
23797
23798 static_assertions::const_assert_eq!(std::mem::size_of::<EnvironmentRef>(), 1);
23799 static_assertions::const_assert_eq!(std::mem::align_of::<EnvironmentRef>(), 1);
23800
23801 unsafe impl ::fidl_next::Wire for EnvironmentRef {
23802 type Owned<'de> = EnvironmentRef;
23803
23804 #[inline]
23805 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
23806 ::fidl_next::munge! {
23807 let Self {
23808
23809 _empty,
23810
23811
23812 } = &mut *out_;
23813 }
23814 }
23815 }
23816
23817 unsafe impl<___D> ::fidl_next::Decode<___D> for EnvironmentRef
23818 where
23819 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
23820 {
23821 fn decode(
23822 slot_: ::fidl_next::Slot<'_, Self>,
23823 decoder_: &mut ___D,
23824 _: (),
23825 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23826 ::fidl_next::munge! {
23827 let Self {
23828
23829 mut _empty,
23830
23831
23832 } = slot_;
23833 }
23834
23835 if _empty.as_bytes() != &[0u8] {
23836 return Err(::fidl_next::DecodeError::InvalidEmptyStruct);
23837 }
23838
23839 Ok(())
23840 }
23841 }
23842
23843 impl ::fidl_next::IntoNatural for EnvironmentRef {
23844 type Natural = crate::natural::EnvironmentRef;
23845 }
23846
23847 impl ::fidl_next::Unconstrained for EnvironmentRef {}
23848
23849 #[repr(transparent)]
23851 pub struct Ref<'de> {
23852 pub(crate) raw: ::fidl_next::RawWireUnion,
23853 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
23854 }
23855
23856 impl<'de> Drop for Ref<'de> {
23857 fn drop(&mut self) {
23858 match self.raw.ordinal() {
23859 1 => {
23860 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::ParentRef>() };
23861 }
23862
23863 2 => {
23864 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::SelfRef>() };
23865 }
23866
23867 3 => {
23868 let _ =
23869 unsafe { self.raw.get().read_unchecked::<crate::wire::ChildRef<'de>>() };
23870 }
23871
23872 4 => {
23873 let _ = unsafe {
23874 self.raw.get().read_unchecked::<crate::wire::CollectionRef<'de>>()
23875 };
23876 }
23877
23878 5 => {
23879 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::FrameworkRef>() };
23880 }
23881
23882 6 => {
23883 let _ = unsafe {
23884 self.raw.get().read_unchecked::<crate::wire::CapabilityRef<'de>>()
23885 };
23886 }
23887
23888 7 => {
23889 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::DebugRef>() };
23890 }
23891
23892 8 => {
23893 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::VoidRef>() };
23894 }
23895
23896 9 => {
23897 let _ =
23898 unsafe { self.raw.get().read_unchecked::<crate::wire::EnvironmentRef>() };
23899 }
23900
23901 _ => (),
23902 }
23903 }
23904 }
23905
23906 unsafe impl ::fidl_next::Wire for Ref<'static> {
23907 type Owned<'de> = Ref<'de>;
23908
23909 #[inline]
23910 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
23911 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
23912 ::fidl_next::RawWireUnion::zero_padding(raw);
23913 }
23914 }
23915
23916 pub mod ref_ {
23917 pub enum Ref<'de> {
23918 Parent(&'de crate::wire::ParentRef),
23919
23920 Self_(&'de crate::wire::SelfRef),
23921
23922 Child(&'de crate::wire::ChildRef<'de>),
23923
23924 Collection(&'de crate::wire::CollectionRef<'de>),
23925
23926 Framework(&'de crate::wire::FrameworkRef),
23927
23928 Capability(&'de crate::wire::CapabilityRef<'de>),
23929
23930 Debug(&'de crate::wire::DebugRef),
23931
23932 VoidType(&'de crate::wire::VoidRef),
23933
23934 Environment(&'de crate::wire::EnvironmentRef),
23935
23936 UnknownOrdinal_(u64),
23937 }
23938 }
23939
23940 impl<'de> Ref<'de> {
23941 pub fn as_ref(&self) -> crate::wire::ref_::Ref<'_> {
23942 match self.raw.ordinal() {
23943 1 => crate::wire::ref_::Ref::Parent(unsafe {
23944 self.raw.get().deref_unchecked::<crate::wire::ParentRef>()
23945 }),
23946
23947 2 => crate::wire::ref_::Ref::Self_(unsafe {
23948 self.raw.get().deref_unchecked::<crate::wire::SelfRef>()
23949 }),
23950
23951 3 => crate::wire::ref_::Ref::Child(unsafe {
23952 self.raw.get().deref_unchecked::<crate::wire::ChildRef<'_>>()
23953 }),
23954
23955 4 => crate::wire::ref_::Ref::Collection(unsafe {
23956 self.raw.get().deref_unchecked::<crate::wire::CollectionRef<'_>>()
23957 }),
23958
23959 5 => crate::wire::ref_::Ref::Framework(unsafe {
23960 self.raw.get().deref_unchecked::<crate::wire::FrameworkRef>()
23961 }),
23962
23963 6 => crate::wire::ref_::Ref::Capability(unsafe {
23964 self.raw.get().deref_unchecked::<crate::wire::CapabilityRef<'_>>()
23965 }),
23966
23967 7 => crate::wire::ref_::Ref::Debug(unsafe {
23968 self.raw.get().deref_unchecked::<crate::wire::DebugRef>()
23969 }),
23970
23971 8 => crate::wire::ref_::Ref::VoidType(unsafe {
23972 self.raw.get().deref_unchecked::<crate::wire::VoidRef>()
23973 }),
23974
23975 9 => crate::wire::ref_::Ref::Environment(unsafe {
23976 self.raw.get().deref_unchecked::<crate::wire::EnvironmentRef>()
23977 }),
23978
23979 unknown => crate::wire::ref_::Ref::UnknownOrdinal_(unknown),
23980 }
23981 }
23982 }
23983
23984 unsafe impl<___D> ::fidl_next::Decode<___D> for Ref<'static>
23985 where
23986 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
23987 ___D: ::fidl_next::Decoder,
23988 {
23989 fn decode(
23990 mut slot: ::fidl_next::Slot<'_, Self>,
23991 decoder: &mut ___D,
23992 _: (),
23993 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
23994 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
23995 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
23996 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::ParentRef>(
23997 raw,
23998 decoder,
23999 (),
24000 )?,
24001
24002 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::SelfRef>(
24003 raw,
24004 decoder,
24005 (),
24006 )?,
24007
24008 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::ChildRef<'static>>(
24009 raw,
24010 decoder,
24011 (),
24012 )?,
24013
24014 4 => ::fidl_next::RawWireUnion::decode_as::<
24015 ___D,
24016 crate::wire::CollectionRef<'static>,
24017 >(raw, decoder, ())?,
24018
24019 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::FrameworkRef>(
24020 raw,
24021 decoder,
24022 (),
24023 )?,
24024
24025 6 => ::fidl_next::RawWireUnion::decode_as::<
24026 ___D,
24027 crate::wire::CapabilityRef<'static>,
24028 >(raw, decoder, ())?,
24029
24030 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::DebugRef>(
24031 raw,
24032 decoder,
24033 (),
24034 )?,
24035
24036 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::VoidRef>(
24037 raw,
24038 decoder,
24039 (),
24040 )?,
24041
24042 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::EnvironmentRef>(
24043 raw,
24044 decoder,
24045 (),
24046 )?,
24047
24048 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
24049 }
24050
24051 Ok(())
24052 }
24053 }
24054
24055 impl<'de> ::core::fmt::Debug for Ref<'de> {
24056 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
24057 match self.raw.ordinal() {
24058 1 => unsafe { self.raw.get().deref_unchecked::<crate::wire::ParentRef>().fmt(f) },
24059 2 => unsafe { self.raw.get().deref_unchecked::<crate::wire::SelfRef>().fmt(f) },
24060 3 => unsafe {
24061 self.raw.get().deref_unchecked::<crate::wire::ChildRef<'_>>().fmt(f)
24062 },
24063 4 => unsafe {
24064 self.raw.get().deref_unchecked::<crate::wire::CollectionRef<'_>>().fmt(f)
24065 },
24066 5 => unsafe {
24067 self.raw.get().deref_unchecked::<crate::wire::FrameworkRef>().fmt(f)
24068 },
24069 6 => unsafe {
24070 self.raw.get().deref_unchecked::<crate::wire::CapabilityRef<'_>>().fmt(f)
24071 },
24072 7 => unsafe { self.raw.get().deref_unchecked::<crate::wire::DebugRef>().fmt(f) },
24073 8 => unsafe { self.raw.get().deref_unchecked::<crate::wire::VoidRef>().fmt(f) },
24074 9 => unsafe {
24075 self.raw.get().deref_unchecked::<crate::wire::EnvironmentRef>().fmt(f)
24076 },
24077 _ => unsafe { ::core::hint::unreachable_unchecked() },
24078 }
24079 }
24080 }
24081
24082 impl<'de> ::fidl_next::IntoNatural for Ref<'de> {
24083 type Natural = crate::natural::Ref;
24084 }
24085
24086 impl ::fidl_next::Unconstrained for Ref<'static> {}
24087
24088 #[repr(C)]
24090 pub struct Storage<'de> {
24091 pub(crate) table: ::fidl_next::WireTable<'de>,
24092 }
24093
24094 impl<'de> Drop for Storage<'de> {
24095 fn drop(&mut self) {
24096 let _ = self.table.get(1).map(|envelope| unsafe {
24097 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24098 });
24099
24100 let _ = self
24101 .table
24102 .get(2)
24103 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
24104
24105 let _ = self.table.get(3).map(|envelope| unsafe {
24106 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24107 });
24108
24109 let _ = self.table.get(4).map(|envelope| unsafe {
24110 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24111 });
24112
24113 let _ = self
24114 .table
24115 .get(5)
24116 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::StorageId>() });
24117 }
24118 }
24119
24120 unsafe impl ::fidl_next::Wire for Storage<'static> {
24121 type Owned<'de> = Storage<'de>;
24122
24123 #[inline]
24124 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
24125 ::fidl_next::munge!(let Self { table } = out);
24126 ::fidl_next::WireTable::zero_padding(table);
24127 }
24128 }
24129
24130 unsafe impl<___D> ::fidl_next::Decode<___D> for Storage<'static>
24131 where
24132 ___D: ::fidl_next::Decoder + ?Sized,
24133 {
24134 fn decode(
24135 slot: ::fidl_next::Slot<'_, Self>,
24136 decoder: &mut ___D,
24137 _: (),
24138 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24139 ::fidl_next::munge!(let Self { table } = slot);
24140
24141 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
24142 match ordinal {
24143 0 => unsafe { ::core::hint::unreachable_unchecked() },
24144
24145 1 => {
24146 ::fidl_next::WireEnvelope::decode_as::<
24147 ___D,
24148 ::fidl_next::WireString<'static>,
24149 >(slot.as_mut(), decoder, 100)?;
24150
24151 let value = unsafe {
24152 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24153 };
24154
24155 if value.len() > 100 {
24156 return Err(::fidl_next::DecodeError::VectorTooLong {
24157 size: value.len() as u64,
24158 limit: 100,
24159 });
24160 }
24161
24162 Ok(())
24163 }
24164
24165 2 => {
24166 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
24167 slot.as_mut(),
24168 decoder,
24169 (),
24170 )?;
24171
24172 Ok(())
24173 }
24174
24175 3 => {
24176 ::fidl_next::WireEnvelope::decode_as::<
24177 ___D,
24178 ::fidl_next::WireString<'static>,
24179 >(slot.as_mut(), decoder, 100)?;
24180
24181 let value = unsafe {
24182 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24183 };
24184
24185 if value.len() > 100 {
24186 return Err(::fidl_next::DecodeError::VectorTooLong {
24187 size: value.len() as u64,
24188 limit: 100,
24189 });
24190 }
24191
24192 Ok(())
24193 }
24194
24195 4 => {
24196 ::fidl_next::WireEnvelope::decode_as::<
24197 ___D,
24198 ::fidl_next::WireString<'static>,
24199 >(slot.as_mut(), decoder, 1024)?;
24200
24201 let value = unsafe {
24202 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24203 };
24204
24205 if value.len() > 1024 {
24206 return Err(::fidl_next::DecodeError::VectorTooLong {
24207 size: value.len() as u64,
24208 limit: 1024,
24209 });
24210 }
24211
24212 Ok(())
24213 }
24214
24215 5 => {
24216 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::StorageId>(
24217 slot.as_mut(),
24218 decoder,
24219 (),
24220 )?;
24221
24222 Ok(())
24223 }
24224
24225 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
24226 }
24227 })
24228 }
24229 }
24230
24231 impl<'de> Storage<'de> {
24232 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
24233 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
24234 }
24235
24236 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
24237 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
24238 }
24239
24240 pub fn backing_dir(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
24241 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
24242 }
24243
24244 pub fn subdir(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
24245 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
24246 }
24247
24248 pub fn storage_id(&self) -> ::core::option::Option<&crate::wire::StorageId> {
24249 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
24250 }
24251 }
24252
24253 impl<'de> ::core::fmt::Debug for Storage<'de> {
24254 fn fmt(
24255 &self,
24256 f: &mut ::core::fmt::Formatter<'_>,
24257 ) -> ::core::result::Result<(), ::core::fmt::Error> {
24258 f.debug_struct("Storage")
24259 .field("name", &self.name())
24260 .field("source", &self.source())
24261 .field("backing_dir", &self.backing_dir())
24262 .field("subdir", &self.subdir())
24263 .field("storage_id", &self.storage_id())
24264 .finish()
24265 }
24266 }
24267
24268 impl<'de> ::fidl_next::IntoNatural for Storage<'de> {
24269 type Natural = crate::natural::Storage;
24270 }
24271
24272 impl ::fidl_next::Unconstrained for Storage<'_> {}
24273
24274 #[repr(C)]
24276 pub struct Dictionary<'de> {
24277 pub(crate) table: ::fidl_next::WireTable<'de>,
24278 }
24279
24280 impl<'de> Drop for Dictionary<'de> {
24281 fn drop(&mut self) {
24282 let _ = self.table.get(1).map(|envelope| unsafe {
24283 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24284 });
24285
24286 let _ = self
24287 .table
24288 .get(2)
24289 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
24290
24291 let _ = self.table.get(3).map(|envelope| unsafe {
24292 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24293 });
24294
24295 let _ = self.table.get(4).map(|envelope| unsafe {
24296 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24297 });
24298 }
24299 }
24300
24301 unsafe impl ::fidl_next::Wire for Dictionary<'static> {
24302 type Owned<'de> = Dictionary<'de>;
24303
24304 #[inline]
24305 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
24306 ::fidl_next::munge!(let Self { table } = out);
24307 ::fidl_next::WireTable::zero_padding(table);
24308 }
24309 }
24310
24311 unsafe impl<___D> ::fidl_next::Decode<___D> for Dictionary<'static>
24312 where
24313 ___D: ::fidl_next::Decoder + ?Sized,
24314 {
24315 fn decode(
24316 slot: ::fidl_next::Slot<'_, Self>,
24317 decoder: &mut ___D,
24318 _: (),
24319 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24320 ::fidl_next::munge!(let Self { table } = slot);
24321
24322 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
24323 match ordinal {
24324 0 => unsafe { ::core::hint::unreachable_unchecked() },
24325
24326 1 => {
24327 ::fidl_next::WireEnvelope::decode_as::<
24328 ___D,
24329 ::fidl_next::WireString<'static>,
24330 >(slot.as_mut(), decoder, 100)?;
24331
24332 let value = unsafe {
24333 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24334 };
24335
24336 if value.len() > 100 {
24337 return Err(::fidl_next::DecodeError::VectorTooLong {
24338 size: value.len() as u64,
24339 limit: 100,
24340 });
24341 }
24342
24343 Ok(())
24344 }
24345
24346 2 => {
24347 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
24348 slot.as_mut(),
24349 decoder,
24350 (),
24351 )?;
24352
24353 Ok(())
24354 }
24355
24356 3 => {
24357 ::fidl_next::WireEnvelope::decode_as::<
24358 ___D,
24359 ::fidl_next::WireString<'static>,
24360 >(slot.as_mut(), decoder, 1024)?;
24361
24362 let value = unsafe {
24363 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24364 };
24365
24366 if value.len() > 1024 {
24367 return Err(::fidl_next::DecodeError::VectorTooLong {
24368 size: value.len() as u64,
24369 limit: 1024,
24370 });
24371 }
24372
24373 Ok(())
24374 }
24375
24376 4 => {
24377 ::fidl_next::WireEnvelope::decode_as::<
24378 ___D,
24379 ::fidl_next::WireString<'static>,
24380 >(slot.as_mut(), decoder, 1024)?;
24381
24382 let value = unsafe {
24383 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24384 };
24385
24386 if value.len() > 1024 {
24387 return Err(::fidl_next::DecodeError::VectorTooLong {
24388 size: value.len() as u64,
24389 limit: 1024,
24390 });
24391 }
24392
24393 Ok(())
24394 }
24395
24396 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
24397 }
24398 })
24399 }
24400 }
24401
24402 impl<'de> Dictionary<'de> {
24403 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
24404 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
24405 }
24406
24407 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
24408 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
24409 }
24410
24411 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
24412 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
24413 }
24414
24415 pub fn source_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
24416 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
24417 }
24418 }
24419
24420 impl<'de> ::core::fmt::Debug for Dictionary<'de> {
24421 fn fmt(
24422 &self,
24423 f: &mut ::core::fmt::Formatter<'_>,
24424 ) -> ::core::result::Result<(), ::core::fmt::Error> {
24425 f.debug_struct("Dictionary")
24426 .field("name", &self.name())
24427 .field("source", &self.source())
24428 .field("source_dictionary", &self.source_dictionary())
24429 .field("source_path", &self.source_path())
24430 .finish()
24431 }
24432 }
24433
24434 impl<'de> ::fidl_next::IntoNatural for Dictionary<'de> {
24435 type Natural = crate::natural::Dictionary;
24436 }
24437
24438 impl ::fidl_next::Unconstrained for Dictionary<'_> {}
24439
24440 #[repr(transparent)]
24442 pub struct Capability<'de> {
24443 pub(crate) raw: ::fidl_next::RawWireUnion,
24444 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
24445 }
24446
24447 impl<'de> Drop for Capability<'de> {
24448 fn drop(&mut self) {
24449 match self.raw.ordinal() {
24450 1 => {
24451 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::Service<'de>>() };
24452 }
24453
24454 2 => {
24455 let _ =
24456 unsafe { self.raw.get().read_unchecked::<crate::wire::Protocol<'de>>() };
24457 }
24458
24459 3 => {
24460 let _ =
24461 unsafe { self.raw.get().read_unchecked::<crate::wire::Directory<'de>>() };
24462 }
24463
24464 4 => {
24465 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::Storage<'de>>() };
24466 }
24467
24468 5 => {
24469 let _ = unsafe { self.raw.get().read_unchecked::<crate::wire::Runner<'de>>() };
24470 }
24471
24472 6 => {
24473 let _ =
24474 unsafe { self.raw.get().read_unchecked::<crate::wire::Resolver<'de>>() };
24475 }
24476
24477 8 => {
24478 let _ =
24479 unsafe { self.raw.get().read_unchecked::<crate::wire::EventStream<'de>>() };
24480 }
24481
24482 9 => {
24483 let _ =
24484 unsafe { self.raw.get().read_unchecked::<crate::wire::Dictionary<'de>>() };
24485 }
24486
24487 10 => {
24488 let _ = unsafe {
24489 self.raw.get().read_unchecked::<crate::wire::Configuration<'de>>()
24490 };
24491 }
24492
24493 _ => (),
24494 }
24495 }
24496 }
24497
24498 unsafe impl ::fidl_next::Wire for Capability<'static> {
24499 type Owned<'de> = Capability<'de>;
24500
24501 #[inline]
24502 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
24503 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
24504 ::fidl_next::RawWireUnion::zero_padding(raw);
24505 }
24506 }
24507
24508 pub mod capability {
24509 pub enum Ref<'de> {
24510 Service(&'de crate::wire::Service<'de>),
24511
24512 Protocol(&'de crate::wire::Protocol<'de>),
24513
24514 Directory(&'de crate::wire::Directory<'de>),
24515
24516 Storage(&'de crate::wire::Storage<'de>),
24517
24518 Runner(&'de crate::wire::Runner<'de>),
24519
24520 Resolver(&'de crate::wire::Resolver<'de>),
24521
24522 EventStream(&'de crate::wire::EventStream<'de>),
24523
24524 Dictionary(&'de crate::wire::Dictionary<'de>),
24525
24526 Config(&'de crate::wire::Configuration<'de>),
24527
24528 UnknownOrdinal_(u64),
24529 }
24530 }
24531
24532 impl<'de> Capability<'de> {
24533 pub fn as_ref(&self) -> crate::wire::capability::Ref<'_> {
24534 match self.raw.ordinal() {
24535 1 => crate::wire::capability::Ref::Service(unsafe {
24536 self.raw.get().deref_unchecked::<crate::wire::Service<'_>>()
24537 }),
24538
24539 2 => crate::wire::capability::Ref::Protocol(unsafe {
24540 self.raw.get().deref_unchecked::<crate::wire::Protocol<'_>>()
24541 }),
24542
24543 3 => crate::wire::capability::Ref::Directory(unsafe {
24544 self.raw.get().deref_unchecked::<crate::wire::Directory<'_>>()
24545 }),
24546
24547 4 => crate::wire::capability::Ref::Storage(unsafe {
24548 self.raw.get().deref_unchecked::<crate::wire::Storage<'_>>()
24549 }),
24550
24551 5 => crate::wire::capability::Ref::Runner(unsafe {
24552 self.raw.get().deref_unchecked::<crate::wire::Runner<'_>>()
24553 }),
24554
24555 6 => crate::wire::capability::Ref::Resolver(unsafe {
24556 self.raw.get().deref_unchecked::<crate::wire::Resolver<'_>>()
24557 }),
24558
24559 8 => crate::wire::capability::Ref::EventStream(unsafe {
24560 self.raw.get().deref_unchecked::<crate::wire::EventStream<'_>>()
24561 }),
24562
24563 9 => crate::wire::capability::Ref::Dictionary(unsafe {
24564 self.raw.get().deref_unchecked::<crate::wire::Dictionary<'_>>()
24565 }),
24566
24567 10 => crate::wire::capability::Ref::Config(unsafe {
24568 self.raw.get().deref_unchecked::<crate::wire::Configuration<'_>>()
24569 }),
24570
24571 unknown => crate::wire::capability::Ref::UnknownOrdinal_(unknown),
24572 }
24573 }
24574 }
24575
24576 unsafe impl<___D> ::fidl_next::Decode<___D> for Capability<'static>
24577 where
24578 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
24579 ___D: ::fidl_next::Decoder,
24580 {
24581 fn decode(
24582 mut slot: ::fidl_next::Slot<'_, Self>,
24583 decoder: &mut ___D,
24584 _: (),
24585 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24586 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
24587 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
24588 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::Service<'static>>(
24589 raw,
24590 decoder,
24591 (),
24592 )?,
24593
24594 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::Protocol<'static>>(
24595 raw,
24596 decoder,
24597 (),
24598 )?,
24599
24600 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::Directory<'static>>(
24601 raw,
24602 decoder,
24603 (),
24604 )?,
24605
24606 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::Storage<'static>>(
24607 raw,
24608 decoder,
24609 (),
24610 )?,
24611
24612 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::Runner<'static>>(
24613 raw,
24614 decoder,
24615 (),
24616 )?,
24617
24618 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::Resolver<'static>>(
24619 raw,
24620 decoder,
24621 (),
24622 )?,
24623
24624 8 => {
24625 ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::EventStream<'static>>(
24626 raw,
24627 decoder,
24628 (),
24629 )?
24630 }
24631
24632 9 => {
24633 ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::Dictionary<'static>>(
24634 raw,
24635 decoder,
24636 (),
24637 )?
24638 }
24639
24640 10 => ::fidl_next::RawWireUnion::decode_as::<
24641 ___D,
24642 crate::wire::Configuration<'static>,
24643 >(raw, decoder, ())?,
24644
24645 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
24646 }
24647
24648 Ok(())
24649 }
24650 }
24651
24652 impl<'de> ::core::fmt::Debug for Capability<'de> {
24653 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
24654 match self.raw.ordinal() {
24655 1 => unsafe { self.raw.get().deref_unchecked::<crate::wire::Service<'_>>().fmt(f) },
24656 2 => unsafe {
24657 self.raw.get().deref_unchecked::<crate::wire::Protocol<'_>>().fmt(f)
24658 },
24659 3 => unsafe {
24660 self.raw.get().deref_unchecked::<crate::wire::Directory<'_>>().fmt(f)
24661 },
24662 4 => unsafe { self.raw.get().deref_unchecked::<crate::wire::Storage<'_>>().fmt(f) },
24663 5 => unsafe { self.raw.get().deref_unchecked::<crate::wire::Runner<'_>>().fmt(f) },
24664 6 => unsafe {
24665 self.raw.get().deref_unchecked::<crate::wire::Resolver<'_>>().fmt(f)
24666 },
24667 8 => unsafe {
24668 self.raw.get().deref_unchecked::<crate::wire::EventStream<'_>>().fmt(f)
24669 },
24670 9 => unsafe {
24671 self.raw.get().deref_unchecked::<crate::wire::Dictionary<'_>>().fmt(f)
24672 },
24673 10 => unsafe {
24674 self.raw.get().deref_unchecked::<crate::wire::Configuration<'_>>().fmt(f)
24675 },
24676 _ => unsafe { ::core::hint::unreachable_unchecked() },
24677 }
24678 }
24679 }
24680
24681 impl<'de> ::fidl_next::IntoNatural for Capability<'de> {
24682 type Natural = crate::natural::Capability;
24683 }
24684
24685 impl ::fidl_next::Unconstrained for Capability<'static> {}
24686
24687 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
24689 #[repr(transparent)]
24690 pub struct StartupMode {
24691 pub(crate) value: ::fidl_next::WireU32,
24692 }
24693
24694 unsafe impl ::fidl_next::Wire for StartupMode {
24695 type Owned<'de> = Self;
24696
24697 #[inline]
24698 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
24699 }
24701 }
24702
24703 impl StartupMode {
24704 pub const LAZY: StartupMode = StartupMode { value: ::fidl_next::WireU32(0) };
24705
24706 pub const EAGER: StartupMode = StartupMode { value: ::fidl_next::WireU32(1) };
24707 }
24708
24709 unsafe impl<___D> ::fidl_next::Decode<___D> for StartupMode
24710 where
24711 ___D: ?Sized,
24712 {
24713 fn decode(
24714 slot: ::fidl_next::Slot<'_, Self>,
24715 _: &mut ___D,
24716 _: (),
24717 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24718 ::fidl_next::munge!(let Self { value } = slot);
24719
24720 match u32::from(*value) {
24721 0 | 1 => (),
24722 unknown => {
24723 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
24724 }
24725 }
24726
24727 Ok(())
24728 }
24729 }
24730
24731 impl ::core::convert::From<crate::natural::StartupMode> for StartupMode {
24732 fn from(natural: crate::natural::StartupMode) -> Self {
24733 match natural {
24734 crate::natural::StartupMode::Lazy => StartupMode::LAZY,
24735
24736 crate::natural::StartupMode::Eager => StartupMode::EAGER,
24737 }
24738 }
24739 }
24740
24741 impl ::fidl_next::IntoNatural for StartupMode {
24742 type Natural = crate::natural::StartupMode;
24743 }
24744
24745 impl ::fidl_next::Unconstrained for StartupMode {}
24746
24747 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
24749 #[repr(transparent)]
24750 pub struct OnTerminate {
24751 pub(crate) value: ::fidl_next::WireU32,
24752 }
24753
24754 unsafe impl ::fidl_next::Wire for OnTerminate {
24755 type Owned<'de> = Self;
24756
24757 #[inline]
24758 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
24759 }
24761 }
24762
24763 impl OnTerminate {
24764 pub const NONE: OnTerminate = OnTerminate { value: ::fidl_next::WireU32(0) };
24765
24766 pub const REBOOT: OnTerminate = OnTerminate { value: ::fidl_next::WireU32(1) };
24767 }
24768
24769 unsafe impl<___D> ::fidl_next::Decode<___D> for OnTerminate
24770 where
24771 ___D: ?Sized,
24772 {
24773 fn decode(
24774 slot: ::fidl_next::Slot<'_, Self>,
24775 _: &mut ___D,
24776 _: (),
24777 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24778 ::fidl_next::munge!(let Self { value } = slot);
24779
24780 match u32::from(*value) {
24781 0 | 1 => (),
24782 unknown => {
24783 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
24784 }
24785 }
24786
24787 Ok(())
24788 }
24789 }
24790
24791 impl ::core::convert::From<crate::natural::OnTerminate> for OnTerminate {
24792 fn from(natural: crate::natural::OnTerminate) -> Self {
24793 match natural {
24794 crate::natural::OnTerminate::None => OnTerminate::NONE,
24795
24796 crate::natural::OnTerminate::Reboot => OnTerminate::REBOOT,
24797 }
24798 }
24799 }
24800
24801 impl ::fidl_next::IntoNatural for OnTerminate {
24802 type Natural = crate::natural::OnTerminate;
24803 }
24804
24805 impl ::fidl_next::Unconstrained for OnTerminate {}
24806
24807 pub type ConfigKey<'de> = ::fidl_next::WireString<'de>;
24809
24810 #[repr(C)]
24812 pub struct ConfigOverride<'de> {
24813 pub(crate) table: ::fidl_next::WireTable<'de>,
24814 }
24815
24816 impl<'de> Drop for ConfigOverride<'de> {
24817 fn drop(&mut self) {
24818 let _ = self.table.get(1).map(|envelope| unsafe {
24819 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24820 });
24821
24822 let _ = self.table.get(2).map(|envelope| unsafe {
24823 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
24824 });
24825 }
24826 }
24827
24828 unsafe impl ::fidl_next::Wire for ConfigOverride<'static> {
24829 type Owned<'de> = ConfigOverride<'de>;
24830
24831 #[inline]
24832 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
24833 ::fidl_next::munge!(let Self { table } = out);
24834 ::fidl_next::WireTable::zero_padding(table);
24835 }
24836 }
24837
24838 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigOverride<'static>
24839 where
24840 ___D: ::fidl_next::Decoder + ?Sized,
24841 {
24842 fn decode(
24843 slot: ::fidl_next::Slot<'_, Self>,
24844 decoder: &mut ___D,
24845 _: (),
24846 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24847 ::fidl_next::munge!(let Self { table } = slot);
24848
24849 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
24850 match ordinal {
24851 0 => unsafe { ::core::hint::unreachable_unchecked() },
24852
24853 1 => {
24854 ::fidl_next::WireEnvelope::decode_as::<
24855 ___D,
24856 ::fidl_next::WireString<'static>,
24857 >(slot.as_mut(), decoder, 64)?;
24858
24859 let value = unsafe {
24860 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24861 };
24862
24863 if value.len() > 64 {
24864 return Err(::fidl_next::DecodeError::VectorTooLong {
24865 size: value.len() as u64,
24866 limit: 64,
24867 });
24868 }
24869
24870 Ok(())
24871 }
24872
24873 2 => {
24874 ::fidl_next::WireEnvelope::decode_as::<
24875 ___D,
24876 crate::wire::ConfigValue<'static>,
24877 >(slot.as_mut(), decoder, ())?;
24878
24879 Ok(())
24880 }
24881
24882 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
24883 }
24884 })
24885 }
24886 }
24887
24888 impl<'de> ConfigOverride<'de> {
24889 pub fn key(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
24890 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
24891 }
24892
24893 pub fn value(&self) -> ::core::option::Option<&crate::wire::ConfigValue<'de>> {
24894 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
24895 }
24896 }
24897
24898 impl<'de> ::core::fmt::Debug for ConfigOverride<'de> {
24899 fn fmt(
24900 &self,
24901 f: &mut ::core::fmt::Formatter<'_>,
24902 ) -> ::core::result::Result<(), ::core::fmt::Error> {
24903 f.debug_struct("ConfigOverride")
24904 .field("key", &self.key())
24905 .field("value", &self.value())
24906 .finish()
24907 }
24908 }
24909
24910 impl<'de> ::fidl_next::IntoNatural for ConfigOverride<'de> {
24911 type Natural = crate::natural::ConfigOverride;
24912 }
24913
24914 impl ::fidl_next::Unconstrained for ConfigOverride<'_> {}
24915
24916 #[repr(C)]
24918 pub struct Child<'de> {
24919 pub(crate) table: ::fidl_next::WireTable<'de>,
24920 }
24921
24922 impl<'de> Drop for Child<'de> {
24923 fn drop(&mut self) {
24924 let _ = self.table.get(1).map(|envelope| unsafe {
24925 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24926 });
24927
24928 let _ = self.table.get(2).map(|envelope| unsafe {
24929 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24930 });
24931
24932 let _ = self
24933 .table
24934 .get(3)
24935 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::StartupMode>() });
24936
24937 let _ = self.table.get(4).map(|envelope| unsafe {
24938 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
24939 });
24940
24941 let _ = self
24942 .table
24943 .get(5)
24944 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::OnTerminate>() });
24945
24946 let _ = self.table.get(6)
24947 .map(|envelope| unsafe {
24948 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::ConfigOverride<'de>>>()
24949 });
24950 }
24951 }
24952
24953 unsafe impl ::fidl_next::Wire for Child<'static> {
24954 type Owned<'de> = Child<'de>;
24955
24956 #[inline]
24957 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
24958 ::fidl_next::munge!(let Self { table } = out);
24959 ::fidl_next::WireTable::zero_padding(table);
24960 }
24961 }
24962
24963 unsafe impl<___D> ::fidl_next::Decode<___D> for Child<'static>
24964 where
24965 ___D: ::fidl_next::Decoder + ?Sized,
24966 {
24967 fn decode(
24968 slot: ::fidl_next::Slot<'_, Self>,
24969 decoder: &mut ___D,
24970 _: (),
24971 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
24972 ::fidl_next::munge!(let Self { table } = slot);
24973
24974 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
24975 match ordinal {
24976 0 => unsafe { ::core::hint::unreachable_unchecked() },
24977
24978 1 => {
24979 ::fidl_next::WireEnvelope::decode_as::<
24980 ___D,
24981 ::fidl_next::WireString<'static>,
24982 >(slot.as_mut(), decoder, 1024)?;
24983
24984 let value = unsafe {
24985 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
24986 };
24987
24988 if value.len() > 1024 {
24989 return Err(::fidl_next::DecodeError::VectorTooLong {
24990 size: value.len() as u64,
24991 limit: 1024,
24992 });
24993 }
24994
24995 Ok(())
24996 }
24997
24998 2 => {
24999 ::fidl_next::WireEnvelope::decode_as::<
25000 ___D,
25001 ::fidl_next::WireString<'static>,
25002 >(slot.as_mut(), decoder, 4096)?;
25003
25004 let value = unsafe {
25005 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
25006 };
25007
25008 if value.len() > 4096 {
25009 return Err(::fidl_next::DecodeError::VectorTooLong {
25010 size: value.len() as u64,
25011 limit: 4096,
25012 });
25013 }
25014
25015 Ok(())
25016 }
25017
25018 3 => {
25019 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::StartupMode>(
25020 slot.as_mut(),
25021 decoder,
25022 (),
25023 )?;
25024
25025 Ok(())
25026 }
25027
25028 4 => {
25029 ::fidl_next::WireEnvelope::decode_as::<
25030 ___D,
25031 ::fidl_next::WireString<'static>,
25032 >(slot.as_mut(), decoder, 100)?;
25033
25034 let value = unsafe {
25035 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
25036 };
25037
25038 if value.len() > 100 {
25039 return Err(::fidl_next::DecodeError::VectorTooLong {
25040 size: value.len() as u64,
25041 limit: 100,
25042 });
25043 }
25044
25045 Ok(())
25046 }
25047
25048 5 => {
25049 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::OnTerminate>(
25050 slot.as_mut(),
25051 decoder,
25052 (),
25053 )?;
25054
25055 Ok(())
25056 }
25057
25058 6 => {
25059 ::fidl_next::WireEnvelope::decode_as::<
25060 ___D,
25061 ::fidl_next::WireVector<'static, crate::wire::ConfigOverride<'static>>,
25062 >(slot.as_mut(), decoder, (4294967295, ()))?;
25063
25064 Ok(())
25065 }
25066
25067 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
25068 }
25069 })
25070 }
25071 }
25072
25073 impl<'de> Child<'de> {
25074 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
25075 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
25076 }
25077
25078 pub fn url(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
25079 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
25080 }
25081
25082 pub fn startup(&self) -> ::core::option::Option<&crate::wire::StartupMode> {
25083 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
25084 }
25085
25086 pub fn environment(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
25087 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
25088 }
25089
25090 pub fn on_terminate(&self) -> ::core::option::Option<&crate::wire::OnTerminate> {
25091 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
25092 }
25093
25094 pub fn config_overrides(
25095 &self,
25096 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::wire::ConfigOverride<'de>>>
25097 {
25098 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
25099 }
25100 }
25101
25102 impl<'de> ::core::fmt::Debug for Child<'de> {
25103 fn fmt(
25104 &self,
25105 f: &mut ::core::fmt::Formatter<'_>,
25106 ) -> ::core::result::Result<(), ::core::fmt::Error> {
25107 f.debug_struct("Child")
25108 .field("name", &self.name())
25109 .field("url", &self.url())
25110 .field("startup", &self.startup())
25111 .field("environment", &self.environment())
25112 .field("on_terminate", &self.on_terminate())
25113 .field("config_overrides", &self.config_overrides())
25114 .finish()
25115 }
25116 }
25117
25118 impl<'de> ::fidl_next::IntoNatural for Child<'de> {
25119 type Natural = crate::natural::Child;
25120 }
25121
25122 impl ::fidl_next::Unconstrained for Child<'_> {}
25123
25124 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
25126 #[repr(transparent)]
25127 pub struct Durability {
25128 pub(crate) value: ::fidl_next::WireU32,
25129 }
25130
25131 unsafe impl ::fidl_next::Wire for Durability {
25132 type Owned<'de> = Self;
25133
25134 #[inline]
25135 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
25136 }
25138 }
25139
25140 impl Durability {
25141 pub const TRANSIENT: Durability = Durability { value: ::fidl_next::WireU32(2) };
25142
25143 pub const SINGLE_RUN: Durability = Durability { value: ::fidl_next::WireU32(3) };
25144 }
25145
25146 unsafe impl<___D> ::fidl_next::Decode<___D> for Durability
25147 where
25148 ___D: ?Sized,
25149 {
25150 fn decode(
25151 slot: ::fidl_next::Slot<'_, Self>,
25152 _: &mut ___D,
25153 _: (),
25154 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25155 ::fidl_next::munge!(let Self { value } = slot);
25156
25157 match u32::from(*value) {
25158 2 | 3 => (),
25159 unknown => {
25160 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
25161 }
25162 }
25163
25164 Ok(())
25165 }
25166 }
25167
25168 impl ::core::convert::From<crate::natural::Durability> for Durability {
25169 fn from(natural: crate::natural::Durability) -> Self {
25170 match natural {
25171 crate::natural::Durability::Transient => Durability::TRANSIENT,
25172
25173 crate::natural::Durability::SingleRun => Durability::SINGLE_RUN,
25174 }
25175 }
25176 }
25177
25178 impl ::fidl_next::IntoNatural for Durability {
25179 type Natural = crate::natural::Durability;
25180 }
25181
25182 impl ::fidl_next::Unconstrained for Durability {}
25183
25184 #[repr(C)]
25186 pub struct Collection<'de> {
25187 pub(crate) table: ::fidl_next::WireTable<'de>,
25188 }
25189
25190 impl<'de> Drop for Collection<'de> {
25191 fn drop(&mut self) {
25192 let _ = self.table.get(1).map(|envelope| unsafe {
25193 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
25194 });
25195
25196 let _ = self
25197 .table
25198 .get(2)
25199 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Durability>() });
25200
25201 let _ = self.table.get(3).map(|envelope| unsafe {
25202 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
25203 });
25204
25205 let _ = self
25206 .table
25207 .get(4)
25208 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::AllowedOffers>() });
25209
25210 let _ = self.table.get(5).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
25211
25212 let _ = self.table.get(6).map(|envelope| unsafe { envelope.read_unchecked::<bool>() });
25213 }
25214 }
25215
25216 unsafe impl ::fidl_next::Wire for Collection<'static> {
25217 type Owned<'de> = Collection<'de>;
25218
25219 #[inline]
25220 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25221 ::fidl_next::munge!(let Self { table } = out);
25222 ::fidl_next::WireTable::zero_padding(table);
25223 }
25224 }
25225
25226 unsafe impl<___D> ::fidl_next::Decode<___D> for Collection<'static>
25227 where
25228 ___D: ::fidl_next::Decoder + ?Sized,
25229 {
25230 fn decode(
25231 slot: ::fidl_next::Slot<'_, Self>,
25232 decoder: &mut ___D,
25233 _: (),
25234 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25235 ::fidl_next::munge!(let Self { table } = slot);
25236
25237 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
25238 match ordinal {
25239 0 => unsafe { ::core::hint::unreachable_unchecked() },
25240
25241 1 => {
25242 ::fidl_next::WireEnvelope::decode_as::<
25243 ___D,
25244 ::fidl_next::WireString<'static>,
25245 >(slot.as_mut(), decoder, 100)?;
25246
25247 let value = unsafe {
25248 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
25249 };
25250
25251 if value.len() > 100 {
25252 return Err(::fidl_next::DecodeError::VectorTooLong {
25253 size: value.len() as u64,
25254 limit: 100,
25255 });
25256 }
25257
25258 Ok(())
25259 }
25260
25261 2 => {
25262 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Durability>(
25263 slot.as_mut(),
25264 decoder,
25265 (),
25266 )?;
25267
25268 Ok(())
25269 }
25270
25271 3 => {
25272 ::fidl_next::WireEnvelope::decode_as::<
25273 ___D,
25274 ::fidl_next::WireString<'static>,
25275 >(slot.as_mut(), decoder, 100)?;
25276
25277 let value = unsafe {
25278 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
25279 };
25280
25281 if value.len() > 100 {
25282 return Err(::fidl_next::DecodeError::VectorTooLong {
25283 size: value.len() as u64,
25284 limit: 100,
25285 });
25286 }
25287
25288 Ok(())
25289 }
25290
25291 4 => {
25292 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::AllowedOffers>(
25293 slot.as_mut(),
25294 decoder,
25295 (),
25296 )?;
25297
25298 Ok(())
25299 }
25300
25301 5 => {
25302 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(
25303 slot.as_mut(),
25304 decoder,
25305 (),
25306 )?;
25307
25308 Ok(())
25309 }
25310
25311 6 => {
25312 ::fidl_next::WireEnvelope::decode_as::<___D, bool>(
25313 slot.as_mut(),
25314 decoder,
25315 (),
25316 )?;
25317
25318 Ok(())
25319 }
25320
25321 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
25322 }
25323 })
25324 }
25325 }
25326
25327 impl<'de> Collection<'de> {
25328 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
25329 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
25330 }
25331
25332 pub fn durability(&self) -> ::core::option::Option<&crate::wire::Durability> {
25333 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
25334 }
25335
25336 pub fn environment(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
25337 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
25338 }
25339
25340 pub fn allowed_offers(&self) -> ::core::option::Option<&crate::wire::AllowedOffers> {
25341 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
25342 }
25343
25344 pub fn allow_long_names(&self) -> ::core::option::Option<&bool> {
25345 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
25346 }
25347
25348 pub fn persistent_storage(&self) -> ::core::option::Option<&bool> {
25349 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
25350 }
25351 }
25352
25353 impl<'de> ::core::fmt::Debug for Collection<'de> {
25354 fn fmt(
25355 &self,
25356 f: &mut ::core::fmt::Formatter<'_>,
25357 ) -> ::core::result::Result<(), ::core::fmt::Error> {
25358 f.debug_struct("Collection")
25359 .field("name", &self.name())
25360 .field("durability", &self.durability())
25361 .field("environment", &self.environment())
25362 .field("allowed_offers", &self.allowed_offers())
25363 .field("allow_long_names", &self.allow_long_names())
25364 .field("persistent_storage", &self.persistent_storage())
25365 .finish()
25366 }
25367 }
25368
25369 impl<'de> ::fidl_next::IntoNatural for Collection<'de> {
25370 type Natural = crate::natural::Collection;
25371 }
25372
25373 impl ::fidl_next::Unconstrained for Collection<'_> {}
25374
25375 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
25377 #[repr(transparent)]
25378 pub struct DependencyType {
25379 pub(crate) value: ::fidl_next::WireU32,
25380 }
25381
25382 unsafe impl ::fidl_next::Wire for DependencyType {
25383 type Owned<'de> = Self;
25384
25385 #[inline]
25386 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
25387 }
25389 }
25390
25391 impl DependencyType {
25392 pub const STRONG: DependencyType = DependencyType { value: ::fidl_next::WireU32(1) };
25393
25394 pub const WEAK: DependencyType = DependencyType { value: ::fidl_next::WireU32(2) };
25395 }
25396
25397 unsafe impl<___D> ::fidl_next::Decode<___D> for DependencyType
25398 where
25399 ___D: ?Sized,
25400 {
25401 fn decode(
25402 slot: ::fidl_next::Slot<'_, Self>,
25403 _: &mut ___D,
25404 _: (),
25405 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25406 ::fidl_next::munge!(let Self { value } = slot);
25407
25408 match u32::from(*value) {
25409 1 | 2 => (),
25410 unknown => {
25411 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
25412 }
25413 }
25414
25415 Ok(())
25416 }
25417 }
25418
25419 impl ::core::convert::From<crate::natural::DependencyType> for DependencyType {
25420 fn from(natural: crate::natural::DependencyType) -> Self {
25421 match natural {
25422 crate::natural::DependencyType::Strong => DependencyType::STRONG,
25423
25424 crate::natural::DependencyType::Weak => DependencyType::WEAK,
25425 }
25426 }
25427 }
25428
25429 impl ::fidl_next::IntoNatural for DependencyType {
25430 type Natural = crate::natural::DependencyType;
25431 }
25432
25433 impl ::fidl_next::Unconstrained for DependencyType {}
25434
25435 #[derive(Debug)]
25437 #[repr(C)]
25438 pub struct NameMapping<'de> {
25439 pub source_name: ::fidl_next::WireString<'de>,
25440
25441 pub target_name: ::fidl_next::WireString<'de>,
25442 }
25443
25444 static_assertions::const_assert_eq!(std::mem::size_of::<NameMapping<'_>>(), 32);
25445 static_assertions::const_assert_eq!(std::mem::align_of::<NameMapping<'_>>(), 8);
25446
25447 static_assertions::const_assert_eq!(std::mem::offset_of!(NameMapping<'_>, source_name), 0);
25448
25449 static_assertions::const_assert_eq!(std::mem::offset_of!(NameMapping<'_>, target_name), 16);
25450
25451 unsafe impl ::fidl_next::Wire for NameMapping<'static> {
25452 type Owned<'de> = NameMapping<'de>;
25453
25454 #[inline]
25455 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
25456 ::fidl_next::munge! {
25457 let Self {
25458
25459 source_name,
25460 target_name,
25461
25462 } = &mut *out_;
25463 }
25464
25465 ::fidl_next::Wire::zero_padding(source_name);
25466
25467 ::fidl_next::Wire::zero_padding(target_name);
25468 }
25469 }
25470
25471 unsafe impl<___D> ::fidl_next::Decode<___D> for NameMapping<'static>
25472 where
25473 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
25474 ___D: ::fidl_next::Decoder,
25475 {
25476 fn decode(
25477 slot_: ::fidl_next::Slot<'_, Self>,
25478 decoder_: &mut ___D,
25479 _: (),
25480 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25481 ::fidl_next::munge! {
25482 let Self {
25483
25484 mut source_name,
25485 mut target_name,
25486
25487 } = slot_;
25488 }
25489
25490 let _field = source_name.as_mut();
25491 ::fidl_next::Constrained::validate(_field, 100)?;
25492 ::fidl_next::Decode::decode(source_name.as_mut(), decoder_, 100)?;
25493
25494 let source_name = unsafe { source_name.deref_unchecked() };
25495
25496 if source_name.len() > 100 {
25497 return Err(::fidl_next::DecodeError::VectorTooLong {
25498 size: source_name.len() as u64,
25499 limit: 100,
25500 });
25501 }
25502
25503 let _field = target_name.as_mut();
25504 ::fidl_next::Constrained::validate(_field, 100)?;
25505 ::fidl_next::Decode::decode(target_name.as_mut(), decoder_, 100)?;
25506
25507 let target_name = unsafe { target_name.deref_unchecked() };
25508
25509 if target_name.len() > 100 {
25510 return Err(::fidl_next::DecodeError::VectorTooLong {
25511 size: target_name.len() as u64,
25512 limit: 100,
25513 });
25514 }
25515
25516 Ok(())
25517 }
25518 }
25519
25520 impl<'de> ::fidl_next::IntoNatural for NameMapping<'de> {
25521 type Natural = crate::natural::NameMapping;
25522 }
25523
25524 impl ::fidl_next::Unconstrained for NameMapping<'static> {}
25525
25526 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
25528 #[repr(transparent)]
25529 pub struct EnvironmentExtends {
25530 pub(crate) value: ::fidl_next::WireU32,
25531 }
25532
25533 unsafe impl ::fidl_next::Wire for EnvironmentExtends {
25534 type Owned<'de> = Self;
25535
25536 #[inline]
25537 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
25538 }
25540 }
25541
25542 impl EnvironmentExtends {
25543 pub const NONE: EnvironmentExtends = EnvironmentExtends { value: ::fidl_next::WireU32(0) };
25544
25545 pub const REALM: EnvironmentExtends = EnvironmentExtends { value: ::fidl_next::WireU32(1) };
25546 }
25547
25548 unsafe impl<___D> ::fidl_next::Decode<___D> for EnvironmentExtends
25549 where
25550 ___D: ?Sized,
25551 {
25552 fn decode(
25553 slot: ::fidl_next::Slot<'_, Self>,
25554 _: &mut ___D,
25555 _: (),
25556 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25557 ::fidl_next::munge!(let Self { value } = slot);
25558
25559 match u32::from(*value) {
25560 0 | 1 => (),
25561 unknown => {
25562 return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128));
25563 }
25564 }
25565
25566 Ok(())
25567 }
25568 }
25569
25570 impl ::core::convert::From<crate::natural::EnvironmentExtends> for EnvironmentExtends {
25571 fn from(natural: crate::natural::EnvironmentExtends) -> Self {
25572 match natural {
25573 crate::natural::EnvironmentExtends::None => EnvironmentExtends::NONE,
25574
25575 crate::natural::EnvironmentExtends::Realm => EnvironmentExtends::REALM,
25576 }
25577 }
25578 }
25579
25580 impl ::fidl_next::IntoNatural for EnvironmentExtends {
25581 type Natural = crate::natural::EnvironmentExtends;
25582 }
25583
25584 impl ::fidl_next::Unconstrained for EnvironmentExtends {}
25585
25586 pub type UrlScheme<'de> = ::fidl_next::WireString<'de>;
25588
25589 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
25591 #[repr(transparent)]
25592 pub struct ConfigTypeLayout {
25593 pub(crate) value: ::fidl_next::WireU32,
25594 }
25595
25596 unsafe impl ::fidl_next::Wire for ConfigTypeLayout {
25597 type Owned<'de> = Self;
25598
25599 #[inline]
25600 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
25601 }
25603 }
25604
25605 impl ConfigTypeLayout {
25606 pub const BOOL: ConfigTypeLayout = ConfigTypeLayout { value: ::fidl_next::WireU32(1) };
25607
25608 pub const UINT8: ConfigTypeLayout = ConfigTypeLayout { value: ::fidl_next::WireU32(2) };
25609
25610 pub const UINT16: ConfigTypeLayout = ConfigTypeLayout { value: ::fidl_next::WireU32(3) };
25611
25612 pub const UINT32: ConfigTypeLayout = ConfigTypeLayout { value: ::fidl_next::WireU32(4) };
25613
25614 pub const UINT64: ConfigTypeLayout = ConfigTypeLayout { value: ::fidl_next::WireU32(5) };
25615
25616 pub const INT8: ConfigTypeLayout = ConfigTypeLayout { value: ::fidl_next::WireU32(6) };
25617
25618 pub const INT16: ConfigTypeLayout = ConfigTypeLayout { value: ::fidl_next::WireU32(7) };
25619
25620 pub const INT32: ConfigTypeLayout = ConfigTypeLayout { value: ::fidl_next::WireU32(8) };
25621
25622 pub const INT64: ConfigTypeLayout = ConfigTypeLayout { value: ::fidl_next::WireU32(9) };
25623
25624 pub const STRING: ConfigTypeLayout = ConfigTypeLayout { value: ::fidl_next::WireU32(10) };
25625
25626 pub const VECTOR: ConfigTypeLayout = ConfigTypeLayout { value: ::fidl_next::WireU32(11) };
25627 }
25628
25629 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigTypeLayout
25630 where
25631 ___D: ?Sized,
25632 {
25633 fn decode(
25634 slot: ::fidl_next::Slot<'_, Self>,
25635 _: &mut ___D,
25636 _: (),
25637 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25638 Ok(())
25639 }
25640 }
25641
25642 impl ::core::convert::From<crate::natural::ConfigTypeLayout> for ConfigTypeLayout {
25643 fn from(natural: crate::natural::ConfigTypeLayout) -> Self {
25644 match natural {
25645 crate::natural::ConfigTypeLayout::Bool => ConfigTypeLayout::BOOL,
25646
25647 crate::natural::ConfigTypeLayout::Uint8 => ConfigTypeLayout::UINT8,
25648
25649 crate::natural::ConfigTypeLayout::Uint16 => ConfigTypeLayout::UINT16,
25650
25651 crate::natural::ConfigTypeLayout::Uint32 => ConfigTypeLayout::UINT32,
25652
25653 crate::natural::ConfigTypeLayout::Uint64 => ConfigTypeLayout::UINT64,
25654
25655 crate::natural::ConfigTypeLayout::Int8 => ConfigTypeLayout::INT8,
25656
25657 crate::natural::ConfigTypeLayout::Int16 => ConfigTypeLayout::INT16,
25658
25659 crate::natural::ConfigTypeLayout::Int32 => ConfigTypeLayout::INT32,
25660
25661 crate::natural::ConfigTypeLayout::Int64 => ConfigTypeLayout::INT64,
25662
25663 crate::natural::ConfigTypeLayout::String => ConfigTypeLayout::STRING,
25664
25665 crate::natural::ConfigTypeLayout::Vector => ConfigTypeLayout::VECTOR,
25666
25667 crate::natural::ConfigTypeLayout::UnknownOrdinal_(value) => {
25668 ConfigTypeLayout { value: ::fidl_next::WireU32::from(value) }
25669 }
25670 }
25671 }
25672 }
25673
25674 impl ::fidl_next::IntoNatural for ConfigTypeLayout {
25675 type Natural = crate::natural::ConfigTypeLayout;
25676 }
25677
25678 impl ::fidl_next::Unconstrained for ConfigTypeLayout {}
25679
25680 #[repr(transparent)]
25682 pub struct LayoutConstraint<'de> {
25683 pub(crate) raw: ::fidl_next::RawWireUnion,
25684 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
25685 }
25686
25687 impl<'de> Drop for LayoutConstraint<'de> {
25688 fn drop(&mut self) {
25689 match self.raw.ordinal() {
25690 1 => {
25691 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::WireU32>() };
25692 }
25693
25694 _ => (),
25695 }
25696 }
25697 }
25698
25699 unsafe impl ::fidl_next::Wire for LayoutConstraint<'static> {
25700 type Owned<'de> = LayoutConstraint<'de>;
25701
25702 #[inline]
25703 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25704 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
25705 ::fidl_next::RawWireUnion::zero_padding(raw);
25706 }
25707 }
25708
25709 pub mod layout_constraint {
25710 pub enum Ref<'de> {
25711 MaxSize(&'de ::fidl_next::WireU32),
25712
25713 UnknownOrdinal_(u64),
25714 }
25715 }
25716
25717 impl<'de> LayoutConstraint<'de> {
25718 pub fn as_ref(&self) -> crate::wire::layout_constraint::Ref<'_> {
25719 match self.raw.ordinal() {
25720 1 => crate::wire::layout_constraint::Ref::MaxSize(unsafe {
25721 self.raw.get().deref_unchecked::<::fidl_next::WireU32>()
25722 }),
25723
25724 unknown => crate::wire::layout_constraint::Ref::UnknownOrdinal_(unknown),
25725 }
25726 }
25727 }
25728
25729 unsafe impl<___D> ::fidl_next::Decode<___D> for LayoutConstraint<'static>
25730 where
25731 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
25732 ___D: ::fidl_next::Decoder,
25733 {
25734 fn decode(
25735 mut slot: ::fidl_next::Slot<'_, Self>,
25736 decoder: &mut ___D,
25737 _: (),
25738 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25739 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
25740 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
25741 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(
25742 raw,
25743 decoder,
25744 (),
25745 )?,
25746
25747 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
25748 }
25749
25750 Ok(())
25751 }
25752 }
25753
25754 impl<'de> ::core::fmt::Debug for LayoutConstraint<'de> {
25755 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
25756 match self.raw.ordinal() {
25757 1 => unsafe { self.raw.get().deref_unchecked::<::fidl_next::WireU32>().fmt(f) },
25758 _ => unsafe { ::core::hint::unreachable_unchecked() },
25759 }
25760 }
25761 }
25762
25763 impl<'de> ::fidl_next::IntoNatural for LayoutConstraint<'de> {
25764 type Natural = crate::natural::LayoutConstraint;
25765 }
25766
25767 impl ::fidl_next::Unconstrained for LayoutConstraint<'static> {}
25768
25769 #[derive(Debug)]
25771 #[repr(C)]
25772 pub struct ConfigType<'de> {
25773 pub layout: crate::wire::ConfigTypeLayout,
25774
25775 pub parameters: ::fidl_next::WireOptionalVector<'de, crate::wire::LayoutParameter<'de>>,
25776
25777 pub constraints: ::fidl_next::WireVector<'de, crate::wire::LayoutConstraint<'de>>,
25778 }
25779
25780 static_assertions::const_assert_eq!(std::mem::size_of::<ConfigType<'_>>(), 40);
25781 static_assertions::const_assert_eq!(std::mem::align_of::<ConfigType<'_>>(), 8);
25782
25783 static_assertions::const_assert_eq!(std::mem::offset_of!(ConfigType<'_>, layout), 0);
25784
25785 static_assertions::const_assert_eq!(std::mem::offset_of!(ConfigType<'_>, parameters), 8);
25786
25787 static_assertions::const_assert_eq!(std::mem::offset_of!(ConfigType<'_>, constraints), 24);
25788
25789 unsafe impl ::fidl_next::Wire for ConfigType<'static> {
25790 type Owned<'de> = ConfigType<'de>;
25791
25792 #[inline]
25793 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
25794 ::fidl_next::munge! {
25795 let Self {
25796
25797 layout,
25798 parameters,
25799 constraints,
25800
25801 } = &mut *out_;
25802 }
25803
25804 ::fidl_next::Wire::zero_padding(layout);
25805
25806 ::fidl_next::Wire::zero_padding(parameters);
25807
25808 ::fidl_next::Wire::zero_padding(constraints);
25809
25810 unsafe {
25811 out_.as_mut_ptr().cast::<u8>().add(4).write_bytes(0, 4);
25812 }
25813 }
25814 }
25815
25816 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigType<'static>
25817 where
25818 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
25819 ___D: ::fidl_next::Decoder,
25820 {
25821 fn decode(
25822 slot_: ::fidl_next::Slot<'_, Self>,
25823 decoder_: &mut ___D,
25824 _: (),
25825 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25826 if slot_.as_bytes()[4..8] != [0u8; 4] {
25827 return Err(::fidl_next::DecodeError::InvalidPadding);
25828 }
25829
25830 ::fidl_next::munge! {
25831 let Self {
25832
25833 mut layout,
25834 mut parameters,
25835 mut constraints,
25836
25837 } = slot_;
25838 }
25839
25840 let _field = layout.as_mut();
25841
25842 ::fidl_next::Decode::decode(layout.as_mut(), decoder_, ())?;
25843
25844 let _field = parameters.as_mut();
25845 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
25846 ::fidl_next::Decode::decode(parameters.as_mut(), decoder_, (4294967295, ()))?;
25847
25848 let _field = constraints.as_mut();
25849 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
25850 ::fidl_next::Decode::decode(constraints.as_mut(), decoder_, (4294967295, ()))?;
25851
25852 Ok(())
25853 }
25854 }
25855
25856 impl<'de> ::fidl_next::IntoNatural for ConfigType<'de> {
25857 type Natural = crate::natural::ConfigType;
25858 }
25859
25860 impl ::fidl_next::Unconstrained for ConfigType<'static> {}
25861
25862 #[repr(transparent)]
25864 pub struct ConfigChecksum<'de> {
25865 pub(crate) raw: ::fidl_next::RawWireUnion,
25866 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
25867 }
25868
25869 impl<'de> Drop for ConfigChecksum<'de> {
25870 fn drop(&mut self) {
25871 match self.raw.ordinal() {
25872 1 => {
25873 let _ = unsafe { self.raw.get().read_unchecked::<[u8; 32]>() };
25874 }
25875
25876 _ => (),
25877 }
25878 }
25879 }
25880
25881 unsafe impl ::fidl_next::Wire for ConfigChecksum<'static> {
25882 type Owned<'de> = ConfigChecksum<'de>;
25883
25884 #[inline]
25885 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25886 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
25887 ::fidl_next::RawWireUnion::zero_padding(raw);
25888 }
25889 }
25890
25891 pub mod config_checksum {
25892 pub enum Ref<'de> {
25893 Sha256(&'de [u8; 32]),
25894
25895 UnknownOrdinal_(u64),
25896 }
25897 }
25898
25899 impl<'de> ConfigChecksum<'de> {
25900 pub fn as_ref(&self) -> crate::wire::config_checksum::Ref<'_> {
25901 match self.raw.ordinal() {
25902 1 => crate::wire::config_checksum::Ref::Sha256(unsafe {
25903 self.raw.get().deref_unchecked::<[u8; 32]>()
25904 }),
25905
25906 unknown => crate::wire::config_checksum::Ref::UnknownOrdinal_(unknown),
25907 }
25908 }
25909 }
25910
25911 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigChecksum<'static>
25912 where
25913 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
25914 ___D: ::fidl_next::Decoder,
25915 {
25916 fn decode(
25917 mut slot: ::fidl_next::Slot<'_, Self>,
25918 decoder: &mut ___D,
25919 _: (),
25920 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25921 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
25922 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
25923 1 => ::fidl_next::RawWireUnion::decode_as::<___D, [u8; 32]>(raw, decoder, ())?,
25924
25925 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
25926 }
25927
25928 Ok(())
25929 }
25930 }
25931
25932 impl<'de> ::core::fmt::Debug for ConfigChecksum<'de> {
25933 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
25934 match self.raw.ordinal() {
25935 1 => unsafe { self.raw.get().deref_unchecked::<[u8; 32]>().fmt(f) },
25936 _ => unsafe { ::core::hint::unreachable_unchecked() },
25937 }
25938 }
25939 }
25940
25941 impl<'de> ::fidl_next::IntoNatural for ConfigChecksum<'de> {
25942 type Natural = crate::natural::ConfigChecksum;
25943 }
25944
25945 impl ::fidl_next::Unconstrained for ConfigChecksum<'static> {}
25946
25947 #[repr(C)]
25949 pub struct UseStorage<'de> {
25950 pub(crate) table: ::fidl_next::WireTable<'de>,
25951 }
25952
25953 impl<'de> Drop for UseStorage<'de> {
25954 fn drop(&mut self) {
25955 let _ = self.table.get(1).map(|envelope| unsafe {
25956 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
25957 });
25958
25959 let _ = self.table.get(2).map(|envelope| unsafe {
25960 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
25961 });
25962
25963 let _ = self
25964 .table
25965 .get(3)
25966 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
25967 }
25968 }
25969
25970 unsafe impl ::fidl_next::Wire for UseStorage<'static> {
25971 type Owned<'de> = UseStorage<'de>;
25972
25973 #[inline]
25974 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
25975 ::fidl_next::munge!(let Self { table } = out);
25976 ::fidl_next::WireTable::zero_padding(table);
25977 }
25978 }
25979
25980 unsafe impl<___D> ::fidl_next::Decode<___D> for UseStorage<'static>
25981 where
25982 ___D: ::fidl_next::Decoder + ?Sized,
25983 {
25984 fn decode(
25985 slot: ::fidl_next::Slot<'_, Self>,
25986 decoder: &mut ___D,
25987 _: (),
25988 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
25989 ::fidl_next::munge!(let Self { table } = slot);
25990
25991 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
25992 match ordinal {
25993 0 => unsafe { ::core::hint::unreachable_unchecked() },
25994
25995 1 => {
25996 ::fidl_next::WireEnvelope::decode_as::<
25997 ___D,
25998 ::fidl_next::WireString<'static>,
25999 >(slot.as_mut(), decoder, 100)?;
26000
26001 let value = unsafe {
26002 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26003 };
26004
26005 if value.len() > 100 {
26006 return Err(::fidl_next::DecodeError::VectorTooLong {
26007 size: value.len() as u64,
26008 limit: 100,
26009 });
26010 }
26011
26012 Ok(())
26013 }
26014
26015 2 => {
26016 ::fidl_next::WireEnvelope::decode_as::<
26017 ___D,
26018 ::fidl_next::WireString<'static>,
26019 >(slot.as_mut(), decoder, 1024)?;
26020
26021 let value = unsafe {
26022 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26023 };
26024
26025 if value.len() > 1024 {
26026 return Err(::fidl_next::DecodeError::VectorTooLong {
26027 size: value.len() as u64,
26028 limit: 1024,
26029 });
26030 }
26031
26032 Ok(())
26033 }
26034
26035 3 => {
26036 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
26037 slot.as_mut(),
26038 decoder,
26039 (),
26040 )?;
26041
26042 Ok(())
26043 }
26044
26045 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
26046 }
26047 })
26048 }
26049 }
26050
26051 impl<'de> UseStorage<'de> {
26052 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
26053 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
26054 }
26055
26056 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
26057 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
26058 }
26059
26060 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
26061 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
26062 }
26063 }
26064
26065 impl<'de> ::core::fmt::Debug for UseStorage<'de> {
26066 fn fmt(
26067 &self,
26068 f: &mut ::core::fmt::Formatter<'_>,
26069 ) -> ::core::result::Result<(), ::core::fmt::Error> {
26070 f.debug_struct("UseStorage")
26071 .field("source_name", &self.source_name())
26072 .field("target_path", &self.target_path())
26073 .field("availability", &self.availability())
26074 .finish()
26075 }
26076 }
26077
26078 impl<'de> ::fidl_next::IntoNatural for UseStorage<'de> {
26079 type Natural = crate::natural::UseStorage;
26080 }
26081
26082 impl ::fidl_next::Unconstrained for UseStorage<'_> {}
26083
26084 #[derive(Clone, Copy, Debug)]
26086 #[repr(transparent)]
26087 pub struct ConfigMutability {
26088 pub(crate) value: ::fidl_next::WireU32,
26089 }
26090
26091 unsafe impl ::fidl_next::Wire for ConfigMutability {
26092 type Owned<'de> = Self;
26093
26094 #[inline]
26095 fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
26096 }
26098 }
26099
26100 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigMutability
26101 where
26102 ___D: ?Sized,
26103 {
26104 fn decode(
26105 slot: ::fidl_next::Slot<'_, Self>,
26106 _: &mut ___D,
26107 _: (),
26108 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26109 Ok(())
26110 }
26111 }
26112
26113 impl ::core::convert::From<crate::natural::ConfigMutability> for ConfigMutability {
26114 fn from(natural: crate::natural::ConfigMutability) -> Self {
26115 Self { value: ::fidl_next::WireU32::from(natural.bits()) }
26116 }
26117 }
26118
26119 impl ::fidl_next::IntoNatural for ConfigMutability {
26120 type Natural = crate::natural::ConfigMutability;
26121 }
26122
26123 impl ::fidl_next::Unconstrained for ConfigMutability {}
26124
26125 #[repr(C)]
26127 pub struct ConfigField<'de> {
26128 pub(crate) table: ::fidl_next::WireTable<'de>,
26129 }
26130
26131 impl<'de> Drop for ConfigField<'de> {
26132 fn drop(&mut self) {
26133 let _ = self.table.get(1).map(|envelope| unsafe {
26134 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
26135 });
26136
26137 let _ = self.table.get(2).map(|envelope| unsafe {
26138 envelope.read_unchecked::<crate::wire::ConfigType<'de>>()
26139 });
26140
26141 let _ = self.table.get(3).map(|envelope| unsafe {
26142 envelope.read_unchecked::<crate::wire::ConfigMutability>()
26143 });
26144 }
26145 }
26146
26147 unsafe impl ::fidl_next::Wire for ConfigField<'static> {
26148 type Owned<'de> = ConfigField<'de>;
26149
26150 #[inline]
26151 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26152 ::fidl_next::munge!(let Self { table } = out);
26153 ::fidl_next::WireTable::zero_padding(table);
26154 }
26155 }
26156
26157 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigField<'static>
26158 where
26159 ___D: ::fidl_next::Decoder + ?Sized,
26160 {
26161 fn decode(
26162 slot: ::fidl_next::Slot<'_, Self>,
26163 decoder: &mut ___D,
26164 _: (),
26165 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26166 ::fidl_next::munge!(let Self { table } = slot);
26167
26168 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
26169 match ordinal {
26170 0 => unsafe { ::core::hint::unreachable_unchecked() },
26171
26172 1 => {
26173 ::fidl_next::WireEnvelope::decode_as::<
26174 ___D,
26175 ::fidl_next::WireString<'static>,
26176 >(slot.as_mut(), decoder, 64)?;
26177
26178 let value = unsafe {
26179 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26180 };
26181
26182 if value.len() > 64 {
26183 return Err(::fidl_next::DecodeError::VectorTooLong {
26184 size: value.len() as u64,
26185 limit: 64,
26186 });
26187 }
26188
26189 Ok(())
26190 }
26191
26192 2 => {
26193 ::fidl_next::WireEnvelope::decode_as::<
26194 ___D,
26195 crate::wire::ConfigType<'static>,
26196 >(slot.as_mut(), decoder, ())?;
26197
26198 Ok(())
26199 }
26200
26201 3 => {
26202 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::ConfigMutability>(
26203 slot.as_mut(),
26204 decoder,
26205 (),
26206 )?;
26207
26208 Ok(())
26209 }
26210
26211 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
26212 }
26213 })
26214 }
26215 }
26216
26217 impl<'de> ConfigField<'de> {
26218 pub fn key(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
26219 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
26220 }
26221
26222 pub fn type_(&self) -> ::core::option::Option<&crate::wire::ConfigType<'de>> {
26223 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
26224 }
26225
26226 pub fn mutability(&self) -> ::core::option::Option<&crate::wire::ConfigMutability> {
26227 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
26228 }
26229 }
26230
26231 impl<'de> ::core::fmt::Debug for ConfigField<'de> {
26232 fn fmt(
26233 &self,
26234 f: &mut ::core::fmt::Formatter<'_>,
26235 ) -> ::core::result::Result<(), ::core::fmt::Error> {
26236 f.debug_struct("ConfigField")
26237 .field("key", &self.key())
26238 .field("type_", &self.type_())
26239 .field("mutability", &self.mutability())
26240 .finish()
26241 }
26242 }
26243
26244 impl<'de> ::fidl_next::IntoNatural for ConfigField<'de> {
26245 type Natural = crate::natural::ConfigField;
26246 }
26247
26248 impl ::fidl_next::Unconstrained for ConfigField<'_> {}
26249
26250 #[repr(C)]
26252 pub struct Program<'de> {
26253 pub(crate) table: ::fidl_next::WireTable<'de>,
26254 }
26255
26256 impl<'de> Drop for Program<'de> {
26257 fn drop(&mut self) {
26258 let _ = self.table.get(1).map(|envelope| unsafe {
26259 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
26260 });
26261
26262 let _ = self.table.get(2).map(|envelope| unsafe {
26263 envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>()
26264 });
26265 }
26266 }
26267
26268 unsafe impl ::fidl_next::Wire for Program<'static> {
26269 type Owned<'de> = Program<'de>;
26270
26271 #[inline]
26272 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26273 ::fidl_next::munge!(let Self { table } = out);
26274 ::fidl_next::WireTable::zero_padding(table);
26275 }
26276 }
26277
26278 unsafe impl<___D> ::fidl_next::Decode<___D> for Program<'static>
26279 where
26280 ___D: ::fidl_next::Decoder + ?Sized,
26281 {
26282 fn decode(
26283 slot: ::fidl_next::Slot<'_, Self>,
26284 decoder: &mut ___D,
26285 _: (),
26286 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26287 ::fidl_next::munge!(let Self { table } = slot);
26288
26289 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
26290 match ordinal {
26291 0 => unsafe { ::core::hint::unreachable_unchecked() },
26292
26293 1 => {
26294 ::fidl_next::WireEnvelope::decode_as::<
26295 ___D,
26296 ::fidl_next::WireString<'static>,
26297 >(slot.as_mut(), decoder, 100)?;
26298
26299 let value = unsafe {
26300 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26301 };
26302
26303 if value.len() > 100 {
26304 return Err(::fidl_next::DecodeError::VectorTooLong {
26305 size: value.len() as u64,
26306 limit: 100,
26307 });
26308 }
26309
26310 Ok(())
26311 }
26312
26313 2 => {
26314 ::fidl_next::WireEnvelope::decode_as::<
26315 ___D,
26316 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
26317 >(slot.as_mut(), decoder, ())?;
26318
26319 Ok(())
26320 }
26321
26322 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
26323 }
26324 })
26325 }
26326 }
26327
26328 impl<'de> Program<'de> {
26329 pub fn runner(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
26330 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
26331 }
26332
26333 pub fn info(
26334 &self,
26335 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>
26336 {
26337 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
26338 }
26339 }
26340
26341 impl<'de> ::core::fmt::Debug for Program<'de> {
26342 fn fmt(
26343 &self,
26344 f: &mut ::core::fmt::Formatter<'_>,
26345 ) -> ::core::result::Result<(), ::core::fmt::Error> {
26346 f.debug_struct("Program")
26347 .field("runner", &self.runner())
26348 .field("info", &self.info())
26349 .finish()
26350 }
26351 }
26352
26353 impl<'de> ::fidl_next::IntoNatural for Program<'de> {
26354 type Natural = crate::natural::Program;
26355 }
26356
26357 impl ::fidl_next::Unconstrained for Program<'_> {}
26358
26359 #[repr(C)]
26361 pub struct UseService<'de> {
26362 pub(crate) table: ::fidl_next::WireTable<'de>,
26363 }
26364
26365 impl<'de> Drop for UseService<'de> {
26366 fn drop(&mut self) {
26367 let _ = self
26368 .table
26369 .get(1)
26370 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
26371
26372 let _ = self.table.get(2).map(|envelope| unsafe {
26373 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
26374 });
26375
26376 let _ = self.table.get(3).map(|envelope| unsafe {
26377 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
26378 });
26379
26380 let _ = self.table.get(4).map(|envelope| unsafe {
26381 envelope.read_unchecked::<crate::wire::DependencyType>()
26382 });
26383
26384 let _ = self
26385 .table
26386 .get(5)
26387 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
26388
26389 let _ = self.table.get(6).map(|envelope| unsafe {
26390 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
26391 });
26392 }
26393 }
26394
26395 unsafe impl ::fidl_next::Wire for UseService<'static> {
26396 type Owned<'de> = UseService<'de>;
26397
26398 #[inline]
26399 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26400 ::fidl_next::munge!(let Self { table } = out);
26401 ::fidl_next::WireTable::zero_padding(table);
26402 }
26403 }
26404
26405 unsafe impl<___D> ::fidl_next::Decode<___D> for UseService<'static>
26406 where
26407 ___D: ::fidl_next::Decoder + ?Sized,
26408 {
26409 fn decode(
26410 slot: ::fidl_next::Slot<'_, Self>,
26411 decoder: &mut ___D,
26412 _: (),
26413 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26414 ::fidl_next::munge!(let Self { table } = slot);
26415
26416 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
26417 match ordinal {
26418 0 => unsafe { ::core::hint::unreachable_unchecked() },
26419
26420 1 => {
26421 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
26422 slot.as_mut(),
26423 decoder,
26424 (),
26425 )?;
26426
26427 Ok(())
26428 }
26429
26430 2 => {
26431 ::fidl_next::WireEnvelope::decode_as::<
26432 ___D,
26433 ::fidl_next::WireString<'static>,
26434 >(slot.as_mut(), decoder, 100)?;
26435
26436 let value = unsafe {
26437 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26438 };
26439
26440 if value.len() > 100 {
26441 return Err(::fidl_next::DecodeError::VectorTooLong {
26442 size: value.len() as u64,
26443 limit: 100,
26444 });
26445 }
26446
26447 Ok(())
26448 }
26449
26450 3 => {
26451 ::fidl_next::WireEnvelope::decode_as::<
26452 ___D,
26453 ::fidl_next::WireString<'static>,
26454 >(slot.as_mut(), decoder, 1024)?;
26455
26456 let value = unsafe {
26457 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26458 };
26459
26460 if value.len() > 1024 {
26461 return Err(::fidl_next::DecodeError::VectorTooLong {
26462 size: value.len() as u64,
26463 limit: 1024,
26464 });
26465 }
26466
26467 Ok(())
26468 }
26469
26470 4 => {
26471 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::DependencyType>(
26472 slot.as_mut(),
26473 decoder,
26474 (),
26475 )?;
26476
26477 Ok(())
26478 }
26479
26480 5 => {
26481 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
26482 slot.as_mut(),
26483 decoder,
26484 (),
26485 )?;
26486
26487 Ok(())
26488 }
26489
26490 6 => {
26491 ::fidl_next::WireEnvelope::decode_as::<
26492 ___D,
26493 ::fidl_next::WireString<'static>,
26494 >(slot.as_mut(), decoder, 1024)?;
26495
26496 let value = unsafe {
26497 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26498 };
26499
26500 if value.len() > 1024 {
26501 return Err(::fidl_next::DecodeError::VectorTooLong {
26502 size: value.len() as u64,
26503 limit: 1024,
26504 });
26505 }
26506
26507 Ok(())
26508 }
26509
26510 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
26511 }
26512 })
26513 }
26514 }
26515
26516 impl<'de> UseService<'de> {
26517 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
26518 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
26519 }
26520
26521 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
26522 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
26523 }
26524
26525 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
26526 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
26527 }
26528
26529 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
26530 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
26531 }
26532
26533 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
26534 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
26535 }
26536
26537 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
26538 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
26539 }
26540 }
26541
26542 impl<'de> ::core::fmt::Debug for UseService<'de> {
26543 fn fmt(
26544 &self,
26545 f: &mut ::core::fmt::Formatter<'_>,
26546 ) -> ::core::result::Result<(), ::core::fmt::Error> {
26547 f.debug_struct("UseService")
26548 .field("source", &self.source())
26549 .field("source_name", &self.source_name())
26550 .field("target_path", &self.target_path())
26551 .field("dependency_type", &self.dependency_type())
26552 .field("availability", &self.availability())
26553 .field("source_dictionary", &self.source_dictionary())
26554 .finish()
26555 }
26556 }
26557
26558 impl<'de> ::fidl_next::IntoNatural for UseService<'de> {
26559 type Natural = crate::natural::UseService;
26560 }
26561
26562 impl ::fidl_next::Unconstrained for UseService<'_> {}
26563
26564 #[repr(C)]
26566 pub struct UseProtocol<'de> {
26567 pub(crate) table: ::fidl_next::WireTable<'de>,
26568 }
26569
26570 impl<'de> Drop for UseProtocol<'de> {
26571 fn drop(&mut self) {
26572 let _ = self
26573 .table
26574 .get(1)
26575 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
26576
26577 let _ = self.table.get(2).map(|envelope| unsafe {
26578 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
26579 });
26580
26581 let _ = self.table.get(3).map(|envelope| unsafe {
26582 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
26583 });
26584
26585 let _ = self.table.get(4).map(|envelope| unsafe {
26586 envelope.read_unchecked::<crate::wire::DependencyType>()
26587 });
26588
26589 let _ = self
26590 .table
26591 .get(5)
26592 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
26593
26594 let _ = self.table.get(6).map(|envelope| unsafe {
26595 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
26596 });
26597
26598 let _ = self.table.get(7).map(|envelope| unsafe { envelope.read_unchecked::<u8>() });
26599 }
26600 }
26601
26602 unsafe impl ::fidl_next::Wire for UseProtocol<'static> {
26603 type Owned<'de> = UseProtocol<'de>;
26604
26605 #[inline]
26606 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26607 ::fidl_next::munge!(let Self { table } = out);
26608 ::fidl_next::WireTable::zero_padding(table);
26609 }
26610 }
26611
26612 unsafe impl<___D> ::fidl_next::Decode<___D> for UseProtocol<'static>
26613 where
26614 ___D: ::fidl_next::Decoder + ?Sized,
26615 {
26616 fn decode(
26617 slot: ::fidl_next::Slot<'_, Self>,
26618 decoder: &mut ___D,
26619 _: (),
26620 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26621 ::fidl_next::munge!(let Self { table } = slot);
26622
26623 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
26624 match ordinal {
26625 0 => unsafe { ::core::hint::unreachable_unchecked() },
26626
26627 1 => {
26628 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
26629 slot.as_mut(),
26630 decoder,
26631 (),
26632 )?;
26633
26634 Ok(())
26635 }
26636
26637 2 => {
26638 ::fidl_next::WireEnvelope::decode_as::<
26639 ___D,
26640 ::fidl_next::WireString<'static>,
26641 >(slot.as_mut(), decoder, 100)?;
26642
26643 let value = unsafe {
26644 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26645 };
26646
26647 if value.len() > 100 {
26648 return Err(::fidl_next::DecodeError::VectorTooLong {
26649 size: value.len() as u64,
26650 limit: 100,
26651 });
26652 }
26653
26654 Ok(())
26655 }
26656
26657 3 => {
26658 ::fidl_next::WireEnvelope::decode_as::<
26659 ___D,
26660 ::fidl_next::WireString<'static>,
26661 >(slot.as_mut(), decoder, 1024)?;
26662
26663 let value = unsafe {
26664 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26665 };
26666
26667 if value.len() > 1024 {
26668 return Err(::fidl_next::DecodeError::VectorTooLong {
26669 size: value.len() as u64,
26670 limit: 1024,
26671 });
26672 }
26673
26674 Ok(())
26675 }
26676
26677 4 => {
26678 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::DependencyType>(
26679 slot.as_mut(),
26680 decoder,
26681 (),
26682 )?;
26683
26684 Ok(())
26685 }
26686
26687 5 => {
26688 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
26689 slot.as_mut(),
26690 decoder,
26691 (),
26692 )?;
26693
26694 Ok(())
26695 }
26696
26697 6 => {
26698 ::fidl_next::WireEnvelope::decode_as::<
26699 ___D,
26700 ::fidl_next::WireString<'static>,
26701 >(slot.as_mut(), decoder, 1024)?;
26702
26703 let value = unsafe {
26704 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26705 };
26706
26707 if value.len() > 1024 {
26708 return Err(::fidl_next::DecodeError::VectorTooLong {
26709 size: value.len() as u64,
26710 limit: 1024,
26711 });
26712 }
26713
26714 Ok(())
26715 }
26716
26717 7 => {
26718 ::fidl_next::WireEnvelope::decode_as::<___D, u8>(
26719 slot.as_mut(),
26720 decoder,
26721 (),
26722 )?;
26723
26724 Ok(())
26725 }
26726
26727 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
26728 }
26729 })
26730 }
26731 }
26732
26733 impl<'de> UseProtocol<'de> {
26734 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
26735 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
26736 }
26737
26738 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
26739 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
26740 }
26741
26742 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
26743 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
26744 }
26745
26746 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
26747 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
26748 }
26749
26750 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
26751 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
26752 }
26753
26754 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
26755 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
26756 }
26757
26758 pub fn numbered_handle(&self) -> ::core::option::Option<&u8> {
26759 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
26760 }
26761 }
26762
26763 impl<'de> ::core::fmt::Debug for UseProtocol<'de> {
26764 fn fmt(
26765 &self,
26766 f: &mut ::core::fmt::Formatter<'_>,
26767 ) -> ::core::result::Result<(), ::core::fmt::Error> {
26768 f.debug_struct("UseProtocol")
26769 .field("source", &self.source())
26770 .field("source_name", &self.source_name())
26771 .field("target_path", &self.target_path())
26772 .field("dependency_type", &self.dependency_type())
26773 .field("availability", &self.availability())
26774 .field("source_dictionary", &self.source_dictionary())
26775 .field("numbered_handle", &self.numbered_handle())
26776 .finish()
26777 }
26778 }
26779
26780 impl<'de> ::fidl_next::IntoNatural for UseProtocol<'de> {
26781 type Natural = crate::natural::UseProtocol;
26782 }
26783
26784 impl ::fidl_next::Unconstrained for UseProtocol<'_> {}
26785
26786 #[repr(C)]
26788 pub struct UseDirectory<'de> {
26789 pub(crate) table: ::fidl_next::WireTable<'de>,
26790 }
26791
26792 impl<'de> Drop for UseDirectory<'de> {
26793 fn drop(&mut self) {
26794 let _ = self
26795 .table
26796 .get(1)
26797 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
26798
26799 let _ = self.table.get(2).map(|envelope| unsafe {
26800 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
26801 });
26802
26803 let _ = self.table.get(3).map(|envelope| unsafe {
26804 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
26805 });
26806
26807 let _ = self.table.get(4).map(|envelope| unsafe {
26808 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
26809 });
26810
26811 let _ = self.table.get(5).map(|envelope| unsafe {
26812 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
26813 });
26814
26815 let _ = self.table.get(6).map(|envelope| unsafe {
26816 envelope.read_unchecked::<crate::wire::DependencyType>()
26817 });
26818
26819 let _ = self
26820 .table
26821 .get(7)
26822 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
26823
26824 let _ = self.table.get(8).map(|envelope| unsafe {
26825 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
26826 });
26827 }
26828 }
26829
26830 unsafe impl ::fidl_next::Wire for UseDirectory<'static> {
26831 type Owned<'de> = UseDirectory<'de>;
26832
26833 #[inline]
26834 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
26835 ::fidl_next::munge!(let Self { table } = out);
26836 ::fidl_next::WireTable::zero_padding(table);
26837 }
26838 }
26839
26840 unsafe impl<___D> ::fidl_next::Decode<___D> for UseDirectory<'static>
26841 where
26842 ___D: ::fidl_next::Decoder + ?Sized,
26843 {
26844 fn decode(
26845 slot: ::fidl_next::Slot<'_, Self>,
26846 decoder: &mut ___D,
26847 _: (),
26848 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
26849 ::fidl_next::munge!(let Self { table } = slot);
26850
26851 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
26852 match ordinal {
26853 0 => unsafe { ::core::hint::unreachable_unchecked() },
26854
26855 1 => {
26856 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
26857 slot.as_mut(),
26858 decoder,
26859 (),
26860 )?;
26861
26862 Ok(())
26863 }
26864
26865 2 => {
26866 ::fidl_next::WireEnvelope::decode_as::<
26867 ___D,
26868 ::fidl_next::WireString<'static>,
26869 >(slot.as_mut(), decoder, 100)?;
26870
26871 let value = unsafe {
26872 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26873 };
26874
26875 if value.len() > 100 {
26876 return Err(::fidl_next::DecodeError::VectorTooLong {
26877 size: value.len() as u64,
26878 limit: 100,
26879 });
26880 }
26881
26882 Ok(())
26883 }
26884
26885 3 => {
26886 ::fidl_next::WireEnvelope::decode_as::<
26887 ___D,
26888 ::fidl_next::WireString<'static>,
26889 >(slot.as_mut(), decoder, 1024)?;
26890
26891 let value = unsafe {
26892 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26893 };
26894
26895 if value.len() > 1024 {
26896 return Err(::fidl_next::DecodeError::VectorTooLong {
26897 size: value.len() as u64,
26898 limit: 1024,
26899 });
26900 }
26901
26902 Ok(())
26903 }
26904
26905 4 => {
26906 ::fidl_next::WireEnvelope::decode_as::<
26907 ___D,
26908 ::fidl_next_common_fuchsia_io::wire::Operations,
26909 >(slot.as_mut(), decoder, ())?;
26910
26911 Ok(())
26912 }
26913
26914 5 => {
26915 ::fidl_next::WireEnvelope::decode_as::<
26916 ___D,
26917 ::fidl_next::WireString<'static>,
26918 >(slot.as_mut(), decoder, 1024)?;
26919
26920 let value = unsafe {
26921 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26922 };
26923
26924 if value.len() > 1024 {
26925 return Err(::fidl_next::DecodeError::VectorTooLong {
26926 size: value.len() as u64,
26927 limit: 1024,
26928 });
26929 }
26930
26931 Ok(())
26932 }
26933
26934 6 => {
26935 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::DependencyType>(
26936 slot.as_mut(),
26937 decoder,
26938 (),
26939 )?;
26940
26941 Ok(())
26942 }
26943
26944 7 => {
26945 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
26946 slot.as_mut(),
26947 decoder,
26948 (),
26949 )?;
26950
26951 Ok(())
26952 }
26953
26954 8 => {
26955 ::fidl_next::WireEnvelope::decode_as::<
26956 ___D,
26957 ::fidl_next::WireString<'static>,
26958 >(slot.as_mut(), decoder, 1024)?;
26959
26960 let value = unsafe {
26961 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
26962 };
26963
26964 if value.len() > 1024 {
26965 return Err(::fidl_next::DecodeError::VectorTooLong {
26966 size: value.len() as u64,
26967 limit: 1024,
26968 });
26969 }
26970
26971 Ok(())
26972 }
26973
26974 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
26975 }
26976 })
26977 }
26978 }
26979
26980 impl<'de> UseDirectory<'de> {
26981 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
26982 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
26983 }
26984
26985 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
26986 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
26987 }
26988
26989 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
26990 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
26991 }
26992
26993 pub fn rights(
26994 &self,
26995 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_io::wire::Operations> {
26996 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
26997 }
26998
26999 pub fn subdir(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27000 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
27001 }
27002
27003 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
27004 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
27005 }
27006
27007 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
27008 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
27009 }
27010
27011 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27012 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
27013 }
27014 }
27015
27016 impl<'de> ::core::fmt::Debug for UseDirectory<'de> {
27017 fn fmt(
27018 &self,
27019 f: &mut ::core::fmt::Formatter<'_>,
27020 ) -> ::core::result::Result<(), ::core::fmt::Error> {
27021 f.debug_struct("UseDirectory")
27022 .field("source", &self.source())
27023 .field("source_name", &self.source_name())
27024 .field("target_path", &self.target_path())
27025 .field("rights", &self.rights())
27026 .field("subdir", &self.subdir())
27027 .field("dependency_type", &self.dependency_type())
27028 .field("availability", &self.availability())
27029 .field("source_dictionary", &self.source_dictionary())
27030 .finish()
27031 }
27032 }
27033
27034 impl<'de> ::fidl_next::IntoNatural for UseDirectory<'de> {
27035 type Natural = crate::natural::UseDirectory;
27036 }
27037
27038 impl ::fidl_next::Unconstrained for UseDirectory<'_> {}
27039
27040 #[repr(C)]
27042 pub struct UseEventStream<'de> {
27043 pub(crate) table: ::fidl_next::WireTable<'de>,
27044 }
27045
27046 impl<'de> Drop for UseEventStream<'de> {
27047 fn drop(&mut self) {
27048 let _ = self.table.get(1).map(|envelope| unsafe {
27049 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27050 });
27051
27052 let _ = self
27053 .table
27054 .get(2)
27055 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
27056
27057 let _ = self.table.get(3).map(|envelope| unsafe {
27058 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Ref<'de>>>()
27059 });
27060
27061 let _ = self.table.get(4).map(|envelope| unsafe {
27062 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27063 });
27064
27065 let _ = self
27066 .table
27067 .get(5)
27068 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
27069
27070 let _ = self.table.get(6).map(|envelope| unsafe {
27071 envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>()
27072 });
27073 }
27074 }
27075
27076 unsafe impl ::fidl_next::Wire for UseEventStream<'static> {
27077 type Owned<'de> = UseEventStream<'de>;
27078
27079 #[inline]
27080 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27081 ::fidl_next::munge!(let Self { table } = out);
27082 ::fidl_next::WireTable::zero_padding(table);
27083 }
27084 }
27085
27086 unsafe impl<___D> ::fidl_next::Decode<___D> for UseEventStream<'static>
27087 where
27088 ___D: ::fidl_next::Decoder + ?Sized,
27089 {
27090 fn decode(
27091 slot: ::fidl_next::Slot<'_, Self>,
27092 decoder: &mut ___D,
27093 _: (),
27094 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27095 ::fidl_next::munge!(let Self { table } = slot);
27096
27097 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
27098 match ordinal {
27099 0 => unsafe { ::core::hint::unreachable_unchecked() },
27100
27101 1 => {
27102 ::fidl_next::WireEnvelope::decode_as::<
27103 ___D,
27104 ::fidl_next::WireString<'static>,
27105 >(slot.as_mut(), decoder, 100)?;
27106
27107 let value = unsafe {
27108 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27109 };
27110
27111 if value.len() > 100 {
27112 return Err(::fidl_next::DecodeError::VectorTooLong {
27113 size: value.len() as u64,
27114 limit: 100,
27115 });
27116 }
27117
27118 Ok(())
27119 }
27120
27121 2 => {
27122 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
27123 slot.as_mut(),
27124 decoder,
27125 (),
27126 )?;
27127
27128 Ok(())
27129 }
27130
27131 3 => {
27132 ::fidl_next::WireEnvelope::decode_as::<
27133 ___D,
27134 ::fidl_next::WireVector<'static, crate::wire::Ref<'static>>,
27135 >(slot.as_mut(), decoder, (4294967295, ()))?;
27136
27137 Ok(())
27138 }
27139
27140 4 => {
27141 ::fidl_next::WireEnvelope::decode_as::<
27142 ___D,
27143 ::fidl_next::WireString<'static>,
27144 >(slot.as_mut(), decoder, 100)?;
27145
27146 let value = unsafe {
27147 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27148 };
27149
27150 if value.len() > 100 {
27151 return Err(::fidl_next::DecodeError::VectorTooLong {
27152 size: value.len() as u64,
27153 limit: 100,
27154 });
27155 }
27156
27157 Ok(())
27158 }
27159
27160 5 => {
27161 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
27162 slot.as_mut(),
27163 decoder,
27164 (),
27165 )?;
27166
27167 Ok(())
27168 }
27169
27170 6 => {
27171 ::fidl_next::WireEnvelope::decode_as::<
27172 ___D,
27173 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
27174 >(slot.as_mut(), decoder, ())?;
27175
27176 Ok(())
27177 }
27178
27179 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
27180 }
27181 })
27182 }
27183 }
27184
27185 impl<'de> UseEventStream<'de> {
27186 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27187 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
27188 }
27189
27190 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
27191 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
27192 }
27193
27194 pub fn scope(
27195 &self,
27196 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::wire::Ref<'de>>> {
27197 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
27198 }
27199
27200 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27201 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
27202 }
27203
27204 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
27205 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
27206 }
27207
27208 pub fn filter(
27209 &self,
27210 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>
27211 {
27212 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
27213 }
27214 }
27215
27216 impl<'de> ::core::fmt::Debug for UseEventStream<'de> {
27217 fn fmt(
27218 &self,
27219 f: &mut ::core::fmt::Formatter<'_>,
27220 ) -> ::core::result::Result<(), ::core::fmt::Error> {
27221 f.debug_struct("UseEventStream")
27222 .field("source_name", &self.source_name())
27223 .field("source", &self.source())
27224 .field("scope", &self.scope())
27225 .field("target_path", &self.target_path())
27226 .field("availability", &self.availability())
27227 .field("filter", &self.filter())
27228 .finish()
27229 }
27230 }
27231
27232 impl<'de> ::fidl_next::IntoNatural for UseEventStream<'de> {
27233 type Natural = crate::natural::UseEventStream;
27234 }
27235
27236 impl ::fidl_next::Unconstrained for UseEventStream<'_> {}
27237
27238 #[repr(C)]
27240 pub struct UseRunner<'de> {
27241 pub(crate) table: ::fidl_next::WireTable<'de>,
27242 }
27243
27244 impl<'de> Drop for UseRunner<'de> {
27245 fn drop(&mut self) {
27246 let _ = self
27247 .table
27248 .get(1)
27249 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
27250
27251 let _ = self.table.get(2).map(|envelope| unsafe {
27252 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27253 });
27254
27255 let _ = self.table.get(3).map(|envelope| unsafe {
27256 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27257 });
27258 }
27259 }
27260
27261 unsafe impl ::fidl_next::Wire for UseRunner<'static> {
27262 type Owned<'de> = UseRunner<'de>;
27263
27264 #[inline]
27265 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27266 ::fidl_next::munge!(let Self { table } = out);
27267 ::fidl_next::WireTable::zero_padding(table);
27268 }
27269 }
27270
27271 unsafe impl<___D> ::fidl_next::Decode<___D> for UseRunner<'static>
27272 where
27273 ___D: ::fidl_next::Decoder + ?Sized,
27274 {
27275 fn decode(
27276 slot: ::fidl_next::Slot<'_, Self>,
27277 decoder: &mut ___D,
27278 _: (),
27279 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27280 ::fidl_next::munge!(let Self { table } = slot);
27281
27282 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
27283 match ordinal {
27284 0 => unsafe { ::core::hint::unreachable_unchecked() },
27285
27286 1 => {
27287 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
27288 slot.as_mut(),
27289 decoder,
27290 (),
27291 )?;
27292
27293 Ok(())
27294 }
27295
27296 2 => {
27297 ::fidl_next::WireEnvelope::decode_as::<
27298 ___D,
27299 ::fidl_next::WireString<'static>,
27300 >(slot.as_mut(), decoder, 100)?;
27301
27302 let value = unsafe {
27303 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27304 };
27305
27306 if value.len() > 100 {
27307 return Err(::fidl_next::DecodeError::VectorTooLong {
27308 size: value.len() as u64,
27309 limit: 100,
27310 });
27311 }
27312
27313 Ok(())
27314 }
27315
27316 3 => {
27317 ::fidl_next::WireEnvelope::decode_as::<
27318 ___D,
27319 ::fidl_next::WireString<'static>,
27320 >(slot.as_mut(), decoder, 1024)?;
27321
27322 let value = unsafe {
27323 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27324 };
27325
27326 if value.len() > 1024 {
27327 return Err(::fidl_next::DecodeError::VectorTooLong {
27328 size: value.len() as u64,
27329 limit: 1024,
27330 });
27331 }
27332
27333 Ok(())
27334 }
27335
27336 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
27337 }
27338 })
27339 }
27340 }
27341
27342 impl<'de> UseRunner<'de> {
27343 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
27344 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
27345 }
27346
27347 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27348 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
27349 }
27350
27351 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27352 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
27353 }
27354 }
27355
27356 impl<'de> ::core::fmt::Debug for UseRunner<'de> {
27357 fn fmt(
27358 &self,
27359 f: &mut ::core::fmt::Formatter<'_>,
27360 ) -> ::core::result::Result<(), ::core::fmt::Error> {
27361 f.debug_struct("UseRunner")
27362 .field("source", &self.source())
27363 .field("source_name", &self.source_name())
27364 .field("source_dictionary", &self.source_dictionary())
27365 .finish()
27366 }
27367 }
27368
27369 impl<'de> ::fidl_next::IntoNatural for UseRunner<'de> {
27370 type Natural = crate::natural::UseRunner;
27371 }
27372
27373 impl ::fidl_next::Unconstrained for UseRunner<'_> {}
27374
27375 #[repr(C)]
27377 pub struct UseConfiguration<'de> {
27378 pub(crate) table: ::fidl_next::WireTable<'de>,
27379 }
27380
27381 impl<'de> Drop for UseConfiguration<'de> {
27382 fn drop(&mut self) {
27383 let _ = self
27384 .table
27385 .get(1)
27386 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
27387
27388 let _ = self.table.get(2).map(|envelope| unsafe {
27389 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27390 });
27391
27392 let _ = self.table.get(3).map(|envelope| unsafe {
27393 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27394 });
27395
27396 let _ = self
27397 .table
27398 .get(4)
27399 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
27400
27401 let _ = self.table.get(5).map(|envelope| unsafe {
27402 envelope.read_unchecked::<crate::wire::ConfigType<'de>>()
27403 });
27404
27405 let _ = self.table.get(6).map(|envelope| unsafe {
27406 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
27407 });
27408
27409 let _ = self.table.get(7).map(|envelope| unsafe {
27410 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27411 });
27412 }
27413 }
27414
27415 unsafe impl ::fidl_next::Wire for UseConfiguration<'static> {
27416 type Owned<'de> = UseConfiguration<'de>;
27417
27418 #[inline]
27419 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27420 ::fidl_next::munge!(let Self { table } = out);
27421 ::fidl_next::WireTable::zero_padding(table);
27422 }
27423 }
27424
27425 unsafe impl<___D> ::fidl_next::Decode<___D> for UseConfiguration<'static>
27426 where
27427 ___D: ::fidl_next::Decoder + ?Sized,
27428 {
27429 fn decode(
27430 slot: ::fidl_next::Slot<'_, Self>,
27431 decoder: &mut ___D,
27432 _: (),
27433 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27434 ::fidl_next::munge!(let Self { table } = slot);
27435
27436 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
27437 match ordinal {
27438 0 => unsafe { ::core::hint::unreachable_unchecked() },
27439
27440 1 => {
27441 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
27442 slot.as_mut(),
27443 decoder,
27444 (),
27445 )?;
27446
27447 Ok(())
27448 }
27449
27450 2 => {
27451 ::fidl_next::WireEnvelope::decode_as::<
27452 ___D,
27453 ::fidl_next::WireString<'static>,
27454 >(slot.as_mut(), decoder, 100)?;
27455
27456 let value = unsafe {
27457 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27458 };
27459
27460 if value.len() > 100 {
27461 return Err(::fidl_next::DecodeError::VectorTooLong {
27462 size: value.len() as u64,
27463 limit: 100,
27464 });
27465 }
27466
27467 Ok(())
27468 }
27469
27470 3 => {
27471 ::fidl_next::WireEnvelope::decode_as::<
27472 ___D,
27473 ::fidl_next::WireString<'static>,
27474 >(slot.as_mut(), decoder, 100)?;
27475
27476 let value = unsafe {
27477 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27478 };
27479
27480 if value.len() > 100 {
27481 return Err(::fidl_next::DecodeError::VectorTooLong {
27482 size: value.len() as u64,
27483 limit: 100,
27484 });
27485 }
27486
27487 Ok(())
27488 }
27489
27490 4 => {
27491 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
27492 slot.as_mut(),
27493 decoder,
27494 (),
27495 )?;
27496
27497 Ok(())
27498 }
27499
27500 5 => {
27501 ::fidl_next::WireEnvelope::decode_as::<
27502 ___D,
27503 crate::wire::ConfigType<'static>,
27504 >(slot.as_mut(), decoder, ())?;
27505
27506 Ok(())
27507 }
27508
27509 6 => {
27510 ::fidl_next::WireEnvelope::decode_as::<
27511 ___D,
27512 crate::wire::ConfigValue<'static>,
27513 >(slot.as_mut(), decoder, ())?;
27514
27515 Ok(())
27516 }
27517
27518 7 => {
27519 ::fidl_next::WireEnvelope::decode_as::<
27520 ___D,
27521 ::fidl_next::WireString<'static>,
27522 >(slot.as_mut(), decoder, 1024)?;
27523
27524 let value = unsafe {
27525 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27526 };
27527
27528 if value.len() > 1024 {
27529 return Err(::fidl_next::DecodeError::VectorTooLong {
27530 size: value.len() as u64,
27531 limit: 1024,
27532 });
27533 }
27534
27535 Ok(())
27536 }
27537
27538 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
27539 }
27540 })
27541 }
27542 }
27543
27544 impl<'de> UseConfiguration<'de> {
27545 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
27546 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
27547 }
27548
27549 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27550 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
27551 }
27552
27553 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27554 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
27555 }
27556
27557 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
27558 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
27559 }
27560
27561 pub fn type_(&self) -> ::core::option::Option<&crate::wire::ConfigType<'de>> {
27562 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
27563 }
27564
27565 pub fn default(&self) -> ::core::option::Option<&crate::wire::ConfigValue<'de>> {
27566 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
27567 }
27568
27569 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27570 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
27571 }
27572 }
27573
27574 impl<'de> ::core::fmt::Debug for UseConfiguration<'de> {
27575 fn fmt(
27576 &self,
27577 f: &mut ::core::fmt::Formatter<'_>,
27578 ) -> ::core::result::Result<(), ::core::fmt::Error> {
27579 f.debug_struct("UseConfiguration")
27580 .field("source", &self.source())
27581 .field("source_name", &self.source_name())
27582 .field("target_name", &self.target_name())
27583 .field("availability", &self.availability())
27584 .field("type_", &self.type_())
27585 .field("default", &self.default())
27586 .field("source_dictionary", &self.source_dictionary())
27587 .finish()
27588 }
27589 }
27590
27591 impl<'de> ::fidl_next::IntoNatural for UseConfiguration<'de> {
27592 type Natural = crate::natural::UseConfiguration;
27593 }
27594
27595 impl ::fidl_next::Unconstrained for UseConfiguration<'_> {}
27596
27597 #[repr(C)]
27599 pub struct UseDictionary<'de> {
27600 pub(crate) table: ::fidl_next::WireTable<'de>,
27601 }
27602
27603 impl<'de> Drop for UseDictionary<'de> {
27604 fn drop(&mut self) {
27605 let _ = self
27606 .table
27607 .get(1)
27608 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
27609
27610 let _ = self.table.get(2).map(|envelope| unsafe {
27611 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27612 });
27613
27614 let _ = self.table.get(3).map(|envelope| unsafe {
27615 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27616 });
27617
27618 let _ = self.table.get(6).map(|envelope| unsafe {
27619 envelope.read_unchecked::<crate::wire::DependencyType>()
27620 });
27621
27622 let _ = self
27623 .table
27624 .get(7)
27625 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
27626
27627 let _ = self.table.get(8).map(|envelope| unsafe {
27628 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
27629 });
27630 }
27631 }
27632
27633 unsafe impl ::fidl_next::Wire for UseDictionary<'static> {
27634 type Owned<'de> = UseDictionary<'de>;
27635
27636 #[inline]
27637 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27638 ::fidl_next::munge!(let Self { table } = out);
27639 ::fidl_next::WireTable::zero_padding(table);
27640 }
27641 }
27642
27643 unsafe impl<___D> ::fidl_next::Decode<___D> for UseDictionary<'static>
27644 where
27645 ___D: ::fidl_next::Decoder + ?Sized,
27646 {
27647 fn decode(
27648 slot: ::fidl_next::Slot<'_, Self>,
27649 decoder: &mut ___D,
27650 _: (),
27651 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27652 ::fidl_next::munge!(let Self { table } = slot);
27653
27654 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
27655 match ordinal {
27656 0 => unsafe { ::core::hint::unreachable_unchecked() },
27657
27658 1 => {
27659 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
27660 slot.as_mut(),
27661 decoder,
27662 (),
27663 )?;
27664
27665 Ok(())
27666 }
27667
27668 2 => {
27669 ::fidl_next::WireEnvelope::decode_as::<
27670 ___D,
27671 ::fidl_next::WireString<'static>,
27672 >(slot.as_mut(), decoder, 100)?;
27673
27674 let value = unsafe {
27675 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27676 };
27677
27678 if value.len() > 100 {
27679 return Err(::fidl_next::DecodeError::VectorTooLong {
27680 size: value.len() as u64,
27681 limit: 100,
27682 });
27683 }
27684
27685 Ok(())
27686 }
27687
27688 3 => {
27689 ::fidl_next::WireEnvelope::decode_as::<
27690 ___D,
27691 ::fidl_next::WireString<'static>,
27692 >(slot.as_mut(), decoder, 1024)?;
27693
27694 let value = unsafe {
27695 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27696 };
27697
27698 if value.len() > 1024 {
27699 return Err(::fidl_next::DecodeError::VectorTooLong {
27700 size: value.len() as u64,
27701 limit: 1024,
27702 });
27703 }
27704
27705 Ok(())
27706 }
27707
27708 6 => {
27709 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::DependencyType>(
27710 slot.as_mut(),
27711 decoder,
27712 (),
27713 )?;
27714
27715 Ok(())
27716 }
27717
27718 7 => {
27719 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
27720 slot.as_mut(),
27721 decoder,
27722 (),
27723 )?;
27724
27725 Ok(())
27726 }
27727
27728 8 => {
27729 ::fidl_next::WireEnvelope::decode_as::<
27730 ___D,
27731 ::fidl_next::WireString<'static>,
27732 >(slot.as_mut(), decoder, 1024)?;
27733
27734 let value = unsafe {
27735 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
27736 };
27737
27738 if value.len() > 1024 {
27739 return Err(::fidl_next::DecodeError::VectorTooLong {
27740 size: value.len() as u64,
27741 limit: 1024,
27742 });
27743 }
27744
27745 Ok(())
27746 }
27747
27748 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
27749 }
27750 })
27751 }
27752 }
27753
27754 impl<'de> UseDictionary<'de> {
27755 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
27756 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
27757 }
27758
27759 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27760 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
27761 }
27762
27763 pub fn target_path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27764 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
27765 }
27766
27767 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
27768 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
27769 }
27770
27771 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
27772 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
27773 }
27774
27775 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
27776 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
27777 }
27778 }
27779
27780 impl<'de> ::core::fmt::Debug for UseDictionary<'de> {
27781 fn fmt(
27782 &self,
27783 f: &mut ::core::fmt::Formatter<'_>,
27784 ) -> ::core::result::Result<(), ::core::fmt::Error> {
27785 f.debug_struct("UseDictionary")
27786 .field("source", &self.source())
27787 .field("source_name", &self.source_name())
27788 .field("target_path", &self.target_path())
27789 .field("dependency_type", &self.dependency_type())
27790 .field("availability", &self.availability())
27791 .field("source_dictionary", &self.source_dictionary())
27792 .finish()
27793 }
27794 }
27795
27796 impl<'de> ::fidl_next::IntoNatural for UseDictionary<'de> {
27797 type Natural = crate::natural::UseDictionary;
27798 }
27799
27800 impl ::fidl_next::Unconstrained for UseDictionary<'_> {}
27801
27802 #[repr(transparent)]
27804 pub struct Use<'de> {
27805 pub(crate) raw: ::fidl_next::RawWireUnion,
27806 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
27807 }
27808
27809 impl<'de> Drop for Use<'de> {
27810 fn drop(&mut self) {
27811 match self.raw.ordinal() {
27812 1 => {
27813 let _ =
27814 unsafe { self.raw.get().read_unchecked::<crate::wire::UseService<'de>>() };
27815 }
27816
27817 2 => {
27818 let _ =
27819 unsafe { self.raw.get().read_unchecked::<crate::wire::UseProtocol<'de>>() };
27820 }
27821
27822 3 => {
27823 let _ = unsafe {
27824 self.raw.get().read_unchecked::<crate::wire::UseDirectory<'de>>()
27825 };
27826 }
27827
27828 4 => {
27829 let _ =
27830 unsafe { self.raw.get().read_unchecked::<crate::wire::UseStorage<'de>>() };
27831 }
27832
27833 7 => {
27834 let _ = unsafe {
27835 self.raw.get().read_unchecked::<crate::wire::UseEventStream<'de>>()
27836 };
27837 }
27838
27839 8 => {
27840 let _ =
27841 unsafe { self.raw.get().read_unchecked::<crate::wire::UseRunner<'de>>() };
27842 }
27843
27844 9 => {
27845 let _ = unsafe {
27846 self.raw.get().read_unchecked::<crate::wire::UseConfiguration<'de>>()
27847 };
27848 }
27849
27850 10 => {
27851 let _ = unsafe {
27852 self.raw.get().read_unchecked::<crate::wire::UseDictionary<'de>>()
27853 };
27854 }
27855
27856 _ => (),
27857 }
27858 }
27859 }
27860
27861 unsafe impl ::fidl_next::Wire for Use<'static> {
27862 type Owned<'de> = Use<'de>;
27863
27864 #[inline]
27865 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
27866 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
27867 ::fidl_next::RawWireUnion::zero_padding(raw);
27868 }
27869 }
27870
27871 pub mod use_ {
27872 pub enum Ref<'de> {
27873 Service(&'de crate::wire::UseService<'de>),
27874
27875 Protocol(&'de crate::wire::UseProtocol<'de>),
27876
27877 Directory(&'de crate::wire::UseDirectory<'de>),
27878
27879 Storage(&'de crate::wire::UseStorage<'de>),
27880
27881 EventStream(&'de crate::wire::UseEventStream<'de>),
27882
27883 Runner(&'de crate::wire::UseRunner<'de>),
27884
27885 Config(&'de crate::wire::UseConfiguration<'de>),
27886
27887 Dictionary(&'de crate::wire::UseDictionary<'de>),
27888
27889 UnknownOrdinal_(u64),
27890 }
27891 }
27892
27893 impl<'de> Use<'de> {
27894 pub fn as_ref(&self) -> crate::wire::use_::Ref<'_> {
27895 match self.raw.ordinal() {
27896 1 => crate::wire::use_::Ref::Service(unsafe {
27897 self.raw.get().deref_unchecked::<crate::wire::UseService<'_>>()
27898 }),
27899
27900 2 => crate::wire::use_::Ref::Protocol(unsafe {
27901 self.raw.get().deref_unchecked::<crate::wire::UseProtocol<'_>>()
27902 }),
27903
27904 3 => crate::wire::use_::Ref::Directory(unsafe {
27905 self.raw.get().deref_unchecked::<crate::wire::UseDirectory<'_>>()
27906 }),
27907
27908 4 => crate::wire::use_::Ref::Storage(unsafe {
27909 self.raw.get().deref_unchecked::<crate::wire::UseStorage<'_>>()
27910 }),
27911
27912 7 => crate::wire::use_::Ref::EventStream(unsafe {
27913 self.raw.get().deref_unchecked::<crate::wire::UseEventStream<'_>>()
27914 }),
27915
27916 8 => crate::wire::use_::Ref::Runner(unsafe {
27917 self.raw.get().deref_unchecked::<crate::wire::UseRunner<'_>>()
27918 }),
27919
27920 9 => crate::wire::use_::Ref::Config(unsafe {
27921 self.raw.get().deref_unchecked::<crate::wire::UseConfiguration<'_>>()
27922 }),
27923
27924 10 => crate::wire::use_::Ref::Dictionary(unsafe {
27925 self.raw.get().deref_unchecked::<crate::wire::UseDictionary<'_>>()
27926 }),
27927
27928 unknown => crate::wire::use_::Ref::UnknownOrdinal_(unknown),
27929 }
27930 }
27931 }
27932
27933 unsafe impl<___D> ::fidl_next::Decode<___D> for Use<'static>
27934 where
27935 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
27936 ___D: ::fidl_next::Decoder,
27937 {
27938 fn decode(
27939 mut slot: ::fidl_next::Slot<'_, Self>,
27940 decoder: &mut ___D,
27941 _: (),
27942 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
27943 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
27944 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
27945 1 => {
27946 ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::UseService<'static>>(
27947 raw,
27948 decoder,
27949 (),
27950 )?
27951 }
27952
27953 2 => {
27954 ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::UseProtocol<'static>>(
27955 raw,
27956 decoder,
27957 (),
27958 )?
27959 }
27960
27961 3 => ::fidl_next::RawWireUnion::decode_as::<
27962 ___D,
27963 crate::wire::UseDirectory<'static>,
27964 >(raw, decoder, ())?,
27965
27966 4 => {
27967 ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::UseStorage<'static>>(
27968 raw,
27969 decoder,
27970 (),
27971 )?
27972 }
27973
27974 7 => ::fidl_next::RawWireUnion::decode_as::<
27975 ___D,
27976 crate::wire::UseEventStream<'static>,
27977 >(raw, decoder, ())?,
27978
27979 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::UseRunner<'static>>(
27980 raw,
27981 decoder,
27982 (),
27983 )?,
27984
27985 9 => ::fidl_next::RawWireUnion::decode_as::<
27986 ___D,
27987 crate::wire::UseConfiguration<'static>,
27988 >(raw, decoder, ())?,
27989
27990 10 => ::fidl_next::RawWireUnion::decode_as::<
27991 ___D,
27992 crate::wire::UseDictionary<'static>,
27993 >(raw, decoder, ())?,
27994
27995 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
27996 }
27997
27998 Ok(())
27999 }
28000 }
28001
28002 impl<'de> ::core::fmt::Debug for Use<'de> {
28003 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
28004 match self.raw.ordinal() {
28005 1 => unsafe {
28006 self.raw.get().deref_unchecked::<crate::wire::UseService<'_>>().fmt(f)
28007 },
28008 2 => unsafe {
28009 self.raw.get().deref_unchecked::<crate::wire::UseProtocol<'_>>().fmt(f)
28010 },
28011 3 => unsafe {
28012 self.raw.get().deref_unchecked::<crate::wire::UseDirectory<'_>>().fmt(f)
28013 },
28014 4 => unsafe {
28015 self.raw.get().deref_unchecked::<crate::wire::UseStorage<'_>>().fmt(f)
28016 },
28017 7 => unsafe {
28018 self.raw.get().deref_unchecked::<crate::wire::UseEventStream<'_>>().fmt(f)
28019 },
28020 8 => unsafe {
28021 self.raw.get().deref_unchecked::<crate::wire::UseRunner<'_>>().fmt(f)
28022 },
28023 9 => unsafe {
28024 self.raw.get().deref_unchecked::<crate::wire::UseConfiguration<'_>>().fmt(f)
28025 },
28026 10 => unsafe {
28027 self.raw.get().deref_unchecked::<crate::wire::UseDictionary<'_>>().fmt(f)
28028 },
28029 _ => unsafe { ::core::hint::unreachable_unchecked() },
28030 }
28031 }
28032 }
28033
28034 impl<'de> ::fidl_next::IntoNatural for Use<'de> {
28035 type Natural = crate::natural::Use;
28036 }
28037
28038 impl ::fidl_next::Unconstrained for Use<'static> {}
28039
28040 #[repr(C)]
28042 pub struct ExposeService<'de> {
28043 pub(crate) table: ::fidl_next::WireTable<'de>,
28044 }
28045
28046 impl<'de> Drop for ExposeService<'de> {
28047 fn drop(&mut self) {
28048 let _ = self
28049 .table
28050 .get(1)
28051 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28052
28053 let _ = self.table.get(2).map(|envelope| unsafe {
28054 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28055 });
28056
28057 let _ = self
28058 .table
28059 .get(3)
28060 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28061
28062 let _ = self.table.get(4).map(|envelope| unsafe {
28063 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28064 });
28065
28066 let _ = self
28067 .table
28068 .get(5)
28069 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
28070
28071 let _ = self.table.get(6).map(|envelope| unsafe {
28072 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28073 });
28074 }
28075 }
28076
28077 unsafe impl ::fidl_next::Wire for ExposeService<'static> {
28078 type Owned<'de> = ExposeService<'de>;
28079
28080 #[inline]
28081 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28082 ::fidl_next::munge!(let Self { table } = out);
28083 ::fidl_next::WireTable::zero_padding(table);
28084 }
28085 }
28086
28087 unsafe impl<___D> ::fidl_next::Decode<___D> for ExposeService<'static>
28088 where
28089 ___D: ::fidl_next::Decoder + ?Sized,
28090 {
28091 fn decode(
28092 slot: ::fidl_next::Slot<'_, Self>,
28093 decoder: &mut ___D,
28094 _: (),
28095 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28096 ::fidl_next::munge!(let Self { table } = slot);
28097
28098 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
28099 match ordinal {
28100 0 => unsafe { ::core::hint::unreachable_unchecked() },
28101
28102 1 => {
28103 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
28104 slot.as_mut(),
28105 decoder,
28106 (),
28107 )?;
28108
28109 Ok(())
28110 }
28111
28112 2 => {
28113 ::fidl_next::WireEnvelope::decode_as::<
28114 ___D,
28115 ::fidl_next::WireString<'static>,
28116 >(slot.as_mut(), decoder, 100)?;
28117
28118 let value = unsafe {
28119 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28120 };
28121
28122 if value.len() > 100 {
28123 return Err(::fidl_next::DecodeError::VectorTooLong {
28124 size: value.len() as u64,
28125 limit: 100,
28126 });
28127 }
28128
28129 Ok(())
28130 }
28131
28132 3 => {
28133 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
28134 slot.as_mut(),
28135 decoder,
28136 (),
28137 )?;
28138
28139 Ok(())
28140 }
28141
28142 4 => {
28143 ::fidl_next::WireEnvelope::decode_as::<
28144 ___D,
28145 ::fidl_next::WireString<'static>,
28146 >(slot.as_mut(), decoder, 100)?;
28147
28148 let value = unsafe {
28149 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28150 };
28151
28152 if value.len() > 100 {
28153 return Err(::fidl_next::DecodeError::VectorTooLong {
28154 size: value.len() as u64,
28155 limit: 100,
28156 });
28157 }
28158
28159 Ok(())
28160 }
28161
28162 5 => {
28163 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
28164 slot.as_mut(),
28165 decoder,
28166 (),
28167 )?;
28168
28169 Ok(())
28170 }
28171
28172 6 => {
28173 ::fidl_next::WireEnvelope::decode_as::<
28174 ___D,
28175 ::fidl_next::WireString<'static>,
28176 >(slot.as_mut(), decoder, 1024)?;
28177
28178 let value = unsafe {
28179 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28180 };
28181
28182 if value.len() > 1024 {
28183 return Err(::fidl_next::DecodeError::VectorTooLong {
28184 size: value.len() as u64,
28185 limit: 1024,
28186 });
28187 }
28188
28189 Ok(())
28190 }
28191
28192 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
28193 }
28194 })
28195 }
28196 }
28197
28198 impl<'de> ExposeService<'de> {
28199 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28200 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
28201 }
28202
28203 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
28204 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
28205 }
28206
28207 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28208 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
28209 }
28210
28211 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
28212 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
28213 }
28214
28215 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
28216 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
28217 }
28218
28219 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
28220 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
28221 }
28222 }
28223
28224 impl<'de> ::core::fmt::Debug for ExposeService<'de> {
28225 fn fmt(
28226 &self,
28227 f: &mut ::core::fmt::Formatter<'_>,
28228 ) -> ::core::result::Result<(), ::core::fmt::Error> {
28229 f.debug_struct("ExposeService")
28230 .field("source", &self.source())
28231 .field("source_name", &self.source_name())
28232 .field("target", &self.target())
28233 .field("target_name", &self.target_name())
28234 .field("availability", &self.availability())
28235 .field("source_dictionary", &self.source_dictionary())
28236 .finish()
28237 }
28238 }
28239
28240 impl<'de> ::fidl_next::IntoNatural for ExposeService<'de> {
28241 type Natural = crate::natural::ExposeService;
28242 }
28243
28244 impl ::fidl_next::Unconstrained for ExposeService<'_> {}
28245
28246 #[repr(C)]
28248 pub struct ExposeProtocol<'de> {
28249 pub(crate) table: ::fidl_next::WireTable<'de>,
28250 }
28251
28252 impl<'de> Drop for ExposeProtocol<'de> {
28253 fn drop(&mut self) {
28254 let _ = self
28255 .table
28256 .get(1)
28257 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28258
28259 let _ = self.table.get(2).map(|envelope| unsafe {
28260 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28261 });
28262
28263 let _ = self
28264 .table
28265 .get(3)
28266 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28267
28268 let _ = self.table.get(4).map(|envelope| unsafe {
28269 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28270 });
28271
28272 let _ = self
28273 .table
28274 .get(5)
28275 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
28276
28277 let _ = self.table.get(6).map(|envelope| unsafe {
28278 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28279 });
28280 }
28281 }
28282
28283 unsafe impl ::fidl_next::Wire for ExposeProtocol<'static> {
28284 type Owned<'de> = ExposeProtocol<'de>;
28285
28286 #[inline]
28287 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28288 ::fidl_next::munge!(let Self { table } = out);
28289 ::fidl_next::WireTable::zero_padding(table);
28290 }
28291 }
28292
28293 unsafe impl<___D> ::fidl_next::Decode<___D> for ExposeProtocol<'static>
28294 where
28295 ___D: ::fidl_next::Decoder + ?Sized,
28296 {
28297 fn decode(
28298 slot: ::fidl_next::Slot<'_, Self>,
28299 decoder: &mut ___D,
28300 _: (),
28301 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28302 ::fidl_next::munge!(let Self { table } = slot);
28303
28304 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
28305 match ordinal {
28306 0 => unsafe { ::core::hint::unreachable_unchecked() },
28307
28308 1 => {
28309 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
28310 slot.as_mut(),
28311 decoder,
28312 (),
28313 )?;
28314
28315 Ok(())
28316 }
28317
28318 2 => {
28319 ::fidl_next::WireEnvelope::decode_as::<
28320 ___D,
28321 ::fidl_next::WireString<'static>,
28322 >(slot.as_mut(), decoder, 100)?;
28323
28324 let value = unsafe {
28325 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28326 };
28327
28328 if value.len() > 100 {
28329 return Err(::fidl_next::DecodeError::VectorTooLong {
28330 size: value.len() as u64,
28331 limit: 100,
28332 });
28333 }
28334
28335 Ok(())
28336 }
28337
28338 3 => {
28339 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
28340 slot.as_mut(),
28341 decoder,
28342 (),
28343 )?;
28344
28345 Ok(())
28346 }
28347
28348 4 => {
28349 ::fidl_next::WireEnvelope::decode_as::<
28350 ___D,
28351 ::fidl_next::WireString<'static>,
28352 >(slot.as_mut(), decoder, 100)?;
28353
28354 let value = unsafe {
28355 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28356 };
28357
28358 if value.len() > 100 {
28359 return Err(::fidl_next::DecodeError::VectorTooLong {
28360 size: value.len() as u64,
28361 limit: 100,
28362 });
28363 }
28364
28365 Ok(())
28366 }
28367
28368 5 => {
28369 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
28370 slot.as_mut(),
28371 decoder,
28372 (),
28373 )?;
28374
28375 Ok(())
28376 }
28377
28378 6 => {
28379 ::fidl_next::WireEnvelope::decode_as::<
28380 ___D,
28381 ::fidl_next::WireString<'static>,
28382 >(slot.as_mut(), decoder, 1024)?;
28383
28384 let value = unsafe {
28385 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28386 };
28387
28388 if value.len() > 1024 {
28389 return Err(::fidl_next::DecodeError::VectorTooLong {
28390 size: value.len() as u64,
28391 limit: 1024,
28392 });
28393 }
28394
28395 Ok(())
28396 }
28397
28398 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
28399 }
28400 })
28401 }
28402 }
28403
28404 impl<'de> ExposeProtocol<'de> {
28405 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28406 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
28407 }
28408
28409 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
28410 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
28411 }
28412
28413 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28414 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
28415 }
28416
28417 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
28418 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
28419 }
28420
28421 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
28422 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
28423 }
28424
28425 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
28426 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
28427 }
28428 }
28429
28430 impl<'de> ::core::fmt::Debug for ExposeProtocol<'de> {
28431 fn fmt(
28432 &self,
28433 f: &mut ::core::fmt::Formatter<'_>,
28434 ) -> ::core::result::Result<(), ::core::fmt::Error> {
28435 f.debug_struct("ExposeProtocol")
28436 .field("source", &self.source())
28437 .field("source_name", &self.source_name())
28438 .field("target", &self.target())
28439 .field("target_name", &self.target_name())
28440 .field("availability", &self.availability())
28441 .field("source_dictionary", &self.source_dictionary())
28442 .finish()
28443 }
28444 }
28445
28446 impl<'de> ::fidl_next::IntoNatural for ExposeProtocol<'de> {
28447 type Natural = crate::natural::ExposeProtocol;
28448 }
28449
28450 impl ::fidl_next::Unconstrained for ExposeProtocol<'_> {}
28451
28452 #[repr(C)]
28454 pub struct ExposeDirectory<'de> {
28455 pub(crate) table: ::fidl_next::WireTable<'de>,
28456 }
28457
28458 impl<'de> Drop for ExposeDirectory<'de> {
28459 fn drop(&mut self) {
28460 let _ = self
28461 .table
28462 .get(1)
28463 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28464
28465 let _ = self.table.get(2).map(|envelope| unsafe {
28466 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28467 });
28468
28469 let _ = self
28470 .table
28471 .get(3)
28472 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28473
28474 let _ = self.table.get(4).map(|envelope| unsafe {
28475 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28476 });
28477
28478 let _ = self.table.get(5).map(|envelope| unsafe {
28479 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
28480 });
28481
28482 let _ = self.table.get(6).map(|envelope| unsafe {
28483 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28484 });
28485
28486 let _ = self
28487 .table
28488 .get(7)
28489 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
28490
28491 let _ = self.table.get(8).map(|envelope| unsafe {
28492 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28493 });
28494 }
28495 }
28496
28497 unsafe impl ::fidl_next::Wire for ExposeDirectory<'static> {
28498 type Owned<'de> = ExposeDirectory<'de>;
28499
28500 #[inline]
28501 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28502 ::fidl_next::munge!(let Self { table } = out);
28503 ::fidl_next::WireTable::zero_padding(table);
28504 }
28505 }
28506
28507 unsafe impl<___D> ::fidl_next::Decode<___D> for ExposeDirectory<'static>
28508 where
28509 ___D: ::fidl_next::Decoder + ?Sized,
28510 {
28511 fn decode(
28512 slot: ::fidl_next::Slot<'_, Self>,
28513 decoder: &mut ___D,
28514 _: (),
28515 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28516 ::fidl_next::munge!(let Self { table } = slot);
28517
28518 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
28519 match ordinal {
28520 0 => unsafe { ::core::hint::unreachable_unchecked() },
28521
28522 1 => {
28523 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
28524 slot.as_mut(),
28525 decoder,
28526 (),
28527 )?;
28528
28529 Ok(())
28530 }
28531
28532 2 => {
28533 ::fidl_next::WireEnvelope::decode_as::<
28534 ___D,
28535 ::fidl_next::WireString<'static>,
28536 >(slot.as_mut(), decoder, 100)?;
28537
28538 let value = unsafe {
28539 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28540 };
28541
28542 if value.len() > 100 {
28543 return Err(::fidl_next::DecodeError::VectorTooLong {
28544 size: value.len() as u64,
28545 limit: 100,
28546 });
28547 }
28548
28549 Ok(())
28550 }
28551
28552 3 => {
28553 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
28554 slot.as_mut(),
28555 decoder,
28556 (),
28557 )?;
28558
28559 Ok(())
28560 }
28561
28562 4 => {
28563 ::fidl_next::WireEnvelope::decode_as::<
28564 ___D,
28565 ::fidl_next::WireString<'static>,
28566 >(slot.as_mut(), decoder, 100)?;
28567
28568 let value = unsafe {
28569 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28570 };
28571
28572 if value.len() > 100 {
28573 return Err(::fidl_next::DecodeError::VectorTooLong {
28574 size: value.len() as u64,
28575 limit: 100,
28576 });
28577 }
28578
28579 Ok(())
28580 }
28581
28582 5 => {
28583 ::fidl_next::WireEnvelope::decode_as::<
28584 ___D,
28585 ::fidl_next_common_fuchsia_io::wire::Operations,
28586 >(slot.as_mut(), decoder, ())?;
28587
28588 Ok(())
28589 }
28590
28591 6 => {
28592 ::fidl_next::WireEnvelope::decode_as::<
28593 ___D,
28594 ::fidl_next::WireString<'static>,
28595 >(slot.as_mut(), decoder, 1024)?;
28596
28597 let value = unsafe {
28598 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28599 };
28600
28601 if value.len() > 1024 {
28602 return Err(::fidl_next::DecodeError::VectorTooLong {
28603 size: value.len() as u64,
28604 limit: 1024,
28605 });
28606 }
28607
28608 Ok(())
28609 }
28610
28611 7 => {
28612 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
28613 slot.as_mut(),
28614 decoder,
28615 (),
28616 )?;
28617
28618 Ok(())
28619 }
28620
28621 8 => {
28622 ::fidl_next::WireEnvelope::decode_as::<
28623 ___D,
28624 ::fidl_next::WireString<'static>,
28625 >(slot.as_mut(), decoder, 1024)?;
28626
28627 let value = unsafe {
28628 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28629 };
28630
28631 if value.len() > 1024 {
28632 return Err(::fidl_next::DecodeError::VectorTooLong {
28633 size: value.len() as u64,
28634 limit: 1024,
28635 });
28636 }
28637
28638 Ok(())
28639 }
28640
28641 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
28642 }
28643 })
28644 }
28645 }
28646
28647 impl<'de> ExposeDirectory<'de> {
28648 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28649 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
28650 }
28651
28652 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
28653 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
28654 }
28655
28656 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28657 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
28658 }
28659
28660 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
28661 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
28662 }
28663
28664 pub fn rights(
28665 &self,
28666 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_io::wire::Operations> {
28667 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
28668 }
28669
28670 pub fn subdir(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
28671 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
28672 }
28673
28674 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
28675 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
28676 }
28677
28678 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
28679 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
28680 }
28681 }
28682
28683 impl<'de> ::core::fmt::Debug for ExposeDirectory<'de> {
28684 fn fmt(
28685 &self,
28686 f: &mut ::core::fmt::Formatter<'_>,
28687 ) -> ::core::result::Result<(), ::core::fmt::Error> {
28688 f.debug_struct("ExposeDirectory")
28689 .field("source", &self.source())
28690 .field("source_name", &self.source_name())
28691 .field("target", &self.target())
28692 .field("target_name", &self.target_name())
28693 .field("rights", &self.rights())
28694 .field("subdir", &self.subdir())
28695 .field("availability", &self.availability())
28696 .field("source_dictionary", &self.source_dictionary())
28697 .finish()
28698 }
28699 }
28700
28701 impl<'de> ::fidl_next::IntoNatural for ExposeDirectory<'de> {
28702 type Natural = crate::natural::ExposeDirectory;
28703 }
28704
28705 impl ::fidl_next::Unconstrained for ExposeDirectory<'_> {}
28706
28707 #[repr(C)]
28709 pub struct ExposeRunner<'de> {
28710 pub(crate) table: ::fidl_next::WireTable<'de>,
28711 }
28712
28713 impl<'de> Drop for ExposeRunner<'de> {
28714 fn drop(&mut self) {
28715 let _ = self
28716 .table
28717 .get(1)
28718 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28719
28720 let _ = self.table.get(2).map(|envelope| unsafe {
28721 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28722 });
28723
28724 let _ = self
28725 .table
28726 .get(3)
28727 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28728
28729 let _ = self.table.get(4).map(|envelope| unsafe {
28730 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28731 });
28732
28733 let _ = self.table.get(6).map(|envelope| unsafe {
28734 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28735 });
28736 }
28737 }
28738
28739 unsafe impl ::fidl_next::Wire for ExposeRunner<'static> {
28740 type Owned<'de> = ExposeRunner<'de>;
28741
28742 #[inline]
28743 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28744 ::fidl_next::munge!(let Self { table } = out);
28745 ::fidl_next::WireTable::zero_padding(table);
28746 }
28747 }
28748
28749 unsafe impl<___D> ::fidl_next::Decode<___D> for ExposeRunner<'static>
28750 where
28751 ___D: ::fidl_next::Decoder + ?Sized,
28752 {
28753 fn decode(
28754 slot: ::fidl_next::Slot<'_, Self>,
28755 decoder: &mut ___D,
28756 _: (),
28757 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28758 ::fidl_next::munge!(let Self { table } = slot);
28759
28760 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
28761 match ordinal {
28762 0 => unsafe { ::core::hint::unreachable_unchecked() },
28763
28764 1 => {
28765 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
28766 slot.as_mut(),
28767 decoder,
28768 (),
28769 )?;
28770
28771 Ok(())
28772 }
28773
28774 2 => {
28775 ::fidl_next::WireEnvelope::decode_as::<
28776 ___D,
28777 ::fidl_next::WireString<'static>,
28778 >(slot.as_mut(), decoder, 100)?;
28779
28780 let value = unsafe {
28781 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28782 };
28783
28784 if value.len() > 100 {
28785 return Err(::fidl_next::DecodeError::VectorTooLong {
28786 size: value.len() as u64,
28787 limit: 100,
28788 });
28789 }
28790
28791 Ok(())
28792 }
28793
28794 3 => {
28795 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
28796 slot.as_mut(),
28797 decoder,
28798 (),
28799 )?;
28800
28801 Ok(())
28802 }
28803
28804 4 => {
28805 ::fidl_next::WireEnvelope::decode_as::<
28806 ___D,
28807 ::fidl_next::WireString<'static>,
28808 >(slot.as_mut(), decoder, 100)?;
28809
28810 let value = unsafe {
28811 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28812 };
28813
28814 if value.len() > 100 {
28815 return Err(::fidl_next::DecodeError::VectorTooLong {
28816 size: value.len() as u64,
28817 limit: 100,
28818 });
28819 }
28820
28821 Ok(())
28822 }
28823
28824 6 => {
28825 ::fidl_next::WireEnvelope::decode_as::<
28826 ___D,
28827 ::fidl_next::WireString<'static>,
28828 >(slot.as_mut(), decoder, 1024)?;
28829
28830 let value = unsafe {
28831 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28832 };
28833
28834 if value.len() > 1024 {
28835 return Err(::fidl_next::DecodeError::VectorTooLong {
28836 size: value.len() as u64,
28837 limit: 1024,
28838 });
28839 }
28840
28841 Ok(())
28842 }
28843
28844 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
28845 }
28846 })
28847 }
28848 }
28849
28850 impl<'de> ExposeRunner<'de> {
28851 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28852 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
28853 }
28854
28855 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
28856 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
28857 }
28858
28859 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
28860 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
28861 }
28862
28863 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
28864 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
28865 }
28866
28867 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
28868 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
28869 }
28870 }
28871
28872 impl<'de> ::core::fmt::Debug for ExposeRunner<'de> {
28873 fn fmt(
28874 &self,
28875 f: &mut ::core::fmt::Formatter<'_>,
28876 ) -> ::core::result::Result<(), ::core::fmt::Error> {
28877 f.debug_struct("ExposeRunner")
28878 .field("source", &self.source())
28879 .field("source_name", &self.source_name())
28880 .field("target", &self.target())
28881 .field("target_name", &self.target_name())
28882 .field("source_dictionary", &self.source_dictionary())
28883 .finish()
28884 }
28885 }
28886
28887 impl<'de> ::fidl_next::IntoNatural for ExposeRunner<'de> {
28888 type Natural = crate::natural::ExposeRunner;
28889 }
28890
28891 impl ::fidl_next::Unconstrained for ExposeRunner<'_> {}
28892
28893 #[repr(C)]
28895 pub struct ExposeResolver<'de> {
28896 pub(crate) table: ::fidl_next::WireTable<'de>,
28897 }
28898
28899 impl<'de> Drop for ExposeResolver<'de> {
28900 fn drop(&mut self) {
28901 let _ = self
28902 .table
28903 .get(1)
28904 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28905
28906 let _ = self.table.get(2).map(|envelope| unsafe {
28907 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28908 });
28909
28910 let _ = self
28911 .table
28912 .get(3)
28913 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
28914
28915 let _ = self.table.get(4).map(|envelope| unsafe {
28916 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28917 });
28918
28919 let _ = self.table.get(6).map(|envelope| unsafe {
28920 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
28921 });
28922 }
28923 }
28924
28925 unsafe impl ::fidl_next::Wire for ExposeResolver<'static> {
28926 type Owned<'de> = ExposeResolver<'de>;
28927
28928 #[inline]
28929 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
28930 ::fidl_next::munge!(let Self { table } = out);
28931 ::fidl_next::WireTable::zero_padding(table);
28932 }
28933 }
28934
28935 unsafe impl<___D> ::fidl_next::Decode<___D> for ExposeResolver<'static>
28936 where
28937 ___D: ::fidl_next::Decoder + ?Sized,
28938 {
28939 fn decode(
28940 slot: ::fidl_next::Slot<'_, Self>,
28941 decoder: &mut ___D,
28942 _: (),
28943 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
28944 ::fidl_next::munge!(let Self { table } = slot);
28945
28946 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
28947 match ordinal {
28948 0 => unsafe { ::core::hint::unreachable_unchecked() },
28949
28950 1 => {
28951 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
28952 slot.as_mut(),
28953 decoder,
28954 (),
28955 )?;
28956
28957 Ok(())
28958 }
28959
28960 2 => {
28961 ::fidl_next::WireEnvelope::decode_as::<
28962 ___D,
28963 ::fidl_next::WireString<'static>,
28964 >(slot.as_mut(), decoder, 100)?;
28965
28966 let value = unsafe {
28967 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28968 };
28969
28970 if value.len() > 100 {
28971 return Err(::fidl_next::DecodeError::VectorTooLong {
28972 size: value.len() as u64,
28973 limit: 100,
28974 });
28975 }
28976
28977 Ok(())
28978 }
28979
28980 3 => {
28981 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
28982 slot.as_mut(),
28983 decoder,
28984 (),
28985 )?;
28986
28987 Ok(())
28988 }
28989
28990 4 => {
28991 ::fidl_next::WireEnvelope::decode_as::<
28992 ___D,
28993 ::fidl_next::WireString<'static>,
28994 >(slot.as_mut(), decoder, 100)?;
28995
28996 let value = unsafe {
28997 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
28998 };
28999
29000 if value.len() > 100 {
29001 return Err(::fidl_next::DecodeError::VectorTooLong {
29002 size: value.len() as u64,
29003 limit: 100,
29004 });
29005 }
29006
29007 Ok(())
29008 }
29009
29010 6 => {
29011 ::fidl_next::WireEnvelope::decode_as::<
29012 ___D,
29013 ::fidl_next::WireString<'static>,
29014 >(slot.as_mut(), decoder, 1024)?;
29015
29016 let value = unsafe {
29017 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
29018 };
29019
29020 if value.len() > 1024 {
29021 return Err(::fidl_next::DecodeError::VectorTooLong {
29022 size: value.len() as u64,
29023 limit: 1024,
29024 });
29025 }
29026
29027 Ok(())
29028 }
29029
29030 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
29031 }
29032 })
29033 }
29034 }
29035
29036 impl<'de> ExposeResolver<'de> {
29037 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29038 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
29039 }
29040
29041 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
29042 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
29043 }
29044
29045 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29046 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
29047 }
29048
29049 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
29050 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
29051 }
29052
29053 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
29054 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
29055 }
29056 }
29057
29058 impl<'de> ::core::fmt::Debug for ExposeResolver<'de> {
29059 fn fmt(
29060 &self,
29061 f: &mut ::core::fmt::Formatter<'_>,
29062 ) -> ::core::result::Result<(), ::core::fmt::Error> {
29063 f.debug_struct("ExposeResolver")
29064 .field("source", &self.source())
29065 .field("source_name", &self.source_name())
29066 .field("target", &self.target())
29067 .field("target_name", &self.target_name())
29068 .field("source_dictionary", &self.source_dictionary())
29069 .finish()
29070 }
29071 }
29072
29073 impl<'de> ::fidl_next::IntoNatural for ExposeResolver<'de> {
29074 type Natural = crate::natural::ExposeResolver;
29075 }
29076
29077 impl ::fidl_next::Unconstrained for ExposeResolver<'_> {}
29078
29079 #[repr(C)]
29081 pub struct ExposeDictionary<'de> {
29082 pub(crate) table: ::fidl_next::WireTable<'de>,
29083 }
29084
29085 impl<'de> Drop for ExposeDictionary<'de> {
29086 fn drop(&mut self) {
29087 let _ = self
29088 .table
29089 .get(1)
29090 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29091
29092 let _ = self.table.get(2).map(|envelope| unsafe {
29093 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
29094 });
29095
29096 let _ = self
29097 .table
29098 .get(3)
29099 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29100
29101 let _ = self.table.get(4).map(|envelope| unsafe {
29102 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
29103 });
29104
29105 let _ = self
29106 .table
29107 .get(5)
29108 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
29109
29110 let _ = self.table.get(6).map(|envelope| unsafe {
29111 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
29112 });
29113 }
29114 }
29115
29116 unsafe impl ::fidl_next::Wire for ExposeDictionary<'static> {
29117 type Owned<'de> = ExposeDictionary<'de>;
29118
29119 #[inline]
29120 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29121 ::fidl_next::munge!(let Self { table } = out);
29122 ::fidl_next::WireTable::zero_padding(table);
29123 }
29124 }
29125
29126 unsafe impl<___D> ::fidl_next::Decode<___D> for ExposeDictionary<'static>
29127 where
29128 ___D: ::fidl_next::Decoder + ?Sized,
29129 {
29130 fn decode(
29131 slot: ::fidl_next::Slot<'_, Self>,
29132 decoder: &mut ___D,
29133 _: (),
29134 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
29135 ::fidl_next::munge!(let Self { table } = slot);
29136
29137 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
29138 match ordinal {
29139 0 => unsafe { ::core::hint::unreachable_unchecked() },
29140
29141 1 => {
29142 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
29143 slot.as_mut(),
29144 decoder,
29145 (),
29146 )?;
29147
29148 Ok(())
29149 }
29150
29151 2 => {
29152 ::fidl_next::WireEnvelope::decode_as::<
29153 ___D,
29154 ::fidl_next::WireString<'static>,
29155 >(slot.as_mut(), decoder, 100)?;
29156
29157 let value = unsafe {
29158 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
29159 };
29160
29161 if value.len() > 100 {
29162 return Err(::fidl_next::DecodeError::VectorTooLong {
29163 size: value.len() as u64,
29164 limit: 100,
29165 });
29166 }
29167
29168 Ok(())
29169 }
29170
29171 3 => {
29172 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
29173 slot.as_mut(),
29174 decoder,
29175 (),
29176 )?;
29177
29178 Ok(())
29179 }
29180
29181 4 => {
29182 ::fidl_next::WireEnvelope::decode_as::<
29183 ___D,
29184 ::fidl_next::WireString<'static>,
29185 >(slot.as_mut(), decoder, 100)?;
29186
29187 let value = unsafe {
29188 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
29189 };
29190
29191 if value.len() > 100 {
29192 return Err(::fidl_next::DecodeError::VectorTooLong {
29193 size: value.len() as u64,
29194 limit: 100,
29195 });
29196 }
29197
29198 Ok(())
29199 }
29200
29201 5 => {
29202 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
29203 slot.as_mut(),
29204 decoder,
29205 (),
29206 )?;
29207
29208 Ok(())
29209 }
29210
29211 6 => {
29212 ::fidl_next::WireEnvelope::decode_as::<
29213 ___D,
29214 ::fidl_next::WireString<'static>,
29215 >(slot.as_mut(), decoder, 1024)?;
29216
29217 let value = unsafe {
29218 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
29219 };
29220
29221 if value.len() > 1024 {
29222 return Err(::fidl_next::DecodeError::VectorTooLong {
29223 size: value.len() as u64,
29224 limit: 1024,
29225 });
29226 }
29227
29228 Ok(())
29229 }
29230
29231 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
29232 }
29233 })
29234 }
29235 }
29236
29237 impl<'de> ExposeDictionary<'de> {
29238 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29239 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
29240 }
29241
29242 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
29243 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
29244 }
29245
29246 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29247 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
29248 }
29249
29250 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
29251 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
29252 }
29253
29254 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
29255 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
29256 }
29257
29258 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
29259 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
29260 }
29261 }
29262
29263 impl<'de> ::core::fmt::Debug for ExposeDictionary<'de> {
29264 fn fmt(
29265 &self,
29266 f: &mut ::core::fmt::Formatter<'_>,
29267 ) -> ::core::result::Result<(), ::core::fmt::Error> {
29268 f.debug_struct("ExposeDictionary")
29269 .field("source", &self.source())
29270 .field("source_name", &self.source_name())
29271 .field("target", &self.target())
29272 .field("target_name", &self.target_name())
29273 .field("availability", &self.availability())
29274 .field("source_dictionary", &self.source_dictionary())
29275 .finish()
29276 }
29277 }
29278
29279 impl<'de> ::fidl_next::IntoNatural for ExposeDictionary<'de> {
29280 type Natural = crate::natural::ExposeDictionary;
29281 }
29282
29283 impl ::fidl_next::Unconstrained for ExposeDictionary<'_> {}
29284
29285 #[repr(C)]
29287 pub struct ExposeConfiguration<'de> {
29288 pub(crate) table: ::fidl_next::WireTable<'de>,
29289 }
29290
29291 impl<'de> Drop for ExposeConfiguration<'de> {
29292 fn drop(&mut self) {
29293 let _ = self
29294 .table
29295 .get(1)
29296 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29297
29298 let _ = self.table.get(2).map(|envelope| unsafe {
29299 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
29300 });
29301
29302 let _ = self
29303 .table
29304 .get(3)
29305 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29306
29307 let _ = self.table.get(4).map(|envelope| unsafe {
29308 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
29309 });
29310
29311 let _ = self
29312 .table
29313 .get(5)
29314 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
29315
29316 let _ = self.table.get(6).map(|envelope| unsafe {
29317 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
29318 });
29319 }
29320 }
29321
29322 unsafe impl ::fidl_next::Wire for ExposeConfiguration<'static> {
29323 type Owned<'de> = ExposeConfiguration<'de>;
29324
29325 #[inline]
29326 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29327 ::fidl_next::munge!(let Self { table } = out);
29328 ::fidl_next::WireTable::zero_padding(table);
29329 }
29330 }
29331
29332 unsafe impl<___D> ::fidl_next::Decode<___D> for ExposeConfiguration<'static>
29333 where
29334 ___D: ::fidl_next::Decoder + ?Sized,
29335 {
29336 fn decode(
29337 slot: ::fidl_next::Slot<'_, Self>,
29338 decoder: &mut ___D,
29339 _: (),
29340 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
29341 ::fidl_next::munge!(let Self { table } = slot);
29342
29343 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
29344 match ordinal {
29345 0 => unsafe { ::core::hint::unreachable_unchecked() },
29346
29347 1 => {
29348 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
29349 slot.as_mut(),
29350 decoder,
29351 (),
29352 )?;
29353
29354 Ok(())
29355 }
29356
29357 2 => {
29358 ::fidl_next::WireEnvelope::decode_as::<
29359 ___D,
29360 ::fidl_next::WireString<'static>,
29361 >(slot.as_mut(), decoder, 100)?;
29362
29363 let value = unsafe {
29364 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
29365 };
29366
29367 if value.len() > 100 {
29368 return Err(::fidl_next::DecodeError::VectorTooLong {
29369 size: value.len() as u64,
29370 limit: 100,
29371 });
29372 }
29373
29374 Ok(())
29375 }
29376
29377 3 => {
29378 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
29379 slot.as_mut(),
29380 decoder,
29381 (),
29382 )?;
29383
29384 Ok(())
29385 }
29386
29387 4 => {
29388 ::fidl_next::WireEnvelope::decode_as::<
29389 ___D,
29390 ::fidl_next::WireString<'static>,
29391 >(slot.as_mut(), decoder, 100)?;
29392
29393 let value = unsafe {
29394 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
29395 };
29396
29397 if value.len() > 100 {
29398 return Err(::fidl_next::DecodeError::VectorTooLong {
29399 size: value.len() as u64,
29400 limit: 100,
29401 });
29402 }
29403
29404 Ok(())
29405 }
29406
29407 5 => {
29408 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
29409 slot.as_mut(),
29410 decoder,
29411 (),
29412 )?;
29413
29414 Ok(())
29415 }
29416
29417 6 => {
29418 ::fidl_next::WireEnvelope::decode_as::<
29419 ___D,
29420 ::fidl_next::WireString<'static>,
29421 >(slot.as_mut(), decoder, 1024)?;
29422
29423 let value = unsafe {
29424 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
29425 };
29426
29427 if value.len() > 1024 {
29428 return Err(::fidl_next::DecodeError::VectorTooLong {
29429 size: value.len() as u64,
29430 limit: 1024,
29431 });
29432 }
29433
29434 Ok(())
29435 }
29436
29437 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
29438 }
29439 })
29440 }
29441 }
29442
29443 impl<'de> ExposeConfiguration<'de> {
29444 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29445 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
29446 }
29447
29448 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
29449 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
29450 }
29451
29452 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29453 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
29454 }
29455
29456 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
29457 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
29458 }
29459
29460 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
29461 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
29462 }
29463
29464 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
29465 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
29466 }
29467 }
29468
29469 impl<'de> ::core::fmt::Debug for ExposeConfiguration<'de> {
29470 fn fmt(
29471 &self,
29472 f: &mut ::core::fmt::Formatter<'_>,
29473 ) -> ::core::result::Result<(), ::core::fmt::Error> {
29474 f.debug_struct("ExposeConfiguration")
29475 .field("source", &self.source())
29476 .field("source_name", &self.source_name())
29477 .field("target", &self.target())
29478 .field("target_name", &self.target_name())
29479 .field("availability", &self.availability())
29480 .field("source_dictionary", &self.source_dictionary())
29481 .finish()
29482 }
29483 }
29484
29485 impl<'de> ::fidl_next::IntoNatural for ExposeConfiguration<'de> {
29486 type Natural = crate::natural::ExposeConfiguration;
29487 }
29488
29489 impl ::fidl_next::Unconstrained for ExposeConfiguration<'_> {}
29490
29491 #[repr(transparent)]
29493 pub struct Expose<'de> {
29494 pub(crate) raw: ::fidl_next::RawWireUnion,
29495 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
29496 }
29497
29498 impl<'de> Drop for Expose<'de> {
29499 fn drop(&mut self) {
29500 match self.raw.ordinal() {
29501 1 => {
29502 let _ = unsafe {
29503 self.raw.get().read_unchecked::<crate::wire::ExposeService<'de>>()
29504 };
29505 }
29506
29507 2 => {
29508 let _ = unsafe {
29509 self.raw.get().read_unchecked::<crate::wire::ExposeProtocol<'de>>()
29510 };
29511 }
29512
29513 3 => {
29514 let _ = unsafe {
29515 self.raw.get().read_unchecked::<crate::wire::ExposeDirectory<'de>>()
29516 };
29517 }
29518
29519 4 => {
29520 let _ = unsafe {
29521 self.raw.get().read_unchecked::<crate::wire::ExposeRunner<'de>>()
29522 };
29523 }
29524
29525 5 => {
29526 let _ = unsafe {
29527 self.raw.get().read_unchecked::<crate::wire::ExposeResolver<'de>>()
29528 };
29529 }
29530
29531 7 => {
29532 let _ = unsafe {
29533 self.raw.get().read_unchecked::<crate::wire::ExposeDictionary<'de>>()
29534 };
29535 }
29536
29537 8 => {
29538 let _ = unsafe {
29539 self.raw.get().read_unchecked::<crate::wire::ExposeConfiguration<'de>>()
29540 };
29541 }
29542
29543 _ => (),
29544 }
29545 }
29546 }
29547
29548 unsafe impl ::fidl_next::Wire for Expose<'static> {
29549 type Owned<'de> = Expose<'de>;
29550
29551 #[inline]
29552 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29553 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
29554 ::fidl_next::RawWireUnion::zero_padding(raw);
29555 }
29556 }
29557
29558 pub mod expose {
29559 pub enum Ref<'de> {
29560 Service(&'de crate::wire::ExposeService<'de>),
29561
29562 Protocol(&'de crate::wire::ExposeProtocol<'de>),
29563
29564 Directory(&'de crate::wire::ExposeDirectory<'de>),
29565
29566 Runner(&'de crate::wire::ExposeRunner<'de>),
29567
29568 Resolver(&'de crate::wire::ExposeResolver<'de>),
29569
29570 Dictionary(&'de crate::wire::ExposeDictionary<'de>),
29571
29572 Config(&'de crate::wire::ExposeConfiguration<'de>),
29573
29574 UnknownOrdinal_(u64),
29575 }
29576 }
29577
29578 impl<'de> Expose<'de> {
29579 pub fn as_ref(&self) -> crate::wire::expose::Ref<'_> {
29580 match self.raw.ordinal() {
29581 1 => crate::wire::expose::Ref::Service(unsafe {
29582 self.raw.get().deref_unchecked::<crate::wire::ExposeService<'_>>()
29583 }),
29584
29585 2 => crate::wire::expose::Ref::Protocol(unsafe {
29586 self.raw.get().deref_unchecked::<crate::wire::ExposeProtocol<'_>>()
29587 }),
29588
29589 3 => crate::wire::expose::Ref::Directory(unsafe {
29590 self.raw.get().deref_unchecked::<crate::wire::ExposeDirectory<'_>>()
29591 }),
29592
29593 4 => crate::wire::expose::Ref::Runner(unsafe {
29594 self.raw.get().deref_unchecked::<crate::wire::ExposeRunner<'_>>()
29595 }),
29596
29597 5 => crate::wire::expose::Ref::Resolver(unsafe {
29598 self.raw.get().deref_unchecked::<crate::wire::ExposeResolver<'_>>()
29599 }),
29600
29601 7 => crate::wire::expose::Ref::Dictionary(unsafe {
29602 self.raw.get().deref_unchecked::<crate::wire::ExposeDictionary<'_>>()
29603 }),
29604
29605 8 => crate::wire::expose::Ref::Config(unsafe {
29606 self.raw.get().deref_unchecked::<crate::wire::ExposeConfiguration<'_>>()
29607 }),
29608
29609 unknown => crate::wire::expose::Ref::UnknownOrdinal_(unknown),
29610 }
29611 }
29612 }
29613
29614 unsafe impl<___D> ::fidl_next::Decode<___D> for Expose<'static>
29615 where
29616 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
29617 ___D: ::fidl_next::Decoder,
29618 {
29619 fn decode(
29620 mut slot: ::fidl_next::Slot<'_, Self>,
29621 decoder: &mut ___D,
29622 _: (),
29623 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
29624 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
29625 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
29626 1 => ::fidl_next::RawWireUnion::decode_as::<
29627 ___D,
29628 crate::wire::ExposeService<'static>,
29629 >(raw, decoder, ())?,
29630
29631 2 => ::fidl_next::RawWireUnion::decode_as::<
29632 ___D,
29633 crate::wire::ExposeProtocol<'static>,
29634 >(raw, decoder, ())?,
29635
29636 3 => ::fidl_next::RawWireUnion::decode_as::<
29637 ___D,
29638 crate::wire::ExposeDirectory<'static>,
29639 >(raw, decoder, ())?,
29640
29641 4 => ::fidl_next::RawWireUnion::decode_as::<
29642 ___D,
29643 crate::wire::ExposeRunner<'static>,
29644 >(raw, decoder, ())?,
29645
29646 5 => ::fidl_next::RawWireUnion::decode_as::<
29647 ___D,
29648 crate::wire::ExposeResolver<'static>,
29649 >(raw, decoder, ())?,
29650
29651 7 => ::fidl_next::RawWireUnion::decode_as::<
29652 ___D,
29653 crate::wire::ExposeDictionary<'static>,
29654 >(raw, decoder, ())?,
29655
29656 8 => ::fidl_next::RawWireUnion::decode_as::<
29657 ___D,
29658 crate::wire::ExposeConfiguration<'static>,
29659 >(raw, decoder, ())?,
29660
29661 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
29662 }
29663
29664 Ok(())
29665 }
29666 }
29667
29668 impl<'de> ::core::fmt::Debug for Expose<'de> {
29669 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
29670 match self.raw.ordinal() {
29671 1 => unsafe {
29672 self.raw.get().deref_unchecked::<crate::wire::ExposeService<'_>>().fmt(f)
29673 },
29674 2 => unsafe {
29675 self.raw.get().deref_unchecked::<crate::wire::ExposeProtocol<'_>>().fmt(f)
29676 },
29677 3 => unsafe {
29678 self.raw.get().deref_unchecked::<crate::wire::ExposeDirectory<'_>>().fmt(f)
29679 },
29680 4 => unsafe {
29681 self.raw.get().deref_unchecked::<crate::wire::ExposeRunner<'_>>().fmt(f)
29682 },
29683 5 => unsafe {
29684 self.raw.get().deref_unchecked::<crate::wire::ExposeResolver<'_>>().fmt(f)
29685 },
29686 7 => unsafe {
29687 self.raw.get().deref_unchecked::<crate::wire::ExposeDictionary<'_>>().fmt(f)
29688 },
29689 8 => unsafe {
29690 self.raw.get().deref_unchecked::<crate::wire::ExposeConfiguration<'_>>().fmt(f)
29691 },
29692 _ => unsafe { ::core::hint::unreachable_unchecked() },
29693 }
29694 }
29695 }
29696
29697 impl<'de> ::fidl_next::IntoNatural for Expose<'de> {
29698 type Natural = crate::natural::Expose;
29699 }
29700
29701 impl ::fidl_next::Unconstrained for Expose<'static> {}
29702
29703 #[repr(C)]
29705 pub struct OfferService<'de> {
29706 pub(crate) table: ::fidl_next::WireTable<'de>,
29707 }
29708
29709 impl<'de> Drop for OfferService<'de> {
29710 fn drop(&mut self) {
29711 let _ = self
29712 .table
29713 .get(1)
29714 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29715
29716 let _ = self.table.get(2).map(|envelope| unsafe {
29717 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
29718 });
29719
29720 let _ = self
29721 .table
29722 .get(3)
29723 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29724
29725 let _ = self.table.get(4).map(|envelope| unsafe {
29726 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
29727 });
29728
29729 let _ = self.table.get(5)
29730 .map(|envelope| unsafe {
29731 envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>()
29732 });
29733
29734 let _ = self.table.get(6)
29735 .map(|envelope| unsafe {
29736 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::NameMapping<'de>>>()
29737 });
29738
29739 let _ = self
29740 .table
29741 .get(7)
29742 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
29743
29744 let _ = self.table.get(8).map(|envelope| unsafe {
29745 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
29746 });
29747
29748 let _ = self.table.get(9).map(|envelope| unsafe {
29749 envelope.read_unchecked::<crate::wire::DependencyType>()
29750 });
29751 }
29752 }
29753
29754 unsafe impl ::fidl_next::Wire for OfferService<'static> {
29755 type Owned<'de> = OfferService<'de>;
29756
29757 #[inline]
29758 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
29759 ::fidl_next::munge!(let Self { table } = out);
29760 ::fidl_next::WireTable::zero_padding(table);
29761 }
29762 }
29763
29764 unsafe impl<___D> ::fidl_next::Decode<___D> for OfferService<'static>
29765 where
29766 ___D: ::fidl_next::Decoder + ?Sized,
29767 {
29768 fn decode(
29769 slot: ::fidl_next::Slot<'_, Self>,
29770 decoder: &mut ___D,
29771 _: (),
29772 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
29773 ::fidl_next::munge!(let Self { table } = slot);
29774
29775 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
29776 match ordinal {
29777 0 => unsafe { ::core::hint::unreachable_unchecked() },
29778
29779 1 => {
29780 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
29781 slot.as_mut(),
29782 decoder,
29783 (),
29784 )?;
29785
29786 Ok(())
29787 }
29788
29789 2 => {
29790 ::fidl_next::WireEnvelope::decode_as::<
29791 ___D,
29792 ::fidl_next::WireString<'static>,
29793 >(slot.as_mut(), decoder, 100)?;
29794
29795 let value = unsafe {
29796 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
29797 };
29798
29799 if value.len() > 100 {
29800 return Err(::fidl_next::DecodeError::VectorTooLong {
29801 size: value.len() as u64,
29802 limit: 100,
29803 });
29804 }
29805
29806 Ok(())
29807 }
29808
29809 3 => {
29810 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
29811 slot.as_mut(),
29812 decoder,
29813 (),
29814 )?;
29815
29816 Ok(())
29817 }
29818
29819 4 => {
29820 ::fidl_next::WireEnvelope::decode_as::<
29821 ___D,
29822 ::fidl_next::WireString<'static>,
29823 >(slot.as_mut(), decoder, 100)?;
29824
29825 let value = unsafe {
29826 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
29827 };
29828
29829 if value.len() > 100 {
29830 return Err(::fidl_next::DecodeError::VectorTooLong {
29831 size: value.len() as u64,
29832 limit: 100,
29833 });
29834 }
29835
29836 Ok(())
29837 }
29838
29839 5 => {
29840 ::fidl_next::WireEnvelope::decode_as::<
29841 ___D,
29842 ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
29843 >(slot.as_mut(), decoder, (4294967295, 100))?;
29844
29845 Ok(())
29846 }
29847
29848 6 => {
29849 ::fidl_next::WireEnvelope::decode_as::<
29850 ___D,
29851 ::fidl_next::WireVector<'static, crate::wire::NameMapping<'static>>,
29852 >(slot.as_mut(), decoder, (4294967295, ()))?;
29853
29854 Ok(())
29855 }
29856
29857 7 => {
29858 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
29859 slot.as_mut(),
29860 decoder,
29861 (),
29862 )?;
29863
29864 Ok(())
29865 }
29866
29867 8 => {
29868 ::fidl_next::WireEnvelope::decode_as::<
29869 ___D,
29870 ::fidl_next::WireString<'static>,
29871 >(slot.as_mut(), decoder, 1024)?;
29872
29873 let value = unsafe {
29874 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
29875 };
29876
29877 if value.len() > 1024 {
29878 return Err(::fidl_next::DecodeError::VectorTooLong {
29879 size: value.len() as u64,
29880 limit: 1024,
29881 });
29882 }
29883
29884 Ok(())
29885 }
29886
29887 9 => {
29888 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::DependencyType>(
29889 slot.as_mut(),
29890 decoder,
29891 (),
29892 )?;
29893
29894 Ok(())
29895 }
29896
29897 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
29898 }
29899 })
29900 }
29901 }
29902
29903 impl<'de> OfferService<'de> {
29904 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29905 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
29906 }
29907
29908 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
29909 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
29910 }
29911
29912 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
29913 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
29914 }
29915
29916 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
29917 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
29918 }
29919
29920 pub fn source_instance_filter(
29921 &self,
29922 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, ::fidl_next::WireString<'de>>>
29923 {
29924 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
29925 }
29926
29927 pub fn renamed_instances(
29928 &self,
29929 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::wire::NameMapping<'de>>>
29930 {
29931 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
29932 }
29933
29934 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
29935 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
29936 }
29937
29938 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
29939 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
29940 }
29941
29942 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
29943 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
29944 }
29945 }
29946
29947 impl<'de> ::core::fmt::Debug for OfferService<'de> {
29948 fn fmt(
29949 &self,
29950 f: &mut ::core::fmt::Formatter<'_>,
29951 ) -> ::core::result::Result<(), ::core::fmt::Error> {
29952 f.debug_struct("OfferService")
29953 .field("source", &self.source())
29954 .field("source_name", &self.source_name())
29955 .field("target", &self.target())
29956 .field("target_name", &self.target_name())
29957 .field("source_instance_filter", &self.source_instance_filter())
29958 .field("renamed_instances", &self.renamed_instances())
29959 .field("availability", &self.availability())
29960 .field("source_dictionary", &self.source_dictionary())
29961 .field("dependency_type", &self.dependency_type())
29962 .finish()
29963 }
29964 }
29965
29966 impl<'de> ::fidl_next::IntoNatural for OfferService<'de> {
29967 type Natural = crate::natural::OfferService;
29968 }
29969
29970 impl ::fidl_next::Unconstrained for OfferService<'_> {}
29971
29972 #[repr(C)]
29974 pub struct OfferProtocol<'de> {
29975 pub(crate) table: ::fidl_next::WireTable<'de>,
29976 }
29977
29978 impl<'de> Drop for OfferProtocol<'de> {
29979 fn drop(&mut self) {
29980 let _ = self
29981 .table
29982 .get(1)
29983 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29984
29985 let _ = self.table.get(2).map(|envelope| unsafe {
29986 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
29987 });
29988
29989 let _ = self
29990 .table
29991 .get(3)
29992 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
29993
29994 let _ = self.table.get(4).map(|envelope| unsafe {
29995 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
29996 });
29997
29998 let _ = self.table.get(5).map(|envelope| unsafe {
29999 envelope.read_unchecked::<crate::wire::DependencyType>()
30000 });
30001
30002 let _ = self
30003 .table
30004 .get(6)
30005 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
30006
30007 let _ = self.table.get(7).map(|envelope| unsafe {
30008 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
30009 });
30010 }
30011 }
30012
30013 unsafe impl ::fidl_next::Wire for OfferProtocol<'static> {
30014 type Owned<'de> = OfferProtocol<'de>;
30015
30016 #[inline]
30017 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30018 ::fidl_next::munge!(let Self { table } = out);
30019 ::fidl_next::WireTable::zero_padding(table);
30020 }
30021 }
30022
30023 unsafe impl<___D> ::fidl_next::Decode<___D> for OfferProtocol<'static>
30024 where
30025 ___D: ::fidl_next::Decoder + ?Sized,
30026 {
30027 fn decode(
30028 slot: ::fidl_next::Slot<'_, Self>,
30029 decoder: &mut ___D,
30030 _: (),
30031 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
30032 ::fidl_next::munge!(let Self { table } = slot);
30033
30034 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
30035 match ordinal {
30036 0 => unsafe { ::core::hint::unreachable_unchecked() },
30037
30038 1 => {
30039 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
30040 slot.as_mut(),
30041 decoder,
30042 (),
30043 )?;
30044
30045 Ok(())
30046 }
30047
30048 2 => {
30049 ::fidl_next::WireEnvelope::decode_as::<
30050 ___D,
30051 ::fidl_next::WireString<'static>,
30052 >(slot.as_mut(), decoder, 100)?;
30053
30054 let value = unsafe {
30055 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
30056 };
30057
30058 if value.len() > 100 {
30059 return Err(::fidl_next::DecodeError::VectorTooLong {
30060 size: value.len() as u64,
30061 limit: 100,
30062 });
30063 }
30064
30065 Ok(())
30066 }
30067
30068 3 => {
30069 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
30070 slot.as_mut(),
30071 decoder,
30072 (),
30073 )?;
30074
30075 Ok(())
30076 }
30077
30078 4 => {
30079 ::fidl_next::WireEnvelope::decode_as::<
30080 ___D,
30081 ::fidl_next::WireString<'static>,
30082 >(slot.as_mut(), decoder, 100)?;
30083
30084 let value = unsafe {
30085 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
30086 };
30087
30088 if value.len() > 100 {
30089 return Err(::fidl_next::DecodeError::VectorTooLong {
30090 size: value.len() as u64,
30091 limit: 100,
30092 });
30093 }
30094
30095 Ok(())
30096 }
30097
30098 5 => {
30099 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::DependencyType>(
30100 slot.as_mut(),
30101 decoder,
30102 (),
30103 )?;
30104
30105 Ok(())
30106 }
30107
30108 6 => {
30109 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
30110 slot.as_mut(),
30111 decoder,
30112 (),
30113 )?;
30114
30115 Ok(())
30116 }
30117
30118 7 => {
30119 ::fidl_next::WireEnvelope::decode_as::<
30120 ___D,
30121 ::fidl_next::WireString<'static>,
30122 >(slot.as_mut(), decoder, 1024)?;
30123
30124 let value = unsafe {
30125 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
30126 };
30127
30128 if value.len() > 1024 {
30129 return Err(::fidl_next::DecodeError::VectorTooLong {
30130 size: value.len() as u64,
30131 limit: 1024,
30132 });
30133 }
30134
30135 Ok(())
30136 }
30137
30138 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
30139 }
30140 })
30141 }
30142 }
30143
30144 impl<'de> OfferProtocol<'de> {
30145 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30146 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
30147 }
30148
30149 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
30150 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
30151 }
30152
30153 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30154 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
30155 }
30156
30157 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
30158 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
30159 }
30160
30161 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
30162 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
30163 }
30164
30165 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
30166 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
30167 }
30168
30169 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
30170 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
30171 }
30172 }
30173
30174 impl<'de> ::core::fmt::Debug for OfferProtocol<'de> {
30175 fn fmt(
30176 &self,
30177 f: &mut ::core::fmt::Formatter<'_>,
30178 ) -> ::core::result::Result<(), ::core::fmt::Error> {
30179 f.debug_struct("OfferProtocol")
30180 .field("source", &self.source())
30181 .field("source_name", &self.source_name())
30182 .field("target", &self.target())
30183 .field("target_name", &self.target_name())
30184 .field("dependency_type", &self.dependency_type())
30185 .field("availability", &self.availability())
30186 .field("source_dictionary", &self.source_dictionary())
30187 .finish()
30188 }
30189 }
30190
30191 impl<'de> ::fidl_next::IntoNatural for OfferProtocol<'de> {
30192 type Natural = crate::natural::OfferProtocol;
30193 }
30194
30195 impl ::fidl_next::Unconstrained for OfferProtocol<'_> {}
30196
30197 #[repr(C)]
30199 pub struct OfferDirectory<'de> {
30200 pub(crate) table: ::fidl_next::WireTable<'de>,
30201 }
30202
30203 impl<'de> Drop for OfferDirectory<'de> {
30204 fn drop(&mut self) {
30205 let _ = self
30206 .table
30207 .get(1)
30208 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30209
30210 let _ = self.table.get(2).map(|envelope| unsafe {
30211 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
30212 });
30213
30214 let _ = self
30215 .table
30216 .get(3)
30217 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30218
30219 let _ = self.table.get(4).map(|envelope| unsafe {
30220 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
30221 });
30222
30223 let _ = self.table.get(5).map(|envelope| unsafe {
30224 envelope.read_unchecked::<::fidl_next_common_fuchsia_io::wire::Operations>()
30225 });
30226
30227 let _ = self.table.get(6).map(|envelope| unsafe {
30228 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
30229 });
30230
30231 let _ = self.table.get(7).map(|envelope| unsafe {
30232 envelope.read_unchecked::<crate::wire::DependencyType>()
30233 });
30234
30235 let _ = self
30236 .table
30237 .get(8)
30238 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
30239
30240 let _ = self.table.get(9).map(|envelope| unsafe {
30241 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
30242 });
30243 }
30244 }
30245
30246 unsafe impl ::fidl_next::Wire for OfferDirectory<'static> {
30247 type Owned<'de> = OfferDirectory<'de>;
30248
30249 #[inline]
30250 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30251 ::fidl_next::munge!(let Self { table } = out);
30252 ::fidl_next::WireTable::zero_padding(table);
30253 }
30254 }
30255
30256 unsafe impl<___D> ::fidl_next::Decode<___D> for OfferDirectory<'static>
30257 where
30258 ___D: ::fidl_next::Decoder + ?Sized,
30259 {
30260 fn decode(
30261 slot: ::fidl_next::Slot<'_, Self>,
30262 decoder: &mut ___D,
30263 _: (),
30264 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
30265 ::fidl_next::munge!(let Self { table } = slot);
30266
30267 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
30268 match ordinal {
30269 0 => unsafe { ::core::hint::unreachable_unchecked() },
30270
30271 1 => {
30272 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
30273 slot.as_mut(),
30274 decoder,
30275 (),
30276 )?;
30277
30278 Ok(())
30279 }
30280
30281 2 => {
30282 ::fidl_next::WireEnvelope::decode_as::<
30283 ___D,
30284 ::fidl_next::WireString<'static>,
30285 >(slot.as_mut(), decoder, 100)?;
30286
30287 let value = unsafe {
30288 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
30289 };
30290
30291 if value.len() > 100 {
30292 return Err(::fidl_next::DecodeError::VectorTooLong {
30293 size: value.len() as u64,
30294 limit: 100,
30295 });
30296 }
30297
30298 Ok(())
30299 }
30300
30301 3 => {
30302 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
30303 slot.as_mut(),
30304 decoder,
30305 (),
30306 )?;
30307
30308 Ok(())
30309 }
30310
30311 4 => {
30312 ::fidl_next::WireEnvelope::decode_as::<
30313 ___D,
30314 ::fidl_next::WireString<'static>,
30315 >(slot.as_mut(), decoder, 100)?;
30316
30317 let value = unsafe {
30318 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
30319 };
30320
30321 if value.len() > 100 {
30322 return Err(::fidl_next::DecodeError::VectorTooLong {
30323 size: value.len() as u64,
30324 limit: 100,
30325 });
30326 }
30327
30328 Ok(())
30329 }
30330
30331 5 => {
30332 ::fidl_next::WireEnvelope::decode_as::<
30333 ___D,
30334 ::fidl_next_common_fuchsia_io::wire::Operations,
30335 >(slot.as_mut(), decoder, ())?;
30336
30337 Ok(())
30338 }
30339
30340 6 => {
30341 ::fidl_next::WireEnvelope::decode_as::<
30342 ___D,
30343 ::fidl_next::WireString<'static>,
30344 >(slot.as_mut(), decoder, 1024)?;
30345
30346 let value = unsafe {
30347 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
30348 };
30349
30350 if value.len() > 1024 {
30351 return Err(::fidl_next::DecodeError::VectorTooLong {
30352 size: value.len() as u64,
30353 limit: 1024,
30354 });
30355 }
30356
30357 Ok(())
30358 }
30359
30360 7 => {
30361 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::DependencyType>(
30362 slot.as_mut(),
30363 decoder,
30364 (),
30365 )?;
30366
30367 Ok(())
30368 }
30369
30370 8 => {
30371 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
30372 slot.as_mut(),
30373 decoder,
30374 (),
30375 )?;
30376
30377 Ok(())
30378 }
30379
30380 9 => {
30381 ::fidl_next::WireEnvelope::decode_as::<
30382 ___D,
30383 ::fidl_next::WireString<'static>,
30384 >(slot.as_mut(), decoder, 1024)?;
30385
30386 let value = unsafe {
30387 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
30388 };
30389
30390 if value.len() > 1024 {
30391 return Err(::fidl_next::DecodeError::VectorTooLong {
30392 size: value.len() as u64,
30393 limit: 1024,
30394 });
30395 }
30396
30397 Ok(())
30398 }
30399
30400 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
30401 }
30402 })
30403 }
30404 }
30405
30406 impl<'de> OfferDirectory<'de> {
30407 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30408 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
30409 }
30410
30411 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
30412 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
30413 }
30414
30415 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30416 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
30417 }
30418
30419 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
30420 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
30421 }
30422
30423 pub fn rights(
30424 &self,
30425 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_io::wire::Operations> {
30426 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
30427 }
30428
30429 pub fn subdir(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
30430 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
30431 }
30432
30433 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
30434 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
30435 }
30436
30437 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
30438 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
30439 }
30440
30441 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
30442 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
30443 }
30444 }
30445
30446 impl<'de> ::core::fmt::Debug for OfferDirectory<'de> {
30447 fn fmt(
30448 &self,
30449 f: &mut ::core::fmt::Formatter<'_>,
30450 ) -> ::core::result::Result<(), ::core::fmt::Error> {
30451 f.debug_struct("OfferDirectory")
30452 .field("source", &self.source())
30453 .field("source_name", &self.source_name())
30454 .field("target", &self.target())
30455 .field("target_name", &self.target_name())
30456 .field("rights", &self.rights())
30457 .field("subdir", &self.subdir())
30458 .field("dependency_type", &self.dependency_type())
30459 .field("availability", &self.availability())
30460 .field("source_dictionary", &self.source_dictionary())
30461 .finish()
30462 }
30463 }
30464
30465 impl<'de> ::fidl_next::IntoNatural for OfferDirectory<'de> {
30466 type Natural = crate::natural::OfferDirectory;
30467 }
30468
30469 impl ::fidl_next::Unconstrained for OfferDirectory<'_> {}
30470
30471 #[repr(C)]
30473 pub struct OfferStorage<'de> {
30474 pub(crate) table: ::fidl_next::WireTable<'de>,
30475 }
30476
30477 impl<'de> Drop for OfferStorage<'de> {
30478 fn drop(&mut self) {
30479 let _ = self.table.get(1).map(|envelope| unsafe {
30480 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
30481 });
30482
30483 let _ = self
30484 .table
30485 .get(2)
30486 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30487
30488 let _ = self
30489 .table
30490 .get(3)
30491 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30492
30493 let _ = self.table.get(4).map(|envelope| unsafe {
30494 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
30495 });
30496
30497 let _ = self
30498 .table
30499 .get(5)
30500 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
30501 }
30502 }
30503
30504 unsafe impl ::fidl_next::Wire for OfferStorage<'static> {
30505 type Owned<'de> = OfferStorage<'de>;
30506
30507 #[inline]
30508 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30509 ::fidl_next::munge!(let Self { table } = out);
30510 ::fidl_next::WireTable::zero_padding(table);
30511 }
30512 }
30513
30514 unsafe impl<___D> ::fidl_next::Decode<___D> for OfferStorage<'static>
30515 where
30516 ___D: ::fidl_next::Decoder + ?Sized,
30517 {
30518 fn decode(
30519 slot: ::fidl_next::Slot<'_, Self>,
30520 decoder: &mut ___D,
30521 _: (),
30522 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
30523 ::fidl_next::munge!(let Self { table } = slot);
30524
30525 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
30526 match ordinal {
30527 0 => unsafe { ::core::hint::unreachable_unchecked() },
30528
30529 1 => {
30530 ::fidl_next::WireEnvelope::decode_as::<
30531 ___D,
30532 ::fidl_next::WireString<'static>,
30533 >(slot.as_mut(), decoder, 100)?;
30534
30535 let value = unsafe {
30536 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
30537 };
30538
30539 if value.len() > 100 {
30540 return Err(::fidl_next::DecodeError::VectorTooLong {
30541 size: value.len() as u64,
30542 limit: 100,
30543 });
30544 }
30545
30546 Ok(())
30547 }
30548
30549 2 => {
30550 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
30551 slot.as_mut(),
30552 decoder,
30553 (),
30554 )?;
30555
30556 Ok(())
30557 }
30558
30559 3 => {
30560 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
30561 slot.as_mut(),
30562 decoder,
30563 (),
30564 )?;
30565
30566 Ok(())
30567 }
30568
30569 4 => {
30570 ::fidl_next::WireEnvelope::decode_as::<
30571 ___D,
30572 ::fidl_next::WireString<'static>,
30573 >(slot.as_mut(), decoder, 100)?;
30574
30575 let value = unsafe {
30576 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
30577 };
30578
30579 if value.len() > 100 {
30580 return Err(::fidl_next::DecodeError::VectorTooLong {
30581 size: value.len() as u64,
30582 limit: 100,
30583 });
30584 }
30585
30586 Ok(())
30587 }
30588
30589 5 => {
30590 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
30591 slot.as_mut(),
30592 decoder,
30593 (),
30594 )?;
30595
30596 Ok(())
30597 }
30598
30599 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
30600 }
30601 })
30602 }
30603 }
30604
30605 impl<'de> OfferStorage<'de> {
30606 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
30607 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
30608 }
30609
30610 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30611 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
30612 }
30613
30614 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30615 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
30616 }
30617
30618 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
30619 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
30620 }
30621
30622 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
30623 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
30624 }
30625 }
30626
30627 impl<'de> ::core::fmt::Debug for OfferStorage<'de> {
30628 fn fmt(
30629 &self,
30630 f: &mut ::core::fmt::Formatter<'_>,
30631 ) -> ::core::result::Result<(), ::core::fmt::Error> {
30632 f.debug_struct("OfferStorage")
30633 .field("source_name", &self.source_name())
30634 .field("source", &self.source())
30635 .field("target", &self.target())
30636 .field("target_name", &self.target_name())
30637 .field("availability", &self.availability())
30638 .finish()
30639 }
30640 }
30641
30642 impl<'de> ::fidl_next::IntoNatural for OfferStorage<'de> {
30643 type Natural = crate::natural::OfferStorage;
30644 }
30645
30646 impl ::fidl_next::Unconstrained for OfferStorage<'_> {}
30647
30648 #[repr(C)]
30650 pub struct OfferRunner<'de> {
30651 pub(crate) table: ::fidl_next::WireTable<'de>,
30652 }
30653
30654 impl<'de> Drop for OfferRunner<'de> {
30655 fn drop(&mut self) {
30656 let _ = self
30657 .table
30658 .get(1)
30659 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30660
30661 let _ = self.table.get(2).map(|envelope| unsafe {
30662 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
30663 });
30664
30665 let _ = self
30666 .table
30667 .get(3)
30668 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30669
30670 let _ = self.table.get(4).map(|envelope| unsafe {
30671 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
30672 });
30673
30674 let _ = self.table.get(5).map(|envelope| unsafe {
30675 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
30676 });
30677 }
30678 }
30679
30680 unsafe impl ::fidl_next::Wire for OfferRunner<'static> {
30681 type Owned<'de> = OfferRunner<'de>;
30682
30683 #[inline]
30684 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30685 ::fidl_next::munge!(let Self { table } = out);
30686 ::fidl_next::WireTable::zero_padding(table);
30687 }
30688 }
30689
30690 unsafe impl<___D> ::fidl_next::Decode<___D> for OfferRunner<'static>
30691 where
30692 ___D: ::fidl_next::Decoder + ?Sized,
30693 {
30694 fn decode(
30695 slot: ::fidl_next::Slot<'_, Self>,
30696 decoder: &mut ___D,
30697 _: (),
30698 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
30699 ::fidl_next::munge!(let Self { table } = slot);
30700
30701 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
30702 match ordinal {
30703 0 => unsafe { ::core::hint::unreachable_unchecked() },
30704
30705 1 => {
30706 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
30707 slot.as_mut(),
30708 decoder,
30709 (),
30710 )?;
30711
30712 Ok(())
30713 }
30714
30715 2 => {
30716 ::fidl_next::WireEnvelope::decode_as::<
30717 ___D,
30718 ::fidl_next::WireString<'static>,
30719 >(slot.as_mut(), decoder, 100)?;
30720
30721 let value = unsafe {
30722 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
30723 };
30724
30725 if value.len() > 100 {
30726 return Err(::fidl_next::DecodeError::VectorTooLong {
30727 size: value.len() as u64,
30728 limit: 100,
30729 });
30730 }
30731
30732 Ok(())
30733 }
30734
30735 3 => {
30736 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
30737 slot.as_mut(),
30738 decoder,
30739 (),
30740 )?;
30741
30742 Ok(())
30743 }
30744
30745 4 => {
30746 ::fidl_next::WireEnvelope::decode_as::<
30747 ___D,
30748 ::fidl_next::WireString<'static>,
30749 >(slot.as_mut(), decoder, 100)?;
30750
30751 let value = unsafe {
30752 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
30753 };
30754
30755 if value.len() > 100 {
30756 return Err(::fidl_next::DecodeError::VectorTooLong {
30757 size: value.len() as u64,
30758 limit: 100,
30759 });
30760 }
30761
30762 Ok(())
30763 }
30764
30765 5 => {
30766 ::fidl_next::WireEnvelope::decode_as::<
30767 ___D,
30768 ::fidl_next::WireString<'static>,
30769 >(slot.as_mut(), decoder, 1024)?;
30770
30771 let value = unsafe {
30772 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
30773 };
30774
30775 if value.len() > 1024 {
30776 return Err(::fidl_next::DecodeError::VectorTooLong {
30777 size: value.len() as u64,
30778 limit: 1024,
30779 });
30780 }
30781
30782 Ok(())
30783 }
30784
30785 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
30786 }
30787 })
30788 }
30789 }
30790
30791 impl<'de> OfferRunner<'de> {
30792 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30793 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
30794 }
30795
30796 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
30797 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
30798 }
30799
30800 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30801 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
30802 }
30803
30804 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
30805 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
30806 }
30807
30808 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
30809 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
30810 }
30811 }
30812
30813 impl<'de> ::core::fmt::Debug for OfferRunner<'de> {
30814 fn fmt(
30815 &self,
30816 f: &mut ::core::fmt::Formatter<'_>,
30817 ) -> ::core::result::Result<(), ::core::fmt::Error> {
30818 f.debug_struct("OfferRunner")
30819 .field("source", &self.source())
30820 .field("source_name", &self.source_name())
30821 .field("target", &self.target())
30822 .field("target_name", &self.target_name())
30823 .field("source_dictionary", &self.source_dictionary())
30824 .finish()
30825 }
30826 }
30827
30828 impl<'de> ::fidl_next::IntoNatural for OfferRunner<'de> {
30829 type Natural = crate::natural::OfferRunner;
30830 }
30831
30832 impl ::fidl_next::Unconstrained for OfferRunner<'_> {}
30833
30834 #[repr(C)]
30836 pub struct OfferResolver<'de> {
30837 pub(crate) table: ::fidl_next::WireTable<'de>,
30838 }
30839
30840 impl<'de> Drop for OfferResolver<'de> {
30841 fn drop(&mut self) {
30842 let _ = self
30843 .table
30844 .get(1)
30845 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30846
30847 let _ = self.table.get(2).map(|envelope| unsafe {
30848 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
30849 });
30850
30851 let _ = self
30852 .table
30853 .get(3)
30854 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
30855
30856 let _ = self.table.get(4).map(|envelope| unsafe {
30857 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
30858 });
30859
30860 let _ = self.table.get(5).map(|envelope| unsafe {
30861 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
30862 });
30863 }
30864 }
30865
30866 unsafe impl ::fidl_next::Wire for OfferResolver<'static> {
30867 type Owned<'de> = OfferResolver<'de>;
30868
30869 #[inline]
30870 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
30871 ::fidl_next::munge!(let Self { table } = out);
30872 ::fidl_next::WireTable::zero_padding(table);
30873 }
30874 }
30875
30876 unsafe impl<___D> ::fidl_next::Decode<___D> for OfferResolver<'static>
30877 where
30878 ___D: ::fidl_next::Decoder + ?Sized,
30879 {
30880 fn decode(
30881 slot: ::fidl_next::Slot<'_, Self>,
30882 decoder: &mut ___D,
30883 _: (),
30884 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
30885 ::fidl_next::munge!(let Self { table } = slot);
30886
30887 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
30888 match ordinal {
30889 0 => unsafe { ::core::hint::unreachable_unchecked() },
30890
30891 1 => {
30892 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
30893 slot.as_mut(),
30894 decoder,
30895 (),
30896 )?;
30897
30898 Ok(())
30899 }
30900
30901 2 => {
30902 ::fidl_next::WireEnvelope::decode_as::<
30903 ___D,
30904 ::fidl_next::WireString<'static>,
30905 >(slot.as_mut(), decoder, 100)?;
30906
30907 let value = unsafe {
30908 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
30909 };
30910
30911 if value.len() > 100 {
30912 return Err(::fidl_next::DecodeError::VectorTooLong {
30913 size: value.len() as u64,
30914 limit: 100,
30915 });
30916 }
30917
30918 Ok(())
30919 }
30920
30921 3 => {
30922 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
30923 slot.as_mut(),
30924 decoder,
30925 (),
30926 )?;
30927
30928 Ok(())
30929 }
30930
30931 4 => {
30932 ::fidl_next::WireEnvelope::decode_as::<
30933 ___D,
30934 ::fidl_next::WireString<'static>,
30935 >(slot.as_mut(), decoder, 100)?;
30936
30937 let value = unsafe {
30938 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
30939 };
30940
30941 if value.len() > 100 {
30942 return Err(::fidl_next::DecodeError::VectorTooLong {
30943 size: value.len() as u64,
30944 limit: 100,
30945 });
30946 }
30947
30948 Ok(())
30949 }
30950
30951 5 => {
30952 ::fidl_next::WireEnvelope::decode_as::<
30953 ___D,
30954 ::fidl_next::WireString<'static>,
30955 >(slot.as_mut(), decoder, 1024)?;
30956
30957 let value = unsafe {
30958 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
30959 };
30960
30961 if value.len() > 1024 {
30962 return Err(::fidl_next::DecodeError::VectorTooLong {
30963 size: value.len() as u64,
30964 limit: 1024,
30965 });
30966 }
30967
30968 Ok(())
30969 }
30970
30971 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
30972 }
30973 })
30974 }
30975 }
30976
30977 impl<'de> OfferResolver<'de> {
30978 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30979 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
30980 }
30981
30982 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
30983 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
30984 }
30985
30986 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
30987 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
30988 }
30989
30990 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
30991 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
30992 }
30993
30994 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
30995 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
30996 }
30997 }
30998
30999 impl<'de> ::core::fmt::Debug for OfferResolver<'de> {
31000 fn fmt(
31001 &self,
31002 f: &mut ::core::fmt::Formatter<'_>,
31003 ) -> ::core::result::Result<(), ::core::fmt::Error> {
31004 f.debug_struct("OfferResolver")
31005 .field("source", &self.source())
31006 .field("source_name", &self.source_name())
31007 .field("target", &self.target())
31008 .field("target_name", &self.target_name())
31009 .field("source_dictionary", &self.source_dictionary())
31010 .finish()
31011 }
31012 }
31013
31014 impl<'de> ::fidl_next::IntoNatural for OfferResolver<'de> {
31015 type Natural = crate::natural::OfferResolver;
31016 }
31017
31018 impl ::fidl_next::Unconstrained for OfferResolver<'_> {}
31019
31020 #[repr(C)]
31022 pub struct OfferEventStream<'de> {
31023 pub(crate) table: ::fidl_next::WireTable<'de>,
31024 }
31025
31026 impl<'de> Drop for OfferEventStream<'de> {
31027 fn drop(&mut self) {
31028 let _ = self
31029 .table
31030 .get(1)
31031 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31032
31033 let _ = self.table.get(2).map(|envelope| unsafe {
31034 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
31035 });
31036
31037 let _ = self.table.get(3).map(|envelope| unsafe {
31038 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Ref<'de>>>()
31039 });
31040
31041 let _ = self
31042 .table
31043 .get(4)
31044 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31045
31046 let _ = self.table.get(5).map(|envelope| unsafe {
31047 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
31048 });
31049
31050 let _ = self
31051 .table
31052 .get(7)
31053 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
31054 }
31055 }
31056
31057 unsafe impl ::fidl_next::Wire for OfferEventStream<'static> {
31058 type Owned<'de> = OfferEventStream<'de>;
31059
31060 #[inline]
31061 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31062 ::fidl_next::munge!(let Self { table } = out);
31063 ::fidl_next::WireTable::zero_padding(table);
31064 }
31065 }
31066
31067 unsafe impl<___D> ::fidl_next::Decode<___D> for OfferEventStream<'static>
31068 where
31069 ___D: ::fidl_next::Decoder + ?Sized,
31070 {
31071 fn decode(
31072 slot: ::fidl_next::Slot<'_, Self>,
31073 decoder: &mut ___D,
31074 _: (),
31075 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
31076 ::fidl_next::munge!(let Self { table } = slot);
31077
31078 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
31079 match ordinal {
31080 0 => unsafe { ::core::hint::unreachable_unchecked() },
31081
31082 1 => {
31083 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
31084 slot.as_mut(),
31085 decoder,
31086 (),
31087 )?;
31088
31089 Ok(())
31090 }
31091
31092 2 => {
31093 ::fidl_next::WireEnvelope::decode_as::<
31094 ___D,
31095 ::fidl_next::WireString<'static>,
31096 >(slot.as_mut(), decoder, 100)?;
31097
31098 let value = unsafe {
31099 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
31100 };
31101
31102 if value.len() > 100 {
31103 return Err(::fidl_next::DecodeError::VectorTooLong {
31104 size: value.len() as u64,
31105 limit: 100,
31106 });
31107 }
31108
31109 Ok(())
31110 }
31111
31112 3 => {
31113 ::fidl_next::WireEnvelope::decode_as::<
31114 ___D,
31115 ::fidl_next::WireVector<'static, crate::wire::Ref<'static>>,
31116 >(slot.as_mut(), decoder, (4294967295, ()))?;
31117
31118 Ok(())
31119 }
31120
31121 4 => {
31122 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
31123 slot.as_mut(),
31124 decoder,
31125 (),
31126 )?;
31127
31128 Ok(())
31129 }
31130
31131 5 => {
31132 ::fidl_next::WireEnvelope::decode_as::<
31133 ___D,
31134 ::fidl_next::WireString<'static>,
31135 >(slot.as_mut(), decoder, 100)?;
31136
31137 let value = unsafe {
31138 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
31139 };
31140
31141 if value.len() > 100 {
31142 return Err(::fidl_next::DecodeError::VectorTooLong {
31143 size: value.len() as u64,
31144 limit: 100,
31145 });
31146 }
31147
31148 Ok(())
31149 }
31150
31151 7 => {
31152 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
31153 slot.as_mut(),
31154 decoder,
31155 (),
31156 )?;
31157
31158 Ok(())
31159 }
31160
31161 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
31162 }
31163 })
31164 }
31165 }
31166
31167 impl<'de> OfferEventStream<'de> {
31168 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31169 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
31170 }
31171
31172 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
31173 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
31174 }
31175
31176 pub fn scope(
31177 &self,
31178 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::wire::Ref<'de>>> {
31179 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
31180 }
31181
31182 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31183 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
31184 }
31185
31186 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
31187 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
31188 }
31189
31190 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
31191 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
31192 }
31193 }
31194
31195 impl<'de> ::core::fmt::Debug for OfferEventStream<'de> {
31196 fn fmt(
31197 &self,
31198 f: &mut ::core::fmt::Formatter<'_>,
31199 ) -> ::core::result::Result<(), ::core::fmt::Error> {
31200 f.debug_struct("OfferEventStream")
31201 .field("source", &self.source())
31202 .field("source_name", &self.source_name())
31203 .field("scope", &self.scope())
31204 .field("target", &self.target())
31205 .field("target_name", &self.target_name())
31206 .field("availability", &self.availability())
31207 .finish()
31208 }
31209 }
31210
31211 impl<'de> ::fidl_next::IntoNatural for OfferEventStream<'de> {
31212 type Natural = crate::natural::OfferEventStream;
31213 }
31214
31215 impl ::fidl_next::Unconstrained for OfferEventStream<'_> {}
31216
31217 #[repr(C)]
31219 pub struct OfferDictionary<'de> {
31220 pub(crate) table: ::fidl_next::WireTable<'de>,
31221 }
31222
31223 impl<'de> Drop for OfferDictionary<'de> {
31224 fn drop(&mut self) {
31225 let _ = self
31226 .table
31227 .get(1)
31228 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31229
31230 let _ = self.table.get(2).map(|envelope| unsafe {
31231 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
31232 });
31233
31234 let _ = self
31235 .table
31236 .get(3)
31237 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31238
31239 let _ = self.table.get(4).map(|envelope| unsafe {
31240 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
31241 });
31242
31243 let _ = self.table.get(5).map(|envelope| unsafe {
31244 envelope.read_unchecked::<crate::wire::DependencyType>()
31245 });
31246
31247 let _ = self
31248 .table
31249 .get(6)
31250 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
31251
31252 let _ = self.table.get(7).map(|envelope| unsafe {
31253 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
31254 });
31255 }
31256 }
31257
31258 unsafe impl ::fidl_next::Wire for OfferDictionary<'static> {
31259 type Owned<'de> = OfferDictionary<'de>;
31260
31261 #[inline]
31262 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31263 ::fidl_next::munge!(let Self { table } = out);
31264 ::fidl_next::WireTable::zero_padding(table);
31265 }
31266 }
31267
31268 unsafe impl<___D> ::fidl_next::Decode<___D> for OfferDictionary<'static>
31269 where
31270 ___D: ::fidl_next::Decoder + ?Sized,
31271 {
31272 fn decode(
31273 slot: ::fidl_next::Slot<'_, Self>,
31274 decoder: &mut ___D,
31275 _: (),
31276 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
31277 ::fidl_next::munge!(let Self { table } = slot);
31278
31279 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
31280 match ordinal {
31281 0 => unsafe { ::core::hint::unreachable_unchecked() },
31282
31283 1 => {
31284 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
31285 slot.as_mut(),
31286 decoder,
31287 (),
31288 )?;
31289
31290 Ok(())
31291 }
31292
31293 2 => {
31294 ::fidl_next::WireEnvelope::decode_as::<
31295 ___D,
31296 ::fidl_next::WireString<'static>,
31297 >(slot.as_mut(), decoder, 100)?;
31298
31299 let value = unsafe {
31300 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
31301 };
31302
31303 if value.len() > 100 {
31304 return Err(::fidl_next::DecodeError::VectorTooLong {
31305 size: value.len() as u64,
31306 limit: 100,
31307 });
31308 }
31309
31310 Ok(())
31311 }
31312
31313 3 => {
31314 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
31315 slot.as_mut(),
31316 decoder,
31317 (),
31318 )?;
31319
31320 Ok(())
31321 }
31322
31323 4 => {
31324 ::fidl_next::WireEnvelope::decode_as::<
31325 ___D,
31326 ::fidl_next::WireString<'static>,
31327 >(slot.as_mut(), decoder, 100)?;
31328
31329 let value = unsafe {
31330 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
31331 };
31332
31333 if value.len() > 100 {
31334 return Err(::fidl_next::DecodeError::VectorTooLong {
31335 size: value.len() as u64,
31336 limit: 100,
31337 });
31338 }
31339
31340 Ok(())
31341 }
31342
31343 5 => {
31344 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::DependencyType>(
31345 slot.as_mut(),
31346 decoder,
31347 (),
31348 )?;
31349
31350 Ok(())
31351 }
31352
31353 6 => {
31354 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
31355 slot.as_mut(),
31356 decoder,
31357 (),
31358 )?;
31359
31360 Ok(())
31361 }
31362
31363 7 => {
31364 ::fidl_next::WireEnvelope::decode_as::<
31365 ___D,
31366 ::fidl_next::WireString<'static>,
31367 >(slot.as_mut(), decoder, 1024)?;
31368
31369 let value = unsafe {
31370 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
31371 };
31372
31373 if value.len() > 1024 {
31374 return Err(::fidl_next::DecodeError::VectorTooLong {
31375 size: value.len() as u64,
31376 limit: 1024,
31377 });
31378 }
31379
31380 Ok(())
31381 }
31382
31383 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
31384 }
31385 })
31386 }
31387 }
31388
31389 impl<'de> OfferDictionary<'de> {
31390 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31391 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
31392 }
31393
31394 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
31395 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
31396 }
31397
31398 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31399 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
31400 }
31401
31402 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
31403 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
31404 }
31405
31406 pub fn dependency_type(&self) -> ::core::option::Option<&crate::wire::DependencyType> {
31407 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
31408 }
31409
31410 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
31411 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
31412 }
31413
31414 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
31415 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
31416 }
31417 }
31418
31419 impl<'de> ::core::fmt::Debug for OfferDictionary<'de> {
31420 fn fmt(
31421 &self,
31422 f: &mut ::core::fmt::Formatter<'_>,
31423 ) -> ::core::result::Result<(), ::core::fmt::Error> {
31424 f.debug_struct("OfferDictionary")
31425 .field("source", &self.source())
31426 .field("source_name", &self.source_name())
31427 .field("target", &self.target())
31428 .field("target_name", &self.target_name())
31429 .field("dependency_type", &self.dependency_type())
31430 .field("availability", &self.availability())
31431 .field("source_dictionary", &self.source_dictionary())
31432 .finish()
31433 }
31434 }
31435
31436 impl<'de> ::fidl_next::IntoNatural for OfferDictionary<'de> {
31437 type Natural = crate::natural::OfferDictionary;
31438 }
31439
31440 impl ::fidl_next::Unconstrained for OfferDictionary<'_> {}
31441
31442 #[repr(C)]
31444 pub struct OfferConfiguration<'de> {
31445 pub(crate) table: ::fidl_next::WireTable<'de>,
31446 }
31447
31448 impl<'de> Drop for OfferConfiguration<'de> {
31449 fn drop(&mut self) {
31450 let _ = self
31451 .table
31452 .get(1)
31453 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31454
31455 let _ = self.table.get(2).map(|envelope| unsafe {
31456 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
31457 });
31458
31459 let _ = self
31460 .table
31461 .get(3)
31462 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31463
31464 let _ = self.table.get(4).map(|envelope| unsafe {
31465 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
31466 });
31467
31468 let _ = self
31469 .table
31470 .get(5)
31471 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Availability>() });
31472
31473 let _ = self.table.get(6).map(|envelope| unsafe {
31474 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
31475 });
31476 }
31477 }
31478
31479 unsafe impl ::fidl_next::Wire for OfferConfiguration<'static> {
31480 type Owned<'de> = OfferConfiguration<'de>;
31481
31482 #[inline]
31483 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31484 ::fidl_next::munge!(let Self { table } = out);
31485 ::fidl_next::WireTable::zero_padding(table);
31486 }
31487 }
31488
31489 unsafe impl<___D> ::fidl_next::Decode<___D> for OfferConfiguration<'static>
31490 where
31491 ___D: ::fidl_next::Decoder + ?Sized,
31492 {
31493 fn decode(
31494 slot: ::fidl_next::Slot<'_, Self>,
31495 decoder: &mut ___D,
31496 _: (),
31497 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
31498 ::fidl_next::munge!(let Self { table } = slot);
31499
31500 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
31501 match ordinal {
31502 0 => unsafe { ::core::hint::unreachable_unchecked() },
31503
31504 1 => {
31505 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
31506 slot.as_mut(),
31507 decoder,
31508 (),
31509 )?;
31510
31511 Ok(())
31512 }
31513
31514 2 => {
31515 ::fidl_next::WireEnvelope::decode_as::<
31516 ___D,
31517 ::fidl_next::WireString<'static>,
31518 >(slot.as_mut(), decoder, 100)?;
31519
31520 let value = unsafe {
31521 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
31522 };
31523
31524 if value.len() > 100 {
31525 return Err(::fidl_next::DecodeError::VectorTooLong {
31526 size: value.len() as u64,
31527 limit: 100,
31528 });
31529 }
31530
31531 Ok(())
31532 }
31533
31534 3 => {
31535 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
31536 slot.as_mut(),
31537 decoder,
31538 (),
31539 )?;
31540
31541 Ok(())
31542 }
31543
31544 4 => {
31545 ::fidl_next::WireEnvelope::decode_as::<
31546 ___D,
31547 ::fidl_next::WireString<'static>,
31548 >(slot.as_mut(), decoder, 100)?;
31549
31550 let value = unsafe {
31551 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
31552 };
31553
31554 if value.len() > 100 {
31555 return Err(::fidl_next::DecodeError::VectorTooLong {
31556 size: value.len() as u64,
31557 limit: 100,
31558 });
31559 }
31560
31561 Ok(())
31562 }
31563
31564 5 => {
31565 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Availability>(
31566 slot.as_mut(),
31567 decoder,
31568 (),
31569 )?;
31570
31571 Ok(())
31572 }
31573
31574 6 => {
31575 ::fidl_next::WireEnvelope::decode_as::<
31576 ___D,
31577 ::fidl_next::WireString<'static>,
31578 >(slot.as_mut(), decoder, 1024)?;
31579
31580 let value = unsafe {
31581 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
31582 };
31583
31584 if value.len() > 1024 {
31585 return Err(::fidl_next::DecodeError::VectorTooLong {
31586 size: value.len() as u64,
31587 limit: 1024,
31588 });
31589 }
31590
31591 Ok(())
31592 }
31593
31594 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
31595 }
31596 })
31597 }
31598 }
31599
31600 impl<'de> OfferConfiguration<'de> {
31601 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31602 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
31603 }
31604
31605 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
31606 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
31607 }
31608
31609 pub fn target(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
31610 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
31611 }
31612
31613 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
31614 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
31615 }
31616
31617 pub fn availability(&self) -> ::core::option::Option<&crate::wire::Availability> {
31618 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
31619 }
31620
31621 pub fn source_dictionary(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
31622 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
31623 }
31624 }
31625
31626 impl<'de> ::core::fmt::Debug for OfferConfiguration<'de> {
31627 fn fmt(
31628 &self,
31629 f: &mut ::core::fmt::Formatter<'_>,
31630 ) -> ::core::result::Result<(), ::core::fmt::Error> {
31631 f.debug_struct("OfferConfiguration")
31632 .field("source", &self.source())
31633 .field("source_name", &self.source_name())
31634 .field("target", &self.target())
31635 .field("target_name", &self.target_name())
31636 .field("availability", &self.availability())
31637 .field("source_dictionary", &self.source_dictionary())
31638 .finish()
31639 }
31640 }
31641
31642 impl<'de> ::fidl_next::IntoNatural for OfferConfiguration<'de> {
31643 type Natural = crate::natural::OfferConfiguration;
31644 }
31645
31646 impl ::fidl_next::Unconstrained for OfferConfiguration<'_> {}
31647
31648 #[repr(transparent)]
31650 pub struct Offer<'de> {
31651 pub(crate) raw: ::fidl_next::RawWireUnion,
31652 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
31653 }
31654
31655 impl<'de> Drop for Offer<'de> {
31656 fn drop(&mut self) {
31657 match self.raw.ordinal() {
31658 1 => {
31659 let _ = unsafe {
31660 self.raw.get().read_unchecked::<crate::wire::OfferService<'de>>()
31661 };
31662 }
31663
31664 2 => {
31665 let _ = unsafe {
31666 self.raw.get().read_unchecked::<crate::wire::OfferProtocol<'de>>()
31667 };
31668 }
31669
31670 3 => {
31671 let _ = unsafe {
31672 self.raw.get().read_unchecked::<crate::wire::OfferDirectory<'de>>()
31673 };
31674 }
31675
31676 4 => {
31677 let _ = unsafe {
31678 self.raw.get().read_unchecked::<crate::wire::OfferStorage<'de>>()
31679 };
31680 }
31681
31682 5 => {
31683 let _ =
31684 unsafe { self.raw.get().read_unchecked::<crate::wire::OfferRunner<'de>>() };
31685 }
31686
31687 6 => {
31688 let _ = unsafe {
31689 self.raw.get().read_unchecked::<crate::wire::OfferResolver<'de>>()
31690 };
31691 }
31692
31693 8 => {
31694 let _ = unsafe {
31695 self.raw.get().read_unchecked::<crate::wire::OfferEventStream<'de>>()
31696 };
31697 }
31698
31699 9 => {
31700 let _ = unsafe {
31701 self.raw.get().read_unchecked::<crate::wire::OfferDictionary<'de>>()
31702 };
31703 }
31704
31705 10 => {
31706 let _ = unsafe {
31707 self.raw.get().read_unchecked::<crate::wire::OfferConfiguration<'de>>()
31708 };
31709 }
31710
31711 _ => (),
31712 }
31713 }
31714 }
31715
31716 unsafe impl ::fidl_next::Wire for Offer<'static> {
31717 type Owned<'de> = Offer<'de>;
31718
31719 #[inline]
31720 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31721 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
31722 ::fidl_next::RawWireUnion::zero_padding(raw);
31723 }
31724 }
31725
31726 pub mod offer {
31727 pub enum Ref<'de> {
31728 Service(&'de crate::wire::OfferService<'de>),
31729
31730 Protocol(&'de crate::wire::OfferProtocol<'de>),
31731
31732 Directory(&'de crate::wire::OfferDirectory<'de>),
31733
31734 Storage(&'de crate::wire::OfferStorage<'de>),
31735
31736 Runner(&'de crate::wire::OfferRunner<'de>),
31737
31738 Resolver(&'de crate::wire::OfferResolver<'de>),
31739
31740 EventStream(&'de crate::wire::OfferEventStream<'de>),
31741
31742 Dictionary(&'de crate::wire::OfferDictionary<'de>),
31743
31744 Config(&'de crate::wire::OfferConfiguration<'de>),
31745
31746 UnknownOrdinal_(u64),
31747 }
31748 }
31749
31750 impl<'de> Offer<'de> {
31751 pub fn as_ref(&self) -> crate::wire::offer::Ref<'_> {
31752 match self.raw.ordinal() {
31753 1 => crate::wire::offer::Ref::Service(unsafe {
31754 self.raw.get().deref_unchecked::<crate::wire::OfferService<'_>>()
31755 }),
31756
31757 2 => crate::wire::offer::Ref::Protocol(unsafe {
31758 self.raw.get().deref_unchecked::<crate::wire::OfferProtocol<'_>>()
31759 }),
31760
31761 3 => crate::wire::offer::Ref::Directory(unsafe {
31762 self.raw.get().deref_unchecked::<crate::wire::OfferDirectory<'_>>()
31763 }),
31764
31765 4 => crate::wire::offer::Ref::Storage(unsafe {
31766 self.raw.get().deref_unchecked::<crate::wire::OfferStorage<'_>>()
31767 }),
31768
31769 5 => crate::wire::offer::Ref::Runner(unsafe {
31770 self.raw.get().deref_unchecked::<crate::wire::OfferRunner<'_>>()
31771 }),
31772
31773 6 => crate::wire::offer::Ref::Resolver(unsafe {
31774 self.raw.get().deref_unchecked::<crate::wire::OfferResolver<'_>>()
31775 }),
31776
31777 8 => crate::wire::offer::Ref::EventStream(unsafe {
31778 self.raw.get().deref_unchecked::<crate::wire::OfferEventStream<'_>>()
31779 }),
31780
31781 9 => crate::wire::offer::Ref::Dictionary(unsafe {
31782 self.raw.get().deref_unchecked::<crate::wire::OfferDictionary<'_>>()
31783 }),
31784
31785 10 => crate::wire::offer::Ref::Config(unsafe {
31786 self.raw.get().deref_unchecked::<crate::wire::OfferConfiguration<'_>>()
31787 }),
31788
31789 unknown => crate::wire::offer::Ref::UnknownOrdinal_(unknown),
31790 }
31791 }
31792 }
31793
31794 unsafe impl<___D> ::fidl_next::Decode<___D> for Offer<'static>
31795 where
31796 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
31797 ___D: ::fidl_next::Decoder,
31798 {
31799 fn decode(
31800 mut slot: ::fidl_next::Slot<'_, Self>,
31801 decoder: &mut ___D,
31802 _: (),
31803 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
31804 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
31805 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
31806 1 => ::fidl_next::RawWireUnion::decode_as::<
31807 ___D,
31808 crate::wire::OfferService<'static>,
31809 >(raw, decoder, ())?,
31810
31811 2 => ::fidl_next::RawWireUnion::decode_as::<
31812 ___D,
31813 crate::wire::OfferProtocol<'static>,
31814 >(raw, decoder, ())?,
31815
31816 3 => ::fidl_next::RawWireUnion::decode_as::<
31817 ___D,
31818 crate::wire::OfferDirectory<'static>,
31819 >(raw, decoder, ())?,
31820
31821 4 => ::fidl_next::RawWireUnion::decode_as::<
31822 ___D,
31823 crate::wire::OfferStorage<'static>,
31824 >(raw, decoder, ())?,
31825
31826 5 => {
31827 ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::OfferRunner<'static>>(
31828 raw,
31829 decoder,
31830 (),
31831 )?
31832 }
31833
31834 6 => ::fidl_next::RawWireUnion::decode_as::<
31835 ___D,
31836 crate::wire::OfferResolver<'static>,
31837 >(raw, decoder, ())?,
31838
31839 8 => ::fidl_next::RawWireUnion::decode_as::<
31840 ___D,
31841 crate::wire::OfferEventStream<'static>,
31842 >(raw, decoder, ())?,
31843
31844 9 => ::fidl_next::RawWireUnion::decode_as::<
31845 ___D,
31846 crate::wire::OfferDictionary<'static>,
31847 >(raw, decoder, ())?,
31848
31849 10 => ::fidl_next::RawWireUnion::decode_as::<
31850 ___D,
31851 crate::wire::OfferConfiguration<'static>,
31852 >(raw, decoder, ())?,
31853
31854 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
31855 }
31856
31857 Ok(())
31858 }
31859 }
31860
31861 impl<'de> ::core::fmt::Debug for Offer<'de> {
31862 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
31863 match self.raw.ordinal() {
31864 1 => unsafe {
31865 self.raw.get().deref_unchecked::<crate::wire::OfferService<'_>>().fmt(f)
31866 },
31867 2 => unsafe {
31868 self.raw.get().deref_unchecked::<crate::wire::OfferProtocol<'_>>().fmt(f)
31869 },
31870 3 => unsafe {
31871 self.raw.get().deref_unchecked::<crate::wire::OfferDirectory<'_>>().fmt(f)
31872 },
31873 4 => unsafe {
31874 self.raw.get().deref_unchecked::<crate::wire::OfferStorage<'_>>().fmt(f)
31875 },
31876 5 => unsafe {
31877 self.raw.get().deref_unchecked::<crate::wire::OfferRunner<'_>>().fmt(f)
31878 },
31879 6 => unsafe {
31880 self.raw.get().deref_unchecked::<crate::wire::OfferResolver<'_>>().fmt(f)
31881 },
31882 8 => unsafe {
31883 self.raw.get().deref_unchecked::<crate::wire::OfferEventStream<'_>>().fmt(f)
31884 },
31885 9 => unsafe {
31886 self.raw.get().deref_unchecked::<crate::wire::OfferDictionary<'_>>().fmt(f)
31887 },
31888 10 => unsafe {
31889 self.raw.get().deref_unchecked::<crate::wire::OfferConfiguration<'_>>().fmt(f)
31890 },
31891 _ => unsafe { ::core::hint::unreachable_unchecked() },
31892 }
31893 }
31894 }
31895
31896 impl<'de> ::fidl_next::IntoNatural for Offer<'de> {
31897 type Natural = crate::natural::Offer;
31898 }
31899
31900 impl ::fidl_next::Unconstrained for Offer<'static> {}
31901
31902 #[repr(C)]
31904 pub struct RunnerRegistration<'de> {
31905 pub(crate) table: ::fidl_next::WireTable<'de>,
31906 }
31907
31908 impl<'de> Drop for RunnerRegistration<'de> {
31909 fn drop(&mut self) {
31910 let _ = self.table.get(1).map(|envelope| unsafe {
31911 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
31912 });
31913
31914 let _ = self
31915 .table
31916 .get(2)
31917 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
31918
31919 let _ = self.table.get(3).map(|envelope| unsafe {
31920 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
31921 });
31922 }
31923 }
31924
31925 unsafe impl ::fidl_next::Wire for RunnerRegistration<'static> {
31926 type Owned<'de> = RunnerRegistration<'de>;
31927
31928 #[inline]
31929 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
31930 ::fidl_next::munge!(let Self { table } = out);
31931 ::fidl_next::WireTable::zero_padding(table);
31932 }
31933 }
31934
31935 unsafe impl<___D> ::fidl_next::Decode<___D> for RunnerRegistration<'static>
31936 where
31937 ___D: ::fidl_next::Decoder + ?Sized,
31938 {
31939 fn decode(
31940 slot: ::fidl_next::Slot<'_, Self>,
31941 decoder: &mut ___D,
31942 _: (),
31943 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
31944 ::fidl_next::munge!(let Self { table } = slot);
31945
31946 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
31947 match ordinal {
31948 0 => unsafe { ::core::hint::unreachable_unchecked() },
31949
31950 1 => {
31951 ::fidl_next::WireEnvelope::decode_as::<
31952 ___D,
31953 ::fidl_next::WireString<'static>,
31954 >(slot.as_mut(), decoder, 100)?;
31955
31956 let value = unsafe {
31957 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
31958 };
31959
31960 if value.len() > 100 {
31961 return Err(::fidl_next::DecodeError::VectorTooLong {
31962 size: value.len() as u64,
31963 limit: 100,
31964 });
31965 }
31966
31967 Ok(())
31968 }
31969
31970 2 => {
31971 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
31972 slot.as_mut(),
31973 decoder,
31974 (),
31975 )?;
31976
31977 Ok(())
31978 }
31979
31980 3 => {
31981 ::fidl_next::WireEnvelope::decode_as::<
31982 ___D,
31983 ::fidl_next::WireString<'static>,
31984 >(slot.as_mut(), decoder, 100)?;
31985
31986 let value = unsafe {
31987 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
31988 };
31989
31990 if value.len() > 100 {
31991 return Err(::fidl_next::DecodeError::VectorTooLong {
31992 size: value.len() as u64,
31993 limit: 100,
31994 });
31995 }
31996
31997 Ok(())
31998 }
31999
32000 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
32001 }
32002 })
32003 }
32004 }
32005
32006 impl<'de> RunnerRegistration<'de> {
32007 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
32008 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
32009 }
32010
32011 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
32012 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
32013 }
32014
32015 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
32016 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
32017 }
32018 }
32019
32020 impl<'de> ::core::fmt::Debug for RunnerRegistration<'de> {
32021 fn fmt(
32022 &self,
32023 f: &mut ::core::fmt::Formatter<'_>,
32024 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32025 f.debug_struct("RunnerRegistration")
32026 .field("source_name", &self.source_name())
32027 .field("source", &self.source())
32028 .field("target_name", &self.target_name())
32029 .finish()
32030 }
32031 }
32032
32033 impl<'de> ::fidl_next::IntoNatural for RunnerRegistration<'de> {
32034 type Natural = crate::natural::RunnerRegistration;
32035 }
32036
32037 impl ::fidl_next::Unconstrained for RunnerRegistration<'_> {}
32038
32039 #[repr(C)]
32041 pub struct ResolverRegistration<'de> {
32042 pub(crate) table: ::fidl_next::WireTable<'de>,
32043 }
32044
32045 impl<'de> Drop for ResolverRegistration<'de> {
32046 fn drop(&mut self) {
32047 let _ = self.table.get(1).map(|envelope| unsafe {
32048 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
32049 });
32050
32051 let _ = self
32052 .table
32053 .get(2)
32054 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
32055
32056 let _ = self.table.get(3).map(|envelope| unsafe {
32057 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
32058 });
32059 }
32060 }
32061
32062 unsafe impl ::fidl_next::Wire for ResolverRegistration<'static> {
32063 type Owned<'de> = ResolverRegistration<'de>;
32064
32065 #[inline]
32066 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32067 ::fidl_next::munge!(let Self { table } = out);
32068 ::fidl_next::WireTable::zero_padding(table);
32069 }
32070 }
32071
32072 unsafe impl<___D> ::fidl_next::Decode<___D> for ResolverRegistration<'static>
32073 where
32074 ___D: ::fidl_next::Decoder + ?Sized,
32075 {
32076 fn decode(
32077 slot: ::fidl_next::Slot<'_, Self>,
32078 decoder: &mut ___D,
32079 _: (),
32080 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32081 ::fidl_next::munge!(let Self { table } = slot);
32082
32083 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32084 match ordinal {
32085 0 => unsafe { ::core::hint::unreachable_unchecked() },
32086
32087 1 => {
32088 ::fidl_next::WireEnvelope::decode_as::<
32089 ___D,
32090 ::fidl_next::WireString<'static>,
32091 >(slot.as_mut(), decoder, 100)?;
32092
32093 let value = unsafe {
32094 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
32095 };
32096
32097 if value.len() > 100 {
32098 return Err(::fidl_next::DecodeError::VectorTooLong {
32099 size: value.len() as u64,
32100 limit: 100,
32101 });
32102 }
32103
32104 Ok(())
32105 }
32106
32107 2 => {
32108 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
32109 slot.as_mut(),
32110 decoder,
32111 (),
32112 )?;
32113
32114 Ok(())
32115 }
32116
32117 3 => {
32118 ::fidl_next::WireEnvelope::decode_as::<
32119 ___D,
32120 ::fidl_next::WireString<'static>,
32121 >(slot.as_mut(), decoder, 100)?;
32122
32123 let value = unsafe {
32124 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
32125 };
32126
32127 if value.len() > 100 {
32128 return Err(::fidl_next::DecodeError::VectorTooLong {
32129 size: value.len() as u64,
32130 limit: 100,
32131 });
32132 }
32133
32134 Ok(())
32135 }
32136
32137 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
32138 }
32139 })
32140 }
32141 }
32142
32143 impl<'de> ResolverRegistration<'de> {
32144 pub fn resolver(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
32145 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
32146 }
32147
32148 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
32149 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
32150 }
32151
32152 pub fn scheme(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
32153 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
32154 }
32155 }
32156
32157 impl<'de> ::core::fmt::Debug for ResolverRegistration<'de> {
32158 fn fmt(
32159 &self,
32160 f: &mut ::core::fmt::Formatter<'_>,
32161 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32162 f.debug_struct("ResolverRegistration")
32163 .field("resolver", &self.resolver())
32164 .field("source", &self.source())
32165 .field("scheme", &self.scheme())
32166 .finish()
32167 }
32168 }
32169
32170 impl<'de> ::fidl_next::IntoNatural for ResolverRegistration<'de> {
32171 type Natural = crate::natural::ResolverRegistration;
32172 }
32173
32174 impl ::fidl_next::Unconstrained for ResolverRegistration<'_> {}
32175
32176 #[repr(C)]
32178 pub struct DebugProtocolRegistration<'de> {
32179 pub(crate) table: ::fidl_next::WireTable<'de>,
32180 }
32181
32182 impl<'de> Drop for DebugProtocolRegistration<'de> {
32183 fn drop(&mut self) {
32184 let _ = self
32185 .table
32186 .get(1)
32187 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Ref<'de>>() });
32188
32189 let _ = self.table.get(2).map(|envelope| unsafe {
32190 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
32191 });
32192
32193 let _ = self.table.get(3).map(|envelope| unsafe {
32194 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
32195 });
32196 }
32197 }
32198
32199 unsafe impl ::fidl_next::Wire for DebugProtocolRegistration<'static> {
32200 type Owned<'de> = DebugProtocolRegistration<'de>;
32201
32202 #[inline]
32203 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32204 ::fidl_next::munge!(let Self { table } = out);
32205 ::fidl_next::WireTable::zero_padding(table);
32206 }
32207 }
32208
32209 unsafe impl<___D> ::fidl_next::Decode<___D> for DebugProtocolRegistration<'static>
32210 where
32211 ___D: ::fidl_next::Decoder + ?Sized,
32212 {
32213 fn decode(
32214 slot: ::fidl_next::Slot<'_, Self>,
32215 decoder: &mut ___D,
32216 _: (),
32217 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32218 ::fidl_next::munge!(let Self { table } = slot);
32219
32220 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32221 match ordinal {
32222 0 => unsafe { ::core::hint::unreachable_unchecked() },
32223
32224 1 => {
32225 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Ref<'static>>(
32226 slot.as_mut(),
32227 decoder,
32228 (),
32229 )?;
32230
32231 Ok(())
32232 }
32233
32234 2 => {
32235 ::fidl_next::WireEnvelope::decode_as::<
32236 ___D,
32237 ::fidl_next::WireString<'static>,
32238 >(slot.as_mut(), decoder, 100)?;
32239
32240 let value = unsafe {
32241 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
32242 };
32243
32244 if value.len() > 100 {
32245 return Err(::fidl_next::DecodeError::VectorTooLong {
32246 size: value.len() as u64,
32247 limit: 100,
32248 });
32249 }
32250
32251 Ok(())
32252 }
32253
32254 3 => {
32255 ::fidl_next::WireEnvelope::decode_as::<
32256 ___D,
32257 ::fidl_next::WireString<'static>,
32258 >(slot.as_mut(), decoder, 100)?;
32259
32260 let value = unsafe {
32261 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
32262 };
32263
32264 if value.len() > 100 {
32265 return Err(::fidl_next::DecodeError::VectorTooLong {
32266 size: value.len() as u64,
32267 limit: 100,
32268 });
32269 }
32270
32271 Ok(())
32272 }
32273
32274 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
32275 }
32276 })
32277 }
32278 }
32279
32280 impl<'de> DebugProtocolRegistration<'de> {
32281 pub fn source(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
32282 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
32283 }
32284
32285 pub fn source_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
32286 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
32287 }
32288
32289 pub fn target_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
32290 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
32291 }
32292 }
32293
32294 impl<'de> ::core::fmt::Debug for DebugProtocolRegistration<'de> {
32295 fn fmt(
32296 &self,
32297 f: &mut ::core::fmt::Formatter<'_>,
32298 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32299 f.debug_struct("DebugProtocolRegistration")
32300 .field("source", &self.source())
32301 .field("source_name", &self.source_name())
32302 .field("target_name", &self.target_name())
32303 .finish()
32304 }
32305 }
32306
32307 impl<'de> ::fidl_next::IntoNatural for DebugProtocolRegistration<'de> {
32308 type Natural = crate::natural::DebugProtocolRegistration;
32309 }
32310
32311 impl ::fidl_next::Unconstrained for DebugProtocolRegistration<'_> {}
32312
32313 #[repr(transparent)]
32315 pub struct DebugRegistration<'de> {
32316 pub(crate) raw: ::fidl_next::RawWireUnion,
32317 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
32318 }
32319
32320 impl<'de> Drop for DebugRegistration<'de> {
32321 fn drop(&mut self) {
32322 match self.raw.ordinal() {
32323 1 => {
32324 let _ = unsafe {
32325 self.raw
32326 .get()
32327 .read_unchecked::<crate::wire::DebugProtocolRegistration<'de>>()
32328 };
32329 }
32330
32331 _ => (),
32332 }
32333 }
32334 }
32335
32336 unsafe impl ::fidl_next::Wire for DebugRegistration<'static> {
32337 type Owned<'de> = DebugRegistration<'de>;
32338
32339 #[inline]
32340 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32341 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
32342 ::fidl_next::RawWireUnion::zero_padding(raw);
32343 }
32344 }
32345
32346 pub mod debug_registration {
32347 pub enum Ref<'de> {
32348 Protocol(&'de crate::wire::DebugProtocolRegistration<'de>),
32349
32350 UnknownOrdinal_(u64),
32351 }
32352 }
32353
32354 impl<'de> DebugRegistration<'de> {
32355 pub fn as_ref(&self) -> crate::wire::debug_registration::Ref<'_> {
32356 match self.raw.ordinal() {
32357 1 => crate::wire::debug_registration::Ref::Protocol(unsafe {
32358 self.raw.get().deref_unchecked::<crate::wire::DebugProtocolRegistration<'_>>()
32359 }),
32360
32361 unknown => crate::wire::debug_registration::Ref::UnknownOrdinal_(unknown),
32362 }
32363 }
32364 }
32365
32366 unsafe impl<___D> ::fidl_next::Decode<___D> for DebugRegistration<'static>
32367 where
32368 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
32369 ___D: ::fidl_next::Decoder,
32370 {
32371 fn decode(
32372 mut slot: ::fidl_next::Slot<'_, Self>,
32373 decoder: &mut ___D,
32374 _: (),
32375 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32376 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
32377 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
32378 1 => ::fidl_next::RawWireUnion::decode_as::<
32379 ___D,
32380 crate::wire::DebugProtocolRegistration<'static>,
32381 >(raw, decoder, ())?,
32382
32383 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
32384 }
32385
32386 Ok(())
32387 }
32388 }
32389
32390 impl<'de> ::core::fmt::Debug for DebugRegistration<'de> {
32391 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
32392 match self.raw.ordinal() {
32393 1 => unsafe {
32394 self.raw
32395 .get()
32396 .deref_unchecked::<crate::wire::DebugProtocolRegistration<'_>>()
32397 .fmt(f)
32398 },
32399 _ => unsafe { ::core::hint::unreachable_unchecked() },
32400 }
32401 }
32402 }
32403
32404 impl<'de> ::fidl_next::IntoNatural for DebugRegistration<'de> {
32405 type Natural = crate::natural::DebugRegistration;
32406 }
32407
32408 impl ::fidl_next::Unconstrained for DebugRegistration<'static> {}
32409
32410 #[repr(C)]
32412 pub struct Environment<'de> {
32413 pub(crate) table: ::fidl_next::WireTable<'de>,
32414 }
32415
32416 impl<'de> Drop for Environment<'de> {
32417 fn drop(&mut self) {
32418 let _ = self.table.get(1).map(|envelope| unsafe {
32419 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
32420 });
32421
32422 let _ = self.table.get(2).map(|envelope| unsafe {
32423 envelope.read_unchecked::<crate::wire::EnvironmentExtends>()
32424 });
32425
32426 let _ = self.table.get(3)
32427 .map(|envelope| unsafe {
32428 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::RunnerRegistration<'de>>>()
32429 });
32430
32431 let _ = self.table.get(4)
32432 .map(|envelope| unsafe {
32433 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::ResolverRegistration<'de>>>()
32434 });
32435
32436 let _ = self.table.get(5)
32437 .map(|envelope| unsafe {
32438 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::DebugRegistration<'de>>>()
32439 });
32440
32441 let _ = self
32442 .table
32443 .get(6)
32444 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireU32>() });
32445 }
32446 }
32447
32448 unsafe impl ::fidl_next::Wire for Environment<'static> {
32449 type Owned<'de> = Environment<'de>;
32450
32451 #[inline]
32452 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32453 ::fidl_next::munge!(let Self { table } = out);
32454 ::fidl_next::WireTable::zero_padding(table);
32455 }
32456 }
32457
32458 unsafe impl<___D> ::fidl_next::Decode<___D> for Environment<'static>
32459 where
32460 ___D: ::fidl_next::Decoder + ?Sized,
32461 {
32462 fn decode(
32463 slot: ::fidl_next::Slot<'_, Self>,
32464 decoder: &mut ___D,
32465 _: (),
32466 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32467 ::fidl_next::munge!(let Self { table } = slot);
32468
32469 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32470 match ordinal {
32471 0 => unsafe { ::core::hint::unreachable_unchecked() },
32472
32473 1 => {
32474 ::fidl_next::WireEnvelope::decode_as::<
32475 ___D,
32476 ::fidl_next::WireString<'static>,
32477 >(slot.as_mut(), decoder, 100)?;
32478
32479 let value = unsafe {
32480 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
32481 };
32482
32483 if value.len() > 100 {
32484 return Err(::fidl_next::DecodeError::VectorTooLong {
32485 size: value.len() as u64,
32486 limit: 100,
32487 });
32488 }
32489
32490 Ok(())
32491 }
32492
32493 2 => {
32494 ::fidl_next::WireEnvelope::decode_as::<
32495 ___D,
32496 crate::wire::EnvironmentExtends,
32497 >(slot.as_mut(), decoder, ())?;
32498
32499 Ok(())
32500 }
32501
32502 3 => {
32503 ::fidl_next::WireEnvelope::decode_as::<
32504 ___D,
32505 ::fidl_next::WireVector<
32506 'static,
32507 crate::wire::RunnerRegistration<'static>,
32508 >,
32509 >(slot.as_mut(), decoder, (4294967295, ()))?;
32510
32511 Ok(())
32512 }
32513
32514 4 => {
32515 ::fidl_next::WireEnvelope::decode_as::<
32516 ___D,
32517 ::fidl_next::WireVector<
32518 'static,
32519 crate::wire::ResolverRegistration<'static>,
32520 >,
32521 >(slot.as_mut(), decoder, (4294967295, ()))?;
32522
32523 Ok(())
32524 }
32525
32526 5 => {
32527 ::fidl_next::WireEnvelope::decode_as::<
32528 ___D,
32529 ::fidl_next::WireVector<
32530 'static,
32531 crate::wire::DebugRegistration<'static>,
32532 >,
32533 >(slot.as_mut(), decoder, (4294967295, ()))?;
32534
32535 Ok(())
32536 }
32537
32538 6 => {
32539 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireU32>(
32540 slot.as_mut(),
32541 decoder,
32542 (),
32543 )?;
32544
32545 Ok(())
32546 }
32547
32548 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
32549 }
32550 })
32551 }
32552 }
32553
32554 impl<'de> Environment<'de> {
32555 pub fn name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
32556 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
32557 }
32558
32559 pub fn extends(&self) -> ::core::option::Option<&crate::wire::EnvironmentExtends> {
32560 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
32561 }
32562
32563 pub fn runners(
32564 &self,
32565 ) -> ::core::option::Option<
32566 &::fidl_next::WireVector<'de, crate::wire::RunnerRegistration<'de>>,
32567 > {
32568 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
32569 }
32570
32571 pub fn resolvers(
32572 &self,
32573 ) -> ::core::option::Option<
32574 &::fidl_next::WireVector<'de, crate::wire::ResolverRegistration<'de>>,
32575 > {
32576 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
32577 }
32578
32579 pub fn debug_capabilities(
32580 &self,
32581 ) -> ::core::option::Option<
32582 &::fidl_next::WireVector<'de, crate::wire::DebugRegistration<'de>>,
32583 > {
32584 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
32585 }
32586
32587 pub fn stop_timeout_ms(&self) -> ::core::option::Option<&::fidl_next::WireU32> {
32588 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
32589 }
32590 }
32591
32592 impl<'de> ::core::fmt::Debug for Environment<'de> {
32593 fn fmt(
32594 &self,
32595 f: &mut ::core::fmt::Formatter<'_>,
32596 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32597 f.debug_struct("Environment")
32598 .field("name", &self.name())
32599 .field("extends", &self.extends())
32600 .field("runners", &self.runners())
32601 .field("resolvers", &self.resolvers())
32602 .field("debug_capabilities", &self.debug_capabilities())
32603 .field("stop_timeout_ms", &self.stop_timeout_ms())
32604 .finish()
32605 }
32606 }
32607
32608 impl<'de> ::fidl_next::IntoNatural for Environment<'de> {
32609 type Natural = crate::natural::Environment;
32610 }
32611
32612 impl ::fidl_next::Unconstrained for Environment<'_> {}
32613
32614 #[repr(C)]
32616 pub struct ConfigSourceCapabilities<'de> {
32617 pub(crate) table: ::fidl_next::WireTable<'de>,
32618 }
32619
32620 impl<'de> Drop for ConfigSourceCapabilities<'de> {
32621 fn drop(&mut self) {}
32622 }
32623
32624 unsafe impl ::fidl_next::Wire for ConfigSourceCapabilities<'static> {
32625 type Owned<'de> = ConfigSourceCapabilities<'de>;
32626
32627 #[inline]
32628 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32629 ::fidl_next::munge!(let Self { table } = out);
32630 ::fidl_next::WireTable::zero_padding(table);
32631 }
32632 }
32633
32634 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigSourceCapabilities<'static>
32635 where
32636 ___D: ::fidl_next::Decoder + ?Sized,
32637 {
32638 fn decode(
32639 slot: ::fidl_next::Slot<'_, Self>,
32640 decoder: &mut ___D,
32641 _: (),
32642 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32643 ::fidl_next::munge!(let Self { table } = slot);
32644
32645 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32646 match ordinal {
32647 0 => unsafe { ::core::hint::unreachable_unchecked() },
32648
32649 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
32650 }
32651 })
32652 }
32653 }
32654
32655 impl<'de> ConfigSourceCapabilities<'de> {}
32656
32657 impl<'de> ::core::fmt::Debug for ConfigSourceCapabilities<'de> {
32658 fn fmt(
32659 &self,
32660 f: &mut ::core::fmt::Formatter<'_>,
32661 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32662 f.debug_struct("ConfigSourceCapabilities").finish()
32663 }
32664 }
32665
32666 impl<'de> ::fidl_next::IntoNatural for ConfigSourceCapabilities<'de> {
32667 type Natural = crate::natural::ConfigSourceCapabilities;
32668 }
32669
32670 impl ::fidl_next::Unconstrained for ConfigSourceCapabilities<'_> {}
32671
32672 #[repr(transparent)]
32674 pub struct ConfigValueSource<'de> {
32675 pub(crate) raw: ::fidl_next::RawWireUnion,
32676 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
32677 }
32678
32679 impl<'de> Drop for ConfigValueSource<'de> {
32680 fn drop(&mut self) {
32681 match self.raw.ordinal() {
32682 1 => {
32683 let _ =
32684 unsafe { self.raw.get().read_unchecked::<::fidl_next::WireString<'de>>() };
32685 }
32686
32687 2 => {
32688 let _ = unsafe {
32689 self.raw
32690 .get()
32691 .read_unchecked::<crate::wire::ConfigSourceCapabilities<'de>>()
32692 };
32693 }
32694
32695 _ => (),
32696 }
32697 }
32698 }
32699
32700 unsafe impl ::fidl_next::Wire for ConfigValueSource<'static> {
32701 type Owned<'de> = ConfigValueSource<'de>;
32702
32703 #[inline]
32704 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32705 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
32706 ::fidl_next::RawWireUnion::zero_padding(raw);
32707 }
32708 }
32709
32710 pub mod config_value_source {
32711 pub enum Ref<'de> {
32712 PackagePath(&'de ::fidl_next::WireString<'de>),
32713
32714 Capabilities(&'de crate::wire::ConfigSourceCapabilities<'de>),
32715
32716 UnknownOrdinal_(u64),
32717 }
32718 }
32719
32720 impl<'de> ConfigValueSource<'de> {
32721 pub fn as_ref(&self) -> crate::wire::config_value_source::Ref<'_> {
32722 match self.raw.ordinal() {
32723 1 => crate::wire::config_value_source::Ref::PackagePath(unsafe {
32724 self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>()
32725 }),
32726
32727 2 => crate::wire::config_value_source::Ref::Capabilities(unsafe {
32728 self.raw.get().deref_unchecked::<crate::wire::ConfigSourceCapabilities<'_>>()
32729 }),
32730
32731 unknown => crate::wire::config_value_source::Ref::UnknownOrdinal_(unknown),
32732 }
32733 }
32734 }
32735
32736 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigValueSource<'static>
32737 where
32738 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
32739 ___D: ::fidl_next::Decoder,
32740 {
32741 fn decode(
32742 mut slot: ::fidl_next::Slot<'_, Self>,
32743 decoder: &mut ___D,
32744 _: (),
32745 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32746 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
32747 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
32748 1 => {
32749 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
32750 raw, decoder, 4294967295,
32751 )?
32752 }
32753
32754 2 => ::fidl_next::RawWireUnion::decode_as::<
32755 ___D,
32756 crate::wire::ConfigSourceCapabilities<'static>,
32757 >(raw, decoder, ())?,
32758
32759 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
32760 }
32761
32762 Ok(())
32763 }
32764 }
32765
32766 impl<'de> ::core::fmt::Debug for ConfigValueSource<'de> {
32767 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
32768 match self.raw.ordinal() {
32769 1 => unsafe {
32770 self.raw.get().deref_unchecked::<::fidl_next::WireString<'_>>().fmt(f)
32771 },
32772 2 => unsafe {
32773 self.raw
32774 .get()
32775 .deref_unchecked::<crate::wire::ConfigSourceCapabilities<'_>>()
32776 .fmt(f)
32777 },
32778 _ => unsafe { ::core::hint::unreachable_unchecked() },
32779 }
32780 }
32781 }
32782
32783 impl<'de> ::fidl_next::IntoNatural for ConfigValueSource<'de> {
32784 type Natural = crate::natural::ConfigValueSource;
32785 }
32786
32787 impl ::fidl_next::Unconstrained for ConfigValueSource<'static> {}
32788
32789 #[repr(C)]
32791 pub struct ConfigSchema<'de> {
32792 pub(crate) table: ::fidl_next::WireTable<'de>,
32793 }
32794
32795 impl<'de> Drop for ConfigSchema<'de> {
32796 fn drop(&mut self) {
32797 let _ = self.table.get(1)
32798 .map(|envelope| unsafe {
32799 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::ConfigField<'de>>>()
32800 });
32801
32802 let _ = self.table.get(2).map(|envelope| unsafe {
32803 envelope.read_unchecked::<crate::wire::ConfigChecksum<'de>>()
32804 });
32805
32806 let _ = self.table.get(3).map(|envelope| unsafe {
32807 envelope.read_unchecked::<crate::wire::ConfigValueSource<'de>>()
32808 });
32809 }
32810 }
32811
32812 unsafe impl ::fidl_next::Wire for ConfigSchema<'static> {
32813 type Owned<'de> = ConfigSchema<'de>;
32814
32815 #[inline]
32816 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32817 ::fidl_next::munge!(let Self { table } = out);
32818 ::fidl_next::WireTable::zero_padding(table);
32819 }
32820 }
32821
32822 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigSchema<'static>
32823 where
32824 ___D: ::fidl_next::Decoder + ?Sized,
32825 {
32826 fn decode(
32827 slot: ::fidl_next::Slot<'_, Self>,
32828 decoder: &mut ___D,
32829 _: (),
32830 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32831 ::fidl_next::munge!(let Self { table } = slot);
32832
32833 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32834 match ordinal {
32835 0 => unsafe { ::core::hint::unreachable_unchecked() },
32836
32837 1 => {
32838 ::fidl_next::WireEnvelope::decode_as::<
32839 ___D,
32840 ::fidl_next::WireVector<'static, crate::wire::ConfigField<'static>>,
32841 >(slot.as_mut(), decoder, (4294967295, ()))?;
32842
32843 Ok(())
32844 }
32845
32846 2 => {
32847 ::fidl_next::WireEnvelope::decode_as::<
32848 ___D,
32849 crate::wire::ConfigChecksum<'static>,
32850 >(slot.as_mut(), decoder, ())?;
32851
32852 Ok(())
32853 }
32854
32855 3 => {
32856 ::fidl_next::WireEnvelope::decode_as::<
32857 ___D,
32858 crate::wire::ConfigValueSource<'static>,
32859 >(slot.as_mut(), decoder, ())?;
32860
32861 Ok(())
32862 }
32863
32864 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
32865 }
32866 })
32867 }
32868 }
32869
32870 impl<'de> ConfigSchema<'de> {
32871 pub fn fields(
32872 &self,
32873 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::wire::ConfigField<'de>>>
32874 {
32875 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
32876 }
32877
32878 pub fn checksum(&self) -> ::core::option::Option<&crate::wire::ConfigChecksum<'de>> {
32879 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
32880 }
32881
32882 pub fn value_source(&self) -> ::core::option::Option<&crate::wire::ConfigValueSource<'de>> {
32883 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
32884 }
32885 }
32886
32887 impl<'de> ::core::fmt::Debug for ConfigSchema<'de> {
32888 fn fmt(
32889 &self,
32890 f: &mut ::core::fmt::Formatter<'_>,
32891 ) -> ::core::result::Result<(), ::core::fmt::Error> {
32892 f.debug_struct("ConfigSchema")
32893 .field("fields", &self.fields())
32894 .field("checksum", &self.checksum())
32895 .field("value_source", &self.value_source())
32896 .finish()
32897 }
32898 }
32899
32900 impl<'de> ::fidl_next::IntoNatural for ConfigSchema<'de> {
32901 type Natural = crate::natural::ConfigSchema;
32902 }
32903
32904 impl ::fidl_next::Unconstrained for ConfigSchema<'_> {}
32905
32906 #[repr(C)]
32908 pub struct Component<'de> {
32909 pub(crate) table: ::fidl_next::WireTable<'de>,
32910 }
32911
32912 impl<'de> Drop for Component<'de> {
32913 fn drop(&mut self) {
32914 let _ = self
32915 .table
32916 .get(1)
32917 .map(|envelope| unsafe { envelope.read_unchecked::<crate::wire::Program<'de>>() });
32918
32919 let _ = self.table.get(2).map(|envelope| unsafe {
32920 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Use<'de>>>()
32921 });
32922
32923 let _ = self.table.get(3).map(|envelope| unsafe {
32924 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Expose<'de>>>()
32925 });
32926
32927 let _ = self.table.get(4).map(|envelope| unsafe {
32928 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Offer<'de>>>()
32929 });
32930
32931 let _ = self.table.get(5)
32932 .map(|envelope| unsafe {
32933 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Capability<'de>>>()
32934 });
32935
32936 let _ = self.table.get(6).map(|envelope| unsafe {
32937 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Child<'de>>>()
32938 });
32939
32940 let _ = self.table.get(7)
32941 .map(|envelope| unsafe {
32942 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Collection<'de>>>()
32943 });
32944
32945 let _ = self.table.get(8)
32946 .map(|envelope| unsafe {
32947 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::Environment<'de>>>()
32948 });
32949
32950 let _ = self.table.get(9).map(|envelope| unsafe {
32951 envelope.read_unchecked::<::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>()
32952 });
32953
32954 let _ = self.table.get(10).map(|envelope| unsafe {
32955 envelope.read_unchecked::<crate::wire::ConfigSchema<'de>>()
32956 });
32957 }
32958 }
32959
32960 unsafe impl ::fidl_next::Wire for Component<'static> {
32961 type Owned<'de> = Component<'de>;
32962
32963 #[inline]
32964 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
32965 ::fidl_next::munge!(let Self { table } = out);
32966 ::fidl_next::WireTable::zero_padding(table);
32967 }
32968 }
32969
32970 unsafe impl<___D> ::fidl_next::Decode<___D> for Component<'static>
32971 where
32972 ___D: ::fidl_next::Decoder + ?Sized,
32973 {
32974 fn decode(
32975 slot: ::fidl_next::Slot<'_, Self>,
32976 decoder: &mut ___D,
32977 _: (),
32978 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
32979 ::fidl_next::munge!(let Self { table } = slot);
32980
32981 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
32982 match ordinal {
32983 0 => unsafe { ::core::hint::unreachable_unchecked() },
32984
32985 1 => {
32986 ::fidl_next::WireEnvelope::decode_as::<___D, crate::wire::Program<'static>>(
32987 slot.as_mut(),
32988 decoder,
32989 (),
32990 )?;
32991
32992 Ok(())
32993 }
32994
32995 2 => {
32996 ::fidl_next::WireEnvelope::decode_as::<
32997 ___D,
32998 ::fidl_next::WireVector<'static, crate::wire::Use<'static>>,
32999 >(slot.as_mut(), decoder, (4294967295, ()))?;
33000
33001 Ok(())
33002 }
33003
33004 3 => {
33005 ::fidl_next::WireEnvelope::decode_as::<
33006 ___D,
33007 ::fidl_next::WireVector<'static, crate::wire::Expose<'static>>,
33008 >(slot.as_mut(), decoder, (4294967295, ()))?;
33009
33010 Ok(())
33011 }
33012
33013 4 => {
33014 ::fidl_next::WireEnvelope::decode_as::<
33015 ___D,
33016 ::fidl_next::WireVector<'static, crate::wire::Offer<'static>>,
33017 >(slot.as_mut(), decoder, (4294967295, ()))?;
33018
33019 Ok(())
33020 }
33021
33022 5 => {
33023 ::fidl_next::WireEnvelope::decode_as::<
33024 ___D,
33025 ::fidl_next::WireVector<'static, crate::wire::Capability<'static>>,
33026 >(slot.as_mut(), decoder, (4294967295, ()))?;
33027
33028 Ok(())
33029 }
33030
33031 6 => {
33032 ::fidl_next::WireEnvelope::decode_as::<
33033 ___D,
33034 ::fidl_next::WireVector<'static, crate::wire::Child<'static>>,
33035 >(slot.as_mut(), decoder, (4294967295, ()))?;
33036
33037 Ok(())
33038 }
33039
33040 7 => {
33041 ::fidl_next::WireEnvelope::decode_as::<
33042 ___D,
33043 ::fidl_next::WireVector<'static, crate::wire::Collection<'static>>,
33044 >(slot.as_mut(), decoder, (4294967295, ()))?;
33045
33046 Ok(())
33047 }
33048
33049 8 => {
33050 ::fidl_next::WireEnvelope::decode_as::<
33051 ___D,
33052 ::fidl_next::WireVector<'static, crate::wire::Environment<'static>>,
33053 >(slot.as_mut(), decoder, (4294967295, ()))?;
33054
33055 Ok(())
33056 }
33057
33058 9 => {
33059 ::fidl_next::WireEnvelope::decode_as::<
33060 ___D,
33061 ::fidl_next_common_fuchsia_data::wire::Dictionary<'static>,
33062 >(slot.as_mut(), decoder, ())?;
33063
33064 Ok(())
33065 }
33066
33067 10 => {
33068 ::fidl_next::WireEnvelope::decode_as::<
33069 ___D,
33070 crate::wire::ConfigSchema<'static>,
33071 >(slot.as_mut(), decoder, ())?;
33072
33073 Ok(())
33074 }
33075
33076 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
33077 }
33078 })
33079 }
33080 }
33081
33082 impl<'de> Component<'de> {
33083 pub fn program(&self) -> ::core::option::Option<&crate::wire::Program<'de>> {
33084 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
33085 }
33086
33087 pub fn uses(
33088 &self,
33089 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::wire::Use<'de>>> {
33090 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
33091 }
33092
33093 pub fn exposes(
33094 &self,
33095 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::wire::Expose<'de>>>
33096 {
33097 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
33098 }
33099
33100 pub fn offers(
33101 &self,
33102 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::wire::Offer<'de>>>
33103 {
33104 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
33105 }
33106
33107 pub fn capabilities(
33108 &self,
33109 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::wire::Capability<'de>>>
33110 {
33111 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
33112 }
33113
33114 pub fn children(
33115 &self,
33116 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::wire::Child<'de>>>
33117 {
33118 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
33119 }
33120
33121 pub fn collections(
33122 &self,
33123 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::wire::Collection<'de>>>
33124 {
33125 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
33126 }
33127
33128 pub fn environments(
33129 &self,
33130 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::wire::Environment<'de>>>
33131 {
33132 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
33133 }
33134
33135 pub fn facets(
33136 &self,
33137 ) -> ::core::option::Option<&::fidl_next_common_fuchsia_data::wire::Dictionary<'de>>
33138 {
33139 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
33140 }
33141
33142 pub fn config(&self) -> ::core::option::Option<&crate::wire::ConfigSchema<'de>> {
33143 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
33144 }
33145 }
33146
33147 impl<'de> ::core::fmt::Debug for Component<'de> {
33148 fn fmt(
33149 &self,
33150 f: &mut ::core::fmt::Formatter<'_>,
33151 ) -> ::core::result::Result<(), ::core::fmt::Error> {
33152 f.debug_struct("Component")
33153 .field("program", &self.program())
33154 .field("uses", &self.uses())
33155 .field("exposes", &self.exposes())
33156 .field("offers", &self.offers())
33157 .field("capabilities", &self.capabilities())
33158 .field("children", &self.children())
33159 .field("collections", &self.collections())
33160 .field("environments", &self.environments())
33161 .field("facets", &self.facets())
33162 .field("config", &self.config())
33163 .finish()
33164 }
33165 }
33166
33167 impl<'de> ::fidl_next::IntoNatural for Component<'de> {
33168 type Natural = crate::natural::Component;
33169 }
33170
33171 impl ::fidl_next::Unconstrained for Component<'_> {}
33172
33173 #[repr(C)]
33175 pub struct ConfigValueSpec<'de> {
33176 pub(crate) table: ::fidl_next::WireTable<'de>,
33177 }
33178
33179 impl<'de> Drop for ConfigValueSpec<'de> {
33180 fn drop(&mut self) {
33181 let _ = self.table.get(1).map(|envelope| unsafe {
33182 envelope.read_unchecked::<crate::wire::ConfigValue<'de>>()
33183 });
33184 }
33185 }
33186
33187 unsafe impl ::fidl_next::Wire for ConfigValueSpec<'static> {
33188 type Owned<'de> = ConfigValueSpec<'de>;
33189
33190 #[inline]
33191 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33192 ::fidl_next::munge!(let Self { table } = out);
33193 ::fidl_next::WireTable::zero_padding(table);
33194 }
33195 }
33196
33197 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigValueSpec<'static>
33198 where
33199 ___D: ::fidl_next::Decoder + ?Sized,
33200 {
33201 fn decode(
33202 slot: ::fidl_next::Slot<'_, Self>,
33203 decoder: &mut ___D,
33204 _: (),
33205 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33206 ::fidl_next::munge!(let Self { table } = slot);
33207
33208 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
33209 match ordinal {
33210 0 => unsafe { ::core::hint::unreachable_unchecked() },
33211
33212 1 => {
33213 ::fidl_next::WireEnvelope::decode_as::<
33214 ___D,
33215 crate::wire::ConfigValue<'static>,
33216 >(slot.as_mut(), decoder, ())?;
33217
33218 Ok(())
33219 }
33220
33221 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
33222 }
33223 })
33224 }
33225 }
33226
33227 impl<'de> ConfigValueSpec<'de> {
33228 pub fn value(&self) -> ::core::option::Option<&crate::wire::ConfigValue<'de>> {
33229 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
33230 }
33231 }
33232
33233 impl<'de> ::core::fmt::Debug for ConfigValueSpec<'de> {
33234 fn fmt(
33235 &self,
33236 f: &mut ::core::fmt::Formatter<'_>,
33237 ) -> ::core::result::Result<(), ::core::fmt::Error> {
33238 f.debug_struct("ConfigValueSpec").field("value", &self.value()).finish()
33239 }
33240 }
33241
33242 impl<'de> ::fidl_next::IntoNatural for ConfigValueSpec<'de> {
33243 type Natural = crate::natural::ConfigValueSpec;
33244 }
33245
33246 impl ::fidl_next::Unconstrained for ConfigValueSpec<'_> {}
33247
33248 #[repr(C)]
33250 pub struct ConfigValuesData<'de> {
33251 pub(crate) table: ::fidl_next::WireTable<'de>,
33252 }
33253
33254 impl<'de> Drop for ConfigValuesData<'de> {
33255 fn drop(&mut self) {
33256 let _ = self.table.get(1)
33257 .map(|envelope| unsafe {
33258 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::wire::ConfigValueSpec<'de>>>()
33259 });
33260
33261 let _ = self.table.get(2).map(|envelope| unsafe {
33262 envelope.read_unchecked::<crate::wire::ConfigChecksum<'de>>()
33263 });
33264 }
33265 }
33266
33267 unsafe impl ::fidl_next::Wire for ConfigValuesData<'static> {
33268 type Owned<'de> = ConfigValuesData<'de>;
33269
33270 #[inline]
33271 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33272 ::fidl_next::munge!(let Self { table } = out);
33273 ::fidl_next::WireTable::zero_padding(table);
33274 }
33275 }
33276
33277 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigValuesData<'static>
33278 where
33279 ___D: ::fidl_next::Decoder + ?Sized,
33280 {
33281 fn decode(
33282 slot: ::fidl_next::Slot<'_, Self>,
33283 decoder: &mut ___D,
33284 _: (),
33285 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33286 ::fidl_next::munge!(let Self { table } = slot);
33287
33288 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
33289 match ordinal {
33290 0 => unsafe { ::core::hint::unreachable_unchecked() },
33291
33292 1 => {
33293 ::fidl_next::WireEnvelope::decode_as::<
33294 ___D,
33295 ::fidl_next::WireVector<'static, crate::wire::ConfigValueSpec<'static>>,
33296 >(slot.as_mut(), decoder, (4294967295, ()))?;
33297
33298 Ok(())
33299 }
33300
33301 2 => {
33302 ::fidl_next::WireEnvelope::decode_as::<
33303 ___D,
33304 crate::wire::ConfigChecksum<'static>,
33305 >(slot.as_mut(), decoder, ())?;
33306
33307 Ok(())
33308 }
33309
33310 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
33311 }
33312 })
33313 }
33314 }
33315
33316 impl<'de> ConfigValuesData<'de> {
33317 pub fn values(
33318 &self,
33319 ) -> ::core::option::Option<&::fidl_next::WireVector<'de, crate::wire::ConfigValueSpec<'de>>>
33320 {
33321 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
33322 }
33323
33324 pub fn checksum(&self) -> ::core::option::Option<&crate::wire::ConfigChecksum<'de>> {
33325 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
33326 }
33327 }
33328
33329 impl<'de> ::core::fmt::Debug for ConfigValuesData<'de> {
33330 fn fmt(
33331 &self,
33332 f: &mut ::core::fmt::Formatter<'_>,
33333 ) -> ::core::result::Result<(), ::core::fmt::Error> {
33334 f.debug_struct("ConfigValuesData")
33335 .field("values", &self.values())
33336 .field("checksum", &self.checksum())
33337 .finish()
33338 }
33339 }
33340
33341 impl<'de> ::fidl_next::IntoNatural for ConfigValuesData<'de> {
33342 type Natural = crate::natural::ConfigValuesData;
33343 }
33344
33345 impl ::fidl_next::Unconstrained for ConfigValuesData<'_> {}
33346
33347 #[repr(C)]
33349 pub struct EventSubscription<'de> {
33350 pub(crate) table: ::fidl_next::WireTable<'de>,
33351 }
33352
33353 impl<'de> Drop for EventSubscription<'de> {
33354 fn drop(&mut self) {
33355 let _ = self.table.get(1).map(|envelope| unsafe {
33356 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
33357 });
33358 }
33359 }
33360
33361 unsafe impl ::fidl_next::Wire for EventSubscription<'static> {
33362 type Owned<'de> = EventSubscription<'de>;
33363
33364 #[inline]
33365 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33366 ::fidl_next::munge!(let Self { table } = out);
33367 ::fidl_next::WireTable::zero_padding(table);
33368 }
33369 }
33370
33371 unsafe impl<___D> ::fidl_next::Decode<___D> for EventSubscription<'static>
33372 where
33373 ___D: ::fidl_next::Decoder + ?Sized,
33374 {
33375 fn decode(
33376 slot: ::fidl_next::Slot<'_, Self>,
33377 decoder: &mut ___D,
33378 _: (),
33379 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33380 ::fidl_next::munge!(let Self { table } = slot);
33381
33382 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
33383 match ordinal {
33384 0 => unsafe { ::core::hint::unreachable_unchecked() },
33385
33386 1 => {
33387 ::fidl_next::WireEnvelope::decode_as::<
33388 ___D,
33389 ::fidl_next::WireString<'static>,
33390 >(slot.as_mut(), decoder, 100)?;
33391
33392 let value = unsafe {
33393 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
33394 };
33395
33396 if value.len() > 100 {
33397 return Err(::fidl_next::DecodeError::VectorTooLong {
33398 size: value.len() as u64,
33399 limit: 100,
33400 });
33401 }
33402
33403 Ok(())
33404 }
33405
33406 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
33407 }
33408 })
33409 }
33410 }
33411
33412 impl<'de> EventSubscription<'de> {
33413 pub fn event_name(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
33414 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
33415 }
33416 }
33417
33418 impl<'de> ::core::fmt::Debug for EventSubscription<'de> {
33419 fn fmt(
33420 &self,
33421 f: &mut ::core::fmt::Formatter<'_>,
33422 ) -> ::core::result::Result<(), ::core::fmt::Error> {
33423 f.debug_struct("EventSubscription").field("event_name", &self.event_name()).finish()
33424 }
33425 }
33426
33427 impl<'de> ::fidl_next::IntoNatural for EventSubscription<'de> {
33428 type Natural = crate::natural::EventSubscription;
33429 }
33430
33431 impl ::fidl_next::Unconstrained for EventSubscription<'_> {}
33432
33433 #[repr(transparent)]
33435 pub struct LayoutParameter<'de> {
33436 pub(crate) raw: ::fidl_next::RawWireUnion,
33437 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
33438 }
33439
33440 impl<'de> Drop for LayoutParameter<'de> {
33441 fn drop(&mut self) {
33442 match self.raw.ordinal() {
33443 1 => {
33444 let _ =
33445 unsafe { self.raw.get().read_unchecked::<crate::wire::ConfigType<'de>>() };
33446 }
33447
33448 _ => (),
33449 }
33450 }
33451 }
33452
33453 unsafe impl ::fidl_next::Wire for LayoutParameter<'static> {
33454 type Owned<'de> = LayoutParameter<'de>;
33455
33456 #[inline]
33457 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33458 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
33459 ::fidl_next::RawWireUnion::zero_padding(raw);
33460 }
33461 }
33462
33463 pub mod layout_parameter {
33464 pub enum Ref<'de> {
33465 NestedType(&'de crate::wire::ConfigType<'de>),
33466
33467 UnknownOrdinal_(u64),
33468 }
33469 }
33470
33471 impl<'de> LayoutParameter<'de> {
33472 pub fn as_ref(&self) -> crate::wire::layout_parameter::Ref<'_> {
33473 match self.raw.ordinal() {
33474 1 => crate::wire::layout_parameter::Ref::NestedType(unsafe {
33475 self.raw.get().deref_unchecked::<crate::wire::ConfigType<'_>>()
33476 }),
33477
33478 unknown => crate::wire::layout_parameter::Ref::UnknownOrdinal_(unknown),
33479 }
33480 }
33481 }
33482
33483 unsafe impl<___D> ::fidl_next::Decode<___D> for LayoutParameter<'static>
33484 where
33485 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
33486 ___D: ::fidl_next::Decoder,
33487 {
33488 fn decode(
33489 mut slot: ::fidl_next::Slot<'_, Self>,
33490 decoder: &mut ___D,
33491 _: (),
33492 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33493 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
33494 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
33495 1 => {
33496 ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::ConfigType<'static>>(
33497 raw,
33498 decoder,
33499 (),
33500 )?
33501 }
33502
33503 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
33504 }
33505
33506 Ok(())
33507 }
33508 }
33509
33510 impl<'de> ::core::fmt::Debug for LayoutParameter<'de> {
33511 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
33512 match self.raw.ordinal() {
33513 1 => unsafe {
33514 self.raw.get().deref_unchecked::<crate::wire::ConfigType<'_>>().fmt(f)
33515 },
33516 _ => unsafe { ::core::hint::unreachable_unchecked() },
33517 }
33518 }
33519 }
33520
33521 impl<'de> ::fidl_next::IntoNatural for LayoutParameter<'de> {
33522 type Natural = crate::natural::LayoutParameter;
33523 }
33524
33525 impl ::fidl_next::Unconstrained for LayoutParameter<'static> {}
33526
33527 #[derive(Debug)]
33529 #[repr(C)]
33530 pub struct ResolvedConfigField<'de> {
33531 pub key: ::fidl_next::WireString<'de>,
33532
33533 pub value: crate::wire::ConfigValue<'de>,
33534 }
33535
33536 static_assertions::const_assert_eq!(std::mem::size_of::<ResolvedConfigField<'_>>(), 32);
33537 static_assertions::const_assert_eq!(std::mem::align_of::<ResolvedConfigField<'_>>(), 8);
33538
33539 static_assertions::const_assert_eq!(std::mem::offset_of!(ResolvedConfigField<'_>, key), 0);
33540
33541 static_assertions::const_assert_eq!(std::mem::offset_of!(ResolvedConfigField<'_>, value), 16);
33542
33543 unsafe impl ::fidl_next::Wire for ResolvedConfigField<'static> {
33544 type Owned<'de> = ResolvedConfigField<'de>;
33545
33546 #[inline]
33547 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
33548 ::fidl_next::munge! {
33549 let Self {
33550
33551 key,
33552 value,
33553
33554 } = &mut *out_;
33555 }
33556
33557 ::fidl_next::Wire::zero_padding(key);
33558
33559 ::fidl_next::Wire::zero_padding(value);
33560 }
33561 }
33562
33563 unsafe impl<___D> ::fidl_next::Decode<___D> for ResolvedConfigField<'static>
33564 where
33565 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
33566 ___D: ::fidl_next::Decoder,
33567 {
33568 fn decode(
33569 slot_: ::fidl_next::Slot<'_, Self>,
33570 decoder_: &mut ___D,
33571 _: (),
33572 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33573 ::fidl_next::munge! {
33574 let Self {
33575
33576 mut key,
33577 mut value,
33578
33579 } = slot_;
33580 }
33581
33582 let _field = key.as_mut();
33583 ::fidl_next::Constrained::validate(_field, 4294967295)?;
33584 ::fidl_next::Decode::decode(key.as_mut(), decoder_, 4294967295)?;
33585
33586 let _field = value.as_mut();
33587
33588 ::fidl_next::Decode::decode(value.as_mut(), decoder_, ())?;
33589
33590 Ok(())
33591 }
33592 }
33593
33594 impl<'de> ::fidl_next::IntoNatural for ResolvedConfigField<'de> {
33595 type Natural = crate::natural::ResolvedConfigField;
33596 }
33597
33598 impl ::fidl_next::Unconstrained for ResolvedConfigField<'static> {}
33599
33600 #[derive(Debug)]
33602 #[repr(C)]
33603 pub struct ResolvedConfig<'de> {
33604 pub fields: ::fidl_next::WireVector<'de, crate::wire::ResolvedConfigField<'de>>,
33605
33606 pub checksum: crate::wire::ConfigChecksum<'de>,
33607 }
33608
33609 static_assertions::const_assert_eq!(std::mem::size_of::<ResolvedConfig<'_>>(), 32);
33610 static_assertions::const_assert_eq!(std::mem::align_of::<ResolvedConfig<'_>>(), 8);
33611
33612 static_assertions::const_assert_eq!(std::mem::offset_of!(ResolvedConfig<'_>, fields), 0);
33613
33614 static_assertions::const_assert_eq!(std::mem::offset_of!(ResolvedConfig<'_>, checksum), 16);
33615
33616 unsafe impl ::fidl_next::Wire for ResolvedConfig<'static> {
33617 type Owned<'de> = ResolvedConfig<'de>;
33618
33619 #[inline]
33620 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
33621 ::fidl_next::munge! {
33622 let Self {
33623
33624 fields,
33625 checksum,
33626
33627 } = &mut *out_;
33628 }
33629
33630 ::fidl_next::Wire::zero_padding(fields);
33631
33632 ::fidl_next::Wire::zero_padding(checksum);
33633 }
33634 }
33635
33636 unsafe impl<___D> ::fidl_next::Decode<___D> for ResolvedConfig<'static>
33637 where
33638 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
33639 ___D: ::fidl_next::Decoder,
33640 {
33641 fn decode(
33642 slot_: ::fidl_next::Slot<'_, Self>,
33643 decoder_: &mut ___D,
33644 _: (),
33645 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33646 ::fidl_next::munge! {
33647 let Self {
33648
33649 mut fields,
33650 mut checksum,
33651
33652 } = slot_;
33653 }
33654
33655 let _field = fields.as_mut();
33656 ::fidl_next::Constrained::validate(_field, (4294967295, ()))?;
33657 ::fidl_next::Decode::decode(fields.as_mut(), decoder_, (4294967295, ()))?;
33658
33659 let _field = checksum.as_mut();
33660
33661 ::fidl_next::Decode::decode(checksum.as_mut(), decoder_, ())?;
33662
33663 Ok(())
33664 }
33665 }
33666
33667 impl<'de> ::fidl_next::IntoNatural for ResolvedConfig<'de> {
33668 type Natural = crate::natural::ResolvedConfig;
33669 }
33670
33671 impl ::fidl_next::Unconstrained for ResolvedConfig<'static> {}
33672}
33673
33674pub mod wire_optional {
33675
33676 #[repr(transparent)]
33677 pub struct ConfigSingleValue<'de> {
33678 pub(crate) raw: ::fidl_next::RawWireUnion,
33679 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
33680 }
33681
33682 unsafe impl ::fidl_next::Wire for ConfigSingleValue<'static> {
33683 type Owned<'de> = ConfigSingleValue<'de>;
33684
33685 #[inline]
33686 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33687 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
33688 ::fidl_next::RawWireUnion::zero_padding(raw);
33689 }
33690 }
33691
33692 impl<'de> ConfigSingleValue<'de> {
33693 pub fn is_some(&self) -> bool {
33694 self.raw.is_some()
33695 }
33696
33697 pub fn is_none(&self) -> bool {
33698 self.raw.is_none()
33699 }
33700
33701 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::ConfigSingleValue<'de>> {
33702 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
33703 }
33704
33705 pub fn into_option(self) -> ::core::option::Option<crate::wire::ConfigSingleValue<'de>> {
33706 if self.is_some() {
33707 Some(crate::wire::ConfigSingleValue {
33708 raw: self.raw,
33709 _phantom: ::core::marker::PhantomData,
33710 })
33711 } else {
33712 None
33713 }
33714 }
33715 }
33716
33717 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigSingleValue<'static>
33718 where
33719 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
33720 ___D: ::fidl_next::Decoder,
33721 {
33722 fn decode(
33723 mut slot: ::fidl_next::Slot<'_, Self>,
33724 decoder: &mut ___D,
33725 _: (),
33726 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33727 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
33728 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
33729 1 => ::fidl_next::RawWireUnion::decode_as::<___D, bool>(raw, decoder, ())?,
33730
33731 2 => ::fidl_next::RawWireUnion::decode_as::<___D, u8>(raw, decoder, ())?,
33732
33733 3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU16>(
33734 raw,
33735 decoder,
33736 (),
33737 )?,
33738
33739 4 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(
33740 raw,
33741 decoder,
33742 (),
33743 )?,
33744
33745 5 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU64>(
33746 raw,
33747 decoder,
33748 (),
33749 )?,
33750
33751 6 => ::fidl_next::RawWireUnion::decode_as::<___D, i8>(raw, decoder, ())?,
33752
33753 7 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI16>(
33754 raw,
33755 decoder,
33756 (),
33757 )?,
33758
33759 8 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI32>(
33760 raw,
33761 decoder,
33762 (),
33763 )?,
33764
33765 9 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireI64>(
33766 raw,
33767 decoder,
33768 (),
33769 )?,
33770
33771 10 => {
33772 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
33773 raw, decoder, 4294967295,
33774 )?
33775 }
33776
33777 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
33778 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
33779 }
33780
33781 Ok(())
33782 }
33783 }
33784
33785 impl<'de> ::core::fmt::Debug for ConfigSingleValue<'de> {
33786 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
33787 self.as_ref().fmt(f)
33788 }
33789 }
33790
33791 impl<'de> ::fidl_next::IntoNatural for ConfigSingleValue<'de> {
33792 type Natural = ::core::option::Option<crate::natural::ConfigSingleValue>;
33793 }
33794
33795 impl ::fidl_next::Unconstrained for ConfigSingleValue<'static> {}
33796
33797 #[repr(transparent)]
33798 pub struct ConfigVectorValue<'de> {
33799 pub(crate) raw: ::fidl_next::RawWireUnion,
33800 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
33801 }
33802
33803 unsafe impl ::fidl_next::Wire for ConfigVectorValue<'static> {
33804 type Owned<'de> = ConfigVectorValue<'de>;
33805
33806 #[inline]
33807 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33808 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
33809 ::fidl_next::RawWireUnion::zero_padding(raw);
33810 }
33811 }
33812
33813 impl<'de> ConfigVectorValue<'de> {
33814 pub fn is_some(&self) -> bool {
33815 self.raw.is_some()
33816 }
33817
33818 pub fn is_none(&self) -> bool {
33819 self.raw.is_none()
33820 }
33821
33822 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::ConfigVectorValue<'de>> {
33823 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
33824 }
33825
33826 pub fn into_option(self) -> ::core::option::Option<crate::wire::ConfigVectorValue<'de>> {
33827 if self.is_some() {
33828 Some(crate::wire::ConfigVectorValue {
33829 raw: self.raw,
33830 _phantom: ::core::marker::PhantomData,
33831 })
33832 } else {
33833 None
33834 }
33835 }
33836 }
33837
33838 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigVectorValue<'static>
33839 where
33840 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
33841 ___D: ::fidl_next::Decoder,
33842 {
33843 fn decode(
33844 mut slot: ::fidl_next::Slot<'_, Self>,
33845 decoder: &mut ___D,
33846 _: (),
33847 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33848 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
33849 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
33850 1 => ::fidl_next::RawWireUnion::decode_as::<
33851 ___D,
33852 ::fidl_next::WireVector<'static, bool>,
33853 >(raw, decoder, (4294967295, ()))?,
33854
33855 2 => ::fidl_next::RawWireUnion::decode_as::<
33856 ___D,
33857 ::fidl_next::WireVector<'static, u8>,
33858 >(raw, decoder, (4294967295, ()))?,
33859
33860 3 => ::fidl_next::RawWireUnion::decode_as::<
33861 ___D,
33862 ::fidl_next::WireVector<'static, ::fidl_next::WireU16>,
33863 >(raw, decoder, (4294967295, ()))?,
33864
33865 4 => ::fidl_next::RawWireUnion::decode_as::<
33866 ___D,
33867 ::fidl_next::WireVector<'static, ::fidl_next::WireU32>,
33868 >(raw, decoder, (4294967295, ()))?,
33869
33870 5 => ::fidl_next::RawWireUnion::decode_as::<
33871 ___D,
33872 ::fidl_next::WireVector<'static, ::fidl_next::WireU64>,
33873 >(raw, decoder, (4294967295, ()))?,
33874
33875 6 => ::fidl_next::RawWireUnion::decode_as::<
33876 ___D,
33877 ::fidl_next::WireVector<'static, i8>,
33878 >(raw, decoder, (4294967295, ()))?,
33879
33880 7 => ::fidl_next::RawWireUnion::decode_as::<
33881 ___D,
33882 ::fidl_next::WireVector<'static, ::fidl_next::WireI16>,
33883 >(raw, decoder, (4294967295, ()))?,
33884
33885 8 => ::fidl_next::RawWireUnion::decode_as::<
33886 ___D,
33887 ::fidl_next::WireVector<'static, ::fidl_next::WireI32>,
33888 >(raw, decoder, (4294967295, ()))?,
33889
33890 9 => ::fidl_next::RawWireUnion::decode_as::<
33891 ___D,
33892 ::fidl_next::WireVector<'static, ::fidl_next::WireI64>,
33893 >(raw, decoder, (4294967295, ()))?,
33894
33895 10 => ::fidl_next::RawWireUnion::decode_as::<
33896 ___D,
33897 ::fidl_next::WireVector<'static, ::fidl_next::WireString<'static>>,
33898 >(raw, decoder, (4294967295, 4294967295))?,
33899
33900 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
33901 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
33902 }
33903
33904 Ok(())
33905 }
33906 }
33907
33908 impl<'de> ::core::fmt::Debug for ConfigVectorValue<'de> {
33909 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
33910 self.as_ref().fmt(f)
33911 }
33912 }
33913
33914 impl<'de> ::fidl_next::IntoNatural for ConfigVectorValue<'de> {
33915 type Natural = ::core::option::Option<crate::natural::ConfigVectorValue>;
33916 }
33917
33918 impl ::fidl_next::Unconstrained for ConfigVectorValue<'static> {}
33919
33920 #[repr(transparent)]
33921 pub struct ConfigValue<'de> {
33922 pub(crate) raw: ::fidl_next::RawWireUnion,
33923 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
33924 }
33925
33926 unsafe impl ::fidl_next::Wire for ConfigValue<'static> {
33927 type Owned<'de> = ConfigValue<'de>;
33928
33929 #[inline]
33930 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
33931 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
33932 ::fidl_next::RawWireUnion::zero_padding(raw);
33933 }
33934 }
33935
33936 impl<'de> ConfigValue<'de> {
33937 pub fn is_some(&self) -> bool {
33938 self.raw.is_some()
33939 }
33940
33941 pub fn is_none(&self) -> bool {
33942 self.raw.is_none()
33943 }
33944
33945 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::ConfigValue<'de>> {
33946 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
33947 }
33948
33949 pub fn into_option(self) -> ::core::option::Option<crate::wire::ConfigValue<'de>> {
33950 if self.is_some() {
33951 Some(crate::wire::ConfigValue {
33952 raw: self.raw,
33953 _phantom: ::core::marker::PhantomData,
33954 })
33955 } else {
33956 None
33957 }
33958 }
33959 }
33960
33961 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigValue<'static>
33962 where
33963 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
33964 ___D: ::fidl_next::Decoder,
33965 {
33966 fn decode(
33967 mut slot: ::fidl_next::Slot<'_, Self>,
33968 decoder: &mut ___D,
33969 _: (),
33970 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
33971 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
33972 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
33973 1 => ::fidl_next::RawWireUnion::decode_as::<
33974 ___D,
33975 crate::wire::ConfigSingleValue<'static>,
33976 >(raw, decoder, ())?,
33977
33978 2 => ::fidl_next::RawWireUnion::decode_as::<
33979 ___D,
33980 crate::wire::ConfigVectorValue<'static>,
33981 >(raw, decoder, ())?,
33982
33983 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
33984 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
33985 }
33986
33987 Ok(())
33988 }
33989 }
33990
33991 impl<'de> ::core::fmt::Debug for ConfigValue<'de> {
33992 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
33993 self.as_ref().fmt(f)
33994 }
33995 }
33996
33997 impl<'de> ::fidl_next::IntoNatural for ConfigValue<'de> {
33998 type Natural = ::core::option::Option<crate::natural::ConfigValue>;
33999 }
34000
34001 impl ::fidl_next::Unconstrained for ConfigValue<'static> {}
34002
34003 #[repr(transparent)]
34004 pub struct Ref<'de> {
34005 pub(crate) raw: ::fidl_next::RawWireUnion,
34006 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34007 }
34008
34009 unsafe impl ::fidl_next::Wire for Ref<'static> {
34010 type Owned<'de> = Ref<'de>;
34011
34012 #[inline]
34013 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34014 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34015 ::fidl_next::RawWireUnion::zero_padding(raw);
34016 }
34017 }
34018
34019 impl<'de> Ref<'de> {
34020 pub fn is_some(&self) -> bool {
34021 self.raw.is_some()
34022 }
34023
34024 pub fn is_none(&self) -> bool {
34025 self.raw.is_none()
34026 }
34027
34028 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Ref<'de>> {
34029 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34030 }
34031
34032 pub fn into_option(self) -> ::core::option::Option<crate::wire::Ref<'de>> {
34033 if self.is_some() {
34034 Some(crate::wire::Ref { raw: self.raw, _phantom: ::core::marker::PhantomData })
34035 } else {
34036 None
34037 }
34038 }
34039 }
34040
34041 unsafe impl<___D> ::fidl_next::Decode<___D> for Ref<'static>
34042 where
34043 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34044 ___D: ::fidl_next::Decoder,
34045 {
34046 fn decode(
34047 mut slot: ::fidl_next::Slot<'_, Self>,
34048 decoder: &mut ___D,
34049 _: (),
34050 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34051 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34052 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
34053 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::ParentRef>(
34054 raw,
34055 decoder,
34056 (),
34057 )?,
34058
34059 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::SelfRef>(
34060 raw,
34061 decoder,
34062 (),
34063 )?,
34064
34065 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::ChildRef<'static>>(
34066 raw,
34067 decoder,
34068 (),
34069 )?,
34070
34071 4 => ::fidl_next::RawWireUnion::decode_as::<
34072 ___D,
34073 crate::wire::CollectionRef<'static>,
34074 >(raw, decoder, ())?,
34075
34076 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::FrameworkRef>(
34077 raw,
34078 decoder,
34079 (),
34080 )?,
34081
34082 6 => ::fidl_next::RawWireUnion::decode_as::<
34083 ___D,
34084 crate::wire::CapabilityRef<'static>,
34085 >(raw, decoder, ())?,
34086
34087 7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::DebugRef>(
34088 raw,
34089 decoder,
34090 (),
34091 )?,
34092
34093 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::VoidRef>(
34094 raw,
34095 decoder,
34096 (),
34097 )?,
34098
34099 9 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::EnvironmentRef>(
34100 raw,
34101 decoder,
34102 (),
34103 )?,
34104
34105 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
34106 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
34107 }
34108
34109 Ok(())
34110 }
34111 }
34112
34113 impl<'de> ::core::fmt::Debug for Ref<'de> {
34114 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34115 self.as_ref().fmt(f)
34116 }
34117 }
34118
34119 impl<'de> ::fidl_next::IntoNatural for Ref<'de> {
34120 type Natural = ::core::option::Option<crate::natural::Ref>;
34121 }
34122
34123 impl ::fidl_next::Unconstrained for Ref<'static> {}
34124
34125 #[repr(transparent)]
34126 pub struct Capability<'de> {
34127 pub(crate) raw: ::fidl_next::RawWireUnion,
34128 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34129 }
34130
34131 unsafe impl ::fidl_next::Wire for Capability<'static> {
34132 type Owned<'de> = Capability<'de>;
34133
34134 #[inline]
34135 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34136 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34137 ::fidl_next::RawWireUnion::zero_padding(raw);
34138 }
34139 }
34140
34141 impl<'de> Capability<'de> {
34142 pub fn is_some(&self) -> bool {
34143 self.raw.is_some()
34144 }
34145
34146 pub fn is_none(&self) -> bool {
34147 self.raw.is_none()
34148 }
34149
34150 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Capability<'de>> {
34151 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34152 }
34153
34154 pub fn into_option(self) -> ::core::option::Option<crate::wire::Capability<'de>> {
34155 if self.is_some() {
34156 Some(crate::wire::Capability {
34157 raw: self.raw,
34158 _phantom: ::core::marker::PhantomData,
34159 })
34160 } else {
34161 None
34162 }
34163 }
34164 }
34165
34166 unsafe impl<___D> ::fidl_next::Decode<___D> for Capability<'static>
34167 where
34168 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34169 ___D: ::fidl_next::Decoder,
34170 {
34171 fn decode(
34172 mut slot: ::fidl_next::Slot<'_, Self>,
34173 decoder: &mut ___D,
34174 _: (),
34175 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34176 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34177 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
34178 1 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::Service<'static>>(
34179 raw,
34180 decoder,
34181 (),
34182 )?,
34183
34184 2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::Protocol<'static>>(
34185 raw,
34186 decoder,
34187 (),
34188 )?,
34189
34190 3 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::Directory<'static>>(
34191 raw,
34192 decoder,
34193 (),
34194 )?,
34195
34196 4 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::Storage<'static>>(
34197 raw,
34198 decoder,
34199 (),
34200 )?,
34201
34202 5 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::Runner<'static>>(
34203 raw,
34204 decoder,
34205 (),
34206 )?,
34207
34208 6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::Resolver<'static>>(
34209 raw,
34210 decoder,
34211 (),
34212 )?,
34213
34214 8 => {
34215 ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::EventStream<'static>>(
34216 raw,
34217 decoder,
34218 (),
34219 )?
34220 }
34221
34222 9 => {
34223 ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::Dictionary<'static>>(
34224 raw,
34225 decoder,
34226 (),
34227 )?
34228 }
34229
34230 10 => ::fidl_next::RawWireUnion::decode_as::<
34231 ___D,
34232 crate::wire::Configuration<'static>,
34233 >(raw, decoder, ())?,
34234
34235 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
34236 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
34237 }
34238
34239 Ok(())
34240 }
34241 }
34242
34243 impl<'de> ::core::fmt::Debug for Capability<'de> {
34244 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34245 self.as_ref().fmt(f)
34246 }
34247 }
34248
34249 impl<'de> ::fidl_next::IntoNatural for Capability<'de> {
34250 type Natural = ::core::option::Option<crate::natural::Capability>;
34251 }
34252
34253 impl ::fidl_next::Unconstrained for Capability<'static> {}
34254
34255 #[repr(transparent)]
34256 pub struct LayoutConstraint<'de> {
34257 pub(crate) raw: ::fidl_next::RawWireUnion,
34258 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34259 }
34260
34261 unsafe impl ::fidl_next::Wire for LayoutConstraint<'static> {
34262 type Owned<'de> = LayoutConstraint<'de>;
34263
34264 #[inline]
34265 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34266 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34267 ::fidl_next::RawWireUnion::zero_padding(raw);
34268 }
34269 }
34270
34271 impl<'de> LayoutConstraint<'de> {
34272 pub fn is_some(&self) -> bool {
34273 self.raw.is_some()
34274 }
34275
34276 pub fn is_none(&self) -> bool {
34277 self.raw.is_none()
34278 }
34279
34280 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::LayoutConstraint<'de>> {
34281 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34282 }
34283
34284 pub fn into_option(self) -> ::core::option::Option<crate::wire::LayoutConstraint<'de>> {
34285 if self.is_some() {
34286 Some(crate::wire::LayoutConstraint {
34287 raw: self.raw,
34288 _phantom: ::core::marker::PhantomData,
34289 })
34290 } else {
34291 None
34292 }
34293 }
34294 }
34295
34296 unsafe impl<___D> ::fidl_next::Decode<___D> for LayoutConstraint<'static>
34297 where
34298 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34299 ___D: ::fidl_next::Decoder,
34300 {
34301 fn decode(
34302 mut slot: ::fidl_next::Slot<'_, Self>,
34303 decoder: &mut ___D,
34304 _: (),
34305 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34306 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34307 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
34308 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireU32>(
34309 raw,
34310 decoder,
34311 (),
34312 )?,
34313
34314 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
34315 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
34316 }
34317
34318 Ok(())
34319 }
34320 }
34321
34322 impl<'de> ::core::fmt::Debug for LayoutConstraint<'de> {
34323 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34324 self.as_ref().fmt(f)
34325 }
34326 }
34327
34328 impl<'de> ::fidl_next::IntoNatural for LayoutConstraint<'de> {
34329 type Natural = ::core::option::Option<crate::natural::LayoutConstraint>;
34330 }
34331
34332 impl ::fidl_next::Unconstrained for LayoutConstraint<'static> {}
34333
34334 #[repr(transparent)]
34335 pub struct ConfigChecksum<'de> {
34336 pub(crate) raw: ::fidl_next::RawWireUnion,
34337 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34338 }
34339
34340 unsafe impl ::fidl_next::Wire for ConfigChecksum<'static> {
34341 type Owned<'de> = ConfigChecksum<'de>;
34342
34343 #[inline]
34344 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34345 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34346 ::fidl_next::RawWireUnion::zero_padding(raw);
34347 }
34348 }
34349
34350 impl<'de> ConfigChecksum<'de> {
34351 pub fn is_some(&self) -> bool {
34352 self.raw.is_some()
34353 }
34354
34355 pub fn is_none(&self) -> bool {
34356 self.raw.is_none()
34357 }
34358
34359 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::ConfigChecksum<'de>> {
34360 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34361 }
34362
34363 pub fn into_option(self) -> ::core::option::Option<crate::wire::ConfigChecksum<'de>> {
34364 if self.is_some() {
34365 Some(crate::wire::ConfigChecksum {
34366 raw: self.raw,
34367 _phantom: ::core::marker::PhantomData,
34368 })
34369 } else {
34370 None
34371 }
34372 }
34373 }
34374
34375 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigChecksum<'static>
34376 where
34377 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34378 ___D: ::fidl_next::Decoder,
34379 {
34380 fn decode(
34381 mut slot: ::fidl_next::Slot<'_, Self>,
34382 decoder: &mut ___D,
34383 _: (),
34384 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34385 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34386 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
34387 1 => ::fidl_next::RawWireUnion::decode_as::<___D, [u8; 32]>(raw, decoder, ())?,
34388
34389 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
34390 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
34391 }
34392
34393 Ok(())
34394 }
34395 }
34396
34397 impl<'de> ::core::fmt::Debug for ConfigChecksum<'de> {
34398 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34399 self.as_ref().fmt(f)
34400 }
34401 }
34402
34403 impl<'de> ::fidl_next::IntoNatural for ConfigChecksum<'de> {
34404 type Natural = ::core::option::Option<crate::natural::ConfigChecksum>;
34405 }
34406
34407 impl ::fidl_next::Unconstrained for ConfigChecksum<'static> {}
34408
34409 #[repr(transparent)]
34410 pub struct Use<'de> {
34411 pub(crate) raw: ::fidl_next::RawWireUnion,
34412 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34413 }
34414
34415 unsafe impl ::fidl_next::Wire for Use<'static> {
34416 type Owned<'de> = Use<'de>;
34417
34418 #[inline]
34419 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34420 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34421 ::fidl_next::RawWireUnion::zero_padding(raw);
34422 }
34423 }
34424
34425 impl<'de> Use<'de> {
34426 pub fn is_some(&self) -> bool {
34427 self.raw.is_some()
34428 }
34429
34430 pub fn is_none(&self) -> bool {
34431 self.raw.is_none()
34432 }
34433
34434 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Use<'de>> {
34435 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34436 }
34437
34438 pub fn into_option(self) -> ::core::option::Option<crate::wire::Use<'de>> {
34439 if self.is_some() {
34440 Some(crate::wire::Use { raw: self.raw, _phantom: ::core::marker::PhantomData })
34441 } else {
34442 None
34443 }
34444 }
34445 }
34446
34447 unsafe impl<___D> ::fidl_next::Decode<___D> for Use<'static>
34448 where
34449 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34450 ___D: ::fidl_next::Decoder,
34451 {
34452 fn decode(
34453 mut slot: ::fidl_next::Slot<'_, Self>,
34454 decoder: &mut ___D,
34455 _: (),
34456 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34457 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34458 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
34459 1 => {
34460 ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::UseService<'static>>(
34461 raw,
34462 decoder,
34463 (),
34464 )?
34465 }
34466
34467 2 => {
34468 ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::UseProtocol<'static>>(
34469 raw,
34470 decoder,
34471 (),
34472 )?
34473 }
34474
34475 3 => ::fidl_next::RawWireUnion::decode_as::<
34476 ___D,
34477 crate::wire::UseDirectory<'static>,
34478 >(raw, decoder, ())?,
34479
34480 4 => {
34481 ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::UseStorage<'static>>(
34482 raw,
34483 decoder,
34484 (),
34485 )?
34486 }
34487
34488 7 => ::fidl_next::RawWireUnion::decode_as::<
34489 ___D,
34490 crate::wire::UseEventStream<'static>,
34491 >(raw, decoder, ())?,
34492
34493 8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::UseRunner<'static>>(
34494 raw,
34495 decoder,
34496 (),
34497 )?,
34498
34499 9 => ::fidl_next::RawWireUnion::decode_as::<
34500 ___D,
34501 crate::wire::UseConfiguration<'static>,
34502 >(raw, decoder, ())?,
34503
34504 10 => ::fidl_next::RawWireUnion::decode_as::<
34505 ___D,
34506 crate::wire::UseDictionary<'static>,
34507 >(raw, decoder, ())?,
34508
34509 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
34510 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
34511 }
34512
34513 Ok(())
34514 }
34515 }
34516
34517 impl<'de> ::core::fmt::Debug for Use<'de> {
34518 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34519 self.as_ref().fmt(f)
34520 }
34521 }
34522
34523 impl<'de> ::fidl_next::IntoNatural for Use<'de> {
34524 type Natural = ::core::option::Option<crate::natural::Use>;
34525 }
34526
34527 impl ::fidl_next::Unconstrained for Use<'static> {}
34528
34529 #[repr(transparent)]
34530 pub struct Expose<'de> {
34531 pub(crate) raw: ::fidl_next::RawWireUnion,
34532 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34533 }
34534
34535 unsafe impl ::fidl_next::Wire for Expose<'static> {
34536 type Owned<'de> = Expose<'de>;
34537
34538 #[inline]
34539 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34540 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34541 ::fidl_next::RawWireUnion::zero_padding(raw);
34542 }
34543 }
34544
34545 impl<'de> Expose<'de> {
34546 pub fn is_some(&self) -> bool {
34547 self.raw.is_some()
34548 }
34549
34550 pub fn is_none(&self) -> bool {
34551 self.raw.is_none()
34552 }
34553
34554 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Expose<'de>> {
34555 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34556 }
34557
34558 pub fn into_option(self) -> ::core::option::Option<crate::wire::Expose<'de>> {
34559 if self.is_some() {
34560 Some(crate::wire::Expose { raw: self.raw, _phantom: ::core::marker::PhantomData })
34561 } else {
34562 None
34563 }
34564 }
34565 }
34566
34567 unsafe impl<___D> ::fidl_next::Decode<___D> for Expose<'static>
34568 where
34569 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34570 ___D: ::fidl_next::Decoder,
34571 {
34572 fn decode(
34573 mut slot: ::fidl_next::Slot<'_, Self>,
34574 decoder: &mut ___D,
34575 _: (),
34576 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34577 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34578 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
34579 1 => ::fidl_next::RawWireUnion::decode_as::<
34580 ___D,
34581 crate::wire::ExposeService<'static>,
34582 >(raw, decoder, ())?,
34583
34584 2 => ::fidl_next::RawWireUnion::decode_as::<
34585 ___D,
34586 crate::wire::ExposeProtocol<'static>,
34587 >(raw, decoder, ())?,
34588
34589 3 => ::fidl_next::RawWireUnion::decode_as::<
34590 ___D,
34591 crate::wire::ExposeDirectory<'static>,
34592 >(raw, decoder, ())?,
34593
34594 4 => ::fidl_next::RawWireUnion::decode_as::<
34595 ___D,
34596 crate::wire::ExposeRunner<'static>,
34597 >(raw, decoder, ())?,
34598
34599 5 => ::fidl_next::RawWireUnion::decode_as::<
34600 ___D,
34601 crate::wire::ExposeResolver<'static>,
34602 >(raw, decoder, ())?,
34603
34604 7 => ::fidl_next::RawWireUnion::decode_as::<
34605 ___D,
34606 crate::wire::ExposeDictionary<'static>,
34607 >(raw, decoder, ())?,
34608
34609 8 => ::fidl_next::RawWireUnion::decode_as::<
34610 ___D,
34611 crate::wire::ExposeConfiguration<'static>,
34612 >(raw, decoder, ())?,
34613
34614 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
34615 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
34616 }
34617
34618 Ok(())
34619 }
34620 }
34621
34622 impl<'de> ::core::fmt::Debug for Expose<'de> {
34623 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34624 self.as_ref().fmt(f)
34625 }
34626 }
34627
34628 impl<'de> ::fidl_next::IntoNatural for Expose<'de> {
34629 type Natural = ::core::option::Option<crate::natural::Expose>;
34630 }
34631
34632 impl ::fidl_next::Unconstrained for Expose<'static> {}
34633
34634 #[repr(transparent)]
34635 pub struct Offer<'de> {
34636 pub(crate) raw: ::fidl_next::RawWireUnion,
34637 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34638 }
34639
34640 unsafe impl ::fidl_next::Wire for Offer<'static> {
34641 type Owned<'de> = Offer<'de>;
34642
34643 #[inline]
34644 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34645 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34646 ::fidl_next::RawWireUnion::zero_padding(raw);
34647 }
34648 }
34649
34650 impl<'de> Offer<'de> {
34651 pub fn is_some(&self) -> bool {
34652 self.raw.is_some()
34653 }
34654
34655 pub fn is_none(&self) -> bool {
34656 self.raw.is_none()
34657 }
34658
34659 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::Offer<'de>> {
34660 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34661 }
34662
34663 pub fn into_option(self) -> ::core::option::Option<crate::wire::Offer<'de>> {
34664 if self.is_some() {
34665 Some(crate::wire::Offer { raw: self.raw, _phantom: ::core::marker::PhantomData })
34666 } else {
34667 None
34668 }
34669 }
34670 }
34671
34672 unsafe impl<___D> ::fidl_next::Decode<___D> for Offer<'static>
34673 where
34674 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34675 ___D: ::fidl_next::Decoder,
34676 {
34677 fn decode(
34678 mut slot: ::fidl_next::Slot<'_, Self>,
34679 decoder: &mut ___D,
34680 _: (),
34681 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34682 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34683 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
34684 1 => ::fidl_next::RawWireUnion::decode_as::<
34685 ___D,
34686 crate::wire::OfferService<'static>,
34687 >(raw, decoder, ())?,
34688
34689 2 => ::fidl_next::RawWireUnion::decode_as::<
34690 ___D,
34691 crate::wire::OfferProtocol<'static>,
34692 >(raw, decoder, ())?,
34693
34694 3 => ::fidl_next::RawWireUnion::decode_as::<
34695 ___D,
34696 crate::wire::OfferDirectory<'static>,
34697 >(raw, decoder, ())?,
34698
34699 4 => ::fidl_next::RawWireUnion::decode_as::<
34700 ___D,
34701 crate::wire::OfferStorage<'static>,
34702 >(raw, decoder, ())?,
34703
34704 5 => {
34705 ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::OfferRunner<'static>>(
34706 raw,
34707 decoder,
34708 (),
34709 )?
34710 }
34711
34712 6 => ::fidl_next::RawWireUnion::decode_as::<
34713 ___D,
34714 crate::wire::OfferResolver<'static>,
34715 >(raw, decoder, ())?,
34716
34717 8 => ::fidl_next::RawWireUnion::decode_as::<
34718 ___D,
34719 crate::wire::OfferEventStream<'static>,
34720 >(raw, decoder, ())?,
34721
34722 9 => ::fidl_next::RawWireUnion::decode_as::<
34723 ___D,
34724 crate::wire::OfferDictionary<'static>,
34725 >(raw, decoder, ())?,
34726
34727 10 => ::fidl_next::RawWireUnion::decode_as::<
34728 ___D,
34729 crate::wire::OfferConfiguration<'static>,
34730 >(raw, decoder, ())?,
34731
34732 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
34733 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
34734 }
34735
34736 Ok(())
34737 }
34738 }
34739
34740 impl<'de> ::core::fmt::Debug for Offer<'de> {
34741 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34742 self.as_ref().fmt(f)
34743 }
34744 }
34745
34746 impl<'de> ::fidl_next::IntoNatural for Offer<'de> {
34747 type Natural = ::core::option::Option<crate::natural::Offer>;
34748 }
34749
34750 impl ::fidl_next::Unconstrained for Offer<'static> {}
34751
34752 #[repr(transparent)]
34753 pub struct DebugRegistration<'de> {
34754 pub(crate) raw: ::fidl_next::RawWireUnion,
34755 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34756 }
34757
34758 unsafe impl ::fidl_next::Wire for DebugRegistration<'static> {
34759 type Owned<'de> = DebugRegistration<'de>;
34760
34761 #[inline]
34762 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34763 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34764 ::fidl_next::RawWireUnion::zero_padding(raw);
34765 }
34766 }
34767
34768 impl<'de> DebugRegistration<'de> {
34769 pub fn is_some(&self) -> bool {
34770 self.raw.is_some()
34771 }
34772
34773 pub fn is_none(&self) -> bool {
34774 self.raw.is_none()
34775 }
34776
34777 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::DebugRegistration<'de>> {
34778 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34779 }
34780
34781 pub fn into_option(self) -> ::core::option::Option<crate::wire::DebugRegistration<'de>> {
34782 if self.is_some() {
34783 Some(crate::wire::DebugRegistration {
34784 raw: self.raw,
34785 _phantom: ::core::marker::PhantomData,
34786 })
34787 } else {
34788 None
34789 }
34790 }
34791 }
34792
34793 unsafe impl<___D> ::fidl_next::Decode<___D> for DebugRegistration<'static>
34794 where
34795 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34796 ___D: ::fidl_next::Decoder,
34797 {
34798 fn decode(
34799 mut slot: ::fidl_next::Slot<'_, Self>,
34800 decoder: &mut ___D,
34801 _: (),
34802 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34803 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34804 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
34805 1 => ::fidl_next::RawWireUnion::decode_as::<
34806 ___D,
34807 crate::wire::DebugProtocolRegistration<'static>,
34808 >(raw, decoder, ())?,
34809
34810 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
34811 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
34812 }
34813
34814 Ok(())
34815 }
34816 }
34817
34818 impl<'de> ::core::fmt::Debug for DebugRegistration<'de> {
34819 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34820 self.as_ref().fmt(f)
34821 }
34822 }
34823
34824 impl<'de> ::fidl_next::IntoNatural for DebugRegistration<'de> {
34825 type Natural = ::core::option::Option<crate::natural::DebugRegistration>;
34826 }
34827
34828 impl ::fidl_next::Unconstrained for DebugRegistration<'static> {}
34829
34830 #[repr(transparent)]
34831 pub struct ConfigValueSource<'de> {
34832 pub(crate) raw: ::fidl_next::RawWireUnion,
34833 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34834 }
34835
34836 unsafe impl ::fidl_next::Wire for ConfigValueSource<'static> {
34837 type Owned<'de> = ConfigValueSource<'de>;
34838
34839 #[inline]
34840 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34841 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34842 ::fidl_next::RawWireUnion::zero_padding(raw);
34843 }
34844 }
34845
34846 impl<'de> ConfigValueSource<'de> {
34847 pub fn is_some(&self) -> bool {
34848 self.raw.is_some()
34849 }
34850
34851 pub fn is_none(&self) -> bool {
34852 self.raw.is_none()
34853 }
34854
34855 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::ConfigValueSource<'de>> {
34856 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34857 }
34858
34859 pub fn into_option(self) -> ::core::option::Option<crate::wire::ConfigValueSource<'de>> {
34860 if self.is_some() {
34861 Some(crate::wire::ConfigValueSource {
34862 raw: self.raw,
34863 _phantom: ::core::marker::PhantomData,
34864 })
34865 } else {
34866 None
34867 }
34868 }
34869 }
34870
34871 unsafe impl<___D> ::fidl_next::Decode<___D> for ConfigValueSource<'static>
34872 where
34873 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34874 ___D: ::fidl_next::Decoder,
34875 {
34876 fn decode(
34877 mut slot: ::fidl_next::Slot<'_, Self>,
34878 decoder: &mut ___D,
34879 _: (),
34880 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34881 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34882 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
34883 1 => {
34884 ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::WireString<'static>>(
34885 raw, decoder, 4294967295,
34886 )?
34887 }
34888
34889 2 => ::fidl_next::RawWireUnion::decode_as::<
34890 ___D,
34891 crate::wire::ConfigSourceCapabilities<'static>,
34892 >(raw, decoder, ())?,
34893
34894 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
34895 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
34896 }
34897
34898 Ok(())
34899 }
34900 }
34901
34902 impl<'de> ::core::fmt::Debug for ConfigValueSource<'de> {
34903 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34904 self.as_ref().fmt(f)
34905 }
34906 }
34907
34908 impl<'de> ::fidl_next::IntoNatural for ConfigValueSource<'de> {
34909 type Natural = ::core::option::Option<crate::natural::ConfigValueSource>;
34910 }
34911
34912 impl ::fidl_next::Unconstrained for ConfigValueSource<'static> {}
34913
34914 #[repr(transparent)]
34915 pub struct LayoutParameter<'de> {
34916 pub(crate) raw: ::fidl_next::RawWireUnion,
34917 pub(crate) _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
34918 }
34919
34920 unsafe impl ::fidl_next::Wire for LayoutParameter<'static> {
34921 type Owned<'de> = LayoutParameter<'de>;
34922
34923 #[inline]
34924 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
34925 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
34926 ::fidl_next::RawWireUnion::zero_padding(raw);
34927 }
34928 }
34929
34930 impl<'de> LayoutParameter<'de> {
34931 pub fn is_some(&self) -> bool {
34932 self.raw.is_some()
34933 }
34934
34935 pub fn is_none(&self) -> bool {
34936 self.raw.is_none()
34937 }
34938
34939 pub fn as_ref(&self) -> ::core::option::Option<&crate::wire::LayoutParameter<'de>> {
34940 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
34941 }
34942
34943 pub fn into_option(self) -> ::core::option::Option<crate::wire::LayoutParameter<'de>> {
34944 if self.is_some() {
34945 Some(crate::wire::LayoutParameter {
34946 raw: self.raw,
34947 _phantom: ::core::marker::PhantomData,
34948 })
34949 } else {
34950 None
34951 }
34952 }
34953 }
34954
34955 unsafe impl<___D> ::fidl_next::Decode<___D> for LayoutParameter<'static>
34956 where
34957 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
34958 ___D: ::fidl_next::Decoder,
34959 {
34960 fn decode(
34961 mut slot: ::fidl_next::Slot<'_, Self>,
34962 decoder: &mut ___D,
34963 _: (),
34964 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
34965 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
34966 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
34967 1 => {
34968 ::fidl_next::RawWireUnion::decode_as::<___D, crate::wire::ConfigType<'static>>(
34969 raw,
34970 decoder,
34971 (),
34972 )?
34973 }
34974
34975 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
34976 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
34977 }
34978
34979 Ok(())
34980 }
34981 }
34982
34983 impl<'de> ::core::fmt::Debug for LayoutParameter<'de> {
34984 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34985 self.as_ref().fmt(f)
34986 }
34987 }
34988
34989 impl<'de> ::fidl_next::IntoNatural for LayoutParameter<'de> {
34990 type Natural = ::core::option::Option<crate::natural::LayoutParameter>;
34991 }
34992
34993 impl ::fidl_next::Unconstrained for LayoutParameter<'static> {}
34994}
34995
34996pub mod generic {
34997
34998 pub struct ParentRef {}
34999
35000 unsafe impl<___E> ::fidl_next::Encode<crate::wire::ParentRef, ___E> for ParentRef
35001 where
35002 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35003 {
35004 #[inline]
35005 fn encode(
35006 self,
35007 encoder_: &mut ___E,
35008 out_: &mut ::core::mem::MaybeUninit<crate::wire::ParentRef>,
35009 _: (),
35010 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35011 ::fidl_next::munge! {
35012 let crate::wire::ParentRef {
35013
35014 _empty,
35015
35016
35017 } = out_;
35018 }
35019
35020 Ok(())
35021 }
35022 }
35023
35024 pub struct SelfRef {}
35025
35026 unsafe impl<___E> ::fidl_next::Encode<crate::wire::SelfRef, ___E> for SelfRef
35027 where
35028 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35029 {
35030 #[inline]
35031 fn encode(
35032 self,
35033 encoder_: &mut ___E,
35034 out_: &mut ::core::mem::MaybeUninit<crate::wire::SelfRef>,
35035 _: (),
35036 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35037 ::fidl_next::munge! {
35038 let crate::wire::SelfRef {
35039
35040 _empty,
35041
35042
35043 } = out_;
35044 }
35045
35046 Ok(())
35047 }
35048 }
35049
35050 pub struct ChildRef<T0, T1> {
35051 pub name: T0,
35052
35053 pub collection: T1,
35054 }
35055
35056 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::ChildRef<'static>, ___E>
35057 for ChildRef<T0, T1>
35058 where
35059 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35060 ___E: ::fidl_next::Encoder,
35061 T0: ::fidl_next::Encode<::fidl_next::WireString<'static>, ___E>,
35062 T1: ::fidl_next::Encode<::fidl_next::WireOptionalString<'static>, ___E>,
35063 {
35064 #[inline]
35065 fn encode(
35066 self,
35067 encoder_: &mut ___E,
35068 out_: &mut ::core::mem::MaybeUninit<crate::wire::ChildRef<'static>>,
35069 _: (),
35070 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35071 ::fidl_next::munge! {
35072 let crate::wire::ChildRef {
35073
35074 name,
35075 collection,
35076
35077 } = out_;
35078 }
35079
35080 ::fidl_next::Encode::encode(self.name, encoder_, name, 1024)?;
35081
35082 ::fidl_next::Encode::encode(self.collection, encoder_, collection, 100)?;
35083
35084 Ok(())
35085 }
35086 }
35087
35088 pub struct CollectionRef<T0> {
35089 pub name: T0,
35090 }
35091
35092 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::CollectionRef<'static>, ___E>
35093 for CollectionRef<T0>
35094 where
35095 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35096 ___E: ::fidl_next::Encoder,
35097 T0: ::fidl_next::Encode<::fidl_next::WireString<'static>, ___E>,
35098 {
35099 #[inline]
35100 fn encode(
35101 self,
35102 encoder_: &mut ___E,
35103 out_: &mut ::core::mem::MaybeUninit<crate::wire::CollectionRef<'static>>,
35104 _: (),
35105 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35106 ::fidl_next::munge! {
35107 let crate::wire::CollectionRef {
35108
35109 name,
35110
35111 } = out_;
35112 }
35113
35114 ::fidl_next::Encode::encode(self.name, encoder_, name, 100)?;
35115
35116 Ok(())
35117 }
35118 }
35119
35120 pub struct FrameworkRef {}
35121
35122 unsafe impl<___E> ::fidl_next::Encode<crate::wire::FrameworkRef, ___E> for FrameworkRef
35123 where
35124 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35125 {
35126 #[inline]
35127 fn encode(
35128 self,
35129 encoder_: &mut ___E,
35130 out_: &mut ::core::mem::MaybeUninit<crate::wire::FrameworkRef>,
35131 _: (),
35132 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35133 ::fidl_next::munge! {
35134 let crate::wire::FrameworkRef {
35135
35136 _empty,
35137
35138
35139 } = out_;
35140 }
35141
35142 Ok(())
35143 }
35144 }
35145
35146 pub struct CapabilityRef<T0> {
35147 pub name: T0,
35148 }
35149
35150 unsafe impl<___E, T0> ::fidl_next::Encode<crate::wire::CapabilityRef<'static>, ___E>
35151 for CapabilityRef<T0>
35152 where
35153 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35154 ___E: ::fidl_next::Encoder,
35155 T0: ::fidl_next::Encode<::fidl_next::WireString<'static>, ___E>,
35156 {
35157 #[inline]
35158 fn encode(
35159 self,
35160 encoder_: &mut ___E,
35161 out_: &mut ::core::mem::MaybeUninit<crate::wire::CapabilityRef<'static>>,
35162 _: (),
35163 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35164 ::fidl_next::munge! {
35165 let crate::wire::CapabilityRef {
35166
35167 name,
35168
35169 } = out_;
35170 }
35171
35172 ::fidl_next::Encode::encode(self.name, encoder_, name, 100)?;
35173
35174 Ok(())
35175 }
35176 }
35177
35178 pub struct DebugRef {}
35179
35180 unsafe impl<___E> ::fidl_next::Encode<crate::wire::DebugRef, ___E> for DebugRef
35181 where
35182 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35183 {
35184 #[inline]
35185 fn encode(
35186 self,
35187 encoder_: &mut ___E,
35188 out_: &mut ::core::mem::MaybeUninit<crate::wire::DebugRef>,
35189 _: (),
35190 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35191 ::fidl_next::munge! {
35192 let crate::wire::DebugRef {
35193
35194 _empty,
35195
35196
35197 } = out_;
35198 }
35199
35200 Ok(())
35201 }
35202 }
35203
35204 pub struct VoidRef {}
35205
35206 unsafe impl<___E> ::fidl_next::Encode<crate::wire::VoidRef, ___E> for VoidRef
35207 where
35208 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35209 {
35210 #[inline]
35211 fn encode(
35212 self,
35213 encoder_: &mut ___E,
35214 out_: &mut ::core::mem::MaybeUninit<crate::wire::VoidRef>,
35215 _: (),
35216 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35217 ::fidl_next::munge! {
35218 let crate::wire::VoidRef {
35219
35220 _empty,
35221
35222
35223 } = out_;
35224 }
35225
35226 Ok(())
35227 }
35228 }
35229
35230 pub struct EnvironmentRef {}
35231
35232 unsafe impl<___E> ::fidl_next::Encode<crate::wire::EnvironmentRef, ___E> for EnvironmentRef
35233 where
35234 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35235 {
35236 #[inline]
35237 fn encode(
35238 self,
35239 encoder_: &mut ___E,
35240 out_: &mut ::core::mem::MaybeUninit<crate::wire::EnvironmentRef>,
35241 _: (),
35242 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35243 ::fidl_next::munge! {
35244 let crate::wire::EnvironmentRef {
35245
35246 _empty,
35247
35248
35249 } = out_;
35250 }
35251
35252 Ok(())
35253 }
35254 }
35255
35256 pub struct NameMapping<T0, T1> {
35257 pub source_name: T0,
35258
35259 pub target_name: T1,
35260 }
35261
35262 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::NameMapping<'static>, ___E>
35263 for NameMapping<T0, T1>
35264 where
35265 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35266 ___E: ::fidl_next::Encoder,
35267 T0: ::fidl_next::Encode<::fidl_next::WireString<'static>, ___E>,
35268 T1: ::fidl_next::Encode<::fidl_next::WireString<'static>, ___E>,
35269 {
35270 #[inline]
35271 fn encode(
35272 self,
35273 encoder_: &mut ___E,
35274 out_: &mut ::core::mem::MaybeUninit<crate::wire::NameMapping<'static>>,
35275 _: (),
35276 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35277 ::fidl_next::munge! {
35278 let crate::wire::NameMapping {
35279
35280 source_name,
35281 target_name,
35282
35283 } = out_;
35284 }
35285
35286 ::fidl_next::Encode::encode(self.source_name, encoder_, source_name, 100)?;
35287
35288 ::fidl_next::Encode::encode(self.target_name, encoder_, target_name, 100)?;
35289
35290 Ok(())
35291 }
35292 }
35293
35294 pub struct ConfigType<T0, T1, T2> {
35295 pub layout: T0,
35296
35297 pub parameters: T1,
35298
35299 pub constraints: T2,
35300 }
35301
35302 unsafe impl<___E, T0, T1, T2> ::fidl_next::Encode<crate::wire::ConfigType<'static>, ___E>
35303 for ConfigType<T0, T1, T2>
35304 where
35305 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35306 ___E: ::fidl_next::Encoder,
35307 T0: ::fidl_next::Encode<crate::wire::ConfigTypeLayout, ___E>,
35308 T1: ::fidl_next::Encode<
35309 ::fidl_next::WireOptionalVector<'static, crate::wire::LayoutParameter<'static>>,
35310 ___E,
35311 >,
35312 T2: ::fidl_next::Encode<
35313 ::fidl_next::WireVector<'static, crate::wire::LayoutConstraint<'static>>,
35314 ___E,
35315 >,
35316 {
35317 #[inline]
35318 fn encode(
35319 self,
35320 encoder_: &mut ___E,
35321 out_: &mut ::core::mem::MaybeUninit<crate::wire::ConfigType<'static>>,
35322 _: (),
35323 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35324 ::fidl_next::munge! {
35325 let crate::wire::ConfigType {
35326
35327 layout,
35328 parameters,
35329 constraints,
35330
35331 } = out_;
35332 }
35333
35334 ::fidl_next::Encode::encode(self.layout, encoder_, layout, ())?;
35335
35336 ::fidl_next::Encode::encode(self.parameters, encoder_, parameters, (4294967295, ()))?;
35337
35338 ::fidl_next::Encode::encode(self.constraints, encoder_, constraints, (4294967295, ()))?;
35339
35340 Ok(())
35341 }
35342 }
35343
35344 pub struct ResolvedConfigField<T0, T1> {
35345 pub key: T0,
35346
35347 pub value: T1,
35348 }
35349
35350 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::ResolvedConfigField<'static>, ___E>
35351 for ResolvedConfigField<T0, T1>
35352 where
35353 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35354 ___E: ::fidl_next::Encoder,
35355 T0: ::fidl_next::Encode<::fidl_next::WireString<'static>, ___E>,
35356 T1: ::fidl_next::Encode<crate::wire::ConfigValue<'static>, ___E>,
35357 {
35358 #[inline]
35359 fn encode(
35360 self,
35361 encoder_: &mut ___E,
35362 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfigField<'static>>,
35363 _: (),
35364 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35365 ::fidl_next::munge! {
35366 let crate::wire::ResolvedConfigField {
35367
35368 key,
35369 value,
35370
35371 } = out_;
35372 }
35373
35374 ::fidl_next::Encode::encode(self.key, encoder_, key, 4294967295)?;
35375
35376 ::fidl_next::Encode::encode(self.value, encoder_, value, ())?;
35377
35378 Ok(())
35379 }
35380 }
35381
35382 pub struct ResolvedConfig<T0, T1> {
35383 pub fields: T0,
35384
35385 pub checksum: T1,
35386 }
35387
35388 unsafe impl<___E, T0, T1> ::fidl_next::Encode<crate::wire::ResolvedConfig<'static>, ___E>
35389 for ResolvedConfig<T0, T1>
35390 where
35391 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
35392 ___E: ::fidl_next::Encoder,
35393 T0: ::fidl_next::Encode<
35394 ::fidl_next::WireVector<'static, crate::wire::ResolvedConfigField<'static>>,
35395 ___E,
35396 >,
35397 T1: ::fidl_next::Encode<crate::wire::ConfigChecksum<'static>, ___E>,
35398 {
35399 #[inline]
35400 fn encode(
35401 self,
35402 encoder_: &mut ___E,
35403 out_: &mut ::core::mem::MaybeUninit<crate::wire::ResolvedConfig<'static>>,
35404 _: (),
35405 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
35406 ::fidl_next::munge! {
35407 let crate::wire::ResolvedConfig {
35408
35409 fields,
35410 checksum,
35411
35412 } = out_;
35413 }
35414
35415 ::fidl_next::Encode::encode(self.fields, encoder_, fields, (4294967295, ()))?;
35416
35417 ::fidl_next::Encode::encode(self.checksum, encoder_, checksum, ())?;
35418
35419 Ok(())
35420 }
35421 }
35422}
35423
35424pub use self::natural::*;
35425
35426#[doc = " Config keys can only consist of these many bytes\n"]
35427pub const CONFIG_KEY_MAX_SIZE: u32 = 64 as u32;
35428
35429pub const MAX_NAME_LENGTH: u32 = 100 as u32;
35430
35431pub const MAX_PATH_LENGTH: u32 = 1024 as u32;
35432
35433pub const MAX_CHILD_NAME_LENGTH: u32 = 1024 as u32;
35434
35435pub const MAX_URL_SCHEME_LENGTH: u32 = 100 as u32;
35436
35437pub const MAX_MONIKER_LENGTH: u32 = 4096 as u32;
35438
35439#[doc = " The maximum number of EventSubscriptions in an EventStream.\n"]
35440pub const MAX_NUM_EVENT_STREAM_SUBSCRIPTIONS: u64 = 100 as u64;
35441
35442pub mod compat {
35444
35445 impl ::fidl_next::CompatFrom<crate::AllowedOffers>
35446 for ::fidl_fuchsia_component_decl::AllowedOffers
35447 {
35448 fn compat_from(value: crate::AllowedOffers) -> Self {
35449 match value {
35450 crate::AllowedOffers::StaticOnly => Self::StaticOnly,
35451
35452 crate::AllowedOffers::StaticAndDynamic => Self::StaticAndDynamic,
35453 }
35454 }
35455 }
35456
35457 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::AllowedOffers>
35458 for crate::AllowedOffers
35459 {
35460 fn compat_from(value: ::fidl_fuchsia_component_decl::AllowedOffers) -> Self {
35461 match value {
35462 ::fidl_fuchsia_component_decl::AllowedOffers::StaticOnly => Self::StaticOnly,
35463
35464 ::fidl_fuchsia_component_decl::AllowedOffers::StaticAndDynamic => {
35465 Self::StaticAndDynamic
35466 }
35467 }
35468 }
35469 }
35470
35471 impl ::fidl_next::CompatFrom<crate::Availability> for ::fidl_fuchsia_component_decl::Availability {
35472 fn compat_from(value: crate::Availability) -> Self {
35473 match value {
35474 crate::Availability::Required => Self::Required,
35475
35476 crate::Availability::Optional => Self::Optional,
35477
35478 crate::Availability::SameAsTarget => Self::SameAsTarget,
35479
35480 crate::Availability::Transitional => Self::Transitional,
35481 }
35482 }
35483 }
35484
35485 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Availability> for crate::Availability {
35486 fn compat_from(value: ::fidl_fuchsia_component_decl::Availability) -> Self {
35487 match value {
35488 ::fidl_fuchsia_component_decl::Availability::Required => Self::Required,
35489
35490 ::fidl_fuchsia_component_decl::Availability::Optional => Self::Optional,
35491
35492 ::fidl_fuchsia_component_decl::Availability::SameAsTarget => Self::SameAsTarget,
35493
35494 ::fidl_fuchsia_component_decl::Availability::Transitional => Self::Transitional,
35495 }
35496 }
35497 }
35498
35499 impl ::fidl_next::CompatFrom<crate::Service> for ::fidl_fuchsia_component_decl::Service {
35500 fn compat_from(value: crate::Service) -> Self {
35501 Self {
35502 name: ::fidl_next::CompatFrom::compat_from(value.name),
35503
35504 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
35505
35506 __source_breaking: ::fidl::marker::SourceBreaking,
35507 }
35508 }
35509 }
35510
35511 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Service> for crate::Service {
35512 fn compat_from(value: ::fidl_fuchsia_component_decl::Service) -> Self {
35513 Self {
35514 name: ::fidl_next::CompatFrom::compat_from(value.name),
35515
35516 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
35517 }
35518 }
35519 }
35520
35521 impl ::fidl_next::CompatFrom<crate::Directory> for ::fidl_fuchsia_component_decl::Directory {
35522 fn compat_from(value: crate::Directory) -> Self {
35523 Self {
35524 name: ::fidl_next::CompatFrom::compat_from(value.name),
35525
35526 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
35527
35528 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
35529
35530 __source_breaking: ::fidl::marker::SourceBreaking,
35531 }
35532 }
35533 }
35534
35535 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Directory> for crate::Directory {
35536 fn compat_from(value: ::fidl_fuchsia_component_decl::Directory) -> Self {
35537 Self {
35538 name: ::fidl_next::CompatFrom::compat_from(value.name),
35539
35540 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
35541
35542 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
35543 }
35544 }
35545 }
35546
35547 impl ::fidl_next::CompatFrom<crate::ParentRef> for ::fidl_fuchsia_component_decl::ParentRef {
35548 #[inline]
35549 fn compat_from(value: crate::ParentRef) -> Self {
35550 Self {}
35551 }
35552 }
35553
35554 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ParentRef> for crate::ParentRef {
35555 #[inline]
35556 fn compat_from(value: ::fidl_fuchsia_component_decl::ParentRef) -> Self {
35557 Self {}
35558 }
35559 }
35560
35561 impl ::fidl_next::CompatFrom<crate::SelfRef> for ::fidl_fuchsia_component_decl::SelfRef {
35562 #[inline]
35563 fn compat_from(value: crate::SelfRef) -> Self {
35564 Self {}
35565 }
35566 }
35567
35568 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::SelfRef> for crate::SelfRef {
35569 #[inline]
35570 fn compat_from(value: ::fidl_fuchsia_component_decl::SelfRef) -> Self {
35571 Self {}
35572 }
35573 }
35574
35575 impl ::fidl_next::CompatFrom<crate::ChildRef> for ::fidl_fuchsia_component_decl::ChildRef {
35576 #[inline]
35577 fn compat_from(value: crate::ChildRef) -> Self {
35578 Self {
35579 name: ::fidl_next::CompatFrom::compat_from(value.name),
35580
35581 collection: ::fidl_next::CompatFrom::compat_from(value.collection),
35582 }
35583 }
35584 }
35585
35586 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ChildRef> for crate::ChildRef {
35587 #[inline]
35588 fn compat_from(value: ::fidl_fuchsia_component_decl::ChildRef) -> Self {
35589 Self {
35590 name: ::fidl_next::CompatFrom::compat_from(value.name),
35591
35592 collection: ::fidl_next::CompatFrom::compat_from(value.collection),
35593 }
35594 }
35595 }
35596
35597 impl ::fidl_next::CompatFrom<crate::CollectionRef>
35598 for ::fidl_fuchsia_component_decl::CollectionRef
35599 {
35600 #[inline]
35601 fn compat_from(value: crate::CollectionRef) -> Self {
35602 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
35603 }
35604 }
35605
35606 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::CollectionRef>
35607 for crate::CollectionRef
35608 {
35609 #[inline]
35610 fn compat_from(value: ::fidl_fuchsia_component_decl::CollectionRef) -> Self {
35611 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
35612 }
35613 }
35614
35615 impl ::fidl_next::CompatFrom<crate::FrameworkRef> for ::fidl_fuchsia_component_decl::FrameworkRef {
35616 #[inline]
35617 fn compat_from(value: crate::FrameworkRef) -> Self {
35618 Self {}
35619 }
35620 }
35621
35622 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::FrameworkRef> for crate::FrameworkRef {
35623 #[inline]
35624 fn compat_from(value: ::fidl_fuchsia_component_decl::FrameworkRef) -> Self {
35625 Self {}
35626 }
35627 }
35628
35629 impl ::fidl_next::CompatFrom<crate::CapabilityRef>
35630 for ::fidl_fuchsia_component_decl::CapabilityRef
35631 {
35632 #[inline]
35633 fn compat_from(value: crate::CapabilityRef) -> Self {
35634 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
35635 }
35636 }
35637
35638 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::CapabilityRef>
35639 for crate::CapabilityRef
35640 {
35641 #[inline]
35642 fn compat_from(value: ::fidl_fuchsia_component_decl::CapabilityRef) -> Self {
35643 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
35644 }
35645 }
35646
35647 impl ::fidl_next::CompatFrom<crate::DebugRef> for ::fidl_fuchsia_component_decl::DebugRef {
35648 #[inline]
35649 fn compat_from(value: crate::DebugRef) -> Self {
35650 Self {}
35651 }
35652 }
35653
35654 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DebugRef> for crate::DebugRef {
35655 #[inline]
35656 fn compat_from(value: ::fidl_fuchsia_component_decl::DebugRef) -> Self {
35657 Self {}
35658 }
35659 }
35660
35661 impl ::fidl_next::CompatFrom<crate::VoidRef> for ::fidl_fuchsia_component_decl::VoidRef {
35662 #[inline]
35663 fn compat_from(value: crate::VoidRef) -> Self {
35664 Self {}
35665 }
35666 }
35667
35668 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::VoidRef> for crate::VoidRef {
35669 #[inline]
35670 fn compat_from(value: ::fidl_fuchsia_component_decl::VoidRef) -> Self {
35671 Self {}
35672 }
35673 }
35674
35675 impl ::fidl_next::CompatFrom<crate::StorageId> for ::fidl_fuchsia_component_decl::StorageId {
35676 fn compat_from(value: crate::StorageId) -> Self {
35677 match value {
35678 crate::StorageId::StaticInstanceId => Self::StaticInstanceId,
35679
35680 crate::StorageId::StaticInstanceIdOrMoniker => Self::StaticInstanceIdOrMoniker,
35681 }
35682 }
35683 }
35684
35685 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::StorageId> for crate::StorageId {
35686 fn compat_from(value: ::fidl_fuchsia_component_decl::StorageId) -> Self {
35687 match value {
35688 ::fidl_fuchsia_component_decl::StorageId::StaticInstanceId => {
35689 Self::StaticInstanceId
35690 }
35691
35692 ::fidl_fuchsia_component_decl::StorageId::StaticInstanceIdOrMoniker => {
35693 Self::StaticInstanceIdOrMoniker
35694 }
35695 }
35696 }
35697 }
35698
35699 impl ::fidl_next::CompatFrom<crate::Runner> for ::fidl_fuchsia_component_decl::Runner {
35700 fn compat_from(value: crate::Runner) -> Self {
35701 Self {
35702 name: ::fidl_next::CompatFrom::compat_from(value.name),
35703
35704 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
35705
35706 __source_breaking: ::fidl::marker::SourceBreaking,
35707 }
35708 }
35709 }
35710
35711 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Runner> for crate::Runner {
35712 fn compat_from(value: ::fidl_fuchsia_component_decl::Runner) -> Self {
35713 Self {
35714 name: ::fidl_next::CompatFrom::compat_from(value.name),
35715
35716 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
35717 }
35718 }
35719 }
35720
35721 impl ::fidl_next::CompatFrom<crate::Resolver> for ::fidl_fuchsia_component_decl::Resolver {
35722 fn compat_from(value: crate::Resolver) -> Self {
35723 Self {
35724 name: ::fidl_next::CompatFrom::compat_from(value.name),
35725
35726 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
35727
35728 __source_breaking: ::fidl::marker::SourceBreaking,
35729 }
35730 }
35731 }
35732
35733 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Resolver> for crate::Resolver {
35734 fn compat_from(value: ::fidl_fuchsia_component_decl::Resolver) -> Self {
35735 Self {
35736 name: ::fidl_next::CompatFrom::compat_from(value.name),
35737
35738 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
35739 }
35740 }
35741 }
35742
35743 impl ::fidl_next::CompatFrom<crate::EventStream> for ::fidl_fuchsia_component_decl::EventStream {
35744 fn compat_from(value: crate::EventStream) -> Self {
35745 Self {
35746 name: ::fidl_next::CompatFrom::compat_from(value.name),
35747
35748 __source_breaking: ::fidl::marker::SourceBreaking,
35749 }
35750 }
35751 }
35752
35753 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::EventStream> for crate::EventStream {
35754 fn compat_from(value: ::fidl_fuchsia_component_decl::EventStream) -> Self {
35755 Self { name: ::fidl_next::CompatFrom::compat_from(value.name) }
35756 }
35757 }
35758
35759 impl ::fidl_next::CompatFrom<crate::ConfigSingleValue>
35760 for ::fidl_fuchsia_component_decl::ConfigSingleValue
35761 {
35762 fn compat_from(value: crate::ConfigSingleValue) -> Self {
35763 match value {
35764 crate::ConfigSingleValue::Bool(value) => {
35765 Self::Bool(::fidl_next::CompatFrom::compat_from(value))
35766 }
35767
35768 crate::ConfigSingleValue::Uint8(value) => {
35769 Self::Uint8(::fidl_next::CompatFrom::compat_from(value))
35770 }
35771
35772 crate::ConfigSingleValue::Uint16(value) => {
35773 Self::Uint16(::fidl_next::CompatFrom::compat_from(value))
35774 }
35775
35776 crate::ConfigSingleValue::Uint32(value) => {
35777 Self::Uint32(::fidl_next::CompatFrom::compat_from(value))
35778 }
35779
35780 crate::ConfigSingleValue::Uint64(value) => {
35781 Self::Uint64(::fidl_next::CompatFrom::compat_from(value))
35782 }
35783
35784 crate::ConfigSingleValue::Int8(value) => {
35785 Self::Int8(::fidl_next::CompatFrom::compat_from(value))
35786 }
35787
35788 crate::ConfigSingleValue::Int16(value) => {
35789 Self::Int16(::fidl_next::CompatFrom::compat_from(value))
35790 }
35791
35792 crate::ConfigSingleValue::Int32(value) => {
35793 Self::Int32(::fidl_next::CompatFrom::compat_from(value))
35794 }
35795
35796 crate::ConfigSingleValue::Int64(value) => {
35797 Self::Int64(::fidl_next::CompatFrom::compat_from(value))
35798 }
35799
35800 crate::ConfigSingleValue::String(value) => {
35801 Self::String(::fidl_next::CompatFrom::compat_from(value))
35802 }
35803
35804 crate::ConfigSingleValue::UnknownOrdinal_(unknown_ordinal) => {
35805 Self::__SourceBreaking { unknown_ordinal }
35806 }
35807 }
35808 }
35809 }
35810
35811 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigSingleValue>
35812 for crate::ConfigSingleValue
35813 {
35814 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigSingleValue) -> Self {
35815 match value {
35816 ::fidl_fuchsia_component_decl::ConfigSingleValue::Bool(value) => {
35817 Self::Bool(::fidl_next::CompatFrom::compat_from(value))
35818 }
35819
35820 ::fidl_fuchsia_component_decl::ConfigSingleValue::Uint8(value) => {
35821 Self::Uint8(::fidl_next::CompatFrom::compat_from(value))
35822 }
35823
35824 ::fidl_fuchsia_component_decl::ConfigSingleValue::Uint16(value) => {
35825 Self::Uint16(::fidl_next::CompatFrom::compat_from(value))
35826 }
35827
35828 ::fidl_fuchsia_component_decl::ConfigSingleValue::Uint32(value) => {
35829 Self::Uint32(::fidl_next::CompatFrom::compat_from(value))
35830 }
35831
35832 ::fidl_fuchsia_component_decl::ConfigSingleValue::Uint64(value) => {
35833 Self::Uint64(::fidl_next::CompatFrom::compat_from(value))
35834 }
35835
35836 ::fidl_fuchsia_component_decl::ConfigSingleValue::Int8(value) => {
35837 Self::Int8(::fidl_next::CompatFrom::compat_from(value))
35838 }
35839
35840 ::fidl_fuchsia_component_decl::ConfigSingleValue::Int16(value) => {
35841 Self::Int16(::fidl_next::CompatFrom::compat_from(value))
35842 }
35843
35844 ::fidl_fuchsia_component_decl::ConfigSingleValue::Int32(value) => {
35845 Self::Int32(::fidl_next::CompatFrom::compat_from(value))
35846 }
35847
35848 ::fidl_fuchsia_component_decl::ConfigSingleValue::Int64(value) => {
35849 Self::Int64(::fidl_next::CompatFrom::compat_from(value))
35850 }
35851
35852 ::fidl_fuchsia_component_decl::ConfigSingleValue::String(value) => {
35853 Self::String(::fidl_next::CompatFrom::compat_from(value))
35854 }
35855
35856 ::fidl_fuchsia_component_decl::ConfigSingleValue::__SourceBreaking {
35857 unknown_ordinal,
35858 } => Self::UnknownOrdinal_(unknown_ordinal),
35859 }
35860 }
35861 }
35862
35863 impl ::fidl_next::CompatFrom<crate::ConfigVectorValue>
35864 for ::fidl_fuchsia_component_decl::ConfigVectorValue
35865 {
35866 fn compat_from(value: crate::ConfigVectorValue) -> Self {
35867 match value {
35868 crate::ConfigVectorValue::BoolVector(value) => {
35869 Self::BoolVector(::fidl_next::CompatFrom::compat_from(value))
35870 }
35871
35872 crate::ConfigVectorValue::Uint8Vector(value) => {
35873 Self::Uint8Vector(::fidl_next::CompatFrom::compat_from(value))
35874 }
35875
35876 crate::ConfigVectorValue::Uint16Vector(value) => {
35877 Self::Uint16Vector(::fidl_next::CompatFrom::compat_from(value))
35878 }
35879
35880 crate::ConfigVectorValue::Uint32Vector(value) => {
35881 Self::Uint32Vector(::fidl_next::CompatFrom::compat_from(value))
35882 }
35883
35884 crate::ConfigVectorValue::Uint64Vector(value) => {
35885 Self::Uint64Vector(::fidl_next::CompatFrom::compat_from(value))
35886 }
35887
35888 crate::ConfigVectorValue::Int8Vector(value) => {
35889 Self::Int8Vector(::fidl_next::CompatFrom::compat_from(value))
35890 }
35891
35892 crate::ConfigVectorValue::Int16Vector(value) => {
35893 Self::Int16Vector(::fidl_next::CompatFrom::compat_from(value))
35894 }
35895
35896 crate::ConfigVectorValue::Int32Vector(value) => {
35897 Self::Int32Vector(::fidl_next::CompatFrom::compat_from(value))
35898 }
35899
35900 crate::ConfigVectorValue::Int64Vector(value) => {
35901 Self::Int64Vector(::fidl_next::CompatFrom::compat_from(value))
35902 }
35903
35904 crate::ConfigVectorValue::StringVector(value) => {
35905 Self::StringVector(::fidl_next::CompatFrom::compat_from(value))
35906 }
35907
35908 crate::ConfigVectorValue::UnknownOrdinal_(unknown_ordinal) => {
35909 Self::__SourceBreaking { unknown_ordinal }
35910 }
35911 }
35912 }
35913 }
35914
35915 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigVectorValue>
35916 for crate::ConfigVectorValue
35917 {
35918 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigVectorValue) -> Self {
35919 match value {
35920 ::fidl_fuchsia_component_decl::ConfigVectorValue::BoolVector(value) => {
35921 Self::BoolVector(::fidl_next::CompatFrom::compat_from(value))
35922 }
35923
35924 ::fidl_fuchsia_component_decl::ConfigVectorValue::Uint8Vector(value) => {
35925 Self::Uint8Vector(::fidl_next::CompatFrom::compat_from(value))
35926 }
35927
35928 ::fidl_fuchsia_component_decl::ConfigVectorValue::Uint16Vector(value) => {
35929 Self::Uint16Vector(::fidl_next::CompatFrom::compat_from(value))
35930 }
35931
35932 ::fidl_fuchsia_component_decl::ConfigVectorValue::Uint32Vector(value) => {
35933 Self::Uint32Vector(::fidl_next::CompatFrom::compat_from(value))
35934 }
35935
35936 ::fidl_fuchsia_component_decl::ConfigVectorValue::Uint64Vector(value) => {
35937 Self::Uint64Vector(::fidl_next::CompatFrom::compat_from(value))
35938 }
35939
35940 ::fidl_fuchsia_component_decl::ConfigVectorValue::Int8Vector(value) => {
35941 Self::Int8Vector(::fidl_next::CompatFrom::compat_from(value))
35942 }
35943
35944 ::fidl_fuchsia_component_decl::ConfigVectorValue::Int16Vector(value) => {
35945 Self::Int16Vector(::fidl_next::CompatFrom::compat_from(value))
35946 }
35947
35948 ::fidl_fuchsia_component_decl::ConfigVectorValue::Int32Vector(value) => {
35949 Self::Int32Vector(::fidl_next::CompatFrom::compat_from(value))
35950 }
35951
35952 ::fidl_fuchsia_component_decl::ConfigVectorValue::Int64Vector(value) => {
35953 Self::Int64Vector(::fidl_next::CompatFrom::compat_from(value))
35954 }
35955
35956 ::fidl_fuchsia_component_decl::ConfigVectorValue::StringVector(value) => {
35957 Self::StringVector(::fidl_next::CompatFrom::compat_from(value))
35958 }
35959
35960 ::fidl_fuchsia_component_decl::ConfigVectorValue::__SourceBreaking {
35961 unknown_ordinal,
35962 } => Self::UnknownOrdinal_(unknown_ordinal),
35963 }
35964 }
35965 }
35966
35967 impl ::fidl_next::CompatFrom<crate::ConfigValue> for ::fidl_fuchsia_component_decl::ConfigValue {
35968 fn compat_from(value: crate::ConfigValue) -> Self {
35969 match value {
35970 crate::ConfigValue::Single(value) => {
35971 Self::Single(::fidl_next::CompatFrom::compat_from(value))
35972 }
35973
35974 crate::ConfigValue::Vector(value) => {
35975 Self::Vector(::fidl_next::CompatFrom::compat_from(value))
35976 }
35977
35978 crate::ConfigValue::UnknownOrdinal_(unknown_ordinal) => {
35979 Self::__SourceBreaking { unknown_ordinal }
35980 }
35981 }
35982 }
35983 }
35984
35985 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigValue> for crate::ConfigValue {
35986 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigValue) -> Self {
35987 match value {
35988 ::fidl_fuchsia_component_decl::ConfigValue::Single(value) => {
35989 Self::Single(::fidl_next::CompatFrom::compat_from(value))
35990 }
35991
35992 ::fidl_fuchsia_component_decl::ConfigValue::Vector(value) => {
35993 Self::Vector(::fidl_next::CompatFrom::compat_from(value))
35994 }
35995
35996 ::fidl_fuchsia_component_decl::ConfigValue::__SourceBreaking {
35997 unknown_ordinal,
35998 } => Self::UnknownOrdinal_(unknown_ordinal),
35999 }
36000 }
36001 }
36002
36003 impl ::fidl_next::CompatFrom<crate::Configuration>
36004 for ::fidl_fuchsia_component_decl::Configuration
36005 {
36006 fn compat_from(value: crate::Configuration) -> Self {
36007 Self {
36008 name: ::fidl_next::CompatFrom::compat_from(value.name),
36009
36010 value: ::fidl_next::CompatFrom::compat_from(value.value),
36011
36012 __source_breaking: ::fidl::marker::SourceBreaking,
36013 }
36014 }
36015 }
36016
36017 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Configuration>
36018 for crate::Configuration
36019 {
36020 fn compat_from(value: ::fidl_fuchsia_component_decl::Configuration) -> Self {
36021 Self {
36022 name: ::fidl_next::CompatFrom::compat_from(value.name),
36023
36024 value: ::fidl_next::CompatFrom::compat_from(value.value),
36025 }
36026 }
36027 }
36028
36029 impl ::fidl_next::CompatFrom<crate::DeliveryType> for ::fidl_fuchsia_component_decl::DeliveryType {
36030 fn compat_from(value: crate::DeliveryType) -> Self {
36031 match value {
36032 crate::DeliveryType::Immediate => Self::Immediate,
36033
36034 crate::DeliveryType::OnReadable => Self::OnReadable,
36035
36036 crate::DeliveryType::UnknownOrdinal_(unknown_ordinal) => {
36037 Self::__SourceBreaking { unknown_ordinal }
36038 }
36039 }
36040 }
36041 }
36042
36043 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DeliveryType> for crate::DeliveryType {
36044 fn compat_from(value: ::fidl_fuchsia_component_decl::DeliveryType) -> Self {
36045 match value {
36046 ::fidl_fuchsia_component_decl::DeliveryType::Immediate => Self::Immediate,
36047
36048 ::fidl_fuchsia_component_decl::DeliveryType::OnReadable => Self::OnReadable,
36049
36050 ::fidl_fuchsia_component_decl::DeliveryType::__SourceBreaking {
36051 unknown_ordinal: value,
36052 } => Self::UnknownOrdinal_(value),
36053 }
36054 }
36055 }
36056
36057 impl ::fidl_next::CompatFrom<crate::Protocol> for ::fidl_fuchsia_component_decl::Protocol {
36058 fn compat_from(value: crate::Protocol) -> Self {
36059 Self {
36060 name: ::fidl_next::CompatFrom::compat_from(value.name),
36061
36062 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
36063
36064 delivery: ::fidl_next::CompatFrom::compat_from(value.delivery),
36065
36066 __source_breaking: ::fidl::marker::SourceBreaking,
36067 }
36068 }
36069 }
36070
36071 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Protocol> for crate::Protocol {
36072 fn compat_from(value: ::fidl_fuchsia_component_decl::Protocol) -> Self {
36073 Self {
36074 name: ::fidl_next::CompatFrom::compat_from(value.name),
36075
36076 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
36077
36078 delivery: ::fidl_next::CompatFrom::compat_from(value.delivery),
36079 }
36080 }
36081 }
36082
36083 impl ::fidl_next::CompatFrom<crate::EnvironmentRef>
36084 for ::fidl_fuchsia_component_decl::EnvironmentRef
36085 {
36086 #[inline]
36087 fn compat_from(value: crate::EnvironmentRef) -> Self {
36088 Self {}
36089 }
36090 }
36091
36092 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::EnvironmentRef>
36093 for crate::EnvironmentRef
36094 {
36095 #[inline]
36096 fn compat_from(value: ::fidl_fuchsia_component_decl::EnvironmentRef) -> Self {
36097 Self {}
36098 }
36099 }
36100
36101 impl ::fidl_next::CompatFrom<crate::Ref> for ::fidl_fuchsia_component_decl::Ref {
36102 fn compat_from(value: crate::Ref) -> Self {
36103 match value {
36104 crate::Ref::Parent(value) => {
36105 Self::Parent(::fidl_next::CompatFrom::compat_from(value))
36106 }
36107
36108 crate::Ref::Self_(value) => {
36109 Self::Self_(::fidl_next::CompatFrom::compat_from(value))
36110 }
36111
36112 crate::Ref::Child(value) => {
36113 Self::Child(::fidl_next::CompatFrom::compat_from(value))
36114 }
36115
36116 crate::Ref::Collection(value) => {
36117 Self::Collection(::fidl_next::CompatFrom::compat_from(value))
36118 }
36119
36120 crate::Ref::Framework(value) => {
36121 Self::Framework(::fidl_next::CompatFrom::compat_from(value))
36122 }
36123
36124 crate::Ref::Capability(value) => {
36125 Self::Capability(::fidl_next::CompatFrom::compat_from(value))
36126 }
36127
36128 crate::Ref::Debug(value) => {
36129 Self::Debug(::fidl_next::CompatFrom::compat_from(value))
36130 }
36131
36132 crate::Ref::VoidType(value) => {
36133 Self::VoidType(::fidl_next::CompatFrom::compat_from(value))
36134 }
36135
36136 crate::Ref::Environment(value) => {
36137 Self::Environment(::fidl_next::CompatFrom::compat_from(value))
36138 }
36139
36140 crate::Ref::UnknownOrdinal_(unknown_ordinal) => {
36141 Self::__SourceBreaking { unknown_ordinal }
36142 }
36143 }
36144 }
36145 }
36146
36147 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Ref> for crate::Ref {
36148 fn compat_from(value: ::fidl_fuchsia_component_decl::Ref) -> Self {
36149 match value {
36150 ::fidl_fuchsia_component_decl::Ref::Parent(value) => {
36151 Self::Parent(::fidl_next::CompatFrom::compat_from(value))
36152 }
36153
36154 ::fidl_fuchsia_component_decl::Ref::Self_(value) => {
36155 Self::Self_(::fidl_next::CompatFrom::compat_from(value))
36156 }
36157
36158 ::fidl_fuchsia_component_decl::Ref::Child(value) => {
36159 Self::Child(::fidl_next::CompatFrom::compat_from(value))
36160 }
36161
36162 ::fidl_fuchsia_component_decl::Ref::Collection(value) => {
36163 Self::Collection(::fidl_next::CompatFrom::compat_from(value))
36164 }
36165
36166 ::fidl_fuchsia_component_decl::Ref::Framework(value) => {
36167 Self::Framework(::fidl_next::CompatFrom::compat_from(value))
36168 }
36169
36170 ::fidl_fuchsia_component_decl::Ref::Capability(value) => {
36171 Self::Capability(::fidl_next::CompatFrom::compat_from(value))
36172 }
36173
36174 ::fidl_fuchsia_component_decl::Ref::Debug(value) => {
36175 Self::Debug(::fidl_next::CompatFrom::compat_from(value))
36176 }
36177
36178 ::fidl_fuchsia_component_decl::Ref::VoidType(value) => {
36179 Self::VoidType(::fidl_next::CompatFrom::compat_from(value))
36180 }
36181
36182 ::fidl_fuchsia_component_decl::Ref::Environment(value) => {
36183 Self::Environment(::fidl_next::CompatFrom::compat_from(value))
36184 }
36185
36186 ::fidl_fuchsia_component_decl::Ref::__SourceBreaking { unknown_ordinal } => {
36187 Self::UnknownOrdinal_(unknown_ordinal)
36188 }
36189 }
36190 }
36191 }
36192
36193 impl ::fidl_next::CompatFrom<crate::Storage> for ::fidl_fuchsia_component_decl::Storage {
36194 fn compat_from(value: crate::Storage) -> Self {
36195 Self {
36196 name: ::fidl_next::CompatFrom::compat_from(value.name),
36197
36198 source: ::fidl_next::CompatFrom::compat_from(value.source),
36199
36200 backing_dir: ::fidl_next::CompatFrom::compat_from(value.backing_dir),
36201
36202 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
36203
36204 storage_id: ::fidl_next::CompatFrom::compat_from(value.storage_id),
36205
36206 __source_breaking: ::fidl::marker::SourceBreaking,
36207 }
36208 }
36209 }
36210
36211 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Storage> for crate::Storage {
36212 fn compat_from(value: ::fidl_fuchsia_component_decl::Storage) -> Self {
36213 Self {
36214 name: ::fidl_next::CompatFrom::compat_from(value.name),
36215
36216 source: ::fidl_next::CompatFrom::compat_from(value.source),
36217
36218 backing_dir: ::fidl_next::CompatFrom::compat_from(value.backing_dir),
36219
36220 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
36221
36222 storage_id: ::fidl_next::CompatFrom::compat_from(value.storage_id),
36223 }
36224 }
36225 }
36226
36227 impl ::fidl_next::CompatFrom<crate::Dictionary> for ::fidl_fuchsia_component_decl::Dictionary {
36228 fn compat_from(value: crate::Dictionary) -> Self {
36229 Self {
36230 name: ::fidl_next::CompatFrom::compat_from(value.name),
36231
36232 source: ::fidl_next::CompatFrom::compat_from(value.source),
36233
36234 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
36235
36236 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
36237
36238 __source_breaking: ::fidl::marker::SourceBreaking,
36239 }
36240 }
36241 }
36242
36243 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Dictionary> for crate::Dictionary {
36244 fn compat_from(value: ::fidl_fuchsia_component_decl::Dictionary) -> Self {
36245 Self {
36246 name: ::fidl_next::CompatFrom::compat_from(value.name),
36247
36248 source: ::fidl_next::CompatFrom::compat_from(value.source),
36249
36250 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
36251
36252 source_path: ::fidl_next::CompatFrom::compat_from(value.source_path),
36253 }
36254 }
36255 }
36256
36257 impl ::fidl_next::CompatFrom<crate::Capability> for ::fidl_fuchsia_component_decl::Capability {
36258 fn compat_from(value: crate::Capability) -> Self {
36259 match value {
36260 crate::Capability::Service(value) => {
36261 Self::Service(::fidl_next::CompatFrom::compat_from(value))
36262 }
36263
36264 crate::Capability::Protocol(value) => {
36265 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
36266 }
36267
36268 crate::Capability::Directory(value) => {
36269 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
36270 }
36271
36272 crate::Capability::Storage(value) => {
36273 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
36274 }
36275
36276 crate::Capability::Runner(value) => {
36277 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
36278 }
36279
36280 crate::Capability::Resolver(value) => {
36281 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
36282 }
36283
36284 crate::Capability::EventStream(value) => {
36285 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
36286 }
36287
36288 crate::Capability::Dictionary(value) => {
36289 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
36290 }
36291
36292 crate::Capability::Config(value) => {
36293 Self::Config(::fidl_next::CompatFrom::compat_from(value))
36294 }
36295
36296 crate::Capability::UnknownOrdinal_(unknown_ordinal) => {
36297 Self::__SourceBreaking { unknown_ordinal }
36298 }
36299 }
36300 }
36301 }
36302
36303 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Capability> for crate::Capability {
36304 fn compat_from(value: ::fidl_fuchsia_component_decl::Capability) -> Self {
36305 match value {
36306 ::fidl_fuchsia_component_decl::Capability::Service(value) => {
36307 Self::Service(::fidl_next::CompatFrom::compat_from(value))
36308 }
36309
36310 ::fidl_fuchsia_component_decl::Capability::Protocol(value) => {
36311 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
36312 }
36313
36314 ::fidl_fuchsia_component_decl::Capability::Directory(value) => {
36315 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
36316 }
36317
36318 ::fidl_fuchsia_component_decl::Capability::Storage(value) => {
36319 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
36320 }
36321
36322 ::fidl_fuchsia_component_decl::Capability::Runner(value) => {
36323 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
36324 }
36325
36326 ::fidl_fuchsia_component_decl::Capability::Resolver(value) => {
36327 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
36328 }
36329
36330 ::fidl_fuchsia_component_decl::Capability::EventStream(value) => {
36331 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
36332 }
36333
36334 ::fidl_fuchsia_component_decl::Capability::Dictionary(value) => {
36335 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
36336 }
36337
36338 ::fidl_fuchsia_component_decl::Capability::Config(value) => {
36339 Self::Config(::fidl_next::CompatFrom::compat_from(value))
36340 }
36341
36342 ::fidl_fuchsia_component_decl::Capability::__SourceBreaking { unknown_ordinal } => {
36343 Self::UnknownOrdinal_(unknown_ordinal)
36344 }
36345 }
36346 }
36347 }
36348
36349 impl ::fidl_next::CompatFrom<crate::StartupMode> for ::fidl_fuchsia_component_decl::StartupMode {
36350 fn compat_from(value: crate::StartupMode) -> Self {
36351 match value {
36352 crate::StartupMode::Lazy => Self::Lazy,
36353
36354 crate::StartupMode::Eager => Self::Eager,
36355 }
36356 }
36357 }
36358
36359 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::StartupMode> for crate::StartupMode {
36360 fn compat_from(value: ::fidl_fuchsia_component_decl::StartupMode) -> Self {
36361 match value {
36362 ::fidl_fuchsia_component_decl::StartupMode::Lazy => Self::Lazy,
36363
36364 ::fidl_fuchsia_component_decl::StartupMode::Eager => Self::Eager,
36365 }
36366 }
36367 }
36368
36369 impl ::fidl_next::CompatFrom<crate::OnTerminate> for ::fidl_fuchsia_component_decl::OnTerminate {
36370 fn compat_from(value: crate::OnTerminate) -> Self {
36371 match value {
36372 crate::OnTerminate::None => Self::None,
36373
36374 crate::OnTerminate::Reboot => Self::Reboot,
36375 }
36376 }
36377 }
36378
36379 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OnTerminate> for crate::OnTerminate {
36380 fn compat_from(value: ::fidl_fuchsia_component_decl::OnTerminate) -> Self {
36381 match value {
36382 ::fidl_fuchsia_component_decl::OnTerminate::None => Self::None,
36383
36384 ::fidl_fuchsia_component_decl::OnTerminate::Reboot => Self::Reboot,
36385 }
36386 }
36387 }
36388
36389 impl ::fidl_next::CompatFrom<crate::ConfigOverride>
36390 for ::fidl_fuchsia_component_decl::ConfigOverride
36391 {
36392 fn compat_from(value: crate::ConfigOverride) -> Self {
36393 Self {
36394 key: ::fidl_next::CompatFrom::compat_from(value.key),
36395
36396 value: ::fidl_next::CompatFrom::compat_from(value.value),
36397
36398 __source_breaking: ::fidl::marker::SourceBreaking,
36399 }
36400 }
36401 }
36402
36403 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigOverride>
36404 for crate::ConfigOverride
36405 {
36406 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigOverride) -> Self {
36407 Self {
36408 key: ::fidl_next::CompatFrom::compat_from(value.key),
36409
36410 value: ::fidl_next::CompatFrom::compat_from(value.value),
36411 }
36412 }
36413 }
36414
36415 impl ::fidl_next::CompatFrom<crate::Child> for ::fidl_fuchsia_component_decl::Child {
36416 fn compat_from(value: crate::Child) -> Self {
36417 Self {
36418 name: ::fidl_next::CompatFrom::compat_from(value.name),
36419
36420 url: ::fidl_next::CompatFrom::compat_from(value.url),
36421
36422 startup: ::fidl_next::CompatFrom::compat_from(value.startup),
36423
36424 environment: ::fidl_next::CompatFrom::compat_from(value.environment),
36425
36426 on_terminate: ::fidl_next::CompatFrom::compat_from(value.on_terminate),
36427
36428 config_overrides: ::fidl_next::CompatFrom::compat_from(value.config_overrides),
36429
36430 __source_breaking: ::fidl::marker::SourceBreaking,
36431 }
36432 }
36433 }
36434
36435 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Child> for crate::Child {
36436 fn compat_from(value: ::fidl_fuchsia_component_decl::Child) -> Self {
36437 Self {
36438 name: ::fidl_next::CompatFrom::compat_from(value.name),
36439
36440 url: ::fidl_next::CompatFrom::compat_from(value.url),
36441
36442 startup: ::fidl_next::CompatFrom::compat_from(value.startup),
36443
36444 environment: ::fidl_next::CompatFrom::compat_from(value.environment),
36445
36446 on_terminate: ::fidl_next::CompatFrom::compat_from(value.on_terminate),
36447
36448 config_overrides: ::fidl_next::CompatFrom::compat_from(value.config_overrides),
36449 }
36450 }
36451 }
36452
36453 impl ::fidl_next::CompatFrom<crate::Durability> for ::fidl_fuchsia_component_decl::Durability {
36454 fn compat_from(value: crate::Durability) -> Self {
36455 match value {
36456 crate::Durability::Transient => Self::Transient,
36457
36458 crate::Durability::SingleRun => Self::SingleRun,
36459 }
36460 }
36461 }
36462
36463 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Durability> for crate::Durability {
36464 fn compat_from(value: ::fidl_fuchsia_component_decl::Durability) -> Self {
36465 match value {
36466 ::fidl_fuchsia_component_decl::Durability::Transient => Self::Transient,
36467
36468 ::fidl_fuchsia_component_decl::Durability::SingleRun => Self::SingleRun,
36469 }
36470 }
36471 }
36472
36473 impl ::fidl_next::CompatFrom<crate::Collection> for ::fidl_fuchsia_component_decl::Collection {
36474 fn compat_from(value: crate::Collection) -> Self {
36475 Self {
36476 name: ::fidl_next::CompatFrom::compat_from(value.name),
36477
36478 durability: ::fidl_next::CompatFrom::compat_from(value.durability),
36479
36480 environment: ::fidl_next::CompatFrom::compat_from(value.environment),
36481
36482 allowed_offers: ::fidl_next::CompatFrom::compat_from(value.allowed_offers),
36483
36484 allow_long_names: ::fidl_next::CompatFrom::compat_from(value.allow_long_names),
36485
36486 persistent_storage: ::fidl_next::CompatFrom::compat_from(value.persistent_storage),
36487
36488 __source_breaking: ::fidl::marker::SourceBreaking,
36489 }
36490 }
36491 }
36492
36493 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Collection> for crate::Collection {
36494 fn compat_from(value: ::fidl_fuchsia_component_decl::Collection) -> Self {
36495 Self {
36496 name: ::fidl_next::CompatFrom::compat_from(value.name),
36497
36498 durability: ::fidl_next::CompatFrom::compat_from(value.durability),
36499
36500 environment: ::fidl_next::CompatFrom::compat_from(value.environment),
36501
36502 allowed_offers: ::fidl_next::CompatFrom::compat_from(value.allowed_offers),
36503
36504 allow_long_names: ::fidl_next::CompatFrom::compat_from(value.allow_long_names),
36505
36506 persistent_storage: ::fidl_next::CompatFrom::compat_from(value.persistent_storage),
36507 }
36508 }
36509 }
36510
36511 impl ::fidl_next::CompatFrom<crate::DependencyType>
36512 for ::fidl_fuchsia_component_decl::DependencyType
36513 {
36514 fn compat_from(value: crate::DependencyType) -> Self {
36515 match value {
36516 crate::DependencyType::Strong => Self::Strong,
36517
36518 crate::DependencyType::Weak => Self::Weak,
36519 }
36520 }
36521 }
36522
36523 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DependencyType>
36524 for crate::DependencyType
36525 {
36526 fn compat_from(value: ::fidl_fuchsia_component_decl::DependencyType) -> Self {
36527 match value {
36528 ::fidl_fuchsia_component_decl::DependencyType::Strong => Self::Strong,
36529
36530 ::fidl_fuchsia_component_decl::DependencyType::Weak => Self::Weak,
36531 }
36532 }
36533 }
36534
36535 impl ::fidl_next::CompatFrom<crate::NameMapping> for ::fidl_fuchsia_component_decl::NameMapping {
36536 #[inline]
36537 fn compat_from(value: crate::NameMapping) -> Self {
36538 Self {
36539 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
36540
36541 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
36542 }
36543 }
36544 }
36545
36546 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::NameMapping> for crate::NameMapping {
36547 #[inline]
36548 fn compat_from(value: ::fidl_fuchsia_component_decl::NameMapping) -> Self {
36549 Self {
36550 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
36551
36552 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
36553 }
36554 }
36555 }
36556
36557 impl ::fidl_next::CompatFrom<crate::EnvironmentExtends>
36558 for ::fidl_fuchsia_component_decl::EnvironmentExtends
36559 {
36560 fn compat_from(value: crate::EnvironmentExtends) -> Self {
36561 match value {
36562 crate::EnvironmentExtends::None => Self::None,
36563
36564 crate::EnvironmentExtends::Realm => Self::Realm,
36565 }
36566 }
36567 }
36568
36569 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::EnvironmentExtends>
36570 for crate::EnvironmentExtends
36571 {
36572 fn compat_from(value: ::fidl_fuchsia_component_decl::EnvironmentExtends) -> Self {
36573 match value {
36574 ::fidl_fuchsia_component_decl::EnvironmentExtends::None => Self::None,
36575
36576 ::fidl_fuchsia_component_decl::EnvironmentExtends::Realm => Self::Realm,
36577 }
36578 }
36579 }
36580
36581 impl ::fidl_next::CompatFrom<crate::ConfigTypeLayout>
36582 for ::fidl_fuchsia_component_decl::ConfigTypeLayout
36583 {
36584 fn compat_from(value: crate::ConfigTypeLayout) -> Self {
36585 match value {
36586 crate::ConfigTypeLayout::Bool => Self::Bool,
36587
36588 crate::ConfigTypeLayout::Uint8 => Self::Uint8,
36589
36590 crate::ConfigTypeLayout::Uint16 => Self::Uint16,
36591
36592 crate::ConfigTypeLayout::Uint32 => Self::Uint32,
36593
36594 crate::ConfigTypeLayout::Uint64 => Self::Uint64,
36595
36596 crate::ConfigTypeLayout::Int8 => Self::Int8,
36597
36598 crate::ConfigTypeLayout::Int16 => Self::Int16,
36599
36600 crate::ConfigTypeLayout::Int32 => Self::Int32,
36601
36602 crate::ConfigTypeLayout::Int64 => Self::Int64,
36603
36604 crate::ConfigTypeLayout::String => Self::String,
36605
36606 crate::ConfigTypeLayout::Vector => Self::Vector,
36607
36608 crate::ConfigTypeLayout::UnknownOrdinal_(unknown_ordinal) => {
36609 Self::__SourceBreaking { unknown_ordinal }
36610 }
36611 }
36612 }
36613 }
36614
36615 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigTypeLayout>
36616 for crate::ConfigTypeLayout
36617 {
36618 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigTypeLayout) -> Self {
36619 match value {
36620 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Bool => Self::Bool,
36621
36622 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Uint8 => Self::Uint8,
36623
36624 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Uint16 => Self::Uint16,
36625
36626 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Uint32 => Self::Uint32,
36627
36628 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Uint64 => Self::Uint64,
36629
36630 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Int8 => Self::Int8,
36631
36632 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Int16 => Self::Int16,
36633
36634 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Int32 => Self::Int32,
36635
36636 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Int64 => Self::Int64,
36637
36638 ::fidl_fuchsia_component_decl::ConfigTypeLayout::String => Self::String,
36639
36640 ::fidl_fuchsia_component_decl::ConfigTypeLayout::Vector => Self::Vector,
36641
36642 ::fidl_fuchsia_component_decl::ConfigTypeLayout::__SourceBreaking {
36643 unknown_ordinal: value,
36644 } => Self::UnknownOrdinal_(value),
36645 }
36646 }
36647 }
36648
36649 impl ::fidl_next::CompatFrom<crate::LayoutConstraint>
36650 for ::fidl_fuchsia_component_decl::LayoutConstraint
36651 {
36652 fn compat_from(value: crate::LayoutConstraint) -> Self {
36653 match value {
36654 crate::LayoutConstraint::MaxSize(value) => {
36655 Self::MaxSize(::fidl_next::CompatFrom::compat_from(value))
36656 }
36657
36658 crate::LayoutConstraint::UnknownOrdinal_(unknown_ordinal) => {
36659 Self::__SourceBreaking { unknown_ordinal }
36660 }
36661 }
36662 }
36663 }
36664
36665 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::LayoutConstraint>
36666 for crate::LayoutConstraint
36667 {
36668 fn compat_from(value: ::fidl_fuchsia_component_decl::LayoutConstraint) -> Self {
36669 match value {
36670 ::fidl_fuchsia_component_decl::LayoutConstraint::MaxSize(value) => {
36671 Self::MaxSize(::fidl_next::CompatFrom::compat_from(value))
36672 }
36673
36674 ::fidl_fuchsia_component_decl::LayoutConstraint::__SourceBreaking {
36675 unknown_ordinal,
36676 } => Self::UnknownOrdinal_(unknown_ordinal),
36677 }
36678 }
36679 }
36680
36681 impl ::fidl_next::CompatFrom<crate::ConfigType> for ::fidl_fuchsia_component_decl::ConfigType {
36682 #[inline]
36683 fn compat_from(value: crate::ConfigType) -> Self {
36684 Self {
36685 layout: ::fidl_next::CompatFrom::compat_from(value.layout),
36686
36687 parameters: ::fidl_next::CompatFrom::compat_from(value.parameters),
36688
36689 constraints: ::fidl_next::CompatFrom::compat_from(value.constraints),
36690 }
36691 }
36692 }
36693
36694 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigType> for crate::ConfigType {
36695 #[inline]
36696 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigType) -> Self {
36697 Self {
36698 layout: ::fidl_next::CompatFrom::compat_from(value.layout),
36699
36700 parameters: ::fidl_next::CompatFrom::compat_from(value.parameters),
36701
36702 constraints: ::fidl_next::CompatFrom::compat_from(value.constraints),
36703 }
36704 }
36705 }
36706
36707 impl ::fidl_next::CompatFrom<crate::ConfigChecksum>
36708 for ::fidl_fuchsia_component_decl::ConfigChecksum
36709 {
36710 fn compat_from(value: crate::ConfigChecksum) -> Self {
36711 match value {
36712 crate::ConfigChecksum::Sha256(value) => {
36713 Self::Sha256(::fidl_next::CompatFrom::compat_from(value))
36714 }
36715
36716 crate::ConfigChecksum::UnknownOrdinal_(unknown_ordinal) => {
36717 Self::__SourceBreaking { unknown_ordinal }
36718 }
36719 }
36720 }
36721 }
36722
36723 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigChecksum>
36724 for crate::ConfigChecksum
36725 {
36726 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigChecksum) -> Self {
36727 match value {
36728 ::fidl_fuchsia_component_decl::ConfigChecksum::Sha256(value) => {
36729 Self::Sha256(::fidl_next::CompatFrom::compat_from(value))
36730 }
36731
36732 ::fidl_fuchsia_component_decl::ConfigChecksum::__SourceBreaking {
36733 unknown_ordinal,
36734 } => Self::UnknownOrdinal_(unknown_ordinal),
36735 }
36736 }
36737 }
36738
36739 impl ::fidl_next::CompatFrom<crate::UseStorage> for ::fidl_fuchsia_component_decl::UseStorage {
36740 fn compat_from(value: crate::UseStorage) -> Self {
36741 Self {
36742 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
36743
36744 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
36745
36746 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
36747
36748 __source_breaking: ::fidl::marker::SourceBreaking,
36749 }
36750 }
36751 }
36752
36753 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseStorage> for crate::UseStorage {
36754 fn compat_from(value: ::fidl_fuchsia_component_decl::UseStorage) -> Self {
36755 Self {
36756 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
36757
36758 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
36759
36760 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
36761 }
36762 }
36763 }
36764
36765 impl ::fidl_next::CompatFrom<crate::ConfigMutability>
36766 for ::fidl_fuchsia_component_decl::ConfigMutability
36767 {
36768 fn compat_from(value: crate::ConfigMutability) -> Self {
36769 Self::from_bits_retain(value.bits())
36770 }
36771 }
36772
36773 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigMutability>
36774 for crate::ConfigMutability
36775 {
36776 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigMutability) -> Self {
36777 Self::from_bits_retain(value.bits())
36778 }
36779 }
36780
36781 impl ::fidl_next::CompatFrom<crate::ConfigField> for ::fidl_fuchsia_component_decl::ConfigField {
36782 fn compat_from(value: crate::ConfigField) -> Self {
36783 Self {
36784 key: ::fidl_next::CompatFrom::compat_from(value.key),
36785
36786 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
36787
36788 mutability: ::fidl_next::CompatFrom::compat_from(value.mutability),
36789
36790 __source_breaking: ::fidl::marker::SourceBreaking,
36791 }
36792 }
36793 }
36794
36795 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigField> for crate::ConfigField {
36796 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigField) -> Self {
36797 Self {
36798 key: ::fidl_next::CompatFrom::compat_from(value.key),
36799
36800 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
36801
36802 mutability: ::fidl_next::CompatFrom::compat_from(value.mutability),
36803 }
36804 }
36805 }
36806
36807 impl ::fidl_next::CompatFrom<crate::Program> for ::fidl_fuchsia_component_decl::Program {
36808 fn compat_from(value: crate::Program) -> Self {
36809 Self {
36810 runner: ::fidl_next::CompatFrom::compat_from(value.runner),
36811
36812 info: ::fidl_next::CompatFrom::compat_from(value.info),
36813
36814 __source_breaking: ::fidl::marker::SourceBreaking,
36815 }
36816 }
36817 }
36818
36819 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Program> for crate::Program {
36820 fn compat_from(value: ::fidl_fuchsia_component_decl::Program) -> Self {
36821 Self {
36822 runner: ::fidl_next::CompatFrom::compat_from(value.runner),
36823
36824 info: ::fidl_next::CompatFrom::compat_from(value.info),
36825 }
36826 }
36827 }
36828
36829 impl ::fidl_next::CompatFrom<crate::UseService> for ::fidl_fuchsia_component_decl::UseService {
36830 fn compat_from(value: crate::UseService) -> Self {
36831 Self {
36832 source: ::fidl_next::CompatFrom::compat_from(value.source),
36833
36834 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
36835
36836 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
36837
36838 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
36839
36840 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
36841
36842 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
36843
36844 __source_breaking: ::fidl::marker::SourceBreaking,
36845 }
36846 }
36847 }
36848
36849 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseService> for crate::UseService {
36850 fn compat_from(value: ::fidl_fuchsia_component_decl::UseService) -> Self {
36851 Self {
36852 source: ::fidl_next::CompatFrom::compat_from(value.source),
36853
36854 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
36855
36856 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
36857
36858 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
36859
36860 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
36861
36862 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
36863 }
36864 }
36865 }
36866
36867 impl ::fidl_next::CompatFrom<crate::UseProtocol> for ::fidl_fuchsia_component_decl::UseProtocol {
36868 fn compat_from(value: crate::UseProtocol) -> Self {
36869 Self {
36870 source: ::fidl_next::CompatFrom::compat_from(value.source),
36871
36872 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
36873
36874 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
36875
36876 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
36877
36878 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
36879
36880 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
36881
36882 numbered_handle: ::fidl_next::CompatFrom::compat_from(value.numbered_handle),
36883
36884 __source_breaking: ::fidl::marker::SourceBreaking,
36885 }
36886 }
36887 }
36888
36889 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseProtocol> for crate::UseProtocol {
36890 fn compat_from(value: ::fidl_fuchsia_component_decl::UseProtocol) -> Self {
36891 Self {
36892 source: ::fidl_next::CompatFrom::compat_from(value.source),
36893
36894 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
36895
36896 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
36897
36898 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
36899
36900 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
36901
36902 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
36903
36904 numbered_handle: ::fidl_next::CompatFrom::compat_from(value.numbered_handle),
36905 }
36906 }
36907 }
36908
36909 impl ::fidl_next::CompatFrom<crate::UseDirectory> for ::fidl_fuchsia_component_decl::UseDirectory {
36910 fn compat_from(value: crate::UseDirectory) -> Self {
36911 Self {
36912 source: ::fidl_next::CompatFrom::compat_from(value.source),
36913
36914 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
36915
36916 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
36917
36918 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
36919
36920 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
36921
36922 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
36923
36924 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
36925
36926 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
36927
36928 __source_breaking: ::fidl::marker::SourceBreaking,
36929 }
36930 }
36931 }
36932
36933 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseDirectory> for crate::UseDirectory {
36934 fn compat_from(value: ::fidl_fuchsia_component_decl::UseDirectory) -> Self {
36935 Self {
36936 source: ::fidl_next::CompatFrom::compat_from(value.source),
36937
36938 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
36939
36940 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
36941
36942 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
36943
36944 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
36945
36946 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
36947
36948 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
36949
36950 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
36951 }
36952 }
36953 }
36954
36955 impl ::fidl_next::CompatFrom<crate::UseEventStream>
36956 for ::fidl_fuchsia_component_decl::UseEventStream
36957 {
36958 fn compat_from(value: crate::UseEventStream) -> Self {
36959 Self {
36960 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
36961
36962 source: ::fidl_next::CompatFrom::compat_from(value.source),
36963
36964 scope: ::fidl_next::CompatFrom::compat_from(value.scope),
36965
36966 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
36967
36968 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
36969
36970 filter: ::fidl_next::CompatFrom::compat_from(value.filter),
36971
36972 __source_breaking: ::fidl::marker::SourceBreaking,
36973 }
36974 }
36975 }
36976
36977 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseEventStream>
36978 for crate::UseEventStream
36979 {
36980 fn compat_from(value: ::fidl_fuchsia_component_decl::UseEventStream) -> Self {
36981 Self {
36982 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
36983
36984 source: ::fidl_next::CompatFrom::compat_from(value.source),
36985
36986 scope: ::fidl_next::CompatFrom::compat_from(value.scope),
36987
36988 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
36989
36990 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
36991
36992 filter: ::fidl_next::CompatFrom::compat_from(value.filter),
36993 }
36994 }
36995 }
36996
36997 impl ::fidl_next::CompatFrom<crate::UseRunner> for ::fidl_fuchsia_component_decl::UseRunner {
36998 fn compat_from(value: crate::UseRunner) -> Self {
36999 Self {
37000 source: ::fidl_next::CompatFrom::compat_from(value.source),
37001
37002 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37003
37004 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37005
37006 __source_breaking: ::fidl::marker::SourceBreaking,
37007 }
37008 }
37009 }
37010
37011 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseRunner> for crate::UseRunner {
37012 fn compat_from(value: ::fidl_fuchsia_component_decl::UseRunner) -> Self {
37013 Self {
37014 source: ::fidl_next::CompatFrom::compat_from(value.source),
37015
37016 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37017
37018 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37019 }
37020 }
37021 }
37022
37023 impl ::fidl_next::CompatFrom<crate::UseConfiguration>
37024 for ::fidl_fuchsia_component_decl::UseConfiguration
37025 {
37026 fn compat_from(value: crate::UseConfiguration) -> Self {
37027 Self {
37028 source: ::fidl_next::CompatFrom::compat_from(value.source),
37029
37030 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37031
37032 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37033
37034 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37035
37036 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
37037
37038 default: ::fidl_next::CompatFrom::compat_from(value.default),
37039
37040 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37041
37042 __source_breaking: ::fidl::marker::SourceBreaking,
37043 }
37044 }
37045 }
37046
37047 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseConfiguration>
37048 for crate::UseConfiguration
37049 {
37050 fn compat_from(value: ::fidl_fuchsia_component_decl::UseConfiguration) -> Self {
37051 Self {
37052 source: ::fidl_next::CompatFrom::compat_from(value.source),
37053
37054 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37055
37056 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37057
37058 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37059
37060 type_: ::fidl_next::CompatFrom::compat_from(value.type_),
37061
37062 default: ::fidl_next::CompatFrom::compat_from(value.default),
37063
37064 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37065 }
37066 }
37067 }
37068
37069 impl ::fidl_next::CompatFrom<crate::UseDictionary>
37070 for ::fidl_fuchsia_component_decl::UseDictionary
37071 {
37072 fn compat_from(value: crate::UseDictionary) -> Self {
37073 Self {
37074 source: ::fidl_next::CompatFrom::compat_from(value.source),
37075
37076 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37077
37078 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
37079
37080 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
37081
37082 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37083
37084 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37085
37086 __source_breaking: ::fidl::marker::SourceBreaking,
37087 }
37088 }
37089 }
37090
37091 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::UseDictionary>
37092 for crate::UseDictionary
37093 {
37094 fn compat_from(value: ::fidl_fuchsia_component_decl::UseDictionary) -> Self {
37095 Self {
37096 source: ::fidl_next::CompatFrom::compat_from(value.source),
37097
37098 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37099
37100 target_path: ::fidl_next::CompatFrom::compat_from(value.target_path),
37101
37102 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
37103
37104 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37105
37106 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37107 }
37108 }
37109 }
37110
37111 impl ::fidl_next::CompatFrom<crate::Use> for ::fidl_fuchsia_component_decl::Use {
37112 fn compat_from(value: crate::Use) -> Self {
37113 match value {
37114 crate::Use::Service(value) => {
37115 Self::Service(::fidl_next::CompatFrom::compat_from(value))
37116 }
37117
37118 crate::Use::Protocol(value) => {
37119 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
37120 }
37121
37122 crate::Use::Directory(value) => {
37123 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
37124 }
37125
37126 crate::Use::Storage(value) => {
37127 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
37128 }
37129
37130 crate::Use::EventStream(value) => {
37131 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
37132 }
37133
37134 crate::Use::Runner(value) => {
37135 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
37136 }
37137
37138 crate::Use::Config(value) => {
37139 Self::Config(::fidl_next::CompatFrom::compat_from(value))
37140 }
37141
37142 crate::Use::Dictionary(value) => {
37143 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
37144 }
37145
37146 crate::Use::UnknownOrdinal_(unknown_ordinal) => {
37147 Self::__SourceBreaking { unknown_ordinal }
37148 }
37149 }
37150 }
37151 }
37152
37153 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Use> for crate::Use {
37154 fn compat_from(value: ::fidl_fuchsia_component_decl::Use) -> Self {
37155 match value {
37156 ::fidl_fuchsia_component_decl::Use::Service(value) => {
37157 Self::Service(::fidl_next::CompatFrom::compat_from(value))
37158 }
37159
37160 ::fidl_fuchsia_component_decl::Use::Protocol(value) => {
37161 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
37162 }
37163
37164 ::fidl_fuchsia_component_decl::Use::Directory(value) => {
37165 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
37166 }
37167
37168 ::fidl_fuchsia_component_decl::Use::Storage(value) => {
37169 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
37170 }
37171
37172 ::fidl_fuchsia_component_decl::Use::EventStream(value) => {
37173 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
37174 }
37175
37176 ::fidl_fuchsia_component_decl::Use::Runner(value) => {
37177 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
37178 }
37179
37180 ::fidl_fuchsia_component_decl::Use::Config(value) => {
37181 Self::Config(::fidl_next::CompatFrom::compat_from(value))
37182 }
37183
37184 ::fidl_fuchsia_component_decl::Use::Dictionary(value) => {
37185 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
37186 }
37187
37188 ::fidl_fuchsia_component_decl::Use::__SourceBreaking { unknown_ordinal } => {
37189 Self::UnknownOrdinal_(unknown_ordinal)
37190 }
37191 }
37192 }
37193 }
37194
37195 impl ::fidl_next::CompatFrom<crate::ExposeService>
37196 for ::fidl_fuchsia_component_decl::ExposeService
37197 {
37198 fn compat_from(value: crate::ExposeService) -> Self {
37199 Self {
37200 source: ::fidl_next::CompatFrom::compat_from(value.source),
37201
37202 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37203
37204 target: ::fidl_next::CompatFrom::compat_from(value.target),
37205
37206 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37207
37208 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37209
37210 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37211
37212 __source_breaking: ::fidl::marker::SourceBreaking,
37213 }
37214 }
37215 }
37216
37217 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeService>
37218 for crate::ExposeService
37219 {
37220 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeService) -> Self {
37221 Self {
37222 source: ::fidl_next::CompatFrom::compat_from(value.source),
37223
37224 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37225
37226 target: ::fidl_next::CompatFrom::compat_from(value.target),
37227
37228 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37229
37230 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37231
37232 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37233 }
37234 }
37235 }
37236
37237 impl ::fidl_next::CompatFrom<crate::ExposeProtocol>
37238 for ::fidl_fuchsia_component_decl::ExposeProtocol
37239 {
37240 fn compat_from(value: crate::ExposeProtocol) -> Self {
37241 Self {
37242 source: ::fidl_next::CompatFrom::compat_from(value.source),
37243
37244 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37245
37246 target: ::fidl_next::CompatFrom::compat_from(value.target),
37247
37248 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37249
37250 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37251
37252 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37253
37254 __source_breaking: ::fidl::marker::SourceBreaking,
37255 }
37256 }
37257 }
37258
37259 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeProtocol>
37260 for crate::ExposeProtocol
37261 {
37262 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeProtocol) -> Self {
37263 Self {
37264 source: ::fidl_next::CompatFrom::compat_from(value.source),
37265
37266 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37267
37268 target: ::fidl_next::CompatFrom::compat_from(value.target),
37269
37270 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37271
37272 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37273
37274 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37275 }
37276 }
37277 }
37278
37279 impl ::fidl_next::CompatFrom<crate::ExposeDirectory>
37280 for ::fidl_fuchsia_component_decl::ExposeDirectory
37281 {
37282 fn compat_from(value: crate::ExposeDirectory) -> Self {
37283 Self {
37284 source: ::fidl_next::CompatFrom::compat_from(value.source),
37285
37286 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37287
37288 target: ::fidl_next::CompatFrom::compat_from(value.target),
37289
37290 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37291
37292 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
37293
37294 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
37295
37296 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37297
37298 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37299
37300 __source_breaking: ::fidl::marker::SourceBreaking,
37301 }
37302 }
37303 }
37304
37305 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeDirectory>
37306 for crate::ExposeDirectory
37307 {
37308 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeDirectory) -> Self {
37309 Self {
37310 source: ::fidl_next::CompatFrom::compat_from(value.source),
37311
37312 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37313
37314 target: ::fidl_next::CompatFrom::compat_from(value.target),
37315
37316 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37317
37318 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
37319
37320 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
37321
37322 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37323
37324 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37325 }
37326 }
37327 }
37328
37329 impl ::fidl_next::CompatFrom<crate::ExposeRunner> for ::fidl_fuchsia_component_decl::ExposeRunner {
37330 fn compat_from(value: crate::ExposeRunner) -> Self {
37331 Self {
37332 source: ::fidl_next::CompatFrom::compat_from(value.source),
37333
37334 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37335
37336 target: ::fidl_next::CompatFrom::compat_from(value.target),
37337
37338 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37339
37340 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37341
37342 __source_breaking: ::fidl::marker::SourceBreaking,
37343 }
37344 }
37345 }
37346
37347 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeRunner> for crate::ExposeRunner {
37348 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeRunner) -> Self {
37349 Self {
37350 source: ::fidl_next::CompatFrom::compat_from(value.source),
37351
37352 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37353
37354 target: ::fidl_next::CompatFrom::compat_from(value.target),
37355
37356 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37357
37358 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37359 }
37360 }
37361 }
37362
37363 impl ::fidl_next::CompatFrom<crate::ExposeResolver>
37364 for ::fidl_fuchsia_component_decl::ExposeResolver
37365 {
37366 fn compat_from(value: crate::ExposeResolver) -> Self {
37367 Self {
37368 source: ::fidl_next::CompatFrom::compat_from(value.source),
37369
37370 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37371
37372 target: ::fidl_next::CompatFrom::compat_from(value.target),
37373
37374 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37375
37376 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37377
37378 __source_breaking: ::fidl::marker::SourceBreaking,
37379 }
37380 }
37381 }
37382
37383 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeResolver>
37384 for crate::ExposeResolver
37385 {
37386 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeResolver) -> Self {
37387 Self {
37388 source: ::fidl_next::CompatFrom::compat_from(value.source),
37389
37390 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37391
37392 target: ::fidl_next::CompatFrom::compat_from(value.target),
37393
37394 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37395
37396 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37397 }
37398 }
37399 }
37400
37401 impl ::fidl_next::CompatFrom<crate::ExposeDictionary>
37402 for ::fidl_fuchsia_component_decl::ExposeDictionary
37403 {
37404 fn compat_from(value: crate::ExposeDictionary) -> Self {
37405 Self {
37406 source: ::fidl_next::CompatFrom::compat_from(value.source),
37407
37408 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37409
37410 target: ::fidl_next::CompatFrom::compat_from(value.target),
37411
37412 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37413
37414 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37415
37416 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37417
37418 __source_breaking: ::fidl::marker::SourceBreaking,
37419 }
37420 }
37421 }
37422
37423 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeDictionary>
37424 for crate::ExposeDictionary
37425 {
37426 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeDictionary) -> Self {
37427 Self {
37428 source: ::fidl_next::CompatFrom::compat_from(value.source),
37429
37430 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37431
37432 target: ::fidl_next::CompatFrom::compat_from(value.target),
37433
37434 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37435
37436 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37437
37438 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37439 }
37440 }
37441 }
37442
37443 impl ::fidl_next::CompatFrom<crate::ExposeConfiguration>
37444 for ::fidl_fuchsia_component_decl::ExposeConfiguration
37445 {
37446 fn compat_from(value: crate::ExposeConfiguration) -> Self {
37447 Self {
37448 source: ::fidl_next::CompatFrom::compat_from(value.source),
37449
37450 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37451
37452 target: ::fidl_next::CompatFrom::compat_from(value.target),
37453
37454 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37455
37456 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37457
37458 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37459
37460 __source_breaking: ::fidl::marker::SourceBreaking,
37461 }
37462 }
37463 }
37464
37465 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ExposeConfiguration>
37466 for crate::ExposeConfiguration
37467 {
37468 fn compat_from(value: ::fidl_fuchsia_component_decl::ExposeConfiguration) -> Self {
37469 Self {
37470 source: ::fidl_next::CompatFrom::compat_from(value.source),
37471
37472 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37473
37474 target: ::fidl_next::CompatFrom::compat_from(value.target),
37475
37476 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37477
37478 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37479
37480 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37481 }
37482 }
37483 }
37484
37485 impl ::fidl_next::CompatFrom<crate::Expose> for ::fidl_fuchsia_component_decl::Expose {
37486 fn compat_from(value: crate::Expose) -> Self {
37487 match value {
37488 crate::Expose::Service(value) => {
37489 Self::Service(::fidl_next::CompatFrom::compat_from(value))
37490 }
37491
37492 crate::Expose::Protocol(value) => {
37493 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
37494 }
37495
37496 crate::Expose::Directory(value) => {
37497 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
37498 }
37499
37500 crate::Expose::Runner(value) => {
37501 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
37502 }
37503
37504 crate::Expose::Resolver(value) => {
37505 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
37506 }
37507
37508 crate::Expose::Dictionary(value) => {
37509 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
37510 }
37511
37512 crate::Expose::Config(value) => {
37513 Self::Config(::fidl_next::CompatFrom::compat_from(value))
37514 }
37515
37516 crate::Expose::UnknownOrdinal_(unknown_ordinal) => {
37517 Self::__SourceBreaking { unknown_ordinal }
37518 }
37519 }
37520 }
37521 }
37522
37523 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Expose> for crate::Expose {
37524 fn compat_from(value: ::fidl_fuchsia_component_decl::Expose) -> Self {
37525 match value {
37526 ::fidl_fuchsia_component_decl::Expose::Service(value) => {
37527 Self::Service(::fidl_next::CompatFrom::compat_from(value))
37528 }
37529
37530 ::fidl_fuchsia_component_decl::Expose::Protocol(value) => {
37531 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
37532 }
37533
37534 ::fidl_fuchsia_component_decl::Expose::Directory(value) => {
37535 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
37536 }
37537
37538 ::fidl_fuchsia_component_decl::Expose::Runner(value) => {
37539 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
37540 }
37541
37542 ::fidl_fuchsia_component_decl::Expose::Resolver(value) => {
37543 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
37544 }
37545
37546 ::fidl_fuchsia_component_decl::Expose::Dictionary(value) => {
37547 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
37548 }
37549
37550 ::fidl_fuchsia_component_decl::Expose::Config(value) => {
37551 Self::Config(::fidl_next::CompatFrom::compat_from(value))
37552 }
37553
37554 ::fidl_fuchsia_component_decl::Expose::__SourceBreaking { unknown_ordinal } => {
37555 Self::UnknownOrdinal_(unknown_ordinal)
37556 }
37557 }
37558 }
37559 }
37560
37561 impl ::fidl_next::CompatFrom<crate::OfferService> for ::fidl_fuchsia_component_decl::OfferService {
37562 fn compat_from(value: crate::OfferService) -> Self {
37563 Self {
37564 source: ::fidl_next::CompatFrom::compat_from(value.source),
37565
37566 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37567
37568 target: ::fidl_next::CompatFrom::compat_from(value.target),
37569
37570 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37571
37572 source_instance_filter: ::fidl_next::CompatFrom::compat_from(
37573 value.source_instance_filter,
37574 ),
37575
37576 renamed_instances: ::fidl_next::CompatFrom::compat_from(value.renamed_instances),
37577
37578 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37579
37580 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37581
37582 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
37583
37584 __source_breaking: ::fidl::marker::SourceBreaking,
37585 }
37586 }
37587 }
37588
37589 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferService> for crate::OfferService {
37590 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferService) -> Self {
37591 Self {
37592 source: ::fidl_next::CompatFrom::compat_from(value.source),
37593
37594 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37595
37596 target: ::fidl_next::CompatFrom::compat_from(value.target),
37597
37598 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37599
37600 source_instance_filter: ::fidl_next::CompatFrom::compat_from(
37601 value.source_instance_filter,
37602 ),
37603
37604 renamed_instances: ::fidl_next::CompatFrom::compat_from(value.renamed_instances),
37605
37606 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37607
37608 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37609
37610 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
37611 }
37612 }
37613 }
37614
37615 impl ::fidl_next::CompatFrom<crate::OfferProtocol>
37616 for ::fidl_fuchsia_component_decl::OfferProtocol
37617 {
37618 fn compat_from(value: crate::OfferProtocol) -> Self {
37619 Self {
37620 source: ::fidl_next::CompatFrom::compat_from(value.source),
37621
37622 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37623
37624 target: ::fidl_next::CompatFrom::compat_from(value.target),
37625
37626 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37627
37628 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
37629
37630 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37631
37632 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37633
37634 __source_breaking: ::fidl::marker::SourceBreaking,
37635 }
37636 }
37637 }
37638
37639 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferProtocol>
37640 for crate::OfferProtocol
37641 {
37642 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferProtocol) -> Self {
37643 Self {
37644 source: ::fidl_next::CompatFrom::compat_from(value.source),
37645
37646 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37647
37648 target: ::fidl_next::CompatFrom::compat_from(value.target),
37649
37650 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37651
37652 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
37653
37654 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37655
37656 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37657 }
37658 }
37659 }
37660
37661 impl ::fidl_next::CompatFrom<crate::OfferDirectory>
37662 for ::fidl_fuchsia_component_decl::OfferDirectory
37663 {
37664 fn compat_from(value: crate::OfferDirectory) -> Self {
37665 Self {
37666 source: ::fidl_next::CompatFrom::compat_from(value.source),
37667
37668 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37669
37670 target: ::fidl_next::CompatFrom::compat_from(value.target),
37671
37672 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37673
37674 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
37675
37676 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
37677
37678 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
37679
37680 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37681
37682 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37683
37684 __source_breaking: ::fidl::marker::SourceBreaking,
37685 }
37686 }
37687 }
37688
37689 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferDirectory>
37690 for crate::OfferDirectory
37691 {
37692 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferDirectory) -> Self {
37693 Self {
37694 source: ::fidl_next::CompatFrom::compat_from(value.source),
37695
37696 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37697
37698 target: ::fidl_next::CompatFrom::compat_from(value.target),
37699
37700 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37701
37702 rights: ::fidl_next::CompatFrom::compat_from(value.rights),
37703
37704 subdir: ::fidl_next::CompatFrom::compat_from(value.subdir),
37705
37706 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
37707
37708 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37709
37710 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37711 }
37712 }
37713 }
37714
37715 impl ::fidl_next::CompatFrom<crate::OfferStorage> for ::fidl_fuchsia_component_decl::OfferStorage {
37716 fn compat_from(value: crate::OfferStorage) -> Self {
37717 Self {
37718 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37719
37720 source: ::fidl_next::CompatFrom::compat_from(value.source),
37721
37722 target: ::fidl_next::CompatFrom::compat_from(value.target),
37723
37724 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37725
37726 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37727
37728 __source_breaking: ::fidl::marker::SourceBreaking,
37729 }
37730 }
37731 }
37732
37733 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferStorage> for crate::OfferStorage {
37734 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferStorage) -> Self {
37735 Self {
37736 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37737
37738 source: ::fidl_next::CompatFrom::compat_from(value.source),
37739
37740 target: ::fidl_next::CompatFrom::compat_from(value.target),
37741
37742 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37743
37744 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37745 }
37746 }
37747 }
37748
37749 impl ::fidl_next::CompatFrom<crate::OfferRunner> for ::fidl_fuchsia_component_decl::OfferRunner {
37750 fn compat_from(value: crate::OfferRunner) -> Self {
37751 Self {
37752 source: ::fidl_next::CompatFrom::compat_from(value.source),
37753
37754 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37755
37756 target: ::fidl_next::CompatFrom::compat_from(value.target),
37757
37758 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37759
37760 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37761
37762 __source_breaking: ::fidl::marker::SourceBreaking,
37763 }
37764 }
37765 }
37766
37767 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferRunner> for crate::OfferRunner {
37768 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferRunner) -> Self {
37769 Self {
37770 source: ::fidl_next::CompatFrom::compat_from(value.source),
37771
37772 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37773
37774 target: ::fidl_next::CompatFrom::compat_from(value.target),
37775
37776 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37777
37778 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37779 }
37780 }
37781 }
37782
37783 impl ::fidl_next::CompatFrom<crate::OfferResolver>
37784 for ::fidl_fuchsia_component_decl::OfferResolver
37785 {
37786 fn compat_from(value: crate::OfferResolver) -> Self {
37787 Self {
37788 source: ::fidl_next::CompatFrom::compat_from(value.source),
37789
37790 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37791
37792 target: ::fidl_next::CompatFrom::compat_from(value.target),
37793
37794 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37795
37796 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37797
37798 __source_breaking: ::fidl::marker::SourceBreaking,
37799 }
37800 }
37801 }
37802
37803 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferResolver>
37804 for crate::OfferResolver
37805 {
37806 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferResolver) -> Self {
37807 Self {
37808 source: ::fidl_next::CompatFrom::compat_from(value.source),
37809
37810 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37811
37812 target: ::fidl_next::CompatFrom::compat_from(value.target),
37813
37814 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37815
37816 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37817 }
37818 }
37819 }
37820
37821 impl ::fidl_next::CompatFrom<crate::OfferEventStream>
37822 for ::fidl_fuchsia_component_decl::OfferEventStream
37823 {
37824 fn compat_from(value: crate::OfferEventStream) -> Self {
37825 Self {
37826 source: ::fidl_next::CompatFrom::compat_from(value.source),
37827
37828 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37829
37830 scope: ::fidl_next::CompatFrom::compat_from(value.scope),
37831
37832 target: ::fidl_next::CompatFrom::compat_from(value.target),
37833
37834 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37835
37836 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37837
37838 __source_breaking: ::fidl::marker::SourceBreaking,
37839 }
37840 }
37841 }
37842
37843 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferEventStream>
37844 for crate::OfferEventStream
37845 {
37846 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferEventStream) -> Self {
37847 Self {
37848 source: ::fidl_next::CompatFrom::compat_from(value.source),
37849
37850 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37851
37852 scope: ::fidl_next::CompatFrom::compat_from(value.scope),
37853
37854 target: ::fidl_next::CompatFrom::compat_from(value.target),
37855
37856 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37857
37858 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37859 }
37860 }
37861 }
37862
37863 impl ::fidl_next::CompatFrom<crate::OfferDictionary>
37864 for ::fidl_fuchsia_component_decl::OfferDictionary
37865 {
37866 fn compat_from(value: crate::OfferDictionary) -> Self {
37867 Self {
37868 source: ::fidl_next::CompatFrom::compat_from(value.source),
37869
37870 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37871
37872 target: ::fidl_next::CompatFrom::compat_from(value.target),
37873
37874 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37875
37876 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
37877
37878 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37879
37880 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37881
37882 __source_breaking: ::fidl::marker::SourceBreaking,
37883 }
37884 }
37885 }
37886
37887 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferDictionary>
37888 for crate::OfferDictionary
37889 {
37890 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferDictionary) -> Self {
37891 Self {
37892 source: ::fidl_next::CompatFrom::compat_from(value.source),
37893
37894 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37895
37896 target: ::fidl_next::CompatFrom::compat_from(value.target),
37897
37898 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37899
37900 dependency_type: ::fidl_next::CompatFrom::compat_from(value.dependency_type),
37901
37902 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37903
37904 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37905 }
37906 }
37907 }
37908
37909 impl ::fidl_next::CompatFrom<crate::OfferConfiguration>
37910 for ::fidl_fuchsia_component_decl::OfferConfiguration
37911 {
37912 fn compat_from(value: crate::OfferConfiguration) -> Self {
37913 Self {
37914 source: ::fidl_next::CompatFrom::compat_from(value.source),
37915
37916 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37917
37918 target: ::fidl_next::CompatFrom::compat_from(value.target),
37919
37920 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37921
37922 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37923
37924 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37925
37926 __source_breaking: ::fidl::marker::SourceBreaking,
37927 }
37928 }
37929 }
37930
37931 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::OfferConfiguration>
37932 for crate::OfferConfiguration
37933 {
37934 fn compat_from(value: ::fidl_fuchsia_component_decl::OfferConfiguration) -> Self {
37935 Self {
37936 source: ::fidl_next::CompatFrom::compat_from(value.source),
37937
37938 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
37939
37940 target: ::fidl_next::CompatFrom::compat_from(value.target),
37941
37942 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
37943
37944 availability: ::fidl_next::CompatFrom::compat_from(value.availability),
37945
37946 source_dictionary: ::fidl_next::CompatFrom::compat_from(value.source_dictionary),
37947 }
37948 }
37949 }
37950
37951 impl ::fidl_next::CompatFrom<crate::Offer> for ::fidl_fuchsia_component_decl::Offer {
37952 fn compat_from(value: crate::Offer) -> Self {
37953 match value {
37954 crate::Offer::Service(value) => {
37955 Self::Service(::fidl_next::CompatFrom::compat_from(value))
37956 }
37957
37958 crate::Offer::Protocol(value) => {
37959 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
37960 }
37961
37962 crate::Offer::Directory(value) => {
37963 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
37964 }
37965
37966 crate::Offer::Storage(value) => {
37967 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
37968 }
37969
37970 crate::Offer::Runner(value) => {
37971 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
37972 }
37973
37974 crate::Offer::Resolver(value) => {
37975 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
37976 }
37977
37978 crate::Offer::EventStream(value) => {
37979 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
37980 }
37981
37982 crate::Offer::Dictionary(value) => {
37983 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
37984 }
37985
37986 crate::Offer::Config(value) => {
37987 Self::Config(::fidl_next::CompatFrom::compat_from(value))
37988 }
37989
37990 crate::Offer::UnknownOrdinal_(unknown_ordinal) => {
37991 Self::__SourceBreaking { unknown_ordinal }
37992 }
37993 }
37994 }
37995 }
37996
37997 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Offer> for crate::Offer {
37998 fn compat_from(value: ::fidl_fuchsia_component_decl::Offer) -> Self {
37999 match value {
38000 ::fidl_fuchsia_component_decl::Offer::Service(value) => {
38001 Self::Service(::fidl_next::CompatFrom::compat_from(value))
38002 }
38003
38004 ::fidl_fuchsia_component_decl::Offer::Protocol(value) => {
38005 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
38006 }
38007
38008 ::fidl_fuchsia_component_decl::Offer::Directory(value) => {
38009 Self::Directory(::fidl_next::CompatFrom::compat_from(value))
38010 }
38011
38012 ::fidl_fuchsia_component_decl::Offer::Storage(value) => {
38013 Self::Storage(::fidl_next::CompatFrom::compat_from(value))
38014 }
38015
38016 ::fidl_fuchsia_component_decl::Offer::Runner(value) => {
38017 Self::Runner(::fidl_next::CompatFrom::compat_from(value))
38018 }
38019
38020 ::fidl_fuchsia_component_decl::Offer::Resolver(value) => {
38021 Self::Resolver(::fidl_next::CompatFrom::compat_from(value))
38022 }
38023
38024 ::fidl_fuchsia_component_decl::Offer::EventStream(value) => {
38025 Self::EventStream(::fidl_next::CompatFrom::compat_from(value))
38026 }
38027
38028 ::fidl_fuchsia_component_decl::Offer::Dictionary(value) => {
38029 Self::Dictionary(::fidl_next::CompatFrom::compat_from(value))
38030 }
38031
38032 ::fidl_fuchsia_component_decl::Offer::Config(value) => {
38033 Self::Config(::fidl_next::CompatFrom::compat_from(value))
38034 }
38035
38036 ::fidl_fuchsia_component_decl::Offer::__SourceBreaking { unknown_ordinal } => {
38037 Self::UnknownOrdinal_(unknown_ordinal)
38038 }
38039 }
38040 }
38041 }
38042
38043 impl ::fidl_next::CompatFrom<crate::RunnerRegistration>
38044 for ::fidl_fuchsia_component_decl::RunnerRegistration
38045 {
38046 fn compat_from(value: crate::RunnerRegistration) -> Self {
38047 Self {
38048 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38049
38050 source: ::fidl_next::CompatFrom::compat_from(value.source),
38051
38052 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38053
38054 __source_breaking: ::fidl::marker::SourceBreaking,
38055 }
38056 }
38057 }
38058
38059 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::RunnerRegistration>
38060 for crate::RunnerRegistration
38061 {
38062 fn compat_from(value: ::fidl_fuchsia_component_decl::RunnerRegistration) -> Self {
38063 Self {
38064 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38065
38066 source: ::fidl_next::CompatFrom::compat_from(value.source),
38067
38068 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38069 }
38070 }
38071 }
38072
38073 impl ::fidl_next::CompatFrom<crate::ResolverRegistration>
38074 for ::fidl_fuchsia_component_decl::ResolverRegistration
38075 {
38076 fn compat_from(value: crate::ResolverRegistration) -> Self {
38077 Self {
38078 resolver: ::fidl_next::CompatFrom::compat_from(value.resolver),
38079
38080 source: ::fidl_next::CompatFrom::compat_from(value.source),
38081
38082 scheme: ::fidl_next::CompatFrom::compat_from(value.scheme),
38083
38084 __source_breaking: ::fidl::marker::SourceBreaking,
38085 }
38086 }
38087 }
38088
38089 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ResolverRegistration>
38090 for crate::ResolverRegistration
38091 {
38092 fn compat_from(value: ::fidl_fuchsia_component_decl::ResolverRegistration) -> Self {
38093 Self {
38094 resolver: ::fidl_next::CompatFrom::compat_from(value.resolver),
38095
38096 source: ::fidl_next::CompatFrom::compat_from(value.source),
38097
38098 scheme: ::fidl_next::CompatFrom::compat_from(value.scheme),
38099 }
38100 }
38101 }
38102
38103 impl ::fidl_next::CompatFrom<crate::DebugProtocolRegistration>
38104 for ::fidl_fuchsia_component_decl::DebugProtocolRegistration
38105 {
38106 fn compat_from(value: crate::DebugProtocolRegistration) -> Self {
38107 Self {
38108 source: ::fidl_next::CompatFrom::compat_from(value.source),
38109
38110 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38111
38112 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38113
38114 __source_breaking: ::fidl::marker::SourceBreaking,
38115 }
38116 }
38117 }
38118
38119 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DebugProtocolRegistration>
38120 for crate::DebugProtocolRegistration
38121 {
38122 fn compat_from(value: ::fidl_fuchsia_component_decl::DebugProtocolRegistration) -> Self {
38123 Self {
38124 source: ::fidl_next::CompatFrom::compat_from(value.source),
38125
38126 source_name: ::fidl_next::CompatFrom::compat_from(value.source_name),
38127
38128 target_name: ::fidl_next::CompatFrom::compat_from(value.target_name),
38129 }
38130 }
38131 }
38132
38133 impl ::fidl_next::CompatFrom<crate::DebugRegistration>
38134 for ::fidl_fuchsia_component_decl::DebugRegistration
38135 {
38136 fn compat_from(value: crate::DebugRegistration) -> Self {
38137 match value {
38138 crate::DebugRegistration::Protocol(value) => {
38139 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
38140 }
38141
38142 crate::DebugRegistration::UnknownOrdinal_(unknown_ordinal) => {
38143 Self::__SourceBreaking { unknown_ordinal }
38144 }
38145 }
38146 }
38147 }
38148
38149 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::DebugRegistration>
38150 for crate::DebugRegistration
38151 {
38152 fn compat_from(value: ::fidl_fuchsia_component_decl::DebugRegistration) -> Self {
38153 match value {
38154 ::fidl_fuchsia_component_decl::DebugRegistration::Protocol(value) => {
38155 Self::Protocol(::fidl_next::CompatFrom::compat_from(value))
38156 }
38157
38158 ::fidl_fuchsia_component_decl::DebugRegistration::__SourceBreaking {
38159 unknown_ordinal,
38160 } => Self::UnknownOrdinal_(unknown_ordinal),
38161 }
38162 }
38163 }
38164
38165 impl ::fidl_next::CompatFrom<crate::Environment> for ::fidl_fuchsia_component_decl::Environment {
38166 fn compat_from(value: crate::Environment) -> Self {
38167 Self {
38168 name: ::fidl_next::CompatFrom::compat_from(value.name),
38169
38170 extends: ::fidl_next::CompatFrom::compat_from(value.extends),
38171
38172 runners: ::fidl_next::CompatFrom::compat_from(value.runners),
38173
38174 resolvers: ::fidl_next::CompatFrom::compat_from(value.resolvers),
38175
38176 debug_capabilities: ::fidl_next::CompatFrom::compat_from(value.debug_capabilities),
38177
38178 stop_timeout_ms: ::fidl_next::CompatFrom::compat_from(value.stop_timeout_ms),
38179
38180 __source_breaking: ::fidl::marker::SourceBreaking,
38181 }
38182 }
38183 }
38184
38185 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Environment> for crate::Environment {
38186 fn compat_from(value: ::fidl_fuchsia_component_decl::Environment) -> Self {
38187 Self {
38188 name: ::fidl_next::CompatFrom::compat_from(value.name),
38189
38190 extends: ::fidl_next::CompatFrom::compat_from(value.extends),
38191
38192 runners: ::fidl_next::CompatFrom::compat_from(value.runners),
38193
38194 resolvers: ::fidl_next::CompatFrom::compat_from(value.resolvers),
38195
38196 debug_capabilities: ::fidl_next::CompatFrom::compat_from(value.debug_capabilities),
38197
38198 stop_timeout_ms: ::fidl_next::CompatFrom::compat_from(value.stop_timeout_ms),
38199 }
38200 }
38201 }
38202
38203 impl ::fidl_next::CompatFrom<crate::ConfigSourceCapabilities>
38204 for ::fidl_fuchsia_component_decl::ConfigSourceCapabilities
38205 {
38206 fn compat_from(value: crate::ConfigSourceCapabilities) -> Self {
38207 Self { __source_breaking: ::fidl::marker::SourceBreaking }
38208 }
38209 }
38210
38211 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigSourceCapabilities>
38212 for crate::ConfigSourceCapabilities
38213 {
38214 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigSourceCapabilities) -> Self {
38215 Self {}
38216 }
38217 }
38218
38219 impl ::fidl_next::CompatFrom<crate::ConfigValueSource>
38220 for ::fidl_fuchsia_component_decl::ConfigValueSource
38221 {
38222 fn compat_from(value: crate::ConfigValueSource) -> Self {
38223 match value {
38224 crate::ConfigValueSource::PackagePath(value) => {
38225 Self::PackagePath(::fidl_next::CompatFrom::compat_from(value))
38226 }
38227
38228 crate::ConfigValueSource::Capabilities(value) => {
38229 Self::Capabilities(::fidl_next::CompatFrom::compat_from(value))
38230 }
38231
38232 crate::ConfigValueSource::UnknownOrdinal_(unknown_ordinal) => {
38233 Self::__SourceBreaking { unknown_ordinal }
38234 }
38235 }
38236 }
38237 }
38238
38239 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigValueSource>
38240 for crate::ConfigValueSource
38241 {
38242 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigValueSource) -> Self {
38243 match value {
38244 ::fidl_fuchsia_component_decl::ConfigValueSource::PackagePath(value) => {
38245 Self::PackagePath(::fidl_next::CompatFrom::compat_from(value))
38246 }
38247
38248 ::fidl_fuchsia_component_decl::ConfigValueSource::Capabilities(value) => {
38249 Self::Capabilities(::fidl_next::CompatFrom::compat_from(value))
38250 }
38251
38252 ::fidl_fuchsia_component_decl::ConfigValueSource::__SourceBreaking {
38253 unknown_ordinal,
38254 } => Self::UnknownOrdinal_(unknown_ordinal),
38255 }
38256 }
38257 }
38258
38259 impl ::fidl_next::CompatFrom<crate::ConfigSchema> for ::fidl_fuchsia_component_decl::ConfigSchema {
38260 fn compat_from(value: crate::ConfigSchema) -> Self {
38261 Self {
38262 fields: ::fidl_next::CompatFrom::compat_from(value.fields),
38263
38264 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
38265
38266 value_source: ::fidl_next::CompatFrom::compat_from(value.value_source),
38267
38268 __source_breaking: ::fidl::marker::SourceBreaking,
38269 }
38270 }
38271 }
38272
38273 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigSchema> for crate::ConfigSchema {
38274 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigSchema) -> Self {
38275 Self {
38276 fields: ::fidl_next::CompatFrom::compat_from(value.fields),
38277
38278 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
38279
38280 value_source: ::fidl_next::CompatFrom::compat_from(value.value_source),
38281 }
38282 }
38283 }
38284
38285 impl ::fidl_next::CompatFrom<crate::Component> for ::fidl_fuchsia_component_decl::Component {
38286 fn compat_from(value: crate::Component) -> Self {
38287 Self {
38288 program: ::fidl_next::CompatFrom::compat_from(value.program),
38289
38290 uses: ::fidl_next::CompatFrom::compat_from(value.uses),
38291
38292 exposes: ::fidl_next::CompatFrom::compat_from(value.exposes),
38293
38294 offers: ::fidl_next::CompatFrom::compat_from(value.offers),
38295
38296 capabilities: ::fidl_next::CompatFrom::compat_from(value.capabilities),
38297
38298 children: ::fidl_next::CompatFrom::compat_from(value.children),
38299
38300 collections: ::fidl_next::CompatFrom::compat_from(value.collections),
38301
38302 environments: ::fidl_next::CompatFrom::compat_from(value.environments),
38303
38304 facets: ::fidl_next::CompatFrom::compat_from(value.facets),
38305
38306 config: ::fidl_next::CompatFrom::compat_from(value.config),
38307
38308 __source_breaking: ::fidl::marker::SourceBreaking,
38309 }
38310 }
38311 }
38312
38313 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::Component> for crate::Component {
38314 fn compat_from(value: ::fidl_fuchsia_component_decl::Component) -> Self {
38315 Self {
38316 program: ::fidl_next::CompatFrom::compat_from(value.program),
38317
38318 uses: ::fidl_next::CompatFrom::compat_from(value.uses),
38319
38320 exposes: ::fidl_next::CompatFrom::compat_from(value.exposes),
38321
38322 offers: ::fidl_next::CompatFrom::compat_from(value.offers),
38323
38324 capabilities: ::fidl_next::CompatFrom::compat_from(value.capabilities),
38325
38326 children: ::fidl_next::CompatFrom::compat_from(value.children),
38327
38328 collections: ::fidl_next::CompatFrom::compat_from(value.collections),
38329
38330 environments: ::fidl_next::CompatFrom::compat_from(value.environments),
38331
38332 facets: ::fidl_next::CompatFrom::compat_from(value.facets),
38333
38334 config: ::fidl_next::CompatFrom::compat_from(value.config),
38335 }
38336 }
38337 }
38338
38339 impl ::fidl_next::CompatFrom<crate::ConfigValueSpec>
38340 for ::fidl_fuchsia_component_decl::ConfigValueSpec
38341 {
38342 fn compat_from(value: crate::ConfigValueSpec) -> Self {
38343 Self {
38344 value: ::fidl_next::CompatFrom::compat_from(value.value),
38345
38346 __source_breaking: ::fidl::marker::SourceBreaking,
38347 }
38348 }
38349 }
38350
38351 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigValueSpec>
38352 for crate::ConfigValueSpec
38353 {
38354 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigValueSpec) -> Self {
38355 Self { value: ::fidl_next::CompatFrom::compat_from(value.value) }
38356 }
38357 }
38358
38359 impl ::fidl_next::CompatFrom<crate::ConfigValuesData>
38360 for ::fidl_fuchsia_component_decl::ConfigValuesData
38361 {
38362 fn compat_from(value: crate::ConfigValuesData) -> Self {
38363 Self {
38364 values: ::fidl_next::CompatFrom::compat_from(value.values),
38365
38366 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
38367
38368 __source_breaking: ::fidl::marker::SourceBreaking,
38369 }
38370 }
38371 }
38372
38373 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ConfigValuesData>
38374 for crate::ConfigValuesData
38375 {
38376 fn compat_from(value: ::fidl_fuchsia_component_decl::ConfigValuesData) -> Self {
38377 Self {
38378 values: ::fidl_next::CompatFrom::compat_from(value.values),
38379
38380 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
38381 }
38382 }
38383 }
38384
38385 impl ::fidl_next::CompatFrom<crate::EventSubscription>
38386 for ::fidl_fuchsia_component_decl::EventSubscription
38387 {
38388 fn compat_from(value: crate::EventSubscription) -> Self {
38389 Self {
38390 event_name: ::fidl_next::CompatFrom::compat_from(value.event_name),
38391
38392 __source_breaking: ::fidl::marker::SourceBreaking,
38393 }
38394 }
38395 }
38396
38397 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::EventSubscription>
38398 for crate::EventSubscription
38399 {
38400 fn compat_from(value: ::fidl_fuchsia_component_decl::EventSubscription) -> Self {
38401 Self { event_name: ::fidl_next::CompatFrom::compat_from(value.event_name) }
38402 }
38403 }
38404
38405 impl ::fidl_next::CompatFrom<crate::LayoutParameter>
38406 for ::fidl_fuchsia_component_decl::LayoutParameter
38407 {
38408 fn compat_from(value: crate::LayoutParameter) -> Self {
38409 match value {
38410 crate::LayoutParameter::NestedType(value) => {
38411 Self::NestedType(::fidl_next::CompatFrom::compat_from(value))
38412 }
38413
38414 crate::LayoutParameter::UnknownOrdinal_(unknown_ordinal) => {
38415 Self::__SourceBreaking { unknown_ordinal }
38416 }
38417 }
38418 }
38419 }
38420
38421 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::LayoutParameter>
38422 for crate::LayoutParameter
38423 {
38424 fn compat_from(value: ::fidl_fuchsia_component_decl::LayoutParameter) -> Self {
38425 match value {
38426 ::fidl_fuchsia_component_decl::LayoutParameter::NestedType(value) => {
38427 Self::NestedType(::fidl_next::CompatFrom::compat_from(value))
38428 }
38429
38430 ::fidl_fuchsia_component_decl::LayoutParameter::__SourceBreaking {
38431 unknown_ordinal,
38432 } => Self::UnknownOrdinal_(unknown_ordinal),
38433 }
38434 }
38435 }
38436
38437 impl ::fidl_next::CompatFrom<crate::ResolvedConfigField>
38438 for ::fidl_fuchsia_component_decl::ResolvedConfigField
38439 {
38440 #[inline]
38441 fn compat_from(value: crate::ResolvedConfigField) -> Self {
38442 Self {
38443 key: ::fidl_next::CompatFrom::compat_from(value.key),
38444
38445 value: ::fidl_next::CompatFrom::compat_from(value.value),
38446 }
38447 }
38448 }
38449
38450 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ResolvedConfigField>
38451 for crate::ResolvedConfigField
38452 {
38453 #[inline]
38454 fn compat_from(value: ::fidl_fuchsia_component_decl::ResolvedConfigField) -> Self {
38455 Self {
38456 key: ::fidl_next::CompatFrom::compat_from(value.key),
38457
38458 value: ::fidl_next::CompatFrom::compat_from(value.value),
38459 }
38460 }
38461 }
38462
38463 impl ::fidl_next::CompatFrom<crate::ResolvedConfig>
38464 for ::fidl_fuchsia_component_decl::ResolvedConfig
38465 {
38466 #[inline]
38467 fn compat_from(value: crate::ResolvedConfig) -> Self {
38468 Self {
38469 fields: ::fidl_next::CompatFrom::compat_from(value.fields),
38470
38471 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
38472 }
38473 }
38474 }
38475
38476 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_decl::ResolvedConfig>
38477 for crate::ResolvedConfig
38478 {
38479 #[inline]
38480 fn compat_from(value: ::fidl_fuchsia_component_decl::ResolvedConfig) -> Self {
38481 Self {
38482 fields: ::fidl_next::CompatFrom::compat_from(value.fields),
38483
38484 checksum: ::fidl_next::CompatFrom::compat_from(value.checksum),
38485 }
38486 }
38487 }
38488}